Index: DCWoRMS/branches/coolemall/src/schedframe/Parameters.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/Parameters.java	(revision 477)
+++ DCWoRMS/branches/coolemall/src/schedframe/Parameters.java	(revision 1423)
@@ -10,3 +10,6 @@
 	private static final long serialVersionUID = 1L;
 	
+	public Parameters(int initSize){
+		super(initSize);
+	}
 }
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;
 	}
 }
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/resources/ResourceStatus.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/ResourceStatus.java	(revision 477)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/ResourceStatus.java	(revision 1423)
@@ -4,5 +4,4 @@
 	BUSY,
 	FREE,
-	RESERVED,
 	FAILED,
 	PENDING,
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/devices/DeviceResourceCharacteristics.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/devices/DeviceResourceCharacteristics.java	(revision 1207)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/devices/DeviceResourceCharacteristics.java	(revision 1423)
@@ -10,4 +10,3 @@
 	}
 
-
 }
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/devices/description/PhysicalResourceDescription.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/devices/description/PhysicalResourceDescription.java	(revision 1415)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/devices/description/PhysicalResourceDescription.java	(revision 1423)
@@ -91,5 +91,5 @@
 					
 					if(params == null)
-						params = new Parameters();
+						params = new Parameters(2);
 					params.put("powerCapLevel", param);
 				}
@@ -102,5 +102,5 @@
 					
 					if(params == null)
-						params = new Parameters();
+						params = new Parameters(2);
 					params.put("powerFloorLevel", param);
 				}
@@ -273,5 +273,5 @@
 		
 		if(parameters.length != 0)
