Index: DCWoRMS/branches/coolemall/src/schedframe/resources/StandardResourceType.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/StandardResourceType.java	(revision 1095)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/StandardResourceType.java	(revision 1207)
@@ -7,5 +7,5 @@
 	DataCenter,
 	Rack,
-	ComputingNode,
+	Node,
 	Processor,
 	Core,
@@ -13,5 +13,19 @@
 	ResourceProvider,
 	GS,
-	LS;
+	LS,
+	Fan,
+	Refrigeration,
+	Heatpipe,
+	ILC,
+	LCU,
+	CRAH,
+	HVAC,
+	Inlet,
+	Outlet,
+	Heatsink,
+	Sensor,
+	Network,
+	CoolingDevice,
+	PowerSupply;
 
 	public String getName() {
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/utils/ResourceIdGenerator.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/utils/ResourceIdGenerator.java	(revision 816)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/utils/ResourceIdGenerator.java	(revision 1207)
@@ -2,6 +2,4 @@
 
 import java.util.HashMap;
-
-import schedframe.resources.ResourceType;
 
 public class ResourceIdGenerator {
@@ -11,5 +9,5 @@
 	public static int getId(String key){
 
-		int value = 0;
+		int value = 1;
 		if(resourceCounter.containsKey(key)){
 			value = resourceCounter.get(key);
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/CoolEmAllResourceType.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/CoolEmAllResourceType.java	(revision 1095)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/CoolEmAllResourceType.java	(revision 1207)
@@ -3,13 +3,21 @@
 public enum CoolEmAllResourceType implements ResourceType {
 	
-	ComputeBox2,
-	ComputeBox1,
-	NodeGroup,
-	Node,
-	Processor,
-	Core;
-
+	ComputeBox2("Room"),
+	ComputeBox1("Rack"),
+	NodeGroup("NodeGroup"),
+	Node("Node"),
+	Processor("Processor"),
+	Core("Core");
+	
+	private String label;
+	
+	CoolEmAllResourceType(String label){
+		this.label = label;
+	}
 	public String getName() {
 		return toString();
 	}
+	public String getLabel(){
+		return label;
+	}
 }
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/ResourceTypeFactory.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/ResourceTypeFactory.java	(revision 1097)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/ResourceTypeFactory.java	(revision 1207)
@@ -5,5 +5,5 @@
 	
 	public static ResourceType createResourceType(String typeName){
-		
+
 		if(typeName.equals(StandardResourceType.Grid.getName()))
 			return StandardResourceType.Grid;
@@ -15,6 +15,6 @@
 			return StandardResourceType.Rack;
 
-		else if (typeName.equals(StandardResourceType.ComputingNode.getName()))
-			return StandardResourceType.ComputingNode;
+		else if (typeName.equals(StandardResourceType.Node.getName()))
+			return StandardResourceType.Node;
 		
 		else if (typeName.equals(StandardResourceType.Processor.getName()))
@@ -24,4 +24,7 @@
 			return StandardResourceType.Core;
 		
+		else if (typeName.equals(CoolEmAllResourceType.ComputeBox2.getName()))
+			return CoolEmAllResourceType.ComputeBox2;
+		
 		else if (typeName.equals(CoolEmAllResourceType.ComputeBox1.getName()))
 			return CoolEmAllResourceType.ComputeBox1;
@@ -30,6 +33,21 @@
 			return CoolEmAllResourceType.NodeGroup;
 		
-		else if (typeName.equals(CoolEmAllResourceType.Node.getName()))
-			return CoolEmAllResourceType.Node;
+		else if (typeName.equals(StandardResourceType.CRAH.getName()))
+			return StandardResourceType.CRAH;
+		
+		else if (typeName.equals(StandardResourceType.Fan.getName()))
+			return StandardResourceType.Fan;
+		
+		else if (typeName.equals(StandardResourceType.Inlet.getName()))
+			return StandardResourceType.Inlet;
+		
+		else if (typeName.equals(StandardResourceType.Outlet.getName()))
+			return StandardResourceType.Outlet;
+		
+		else if (typeName.equals(StandardResourceType.CoolingDevice.getName()))
+			return StandardResourceType.CoolingDevice;
+		
+		else if (typeName.equals(StandardResourceType.Heatsink.getName()))
+			return StandardResourceType.Heatsink;
 		
 		else if (typeName.equals(StandardResourceType.ResourceProvider.getName()))
@@ -42,5 +60,5 @@
 			return StandardResourceType.LS;
 		
-		else return new UserResourceType(typeName);
+		return new UserResourceType(typeName);
 	}
 }
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/ResourceHistoryChanges.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/ResourceHistoryChanges.java	(revision 1207)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/ResourceHistoryChanges.java	(revision 1207)
@@ -0,0 +1,34 @@
+package schedframe.resources;
+
+
+public class ResourceHistoryChanges {
+	
+	private long timestamp;	
+	private String resourceName;
+	private String operation;
+	private String paramter;
+	
+	public ResourceHistoryChanges(long timestamp, String resourceName, String operation, String paramter) {
+		super();
+		this.timestamp = timestamp;
+		this.resourceName = resourceName;
+		this.operation = operation;
+		this.paramter = paramter;
+	}
+	
+	public long getTimestamp() {
+		return timestamp;
+	}
+	
+	public String getResourceName() {
+		return resourceName;
+	}
+	
+	public String getOperation() {
+		return operation;
+	}
+	
+	public String getParamter() {
+		return paramter;
+	}
+}
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/devices/PhysicalResource.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/devices/PhysicalResource.java	(revision 1207)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/devices/PhysicalResource.java	(revision 1207)
@@ -0,0 +1,100 @@
+package schedframe.resources.devices;
+
+import schedframe.Initializable;
+import schedframe.events.Event;
+import schedframe.events.EventHandler;
+import schedframe.resources.Resource;
+import schedframe.resources.ResourceStatus;
+import schedframe.resources.ResourceType;
+import schedframe.resources.computing.ResourceCharacteristics;
+import schedframe.resources.computing.extensions.Extension;
+import schedframe.resources.computing.extensions.ExtensionList;
+import schedframe.resources.computing.extensions.ExtensionType;
+import schedframe.resources.computing.profiles.energy.EnergyExtension;
+import schedframe.resources.computing.profiles.energy.airthroughput.ui.AirThroughputInterface;
+import schedframe.resources.computing.profiles.energy.power.ui.PowerInterface;
+import schedframe.resources.computing.profiles.energy.thermal.ui.ThermalInterface;
+
+public abstract class PhysicalResource implements Resource, Initializable{
+
+	protected String name;
+	protected ResourceType type;
+	protected String category;
+	protected ResourceStatus status;
+	protected ResourceCharacteristics resourceCharacteristic;
+	protected ExtensionList extensionList;
+
+	
+	public abstract void handleEvent(Event event);
+	
+	public abstract EventHandler getEventHandler();
+	
+	public String getName() {
+		return name;
+	}
+
+	public ResourceType getType() {
+		return type;
+	}
+
+	public String getCategory(){
+		return category;
+	}
+	
+	public abstract void setStatus(ResourceStatus newStatus);
+	
+	public ResourceStatus getStatus() {
+		return status;
+	}
+	
+	private Extension getExtension(ExtensionType type){
+		if (extensionList != null) {
+			for (Extension extension : extensionList) {
+				if (extension.getType() == type) {
+					return extension;
+				}
+			}
+		}
+		return null;
+	}
+	
+	public PowerInterface getPowerInterface(){
+		Extension extension = getExtension(ExtensionType.ENERGY_EXTENSION);
+		if(extension != null){
+			EnergyExtension ee = (EnergyExtension)extension;
+			return ee.getPowerInterface();
+		}
+		return null;
+	}
+	
+	public AirThroughputInterface getAirThroughputInterface(){
+		Extension extension = getExtension(ExtensionType.ENERGY_EXTENSION);
+		if(extension != null){
+			EnergyExtension ee = (EnergyExtension)extension;
+			return ee.getAirThroughputInterface();
+		}
+		return null;
+	}
+	
+	public ThermalInterface getThermalInterface(){
+		Extension extension = getExtension(ExtensionType.ENERGY_EXTENSION);
+		if(extension != null){
+			EnergyExtension ee = (EnergyExtension)extension;
+			return ee.getThermalInterface();
+		}
+		return null;
+	}
+	
+	public ExtensionList getExtensionList() {
+		return extensionList;
+	}
+	
+	protected void accept(Extension e){
+		extensionList.add(e);
+	}
+
+	public ResourceCharacteristics getResourceCharacteristic() {
+		return resourceCharacteristic;
+	}
+	
+}
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/devices/DeviceEnergyExtension.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/devices/DeviceEnergyExtension.java	(revision 1207)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/devices/DeviceEnergyExtension.java	(revision 1207)
@@ -0,0 +1,227 @@
+package schedframe.resources.devices;
+
+import java.util.Properties;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import schedframe.events.Event;
+import schedframe.resources.computing.ComputingResource;
+import schedframe.resources.computing.extensions.Extension;
+import schedframe.resources.computing.extensions.ExtensionException;
+import schedframe.resources.computing.extensions.ExtensionType;
+import schedframe.resources.computing.profiles.energy.EnergyEvent;
+import schedframe.resources.computing.profiles.energy.EnergyEventType;
+import schedframe.resources.computing.profiles.energy.EnergyExtension;
+import schedframe.resources.computing.profiles.energy.EnergyExtension.Builder;
+import schedframe.resources.computing.profiles.energy.airthroughput.AirThroughputInterfaceFactory;
+import schedframe.resources.computing.profiles.energy.airthroughput.AirThroughputProfile;
+import schedframe.resources.computing.profiles.energy.airthroughput.ui.AirThroughputInterface;
+import schedframe.resources.computing.profiles.energy.power.PowerInterfaceFactory;
+import schedframe.resources.computing.profiles.energy.power.PowerProfile;
+import schedframe.resources.computing.profiles.energy.power.ui.PowerInterface;
+import schedframe.resources.computing.profiles.energy.thermal.ThermalInterfaceFactory;
+import schedframe.resources.computing.profiles.energy.thermal.ThermalProfile;
+import schedframe.resources.computing.profiles.energy.thermal.ui.ThermalInterface;
+import schedframe.scheduling.manager.tasks.JobRegistryImpl;
+import simulator.DataCenterWorkloadSimulator;
+
+public class DeviceEnergyExtension implements Extension{
+
+	private Log log = LogFactory.getLog(EnergyExtension.class);
+
+	protected PowerInterface powerInterface;
+	protected PowerProfile powerProfile;
+	
+	protected AirThroughputInterface airFlowInterface;
+	protected AirThroughputProfile airFlowProfile;
+	
+	protected ThermalInterface thermalInterface;
+	protected ThermalProfile thermalProfile;
+	
+  	protected PhysicalResource resource;
+
+
+	public static class Builder {
+		  
+		protected PhysicalResource resource;
+		protected PowerInterface powerInterface;
+		protected PowerProfile powerProfile;
+		
+		protected AirThroughputInterface airFlowInterface;
+		protected AirThroughputProfile airFlowProfile;
+		
+		protected ThermalInterface thermalInterface;
+		protected ThermalProfile thermalProfile;
+		
+		public Builder resource(PhysicalResource res) {this.resource = res; return this;}
+		
+		public Builder powerProfile(PowerProfile pp){this.powerProfile = pp; this.powerInterface = PowerInterfaceFactory.createPowerInterface(resource, powerProfile); return this; }
+
+        public Builder airFlowProfile(AirThroughputProfile atp){this.airFlowProfile = atp; this.airFlowInterface = AirThroughputInterfaceFactory.createAirThroughputInterface(resource, airFlowProfile); return this; }
+
+        public Builder thermalProfile(ThermalProfile tp){this.thermalProfile = tp; this.thermalInterface = ThermalInterfaceFactory.createThermalInterface(resource, thermalProfile); return this; }
+
+        public DeviceEnergyExtension build() {
+            return new DeviceEnergyExtension(this);
+        }
+	}
+	
+	private DeviceEnergyExtension(Builder builder) {
+		this.resource = builder.resource;
+		this.powerInterface = builder.powerInterface;
+		this.powerProfile = builder.powerProfile;
+		
+		this.airFlowInterface = builder.airFlowInterface ;
+		this.airFlowProfile = builder.airFlowProfile;
+		
+		this.thermalInterface = builder.thermalInterface;
+		this.thermalProfile = builder.thermalProfile;
+	}
+
+	
+	public boolean supportsEvent(Event event) {
+
+		if(powerProfile == null || powerProfile.getEnergyEstimationPlugin() == null)
+			return false;
+		if(event.getType().getName().equals(EnergyEventType.POWER_STATE_CHANGED.getName()))
+			return true;
+		else if(event.getType().getName().equals(EnergyEventType.FREQUENCY_CHANGED.getName()))
+			return true;
+		else if(event.getType().getName().equals(EnergyEventType.TASK_STARTED.getName()))
+			return true;
+		else if(event.getType().getName().equals(EnergyEventType.TASK_FINISHED.getName()))
+			return true;
+		else if(event.getType().getName().equals(EnergyEventType.RESOURCE_UTILIZATION_CHANGED.getName()))
+			return true;
+	
+		if(event.getType().getName().equals(EnergyEventType.AIRFLOW_STATE_CHANGED.getName()))
+			return true;
+		if(event.getType().getName().equals(EnergyEventType.TEMPERATURE_CHANGED.getName()))
+			return true;
+		
+		else return false;
+	}
+
+	public void handleEvent(Event event) {
+		
+		EnergyEvent enEvent = (EnergyEvent)event;
+		double power = 0;
+		boolean status = false;
+		try{
+			switch (enEvent.getType()) {
+			
+			case POWER_STATE_CHANGED:
+				power = powerProfile.getEnergyEstimationPlugin().estimatePowerConsumption(enEvent, new JobRegistryImpl(resource.getFullName()), resource);
+				/*if(computingResource instanceof ComputingNode){
+					ComputingNode node = (ComputingNode)computingResource;
+					if(event.getData() instanceof PowerState){
+						PowerState newState = (PowerState)event.getData();
+						if(newState == PowerState.ON) {
+							addToPowerUsageHistory(power+node.getPowerInterface().START_COST);
+							addToPowerUsageHistory(DateTimeUtils.currentTimeMillis() + node.getPowerInterface().START_TIME, power);
+						}else if(newState == PowerState.OFF){
+							addToPowerUsageHistory(power+node.getPowerInterface().SHUTDOWN_COST);
+							addToPowerUsageHistory(DateTimeUtils.currentTimeMillis() + node.getPowerInterface().SHUTDOWN_TIME, power);
+						}
+					}
+				}
+				else*/ 
+				
+				status = powerProfile.addToPowerUsageHistory(power);
+				//temperature = powerProfile.getEnergyEstimationPlugin().estimateTemperature(enEvent, new JobRegistryImpl(computingResource.getName()), computingResource);
+				//thermalProfile.addToTemperatureHistory(temperature);
+				break;
+				
+			case FREQUENCY_CHANGED:
+				power = powerProfile.getEnergyEstimationPlugin().estimatePowerConsumption(enEvent, new JobRegistryImpl(resource.getFullName()), resource);
+				status = powerProfile.addToPowerUsageHistory(power);
+				//temperature = powerProfile.getEnergyEstimationPlugin().estimateTemperature(enEvent, new JobRegistryImpl(computingResource.getName()), computingResource);
+				//thermalProfile.addToTemperatureHistory(temperature);
+				break;
+				
+			case TASK_STARTED:
+				power = powerProfile.getEnergyEstimationPlugin().estimatePowerConsumption(enEvent, new JobRegistryImpl(resource.getFullName()), resource);
+				status = powerProfile.addToPowerUsageHistory(power);
+				//temperature = powerProfile.getEnergyEstimationPlugin().estimateTemperature(enEvent, new JobRegistryImpl(computingResource.getName()), computingResource);
+				//thermalProfile.addToTemperatureHistory(temperature);
+				break;
+	
+			case TASK_FINISHED:
+				power = powerProfile.getEnergyEstimationPlugin().estimatePowerConsumption(enEvent, new JobRegistryImpl(resource.getFullName()), resource);
+				status = powerProfile.addToPowerUsageHistory(power);
+				//temperature = powerProfile.getEnergyEstimationPlugin().estimateTemperature(enEvent, new JobRegistryImpl(computingResource.getName()), computingResource);
+				//thermalProfile.addToTemperatureHistory(temperature);
+				break;
+				
+			case RESOURCE_UTILIZATION_CHANGED:
+				power = powerProfile.getEnergyEstimationPlugin().estimatePowerConsumption(enEvent, new JobRegistryImpl(resource.getFullName()), resource);
+				status = powerProfile.addToPowerUsageHistory(power);
+				//temperature = powerProfile.getEnergyEstimationPlugin().estimateTemperature(enEvent, new JobRegistryImpl(computingResource.getName()), computingResource);
+				//thermalProfile.addToTemperatureHistory(temperature);
+				break;
+				
+			case AIRFLOW_STATE_CHANGED:
+				double airFlow = powerProfile.getEnergyEstimationPlugin().estimateAirThroughput(enEvent, new JobRegistryImpl(resource.getFullName()), resource);
+				airFlowProfile.addToAirFlowHistory(airFlow);
+				power = powerProfile.getEnergyEstimationPlugin().estimatePowerConsumption(enEvent, new JobRegistryImpl(resource.getFullName()), resource);
+				powerProfile.addToPowerUsageHistory(power);
+				//temperature = powerProfile.getEnergyEstimationPlugin().estimateTemperature(enEvent, new JobRegistryImpl(computingResource.getName()), computingResource);
+				//thermalProfile.addToTemperatureHistory(temperature);
+				break;
+				
+			case TEMPERATURE_CHANGED:
+				double temperature = powerProfile.getEnergyEstimationPlugin().estimateTemperature(enEvent, new JobRegistryImpl(resource.getFullName()), resource);
+				thermalProfile.addToTemperatureHistory(temperature);
+				break;
+			}
+		}catch(Exception e){
+			
+		}
+		if(status){
+			DataCenterWorkloadSimulator.getEventManager().sendToResources(resource.getType(), 0, new EnergyEvent(EnergyEventType.TEMPERATURE_CHANGED, resource.getFullName()));
+
+		}
+	}
+
+	public void init(Properties properties) throws ExtensionException {
+		// TODO Auto-generated method stub
+	}
+
+	public ExtensionType getType() {
+		return ExtensionType.ENERGY_EXTENSION;
+	}
+
+	/*public ComputingResource getResource() {
+		return computingResource;
+	}
+
+	public void setResource(ComputingResource compRes){
+		this.computingResource = compRes;
+	}*/
+
+	public PowerInterface getPowerInterface() {
+		return powerInterface;
+	}
+
+	public PowerProfile getPowerProfile() {
+		return powerProfile;
+	}
+
+	public AirThroughputInterface getAirThroughputInterface() {
+		return airFlowInterface;
+	}
+
+	public AirThroughputProfile getAirFlowProfile() {
+		return airFlowProfile;
+	}
+	
+	public ThermalProfile getThermalProfile() {
+		return thermalProfile;
+	}
+
+	public ThermalInterface getThermalInterface() {
+		return thermalInterface;
+	}
+
+}
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/devices/coolemall/FanAirThroughputInterface.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/devices/coolemall/FanAirThroughputInterface.java	(revision 1207)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/devices/coolemall/FanAirThroughputInterface.java	(revision 1207)
@@ -0,0 +1,22 @@
+package schedframe.resources.devices.coolemall;
+
+import schedframe.resources.computing.profiles.energy.airthroughput.AirThroughputProfile;
+import schedframe.resources.computing.profiles.energy.airthroughput.UserAirThroughputStateName;
+import schedframe.resources.devices.PhysicalResource;
+import schedframe.resources.devices.PhysicalResourceAirThroughputInterface;
+
+public class FanAirThroughputInterface extends PhysicalResourceAirThroughputInterface {
+
+	public FanAirThroughputInterface(PhysicalResource resource, AirThroughputProfile airThroughputProfile) {
+		super(resource, airThroughputProfile);
+		this.currentAirThroughputState = new UserAirThroughputStateName("2");
+	}
+	
+	public boolean turnOn(){
+		return setAirThroughputState(new UserAirThroughputStateName("2"));
+	}
+
+	public boolean turnOff(){
+		return setAirThroughputState(new UserAirThroughputStateName("1"));
+	}
+}
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/devices/PhysicalResourceAirThroughputInterface.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/devices/PhysicalResourceAirThroughputInterface.java	(revision 1207)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/devices/PhysicalResourceAirThroughputInterface.java	(revision 1207)
@@ -0,0 +1,111 @@
+package schedframe.resources.devices;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.joda.time.DateTimeUtils;
+
+import schedframe.Parameters;
+import schedframe.resources.computing.profiles.energy.EnergyEvent;
+import schedframe.resources.computing.profiles.energy.EnergyEventType;
+import schedframe.resources.computing.profiles.energy.airthroughput.AirFlowValue;
+import schedframe.resources.computing.profiles.energy.airthroughput.AirThroughputProfile;
+import schedframe.resources.computing.profiles.energy.airthroughput.AirThroughputState;
+import schedframe.resources.computing.profiles.energy.airthroughput.AirThroughputStateName;
+import schedframe.resources.computing.profiles.energy.airthroughput.StandardAirThroughputStateName;
+import schedframe.resources.computing.profiles.energy.airthroughput.ui.AirThroughputInterface;
+
+public class PhysicalResourceAirThroughputInterface implements AirThroughputInterface{
+
+	protected AirThroughputStateName currentAirThroughputState;
+	protected AirThroughputProfile airThroughputProfile;
+	protected PhysicalResource resource;
+	
+	public PhysicalResourceAirThroughputInterface(PhysicalResource resource, AirThroughputProfile airThroughputProfile){
+		this.resource = resource;
+		this.airThroughputProfile = airThroughputProfile;
+		this.currentAirThroughputState = StandardAirThroughputStateName.ON;
+	}
+	
+	public AirThroughputStateName getAirThroughputState() {
+		return currentAirThroughputState;
+	}
+
+	public boolean setAirThroughputState(AirThroughputStateName state) {
+		if(supportAirThroughputState(state)){
+			currentAirThroughputState = state;
+			
+			//TO DO - notifications should be called for all resources starting form the lowest layer
+			resource.handleEvent(new EnergyEvent(EnergyEventType.AIRFLOW_STATE_CHANGED, resource.getFullName()));
+			resource.handleEvent(new EnergyEvent(EnergyEventType.POWER_STATE_CHANGED, resource.getFullName()));
+			return true;
+		}
+		return false;
+	}
+
+	public boolean supportAirThroughputState(AirThroughputStateName state) {
+		for(AirThroughputState airFlowState: airThroughputProfile.getAirThroughputStates()){
+			if(airFlowState.getName().equals(state.getName())){
+				return true;
+			}
+		}
+		return false;
+	}
+
+	public List<AirThroughputState> getSupportedAirThroughputStates() throws NoSuchFieldException {
+		List<AirThroughputState> airThroughputStates = new ArrayList<AirThroughputState>();
+		for(AirThroughputState airFlowState: airThroughputProfile.getAirThroughputStates()){
+			airThroughputStates.add(airFlowState);
+		}
+		return airThroughputStates;
+	}
+
+	public double getAirFlow(AirThroughputStateName state) throws NoSuchFieldException {
+		double airThroughput = 0;
+		if(supportAirThroughputState(state)){
+			for(AirThroughputState airFlowState: airThroughputProfile.getAirThroughputStates()){
+				if(airFlowState.getName().equals(state.getName())){
+					airThroughput = airFlowState.getValue();
+					break;
+				}
+			}
+		}
+		return airThroughput;
+	}
+
+	public double getPowerConsumption(AirThroughputStateName state) throws NoSuchFieldException {
+		double powerConsumption = 0;
+		if(supportAirThroughputState(state)){
+			for(AirThroughputState airFlowState: airThroughputProfile.getAirThroughputStates()){
+				if(airFlowState.getName().equals(state.getName())){
+					powerConsumption = airFlowState.getPowerUsage();
+					break;
+				}
+			}
+		}
+		return powerConsumption;
+	}
+	
+	public AirFlowValue getRecentAirFlow() {
+		AirFlowValue airFlow = null;
+		int lastIdx = getAirFlowHistory().size() - 1;
+		if(lastIdx >= 0)
+			airFlow = getAirFlowHistory().get(lastIdx);
+		else {	
+			try {
+				airFlow = new AirFlowValue(DateTimeUtils.currentTimeMillis(), getAirFlow(currentAirThroughputState));
+			} catch (NoSuchFieldException e) {
+			}
+		}
+		return airFlow;
+	}
+	
+	public List<AirFlowValue> getAirFlowHistory(){
+		return airThroughputProfile.getAirThroughputHistory();
+	}
+	
+	public Parameters getParameters() {
+		return airThroughputProfile.getParameters();
+	}
+
+}
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/devices/Device.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/devices/Device.java	(revision 1207)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/devices/Device.java	(revision 1207)
@@ -0,0 +1,109 @@
+package schedframe.resources.devices;
+
+import schedframe.events.Event;
+import schedframe.events.EventHandler;
+import schedframe.events.ResourceEventCommand;
+import schedframe.events.scheduling.EventReason;
+import schedframe.events.scheduling.SchedulingEvent;
+import schedframe.resources.ResourceStatus;
+import schedframe.resources.computing.ComputingResource;
+import schedframe.resources.computing.ResourceCharacteristics;
+import schedframe.resources.computing.extensions.Extension;
+import schedframe.resources.computing.extensions.ExtensionListImpl;
+import schedframe.resources.computing.profiles.energy.EnergyEvent;
+import schedframe.resources.computing.profiles.energy.EnergyEventType;
+import schedframe.resources.computing.profiles.energy.EnergyExtension;
+import schedframe.resources.devices.description.DeviceDescription;
+
+public class Device extends PhysicalResource{
+
+	private ComputingResource compResource;
+	
+	public Device (DeviceDescription devDesc){
+		this.type = devDesc.getType();
+		this.name = devDesc.getId();
+		this.extensionList = new ExtensionListImpl(1);
+		initCharacteristics(devDesc);
+		accept(new EnergyExtension.Builder().resource(this).powerProfile(devDesc.getPowerProfile()).airFlowProfile(devDesc.getAirThroughputProfile()).thermalProfile(devDesc.getThermalProfile()).build());	
+	}
+
+	public String getFullName() {
+		
+		if(this.getResourceCharacteristic().getParameters().get("fullPath") != null){
+			String fullPath = this.getResourceCharacteristic().getParameters().get("fullPath").get(0).getContent();
+			return fullPath;
+		}
+		else 
+			return compResource.getFullName() + "/" + name;
+	}
+
+	public void setStatus(ResourceStatus newStatus) {
+		if(newStatus != status){
+			status = newStatus;
+		}
+	}
+
+	public void handleEvent(Event event) {
+		ResourceEventCommand rec = new ResourceEventCommand(this);
+		rec.execute(event);
+	}
+	
+	class DeviceEventHandler implements EventHandler{
+		
+		public void handleResourceEvent(Event event){
+			if (extensionList != null) {
+				for (Extension extension : extensionList) {
+					if (extension.supportsEvent(event)) {
+						extension.handleEvent(event);
+					}
+				}
+			}
+			if(event.getReason() != EventReason.SIM_INIT)
+				compResource.handleEvent(event);
+		}
+		
+		public void handleSchedulingEvent(SchedulingEvent event){
+
+		}
+	}
+	
+	public EventHandler getEventHandler(){
+		return new DeviceEventHandler();
+	}
+	
+	public final void initiate(){
+		
+		ResourceEventCommand rec = new ResourceEventCommand(this);
+		EnergyEvent event = new EnergyEvent(EnergyEventType.AIRFLOW_STATE_CHANGED, "Resource controller");
+		event.setReason(EventReason.SIM_INIT);
+		rec.execute(event);
+		
+		rec = new ResourceEventCommand(this);
+		event = new EnergyEvent(EnergyEventType.POWER_STATE_CHANGED, "Resource controller");
+		event.setReason(EventReason.SIM_INIT);
+		rec.execute(event);
+		
+		rec = new ResourceEventCommand(this);
+		event = new EnergyEvent(EnergyEventType.TEMPERATURE_CHANGED, "Resource controller");
+		event.setReason(EventReason.SIM_INIT);
+		rec.execute(event);
+			
+		//alternative way
+		//getEventHandler().handleResourceEvent(new EnergyEvent(EnergyEventType.AIRFLOW_STATE_CHANGED, "Resource controller"));
+		//getEventHandler().handleResourceEvent(new EnergyEvent(EnergyEventType.POWER_STATE_CHANGED, "Resource controller"));
+		//getEventHandler().handleResourceEvent(new EnergyEvent(EnergyEventType.TEMPERATURE_CHANGED, "Resource controller"));
+	}
+
+	protected void initCharacteristics(DeviceDescription devDesc){
+		resourceCharacteristic = ResourceCharacteristics.builder().location(devDesc.getLocation()).parameters(devDesc.getParameters()).build();
+	}
+
+	public void setComputingResource(ComputingResource compResource) {
+		this.compResource = compResource;
+	}
+
+	public ComputingResource getComputingResource() {
+		return compResource;
+	}
+
+}
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/devices/PhysicalResourcePowerInterface.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/devices/PhysicalResourcePowerInterface.java	(revision 1207)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/devices/PhysicalResourcePowerInterface.java	(revision 1207)
@@ -0,0 +1,101 @@
+package schedframe.resources.devices;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.joda.time.DateTimeUtils;
+
+import schedframe.Parameters;
+import schedframe.resources.computing.profiles.energy.EnergyEvent;
+import schedframe.resources.computing.profiles.energy.EnergyEventType;
+import schedframe.resources.computing.profiles.energy.power.PowerProfile;
+import schedframe.resources.computing.profiles.energy.power.PowerState;
+import schedframe.resources.computing.profiles.energy.power.PowerStateName;
+import schedframe.resources.computing.profiles.energy.power.PowerUsage;
+import schedframe.resources.computing.profiles.energy.power.StandardPowerStateName;
+import schedframe.resources.computing.profiles.energy.power.ui.PowerInterface;
+
+public class PhysicalResourcePowerInterface implements PowerInterface{
+
+	protected PowerStateName currentPowerState;
+	protected PowerProfile powerProfile;
+	protected PhysicalResource resource;
+	
+	public PhysicalResourcePowerInterface(PhysicalResource resource, PowerProfile powerProfile){
+		this.resource = resource;
+		this.powerProfile = powerProfile;
+		this.currentPowerState = StandardPowerStateName.ON;
+	}
+	
+	public boolean setPowerState(PowerStateName state) {
+		if(supportPowerState(state)){
+			currentPowerState = state;
+
+			resource.handleEvent(new EnergyEvent(EnergyEventType.POWER_STATE_CHANGED, resource.getFullName()));
+
+			return true;
+		}
+		return false;
+	}
+	
+
+	public PowerStateName getPowerState() {
+		return currentPowerState;
+	}
+
+	public List<PowerState> getSupportedPowerStates() throws NoSuchFieldException {
+		List<PowerState> powerStates = new ArrayList<PowerState>();
+		for(PowerState powerState: powerProfile.getSupportedPowerStates()){
+			powerStates.add(powerState);
+		}
+		return powerStates;
+	}
+
+	public boolean supportPowerState(PowerStateName state) {
+		for(PowerState powerState: powerProfile.getSupportedPowerStates()){
+			if(powerState.getName().equals(state)){
+				return true;
+			}
+		}
+		return false;
+		
+	}
+	
+	public double getPowerConsumption(PowerStateName state) throws NoSuchFieldException {
+		double powerConsumption = 0;
+		if(supportPowerState(state)){
+			for(PowerState powerState: powerProfile.getSupportedPowerStates()){
+				if(powerState.getName().equals(state)){
+					powerConsumption = powerState.getPowerUsage();
+					break;
+				}
+			}
+		} else {
+			throw new NoSuchFieldException("Power state not supported");
+		}
+		return powerConsumption;
+	}
+
+	public PowerUsage getRecentPowerUsage() {
+		PowerUsage powerUsage = null;
+		int lastIdx = getPowerUsageHistory().size() - 1;
+		if(lastIdx >= 0)
+			powerUsage = getPowerUsageHistory().get(lastIdx);
+		else {	
+			try {
+				powerUsage = new PowerUsage(DateTimeUtils.currentTimeMillis(), getPowerConsumption(currentPowerState));
+			} catch (NoSuchFieldException e) {
+			}
+		}
+		return powerUsage;
+	}
+	
+	public List<PowerUsage> getPowerUsageHistory(){
+		return powerProfile.getPowerUsageHistory();
+	}
+	
+	public Parameters getParameters() {
+		return powerProfile.getParameters();
+	}
+
+}
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/devices/PhysicalResourceThermalInterface.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/devices/PhysicalResourceThermalInterface.java	(revision 1207)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/devices/PhysicalResourceThermalInterface.java	(revision 1207)
@@ -0,0 +1,43 @@
+package schedframe.resources.devices;
+
+import java.util.List;
+
+import org.joda.time.DateTimeUtils;
+
+import schedframe.Parameters;
+import schedframe.resources.computing.profiles.energy.thermal.TemperatureValue;
+import schedframe.resources.computing.profiles.energy.thermal.ThermalProfile;
+import schedframe.resources.computing.profiles.energy.thermal.ui.ThermalInterface;
+
+public class PhysicalResourceThermalInterface implements ThermalInterface{
+
+	private static int START_TEMP = 0;
+	protected PhysicalResource resource;
+	protected ThermalProfile thermalProfile;
+
+	public PhysicalResourceThermalInterface(PhysicalResource resource, ThermalProfile thermalProfile) {
+		super();
+		this.resource = resource;
+		this.thermalProfile = thermalProfile;
+	}
+
+	public TemperatureValue getRecentTemperature() {
+		TemperatureValue temperature = null;
+		int lastIdx = getTemperatureHistory().size() - 1;
+		if(lastIdx >= 0)
+			temperature = getTemperatureHistory().get(lastIdx);
+		else {	
+			temperature = new TemperatureValue(DateTimeUtils.currentTimeMillis(), START_TEMP);
+		}
+		return temperature;
+	}
+
+	public List<TemperatureValue> getTemperatureHistory() {
+		return thermalProfile.getTemperatureHistory();
+	}
+
+	public Parameters getParameters() {
+		return thermalProfile.getParameters();
+	}
+
+}
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 1207)
@@ -0,0 +1,13 @@
+package schedframe.resources.devices;
+
+import schedframe.resources.computing.ResourceCharacteristics;
+
+public class DeviceResourceCharacteristics extends ResourceCharacteristics{
+
+	protected DeviceResourceCharacteristics(Builder<?> builder) {
+		super(builder);
+		// TODO Auto-generated constructor stub
+	}
+
+
+}
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/devices/description/DeviceDescription.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/devices/description/DeviceDescription.java	(revision 1207)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/devices/description/DeviceDescription.java	(revision 1207)
@@ -0,0 +1,31 @@
+package schedframe.resources.devices.description;
+
+import schedframe.resources.ResourceTypeFactory;
+import schedframe.resources.utils.ResourceIdGenerator;
+
+public class DeviceDescription extends PhysicalResourceDescription{
+	
+	
+	public DeviceDescription(schemas.Device device) {
+
+		super(ResourceTypeFactory.createResourceType(device.getClazz()));
+		this.category = device.getType();
+		
+		initId(device);
+
+		if (device.getDeviceTypeChoiceSequence() != null) {
+			initProfiles(device.getDeviceTypeChoiceSequence().getProfile());
+			initLocation(device.getDeviceTypeChoiceSequence().getLocation());
+			this.parameters = extractParameters(device.getDeviceTypeChoiceSequence().getParameter());
+		}
+	}
+
+	private void initId(schemas.Device device){
+		this.id = device.getName() != null ? device.getName() : type.getName();
+		if(device.getCount() > 1 || device.getName() == null){
+			this.id = id + "_" + String.valueOf(ResourceIdGenerator.getId(type.getName()));
+		}
+	}
+	
+
+}
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/devices/description/PhysicalResourceDescription.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/devices/description/PhysicalResourceDescription.java	(revision 1207)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/devices/description/PhysicalResourceDescription.java	(revision 1207)
@@ -0,0 +1,262 @@
+package schedframe.resources.devices.description;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import schedframe.Parameter;
+import schedframe.Parameters;
+import schedframe.Property;
+import schedframe.resources.ResourceType;
+import schedframe.resources.computing.description.ResourceDescription;
+import schedframe.resources.computing.location.Location;
+import schedframe.resources.computing.profiles.energy.airthroughput.AirThroughputProfile;
+import schedframe.resources.computing.profiles.energy.airthroughput.AirThroughputState;
+import schedframe.resources.computing.profiles.energy.airthroughput.plugin.AirThroughputEstimationPlugin;
+import schedframe.resources.computing.profiles.energy.airthroughput.plugin.DefaultAirThroughputEstimationPlugin;
+import schedframe.resources.computing.profiles.energy.power.PState;
+import schedframe.resources.computing.profiles.energy.power.PowerProfile;
+import schedframe.resources.computing.profiles.energy.power.PowerState;
+import schedframe.resources.computing.profiles.energy.power.PowerStateNameFactory;
+import schedframe.resources.computing.profiles.energy.power.Transition;
+import schedframe.resources.computing.profiles.energy.power.plugin.EnergyEstimationPlugin;
+import schedframe.resources.computing.profiles.energy.thermal.ThermalProfile;
+import schedframe.resources.computing.profiles.energy.thermal.plugin.DefaultTemperatureEstimationPlugin;
+import schedframe.resources.computing.profiles.energy.thermal.plugin.TemperatureEstimationPlugin;
+import schemas.PowerUsage;
+import schemas.Profile;
+import simulator.utils.InstanceFactory;
+import example.energy.DefaultEnergyEstimationPlugin;
+
+public class PhysicalResourceDescription extends ResourceDescription{
+
+	protected PowerProfile powerProfile;
+	protected AirThroughputProfile airThroughputProfile;
+	protected ThermalProfile thermalProfile;
+	
+	protected String category;
+	protected Location location;
+	
+	public PhysicalResourceDescription(ResourceType type) {
+		super(type);
+		// TODO Auto-generated constructor stub
+	}
+
+	protected void initProfiles(Profile profile) {
+		if (profile != null) {
+			initPowerProfile(profile.getPowerProfile());
+			initAirThroughputProfile(profile.getAirThroughputProfile());
+			initThermalProfile(profile.getThermalProfile());
+		}
+	}
+	
+	protected void initPowerProfile(schemas.PowerProfile powerProfileCharacteristic) {
+		
+		if (powerProfileCharacteristic != null) {
+			EnergyEstimationPlugin energyEstimationPlugin = null;
+			List<PowerState> powerStates = null;
+			List<PState> pStates = null;
+			if(powerProfileCharacteristic.getEnergyEstimationPlugin() != null){
+				String energyEstimationPluginName = powerProfileCharacteristic.getEnergyEstimationPlugin().getName();
+				if(energyEstimationPluginName != null) {
+					energyEstimationPlugin = (EnergyEstimationPlugin) InstanceFactory.createInstance(
+							energyEstimationPluginName, EnergyEstimationPlugin.class);			
+				} else {
+					energyEstimationPlugin = new DefaultEnergyEstimationPlugin();
+				}
+				Parameters params = extractParameters(powerProfileCharacteristic.getEnergyEstimationPlugin().getParameter());
+				energyEstimationPlugin.init(params);
+			}
+			
+			if(powerProfileCharacteristic.getPowerStates() != null) {
+				powerStates = new ArrayList<PowerState>();
+				int powerStateCount = powerProfileCharacteristic.getPowerStates().getPowerStateCount();
+				for (int i = 0; i < powerStateCount ; i++) {
+					schemas.PowerState ps = powerProfileCharacteristic.getPowerStates().getPowerState(i);
+					List<Transition> transitions = new ArrayList<Transition>();
+					int transitionCount = ps.getTransitionCount();
+					for (int j = 0; j < transitionCount; j++) {
+						schemas.Transition t = ps.getTransition(j);
+						Transition transition = new Transition(PowerStateNameFactory.createPowerStateName(t.getTo()), t
+								.getPowerUsage().getContent(), t.getTime().getContent());
+						Parameters params = extractParameters(t.getParameter());
+						transition.init(params);
+						transitions.add(transition);
+					}
+					//CoolEmAll DEBB description case
+					if(ps.getPowerUsage() == null){
+						ps.setPowerUsage(new PowerUsage("0"));
+					}
+					PowerState powerState = new PowerState(PowerStateNameFactory.createPowerStateName(ps.getName()), ps
+							.getPowerUsage().getContent(), transitions);
+					Parameters params = extractParameters(ps.getParameter());
+					powerState.init(params);
+					powerStates.add(powerState);
+				}
+			}
+			
+			if(powerProfileCharacteristic.getParameter() != null){
+				pStates = new ArrayList<PState>();
+				int parameterCount = powerProfileCharacteristic.getParameterCount();
+				for(int i = 0; i < parameterCount; i++){
+					schemas.Parameter parameter = powerProfileCharacteristic.getParameter(i);
+					if(parameter.getName().equals("pState")){
+						PState.Builder builder = new PState.Builder();
+						int propertyCount = parameter.getParameterTypeSequence().getPropertyCount();
+						for(int j = 0; j < propertyCount; j++){
+							schemas.Property property = parameter.getParameterTypeSequence().getProperty(j);
+							if(property.getName().equals("name")){
+								 builder = builder.name(property.getStringValueWithUnit(0).getContent());
+							} else if (property.getName().equals("frequency")){
+								 builder = builder.frequency(Double.valueOf(property.getStringValueWithUnit(0).getContent()));
+							} else if (property.getName().equals("voltage")){
+								builder = builder.voltage(Double.valueOf(property.getStringValueWithUnit(0).getContent()));
+							} else if (property.getName().equals("powerUsage")){
+								if(property.getStringValueWithUnit(0).getContent() != null && property.getStringValueWithUnit(0).getContent().length() > 0){
+									builder = builder.powerUsage(Double.valueOf(property.getStringValueWithUnit(0).getContent()));	
+								}
+							} else if (property.getName().equals("powerUsageMin")){
+								if(property.getStringValueWithUnit(0).getContent() != null && property.getStringValueWithUnit(0).getContent().length() > 0){
+									builder = builder.powerUsageMin(Double.valueOf(property.getStringValueWithUnit(0).getContent()));	
+								}
+							} else if (property.getName().equals("powerUsageMax")){
+								if(property.getStringValueWithUnit(0).getContent() != null && property.getStringValueWithUnit(0).getContent().length() > 0){
+									builder = builder.powerUsageMax(Double.valueOf(property.getStringValueWithUnit(0).getContent()));	
+								}
+							}else if (property.getName().equals("loadPowerUsage")){
+								if(property.getStringValueWithUnit(0).getContent() != null && property.getStringValueWithUnit(0).getContent().length() > 0 &&
+										property.getStringValueWithUnit(1).getContent() != null && property.getStringValueWithUnit(1).getContent().length() > 0){
+									//LoadPowerUsage lpu = new LoadPowerUsage(Double.valueOf(property.getStringValueWithUnit(0).getContent()), Double.valueOf(property.getStringValueWithUnit(1).getContent()));
+									//builder = builder.loadPowerUsage(lpu);
+									builder.loadPowerUsage(Double.valueOf(property.getStringValueWithUnit(0).getContent()), Double.valueOf(property.getStringValueWithUnit(1).getContent()));
+								}
+							}
+						}
+						PState pState = builder.build();
+						pStates.add(pState);
+					}
+				}	
+			}
+			this.powerProfile = new PowerProfile(energyEstimationPlugin, powerStates, pStates);
+			Parameters params = extractParameters(powerProfileCharacteristic.getParameter());
+			this.powerProfile.init(params);
+		}
+	}
+
+	protected void initAirThroughputProfile(schemas.AirThroughputProfile airThroughputProfile) {
+		if (airThroughputProfile != null) {
+			
+			AirThroughputEstimationPlugin airThroughputEstimationPlugin = null;
+			List<AirThroughputState> airThroughputStates = null;
+			if(airThroughputProfile.getAirThroughputEstimationPlugin() != null){
+				String airThroughputEstimationPluginName = airThroughputProfile.getAirThroughputEstimationPlugin().getName();
+				if(airThroughputEstimationPluginName != null) {
+					airThroughputEstimationPlugin = (AirThroughputEstimationPlugin) InstanceFactory.createInstance(
+							airThroughputEstimationPluginName, AirThroughputEstimationPlugin.class);			
+				} else {
+					airThroughputEstimationPlugin = new DefaultAirThroughputEstimationPlugin();
+				}
+				Parameters params = extractParameters(airThroughputProfile.getAirThroughputEstimationPlugin().getParameter());
+				airThroughputEstimationPlugin.init(params);
+			}
+			if(airThroughputProfile.getAirThroughputStates() != null){
+				airThroughputStates = new ArrayList<AirThroughputState>();
+				int airThrouhputStateCount = airThroughputProfile.getAirThroughputStates().getAirThroughputStateCount();
+				for (int i = 0; i < airThrouhputStateCount; i++) {
+					schemas.AirThroughputState ats = airThroughputProfile.getAirThroughputStates().getAirThroughputState(i);
+					AirThroughputState airThroughputState = new AirThroughputState(ats.getName(), ats.getValue()
+							.getContent(), ats.getPowerUsage().getContent());
+					Parameters params = extractParameters(ats.getParameter());
+					airThroughputState.init(params);
+					airThroughputStates.add(airThroughputState);
+				}
+			}
+			this.airThroughputProfile = new AirThroughputProfile(airThroughputEstimationPlugin, airThroughputStates);
+			Parameters params = extractParameters(airThroughputProfile.getParameter());
+			this.airThroughputProfile.init(params);
+		}
+	}
+	
+	protected void initThermalProfile(schemas.ThermalProfile thermalProfile) {
+		
+		if (thermalProfile != null) {
+			
+			TemperatureEstimationPlugin temperatureEstimationPlugin = null;
+
+			if(thermalProfile.getTemperatureEstimationPlugin() != null){
+				String temperatureEstimationPluginName = thermalProfile.getTemperatureEstimationPlugin().getName();
+				if(temperatureEstimationPluginName != null) {
+					temperatureEstimationPlugin = (TemperatureEstimationPlugin) InstanceFactory.createInstance(
+							temperatureEstimationPluginName, TemperatureEstimationPlugin.class);			
+				} else {
+					temperatureEstimationPlugin = new DefaultTemperatureEstimationPlugin();
+				}
+				Parameters params = extractParameters(thermalProfile.getTemperatureEstimationPlugin().getParameter());
+				temperatureEstimationPlugin.init(params);
+			}
+			this.thermalProfile = new ThermalProfile();
+			Parameters params = extractParameters(thermalProfile.getParameter());
+			this.thermalProfile.init(params);
+		}
+	}
+	
+	protected void initLocation(schemas.Location l) {
+		if (location != null) {
+			this.location = new Location(l.getHorizontal(), l.getVertical(), l.getDepth());
+			Parameters params = extractParameters(l.getParameter());
+			this.location.init(params);
+		}
+	}
+
+	protected Parameters extractParameters(schemas.Parameter[] parameters){
+		
+		Parameters params = null;
+		
+		if(parameters.length != 0)
+			params = new Parameters();
+		
+		for(int i = 0; i < parameters.length; i++){
+			schemas.Parameter parameter = parameters[i];
+			Parameter param = new Parameter(parameter.getName());
+			if(parameter.getParameterTypeSequence() != null && parameter.getParameterTypeSequence().getProperty() != null)
+			{							
+				int propertyCount = parameter.getParameterTypeSequence().getPropertyCount();
+				for(int j = 0; j < propertyCount; j++){
+					schemas.Property property = parameter.getParameterTypeSequence().getProperty(j);
+					Property prop = new Property(property.getName());
+					int stringValueWithUnitCount = property.getStringValueWithUnitCount();
+					for(int k = 0; k < stringValueWithUnitCount; k++){
+						prop.add(property.getStringValueWithUnit(k));
+					}
+					param.addProperty(prop);
+				}
+			} else {
+				int stringValueWithUnitCount =  parameter.getStringValueWithUnitCount();
+				for(int j = 0; j < stringValueWithUnitCount; j++){
+					param.add(parameter.getStringValueWithUnit(j));
+				}
+			}
+			params.put(parameter.getName(), param);
+		}
+		return params;
+	}
+	
+	public PowerProfile getPowerProfile() {
+		return powerProfile;
+	}
+
+	public AirThroughputProfile getAirThroughputProfile() {
+		return airThroughputProfile;
+	}
+
+	public ThermalProfile getThermalProfile() {
+		return thermalProfile;
+	}
+	
+	public Location getLocation() {
+		return location;
+	}
+	
+	public String getCategory() {
+		return category;
+	}
+}
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/computing/StandardResourceFactory.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/computing/StandardResourceFactory.java	(revision 1207)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/computing/StandardResourceFactory.java	(revision 1207)
@@ -0,0 +1,64 @@
+package schedframe.resources.computing;
+
+import schedframe.resources.CoolEmAllResourceType;
+import schedframe.resources.StandardResourceType;
+import schedframe.resources.computing.description.ComputingResourceDescription;
+import schedframe.scheduling.Scheduler;
+import schedframe.scheduling.manager.resources.ManagedResources;
+import schedframe.scheduling.plugin.SchedulingPlugin;
+import schedframe.scheduling.plugin.estimation.ExecutionTimeEstimationPlugin;
+import schedframe.scheduling.policy.AbstractManagementSystem;
+import schedframe.scheduling.policy.global.GridBroker;
+import schedframe.scheduling.policy.local.LocalManagementSystem;
+import schedframe.scheduling.queue.TaskQueueList;
+import simulator.DCWormsConstants;
+
+public class StandardResourceFactory implements ResourceFactory {
+	
+	public ComputingResource createComputingResource(ComputingResourceDescription resDesc){
+		
+		if (resDesc.getType().equals(StandardResourceType.DataCenter))
+			return new DataCenter(resDesc);
+		else if (resDesc.getType().equals(StandardResourceType.Rack))
+			return new Rack(resDesc);
+		else if (resDesc.getType().equals(StandardResourceType.Node))
+			return new ComputingNode(resDesc);
+		else if (resDesc.getType().equals(StandardResourceType.Processor))
+			return new Processor(resDesc);
+		else if (resDesc.getType().equals(StandardResourceType.Core))
+			return new Core(resDesc);
+		else
+			return new ComputingResource(resDesc);
+	
+		/*switch(resDesc.getType()){
+			case Grid: return new Grid(resDesc);
+			case DataCenter: return new DataCenter(resDesc);
+			case ComputingNode: return new ComputingNode(resDesc);
+			case Processor: return new Processor(resDesc);
+		default:
+			return new ComputingResource(resDesc);
+		}*/
+	}
+
+	public Scheduler createScheduler(StandardResourceType type, String id, SchedulingPlugin schedulingPlugin, ExecutionTimeEstimationPlugin execTimeEstimationPlugin, TaskQueueList queues, ManagedResources managedResources) throws Exception{
+		AbstractManagementSystem ms;
+		switch(type){
+			case GS: {
+				ms = new GridBroker("grid",
+						schedulingPlugin, execTimeEstimationPlugin, queues);
+				return new Scheduler(ms, type, managedResources);
+			}
+			case LS: {
+				ms = new LocalManagementSystem(id, DCWormsConstants.MANAGEMENT_SYSTEM,
+						schedulingPlugin, execTimeEstimationPlugin, queues);
+				return new Scheduler(ms, type, managedResources);
+			}
+
+		default:{
+				ms = new LocalManagementSystem(id, DCWormsConstants.MANAGEMENT_SYSTEM,
+						schedulingPlugin, execTimeEstimationPlugin, queues);
+				return new Scheduler(ms, type, managedResources);
+			}
+		}
+	}
+}
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/ui/AirThroughputInterface.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/ui/AirThroughputInterface.java	(revision 754)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/ui/AirThroughputInterface.java	(revision 1207)
@@ -4,4 +4,5 @@
 
 import schedframe.Parameters;
+import schedframe.resources.computing.profiles.energy.airthroughput.AirFlowValue;
 import schedframe.resources.computing.profiles.energy.airthroughput.AirThroughputState;
 import schedframe.resources.computing.profiles.energy.airthroughput.AirThroughputStateName;
@@ -9,5 +10,5 @@
 public interface AirThroughputInterface {
 	
-	public AirThroughputStateName  getAirThroughputState();
+	public AirThroughputStateName getAirThroughputState();
 	
 	public boolean setAirThroughputState(AirThroughputStateName airThroughputState);
@@ -21,4 +22,10 @@
 	public double getPowerConsumption(AirThroughputStateName state) throws NoSuchFieldException;
 	
+	public AirFlowValue getRecentAirFlow();
+	
+	List<AirFlowValue> getAirFlowHistory();
+	
 	public Parameters getParameters();
+	
+	
 }
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/ui/ComputingResourceAirThroughputInterface.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/ui/ComputingResourceAirThroughputInterface.java	(revision 754)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/ui/ComputingResourceAirThroughputInterface.java	(revision 1207)
@@ -4,8 +4,11 @@
 import java.util.List;
 
+import org.joda.time.DateTimeUtils;
+
 import schedframe.Parameters;
 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.airthroughput.AirFlowValue;
 import schedframe.resources.computing.profiles.energy.airthroughput.AirThroughputProfile;
 import schedframe.resources.computing.profiles.energy.airthroughput.AirThroughputState;
@@ -22,5 +25,5 @@
 		this.resource = resource;
 		this.airThroughputProfile = airThroughputProfile;
-		this.currentAirThroughputState = StandardAirThroughputStateName.FAN_ON;
+		this.currentAirThroughputState = StandardAirThroughputStateName.ON;
 	}
 	
@@ -34,5 +37,6 @@
 			
 			//TO DO - notifications should be called for all resources starting form the lowest layer
-			resource.handleEvent(new EnergyEvent(EnergyEventType.AIRFLOW_STATE_CHANGED, resource.getName()));
+			resource.handleEvent(new EnergyEvent(EnergyEventType.AIRFLOW_STATE_CHANGED, resource.getFullName()));
+			resource.handleEvent(new EnergyEvent(EnergyEventType.POWER_STATE_CHANGED, resource.getFullName()));
 			return true;
 		}
