Index: /DCWoRMS/trunk/src/schedframe/resources/computing/description/ComputingResourceDescription.java
===================================================================
--- /DCWoRMS/trunk/src/schedframe/resources/computing/description/ComputingResourceDescription.java	(revision 752)
+++ /DCWoRMS/trunk/src/schedframe/resources/computing/description/ComputingResourceDescription.java	(revision 815)
@@ -1,6 +1,11 @@
 package schedframe.resources.computing.description;
 
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.PropertyResourceBundle;
+import java.util.ResourceBundle;
 
 import schedframe.Parameter;
@@ -19,8 +24,12 @@
 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.units.ResourceUnit;
 import schedframe.resources.units.ResourceUnitFactory;
 import schedframe.resources.utils.ResourceIdGenerator;
 import schemas.ComputingResource;
+import schemas.PowerUsage;
 import schemas.Profile;
 import simulator.utils.InstanceFactory;
@@ -32,4 +41,5 @@
 	protected PowerProfile powerProfile;
 	protected AirThroughputProfile airThroughputProfile;
+	protected ThermalProfile thermalProfile;
 	protected Location location;
 	protected String category;
@@ -39,10 +49,29 @@
 
 		super(ResourceTypeFactory.createResourceType(computingResource.getClazz()));
-
+		this.category = computingResource.getType();
+		
 		initId(computingResource);
-		this.category = computingResource.getType();
 
 		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());
@@ -54,5 +83,5 @@
 		this.id = computingResource.getName() != null ? computingResource.getName() : type.toString();
 		if(computingResource.getCount() > 1 || computingResource.getName() == null){
-			this.id = id + "_" + String.valueOf(ResourceIdGenerator.getId(type));
+			this.id = id + "_" + String.valueOf(ResourceIdGenerator.getId(type.toString()));
 		}
 	}
@@ -73,4 +102,5 @@
 			initPowerProfile(profile.getPowerProfile());
 			initAirThroughputProfile(profile.getAirThroughputProfile());
+			initThermalProfile(profile.getThermalProfile());
 		}
 	}
@@ -83,5 +113,5 @@
 			List<PState> pStates = null;
 			if(powerProfileCharacteristic.getEnergyEstimationPlugin() != null){
-				String  energyEstimationPluginName = powerProfileCharacteristic.getEnergyEstimationPlugin().getName();
+				String energyEstimationPluginName = powerProfileCharacteristic.getEnergyEstimationPlugin().getName();
 				if(energyEstimationPluginName != null) {
 					energyEstimationPlugin = (EnergyEstimationPlugin) InstanceFactory.createInstance(
@@ -109,4 +139,8 @@
 						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);
@@ -119,9 +153,9 @@
 			if(powerProfileCharacteristic.getParameter() != null){
 				pStates = new ArrayList<PState>();
-				int parameterCount =  powerProfileCharacteristic.getParameterCount();
+				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();
+						PState.Builder builder = new PState.Builder();
 						int propertyCount = parameter.getParameterTypeSequence().getPropertyCount();
 						for(int j = 0; j < propertyCount; j++){
@@ -166,5 +200,5 @@
 			if(airThroughputProfile.getAirThroughputStates() != null){
 				airThroughputStates = new ArrayList<AirThroughputState>();
-				int airThrouhputStateCount =  airThroughputProfile.getAirThroughputStates().getAirThroughputStateCount();
+				int airThrouhputStateCount = airThroughputProfile.getAirThroughputStates().getAirThroughputStateCount();
 				for (int i = 0; i < airThrouhputStateCount; i++) {
 					schemas.AirThroughputState ats = airThroughputProfile.getAirThroughputStates().getAirThroughputState(i);
@@ -179,4 +213,27 @@
 			Parameters params = extractParameters(airThroughputProfile.getParameter());
 			this.airThroughputProfile.init(params);
+		}
+	}
+	
+	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);
 		}
 	}
@@ -260,4 +317,8 @@
 	}
 
+	public ThermalProfile getThermalProfile() {
+		return thermalProfile;
+	}
+	
 	public Location getLocation() {
 		return location;
@@ -268,3 +329,24 @@
 	}
 
+
+	/***COOLEMALL CASE RELATED***/
+
+	private static ResourceBundle recsBundle;
+	
+	private ResourceBundle getRecsBundle(String fileName) throws FileNotFoundException, IOException{
+		if(recsBundle == null){
+			recsBundle = new PropertyResourceBundle(new FileInputStream(fileName));
+		}
+		return recsBundle;
+	}
+	
+	protected String getEEP(String query, String fileName) throws FileNotFoundException, IOException{
+		ResourceBundle recsBundle = getRecsBundle(fileName);
+		return recsBundle.getString(query);
+	}
+	
+	protected String createEEPQuery(ComputingResource compRes) {
+		String query = compRes.getClazz() + "EEP";
+		return query;
+	}
 }
