Index: DCWoRMS/branches/coolemall/src/schedframe/scheduling/tasks/phases/ExecutionPhase.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/scheduling/tasks/phases/ExecutionPhase.java	(revision 1415)
+++ DCWoRMS/branches/coolemall/src/schedframe/scheduling/tasks/phases/ExecutionPhase.java	(revision 1415)
@@ -0,0 +1,87 @@
+package schedframe.scheduling.tasks.phases;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.qcg.broker.schemas.resreqs.ComputingResourceBaseTypeItem;
+import org.qcg.broker.schemas.resreqs.ComputingResourceParameterType;
+import org.qcg.broker.schemas.resreqs.PhaseBehaviourType;
+import org.qcg.broker.schemas.resreqs.StringParameterType;
+
+import org.qcg.broker.schemas.resreqs.ResourceConsumptionType;
+
+public class ExecutionPhase {
+
+	protected String id;
+    protected Map<String, String> referenceHardware;
+    protected long originDuration;
+    protected long lenght;
+    protected List<PhaseSystemLoad> systemLoad;
+    
+    public ExecutionPhase(long duration, ComputingResourceBaseTypeItem item[]){
+    	this.id = null;
+    	this.referenceHardware = null;
+    	this.originDuration = duration;
+    	this.systemLoad = new ArrayList<PhaseSystemLoad>();
+    	for(ComputingResourceBaseTypeItem compResItem: item){
+    		ComputingResourceParameterType hostParameter = compResItem.getHostParameter();
+        	PhaseSystemLoad pb = new PhaseSystemLoad(hostParameter.getName().toString());
+        	systemLoad.add(pb);
+    	}
+    	this.lenght = duration;
+    }
+    
+    public ExecutionPhase(ResourceConsumptionType resConsumptionType){
+    	this.id = resConsumptionType.getId();
+    	this.referenceHardware = new HashMap<String, String>();
+    	this.originDuration = resConsumptionType.getDuration().toLong() / 1000;
+    	
+    	double speed = 1;
+    	if(resConsumptionType.getReferenceHardware() != null){
+        	for (int i = 0; i < resConsumptionType.getReferenceHardware().getReference().length; i++){
+        		StringParameterType spt = resConsumptionType.getReferenceHardware().getReference(i);
+        		this.referenceHardware.put(spt.getName(), spt.getContent());
+            	if(spt.getName().equals("cpu_maxfreq")){
+            		speed = new Double(spt.getContent());
+            	}
+        	}
+    	}
+    	this.systemLoad = new ArrayList<PhaseSystemLoad>();
+    	int nrOfThreads = 1;
+    	for(PhaseBehaviourType pbt: resConsumptionType.getBehaviour()){
+        	PhaseSystemLoad pb = new PhaseSystemLoad(pbt);
+        	this.systemLoad.add(pb);
+        	if(pbt.getName().equals("PM_Threads")){
+        		nrOfThreads = new Double(pbt.getParameterTypeChoice().getParameterTypeChoiceItem(0).getParameterValue().getContent()).intValue();
+        	}
+    	}
+    	this.lenght = (long) (originDuration * nrOfThreads * speed);
+    }
+    
+	public String getId() {
+		return id;
+	}
+
+	public void setId(String id) {
+		this.id = id;
+	}
+
+	public Map<String, String> getReferenceHardware() {
+		return referenceHardware;
+	}
+
+	public long getDuration() {
+		return originDuration;
+	}
+
+	public List<PhaseSystemLoad> getSystemLoad() {
+		return systemLoad;
+	}
+
+	public long getLenght() {
+		return lenght;
+	}
+
+}
Index: DCWoRMS/branches/coolemall/src/schedframe/scheduling/tasks/phases/ExecutionProfile.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/scheduling/tasks/phases/ExecutionProfile.java	(revision 1362)
+++ DCWoRMS/branches/coolemall/src/schedframe/scheduling/tasks/phases/ExecutionProfile.java	(revision 1415)
@@ -5,18 +5,21 @@
 public class ExecutionProfile {
 	
-	protected LinkedList<ResourceConsumption> resourceConsumptionList;
+	protected LinkedList<ExecutionPhase> resourceConsumptionList;
 	protected long usefulWork;
+	protected double completionPercentage;
 	private int currentPhase;
+	
 
-	public ExecutionProfile(LinkedList<ResourceConsumption> resourceConsumptionList) {
+	public ExecutionProfile(LinkedList<ExecutionPhase> resourceConsumptionList) {
 		this.resourceConsumptionList = resourceConsumptionList;
+		this.completionPercentage = 0;
 		this.currentPhase = 0;
 	}
 	
-	public LinkedList<ResourceConsumption> getResourceConsumptionList(){
+	public LinkedList<ExecutionPhase> getResourceConsumptionList(){
 		return resourceConsumptionList;
 	}
 	
-	public ResourceConsumption getCurrentResourceConsumption(){
+	public ExecutionPhase getCurrentResourceConsumption(){
 		return resourceConsumptionList.get(currentPhase);
 	}
@@ -44,3 +47,19 @@
 		return false;
 	}
+
+	public double getCompletionPercentage() {
+		return completionPercentage;
+	}
+
+	public void setCompletionPercentage(double completionPercentage) {
+		this.completionPercentage = completionPercentage;
+	}
+	
+	public long getLength() {
+		long length = 0;
+		for(ExecutionPhase execPhase: resourceConsumptionList){
+			length = length + execPhase.getLenght();
+		}
+		return length;
+	}
 }
Index: DCWoRMS/branches/coolemall/src/schedframe/scheduling/tasks/phases/PhaseSystemLoad.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/scheduling/tasks/phases/PhaseSystemLoad.java	(revision 1415)
+++ DCWoRMS/branches/coolemall/src/schedframe/scheduling/tasks/phases/PhaseSystemLoad.java	(revision 1415)
@@ -0,0 +1,32 @@
+package schedframe.scheduling.tasks.phases;
+
+import org.qcg.broker.schemas.resreqs.PhaseBehaviourType;
+
+public class PhaseSystemLoad {
+	
+	protected String resName;
+	protected double utilization;
+	
+	PhaseSystemLoad(String resName, double utilization) {
+		this.resName = resName;
+		this.utilization = utilization;
+	}
+	
+	PhaseSystemLoad(String resName) {
+		this.resName = resName;
+		this.utilization = 100;
+	}
+	
+	PhaseSystemLoad(PhaseBehaviourType pbt) {
+		this.resName = pbt.getName();
+		this.utilization = pbt.getParameterTypeChoice().getParameterTypeChoiceItem(0).getParameterValue().getContent();
+	}
+	
+	public String getResouceName() {
+		return resName;
+	}
+	
+	public double getUtilization() {
+		return utilization;
+	}
+}
Index: DCWoRMS/branches/coolemall/src/schedframe/scheduling/tasks/phases/PhaseBehaviour.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/scheduling/tasks/phases/PhaseBehaviour.java	(revision 883)
+++ 	(revision )
@@ -1,32 +1,0 @@
-package schedframe.scheduling.tasks.phases;
-
-import org.qcg.broker.schemas.resreqs.PhaseBehaviourType;
-
-public class PhaseBehaviour {
-	
-	protected String resName;
-	protected double utilization;
-	
-	PhaseBehaviour(String resName, double utilization) {
-		this.resName = resName;
-		this.utilization = utilization;
-	}
-	
-	PhaseBehaviour(String resName) {
-		this.resName = resName;
-		this.utilization = 100;
-	}
-	
-	PhaseBehaviour(PhaseBehaviourType pbt) {
-		this.resName = pbt.getName();
-		this.utilization = pbt.getParameterTypeChoice().getParameterTypeChoiceItem(0).getParameterValue().getContent();
-	}
-	
-	public String getResouceName() {
-		return resName;
-	}
-	
-	public double getUtilization() {
-		return utilization;
-	}
-}
Index: DCWoRMS/branches/coolemall/src/schedframe/scheduling/tasks/phases/ResourceConsumption.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/scheduling/tasks/phases/ResourceConsumption.java	(revision 1207)
+++ 	(revision )
@@ -1,71 +1,0 @@
-package schedframe.scheduling.tasks.phases;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.qcg.broker.schemas.resreqs.ComputingResourceBaseTypeItem;
-import org.qcg.broker.schemas.resreqs.ComputingResourceParameterType;
-import org.qcg.broker.schemas.resreqs.PhaseBehaviourType;
-import org.qcg.broker.schemas.resreqs.StringParameterType;
-
-import org.qcg.broker.schemas.resreqs.ResourceConsumptionType;
-
-public class ResourceConsumption {
-
-	protected String id;
-    protected Map<String, String> referenceHardware;
-    protected long duration;
-    protected List<PhaseBehaviour> phaseBehaviourList;
-    
-    public ResourceConsumption(long duration, ComputingResourceBaseTypeItem item[]){
-    	this.id = null;
-    	this.referenceHardware = null;
-    	this.duration = duration;
-    	this.phaseBehaviourList = new ArrayList<PhaseBehaviour>();
-    	for(ComputingResourceBaseTypeItem compResItem: item){
-    		ComputingResourceParameterType hostParameter = compResItem.getHostParameter();
-        	PhaseBehaviour pb = new PhaseBehaviour(hostParameter.getName().toString());
-        	phaseBehaviourList.add(pb);
-    	}
-    }
-    
-    public ResourceConsumption(ResourceConsumptionType resConsumptionType){
-    	this.id = resConsumptionType.getId();
-    	this.referenceHardware = new HashMap<String, String>();
-    	if(resConsumptionType.getReferenceHardware() != null){
-        	for (int i = 0; i < resConsumptionType.getReferenceHardware().getReference().length; i++){
-        		StringParameterType spt = resConsumptionType.getReferenceHardware().getReference(i);
-        		referenceHardware.put(spt.getName(), spt.getContent());
-        	}
-    	}
-    	this.duration = resConsumptionType.getDuration().toLong()/1000;
-    	this.phaseBehaviourList = new ArrayList<PhaseBehaviour>();
-    	for(PhaseBehaviourType pbt: resConsumptionType.getBehaviour()){
-        	PhaseBehaviour pb = new PhaseBehaviour(pbt);
-        	phaseBehaviourList.add(pb);
-    	}
-    }
-    
-	public String getId() {
-		return id;
-	}
-
-	public void setId(String id) {
-		this.id = id;
-	}
-
-	public Map<String, String> getReferenceHardware() {
-		return referenceHardware;
-	}
-
-	public long getDuration() {
-		return duration;
-	}
-
-	public List<PhaseBehaviour> getBehaviourList() {
-		return phaseBehaviourList;
-	}
-
-}
Index: DCWoRMS/branches/coolemall/src/schedframe/scheduling/ResourceItem.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/scheduling/ResourceItem.java	(revision 1396)
+++ DCWoRMS/branches/coolemall/src/schedframe/scheduling/ResourceItem.java	(revision 1415)
@@ -1,9 +1,9 @@
 package schedframe.scheduling;
 
-import java.util.HashSet;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
+import java.util.TreeSet;
 
 import schedframe.resources.computing.ComputingResource;
@@ -16,9 +16,9 @@
 
 	protected Map<ResourceUnitName, ResourceUnit> usedResources;
-	protected Set<String> visitedResources;
+	protected Set<String> resourceNames;
 
 	public ResourceItem(Map<ResourceUnitName, ResourceUnit> usedResources){
 		this.usedResources = usedResources;
-		this.visitedResources = new HashSet<String>();
+		this.resourceNames = new TreeSet<String>();
 		saveResourceNames();
 	}
@@ -29,5 +29,5 @@
 	
 	public Set<String> getResourceNames(){
-		return visitedResources;
+		return resourceNames;
 	}
 	
@@ -43,6 +43,6 @@
 				List<ComputingResource> resources = compResource.getChildren();
 				if(resources.isEmpty()){
-					if(!visitedResources.contains(compResource.getFullName())){
-						visitedResources.add(compResource.getFullName());
+					if(!resourceNames.contains(compResource.getFullName())){
+						resourceNames.add(compResource.getFullName());
 					}
 				} else {
Index: DCWoRMS/branches/coolemall/src/schedframe/scheduling/Scheduler.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/scheduling/Scheduler.java	(revision 1362)
+++ DCWoRMS/branches/coolemall/src/schedframe/scheduling/Scheduler.java	(revision 1415)
@@ -63,10 +63,4 @@
 		List<Integer> schedRes = GridSim.getGridResourceList();
 		schedRes.add(schedulerIdObj);
-
-		/*if (supportsAR) {
-			res = GridSim.getAdvancedReservationList();
-			res.add(resIdObj);
-		} */
-
 	}
 	
Index: DCWoRMS/branches/coolemall/src/schedframe/scheduling/plugin/local/LocalSchedulingPlugin.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/scheduling/plugin/local/LocalSchedulingPlugin.java	(revision 1396)
+++ DCWoRMS/branches/coolemall/src/schedframe/scheduling/plugin/local/LocalSchedulingPlugin.java	(revision 1415)
@@ -1,19 +1,9 @@
 package schedframe.scheduling.plugin.local;
 
-import schedframe.events.scheduling.SchedulingEvent;
-import schedframe.events.scheduling.SchedulingResponseType;
-import schedframe.scheduling.manager.resources.ResourceManager;
-import schedframe.scheduling.manager.tasks.JobRegistry;
-import schedframe.scheduling.plugin.ModuleList;
 import schedframe.scheduling.plugin.SchedulingPlugin;
-import schedframe.scheduling.queue.TaskQueueList;
 
 
 public interface LocalSchedulingPlugin extends SchedulingPlugin {
 
-	public SchedulingResponseType handleResourceAllocationViolation(SchedulingEvent event,
-					TaskQueueList queues, 
-					JobRegistry jobRegistry, 
-					ResourceManager resourceManager, ModuleList modules);
 
 }
Index: DCWoRMS/branches/coolemall/src/schedframe/scheduling/policy/local/LocalManagementSystem.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/scheduling/policy/local/LocalManagementSystem.java	(revision 1396)
+++ DCWoRMS/branches/coolemall/src/schedframe/scheduling/policy/local/LocalManagementSystem.java	(revision 1415)
@@ -19,10 +19,12 @@
 import schedframe.events.scheduling.StartTaskExecutionEvent;
 import schedframe.events.scheduling.TaskFinishedEvent;
+import schedframe.events.scheduling.TaskPausedEvent;
 import schedframe.events.scheduling.TaskRequestedTimeExpiredEvent;
+import schedframe.events.scheduling.TaskResumedEvent;
 import schedframe.exceptions.ResourceException;
 import schedframe.resources.StandardResourceType;
 import schedframe.resources.computing.ComputingResource;
-import schedframe.resources.computing.profiles.energy.EnergyEvent;
-import schedframe.resources.computing.profiles.energy.EnergyEventType;
+import schedframe.resources.computing.profiles.energy.ResourceEvent;
+import schedframe.resources.computing.profiles.energy.ResourceEventType;
 import schedframe.resources.units.PEUnit;
 import schedframe.resources.units.ProcessingElements;
@@ -163,7 +165,7 @@
 			String[] ids = (String[]) ev.get_data();
 			execTask = jobRegistry.getTask(ids[0], ids[1]);
-			taskPause(execTask);
+			pauseTask(execTask);
 			if (pluginSupportsEvent(tag)) {
-				SchedulingEvent event = new SchedulingEvent(SchedulingEventType.TASK_PAUSED);
+				SchedulingEvent event = new TaskPausedEvent(ids[0], ids[1]);
 				SchedulingPlanInterface<?> decision = schedulingPlugin.schedule(event,
 						queues, jobRegistry, getResourceManager(), moduleList);
@@ -176,7 +178,7 @@
 			String[] ids = (String[]) ev.get_data();
 			execTask = jobRegistry.getTask(ids[0], ids[1]);
-			taskResume(execTask, execTask.getAllocatedResources().getLast().getResourceUnits(), true);
+			resumeTask(execTask, execTask.getAllocatedResources().getLast().getResourceUnits(), true);
 			if (pluginSupportsEvent(tag)) {
-				SchedulingEvent event = new StartTaskExecutionEvent(ids[0], ids[1]);
+				SchedulingEvent event = new TaskResumedEvent(ids[0], ids[1]);
 				SchedulingPlanInterface<?> decision = schedulingPlugin.schedule(event,
 						queues, jobRegistry, getResourceManager(), moduleList);
@@ -189,5 +191,6 @@
 			Object[] data = (Object[]) ev.get_data();
 			execTask = jobRegistry.getTask((String)data[0], (String)data[1]);
-			double migrationTime = execTimeEstimationPlugin.estimateMigrationTime(new StartTaskExecutionEvent((String)data[0], (String)data[1]), execTask, execTask.getAllocatedResources().getLast().getResourceUnits(), (Map<ResourceUnitName, ResourceUnit>)data[2]);
+			double migrationTime = execTimeEstimationPlugin.estimateMigrationTime(new StartTaskExecutionEvent((String)data[0], 
+					(String)data[1]), execTask, execTask.getAllocatedResources().getLast().getResourceUnits(), (Map<ResourceUnitName, ResourceUnit>)data[2]);
 			scheduler.sendInternal(migrationTime, DCWormsTags.TASK_MOVE, data);
 		}
@@ -197,5 +200,5 @@
 			Object[] data = (Object[]) ev.get_data();
 			execTask = jobRegistry.getTask((String)data[0], (String)data[1]);
-			taskMove(execTask, (Map<ResourceUnitName, ResourceUnit>)data[2]);
+			moveTask(execTask, (Map<ResourceUnitName, ResourceUnit>)data[2]);
 			if (pluginSupportsEvent(tag)) {
 				SchedulingEvent event = new StartTaskExecutionEvent((String)data[0], (String)data[1]);
@@ -209,5 +212,5 @@
 		case DCWormsTags.TASK_EXECUTION_CHANGED:
 			execTask = (ExecTask) ev.get_data();
-			updateTaskExecutionPhase(execTask, SchedulingEventType.RESOURCE_STATE_CHANGED);
+			updateTaskExecutionPhase(execTask);
 			break;
 
@@ -231,9 +234,12 @@
 			}
 			break;
-		}
-	}
-
-
-	public void taskPause(ExecTask execTask) {
+		default: 		
+			
+			break;
+		}
+	}
+
+
+	protected void pauseTask(ExecTask execTask) {
 		if (execTask == null) {
 			return;
@@ -246,5 +252,5 @@
 				getAllocationManager().freeResources(lastUsed, true);
 				
-				saveExecutionHistory(exec, exec.getCompletionPercentage(), exec.getEstimatedDuration());
+				saveExecutionHistory(exec, exec.getExecutionProfile().getCompletionPercentage(), exec.getEstimatedDuration());
 				
 				ExecTaskFilter filter = new ExecTaskFilter(exec.getUniqueId(), -1);
@@ -252,5 +258,5 @@
 				
 				PEUnit peUnit = (PEUnit)lastUsed.get(StandardResourceUnitName.PE);
-				updateComputingResources(peUnit, EnergyEventType.TASK_FINISHED, exec);
+				updateComputingResources(peUnit, ResourceEventType.TASK_FINISHED, exec);
 			} catch (Exception e) {
 				// TODO Auto-generated catch block
@@ -260,5 +266,5 @@
 	}
 	
-	public void taskResume(ExecTask execTask, Map<ResourceUnitName, ResourceUnit> resources, boolean exclusive) {
+	protected void resumeTask(ExecTask execTask, Map<ResourceUnitName, ResourceUnit> resources, boolean exclusive) {
 		if (execTask == null) {
 			return;
@@ -278,5 +284,5 @@
 					
 					PEUnit peUnit = (PEUnit)resources.get(StandardResourceUnitName.PE);
-					updateComputingResources(peUnit, EnergyEventType.TASK_STARTED, exec);
+					updateComputingResources(peUnit, ResourceEventType.TASK_STARTED, exec);
 				}
 
@@ -288,7 +294,7 @@
 	}
 	
-	public void taskMove(ExecTask execTask, Map<ResourceUnitName, ResourceUnit> map) {
-		taskPause(execTask);
-		taskResume(execTask, map, false);
+	protected void moveTask(ExecTask execTask, Map<ResourceUnitName, ResourceUnit> map) {
+		pauseTask(execTask);
+		resumeTask(execTask, map, false);
 	}
 	
@@ -351,5 +357,5 @@
 		
 		PEUnit peUnit = (PEUnit)choosenResources.get(StandardResourceUnitName.PE);
-		updateComputingResources(peUnit, EnergyEventType.RESOURCE_UTILIZATION_CHANGED, exec);
+		updateComputingResources(peUnit, ResourceEventType.UTILIZATION_CHANGED, exec);
 		
 
@@ -377,7 +383,7 @@
 
 		int phaseDuration = Double.valueOf(execTimeEstimationPlugin.execTimeEstimation(new SchedulingEvent(SchedulingEventType.START_TASK_EXECUTION), 
-				execTask, resources, exec.getCompletionPercentage())).intValue();
-
-		saveExecutionHistory(exec, exec.getCompletionPercentage(), phaseDuration);
+				execTask, resources, exec.getExecutionProfile().getCompletionPercentage())).intValue();
+
+		saveExecutionHistory(exec, exec.getExecutionProfile().getCompletionPercentage(), phaseDuration);
 		if(exec.getExecutionProfile().isLast()){
 			scheduler.sendInternal(phaseDuration, DCWormsTags.TASK_EXECUTION_FINISHED, execTask);;
@@ -387,5 +393,5 @@
 		
 		PEUnit peUnit = (PEUnit)resources.get(StandardResourceUnitName.PE);
-		updateComputingResources(peUnit, EnergyEventType.TASK_STARTED, exec);
+		updateComputingResources(peUnit, ResourceEventType.TASK_STARTED, exec);
 		
 	}
@@ -429,10 +435,10 @@
 		
 		PEUnit peUnit = (PEUnit)lastUsed.get(StandardResourceUnitName.PE);
-		updateComputingResources(peUnit, EnergyEventType.TASK_FINISHED, exec);
+		updateComputingResources(peUnit, ResourceEventType.TASK_FINISHED, exec);
 		
 		log.debug(execTask.getJobId() + "_" + execTask.getId() + " finished execution on " + new DateTime());
 		log.info(DCWormsConstants.USAGE_MEASURE_NAME + ": " + calculateTotalLoad());
 		
-		updateComputingResources(peUnit, EnergyEventType.RESOURCE_UTILIZATION_CHANGED, exec);
+		updateComputingResources(peUnit, ResourceEventType.UTILIZATION_CHANGED, exec);
 	}
 	
@@ -452,5 +458,6 @@
 			//System.out.println("--- upadteProgressX: " + Sim_system.sim_clock() );
 			//System.out.println("taskId: " + exec.getId() + "; completion percentage: " + exec.getCompletionPercentage() + "; timespan: " + timeSpan + "; estimatedDuration: " +  execHistItem.getCompletionPercentage());
-			exec.setCompletionPercentage(exec.getCompletionPercentage() + 100 * (timeSpan / (execHistItem.getEstimatedDuration()) * (1.0 - execHistItem.getCompletionPercentage()/100.0)));
+			exec.getExecutionProfile().setCompletionPercentage(exec.getExecutionProfile().getCompletionPercentage() + 100 * (timeSpan / (execHistItem.getEstimatedDuration()) * (1.0 - execHistItem.getCompletionPercentage()/100.0)));
+			exec.setTotalCompletionPercentage(exec.getTotalCompletionPercentage() + 100 * (timeSpan / execHistItem.getEstimatedDuration()) * exec.getExecutionProfile().getCurrentResourceConsumption().getLenght() / exec.getExecutionProfile().getLength());
 			//System.out.println("newProgress: " + exec.getCompletionPercentage()  );	
 
@@ -458,9 +465,9 @@
 	}
 	