@@ -83,4 +87,23 @@
 	}
 	
+	public AirFlowValue getRecentAirFlow() {
+		AirFlowValue airFlow = null;
+		int lastIdx = getAirFlowHistory().size() - 1;
+		if(lastIdx >= 0)
+			airFlow = getAirFlowHistory().get(lastIdx);
+		else {	
+			try {
+				airFlow = new AirFlowValue(DateTimeUtils.currentTimeMillis(), getAirFlow(currentAirThroughputState));
+			} catch (NoSuchFieldException e) {
+			}
+		}
+		return airFlow;
+	}
+	
+	public List<AirFlowValue> getAirFlowHistory(){
+		return airThroughputProfile.getAirThroughputHistory();
+	}
+	
+	
 	public Parameters getParameters() {
 		return airThroughputProfile.getParameters();
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/AirThroughputInterfaceFactory.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/AirThroughputInterfaceFactory.java	(revision 753)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/AirThroughputInterfaceFactory.java	(revision 1207)
@@ -1,15 +1,30 @@
 package schedframe.resources.computing.profiles.energy.airthroughput;
 
+import schedframe.resources.StandardResourceType;
 import schedframe.resources.computing.ComputingResource;
 import schedframe.resources.computing.profiles.energy.airthroughput.ui.AirThroughputInterface;
 import schedframe.resources.computing.profiles.energy.airthroughput.ui.ComputingResourceAirThroughputInterface;
+import schedframe.resources.devices.PhysicalResource;
+import schedframe.resources.devices.PhysicalResourceAirThroughputInterface;
+import schedframe.resources.devices.coolemall.FanAirThroughputInterface;
 
 public class AirThroughputInterfaceFactory {
 	
-	public static AirThroughputInterface createAirThroughputInterface(ComputingResource resource, AirThroughputProfile atp){
+	public static AirThroughputInterface createAirThroughputInterface(PhysicalResource resource, AirThroughputProfile atp){
 		if(atp == null)
 			return null;
-		AirThroughputInterface airThroughputInterface = new ComputingResourceAirThroughputInterface(resource, atp);
-
+		AirThroughputInterface airThroughputInterface = null;
+		if(resource.getType().getName().equals(StandardResourceType.CRAH.getName()))
+			airThroughputInterface = new PhysicalResourceAirThroughputInterface(resource, atp);
+		else if(resource.getType().getName().equals(StandardResourceType.Fan.getName()))
+			airThroughputInterface = new FanAirThroughputInterface(resource, atp);
+		else if(resource.getType().getName().equals(StandardResourceType.Inlet.getName()))
+			airThroughputInterface = new FanAirThroughputInterface(resource, atp);
+		else if(resource.getType().getName().equals(StandardResourceType.Outlet.getName()))
+			airThroughputInterface = new FanAirThroughputInterface(resource, atp);
+		else if(resource.getType().getName().equals(StandardResourceType.CoolingDevice.getName()))
+			airThroughputInterface = new PhysicalResourceAirThroughputInterface(resource, atp);
+		else
+			airThroughputInterface = new ComputingResourceAirThroughputInterface((ComputingResource)resource, atp);
 		return airThroughputInterface;
 	}
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/AirThroughputProfile.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/AirThroughputProfile.java	(revision 495)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/AirThroughputProfile.java	(revision 1207)
@@ -28,5 +28,5 @@
 	}
 	
-	public void addToPowerUsageHistory(double airFlow) {
+	public void addToAirFlowHistory(double airFlow) {
 
 		if (airFlowHistory.size() == 0) {
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/StandardAirThroughputStateName.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/StandardAirThroughputStateName.java	(revision 753)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/StandardAirThroughputStateName.java	(revision 1207)
@@ -3,6 +3,6 @@
 public enum  StandardAirThroughputStateName implements AirThroughputStateName{
 
-	FAN_ON,
-	FAN_OFF;
+	ON,
+	OFF;
 
 	public String getName() {
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/EnergyExtension.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/EnergyExtension.java	(revision 1165)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/EnergyExtension.java	(revision 1207)
@@ -7,5 +7,4 @@
 
 import schedframe.events.Event;
-import schedframe.resources.computing.ComputingResource;
 import schedframe.resources.computing.extensions.Extension;
 import schedframe.resources.computing.extensions.ExtensionException;
@@ -20,5 +19,7 @@
 import schedframe.resources.computing.profiles.energy.thermal.ThermalProfile;
 import schedframe.resources.computing.profiles.energy.thermal.ui.ThermalInterface;
+import schedframe.resources.devices.PhysicalResource;
 import schedframe.scheduling.manager.tasks.JobRegistryImpl;
+import simulator.DataCenterWorkloadSimulator;
 
 public class EnergyExtension implements Extension{
@@ -35,34 +36,74 @@
 	protected ThermalProfile thermalProfile;
 	
-  	protected ComputingResource computingResource;
-
-
-	public EnergyExtension(ComputingResource computingResource, PowerInterface powerInterface, PowerProfile powerProfile) {
+  	protected PhysicalResource resource;
+
+
+	/*public EnergyExtension(PhysicalResource resource, PowerInterface powerInterface, PowerProfile powerProfile) {
+		super();
+		this.resource = resource;
 		this.powerProfile = powerProfile;
-		this.powerInterface = PowerInterfaceFactory.createPowerInterface(computingResource, powerProfile);
-	}
-	
-	public EnergyExtension(ComputingResource computingResource, PowerProfile powerProfile,
+		this.powerInterface = PowerInterfaceFactory.createPowerInterface(resource, powerProfile);
+	}
+	
+	public EnergyExtension(PhysicalResource resource, PowerProfile powerProfile,
 			AirThroughputProfile airFlowProfile) {
 		super();
-		this.computingResource = computingResource;
+		this.resource = resource;
 		this.powerProfile = powerProfile;
-		this.powerInterface = PowerInterfaceFactory.createPowerInterface(computingResource, powerProfile);
+		this.powerInterface = PowerInterfaceFactory.createPowerInterface(resource, powerProfile);
 		this.airFlowProfile = airFlowProfile;
-		this.airFlowInterface = AirThroughputInterfaceFactory.createAirThroughputInterface(computingResource, airFlowProfile);
-	}
-	
-	public EnergyExtension(ComputingResource computingResource, PowerProfile powerProfile,
+		this.airFlowInterface = AirThroughputInterfaceFactory.createAirThroughputInterface(resource, airFlowProfile);
+	}
+	
+	public EnergyExtension(PhysicalResource resource, PowerProfile powerProfile,
 			AirThroughputProfile airFlowProfile, ThermalProfile thermalProfile) {
 		super();
-		this.computingResource = computingResource;
+		this.resource = resource;
 		this.powerProfile = powerProfile;
-		this.powerInterface = PowerInterfaceFactory.createPowerInterface(computingResource, powerProfile);
+		this.powerInterface = PowerInterfaceFactory.createPowerInterface(resource, powerProfile);
 		this.airFlowProfile = airFlowProfile;
-		this.airFlowInterface = AirThroughputInterfaceFactory.createAirThroughputInterface(computingResource, airFlowProfile);
+		this.airFlowInterface = AirThroughputInterfaceFactory.createAirThroughputInterface(resource, airFlowProfile);
 		this.thermalProfile = thermalProfile;
-		this.thermalInterface = ThermalInterfaceFactory.createThermalInterface(computingResource, thermalProfile);
-	}
-
+		this.thermalInterface = ThermalInterfaceFactory.createThermalInterface(resource, thermalProfile);
+	}*/
+
+	public static class Builder {
+		  
+		protected PhysicalResource resource;
+		protected PowerInterface powerInterface;
+		protected PowerProfile powerProfile;
+		
+		protected AirThroughputInterface airFlowInterface;
+		protected AirThroughputProfile airFlowProfile;
+		
+		protected ThermalInterface thermalInterface;
+		protected ThermalProfile thermalProfile;
+		
+		public Builder resource(PhysicalResource res) {this.resource = res; return this;}
+		
+		public Builder powerProfile(PowerProfile pp){this.powerProfile = pp; this.powerInterface = PowerInterfaceFactory.createPowerInterface(resource, powerProfile); return this; }
+
+        public Builder airFlowProfile(AirThroughputProfile atp){this.airFlowProfile = atp; this.airFlowInterface = AirThroughputInterfaceFactory.createAirThroughputInterface(resource, airFlowProfile); return this; }
+
+        public Builder thermalProfile(ThermalProfile tp){this.thermalProfile = tp; this.thermalInterface = ThermalInterfaceFactory.createThermalInterface(resource, thermalProfile); return this; }
+
+        public EnergyExtension build() {
+            return new EnergyExtension(this);
+        }
+	}
+	
+	private EnergyExtension(Builder builder) {
+		this.resource = builder.resource;
+		this.powerInterface = builder.powerInterface;
+		this.powerProfile = builder.powerProfile;
+		
+		this.airFlowInterface = builder.airFlowInterface ;
+		this.airFlowProfile = builder.airFlowProfile;
+		
+		this.thermalInterface = builder.thermalInterface;
+		this.thermalProfile = builder.thermalProfile;
+	}
+
+	
 	public boolean supportsEvent(Event event) {
 
@@ -82,4 +123,6 @@
 		if(event.getType().getName().equals(EnergyEventType.AIRFLOW_STATE_CHANGED.getName()))
 			return true;
+		if(event.getType().getName().equals(EnergyEventType.TEMPERATURE_CHANGED.getName()))
+			return true;
 		
 		else return false;
@@ -90,10 +133,10 @@
 		EnergyEvent enEvent = (EnergyEvent)event;
 		double power = 0;
-		double temperature = 0;
+		boolean status = false;
 		try{
 			switch (enEvent.getType()) {
 			
 			case POWER_STATE_CHANGED:
-				power = powerProfile.getEnergyEstimationPlugin().estimatePowerConsumption(enEvent, new JobRegistryImpl(computingResource.getName()), computingResource);
+				power = powerProfile.getEnergyEstimationPlugin().estimatePowerConsumption(enEvent, new JobRegistryImpl(resource.getFullName()), resource);
 				/*if(computingResource instanceof ComputingNode){
 					ComputingNode node = (ComputingNode)computingResource;
@@ -109,45 +152,36 @@
 					}
 				}
-				else*/ powerProfile.addToPowerUsageHistory(power);
-				temperature = powerProfile.getEnergyEstimationPlugin().estimateTemperature(enEvent, new JobRegistryImpl(computingResource.getName()), computingResource);
-				thermalProfile.addToTemperatureHistory(temperature);
+				else*/ 
+				
+				status = powerProfile.addToPowerUsageHistory(power);
 				break;
 				
 			case FREQUENCY_CHANGED:
-				power = powerProfile.getEnergyEstimationPlugin().estimatePowerConsumption(enEvent, new JobRegistryImpl(computingResource.getName()), computingResource);
-				powerProfile.addToPowerUsageHistory(power);
-				temperature = powerProfile.getEnergyEstimationPlugin().estimateTemperature(enEvent, new JobRegistryImpl(computingResource.getName()), computingResource);
-				thermalProfile.addToTemperatureHistory(temperature);
+				power = powerProfile.getEnergyEstimationPlugin().estimatePowerConsumption(enEvent, new JobRegistryImpl(resource.getFullName()), resource);
+				status = powerProfile.addToPowerUsageHistory(power);
 				break;
 				
 			case TASK_STARTED:
-				power = powerProfile.getEnergyEstimationPlugin().estimatePowerConsumption(enEvent, new JobRegistryImpl(computingResource.getName()), computingResource);
-				powerProfile.addToPowerUsageHistory(power);
-				temperature = powerProfile.getEnergyEstimationPlugin().estimateTemperature(enEvent, new JobRegistryImpl(computingResource.getName()), computingResource);
-				thermalProfile.addToTemperatureHistory(temperature);
+				power = powerProfile.getEnergyEstimationPlugin().estimatePowerConsumption(enEvent, new JobRegistryImpl(resource.getFullName()), resource);
+				status = powerProfile.addToPowerUsageHistory(power);
 				break;
 	
 			case TASK_FINISHED:
-				//System.out.println(this.resource.getName() + " - ENERGY EXTENSION: TASK FINISHED");
-				power = powerProfile.getEnergyEstimationPlugin().estimatePowerConsumption(enEvent, new JobRegistryImpl(computingResource.getName()), computingResource);
-				//System.out.println(this.resource.getName() + " - ESTIMATED ENERGY:" + power);
-				powerProfile.addToPowerUsageHistory(power);
-				temperature = powerProfile.getEnergyEstimationPlugin().estimateTemperature(enEvent, new JobRegistryImpl(computingResource.getName()), computingResource);
-				thermalProfile.addToTemperatureHistory(temperature);
+				power = powerProfile.getEnergyEstimationPlugin().estimatePowerConsumption(enEvent, new JobRegistryImpl(resource.getFullName()), resource);
+				status = powerProfile.addToPowerUsageHistory(power);
 				break;
 				
 			case RESOURCE_UTILIZATION_CHANGED:
-				power = powerProfile.getEnergyEstimationPlugin().estimatePowerConsumption(enEvent, new JobRegistryImpl(computingResource.getName()), computingResource);
-				powerProfile.addToPowerUsageHistory(power);
-				temperature = powerProfile.getEnergyEstimationPlugin().estimateTemperature(enEvent, new JobRegistryImpl(computingResource.getName()), computingResource);
-				thermalProfile.addToTemperatureHistory(temperature);
+				power = powerProfile.getEnergyEstimationPlugin().estimatePowerConsumption(enEvent, new JobRegistryImpl(resource.getFullName()), resource);
+				status = powerProfile.addToPowerUsageHistory(power);
 				break;
 				
 			case AIRFLOW_STATE_CHANGED:
-				double airFlow = powerProfile.getEnergyEstimationPlugin().estimateAirThroughput(enEvent, new JobRegistryImpl(computingResource.getName()), computingResource);
-				airFlowProfile.addToPowerUsageHistory(airFlow);
-				power = powerProfile.getEnergyEstimationPlugin().estimatePowerConsumption(enEvent, new JobRegistryImpl(computingResource.getName()), computingResource);
-				powerProfile.addToPowerUsageHistory(power);
-				temperature = powerProfile.getEnergyEstimationPlugin().estimateTemperature(enEvent, new JobRegistryImpl(computingResource.getName()), computingResource);
+				double airFlow = powerProfile.getEnergyEstimationPlugin().estimateAirThroughput(enEvent, new JobRegistryImpl(resource.getFullName()), resource);
+				airFlowProfile.addToAirFlowHistory(airFlow);
+				break;
+				
+			case TEMPERATURE_CHANGED:
+				double temperature = powerProfile.getEnergyEstimationPlugin().estimateTemperature(enEvent, new JobRegistryImpl(resource.getFullName()), resource);
 				thermalProfile.addToTemperatureHistory(temperature);
 				break;
@@ -156,4 +190,7 @@
 			
 		}
+		if(status){
+			DataCenterWorkloadSimulator.getEventManager().sendToResources(resource.getType(), 0, new EnergyEvent(EnergyEventType.TEMPERATURE_CHANGED, resource.getFullName()));
+		}
 	}
 
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/PowerInterfaceFactory.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/PowerInterfaceFactory.java	(revision 1104)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/PowerInterfaceFactory.java	(revision 1207)
@@ -1,44 +1,38 @@
 package schedframe.resources.computing.profiles.energy.power;
 
-import schedframe.resources.CoolEmAllResourceType;
 import schedframe.resources.StandardResourceType;
 import schedframe.resources.computing.ComputingResource;
 import schedframe.resources.computing.profiles.energy.power.ui.PowerInterface;
+import schedframe.resources.devices.PhysicalResource;
+import schedframe.resources.devices.PhysicalResourcePowerInterface;
 
 public class PowerInterfaceFactory {
 
-
-
-	//new1
-	/*public static PowerInterface createPowerProfile(ResourceType resourceType, List<PowerState> powerStates, List<PState> pStates, String eepn){
-
-		PowerInterface powerProfile;
-
-		switch(resourceType){
-			case DataCenter: powerProfile = new DataCenterPowerInterfaceNew(eepn, powerStates); break;
-			case ComputingNode: powerProfile = new ComputingNodePowerInterfaceNew(eepn, powerStates); break;
-			case Processor: powerProfile = new CPUPowerInterfaceNew(eepn, powerStates, pStates); break;
-			default:
-				throw new IllegalArgumentException("ResourceType " + resourceType + " is not supported.");
-		}
-
-		return powerProfile;
-	}*/
 	
-	public static PowerInterface createPowerInterface(ComputingResource resource, PowerProfile pp){
+	public static PowerInterface createPowerInterface(PhysicalResource resource, PowerProfile pp){
 		if(pp == null)
 			return null;
 		PowerInterface powerInterface;
-
+		
 		if(resource.getType().getName().equals(StandardResourceType.DataCenter.getName()))
-			powerInterface = new schedframe.resources.computing.profiles.energy.power.ui.DataCenterPowerInterface(resource, pp);
-		else if (resource.getType().getName().equals(StandardResourceType.ComputingNode.getName()))
-			powerInterface = new schedframe.resources.computing.profiles.energy.power.ui.ComputingNodePowerInterface(resource, pp);
+			powerInterface = new schedframe.resources.computing.profiles.energy.power.ui.DataCenterPowerInterface((ComputingResource)resource, pp);
+		else if (resource.getType().getName().equals(StandardResourceType.Node.getName()))
+			powerInterface = new schedframe.resources.computing.profiles.energy.power.ui.ComputingNodePowerInterface((ComputingResource)resource, pp);
 		else if (resource.getType().getName().equals(StandardResourceType.Processor.getName()))
-			powerInterface = new schedframe.resources.computing.profiles.energy.power.ui.ProcessorPowerInterface(resource, pp);
-		else if (resource.getType().getName().equals(CoolEmAllResourceType.Node.getName()))
-			powerInterface = new schedframe.resources.computing.profiles.energy.power.ui.ComputingNodePowerInterface(resource, pp);
+			powerInterface = new schedframe.resources.computing.profiles.energy.power.ui.ProcessorPowerInterface((ComputingResource)resource, pp);
+		else if (resource.getType().getName().equals(StandardResourceType.CRAH.getName()))
+			powerInterface = new PhysicalResourcePowerInterface(resource, pp);
+		else if (resource.getType().getName().equals(StandardResourceType.Fan.getName()))
+			powerInterface = new PhysicalResourcePowerInterface(resource, pp);
+		else if (resource.getType().getName().equals(StandardResourceType.Inlet.getName()))
+			powerInterface = new PhysicalResourcePowerInterface(resource, pp);
+		else if (resource.getType().getName().equals(StandardResourceType.Outlet.getName()))
+			powerInterface = new PhysicalResourcePowerInterface(resource, pp);
+		else if (resource.getType().getName().equals(StandardResourceType.CoolingDevice.getName()))
+			powerInterface = new PhysicalResourcePowerInterface(resource, pp);
+		else if (resource.getType().getName().equals(StandardResourceType.Heatsink.getName()))
+			powerInterface = new PhysicalResourcePowerInterface(resource, pp);
 		else 
-			powerInterface = new schedframe.resources.computing.profiles.energy.power.ui.ComputingResourcePowerInterface(resource, pp);
+			powerInterface = new schedframe.resources.computing.profiles.energy.power.ui.ComputingResourcePowerInterface((ComputingResource)resource, pp);
 
 		/*switch(resource.getType()){
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 1167)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/PowerProfile.java	(revision 1207)
@@ -24,9 +24,10 @@
 	public PowerProfile(EnergyEstimationPlugin energyEstimationPlugin, List<PowerState> powerStates) {
 		this.energyEstimationPlugin = energyEstimationPlugin;
+		this.supportedPowerStates = powerStates;
 		this.powerUsage = new ArrayList<PowerUsage>();
-		this.supportedPowerStates = powerStates;
+		initDefaultPowerStates();
 	}
 	
-	public PowerProfile(EnergyEstimationPlugin energyEstimationPlugin, List<PowerState> powerStates,  List<PState> pStates) {
+	public PowerProfile(EnergyEstimationPlugin energyEstimationPlugin, List<PowerState> powerStates, List<PState> pStates) {
 		this.energyEstimationPlugin = energyEstimationPlugin;
 		this.supportedPowerStates = powerStates;
@@ -37,4 +38,5 @@
 			supportedPStates.put(pState.getName(), pState);
 		}
+		initDefaultPowerStates();
 	}
 	
@@ -60,7 +62,7 @@
 	}
 	
-	public List<PowerState> getSupportedPowerStates() throws NoSuchFieldException{
+	public List<PowerState> getSupportedPowerStates() {
 		if(supportedPowerStates == null)
-			throw new NoSuchFieldException("Supported power states are not defined.");
+			return new ArrayList<PowerState>();
 		return supportedPowerStates;
 	}
@@ -111,4 +113,24 @@
 	}
 
-
+	protected void initDefaultPowerStates(){
+		boolean supportsON = false;
+		boolean supportsOFF = false;
+		if(supportedPowerStates == null){
+			supportedPowerStates = new ArrayList<PowerState>();
+		}
+		for(PowerState ps: supportedPowerStates){
+			if(ps.getName().equals(StandardPowerStateName.ON)){
+				supportsON = true;
+			} else if (ps.getName().equals(StandardPowerStateName.OFF)){
+				supportsOFF = true;
+			}
+		}
+		
+		if(!supportsON){
+			supportedPowerStates.add(new PowerState(StandardPowerStateName.ON, -1, new ArrayList<Transition>()));
+		}
+		if(!supportsOFF){
+			supportedPowerStates.add(new PowerState(StandardPowerStateName.OFF, -1, new ArrayList<Transition>()));
+		}
+	}
 }
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/ui/ComputingNodePowerInterface.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/ui/ComputingNodePowerInterface.java	(revision 1166)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/ui/ComputingNodePowerInterface.java	(revision 1207)
@@ -1,4 +1,9 @@
 package schedframe.resources.computing.profiles.energy.power.ui;
 
+
+
+import org.joda.time.DateTime;
+
+import schedframe.SimulatedEnvironment;
 import schedframe.resources.ResourceStatus;
 import schedframe.resources.computing.ComputingNode;
@@ -38,5 +43,5 @@
 		
 		if(!pePowerStateChangeStatus){
-			computingNode.handleEvent(new EnergyEvent(EnergyEventType.POWER_STATE_CHANGED, computingNode.getName()));
+			computingNode.handleEvent(new EnergyEvent(EnergyEventType.POWER_STATE_CHANGED, computingNode.getFullName()));
 		}
 
@@ -48,4 +53,5 @@
 		}
 		//computingNode.handleEvent(new EnergyEvent(EnergyEventType.POWER_STATE_CHANGED, computingNode.getName()));
+		//ResourceController.traceResource(new DateTime().getMillis(), resource.getFullName(), "POWER_STATE_CHANGED", state.getName());
 		return true;
 	}
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 579)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/ui/ComputingResourcePowerInterface.java	(revision 1207)
@@ -4,7 +4,9 @@
 import java.util.List;
 
+import org.joda.time.DateTime;
 import org.joda.time.DateTimeUtils;
 
 import schedframe.Parameters;
+import schedframe.SimulatedEnvironment;
 import schedframe.resources.ResourceStatus;
 import schedframe.resources.computing.ComputingResource;
@@ -46,9 +48,10 @@
 			}
 			//notifications from all levels
-			resource.handleEvent(new EnergyEvent(EnergyEventType.POWER_STATE_CHANGED, resource.getName()));
+			resource.handleEvent(new EnergyEvent(EnergyEventType.POWER_STATE_CHANGED, resource.getFullName()));
 
 			//notification from last level
 			//if (resource.getChildren() == null) resource.handleEvent(new EnergyEvent(EnergyEventType.POWER_STATE_CHANGED, resource));
 			
+			//ResourceController.traceResource(new DateTime().getMillis(), resource.getFullName(), "POWER_STATE_CHANGED", state.getName());
 			return true;
 		}
@@ -70,12 +73,8 @@
 
 	public boolean supportPowerState(PowerStateName state) {
-		try {
-			for(PowerState powerState: powerProfile.getSupportedPowerStates()){
-				if(powerState.getName().equals(state)){
-					return true;
-				}
+		for(PowerState powerState: powerProfile.getSupportedPowerStates()){
+			if(powerState.getName().equals(state)){
+				return true;
 			}
-		} catch (NoSuchFieldException e) {
-			return false;
 		}
 		return false;
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/ui/ProcessorPowerInterface.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/ui/ProcessorPowerInterface.java	(revision 782)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/ui/ProcessorPowerInterface.java	(revision 1207)
@@ -4,4 +4,7 @@
 import java.util.Map;
 
+import org.joda.time.DateTime;
+
+import schedframe.SimulatedEnvironment;
 import schedframe.resources.ResourceStatus;
 import schedframe.resources.computing.ComputingResource;
@@ -16,5 +19,4 @@
 
 	protected PState currentPState;
-
 
 	public ProcessorPowerInterface(ComputingResource resource, PowerProfile pp){
@@ -34,5 +36,5 @@
 				resource.setStatus(ResourceStatus.FREE);
 			}
-			resource.handleEvent(new EnergyEvent(EnergyEventType.POWER_STATE_CHANGED, resource.getName()));		
+			resource.handleEvent(new EnergyEvent(EnergyEventType.POWER_STATE_CHANGED, resource.getFullName()));		
 		}
 
@@ -68,6 +70,8 @@
 			//speed.setAmount(Double.valueOf(currentPState.getFrequency()).intValue());
 			//new ResourceEventCommand(resource).execute(EnergyEventType.FREQUENCY_CHANGED);
-			resource.handleEvent(new EnergyEvent(EnergyEventType.FREQUENCY_CHANGED, resource.getName()));
+			resource.handleEvent(new EnergyEvent(EnergyEventType.FREQUENCY_CHANGED, resource.getFullName()));
 			//resource.getScheduler().sendInternal(GridSimTags.SCHEDULE_NOW, DCWormsTags.UPDATE, resource.getName());
+			
+			//ResourceController.traceResource(new DateTime().getMillis(), resource.getFullName(), "PSTATE_CHANGED", pStateName);
 			return true;
 		}
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/ui/DataCenterPowerInterface.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/ui/DataCenterPowerInterface.java	(revision 495)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/ui/DataCenterPowerInterface.java	(revision 1207)
@@ -1,4 +1,7 @@
 package schedframe.resources.computing.profiles.energy.power.ui;
 
+import org.joda.time.DateTime;
+
+import schedframe.SimulatedEnvironment;
 import schedframe.resources.computing.ComputingResource;
 import schedframe.resources.computing.DataCenter;
@@ -23,5 +26,5 @@
 			child.getPowerInterface().setPowerState(state);
 		}
-
+		//ResourceController.traceResource(new DateTime().getMillis(), resource.getFullName(), "POWER_STATE_CHANGED", state.getName());
 		return true;
 	}
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/plugin/EnergyEstimationPlugin.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/plugin/EnergyEstimationPlugin.java	(revision 477)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/plugin/EnergyEstimationPlugin.java	(revision 1207)
@@ -2,15 +2,15 @@
 
 import schedframe.Plugin;
-import schedframe.resources.computing.ComputingResource;
 import schedframe.resources.computing.profiles.energy.EnergyEvent;
+import schedframe.resources.devices.PhysicalResource;
 import schedframe.scheduling.manager.tasks.JobRegistry;
 
 public interface EnergyEstimationPlugin extends Plugin {
 	
-	public double estimatePowerConsumption(EnergyEvent event, JobRegistry jobRegistry, ComputingResource resource);
+	public double estimatePowerConsumption(EnergyEvent event, JobRegistry jobRegistry, PhysicalResource resource);
 
-	public double estimateAirThroughput(EnergyEvent event, JobRegistry jobRegistry, ComputingResource resource);
+	public double estimateAirThroughput(EnergyEvent event, JobRegistry jobRegistry, PhysicalResource resource);
 
-	public double estimateTemperature(EnergyEvent event, JobRegistry jobRegistry, ComputingResource resource);
+	public double estimateTemperature(EnergyEvent event, JobRegistry jobRegistry, PhysicalResource resource);
 
 }
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/PState.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/PState.java	(revision 1119)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/PState.java	(revision 1207)
@@ -1,3 +1,6 @@
 package schedframe.resources.computing.profiles.energy.power;
+
+import java.util.Map;
+import java.util.TreeMap;
 
 public class PState {
@@ -9,5 +12,7 @@
 	protected double powerUsageMin;
 	protected double powerUsageMax;
-
+	//protected List<LoadPowerUsage> loadPowerUsageList;
+	protected Map<Double, Double> loadPowerUsage;
+	
 	/*public PState(PStateType name, double frequency, double voltage, double power) {
 		super();
@@ -38,5 +43,14 @@
 		return powerUsageMax;
 	}
-	
+	/*public List<LoadPowerUsage> getLoadPowerUsageList() {
+		return loadPowerUsageList;
+	}*/
+	public Map<Double, Double> getLoadPowerUsage() {
+		if(loadPowerUsage == null) {
+			return new TreeMap<Double, Double>();
+		}
+		return loadPowerUsage;
+	}
+
 	public static class Builder {
 	  
@@ -47,4 +61,6 @@
 		protected double powerUsageMin;
 		protected double powerUsageMax;
+		//protected List<LoadPowerUsage> loadPowerUsageList = new ArrayList<LoadPowerUsage>();
+		protected Map<Double, Double> loadPowerUsage = new TreeMap<Double, Double>();
 		
 		public Builder name(String name){this.name = name; return this; }
@@ -54,4 +70,6 @@
         public Builder powerUsageMin(double rate){this.powerUsageMin = rate; return this; }
         public Builder powerUsageMax(double rate){this.powerUsageMax = rate; return this; }
+        //public Builder loadPowerUsage(LoadPowerUsage lpu){this.loadPowerUsageList.add(lpu); return this; }
+        public Builder loadPowerUsage(double load, double power){this.loadPowerUsage.put(load, power); return this; }
         
         public PState build() {
@@ -67,4 +85,8 @@
 		this.powerUsageMin = builder.powerUsageMin;
 		this.powerUsageMax = builder.powerUsageMax;
+		//this.loadPowerUsageList = builder.loadPowerUsageList;
+		this.loadPowerUsage = builder.loadPowerUsage;
 	}
+
+
 }
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/LoadPowerUsage.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/LoadPowerUsage.java	(revision 1207)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/LoadPowerUsage.java	(revision 1207)
@@ -0,0 +1,20 @@
+package schedframe.resources.computing.profiles.energy.power;
+
+public class LoadPowerUsage {
+	double load;
+	double powerUsage;
+	
+	public LoadPowerUsage(double load, double powerUsage) {
+		super();
+		this.load = load;
+		this.powerUsage = powerUsage;
+	}
+
+	public double getLoad() {
+		return load;
+	}
+
+	public double getPowerUsage() {
+		return powerUsage;
+	}
+}
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/thermal/ThermalInterfaceFactory.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/thermal/ThermalInterfaceFactory.java	(revision 803)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/thermal/ThermalInterfaceFactory.java	(revision 1207)
@@ -1,14 +1,22 @@
 package schedframe.resources.computing.profiles.energy.thermal;
 
+import schedframe.resources.StandardResourceType;
 import schedframe.resources.computing.ComputingResource;
 import schedframe.resources.computing.profiles.energy.thermal.ui.ComputingResourceThermalInterface;
 import schedframe.resources.computing.profiles.energy.thermal.ui.ThermalInterface;
+import schedframe.resources.devices.PhysicalResource;
+import schedframe.resources.devices.PhysicalResourceThermalInterface;
 
 public class ThermalInterfaceFactory {
-	public static ThermalInterface createThermalInterface(ComputingResource resource, ThermalProfile tp){
+	public static ThermalInterface createThermalInterface(PhysicalResource resource, ThermalProfile tp){
 		if(tp == null)
 			return null;
-		ThermalInterface thermalInterface = new ComputingResourceThermalInterface(resource, tp);
-
+		ThermalInterface thermalInterface;
+		if (resource.getType().getName().equals(StandardResourceType.CRAH.getName()))
+			thermalInterface = new PhysicalResourceThermalInterface(resource, tp);
+		else if (resource.getType().getName().equals(StandardResourceType.Fan.getName()))
+			thermalInterface = new PhysicalResourceThermalInterface(resource, tp);
+		else 
+			thermalInterface = new ComputingResourceThermalInterface((ComputingResource)resource, tp);
 		return thermalInterface;
 	}
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/computing/description/ResourceDescription.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/computing/description/ResourceDescription.java	(revision 1207)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/computing/description/ResourceDescription.java	(revision 1207)
@@ -0,0 +1,64 @@
+package schedframe.resources.computing.description;
+
+
+import java.util.ArrayList;
+import java.util.List;
+
+import schedframe.Parameters;
+import schedframe.resources.ResourceType;
+
+
+public abstract class ResourceDescription {
+
+	protected String id;
+	protected ResourceType type;
+	protected List<ResourceDescription> children;
+	protected Parameters parameters;
+	
+	public ResourceDescription(ResourceType type){
+		this.type = type;
+	}
+
+	public List<ResourceDescription> getChildren() {
+		return children;
+	}
+	
+	public void setChildren(List<ResourceDescription> children) {
+		this.children = children;
+	}
+	
+	public void addChildren(ResourceDescription child) {
+		//child.setParent(this);
+		if(children == null)
+			children = new ArrayList<ResourceDescription> (1);
+		this.children.add(child);
+	}
+
+	public String getId(){
+		return this.id;
+	}
+
+	public ResourceType getType() {
+		return type;
+	}
+	
+	public Parameters getParameters() {
+		return parameters;
+	}
+	
+	/*protected AbstractResourceDescription parent;
+	/public AbstractResourceDescription getParent() {
+		return parent;
+	}
+
+	public void setParent(AbstractResourceDescription parent) {
+		this.parent = parent;
+	}*/
+	
+	/*public enum ResourceType {
+		COMPUTING_RESOURCE,
+		QUEUING_SYSTEM;
+	}
+	*/
+	
+}
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/computing/description/ComputingResourceDescription.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/computing/description/ComputingResourceDescription.java	(revision 1113)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/computing/description/ComputingResourceDescription.java	(revision 1207)
@@ -1,49 +1,28 @@
 package schedframe.resources.computing.description;
 
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
 import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Iterator;
 import java.util.List;
-import java.util.PropertyResourceBundle;
-import java.util.ResourceBundle;
+import java.util.Map;
 
-import schedframe.Parameter;
 import schedframe.Parameters;
-import schedframe.Property;
 import schedframe.resources.ResourceTypeFactory;
-import schedframe.resources.computing.location.Location;
-import schedframe.resources.computing.profiles.energy.airthroughput.AirThroughputProfile;
-import schedframe.resources.computing.profiles.energy.airthroughput.AirThroughputState;
-import schedframe.resources.computing.profiles.energy.airthroughput.plugin.AirThroughputEstimationPlugin;
-import schedframe.resources.computing.profiles.energy.airthroughput.plugin.DefaultAirThroughputEstimationPlugin;
-import schedframe.resources.computing.profiles.energy.power.PState;
-import schedframe.resources.computing.profiles.energy.power.PowerProfile;
-import schedframe.resources.computing.profiles.energy.power.PowerState;
-import schedframe.resources.computing.profiles.energy.power.PowerStateNameFactory;
-import schedframe.resources.computing.profiles.energy.power.Transition;
-import schedframe.resources.computing.profiles.energy.power.plugin.EnergyEstimationPlugin;
-import schedframe.resources.computing.profiles.energy.thermal.ThermalProfile;
-import schedframe.resources.computing.profiles.energy.thermal.plugin.DefaultTemperatureEstimationPlugin;
-import schedframe.resources.computing.profiles.energy.thermal.plugin.TemperatureEstimationPlugin;
+import schedframe.resources.devices.Device;
+import schedframe.resources.devices.description.DeviceDescription;
+import schedframe.resources.devices.description.PhysicalResourceDescription;
 import schedframe.resources.units.ResourceUnit;
 import schedframe.resources.units.ResourceUnitFactory;
+import schedframe.resources.units.ResourceUnitName;
 import schedframe.resources.utils.ResourceIdGenerator;
 import schemas.ComputingResource;
-import schemas.PowerUsage;
-import schemas.Profile;
-import simulator.utils.InstanceFactory;
-import example.energy.DefaultEnergyEstimationPlugin;
 
-public class ComputingResourceDescription extends ExecutingResourceDescription {
 
-	//protected Map<ResourceUnitName, List<AbstractResourceUnit>> resUnits;
-	protected PowerProfile powerProfile;
-	protected AirThroughputProfile airThroughputProfile;
-	protected ThermalProfile thermalProfile;
-	protected Location location;
-	protected String category;
-	//protected Parameters parameters;
+public class ComputingResourceDescription extends PhysicalResourceDescription implements ExecutingResourceDescription {
 
+	protected Map<ResourceUnitName, List<ResourceUnit>> resUnits;
+	protected List<Device> devices;
+	
 	public ComputingResourceDescription(ComputingResource computingResource) {
 
@@ -55,25 +34,8 @@
 		if (computingResource.getComputingResourceTypeChoiceSequence() != null) {
 			initResourceUnits(computingResource.getComputingResourceTypeChoiceSequence().getResourceUnit());
-			try {
-				if(System.getProperty("coolemall.resdesc") != null){
-					schemas.EnergyEstimationPlugin eep = new schemas.EnergyEstimationPlugin();
-					eep.setName(getEEP(createEEPQuery(computingResource), System.getProperty("coolemall.resdesc")));
-					if(computingResource.getComputingResourceTypeChoiceSequence().getProfile() != null) {
-						if(computingResource.getComputingResourceTypeChoiceSequence().getProfile().getPowerProfile() != null) {
-							computingResource.getComputingResourceTypeChoiceSequence().getProfile().getPowerProfile().setEnergyEstimationPlugin(eep);
-						}
-					} else {
-						schemas.Profile p = new schemas.Profile();
-						computingResource.getComputingResourceTypeChoiceSequence().setProfile(p);
-						schemas.PowerProfile pp = new schemas.PowerProfile();
-						computingResource.getComputingResourceTypeChoiceSequence().getProfile().setPowerProfile(pp);
-						computingResource.getComputingResourceTypeChoiceSequence().getProfile().getPowerProfile().setEnergyEstimationPlugin(eep);
-					}
-				}
-			} catch (FileNotFoundException e) {
-			} catch (IOException e) {
-			}
+
 			initProfiles(computingResource.getComputingResourceTypeChoiceSequence().getProfile());
 			initLocation(computingResource.getComputingResourceTypeChoiceSequence().getLocation());
+			initDevices(computingResource.getComputingResourceTypeChoiceSequence().getDevice());
 			this.parameters = extractParameters(computingResource.getComputingResourceTypeChoiceSequence().getParameter());
 		}
@@ -97,164 +59,18 @@
 		}
 	}
-
-	private void initProfiles(Profile profile) {
-		if (profile != null) {
-			initPowerProfile(profile.getPowerProfile());
-			initAirThroughputProfile(profile.getAirThroughputProfile());
-			initThermalProfile(profile.getThermalProfile());
-		}
-	}
 	
-	private void initPowerProfile(schemas.PowerProfile powerProfileCharacteristic) {
-		
-		if (powerProfileCharacteristic != null) {
-			EnergyEstimationPlugin energyEstimationPlugin = null;
-			List<PowerState> powerStates = null;
-			List<PState> pStates = null;
-			if(powerProfileCharacteristic.getEnergyEstimationPlugin() != null){
-				String energyEstimationPluginName = powerProfileCharacteristic.getEnergyEstimationPlugin().getName();
-				if(energyEstimationPluginName != null) {
-					energyEstimationPlugin = (EnergyEstimationPlugin) InstanceFactory.createInstance(
-							energyEstimationPluginName, EnergyEstimationPlugin.class);			
-				} else {
-					energyEstimationPlugin = new DefaultEnergyEstimationPlugin();
-				}
-				Parameters params = extractParameters(powerProfileCharacteristic.getEnergyEstimationPlugin().getParameter());
-				energyEstimationPlugin.init(params);
+	private void initDevices(schemas.Device[] dev) {
+		if (dev != null){
+			this.devices = new ArrayList<Device>();
+			for(int i = 0; i < dev.length; i++){
+				Device device = new Device(new DeviceDescription(dev[i]));
+				this.devices.add(device);
 			}
-			
-			if(powerProfileCharacteristic.getPowerStates() != null) {
-				powerStates = new ArrayList<PowerState>();
-				int powerStateCount = powerProfileCharacteristic.getPowerStates().getPowerStateCount();
-				for (int i = 0; i < powerStateCount ; i++) {
-					schemas.PowerState ps = powerProfileCharacteristic.getPowerStates().getPowerState(i);
-					List<Transition> transitions = new ArrayList<Transition>();
-					int transitionCount = ps.getTransitionCount();
-					for (int j = 0; j < transitionCount; j++) {
-						schemas.Transition t = ps.getTransition(j);
-						Transition transition = new Transition(PowerStateNameFactory.createPowerStateName(t.getTo()), t
-								.getPowerUsage().getContent(), t.getTime().getContent());
-						Parameters params = extractParameters(t.getParameter());
-						transition.init(params);
-						transitions.add(transition);
-					}
-					//CoolEmAll DEBB description case
-					if(ps.getPowerUsage() == null){
-						ps.setPowerUsage(new PowerUsage("0"));
-					}
-					PowerState powerState = new PowerState(PowerStateNameFactory.createPowerStateName(ps.getName()), ps
-							.getPowerUsage().getContent(), transitions);
-					Parameters params = extractParameters(ps.getParameter());
-					powerState.init(params);
-					powerStates.add(powerState);
-				}
-			}
-			
-			if(powerProfileCharacteristic.getParameter() != null){
-				pStates = new ArrayList<PState>();
-				int parameterCount = powerProfileCharacteristic.getParameterCount();
-				for(int i = 0; i < parameterCount; i++){
-					schemas.Parameter parameter = powerProfileCharacteristic.getParameter(i);
-					if(parameter.getName().equals("pState")){
-						PState.Builder builder = new PState.Builder();
-						int propertyCount = parameter.getParameterTypeSequence().getPropertyCount();
-						for(int j = 0; j < propertyCount; j++){
-							schemas.Property property = parameter.getParameterTypeSequence().getProperty(j);
-							if(property.getName().equals("name")){
-								 builder = builder.name(property.getStringValueWithUnit(0).getContent());
-							} else if (property.getName().equals("frequency")){
-								 builder = builder.frequency(Double.valueOf(property.getStringValueWithUnit(0).getContent()));
-							} else if (property.getName().equals("voltage")){
-								builder = builder.voltage(Double.valueOf(property.getStringValueWithUnit(0).getContent()));
-							} else if (property.getName().equals("powerUsage")){
-								if(property.getStringValueWithUnit(0).getContent() != null && property.getStringValueWithUnit(0).getContent().length() > 0){
-									builder = builder.powerUsage(Double.valueOf(property.getStringValueWithUnit(0).getContent()));	
-								}
-							} else if (property.getName().equals("powerUsageMin")){
-								if(property.getStringValueWithUnit(0).getContent() != null && property.getStringValueWithUnit(0).getContent().length() > 0){
-									builder = builder.powerUsageMin(Double.valueOf(property.getStringValueWithUnit(0).getContent()));	
-								}
-							} else if (property.getName().equals("powerUsageMax")){
-								if(property.getStringValueWithUnit(0).getContent() != null && property.getStringValueWithUnit(0).getContent().length() > 0){
-									builder = builder.powerUsageMax(Double.valueOf(property.getStringValueWithUnit(0).getContent()));	
-								}
-							}
-						}
-						PState pState = builder.build();
-						pStates.add(pState);
-					}
-				}	
-			}
-			this.powerProfile = new PowerProfile(energyEstimationPlugin, powerStates, pStates);
-			Parameters params = extractParameters(powerProfileCharacteristic.getParameter());
-			this.powerProfile.init(params);
 		}
 	}
 
-	private void initAirThroughputProfile(schemas.AirThroughputProfile airThroughputProfile) {
-		if (airThroughputProfile != null) {
-			
-			AirThroughputEstimationPlugin airThroughputEstimationPlugin = null;
-			List<AirThroughputState> airThroughputStates = null;
-			if(airThroughputProfile.getAirThroughputEstimationPlugin() != null){
-				String airThroughputEstimationPluginName = airThroughputProfile.getAirThroughputEstimationPlugin().getName();
-				if(airThroughputEstimationPluginName != null) {
-					airThroughputEstimationPlugin = (AirThroughputEstimationPlugin) InstanceFactory.createInstance(
-							airThroughputEstimationPluginName, AirThroughputEstimationPlugin.class);			
-				} else {
-					airThroughputEstimationPlugin = new DefaultAirThroughputEstimationPlugin();
-				}
-				Parameters params = extractParameters(airThroughputProfile.getAirThroughputEstimationPlugin().getParameter());
-				airThroughputEstimationPlugin.init(params);
-			}
-			if(airThroughputProfile.getAirThroughputStates() != null){
-				airThroughputStates = new ArrayList<AirThroughputState>();
-				int airThrouhputStateCount = airThroughputProfile.getAirThroughputStates().getAirThroughputStateCount();
-				for (int i = 0; i < airThrouhputStateCount; i++) {
-					schemas.AirThroughputState ats = airThroughputProfile.getAirThroughputStates().getAirThroughputState(i);
-					AirThroughputState airThroughputState = new AirThroughputState(ats.getName(), ats.getValue()
-							.getContent(), ats.getPowerUsage().getContent());
-					Parameters params = extractParameters(ats.getParameter());
-					airThroughputState.init(params);
-					airThroughputStates.add(airThroughputState);
-				}
-			}
-			this.airThroughputProfile = new AirThroughputProfile(airThroughputEstimationPlugin, airThroughputStates);
-			Parameters params = extractParameters(airThroughputProfile.getParameter());
-			this.airThroughputProfile.init(params);
-		}
+	public String getCompResourceParameterValue(String name){
+		return getParameters().get(name).get(0).getContent();
 	}
-	
-	private void initThermalProfile(schemas.ThermalProfile thermalProfile) {
-		
-		if (thermalProfile != null) {
-			
-			TemperatureEstimationPlugin temperatureEstimationPlugin = null;
-
-			if(thermalProfile.getTemperatureEstimationPlugin() != null){
-				String temperatureEstimationPluginName = thermalProfile.getTemperatureEstimationPlugin().getName();
-				if(temperatureEstimationPluginName != null) {
-					temperatureEstimationPlugin = (TemperatureEstimationPlugin) InstanceFactory.createInstance(
-							temperatureEstimationPluginName, TemperatureEstimationPlugin.class);			
-				} else {
-					temperatureEstimationPlugin = new DefaultTemperatureEstimationPlugin();
-				}
-				Parameters params = extractParameters(thermalProfile.getTemperatureEstimationPlugin().getParameter());
-				temperatureEstimationPlugin.init(params);
-			}
-			this.thermalProfile = new ThermalProfile();
-			Parameters params = extractParameters(thermalProfile.getParameter());
-			this.thermalProfile.init(params);
-		}
-	}
-	
-	private void initLocation(schemas.Location l) {
-		if (location != null) {
-			this.location = new Location(l.getHorizontal(), l.getVertical(), l.getDepth());
-			Parameters params = extractParameters(l.getParameter());
-			this.location.init(params);
-		}
-	}
-
 
 	/*private Properties initProperties(schemas.Parameter[] parameters){
@@ -285,78 +101,52 @@
 		return prop;
 	}*/
-	
-	private Parameters extractParameters(schemas.Parameter[] parameters){
-		
-		Parameters params = null;
-		
-		if(parameters.length != 0)
-			params = new Parameters();
-		
-		for(int i = 0; i < parameters.length; i++){
-			schemas.Parameter parameter = parameters[i];
-			Parameter param = new Parameter(parameter.getName());
-			if(parameter.getParameterTypeSequence() != null && parameter.getParameterTypeSequence().getProperty() != null)
-			{							
-				int propertyCount = parameter.getParameterTypeSequence().getPropertyCount();
-				for(int j = 0; j < propertyCount; j++){
-					schemas.Property property = parameter.getParameterTypeSequence().getProperty(j);
-					Property prop = new Property(property.getName());
-					int stringValueWithUnitCount = property.getStringValueWithUnitCount();
-					for(int k = 0; k < stringValueWithUnitCount; k++){
-						prop.add(property.getStringValueWithUnit(k));
-					}
-					param.addProperty(prop);
-				}
-			} else {
-				int stringValueWithUnitCount =  parameter.getStringValueWithUnitCount();
-				for(int j = 0; j < stringValueWithUnitCount; j++){
-					param.add(parameter.getStringValueWithUnit(j));
-				}
-			}
-			params.put(parameter.getName(), param);
-		}
-		return params;
-	}
 
-	public PowerProfile getPowerProfile() {
-		return powerProfile;
-	}
 
-	public AirThroughputProfile getAirThroughputProfile() {
-		return airThroughputProfile;
-	}
-
-	public ThermalProfile getThermalProfile() {
-		return thermalProfile;
-	}
-	
-	public Location getLocation() {
-		return location;
-	}
-
-	public String getCategory() {
-		return category;
+	public List<Device> getDevices() {
+		return devices;
 	}
 
 
-	/***COOLEMALL CASE RELATED***/
-
-	private static ResourceBundle recsBundle;
-	
-	private ResourceBundle getRecsBundle(String fileName) throws FileNotFoundException, IOException{
-		if(recsBundle == null){
-			recsBundle = new PropertyResourceBundle(new FileInputStream(fileName));
+	public void addResourceUnit(ResourceUnit unit) {
+		if (this.resUnits == null)
+			this.resUnits = new HashMap<ResourceUnitName, List<ResourceUnit>>(1);
+		List<ResourceUnit> list = null;
+		if (this.resUnits.containsKey(unit.getName())) {
+			list = this.resUnits.get(unit.getName());
+		} else {
+			list = new ArrayList<ResourceUnit>(1);
+			this.resUnits.put(unit.getName(), list);
 		}
-		return recsBundle;
+		list.add(unit);
 	}
 	
-	protected String getEEP(String query, String fileName) throws FileNotFoundException, IOException{
-		ResourceBundle recsBundle = getRecsBundle(fileName);
-		return recsBundle.getString(query);
+	public ResourceUnit getResourceUnit(ResourceUnitName unitName) throws NoSuchFieldException {
+		return getResourceUnitList(unitName).get(0);
 	}
-	
-	protected String createEEPQuery(ComputingResource compRes) {
-		String query = compRes.getClazz() + "EEP";
-		return query;
+
+	public List<ResourceUnit> getResourceUnitList(ResourceUnitName unitName) throws NoSuchFieldException {
+		if (resUnits.containsKey(unitName))
+			return resUnits.get(unitName);
+		else
+			throw new NoSuchFieldException("Resource unit " + unitName + " is not available in resource " + this.id);
+	}
+
+	public Collection<ResourceUnit> getResourceUnit() {
+		if (resUnits == null)
+			return null;
+		List<ResourceUnit> values = new ArrayList<ResourceUnit>();
+		Collection<List<ResourceUnit>> lists = resUnits.values();
+		Iterator<List<ResourceUnit>> itr = lists.iterator();
+
+		while (itr.hasNext()) {
+			List<ResourceUnit> list = itr.next();
+			values.addAll(list);
+		}
+
+		return values;
+	}
+
+	public Map<ResourceUnitName, List<ResourceUnit>> getResourceUnits() {
+		return resUnits;
 	}
 }
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/computing/description/ExecutingResourceDescription.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/computing/description/ExecutingResourceDescription.java	(revision 477)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/computing/description/ExecutingResourceDescription.java	(revision 1207)
@@ -1,74 +1,21 @@
 package schedframe.resources.computing.description;
 
-import java.util.ArrayList;
 import java.util.Collection;
-import java.util.HashMap;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
-import schedframe.Parameters;
-import schedframe.resources.ResourceType;
 import schedframe.resources.units.ResourceUnit;
 import schedframe.resources.units.ResourceUnitName;
 
-public class ExecutingResourceDescription extends AbstractResourceDescription {
+public interface ExecutingResourceDescription {
+	
+	public void addResourceUnit(ResourceUnit unit);
+	
+	public ResourceUnit getResourceUnit(ResourceUnitName unitName) throws NoSuchFieldException ;
 
-	protected Map<ResourceUnitName, List<ResourceUnit>> resUnits;
-	protected Parameters parameters;
+	public List<ResourceUnit> getResourceUnitList(ResourceUnitName unitName) throws NoSuchFieldException;
+
+	public Collection<ResourceUnit> getResourceUnit();
 	
-	public ExecutingResourceDescription(ResourceType type) {
-		super(type);
-	}
-
-	public Parameters getParameters() {
-		return parameters;
-	}
-	
-	public String getCompResourceParameterValue(String name){
-		return getParameters().get(name).get(0).getContent();
-	}
-	
-	public void addResourceUnit(ResourceUnit unit) {
-		if (this.resUnits == null)
-			this.resUnits = new HashMap<ResourceUnitName, List<ResourceUnit>>(1);
-		List<ResourceUnit> list = null;
-		if (this.resUnits.containsKey(unit.getName())) {
-			list = this.resUnits.get(unit.getName());
-		} else {
-			list = new ArrayList<ResourceUnit>(1);
-			this.resUnits.put(unit.getName(), list);
-		}
-		list.add(unit);
-	}
-	
-	public ResourceUnit getResourceUnit(ResourceUnitName unitName) throws NoSuchFieldException {
-		return getResourceUnitList(unitName).get(0);
-	}
-
-	public List<ResourceUnit> getResourceUnitList(ResourceUnitName unitName) throws NoSuchFieldException {
-		if (resUnits.containsKey(unitName))
-			return resUnits.get(unitName);
-		else
-			throw new NoSuchFieldException("Resource unit " + unitName + " is not available in resource " + this.id);
-	}
-
-	public Collection<ResourceUnit> getResourceUnit() {
-		if (resUnits == null)
-			return null;
-		List<ResourceUnit> values = new ArrayList<ResourceUnit>();
-		Collection<List<ResourceUnit>> lists = resUnits.values();
-		Iterator<List<ResourceUnit>> itr = lists.iterator();
-
-		while (itr.hasNext()) {
-			List<ResourceUnit> list = itr.next();
-			values.addAll(list);
-		}
-
-		return values;
-	}
-
-	public Map<ResourceUnitName, List<ResourceUnit>> getResourceUnits() {
-		return resUnits;
-	}
+	public Map<ResourceUnitName, List<ResourceUnit>> getResourceUnits();
 }
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/computing/description/AbstractResourceDescription.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/computing/description/AbstractResourceDescription.java	(revision 477)
+++ 	(revision )
@@ -1,59 +1,0 @@
-package schedframe.resources.computing.description;
-
-
-import java.util.ArrayList;
-import java.util.List;
-
-import schedframe.resources.ResourceType;
-
-
-public abstract class AbstractResourceDescription {
-
-	protected String id;
-	protected ResourceType type;
-	protected List<AbstractResourceDescription> children;
-	
-	public AbstractResourceDescription(ResourceType type){
-		this.type = type;
-		this.children = null;
-	}
-
-	public List<AbstractResourceDescription> getChildren() {
-		return children;
-	}
-	
-	public void setChildren(List<AbstractResourceDescription> children) {
-		this.children = children;
-	}
-	
-	public void addChildren(AbstractResourceDescription child) {
-		//child.setParent(this);
-		if(children == null)
-			children = new ArrayList<AbstractResourceDescription> (1);
-		this.children.add(child);
-	}
-
-	public String getId(){
-		return this.id;
-	}
-
-	public ResourceType getType() {
-		return type;
-	}
-	
-	/*protected AbstractResourceDescription parent;
-	/public AbstractResourceDescription getParent() {
-		return parent;
-	}
-
-	public void setParent(AbstractResourceDescription parent) {
-		this.parent = parent;
-	}*/
-	
-	/*public enum ResourceType {
-		COMPUTING_RESOURCE,
-		QUEUING_SYSTEM;
-	}
-	*/
-	
-}
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/computing/validator/ResourceNameValidator.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/computing/validator/ResourceNameValidator.java	(revision 477)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/computing/validator/ResourceNameValidator.java	(revision 1207)
@@ -13,5 +13,5 @@
 	@Override
 	public boolean validate(ComputingResource resource) {
-		return resource.getName().equals(name);
+		return resource.getFullName().equals(name);
 	}
 
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 1207)
@@ -0,0 +1,85 @@
+package schedframe.resources.computing;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import schedframe.resources.devices.Device;
+import schedframe.resources.units.ResourceUnit;
+import schedframe.resources.units.ResourceUnitName;
+
+public class ComputingResourceCharacteristics extends ResourceCharacteristics{
+
+	
+	protected Map<ResourceUnitName, List<ResourceUnit>> resUnits;
+	protected List<Device> devices;
+	
+	protected ComputingResourceCharacteristics(Builder<?> builder) {
+		super(builder);
+		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 resUnits;
+	}
+	
+	public ResourceUnit getResourceUnit(ResourceUnitName unitName) throws NoSuchFieldException{
+		if(getResourceUnits().containsKey(unitName))
+			return getResourceUnits().get(unitName).get(0);
+		else throw new NoSuchFieldException("Resource unit " + unitName + 
+				" is not available in this resource ");
+	}
+	
+	public void addResourceUnit(ResourceUnit unit){ 
+		if(resUnits == null){
+			resUnits = new HashMap<ResourceUnitName, List<ResourceUnit>>(2);
+		}
+		List<ResourceUnit> list = null;
+		if(resUnits.containsKey(unit.getName())){
+			list = resUnits.get(unit.getName());
+		} else {
+			list = new ArrayList<ResourceUnit>(1);
+			resUnits.put(unit.getName(), list);
+		}
+		list.add(unit);
+	}
+	
+
+	
+	public List<Device> getDevices(){
+		if(devices == null)
+			return new ArrayList<Device>();
+		return devices;
+	}
+	
+	public static abstract class Builder<T extends Builder<T>> extends ResourceCharacteristics.Builder<T> {
+
+		protected Map<ResourceUnitName, List<ResourceUnit>> resUnits;
+		protected List<Device> devices;
+		
+        public T resourceUnits(Map<ResourceUnitName, List<ResourceUnit>> units){this.resUnits = units; return self(); }
+        public T resourceUnits(){this.resUnits = new HashMap<ResourceUnitName, List<ResourceUnit>>(2); return self(); }
+        public T device(List<Device> dev){this.devices = dev; return self(); }
+
+        public ComputingResourceCharacteristics build() {
+            return new ComputingResourceCharacteristics(this);
+        }
+    }
+
+    public static class Builder2 extends Builder<Builder2> {
+        @Override
+        protected Builder2 self() {
+            return this;
+        }
+    }
+
+    public static Builder<?> builder() {
+        return new Builder2();
+    }
+
+}
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/computing/DataCenter.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/computing/DataCenter.java	(revision 756)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/computing/DataCenter.java	(revision 1207)
@@ -20,5 +20,5 @@
 	@SuppressWarnings("unchecked")
 	public List<ComputingNode> getComputingNodes(){
-		return (List<ComputingNode>) getDescendantsByType(StandardResourceType.ComputingNode);
+		return (List<ComputingNode>) getDescendantsByType(StandardResourceType.Node);
 	}
 	
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/computing/ComputingNode.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/computing/ComputingNode.java	(revision 756)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/computing/ComputingNode.java	(revision 1207)
@@ -3,5 +3,4 @@
 import java.util.List;
 import java.util.Properties;
-
 
 import schedframe.resources.ResourceStatus;
@@ -10,9 +9,5 @@
 import schedframe.resources.computing.extensions.ExtensionType;
 import schedframe.resources.computing.profiles.energy.EnergyExtension;
-import schedframe.resources.computing.profiles.energy.airthroughput.AirThroughputInterfaceFactory;
-import schedframe.resources.computing.profiles.energy.airthroughput.ui.AirThroughputInterface;
-import schedframe.resources.computing.profiles.energy.power.PowerInterfaceFactory;
 import schedframe.resources.computing.profiles.energy.power.ui.ComputingNodePowerInterface;
-import schedframe.resources.computing.profiles.energy.power.ui.PowerInterface;
 import schedframe.resources.computing.properties.ComputingNodePropertiesBuilder;
 import schedframe.resources.computing.properties.PropertiesDirector;
@@ -32,13 +27,5 @@
 		//accept(new EnergyExtension(pi, resDesc.getPowerProfile()));
 		//accept(new EnergyExtension(pi, resDesc.getPowerProfile(), ai, resDesc.getAirThroughputProfile()));	
-	}
-	
-	/*public ComputingNode (String resourceName, ResourceCharacteristics resourceCharacteristic, Category cat, PowerInterface powerInterface) {
-		super(resourceName, ResourceType.COMPUTING_NODE, resourceCharacteristic);
-		category = cat;
-		accept(powerInterface);
-	//	extensionList.add(new EnergyExtension(this, "example.energy.ComputingNodeEnergyEstimationPlugin"));
-	}*/
-	
+	}	
 	
 	public ComputingNodePowerInterface getPowerInterface(){
@@ -86,5 +73,5 @@
 	
 	public Memory getMemory() throws NoSuchFieldException {
-		return (Memory) resourceCharacteristic.getResourceUnit(StandardResourceUnitName.MEMORY);
+		return (Memory) ((ComputingResourceCharacteristics)resourceCharacteristic).getResourceUnit(StandardResourceUnitName.MEMORY);
 	}
 	
@@ -95,5 +82,5 @@
 	
 	private Cost getCost() throws NoSuchFieldException {
-		return (Cost) resourceCharacteristic.getResourceUnit(StandardResourceUnitName.COST);
+		return (Cost) ((ComputingResourceCharacteristics)resourceCharacteristic).getResourceUnit(StandardResourceUnitName.COST);
 	}
 
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/computing/properties/ResourceProperties.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/computing/properties/ResourceProperties.java	(revision 477)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/computing/properties/ResourceProperties.java	(revision 1207)
@@ -3,5 +3,5 @@
 import java.util.Properties;
 
-import schedframe.resources.computing.description.AbstractResourceDescription;
+import schedframe.resources.computing.description.ResourceDescription;
 
 public class ResourceProperties extends Properties{
@@ -16,5 +16,5 @@
 	}
 	
-	public ResourceProperties(AbstractResourceDescription ard){
+	public ResourceProperties(ResourceDescription ard){
 		
 	}
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/computing/ComputingResource.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/computing/ComputingResource.java	(revision 1005)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/computing/ComputingResource.java	(revision 1207)
@@ -9,5 +9,4 @@
 import java.util.Properties;
 
-import schedframe.Initializable;
 import schedframe.events.Event;
 import schedframe.events.EventHandler;
@@ -17,18 +16,12 @@
 import schedframe.events.scheduling.SchedulingEventCommand;
 import schedframe.exceptions.ResourceException;
-import schedframe.resources.Resource;
 import schedframe.resources.ResourceStatus;
 import schedframe.resources.ResourceType;
 import schedframe.resources.computing.description.ComputingResourceDescription;
 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.EnergyEvent;
 import schedframe.resources.computing.profiles.energy.EnergyEventType;
 import schedframe.resources.computing.profiles.energy.EnergyExtension;
-import schedframe.resources.computing.profiles.energy.airthroughput.ui.AirThroughputInterface;
-import schedframe.resources.computing.profiles.energy.power.ui.PowerInterface;
-import schedframe.resources.computing.profiles.energy.thermal.ui.ThermalInterface;
 import schedframe.resources.computing.properties.DefaultPropertiesBuilder;
 import schedframe.resources.computing.properties.PropertiesDirector;
@@ -38,15 +31,9 @@
 import schedframe.resources.computing.validator.ResourceTypeValidator;
 import schedframe.resources.computing.validator.ResourceValidator;
-import schedframe.resources.units.PEUnit;
-import schedframe.resources.units.ResourceUnit;
-import schedframe.resources.units.StandardResourceUnitName;
+import schedframe.resources.devices.Device;
+import schedframe.resources.devices.PhysicalResource;
 import schedframe.scheduling.Scheduler;
 
-public class ComputingResource implements Resource, Initializable{
-	
-	protected String name;
-	protected ResourceType type;
-	protected String category;
-	protected ResourceStatus status;
+public class ComputingResource extends PhysicalResource{
 
 	protected ComputingResource parent;
@@ -54,11 +41,6 @@
 	
 	protected Scheduler scheduler;
-	protected ResourceCharacteristics resourceCharacteristic;
-	protected ExtensionList extensionList;
-	
-
-	public ExtensionList getExtensionList() {
-		return extensionList;
-	}
+	//protected ResourceCharacteristics resourceCharacteristic;
+
 
 	public ComputingResource(ComputingResourceDescription resDesc) {
@@ -69,24 +51,12 @@
 		this.extensionList = new ExtensionListImpl(1);
 		initCharacteristics(resDesc);
-		accept(new EnergyExtension(this, resDesc.getPowerProfile(), resDesc.getAirThroughputProfile(), resDesc.getThermalProfile()));	
-		addFakeProcessors();
-	}
-
-	//TODO remove if possible (check if all scenarios can be realized - statistics issue), since it's a temporary method
-	private void addFakeProcessors() {
-		if(getResourceCharacteristic().getResourceUnits().get(StandardResourceUnitName.PE) != null){
-			for(ResourceUnit resUnit: getResourceCharacteristic().getResourceUnits().get(StandardResourceUnitName.PE)){
-				PEUnit peUnit = (PEUnit) resUnit;
-				for(int i = 0; i < peUnit.getAmount(); i++){
-					schemas.ComputingResource fakeCompResource = new schemas.ComputingResource();
-					fakeCompResource.setClazz("Processor");
-					addChild(ResourceFactory.createResource(new ComputingResourceDescription(fakeCompResource)));
-				}
-			}
-		}
+		accept(new EnergyExtension.Builder().resource(this).powerProfile(resDesc.getPowerProfile()).airFlowProfile(resDesc.getAirThroughputProfile()).thermalProfile(resDesc.getThermalProfile()).build());	
 	}
 
 	protected void initCharacteristics(ComputingResourceDescription resDesc){
-		resourceCharacteristic = new ResourceCharacteristics.Builder().resourceUnits(resDesc.getResourceUnits()).location(resDesc.getLocation()).parameters(resDesc.getParameters()).build();
+		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);
+		}
 	}
 	
@@ -112,8 +82,4 @@
 	}
 
-	public String getName() {
-		return name;
-	}
-	
 	public String getFullName() {
 		if(this.getResourceCharacteristic().getParameters().get("fullPath") != null){
@@ -127,14 +93,6 @@
 	}
 
-	public ResourceType getType() {
-		return type;
-	}
-
-	public ResourceCharacteristics getResourceCharacteristic() {
-		return resourceCharacteristic;
-	}
-
-	public ResourceStatus getStatus() {
-		return status;
+	public ComputingResourceCharacteristics getResourceCharacteristic() {
+		return (ComputingResourceCharacteristics)resourceCharacteristic;
 	}
 
@@ -245,46 +203,4 @@
 	}
 	
-	public String getCategory(){
-		return category;
-	}
-	
-	public PowerInterface getPowerInterface(){
-		Extension extension = getExtension(ExtensionType.ENERGY_EXTENSION);
-		if(extension != null){
-			EnergyExtension ee = (EnergyExtension)extension;
-			return ee.getPowerInterface();
-		}
-		return null;
-	}
-	
-	public AirThroughputInterface getAirThroughputInterface(){
-		Extension extension = getExtension(ExtensionType.ENERGY_EXTENSION);
-		if(extension != null){
-			EnergyExtension ee = (EnergyExtension)extension;
-			return ee.getAirThroughputInterface();
-		}
-		return null;
-	}
-	
-	public ThermalInterface getThermalInterface(){
-		Extension extension = getExtension(ExtensionType.ENERGY_EXTENSION);
-		if(extension != null){
-			EnergyExtension ee = (EnergyExtension)extension;
-			return ee.getThermalInterface();
-		}
-		return null;
-	}
-
-	private Extension getExtension(ExtensionType type){
-		if (extensionList != null) {
-			for (Extension extension : extensionList) {
-				if (extension.getType() == type) {
-					return extension;
-				}
-			}
-		}
-		return null;
-	}
-	
 	public Scheduler getScheduler() {
 		return scheduler;
@@ -307,4 +223,12 @@
 					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);
+						}
 					}
 				}
@@ -332,6 +256,8 @@
 	}
 	
-	public void initiate(){
-		
+	public final void initiate(){
+		for(Device dev: this.getResourceCharacteristic().getDevices()){
+			dev.initiate();
+		}
 		ResourceEventCommand rec = new ResourceEventCommand(this);
 		EnergyEvent event = new EnergyEvent(EnergyEventType.AIRFLOW_STATE_CHANGED, "Resource controller");
@@ -343,12 +269,14 @@
 		rec.execute(event);
 		
+		rec = new ResourceEventCommand(this);
+		event = new EnergyEvent(EnergyEventType.TEMPERATURE_CHANGED, "Resource controller");
+		event.setReason(EventReason.SIM_INIT);
+		rec.execute(event);
+		
 		//alternative way
 		//getEventHandler().handleResourceEvent(new EnergyEvent(EnergyEventType.AIRFLOW_STATE_CHANGED, "Resource controller"));
 		//getEventHandler().handleResourceEvent(new EnergyEvent(EnergyEventType.POWER_STATE_CHANGED, "Resource controller"));
 	}
-	
-	
-	private void accept(EnergyExtension e){
-		extensionList.add(e);
-	}
+
+
 }
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/computing/Processor.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/computing/Processor.java	(revision 883)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/computing/Processor.java	(revision 1207)
@@ -9,6 +9,4 @@
 import schedframe.resources.computing.extensions.ExtensionType;
 import schedframe.resources.computing.profiles.energy.EnergyExtension;
-import schedframe.resources.computing.profiles.energy.power.PowerInterfaceFactory;
-import schedframe.resources.computing.profiles.energy.power.ui.PowerInterface;
 import schedframe.resources.computing.profiles.energy.power.ui.ProcessorPowerInterface;
 import schedframe.resources.computing.properties.CpuPropertiesBuilder;
@@ -27,7 +25,15 @@
 	}
 
-
-	public ComputingNode getComputingNode(){
-		return (ComputingNode)parent;
+	public ComputingNode getNode(){
+		ComputingResource compRes = parent;
+		while(compRes != null && !compRes.getType().equals(StandardResourceType.Node)){
+			compRes = compRes.getParent();
+		}
+		ComputingNode compNode = null;
+		try{
+			compNode = (ComputingNode)compRes;
+		} catch(Exception e) {
+		}
+		return compNode;
 	}
 	
@@ -63,5 +69,5 @@
 
 	private CpuSpeed getSpeedUnit() throws NoSuchFieldException{
-		return (CpuSpeed) resourceCharacteristic.getResourceUnit(StandardResourceUnitName.CPUSPEED);
+		return (CpuSpeed) ((ComputingResourceCharacteristics)resourceCharacteristic).getResourceUnit(StandardResourceUnitName.CPUSPEED);
 	}
 	
@@ -80,7 +86,7 @@
 		super.initCharacteristics(resDesc);
 		try{
-			resourceCharacteristic.addResourceUnit(new CpuSpeed(name, Integer.valueOf(resDesc.getCompResourceParameterValue("speed")) * 1, 0));
+			((ComputingResourceCharacteristics)resourceCharacteristic).addResourceUnit(new CpuSpeed(name, Integer.valueOf(resDesc.getCompResourceParameterValue("speed")) * 1, 0));
 		} catch(Exception e){
-			resourceCharacteristic.addResourceUnit(new CpuSpeed(name,  1, 0));
+			((ComputingResourceCharacteristics)resourceCharacteristic).addResourceUnit(new CpuSpeed(name,  1, 0));
 		}
 	}
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/computing/ResourceFactory.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/computing/ResourceFactory.java	(revision 1095)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/computing/ResourceFactory.java	(revision 1207)
@@ -1,79 +1,20 @@
 package schedframe.resources.computing;
 
-import schedframe.resources.CoolEmAllResourceType;
 import schedframe.resources.StandardResourceType;
 import schedframe.resources.computing.description.ComputingResourceDescription;
-import schedframe.resources.computing.recs.ComputeBox1;
-import schedframe.resources.computing.recs.Node;
-import schedframe.resources.computing.recs.NodeGroup;
 import schedframe.scheduling.Scheduler;
 import schedframe.scheduling.manager.resources.ManagedResources;
 import schedframe.scheduling.plugin.SchedulingPlugin;
 import schedframe.scheduling.plugin.estimation.ExecutionTimeEstimationPlugin;
-import schedframe.scheduling.policy.AbstractManagementSystem;
-import schedframe.scheduling.policy.global.GridBroker;
-import schedframe.scheduling.policy.local.LocalManagementSystem;
 import schedframe.scheduling.queue.TaskQueueList;
-import simulator.DCWormsConstants;
 
 
-public class ResourceFactory {
+public interface ResourceFactory {
 
-	public static ComputingResource createResource(ComputingResourceDescription resDesc){
-		
-		if (resDesc.getType().equals(StandardResourceType.DataCenter))
-			return new DataCenter(resDesc);
-		else if (resDesc.getType().equals(StandardResourceType.Rack))
-			return new Rack(resDesc);
-		else if (resDesc.getType().equals(StandardResourceType.ComputingNode))
-			return new ComputingNode(resDesc);
-		else if (resDesc.getType().equals(StandardResourceType.Processor))
-			return new Processor(resDesc);
-		else if (resDesc.getType().equals(StandardResourceType.Core))
-			return new Core(resDesc);
-		else if (resDesc.getType().equals(CoolEmAllResourceType.ComputeBox1))
-			return new ComputeBox1(resDesc);
-		else if (resDesc.getType().equals(CoolEmAllResourceType.NodeGroup))
-			return new NodeGroup(resDesc);
-		else if (resDesc.getType().equals(CoolEmAllResourceType.Node))
-			return new Node(resDesc);
-		else if (resDesc.getType().equals(CoolEmAllResourceType.Processor))
-			return new Processor(resDesc);
-		else if (resDesc.getType().equals(CoolEmAllResourceType.Core))
-			return new Core(resDesc);
-		else
-			return new ComputingResource(resDesc);
+	public ComputingResource createComputingResource(ComputingResourceDescription resDesc);
+
+	//public Device createDevice(DeviceDescription devDesc);
 	
-		/*switch(resDesc.getType()){
-			case Grid: return new Grid(resDesc);
-			case DataCenter: return new DataCenter(resDesc);
-			case ComputingNode: return new ComputingNode(resDesc);
-			case Processor: return new Processor(resDesc);
-		default:
-			return new ComputingResource(resDesc);
-		}*/
-	}
-
-	public static Scheduler createScheduler(StandardResourceType type, String id, SchedulingPlugin schedulingPlugin, ExecutionTimeEstimationPlugin execTimeEstimationPlugin, TaskQueueList queues, ManagedResources managedResources) throws Exception{
-		AbstractManagementSystem ms;
-		switch(type){
-			case GS: {
-				ms = new GridBroker("grid",
-						schedulingPlugin, execTimeEstimationPlugin, queues);
-				return new Scheduler(ms, type, managedResources);
-			}
-			case LS: {
-				ms = new LocalManagementSystem(id, DCWormsConstants.MANAGEMENT_SYSTEM,
-						schedulingPlugin, execTimeEstimationPlugin, queues);
-				return new Scheduler(ms, type, managedResources);
-			}
-
-		default:{
-				ms = new LocalManagementSystem(id, DCWormsConstants.MANAGEMENT_SYSTEM,
-						schedulingPlugin, execTimeEstimationPlugin, queues);
-				return new Scheduler(ms, type, managedResources);
-			}
-		}
-	}
+	public Scheduler createScheduler(StandardResourceType type, String id, SchedulingPlugin schedulingPlugin, ExecutionTimeEstimationPlugin execTimeEstimationPlugin, TaskQueueList queues, ManagedResources managedResources) throws Exception;
 }
 
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/computing/Rack.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/computing/Rack.java	(revision 756)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/computing/Rack.java	(revision 1207)
@@ -5,7 +5,4 @@
 import schedframe.resources.StandardResourceType;
 import schedframe.resources.computing.description.ComputingResourceDescription;
-import schedframe.resources.computing.profiles.energy.EnergyExtension;
-import schedframe.resources.computing.profiles.energy.power.PowerInterfaceFactory;
-import schedframe.resources.computing.profiles.energy.power.ui.PowerInterface;
 
 public class Rack extends ComputingResource{
@@ -20,5 +17,5 @@
 	@SuppressWarnings("unchecked")
 	public List<ComputingNode> getComputingNodes(){
-		return (List<ComputingNode>) getDescendantsByType(StandardResourceType.ComputingNode);
+		return (List<ComputingNode>) getDescendantsByType(StandardResourceType.Node);
 	}
 	
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/computing/ResourceCharacteristics.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/computing/ResourceCharacteristics.java	(revision 1007)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/computing/ResourceCharacteristics.java	(revision 1207)
@@ -1,13 +1,6 @@
 package schedframe.resources.computing;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
 
 import schedframe.Parameters;
 import schedframe.resources.computing.location.Location;
-import schedframe.resources.units.ResourceUnit;
-import schedframe.resources.units.ResourceUnitName;
 
 
@@ -16,7 +9,8 @@
 	private static final long serialVersionUID = 2719535186621622647L;
 
-	protected Map<ResourceUnitName, List<ResourceUnit>> resUnits;
+	protected Location location;
 	protected Parameters parameters;
-	protected Location location;
+	//protected Location location;
+	//protected List<Device> devices;
 
 	/*public ResourceCharacteristics(Map<ResourceUnitName, List<AbstractResourceUnit>> resUnits){
@@ -32,54 +26,6 @@
 	}*/
 	
-	public Map<ResourceUnitName, List<ResourceUnit>> getResourceUnits() {
-		if(resUnits == null)
-			return new HashMap<ResourceUnitName, List<ResourceUnit>>();
-		return resUnits;
-	}
+
 	
-	public ResourceUnit getResourceUnit(ResourceUnitName unitName) throws NoSuchFieldException{
-		if(getResourceUnits().containsKey(unitName))
-			return getResourceUnits().get(unitName).get(0);
-		else throw new NoSuchFieldException("Resource unit " + unitName + 
-				" is not available in this resource ");
-	}
-	
-	public void addResourceUnit(ResourceUnit unit){ 
-		if(resUnits == null){
-			resUnits = new HashMap<ResourceUnitName, List<ResourceUnit>>(2);
-		}
-		List<ResourceUnit> list = null;
-		if(resUnits.containsKey(unit.getName())){
-			list = resUnits.get(unit.getName());
-		} else {
-			list = new ArrayList<ResourceUnit>(1);
-			resUnits.put(unit.getName(), list);
-		}
-		list.add(unit);
-	}
-	
-	
-	public static class Builder {
-		  
-		protected Map<ResourceUnitName, List<ResourceUnit>> resUnits;
-		protected Location location;
-		protected Parameters parameters;
-		
-		public Builder location(Location loc){this.location = loc; return this; }
-        public Builder parameters(Parameters params){this.parameters = params; return this; }
-        public Builder resourceUnits(Map<ResourceUnitName, List<ResourceUnit>> units){this.resUnits = units; return this; }
-        public Builder resourceUnits(){this.resUnits = new HashMap<ResourceUnitName, List<ResourceUnit>>(2); return this; }
-        
-        public ResourceCharacteristics build() {
-            return new ResourceCharacteristics(this);
-        }
-	}
-	
-	private ResourceCharacteristics(Builder builder) {
-		this.location = builder.location;
-		this.parameters = builder.parameters;
-		this.resUnits = builder.resUnits;
-	}
-
 	public Parameters getParameters() {
 		if(parameters == null)
@@ -91,4 +37,56 @@
 		return location;
 	}
+	
+	protected ResourceCharacteristics(Builder<?> builder) {
+		//this.location = builder.location;
+		this.parameters = builder.parameters;
+		this.location = builder.location;
+		//this.devices = builder.devices;
+	}
+	
+    public static abstract class Builder<T extends Builder<T>> {
+  	  
+		protected Location location;
+		protected Parameters parameters;
+
+        public T parameters(Parameters params){this.parameters = params; return self(); }
+		public T location(Location loc){this.location = loc; return self(); }
+		
+        protected abstract T self();
+
+        public ResourceCharacteristics build() {
+            return new ResourceCharacteristics(this);
+        }
+    }
+    private static class Builder2 extends Builder<Builder2> {
+        @Override
+        protected Builder2 self() {
+            return this;
+        }
+    }
+
+    public static Builder<?> builder() {
+        return new Builder2();
+    }
+	
+	/*public static class Builder {
+		  
+		protected Map<ResourceUnitName, List<ResourceUnit>> resUnits;
+		//protected Location location;
+		protected Parameters parameters;
+		//protected List<Device> devices;
+		
+		//public Builder location(Location loc){this.location = loc; return this; }
+        public Builder parameters(Parameters params){this.parameters = params; return this; }
+        //public Builder device(List<Device> dev){this.devices = dev; return this; }
+        public Builder resourceUnits(Map<ResourceUnitName, List<ResourceUnit>> units){this.resUnits = units; return this; }
+        public Builder resourceUnits(){this.resUnits = new HashMap<ResourceUnitName, List<ResourceUnit>>(2); return this; }
+        
+        public ResourceCharacteristics build() {
+            return new ResourceCharacteristics(this);
+        }
+	}
+	*/
+
 
 }
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/computing/coolemall/ComputeBox2.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/computing/coolemall/ComputeBox2.java	(revision 1207)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/computing/coolemall/ComputeBox2.java	(revision 1207)
@@ -0,0 +1,13 @@
+package schedframe.resources.computing.coolemall;
+
+import schedframe.resources.computing.DataCenter;
+import schedframe.resources.computing.description.ComputingResourceDescription;
+
+public class ComputeBox2 extends DataCenter {
+
+	public ComputeBox2(ComputingResourceDescription resDesc) {
+		super(resDesc);
+		// TODO Auto-generated constructor stub
+	}
+
+}
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/computing/coolemall/NodeGroup.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/computing/coolemall/NodeGroup.java	(revision 1207)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/computing/coolemall/NodeGroup.java	(revision 1207)
@@ -0,0 +1,26 @@
+package schedframe.resources.computing.coolemall;
+
+import java.util.List;
+
+import schedframe.resources.StandardResourceType;
+import schedframe.resources.computing.ComputingResource;
+import schedframe.resources.computing.Processor;
+import schedframe.resources.computing.description.ComputingResourceDescription;
+
+public class NodeGroup extends ComputingResource{
+	
+	public NodeGroup(ComputingResourceDescription resDesc) {
+		super(resDesc);
+	}
+
+	@SuppressWarnings("unchecked")
+	public List<Node> getNodes(){
+		return (List<Node>) getDescendantsByType(StandardResourceType.Node);
+	}
+	
+	@SuppressWarnings("unchecked")
+	public List<Processor> getProcessors(){
+		return (List<Processor>) getDescendantsByType(StandardResourceType.Processor);
+	}
+
+}
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/computing/coolemall/Node.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/computing/coolemall/Node.java	(revision 1207)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/computing/coolemall/Node.java	(revision 1207)
@@ -0,0 +1,34 @@
+package schedframe.resources.computing.coolemall;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import schedframe.resources.computing.ComputingNode;
+import schedframe.resources.computing.Core;
+import schedframe.resources.computing.Processor;
+import schedframe.resources.computing.description.ComputingResourceDescription;
+
+public class Node extends ComputingNode{
+
+	public Node(ComputingResourceDescription resDesc) {
+		super(resDesc);
+		// TODO Auto-generated constructor stub
+	}
+	
+	public List<Core> getCores(){
+		List<Core> cores = new ArrayList<Core>();
+		for(Processor proc: getProcessors()){
+			cores.addAll(proc.getCores());
+		}
+		return cores;
+	}
+
+	public List<Core> getFreeCores(){
+		List<Core> freeCores = new ArrayList<Core>();
+		for(Processor proc: getProcessors()){
+			freeCores.addAll(proc.getFreeCores());
+		}
+		return freeCores;
+	}
+
+}
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/computing/coolemall/ComputeBox1.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/computing/coolemall/ComputeBox1.java	(revision 1207)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/computing/coolemall/ComputeBox1.java	(revision 1207)
@@ -0,0 +1,28 @@
+package schedframe.resources.computing.coolemall;
+
+import java.util.List;
+
+import schedframe.resources.CoolEmAllResourceType;
+import schedframe.resources.StandardResourceType;
+import schedframe.resources.computing.ComputingNode;
+import schedframe.resources.computing.Rack;
+import schedframe.resources.computing.description.ComputingResourceDescription;
+
+public class ComputeBox1 extends Rack{
+	
+	public ComputeBox1(ComputingResourceDescription resDesc) {
+		super(resDesc);
+	}
+
+	@SuppressWarnings("unchecked")
+	public List<NodeGroup> getNodesGroups(){
+		return (List<NodeGroup>) getDescendantsByType(CoolEmAllResourceType.NodeGroup);
+	}
+	
+	@SuppressWarnings("unchecked")
+	public List<ComputingNode> getNodes(){
+		return (List<ComputingNode>) getDescendantsByType(StandardResourceType.Node);
+	}
+
+
+}
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/computing/Core.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/computing/Core.java	(revision 756)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/computing/Core.java	(revision 1207)
@@ -1,8 +1,6 @@
 package schedframe.resources.computing;
 
+import schedframe.resources.StandardResourceType;
 import schedframe.resources.computing.description.ComputingResourceDescription;
-import schedframe.resources.computing.profiles.energy.EnergyExtension;
-import schedframe.resources.computing.profiles.energy.power.PowerInterfaceFactory;
-import schedframe.resources.computing.profiles.energy.power.ui.PowerInterface;
 import schedframe.resources.units.CpuSpeed;
 import schedframe.resources.units.StandardResourceUnitName;
@@ -18,5 +16,27 @@
 
 	public Processor getProcessor(){
-		return (Processor)parent;
+		ComputingResource compRes = parent;
+		while(compRes != null && !compRes.getType().equals(StandardResourceType.Processor)){
+			compRes = compRes.getParent();
+		}
+		Processor proc = null;
+		try{
+			proc = (Processor)compRes;
+		} catch(ClassCastException e) {
+		}
+		return proc;
+	}
+	
+	public ComputingNode getNode(){
+		ComputingResource compRes = parent;
+		while(compRes != null && !compRes.getType().equals(StandardResourceType.Node)){
+			compRes = compRes.getParent();
+		}
+		ComputingNode compNode = null;
+		try{
+			compNode = (ComputingNode)compRes;
+		} catch(ClassCastException e) {
+		}
+		return compNode;
 	}
 	
@@ -42,5 +62,5 @@
 
 	private CpuSpeed getSpeedUnit() throws NoSuchFieldException{
-		return (CpuSpeed) resourceCharacteristic.getResourceUnit(StandardResourceUnitName.CPUSPEED);
+		return (CpuSpeed) ((ComputingResourceCharacteristics)resourceCharacteristic).getResourceUnit(StandardResourceUnitName.CPUSPEED);
 	}
 
@@ -48,7 +68,7 @@
 		super.initCharacteristics(resDesc);
 		try{
-			resourceCharacteristic.addResourceUnit(new CpuSpeed(name, Integer.valueOf(resDesc.getCompResourceParameterValue("speed")) * 1, 0));
+			((ComputingResourceCharacteristics)resourceCharacteristic).addResourceUnit(new CpuSpeed(name, Integer.valueOf(resDesc.getCompResourceParameterValue("speed")) * 1, 0));
 		} catch(Exception e){
-			resourceCharacteristic.addResourceUnit(new CpuSpeed(name,  1, 0));
+			((ComputingResourceCharacteristics)resourceCharacteristic).addResourceUnit(new CpuSpeed(name,  1, 0));
 		}
 	}
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/CoolEmAllResourceFactory.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/CoolEmAllResourceFactory.java	(revision 1207)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/CoolEmAllResourceFactory.java	(revision 1207)
@@ -0,0 +1,56 @@
+package schedframe.resources;
+
+import schedframe.resources.computing.ComputingResource;
+import schedframe.resources.computing.Core;
+import schedframe.resources.computing.DataCenter;
+import schedframe.resources.computing.Processor;
+import schedframe.resources.computing.ResourceFactory;
+import schedframe.resources.computing.coolemall.ComputeBox1;
+import schedframe.resources.computing.coolemall.Node;
+import schedframe.resources.computing.coolemall.NodeGroup;
+import schedframe.resources.computing.description.ComputingResourceDescription;
+import schedframe.scheduling.Scheduler;
+import schedframe.scheduling.manager.resources.ManagedResources;
+import schedframe.scheduling.plugin.SchedulingPlugin;
+import schedframe.scheduling.plugin.estimation.ExecutionTimeEstimationPlugin;
+import schedframe.scheduling.policy.AbstractManagementSystem;
+import schedframe.scheduling.policy.local.LocalManagementSystem;
+import schedframe.scheduling.queue.TaskQueueList;
+import simulator.DCWormsConstants;
+
+public class CoolEmAllResourceFactory implements ResourceFactory{
+	
+	public ComputingResource createComputingResource(ComputingResourceDescription resDesc){
+		
+		if (resDesc.getType().getName().equals(StandardResourceType.DataCenter.getName()))
+			return new DataCenter(resDesc);
+		else if (resDesc.getType().getName().equals(StandardResourceType.Rack.getName()))
+			return new ComputeBox1(resDesc);
+		else if (resDesc.getType().getName().equals(CoolEmAllResourceType.NodeGroup.getName()))
+			return new NodeGroup(resDesc);
+		else if (resDesc.getType().getName().equals(StandardResourceType.Node.getName()))
+			return new Node(resDesc);
+		else if (resDesc.getType().getName().equals(StandardResourceType.Processor.getName()))
+			return new Processor(resDesc);
+		else if (resDesc.getType().getName().equals(StandardResourceType.Core.getName()))
+			return new Core(resDesc);
+		else return new ComputingResource(resDesc);
+	}
+
+	public Scheduler createScheduler(StandardResourceType type, String id, SchedulingPlugin schedulingPlugin, ExecutionTimeEstimationPlugin execTimeEstimationPlugin, TaskQueueList queues, ManagedResources managedResources) throws Exception{
+		AbstractManagementSystem ms;
+		switch(type){
+			case LS: {
+				ms = new LocalManagementSystem(id, DCWormsConstants.MANAGEMENT_SYSTEM,
+						schedulingPlugin, execTimeEstimationPlugin, queues);
+				return new Scheduler(ms, type, managedResources);
+			}
+
+		default:{
+				ms = new LocalManagementSystem(id, DCWormsConstants.MANAGEMENT_SYSTEM,
+						schedulingPlugin, execTimeEstimationPlugin, queues);
+				return new Scheduler(ms, type, managedResources);
+			}
+		}
+	}
+}
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/Resource.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/Resource.java	(revision 893)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/Resource.java	(revision 1207)
@@ -1,3 +1,4 @@
 package schedframe.resources;
+
 
 
