Index: DCWoRMS/branches/coolemall/src/schedframe/scheduling/policy/local/LocalManagementSystem.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/scheduling/policy/local/LocalManagementSystem.java	(revision 1415)
+++ DCWoRMS/branches/coolemall/src/schedframe/scheduling/policy/local/LocalManagementSystem.java	(revision 1423)
@@ -4,6 +4,8 @@
 import java.util.HashMap;
 import java.util.Iterator;
+import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
 
 import org.apache.commons.logging.Log;
@@ -93,5 +95,4 @@
 
 		int tag = ev.get_tag();
-
 		switch (tag) {
 
@@ -139,5 +140,5 @@
 				getWorkloadUnitHandler().handleJob(job);
 			} 
-			//SUPPORTS PRECEDING CONSTRAINST COMING BOTH FROM SWF FILES
+			//SUPPORTS PRECEDING CONSTRAINST COMING ALSO FROM SWF FILES
 			/*else {
 				try {
@@ -394,6 +395,6 @@
 		PEUnit peUnit = (PEUnit)resources.get(StandardResourceUnitName.PE);
 		updateComputingResources(peUnit, ResourceEventType.TASK_STARTED, exec);
-		
-	}
+	}
+
 	protected void finalizeExecutable(ExecTask execTask){
 		
@@ -459,5 +460,5 @@
 			//System.out.println("taskId: " + exec.getId() + "; completion percentage: " + exec.getCompletionPercentage() + "; timespan: " + timeSpan + "; estimatedDuration: " +  execHistItem.getCompletionPercentage());
 			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());
+			exec.setTotalCompletionPercentage(exec.getTotalCompletionPercentage() + 100 * (timeSpan / execHistItem.getEstimatedDuration()) * exec.getExecutionProfile().getCurrentExecutionPhase().getLenght() / exec.getExecutionProfile().getLength());
 			//System.out.println("newProgress: " + exec.getCompletionPercentage()  );	
 
@@ -467,9 +468,9 @@
 	private void updateComputingResources(PEUnit peUnit, ResourceEventType eventType, Object obj){
 		if(peUnit instanceof ProcessingElements){
-			ProcessingElements pes = (ProcessingElements) peUnit;
+			/*ProcessingElements pes = (ProcessingElements) peUnit;
 			for (ComputingResource resource : pes) {
 				resource.handleEvent(new ResourceEvent(eventType, obj, scheduler.getFullName()));
 				//DataCenterWorkloadSimulator.getEventManager().sendToResources(resource.getType(), 0, new EnergyEvent(eventType, obj));
-			}
+			}*/
 			/*try {
 				for (ComputingResource resource : resourceManager.getResourcesOfType(pes.get(0).getType())) {
@@ -480,4 +481,25 @@
 				e.printStackTrace();
 			}*/