-	private void updateComputingResources(PEUnit peUnit, EnergyEventType eventType, Object obj){
+	private void updateComputingResources(PEUnit peUnit, ResourceEventType eventType, Object obj){
 		if(peUnit instanceof ProcessingElements){
 			ProcessingElements pes = (ProcessingElements) peUnit;
 			for (ComputingResource resource : pes) {
-				resource.handleEvent(new EnergyEvent(eventType, obj, scheduler.getFullName()));
+				resource.handleEvent(new ResourceEvent(eventType, obj, scheduler.getFullName()));
 				//DataCenterWorkloadSimulator.getEventManager().sendToResources(resource.getType(), 0, new EnergyEvent(eventType, obj));
 			}
@@ -480,5 +487,5 @@
 				return;
 			}
-			resource.handleEvent(new EnergyEvent(eventType, obj, scheduler.getFullName()));
+			resource.handleEvent(new ResourceEvent(eventType, obj, scheduler.getFullName()));
 		}
 	}
@@ -492,9 +499,9 @@
 
 			int phaseDuration = Double.valueOf(execTimeEstimationPlugin.execTimeEstimation(new SchedulingEvent(SchedulingEventType.RESOURCE_STATE_CHANGED), 
-					execTask, choosenResources, exec.getCompletionPercentage())).intValue();
+					execTask, choosenResources, exec.getExecutionProfile().getCompletionPercentage())).intValue();
 
 			ExecutionHistoryItem execHistItem = exec.getExecutionHistory().getLast();