-			params = new Parameters();
+			params = new Parameters(2);
 		
 		for(int i = 0; i < parameters.length; i++){
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/devices/DeviceAirflowInterface.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/devices/DeviceAirflowInterface.java	(revision 1415)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/devices/DeviceAirflowInterface.java	(revision 1423)
@@ -1,5 +1,4 @@
 package schedframe.resources.devices;
 
-import java.util.ArrayList;
 import java.util.List;
 
@@ -54,9 +53,5 @@
 
 	public List<AirflowState> getSupportedAirflowStates(){
-		List<AirflowState> airflowStates = new ArrayList<AirflowState>();
-		for(AirflowState airFlowState: airflowProfile.getAirflowStates()){
-			airflowStates.add(airFlowState);
-		}
-		return airflowStates;
+		return airflowProfile.getAirflowStates();
 	}
 
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/devices/PhysicalResource.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/devices/PhysicalResource.java	(revision 1415)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/devices/PhysicalResource.java	(revision 1423)
@@ -2,5 +2,4 @@
 
 import schedframe.Initializable;
-import schedframe.events.Event;
 import schedframe.events.EventHandler;
 import schedframe.resources.Resource;
@@ -10,4 +9,5 @@
 import schedframe.resources.computing.extensions.Extension;
 import schedframe.resources.computing.extensions.ExtensionList;
+import schedframe.resources.computing.extensions.ExtensionListImpl;
 import schedframe.resources.computing.extensions.ExtensionType;
 import schedframe.resources.computing.profiles.energy.EnergyExtension;
@@ -99,4 +99,7 @@
 	
 	public ExtensionList getExtensionList() {
+		if(extensionList == null){
+			return new ExtensionListImpl(0);
+		}
 		return extensionList;
 	}
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/units/ProcessingElements.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/units/ProcessingElements.java	(revision 1392)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/units/ProcessingElements.java	(revision 1423)
@@ -239,5 +239,5 @@
 	
 	public ProcessingElements replicate(int amount){
-		List<ComputingResource> compResources =  new ArrayList<ComputingResource>(amount);
+		List<ComputingResource> compResources = new ArrayList<ComputingResource>(amount);
 		Iterator<ComputingResource> it = resources.iterator();
 		amount = Math.min(resources.size(), amount);
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/computing/description/ComputingResourceDescription.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/computing/description/ComputingResourceDescription.java	(revision 1344)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/computing/description/ComputingResourceDescription.java	(revision 1423)
@@ -112,5 +112,5 @@
 	public void addResourceUnit(ResourceUnit unit) {
 		if (this.resUnits == null)
-			this.resUnits = new HashMap<ResourceUnitName, List<ResourceUnit>>(1);
+			this.resUnits = new HashMap<ResourceUnitName, List<ResourceUnit>>(2);
 		List<ResourceUnit> list = null;
 		if (this.resUnits.containsKey(unit.getName())) {
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/ui/ComputingResourceAirflowInterface.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/ui/ComputingResourceAirflowInterface.java	(revision 1415)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/ui/ComputingResourceAirflowInterface.java	(revision 1423)
@@ -1,5 +1,4 @@
 package schedframe.resources.computing.profiles.energy.airthroughput.ui;
 
-import java.util.ArrayList;
 import java.util.List;
 
@@ -54,9 +53,5 @@
 
 	public List<AirflowState> getSupportedAirflowStates() {
-		List<AirflowState> airflowStates = new ArrayList<AirflowState>();
-		for(AirflowState airflowState: airflowProfile.getAirflowStates()){
-			airflowStates.add(airflowState);
-		}
-		return airflowStates;
+		return airflowProfile.getAirflowStates();
 	}
 
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/ui/AirflowInterface.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/ui/AirflowInterface.java	(revision 1396)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/ui/AirflowInterface.java	(revision 1423)
@@ -24,5 +24,5 @@
 	public AirflowValue getRecentAirflow();
 	
-	List<AirflowValue> getAirflowHistory();
+	public List<AirflowValue> getAirflowHistory();
 	
 	public Parameters getParameters();
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/EnergyExtension.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/EnergyExtension.java	(revision 1415)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/EnergyExtension.java	(revision 1423)
@@ -111,13 +111,15 @@
 		if(powerProfile == null || powerProfile.getEnergyEstimationPlugin() == null)
 			return false;
-		if(event.getType().getName().equals(ResourceEventType.POWER_STATE_CHANGED.getName()))
+		if(event.getType().getName().equals(ResourceEventType.UTILIZATION_CHANGED.getName()))
+			return true;
+		else if(event.getType().getName().equals(ResourceEventType.TASK_STARTED.getName()))
+			return true;
+		else if(event.getType().getName().equals(ResourceEventType.TASK_FINISHED.getName()))
+			return true;
+		else if(event.getType().getName().equals(ResourceEventType.POWER_STATE_CHANGED.getName()))
 			return true;
 		else if(event.getType().getName().equals(ResourceEventType.CPU_FREQUENCY_CHANGED.getName()))
 			return true;
-		else if(event.getType().getName().equals(ResourceEventType.TASK_STARTED.getName()))
-			return true;
-		else if(event.getType().getName().equals(ResourceEventType.TASK_FINISHED.getName()))
-			return true;
-		else if(event.getType().getName().equals(ResourceEventType.UTILIZATION_CHANGED.getName()))
+		else if(event.getType().getName().equals(ResourceEventType.UPDATE_POWER_STATE.getName()))
 			return true;
 	
@@ -138,9 +140,19 @@
 			switch (resEvent.getType()) {
 			
-			case UPDATE_POWER_STATE:
-				PowerStateName newPowerState = (PowerStateName) resEvent.getData();
-				powerInterface.setPowerState(newPowerState);
-				break;
-				
+			case UTILIZATION_CHANGED:
+				power = powerProfile.getEnergyEstimationPlugin().estimatePowerConsumption(resEvent, new JobRegistryImpl(resource.getFullName()), resource);
+				status = powerProfile.addToPowerUsageHistory(power);
+				break;
+				
+			case TASK_STARTED:
+				power = powerProfile.getEnergyEstimationPlugin().estimatePowerConsumption(resEvent, new JobRegistryImpl(resource.getFullName()), resource);
+				status = powerProfile.addToPowerUsageHistory(power);
+				break;
+	
+			case TASK_FINISHED:
+				power = powerProfile.getEnergyEstimationPlugin().estimatePowerConsumption(resEvent, new JobRegistryImpl(resource.getFullName()), resource);
+				status = powerProfile.addToPowerUsageHistory(power);
+				break;
+								
 			case POWER_STATE_CHANGED:
 				power = powerProfile.getEnergyEstimationPlugin().estimatePowerConsumption(resEvent, new JobRegistryImpl(resource.getFullName()), resource);			
@@ -153,17 +165,9 @@
 				break;
 				
-			case TASK_STARTED:
-				power = powerProfile.getEnergyEstimationPlugin().estimatePowerConsumption(resEvent, new JobRegistryImpl(resource.getFullName()), resource);
-				status = powerProfile.addToPowerUsageHistory(power);
-				break;
-	
-			case TASK_FINISHED:
-				power = powerProfile.getEnergyEstimationPlugin().estimatePowerConsumption(resEvent, new JobRegistryImpl(resource.getFullName()), resource);
-				status = powerProfile.addToPowerUsageHistory(power);
-				break;
-				
-			case UTILIZATION_CHANGED:
-				power = powerProfile.getEnergyEstimationPlugin().estimatePowerConsumption(resEvent, new JobRegistryImpl(resource.getFullName()), resource);
-				status = powerProfile.addToPowerUsageHistory(power);
+			case UPDATE_POWER_STATE:
+				if(resource.getFullName().equals(resEvent.getSource())){
+					PowerStateName newPowerState = (PowerStateName) resEvent.getData();
+					powerInterface.setPowerState(newPowerState);
+				}
 				break;
 				
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/PowerProfile.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/PowerProfile.java	(revision 1207)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/PowerProfile.java	(revision 1423)
@@ -64,5 +64,5 @@
 	public List<PowerState> getSupportedPowerStates() {
 		if(supportedPowerStates == null)
-			return new ArrayList<PowerState>();
+			return new ArrayList<PowerState>(0);
 		return supportedPowerStates;
 	}
@@ -70,5 +70,5 @@
 	public Map<String, PState> getSupportedPStates() {
 		if(supportedPStates == null)
-			return new HashMap<String, PState>();
+			return new HashMap<String, PState>(0);
 		return supportedPStates;
 	}
@@ -117,5 +117,5 @@
 		boolean supportsOFF = false;
 		if(supportedPowerStates == null){
-			supportedPowerStates = new ArrayList<PowerState>();
+			supportedPowerStates = new ArrayList<PowerState>(4);
 		}
 		for(PowerState ps: supportedPowerStates){
@@ -128,8 +128,10 @@
 		
 		if(!supportsON){
-			supportedPowerStates.add(new PowerState(StandardPowerStateName.ON, -1, new ArrayList<Transition>()));
+			supportedPowerStates.add(new PowerState(StandardPowerStateName.ON, -1, null));
+			supportedPowerStates.add(new PowerState(StandardPowerStateName.BOOT, -1, null));
 		}
 		if(!supportsOFF){
-			supportedPowerStates.add(new PowerState(StandardPowerStateName.OFF, -1, new ArrayList<Transition>()));
+			supportedPowerStates.add(new PowerState(StandardPowerStateName.OFF, -1, null));
+			supportedPowerStates.add(new PowerState(StandardPowerStateName.POWEROFF, -1, null));
 		}
 	}
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/PowerState.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/PowerState.java	(revision 477)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/PowerState.java	(revision 1423)
@@ -1,4 +1,5 @@
 package schedframe.resources.computing.profiles.energy.power;
 
+import java.util.ArrayList;
 import java.util.List;
 
@@ -24,4 +25,6 @@
 	}
 	public List<Transition> getTransitions() {
+		if(transitions == null)
+			return new ArrayList<Transition>(0);
 		return transitions;
 	}
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/ui/NodePowerInterface.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/ui/NodePowerInterface.java	(revision 1415)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/ui/NodePowerInterface.java	(revision 1423)
@@ -4,4 +4,5 @@
 
 import java.util.List;
+
 
 import schedframe.resources.ResourceStatus;
@@ -37,8 +38,8 @@
 			}
 
-			if(state == StandardPowerStateName.OFF){
+			if(state == StandardPowerStateName.OFF || state == StandardPowerStateName.POWEROFF){
 				node.setStatus(ResourceStatus.UNAVAILABLE);
 			}
-			else if(state == StandardPowerStateName.ON){
+			else if(state == StandardPowerStateName.ON || state == StandardPowerStateName.BOOT){
 				node.setStatus(ResourceStatus.FREE);
 			}
@@ -55,5 +56,6 @@
 		/*double timePenalty = getTransitionTime(currentPowerState, StandardPowerStateName.ON);
 		setPowerState(StandardPowerStateName.BOOT);
-		DataCenterWorkloadSimulator.getEventManager().sendToResource(resource.getFullName(), timePenalty, new ResourceEvent(ResourceEventType.UPDATE_POWER_STATE, StandardPowerStateName.ON, resource.getFullName()));*/
+		DataCenterWorkloadSimulator.getEventManager().sendToResource(resource.getFullName(), timePenalty, new ResourceEvent(ResourceEventType.UPDATE_POWER_STATE, StandardPowerStateName.ON, resource.getFullName()));
+		 */		
 		setPowerState(StandardPowerStateName.ON);
 	}
@@ -68,5 +70,5 @@
 	private double getTransitionTime(PowerStateName from, PowerStateName to){
 		List<PowerState> availablePowerStates = getSupportedPowerStates();
-		double timePenalty = 0;
+		double time = 0;
 		for(PowerState ps : availablePowerStates){
 			if(ps.getName().getLabel().equals(from.getLabel())){
@@ -74,10 +76,10 @@
 				for(Transition t: transitions){
 					if(t.getTo().getLabel().equals(to)){
-						timePenalty = t.getTime();
+						time = t.getTime();
 					}
 				}
 			}
 		}
-		return timePenalty;
+		return time;
 	}
 
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/ui/ComputingResourcePowerInterface.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/ui/ComputingResourcePowerInterface.java	(revision 1415)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/ui/ComputingResourcePowerInterface.java	(revision 1423)
@@ -1,5 +1,4 @@
 package schedframe.resources.computing.profiles.energy.power.ui;
 
-import java.util.ArrayList;
 import java.util.List;
 
@@ -65,9 +64,5 @@
 
 	public List<PowerState> getSupportedPowerStates(){
-		List<PowerState> powerStates = new ArrayList<PowerState>();
-		for(PowerState powerState: powerProfile.getSupportedPowerStates()){
-			powerStates.add(powerState);
-		}
-		return powerStates;
+		return powerProfile.getSupportedPowerStates();
 	}
 
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/ui/PowerInterface.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/ui/PowerInterface.java	(revision 1380)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/ui/PowerInterface.java	(revision 1423)
@@ -24,5 +24,5 @@
 	//public double getCurrentPowerConsumption();
 	
-	List<PowerUsage> getPowerUsageHistory();
+	public List<PowerUsage> getPowerUsageHistory();
 	
 	public Parameters getParameters();
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/thermal/ui/ThermalInterface.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/thermal/ui/ThermalInterface.java	(revision 804)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/thermal/ui/ThermalInterface.java	(revision 1423)
@@ -10,5 +10,5 @@
 	public TemperatureValue getRecentTemperature();
 	
-	List<TemperatureValue> getTemperatureHistory();
+	public List<TemperatureValue> getTemperatureHistory();
 	
 	public Parameters getParameters();
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/load/LoadEstimationPluginFactory.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/load/LoadEstimationPluginFactory.java	(revision 1293)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/load/LoadEstimationPluginFactory.java	(revision 1423)
@@ -1,4 +1,5 @@
 package schedframe.resources.computing.profiles.load;
 
+import example.load.AppBasedProcessorLoadEstimationPlugin;
 import example.load.DefaultLoadEstimationPlugin;
 import example.load.ProcessorLoadEstimationPlugin;
@@ -14,5 +15,5 @@
 		
 		if(resType.getName().equals(StandardResourceType.Processor.getName()))
-			loadEstimationPlugin = new ProcessorLoadEstimationPlugin();
+			loadEstimationPlugin = new AppBasedProcessorLoadEstimationPlugin();
 		else
 			loadEstimationPlugin = new DefaultLoadEstimationPlugin();
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/load/LoadExtension.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/load/LoadExtension.java	(revision 1415)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/load/LoadExtension.java	(revision 1423)
@@ -19,5 +19,5 @@
   	protected PhysicalResource resource;
 
-	public LoadExtension(LoadProfile loadProfile,  PhysicalResource resource) {
+	public LoadExtension(LoadProfile loadProfile, PhysicalResource resource) {
 		this.loadProfile = loadProfile;
 		this.loadInterface =  LoadInterfaceFactory.createLoadInterface(resource, loadProfile);
@@ -29,7 +29,5 @@
 		if(loadProfile == null || loadProfile.getLoadEstimationPlugin() == null)
 			return false;
-		if(event.getType().getName().equals(ResourceEventType.POWER_STATE_CHANGED.getName()))
-			return true;
-		else if(event.getType().getName().equals(ResourceEventType.CPU_FREQUENCY_CHANGED.getName()))
+		if(event.getType().getName().equals(ResourceEventType.UTILIZATION_CHANGED.getName()))
 			return true;
 		else if(event.getType().getName().equals(ResourceEventType.TASK_STARTED.getName()))
@@ -37,6 +35,8 @@
 		else if(event.getType().getName().equals(ResourceEventType.TASK_FINISHED.getName()))
 			return true;
-		else if(event.getType().getName().equals(ResourceEventType.UTILIZATION_CHANGED.getName()))
-			return true;		
+		else if(event.getType().getName().equals(ResourceEventType.POWER_STATE_CHANGED.getName()))
+			return true;
+		else if(event.getType().getName().equals(ResourceEventType.CPU_FREQUENCY_CHANGED.getName()))
+			return true;
 		else return false;
 	}
@@ -44,31 +44,31 @@
 	public void handleEvent(Event event) {
 		
-		ResourceEvent enEvent = (ResourceEvent)event;
+		ResourceEvent resEvent = (ResourceEvent)event;
 		double load = 0;
 		try{
-			switch (enEvent.getType()) {
+			switch (resEvent.getType()) {
 			
+			case UTILIZATION_CHANGED:
+				load = loadProfile.getLoadEstimationPlugin().estimateUtlization(resEvent, new JobRegistryImpl(resource.getFullName()), resource);
+				loadProfile.addToLoadHistory(load);
+				break;
+				
+			case TASK_STARTED:
+				load = loadProfile.getLoadEstimationPlugin().estimateUtlization(resEvent, new JobRegistryImpl(resource.getFullName()), resource);
+				loadProfile.addToLoadHistory(load);
+				break;
+	
+			case TASK_FINISHED:
+				load = loadProfile.getLoadEstimationPlugin().estimateUtlization(resEvent, new JobRegistryImpl(resource.getFullName()), resource);
+				loadProfile.addToLoadHistory(load);
+				break;
+				
 			case POWER_STATE_CHANGED:
-				load = loadProfile.getLoadEstimationPlugin().estimateUtlization(enEvent, new JobRegistryImpl(resource.getFullName()), resource);
+				load = loadProfile.getLoadEstimationPlugin().estimateUtlization(resEvent, new JobRegistryImpl(resource.getFullName()), resource);
 				loadProfile.addToLoadHistory(load);
 				break;
 				
 			case CPU_FREQUENCY_CHANGED:
-				load = loadProfile.getLoadEstimationPlugin().estimateUtlization(enEvent, new JobRegistryImpl(resource.getFullName()), resource);
-				loadProfile.addToLoadHistory(load);
-				break;
-				
-			case TASK_STARTED:
-				load = loadProfile.getLoadEstimationPlugin().estimateUtlization(enEvent, new JobRegistryImpl(resource.getFullName()), resource);
-				loadProfile.addToLoadHistory(load);
-				break;
-	
-			case TASK_FINISHED:
-				load = loadProfile.getLoadEstimationPlugin().estimateUtlization(enEvent, new JobRegistryImpl(resource.getFullName()), resource);
-				loadProfile.addToLoadHistory(load);
-				break;
-				
-			case UTILIZATION_CHANGED:
-				load = loadProfile.getLoadEstimationPlugin().estimateUtlization(enEvent, new JobRegistryImpl(resource.getFullName()), resource);
+				load = loadProfile.getLoadEstimationPlugin().estimateUtlization(resEvent, new JobRegistryImpl(resource.getFullName()), resource);
 				loadProfile.addToLoadHistory(load);
 				break;
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/computing/ComputingResourceCharacteristics.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/computing/ComputingResourceCharacteristics.java	(revision 1207)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/computing/ComputingResourceCharacteristics.java	(revision 1423)
@@ -20,10 +20,9 @@
 		this.resUnits = builder.resUnits;
 		this.devices = builder.devices;
-		// TODO Auto-generated constructor stub
 	}
 
 	public Map<ResourceUnitName, List<ResourceUnit>> getResourceUnits() {
 		if(resUnits == null)
-			return new HashMap<ResourceUnitName, List<ResourceUnit>>();
+			return new HashMap<ResourceUnitName, List<ResourceUnit>>(2);
 		return resUnits;
 	}
@@ -54,5 +53,5 @@
 	public List<Device> getDevices(){
 		if(devices == null)
-			return new ArrayList<Device>();
+			return new ArrayList<Device>(0);
 		return devices;
 	}
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/computing/ComputingResource.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/computing/ComputingResource.java	(revision 1415)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/computing/ComputingResource.java	(revision 1423)
@@ -47,5 +47,5 @@
 	//protected ResourceCharacteristics resourceCharacteristic;
 
-
+	
 	public ComputingResource(ComputingResourceDescription resDesc) {
 		this.type = resDesc.getType();
@@ -53,12 +53,13 @@
 		this.category = resDesc.getCategory();
 		this.status = ResourceStatus.FREE;
-		this.extensionList = new ExtensionListImpl(1);
+		this.extensionList = new ExtensionListImpl(2);
 		initCharacteristics(resDesc);
 		accept(new LoadExtension(resDesc.getLoadProfile(), this));
 		accept(new EnergyExtension.Builder().resource(this).powerProfile(resDesc.getPowerProfile()).airflowProfile(resDesc.getAirflowProfile()).thermalProfile(resDesc.getThermalProfile()).build());	
+
 	}
 
 	protected void initCharacteristics(ComputingResourceDescription resDesc){
-		resourceCharacteristic = ComputingResourceCharacteristics.builder().resourceUnits(resDesc.getResourceUnits()).location(resDesc.getLocation()).parameters(resDesc.getParameters()).device(resDesc.getDevices()).build();
+		this.resourceCharacteristic = ComputingResourceCharacteristics.builder().resourceUnits(resDesc.getResourceUnits()).location(resDesc.getLocation()).parameters(resDesc.getParameters()).device(resDesc.getDevices()).build();
 		for(Device device: ((ComputingResourceCharacteristics)resourceCharacteristic).getDevices()){
 			device.setComputingResource(this);
@@ -71,5 +72,5 @@
 
 	public void setParent(ComputingResource newParent) {
-		parent = newParent;
+		this.parent = newParent;
 		/*if(this.getLoadInterface().getLoadCalendar().getLoadDistribution().size() == 0){
 			this.getLoadInterface().getLoadCalendar().getLoadDistribution().addAll(parent.getLoadInterface().getLoadCalendar().getLoadDistribution());
@@ -79,5 +80,5 @@
 	public List<ComputingResource> getChildren() {
 		if (children == null)
-			return new ArrayList<ComputingResource>(1);
+			return new ArrayList<ComputingResource>(0);
 		return children;
 	}
@@ -124,7 +125,8 @@
 		ResourceEventCommand rec = new ResourceEventCommand(this);
 		rec.execute(event);
-		SchedulingEventCommand sec = new SchedulingEventCommand(this);
-		sec.execute(event);
-
+		if((scheduler != null && (parent != null && scheduler != parent.getScheduler()))  && !event.getSource().equals(scheduler.getFullName())){
+			SchedulingEventCommand sec = new SchedulingEventCommand(this);
+			sec.execute(event);
+		}
 		//old, correctly working method
 		/*if (extensionList != null) {
@@ -143,6 +145,26 @@
 	}
 	
+
+	public void updateState(ResourceEvent event){
+		for (Device device: ((ComputingResourceCharacteristics)resourceCharacteristic).getDevices()) {
+			for (Extension extension: device.getExtensionList()) {
+				if (extension.supportsEvent(event)) {
+					extension.handleEvent(event);
+				}
+			}
+		}
+		
+		if (extensionList != null) {
+			for (Extension extension: extensionList) {
+				if (extension.supportsEvent(event)) {
+					extension.handleEvent(event);
+				}
+			}
+		}
+		
+	}
+	
 	public List <? extends ComputingResource> getDescendantsByType(ResourceType type) {
-		List<ResourceValidator> validators = new ArrayList<ResourceValidator>();
+		List<ResourceValidator> validators = new ArrayList<ResourceValidator>(1);
 		validators.add(new ResourceTypeValidator(type));
 		return searchDescendants(validators, true);
@@ -150,5 +172,5 @@
 
 	public List<? extends ComputingResource> getDescendantsByTypeAndStatus(ResourceType type, ResourceStatus status) {
-		List<ResourceValidator> validators = new ArrayList<ResourceValidator>();
+		List<ResourceValidator> validators = new ArrayList<ResourceValidator>(2);
 		validators.add(new ResourceStatusValidator(status));
 		validators.add(new ResourceTypeValidator(type));
@@ -157,5 +179,5 @@
 
 	public ComputingResource getDescendantByName(String resourceName){
-		List<ResourceValidator> validators = new ArrayList<ResourceValidator>();
+		List<ResourceValidator> validators = new ArrayList<ResourceValidator>(1);
 		validators.add(new ResourceNameValidator(resourceName));
 		List<? extends ComputingResource> resources = searchDescendants(validators, true);
@@ -227,16 +249,16 @@
 		
 		public void handleResourceEvent(ResourceEvent event){
+			for (Device device: ((ComputingResourceCharacteristics)resourceCharacteristic).getDevices()) {
+				for (Extension extension: device.getExtensionList()) {
+					if (extension.supportsEvent(event)) {
+						extension.handleEvent(event);
+					}
+				}
+			}
+			
 			if (extensionList != null) {
 				for (Extension extension: extensionList) {
 					if (extension.supportsEvent(event)) {
 						extension.handleEvent(event);
-					}
-				}
-				
-				for (Device device: ((ComputingResourceCharacteristics)resourceCharacteristic).getDevices()) {
-					for (Extension extension: device.getExtensionList()) {
-						if (extension.supportsEvent(event)) {
-							extension.handleEvent(event);
-						}
 					}
 				}
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/computing/ResourceCharacteristics.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/computing/ResourceCharacteristics.java	(revision 1207)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/computing/ResourceCharacteristics.java	(revision 1423)
@@ -30,5 +30,5 @@
 	public Parameters getParameters() {
 		if(parameters == null)
-			return new Parameters();
+			return new Parameters(2);
 		return parameters;
 	}