+			
+			ProcessingElements pes = (ProcessingElements) peUnit;
+			ResourceEvent resEvent = new ResourceEvent(eventType, obj, scheduler.getFullName());		
+			try{
+				Set<ComputingResource> resourcesToUpdate = new LinkedHashSet<ComputingResource>();
+			
+				for (ComputingResource compResource : pes) {
+					resourcesToUpdate.add(compResource);
+				}
+				while(resourcesToUpdate.size() > 0){
+					Set<ComputingResource> newSet = new LinkedHashSet<ComputingResource>();
+					for(ComputingResource compResource: resourcesToUpdate){
+						compResource.updateState(resEvent);
+						if(compResource.getParent() != null){
+							newSet.add(compResource.getParent());
+						}
+					}
+					resourcesToUpdate = new LinkedHashSet<ComputingResource>(newSet);
+				}
+			}catch(Exception e){
+			}
 		} else {
 			ComputingResource resource = null;
@@ -492,5 +514,5 @@
 
 	protected void updateProcessingTimes() {
-		for (ExecTask execTask : jobRegistry.getRunningTasks()) {
+		for (ExecTask execTask: jobRegistry.getRunningTasks()) {
 			Executable exec = (Executable)execTask;
 
@@ -502,5 +524,5 @@
 
 			ExecutionHistoryItem execHistItem = exec.getExecutionHistory().getLast();
-			double lastTimeStamp = execHistItem.getTimeStamp().getMillis() / 1000;
+			double lastTimeStamp = execHistItem.getTimeStamp() / 1000;
 			if(DoubleMath.subtract((lastTimeStamp + execHistItem.getEstimatedDuration()), (new DateTime().getMillis() / 1000 + phaseDuration)) == 0.0){
 				continue;
@@ -706,5 +728,5 @@
 	
 	private void saveExecutionHistory(Executable exec, double completionPercentage, double estimatedDuration){
-		ExecutionHistoryItem execHistoryItem = new ExecutionHistoryItem(new DateTime());
+		ExecutionHistoryItem execHistoryItem = new ExecutionHistoryItem(new DateTime().getMillis());
 		execHistoryItem.setCompletionPercentage(completionPercentage);
 		execHistoryItem.setEstimatedDuration(estimatedDuration);
Index: DCWoRMS/branches/coolemall/src/schedframe/scheduling/ExecutionHistoryItem.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/scheduling/ExecutionHistoryItem.java	(revision 1362)
+++ DCWoRMS/branches/coolemall/src/schedframe/scheduling/ExecutionHistoryItem.java	(revision 1423)
@@ -5,5 +5,5 @@
 public class ExecutionHistoryItem {
 
-	protected DateTime timeStamp;
+	protected long timeStamp;
 	protected double completionPercentage;
 	protected double estimatedDuration;
@@ -11,9 +11,9 @@
 	protected int resUsageIndex;
 
-	public ExecutionHistoryItem(DateTime time){
+	public ExecutionHistoryItem(long time){
 		this.timeStamp = time;
 	}
 
-	public DateTime getTimeStamp(){
+	public long getTimeStamp(){
 		return timeStamp;
 	}
Index: DCWoRMS/branches/coolemall/src/schedframe/scheduling/tasks/phases/ExecutionProfile.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/scheduling/tasks/phases/ExecutionProfile.java	(revision 1415)
+++ DCWoRMS/branches/coolemall/src/schedframe/scheduling/tasks/phases/ExecutionProfile.java	(revision 1423)
@@ -5,5 +5,5 @@
 public class ExecutionProfile {
 	
-	protected LinkedList<ExecutionPhase> resourceConsumptionList;
+	protected LinkedList<ExecutionPhase> executionPhases;
 	protected long usefulWork;
 	protected double completionPercentage;
@@ -11,16 +11,16 @@
 	
 
-	public ExecutionProfile(LinkedList<ExecutionPhase> resourceConsumptionList) {
-		this.resourceConsumptionList = resourceConsumptionList;
+	public ExecutionProfile(LinkedList<ExecutionPhase> execPhases) {
+		this.executionPhases = execPhases;
 		this.completionPercentage = 0;
 		this.currentPhase = 0;
 	}
 	
-	public LinkedList<ExecutionPhase> getResourceConsumptionList(){
-		return resourceConsumptionList;
+	public LinkedList<ExecutionPhase> getExecutionPhases(){
+		return executionPhases;
 	}
 	
-	public ExecutionPhase getCurrentResourceConsumption(){
-		return resourceConsumptionList.get(currentPhase);
+	public ExecutionPhase getCurrentExecutionPhase(){
+		return executionPhases.get(currentPhase);
 	}
 
@@ -42,5 +42,5 @@
 	
 	public boolean isLast(){
-		if(currentPhase == resourceConsumptionList.size() - 1){
+		if(currentPhase == executionPhases.size() - 1){
 			return true;
 		}
@@ -58,5 +58,5 @@
 	public long getLength() {
 		long length = 0;
-		for(ExecutionPhase execPhase: resourceConsumptionList){
+		for(ExecutionPhase execPhase: executionPhases){
 			length = length + execPhase.getLenght();
 		}
Index: DCWoRMS/branches/coolemall/src/schedframe/scheduling/ResourceItem.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/scheduling/ResourceItem.java	(revision 1415)
+++ DCWoRMS/branches/coolemall/src/schedframe/scheduling/ResourceItem.java	(revision 1423)
@@ -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;
@@ -20,6 +20,5 @@
 	public ResourceItem(Map<ResourceUnitName, ResourceUnit> usedResources){
 		this.usedResources = usedResources;
-		this.resourceNames = new TreeSet<String>();
-		saveResourceNames();
+		this.resourceNames = saveResourceNames();
 	}
 	
@@ -32,7 +31,9 @@
 	}
 	
-	private void saveResourceNames(){
+	private Set<String> saveResourceNames(){
+		Set<String> resourceNames;
 		ProcessingElements pes = (ProcessingElements) usedResources.get(StandardResourceUnitName.PE);
-		for (ComputingResource resource : pes) {
+		resourceNames = new HashSet<String>(pes.size(), 1);
+		for (ComputingResource resource: pes) {
 
 			LinkedList<ComputingResource> toExamine = new LinkedList<ComputingResource>();
@@ -54,4 +55,5 @@
 			}
 		}
+		return resourceNames;
 	}
 }