-			double lastTimeStamp = execHistItem.getTimeStamp().getMillis()/1000;
-			if(DoubleMath.subtract((lastTimeStamp + execHistItem.getEstimatedDuration()), (new DateTime().getMillis()/1000 + phaseDuration)) == 0.0){
+			double lastTimeStamp = execHistItem.getTimeStamp().getMillis() / 1000;
+			if(DoubleMath.subtract((lastTimeStamp + execHistItem.getEstimatedDuration()), (new DateTime().getMillis() / 1000 + phaseDuration)) == 0.0){
 				continue;
 			}
@@ -504,5 +511,5 @@
 			//System.out.println("completionPercantage: " + exec.getCompletionPercentage() + "; basic duration: " +exec.getResourceConsumptionProfile().getCurrentResourceConsumption().getDuration() +   "; phaseDuration: " +  phaseDuration);
 
-			saveExecutionHistory(exec, exec.getCompletionPercentage(), phaseDuration);
+			saveExecutionHistory(exec, exec.getExecutionProfile().getCompletionPercentage(), phaseDuration);
 			
 			if(exec.getExecutionProfile().isLast()){
@@ -522,5 +529,5 @@
 	}	
 
-	protected void updateTaskExecutionPhase(ExecTask execTask, SchedulingEventType schedEvType) {
+	protected void updateTaskExecutionPhase(ExecTask execTask) {
 
 		if (execTask.getStatus() == DCWormsTags.INEXEC) {
@@ -535,8 +542,8 @@
 			Map<ResourceUnitName, ResourceUnit> choosenResources = exec.getAllocatedResources().getLast().getResourceUnits();
 
-			int phaseDuration = Double.valueOf(execTimeEstimationPlugin.execTimeEstimation(new SchedulingEvent(schedEvType), 
-					execTask, choosenResources, exec.getCompletionPercentage())).intValue();
-			
-			saveExecutionHistory(exec, exec.getCompletionPercentage(), phaseDuration);
+			int phaseDuration = Double.valueOf(execTimeEstimationPlugin.execTimeEstimation(new SchedulingEvent(SchedulingEventType.TASK_EXECUTION_CHANGED), 
+					execTask, choosenResources, exec.getExecutionProfile().getCompletionPercentage())).intValue();
+			
+			saveExecutionHistory(exec, exec.getExecutionProfile().getCompletionPercentage(), phaseDuration);
 			
 			if(exec.getExecutionProfile().isLast()){
@@ -547,20 +554,16 @@
 			
 			PEUnit peUnit = (PEUnit)exec.getAllocatedResources().getLast().getResourceUnits().get(StandardResourceUnitName.PE);
-			updateComputingResources(peUnit, EnergyEventType.RESOURCE_UTILIZATION_CHANGED, exec);
+			updateComputingResources(peUnit, ResourceEventType.UTILIZATION_CHANGED, exec);
 		}
 	}	
 
-	public double calculateTotalLoad() {
+	protected double calculateTotalLoad() {
 
 		DCwormsAccumulator loadAcc = new DCwormsAccumulator();
-		try {
-			for(ComputingResource compRes: getResourceManager().getResourcesOfType(StandardResourceType.Node)){
-				loadAcc.add(compRes.getLoadInterface().getRecentUtilization().getValue());				
-			}
-		} catch (ResourceException e) {
-			// TODO Auto-generated catch block
-			e.printStackTrace();
-		}
-		
+
+		for(ComputingResource compRes: getResourceManager().getResourcesOfType(StandardResourceType.Node)){
+			loadAcc.add(compRes.getLoadInterface().getRecentUtilization().getValue());				
+		}
+
 		return loadAcc.getMean();
 	}
@@ -703,5 +706,4 @@
 	
 	private void saveExecutionHistory(Executable exec, double completionPercentage, double estimatedDuration){
-
 		ExecutionHistoryItem execHistoryItem = new ExecutionHistoryItem(new DateTime());
 		execHistoryItem.setCompletionPercentage(completionPercentage);
@@ -710,5 +712,4 @@
 		execHistoryItem.setStatus(exec.getStatus());
 		exec.addExecHistory(execHistoryItem);
-		
 	}
 	
Index: DCWoRMS/branches/coolemall/src/schedframe/scheduling/policy/global/GlobalManagementSystem.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/scheduling/policy/global/GlobalManagementSystem.java	(revision 1385)
+++ DCWoRMS/branches/coolemall/src/schedframe/scheduling/policy/global/GlobalManagementSystem.java	(revision 1415)
@@ -78,5 +78,4 @@
 			return;
 		}
-		
 		registerWorkloadUnit(wu);
 
Index: DCWoRMS/branches/coolemall/src/schedframe/scheduling/manager/tasks/JobRegistryImpl.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/scheduling/manager/tasks/JobRegistryImpl.java	(revision 1396)
+++ DCWoRMS/branches/coolemall/src/schedframe/scheduling/manager/tasks/JobRegistryImpl.java	(revision 1415)
@@ -55,10 +55,10 @@
 					Set<String> visitedResource = task.getAllocatedResources().getLast().getResourceNames();
 					for(String res: visitedResource){
-						if(res.contains(context)){
+						if(res.equals(context) || res.substring(0, res.lastIndexOf("/")).contains(context)){
 							taskList.add(task);
 							break;
 						}
 					}
-					if(task.getSchedulerName().contains(context)) {
+					if(task.getSchedulerName().equals(context)) {
 						taskList.add(task);
 					}
Index: DCWoRMS/branches/coolemall/src/schedframe/scheduling/manager/resources/ClusterResourceManager.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/scheduling/manager/resources/ClusterResourceManager.java	(revision 1247)
+++ DCWoRMS/branches/coolemall/src/schedframe/scheduling/manager/resources/ClusterResourceManager.java	(revision 1415)
@@ -1,12 +1,10 @@
 package schedframe.scheduling.manager.resources;
 
-import java.util.ArrayList;
 import java.util.List;
 import java.util.Properties;
 
-import schedframe.exceptions.ResourceException;
 import schedframe.resources.StandardResourceType;
+import schedframe.resources.computing.ComputingResource;
 import schedframe.resources.computing.Node;
-import schedframe.resources.computing.ComputingResource;
 import schedframe.resources.computing.Processor;
 import schedframe.scheduling.Scheduler;
@@ -22,18 +20,10 @@
 	@SuppressWarnings("unchecked")
 	public List<Node> getNodes(){
-		try {
-			return (List<Node>) getResourcesOfType(StandardResourceType.Node);
-		} catch (ResourceException e) {
-			return new ArrayList<Node>();
-		}
+		return (List<Node>) getResourcesOfType(StandardResourceType.Node);
 	}
 	
 	@SuppressWarnings("unchecked")
 	public List<Processor> getProcessors(){
-		try {
-			return (List<Processor>) getResourcesOfType(StandardResourceType.Processor);
-		} catch (Exception e) {
-			return new ArrayList<Processor>();
-		}
+		return (List<Processor>) getResourcesOfType(StandardResourceType.Processor);
 	}
 
Index: DCWoRMS/branches/coolemall/src/schedframe/scheduling/manager/resources/LocalResourceManager.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/scheduling/manager/resources/LocalResourceManager.java	(revision 1396)
+++ DCWoRMS/branches/coolemall/src/schedframe/scheduling/manager/resources/LocalResourceManager.java	(revision 1415)
@@ -107,5 +107,5 @@
 	}
 
-	public List<? extends ComputingResource> getResourcesOfType(ResourceType type) throws ResourceException {
+	public List<? extends ComputingResource> getResourcesOfType(ResourceType type) {
 		List<ComputingResource> resourcesOfType = new ArrayList<ComputingResource>();
 		for (ComputingResource resource : computingResources) {
@@ -118,6 +118,5 @@
 	}
 
-	public List<? extends ComputingResource> getResourcesByTypeWithStatus(ResourceType type, ResourceStatus status)
-			throws ResourceException {
+	public List<? extends ComputingResource> getResourcesByTypeWithStatus(ResourceType type, ResourceStatus status){
 
 		List<ComputingResource> resourcesOfType = new ArrayList<ComputingResource>();
@@ -225,9 +224,7 @@
 		List<ComputingResource> computingResources = null;
 		if(areResourcesAchievable(StandardResourceType.Core)){
-			try {
-				computingResources = (List<ComputingResource>) getResourcesOfType(StandardResourceType.Core);
-			} catch (ResourceException e) {
-				throw new RuntimeException("DCWorms internal error");
-			}
+
+			computingResources = (List<ComputingResource>) getResourcesOfType(StandardResourceType.Core);
+
 			PEUnit peUnit = new ProcessingElements(computingResources);
 			peUnits = new ArrayList<ResourceUnit>();
@@ -236,9 +233,7 @@
 
 		else if(areResourcesAchievable(StandardResourceType.Processor)){
-			try {
-				computingResources = (List<ComputingResource>) getResourcesOfType(StandardResourceType.Processor);
-			} catch (ResourceException e) {
-				throw new RuntimeException("DCWorms internal error");
-			}
+
+			computingResources = (List<ComputingResource>) getResourcesOfType(StandardResourceType.Processor);
+
 			PEUnit peUnit = new ProcessingElements(computingResources);
 			peUnits = new ArrayList<ResourceUnit>();
