Index: DCWoRMS/branches/coolemall/src/schedframe/SimulatedEnvironment.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/SimulatedEnvironment.java	(revision 1207)
+++ DCWoRMS/branches/coolemall/src/schedframe/SimulatedEnvironment.java	(revision 1396)
@@ -11,5 +11,5 @@
 
 import schedframe.exceptions.ResourceException;
-import schedframe.resources.ResourceHistoryChanges;
+import schedframe.resources.ResourceHistoryItem;
 import schedframe.resources.computing.ComputingResource;
 import schedframe.scheduling.Scheduler;
@@ -21,5 +21,5 @@
 	protected List<Initializable> toInit;
 	protected Set<String> compResLayers;
-	protected static List<ResourceHistoryChanges> compResHistory = new ArrayList<ResourceHistoryChanges>();
+	protected static List<ResourceHistoryItem> compResHistory = new ArrayList<ResourceHistoryItem>();
 	
 	public SimulatedEnvironment(Scheduler logicalStructure, List<ComputingResource> compResources){
@@ -156,9 +156,9 @@
 
 	public static void traceResource(long timestamp, String resourceName, String operation, String paramter){
-		ResourceHistoryChanges rhc = new ResourceHistoryChanges(timestamp, resourceName, operation, paramter);
+		ResourceHistoryItem rhc = new ResourceHistoryItem(timestamp, resourceName, operation, paramter);
 		compResHistory.add(rhc);
 	}
 
-	public static List<ResourceHistoryChanges> getCompResHistory() {
+	public static List<ResourceHistoryItem> getCompResHistory() {
 		return compResHistory;
 	}
Index: DCWoRMS/branches/coolemall/src/schedframe/scheduling/plugin/Module.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/scheduling/plugin/Module.java	(revision 1396)
+++ DCWoRMS/branches/coolemall/src/schedframe/scheduling/plugin/Module.java	(revision 1396)
@@ -0,0 +1,20 @@
+package schedframe.scheduling.plugin;
+
+import java.util.Properties;
+
+import schedframe.exceptions.ModuleException;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+public interface Module {
+
+	public void init(Properties properties) throws ModuleException;
+	
+	public void dispose() throws ModuleException;
+	
+	public ModuleType getType();
+	
+}
Index: DCWoRMS/branches/coolemall/src/schedframe/scheduling/plugin/grid/ResourceDiscovery.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/scheduling/plugin/grid/ResourceDiscovery.java	(revision 477)
+++ DCWoRMS/branches/coolemall/src/schedframe/scheduling/plugin/grid/ResourceDiscovery.java	(revision 1396)
@@ -6,4 +6,5 @@
 import schedframe.scheduling.SchedulerDescription;
 import schedframe.scheduling.SecurityContext;
+import schedframe.scheduling.plugin.Module;
 import schedframe.scheduling.tasks.requirements.AbstractResourceRequirements;
 
Index: DCWoRMS/branches/coolemall/src/schedframe/scheduling/plugin/grid/ModuleList.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/scheduling/plugin/grid/ModuleList.java	(revision 477)
+++ 	(revision )
@@ -1,12 +1,0 @@
-package schedframe.scheduling.plugin.grid;
-
-import java.util.List;
-
-public interface ModuleList extends List<Module>{
-	
-	public <T extends Module> List<T> get(ModuleType type);
-	
-	public Module getModule(ModuleType type);
-	
-	public boolean isModuleAvailable(ModuleType type);
-}
Index: DCWoRMS/branches/coolemall/src/schedframe/scheduling/plugin/grid/ModuleListImpl.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/scheduling/plugin/grid/ModuleListImpl.java	(revision 477)
+++ 	(revision )
@@ -1,58 +1,0 @@
-package schedframe.scheduling.plugin.grid;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * 
- * @author Marcin Krystek
- *
- */
-public class ModuleListImpl extends ArrayList<Module> implements ModuleList {
-
-	private static final long serialVersionUID = -3824600938144742457L;
-
-	public ModuleListImpl(){
-		super();
-	}
-	
-	public ModuleListImpl(int initialSize){
-		super(initialSize);
-	}
-	
-	public List<Module> get(ModuleType type){
-		List<Module> list = null;
-		
-		for(int i = 0; i < size(); i++){
-			Module m = get(i);
-			if(m.getType() == type){
-				list = (list == null ? new ArrayList<Module>(1) : list);
-				list.add(m);
-			}
-		}
-		return list;
-	}
-	
-	public Module getModule(ModuleType type){
-		
-		for(int i = 0; i < size(); i++){
-			Module m = get(i);
-			if(m.getType() == type){
-				return m;
-			}
-		}
-		return null;
-	}
-	
-	public boolean isModuleAvailable(ModuleType type){
-		for(int i = 0; i < size(); i++){
-			Module m = get(i);
-			if(m.getType() == type){
-				return true;
-			}
-		}
-		return false;
-	}
-	
-	
-}
Index: DCWoRMS/branches/coolemall/src/schedframe/scheduling/plugin/grid/Module.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/scheduling/plugin/grid/Module.java	(revision 477)
+++ 	(revision )
@@ -1,22 +1,0 @@
-package schedframe.scheduling.plugin.grid;
-
-import java.util.Properties;
-
-import eduni.simjava.Sim_event;
-
-import schedframe.exceptions.ModuleException;
-
-/**
- * 
- * @author Marcin Krystek
- *
- */
-public interface Module {
-
-	public void init(Properties properties) throws ModuleException;
-	
-	public void dispose() throws ModuleException;
-	
-	public ModuleType getType();
-	
-}
Index: DCWoRMS/branches/coolemall/src/schedframe/scheduling/plugin/grid/ModuleType.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/scheduling/plugin/grid/ModuleType.java	(revision 777)
+++ 	(revision )
@@ -1,36 +1,0 @@
-package schedframe.scheduling.plugin.grid;
-
-import schedframe.StaticResourceLoadCalendar;
-import test.EventManager;
-
-
-/**
- * 
- * @author Marcin Krystek
- *
- */
-public enum ModuleType {
-
-	RESOURCE_DISCOVERY("Resource_discovery", ResourceDiscovery.class),
-	RESOURCE_CALENDAR("Resource calendar", StaticResourceLoadCalendar.class),
-	EVENT_MANAGER("Event manager", EventManager.class);
-	//DATA_MANAGER("Data Manager", DataManager.class),
-	//AR_EXTENSION("ARExtension", ARExtension.class);
-
-	
-	private String name;
-	private Class<?> _interface;
-	
-	private ModuleType(String name, Class<?> _class){
-		this.name = name;
-		this._interface = _class;
-	}
-	
-	public String toString(){
-		return this.name;
-	}
-	
-	public boolean isValidFor(Module m){
-		return (m == null ? false : _interface.isAssignableFrom(m.getClass()));
-	}
-}
Index: DCWoRMS/branches/coolemall/src/schedframe/scheduling/plugin/ModuleType.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/scheduling/plugin/ModuleType.java	(revision 1396)
+++ DCWoRMS/branches/coolemall/src/schedframe/scheduling/plugin/ModuleType.java	(revision 1396)
@@ -0,0 +1,36 @@
+package schedframe.scheduling.plugin;
+
+
+import schedframe.scheduling.plugin.grid.ResourceDiscovery;
+import test.EventManager;
+
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+public enum ModuleType {
+
+	RESOURCE_DISCOVERY("Resource_discovery", ResourceDiscovery.class),
+	EVENT_MANAGER("Event manager", EventManager.class);
+	//DATA_MANAGER("Data Manager", DataManager.class),
+	//AR_EXTENSION("ARExtension", ARExtension.class);
+
+	
+	private String name;
+	private Class<?> _interface;
+	
+	private ModuleType(String name, Class<?> _class){
+		this.name = name;
+		this._interface = _class;
+	}
+	
+	public String toString(){
+		return this.name;
+	}
+	
+	public boolean isValidFor(Module m){
+		return (m == null ? false : _interface.isAssignableFrom(m.getClass()));
+	}
+}
Index: DCWoRMS/branches/coolemall/src/schedframe/scheduling/plugin/local/LocalSchedulingPlugin.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/scheduling/plugin/local/LocalSchedulingPlugin.java	(revision 515)
+++ DCWoRMS/branches/coolemall/src/schedframe/scheduling/plugin/local/LocalSchedulingPlugin.java	(revision 1396)
@@ -5,6 +5,6 @@
 import schedframe.scheduling.manager.resources.ResourceManager;
 import schedframe.scheduling.manager.tasks.JobRegistry;
+import schedframe.scheduling.plugin.ModuleList;
 import schedframe.scheduling.plugin.SchedulingPlugin;
-import schedframe.scheduling.plugin.grid.ModuleList;
 import schedframe.scheduling.queue.TaskQueueList;
 
Index: DCWoRMS/branches/coolemall/src/schedframe/scheduling/plugin/ModuleList.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/scheduling/plugin/ModuleList.java	(revision 1396)
+++ DCWoRMS/branches/coolemall/src/schedframe/scheduling/plugin/ModuleList.java	(revision 1396)
@@ -0,0 +1,12 @@
+package schedframe.scheduling.plugin;
+
+import java.util.List;
+
+public interface ModuleList extends List<Module>{
+	
+	public <T extends Module> List<T> get(ModuleType type);
+	
+	public Module getModule(ModuleType type);
+	
+	public boolean isModuleAvailable(ModuleType type);
+}
Index: DCWoRMS/branches/coolemall/src/schedframe/scheduling/plugin/ModuleListImpl.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/scheduling/plugin/ModuleListImpl.java	(revision 1396)
+++ DCWoRMS/branches/coolemall/src/schedframe/scheduling/plugin/ModuleListImpl.java	(revision 1396)
@@ -0,0 +1,58 @@
+package schedframe.scheduling.plugin;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+public class ModuleListImpl extends ArrayList<Module> implements ModuleList {
+
+	private static final long serialVersionUID = -3824600938144742457L;
+
+	public ModuleListImpl(){
+		super();
+	}
+	
+	public ModuleListImpl(int initialSize){
+		super(initialSize);
+	}
+	
+	public List<Module> get(ModuleType type){
+		List<Module> list = null;
+		
+		for(int i = 0; i < size(); i++){
+			Module m = get(i);
+			if(m.getType() == type){
+				list = (list == null ? new ArrayList<Module>(1) : list);
+				list.add(m);
+			}
+		}
+		return list;
+	}
+	
+	public Module getModule(ModuleType type){
+		
+		for(int i = 0; i < size(); i++){
+			Module m = get(i);
+			if(m.getType() == type){
+				return m;
+			}
+		}
+		return null;
+	}
+	
+	public boolean isModuleAvailable(ModuleType type){
+		for(int i = 0; i < size(); i++){
+			Module m = get(i);
+			if(m.getType() == type){
+				return true;
+			}
+		}
+		return false;
+	}
+	
+	
+}
Index: DCWoRMS/branches/coolemall/src/schedframe/scheduling/plugin/SchedulingPlugin.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/scheduling/plugin/SchedulingPlugin.java	(revision 516)
+++ DCWoRMS/branches/coolemall/src/schedframe/scheduling/plugin/SchedulingPlugin.java	(revision 1396)
@@ -7,5 +7,4 @@
 import schedframe.scheduling.manager.tasks.JobRegistry;
 import schedframe.scheduling.plan.SchedulingPlanInterface;
-import schedframe.scheduling.plugin.grid.ModuleList;
 import schedframe.scheduling.queue.TaskQueueList;
 
Index: DCWoRMS/branches/coolemall/src/schedframe/scheduling/policy/AbstractManagementSystem.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/scheduling/policy/AbstractManagementSystem.java	(revision 1377)
+++ DCWoRMS/branches/coolemall/src/schedframe/scheduling/policy/AbstractManagementSystem.java	(revision 1396)
@@ -23,7 +23,7 @@
 import schedframe.scheduling.plan.AllocationInterface;
 import schedframe.scheduling.plan.SchedulingPlanInterface;
+import schedframe.scheduling.plugin.ModuleList;
 import schedframe.scheduling.plugin.SchedulingPlugin;
 import schedframe.scheduling.plugin.estimation.ExecutionTimeEstimationPlugin;
-import schedframe.scheduling.plugin.grid.ModuleList;
 import schedframe.scheduling.manager.resources.ResourceAllocation;
 import schedframe.scheduling.queue.TaskQueue;
Index: DCWoRMS/branches/coolemall/src/schedframe/scheduling/policy/local/LocalManagementSystem.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/scheduling/policy/local/LocalManagementSystem.java	(revision 1392)
+++ DCWoRMS/branches/coolemall/src/schedframe/scheduling/policy/local/LocalManagementSystem.java	(revision 1396)
@@ -4,8 +4,6 @@
 import java.util.HashMap;
 import java.util.Iterator;
-import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
-import java.util.Set;
 
 import org.apache.commons.logging.Log;
@@ -33,5 +31,5 @@
 import schedframe.resources.units.StandardResourceUnitName;
 import schedframe.scheduling.ExecutionHistoryItem;
-import schedframe.scheduling.ResourceHistoryItem;
+import schedframe.scheduling.ResourceItem;
 import schedframe.scheduling.Scheduler;
 import schedframe.scheduling.TaskList;
@@ -44,7 +42,7 @@
 import schedframe.scheduling.plan.ScheduledTaskInterface;
 import schedframe.scheduling.plan.SchedulingPlanInterface;
+import schedframe.scheduling.plugin.ModuleListImpl;
 import schedframe.scheduling.plugin.SchedulingPlugin;
 import schedframe.scheduling.plugin.estimation.ExecutionTimeEstimationPlugin;
-import schedframe.scheduling.plugin.grid.ModuleListImpl;
 import schedframe.scheduling.policy.AbstractManagementSystem;
 import schedframe.scheduling.queue.TaskQueueList;
@@ -56,5 +54,5 @@
 import schedframe.scheduling.tasks.WorkloadUnit;
 import simulator.DCWormsConstants;
-import simulator.stats.GSSAccumulator;
+import simulator.stats.DCwormsAccumulator;
 import simulator.utils.DoubleMath;
 import dcworms.schedframe.scheduling.ExecTask;
@@ -382,5 +380,5 @@
 
 		saveExecutionHistory(exec, exec.getCompletionPercentage(), phaseDuration);
-		if(exec.getResourceConsumptionProfile().isLast()){
+		if(exec.getExecutionProfile().isLast()){
 			scheduler.sendInternal(phaseDuration, DCWormsTags.TASK_EXECUTION_FINISHED, execTask);;
 		} else {
@@ -451,5 +449,5 @@
 			ExecTask task = iter.next();
 			Executable exec = (Executable)task;
-			ExecutionHistoryItem execHistItem = exec.getExecHistory().getLast();
+			ExecutionHistoryItem execHistItem = exec.getExecutionHistory().getLast();
 			//System.out.println("--- upadteProgressX: " + Sim_system.sim_clock() );
 			//System.out.println("taskId: " + exec.getId() + "; completion percentage: " + exec.getCompletionPercentage() + "; timespan: " + timeSpan + "; estimatedDuration: " +  execHistItem.getCompletionPercentage());
@@ -496,5 +494,5 @@
 					execTask, choosenResources, exec.getCompletionPercentage())).intValue();
 
-			ExecutionHistoryItem execHistItem = exec.getExecHistory().getLast();
+			ExecutionHistoryItem execHistItem = exec.getExecutionHistory().getLast();
 			double lastTimeStamp = execHistItem.getTimeStamp().getMillis()/1000;
 			if(DoubleMath.subtract((lastTimeStamp + execHistItem.getEstimatedDuration()), (new DateTime().getMillis()/1000 + phaseDuration)) == 0.0){
@@ -508,5 +506,5 @@
 			saveExecutionHistory(exec, exec.getCompletionPercentage(), phaseDuration);
 			
-			if(exec.getResourceConsumptionProfile().isLast()){
+			if(exec.getExecutionProfile().isLast()){
 				ExecTaskFilter filter = new ExecTaskFilter(exec.getUniqueId(), DCWormsTags.TASK_EXECUTION_FINISHED);
 				scheduler.sim_cancel(filter, null);
@@ -542,5 +540,5 @@
 			saveExecutionHistory(exec, exec.getCompletionPercentage(), phaseDuration);
 			
-			if(exec.getResourceConsumptionProfile().isLast()){
+			if(exec.getExecutionProfile().isLast()){
 				scheduler.sendInternal(phaseDuration, DCWormsTags.TASK_EXECUTION_FINISHED, execTask);
 			} else {
@@ -555,5 +553,5 @@
 	public double calculateTotalLoad() {
 
-		GSSAccumulator loadAcc = new GSSAccumulator();
+		DCwormsAccumulator loadAcc = new DCwormsAccumulator();
 		try {
 			for(ComputingResource compRes: getResourceManager().getResourcesOfType(StandardResourceType.Node)){
@@ -718,7 +716,6 @@
 		boolean allocationStatus = getAllocationManager().allocateResources(choosenResources, exclusive);
 		if(allocationStatus){
-			ResourceHistoryItem resourceHistoryItem = new ResourceHistoryItem(choosenResources);
+			ResourceItem resourceHistoryItem = new ResourceItem(choosenResources);
 			exec.addAllocatedResources(resourceHistoryItem);
-			saveResourceHistory(exec);
 			return true;
 		}
@@ -726,28 +723,5 @@
 	}
 	
-	private void saveResourceHistory(Executable exec){
-		ProcessingElements pes = (ProcessingElements) exec.getAllocatedResources().getLast().getResourceUnits().get(StandardResourceUnitName.PE);
-		for (ComputingResource resource : pes) {
-
-			LinkedList<ComputingResource> toExamine = new LinkedList<ComputingResource>();
-			toExamine.push(resource);
-
-			while (!toExamine.isEmpty()) {
-				ComputingResource compResource = toExamine.pop();
-				List<ComputingResource> resources = compResource.getChildren();
-				if(resources.isEmpty()){
-					Set<String> visitedResources = exec.getAllocatedResources().getLast().getVisitedResources();
-					if(!visitedResources.contains(compResource.getFullName())){
-						exec.getAllocatedResources().getLast().trackResource(compResource.getFullName());
-					}
-				} else {
-					for (int i = 0; i < resources.size(); i++) {
-						ComputingResource resourceChild = resources.get(i);
-						toExamine.addLast(resourceChild);
-					}
-				}
-			}
-		}
-	}
+
 	
 }
Index: DCWoRMS/branches/coolemall/src/schedframe/scheduling/policy/global/GridBroker.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/scheduling/policy/global/GridBroker.java	(revision 1385)
+++ DCWoRMS/branches/coolemall/src/schedframe/scheduling/policy/global/GridBroker.java	(revision 1396)
@@ -12,7 +12,7 @@
 import schedframe.scheduling.Scheduler;
 import schedframe.scheduling.manager.resources.ManagedResources;
+import schedframe.scheduling.plugin.ModuleListImpl;
 import schedframe.scheduling.plugin.SchedulingPlugin;
 import schedframe.scheduling.plugin.estimation.ExecutionTimeEstimationPlugin;
-import schedframe.scheduling.plugin.grid.ModuleListImpl;
 import schedframe.scheduling.queue.TaskQueueList;
 
Index: DCWoRMS/branches/coolemall/src/schedframe/scheduling/GridResourceDiscovery.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/scheduling/GridResourceDiscovery.java	(revision 493)
+++ DCWoRMS/branches/coolemall/src/schedframe/scheduling/GridResourceDiscovery.java	(revision 1396)
@@ -20,5 +20,5 @@
 import schedframe.resources.units.ResourceUnitName;
 import schedframe.scheduling.manager.resources.ResourceManager;
-import schedframe.scheduling.plugin.grid.ModuleType;
+import schedframe.scheduling.plugin.ModuleType;
 import schedframe.scheduling.plugin.grid.ResourceDiscovery;
 import schedframe.scheduling.tasks.requirements.AbstractResourceRequirements;
Index: DCWoRMS/branches/coolemall/src/schedframe/scheduling/manager/tasks/JobRegistryImpl.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/scheduling/manager/tasks/JobRegistryImpl.java	(revision 1362)
+++ DCWoRMS/branches/coolemall/src/schedframe/scheduling/manager/tasks/JobRegistryImpl.java	(revision 1396)
@@ -53,5 +53,5 @@
 			for (ExecTask task: executables) {
 				if (task.getStatus() == status) {
-					Set<String> visitedResource = task.getAllocatedResources().getLast().getVisitedResources();
+					Set<String> visitedResource = task.getAllocatedResources().getLast().getResourceNames();
 					for(String res: visitedResource){
 						if(res.contains(context)){
Index: DCWoRMS/branches/coolemall/src/schedframe/scheduling/manager/resources/LocalResourceManager.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/scheduling/manager/resources/LocalResourceManager.java	(revision 1392)
+++ DCWoRMS/branches/coolemall/src/schedframe/scheduling/manager/resources/LocalResourceManager.java	(revision 1396)
@@ -306,5 +306,5 @@
 			for(ResourceUnitName resUnitName: resources.keySet()){
 				ResourceUnit resUnit = resources.get(resUnitName);
-				if(resUnit.getName().getName().equals(StandardResourceUnitName.PE.getName())){
+				if(resUnit.getName().getLabel().equals(StandardResourceUnitName.PE.getLabel())){
 					ProcessingElements pe = (ProcessingElements)resUnit;
 					for(ComputingResource cr: pe){
Index: DCWoRMS/branches/coolemall/src/schedframe/scheduling/tasks/Job.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/scheduling/tasks/Job.java	(revision 1374)
+++ DCWoRMS/branches/coolemall/src/schedframe/scheduling/tasks/Job.java	(revision 1396)
@@ -1,9 +1,3 @@
 package schedframe.scheduling.tasks;
-
-
-import org.qcg.broker.schemas.resreqs.ParentType;
-import org.qcg.broker.schemas.resreqs.ResourceRequirements;
-import org.qcg.broker.schemas.resreqs.Workflow;
-import org.qcg.broker.schemas.resreqs.types.TaskStatesName;
 
 
@@ -15,7 +9,7 @@
 
 import org.joda.time.DateTime;
+import org.qcg.broker.schemas.resreqs.ResourceRequirements;
 
 import qcg.shared.constants.BrokerConstants;
-
 import schedframe.scheduling.WorkloadUnitHandler;
 import schedframe.scheduling.manager.tasks.JobRegistryImpl;
@@ -210,83 +204,3 @@
 	}
 	
-	private List<Task> getReadyTasks() throws NoSuchFieldException{
-		
-		List<Task> availableTasks = new ArrayList<Task>();
-		int size = tasks.size();
-		
-		for(int i = 0; i < size; i++){
-			int parCnt;
-			int previousTaskSucceedCnt = 0;
-			Task task = tasks.get(i);
-			if(task.getStatus() != (int)BrokerConstants.TASK_STATUS_UNSUBMITTED)
-				continue;
-			//the following procedure supports only one nested structure
-			Workflow w = task.getDescription().getWorkflow();
-			if (w == null){
-				availableTasks.add(task);
-				continue;
-			}
-			if(w.getAnd() != null) {
-				parCnt = w.getAnd().getParentOpTypeItemCount();
-				if(parCnt == 0){
-					availableTasks.add(task);
-				}else
-				{
-					for(int j = 0; j < parCnt; j++){
-						ParentType par = w.getAnd().getParentOpTypeItem(j).getParent();
-						if(par.getTriggerState().compareTo(TaskStatesName.FINISHED) == 0){
-							if(!getTask(par.getContent()).isFinished()){
-								break;
-							}
-						}
-						previousTaskSucceedCnt++;
-					}
-
-					if(previousTaskSucceedCnt == parCnt)
-						availableTasks.add(task);
-				}
-			} 
-			else if(w.getOr() != null) {
-				parCnt = w.getOr().getParentOpTypeItemCount();
-				if(parCnt == 0){
-					availableTasks.add(task);
-				}
-				else{
-					for(int j = 0; j < parCnt; j++){
-						ParentType par = w.getOr().getParentOpTypeItem(j).getParent();
-						if(par.getTriggerState().compareTo(TaskStatesName.FINISHED) == 0){
-							if(!getTask(par.getContent()).isFinished()){
-								continue;
-							}
-						}
-						previousTaskSucceedCnt++;
-					}
-
-					if(previousTaskSucceedCnt > 0)
-						availableTasks.add(task);
-				}
-			}
-			else {
-				parCnt = w.getParentCount();
-				if(parCnt == 0){
-					availableTasks.add(task);
-				}else{
-					for(int j = 0; j < parCnt; j++){
-						ParentType par = w.getParent(j);
-						if(par.getTriggerState().compareTo(TaskStatesName.FINISHED) == 0){
-							if(!getTask(par.getContent()).isFinished()){
-								continue;
-							}
-						}
-						previousTaskSucceedCnt++;
-					}
-
-					if(previousTaskSucceedCnt == parCnt)
-						availableTasks.add(task);
-				}
-			}
-		}		
-		return availableTasks;
-	}
-	
 }
Index: DCWoRMS/branches/coolemall/src/schedframe/scheduling/ResourceItem.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/scheduling/ResourceItem.java	(revision 1396)
+++ DCWoRMS/branches/coolemall/src/schedframe/scheduling/ResourceItem.java	(revision 1396)
@@ -0,0 +1,57 @@
+package schedframe.scheduling;
+
+import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import schedframe.resources.computing.ComputingResource;
+import schedframe.resources.units.ProcessingElements;
+import schedframe.resources.units.ResourceUnit;
+import schedframe.resources.units.ResourceUnitName;
+import schedframe.resources.units.StandardResourceUnitName;
+
+public class ResourceItem {
+
+	protected Map<ResourceUnitName, ResourceUnit> usedResources;
+	protected Set<String> visitedResources;
+
+	public ResourceItem(Map<ResourceUnitName, ResourceUnit> usedResources){
+		this.usedResources = usedResources;
+		this.visitedResources = new HashSet<String>();
+		saveResourceNames();
+	}
+	
+	public Map<ResourceUnitName, ResourceUnit> getResourceUnits(){
+		return usedResources;
+	}
+	
+	public Set<String> getResourceNames(){
+		return visitedResources;
+	}
+	
+	private void saveResourceNames(){
+		ProcessingElements pes = (ProcessingElements) usedResources.get(StandardResourceUnitName.PE);
+		for (ComputingResource resource : pes) {
+
+			LinkedList<ComputingResource> toExamine = new LinkedList<ComputingResource>();
+			toExamine.push(resource);
+
+			while (!toExamine.isEmpty()) {
+				ComputingResource compResource = toExamine.pop();
+				List<ComputingResource> resources = compResource.getChildren();
+				if(resources.isEmpty()){
+					if(!visitedResources.contains(compResource.getFullName())){
+						visitedResources.add(compResource.getFullName());
+					}
+				} else {
+					for (int i = 0; i < resources.size(); i++) {
+						ComputingResource resourceChild = resources.get(i);
+						toExamine.addLast(resourceChild);
+					}
+				}
+			}
+		}
+	}
+}
Index: DCWoRMS/branches/coolemall/src/schedframe/scheduling/ResourceHistoryItem.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/scheduling/ResourceHistoryItem.java	(revision 1362)
+++ 	(revision )
@@ -1,32 +1,0 @@
-package schedframe.scheduling;
-
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-import schedframe.resources.units.ResourceUnit;
-import schedframe.resources.units.ResourceUnitName;
-
-public class ResourceHistoryItem {
-
-	protected Map<ResourceUnitName, ResourceUnit> usedResources;
-	protected Set<String> visitedResources;
-
-	public ResourceHistoryItem(Map<ResourceUnitName, ResourceUnit> usedResources){
-		this.usedResources = usedResources;
-		this.visitedResources = new HashSet<String>();
-	}
-	
-	public Map<ResourceUnitName, ResourceUnit> getResourceUnits(){
-		return usedResources;
-	}
-	
-	public void trackResource(String resName){
-		visitedResources.add(resName);
-	}
-	
-	public Set<String> getVisitedResources(){
-		return visitedResources;
-	}
-	
-}
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/ResourceTypeFactory.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/ResourceTypeFactory.java	(revision 1207)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/ResourceTypeFactory.java	(revision 1396)
@@ -60,5 +60,5 @@
 			return StandardResourceType.LS;
 		
-		return new UserResourceType(typeName);
+		return new CustomResourceType(typeName);
 	}
 }
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/devices/description/PhysicalResourceDescription.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/devices/description/PhysicalResourceDescription.java	(revision 1317)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/devices/description/PhysicalResourceDescription.java	(revision 1396)
@@ -10,8 +10,9 @@
 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.airthroughput.AirflowStateNameFactory;
+import schedframe.resources.computing.profiles.energy.airthroughput.AirflowProfile;
+import schedframe.resources.computing.profiles.energy.airthroughput.AirflowState;
+import schedframe.resources.computing.profiles.energy.airthroughput.plugin.AirflowEstimationPlugin;
+import schedframe.resources.computing.profiles.energy.airthroughput.plugin.DefaultAirflowEstimationPlugin;
 import schedframe.resources.computing.profiles.energy.power.PState;
 import schedframe.resources.computing.profiles.energy.power.PowerProfile;
@@ -36,5 +37,5 @@
 
 	protected PowerProfile powerProfile;
-	protected AirThroughputProfile airThroughputProfile;
+	protected AirflowProfile airflowProfile;
 	protected ThermalProfile thermalProfile;
 	protected LoadProfile loadProfile;
@@ -58,5 +59,5 @@
 		if (profile != null) {
 			initPowerProfile(profile.getPowerProfile());
-			initAirThroughputProfile(profile.getAirThroughputProfile());
+			initAirflowProfile(profile.getAirThroughputProfile());
 			initThermalProfile(profile.getThermalProfile());
 			initLoadProfile(profile.getLoadProfile());
@@ -151,35 +152,35 @@
 	}
 
-	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);			
+	protected void initAirflowProfile(schemas.AirThroughputProfile airflowProfile) {
+		if (airflowProfile != null) {
+			
+			AirflowEstimationPlugin airflowEstimationPlugin = null;
+			List<AirflowState> airflowStates = null;
+			if(airflowProfile.getAirThroughputEstimationPlugin() != null){
+				String airflowEstimationPluginName = airflowProfile.getAirThroughputEstimationPlugin().getName();
+				if(airflowEstimationPluginName != null) {
+					airflowEstimationPlugin = (AirflowEstimationPlugin) InstanceFactory.createInstance(
+							airflowEstimationPluginName, AirflowEstimationPlugin.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()
+					airflowEstimationPlugin = new DefaultAirflowEstimationPlugin();
+				}
+				Parameters params = extractParameters(airflowProfile.getAirThroughputEstimationPlugin().getParameter());
+				airflowEstimationPlugin.init(params);
+			}
+			if(airflowProfile.getAirThroughputStates() != null){
+				airflowStates = new ArrayList<AirflowState>();
+				int airflowStateCount = airflowProfile.getAirThroughputStates().getAirThroughputStateCount();
+				for (int i = 0; i < airflowStateCount; i++) {
+					schemas.AirThroughputState ats = airflowProfile.getAirThroughputStates().getAirThroughputState(i);
+					AirflowState airflowState = new AirflowState(AirflowStateNameFactory.createAirflowStateName(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);
+					airflowState.init(params);
+					airflowStates.add(airflowState);
+				}
+			}
+			this.airflowProfile = new AirflowProfile(airflowEstimationPlugin, airflowStates);
+			Parameters params = extractParameters(airflowProfile.getParameter());
+			this.airflowProfile.init(params);
 		}
 	}
@@ -281,6 +282,6 @@
 	}
 
-	public AirThroughputProfile getAirThroughputProfile() {
-		return airThroughputProfile;
+	public AirflowProfile getAirflowProfile() {
+		return airflowProfile;
 	}
 
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/devices/DeviceAirflowInterface.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/devices/DeviceAirflowInterface.java	(revision 1396)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/devices/DeviceAirflowInterface.java	(revision 1396)
@@ -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.AirflowProfile;
+import schedframe.resources.computing.profiles.energy.airthroughput.AirflowState;
+import schedframe.resources.computing.profiles.energy.airthroughput.AirflowStateName;
+import schedframe.resources.computing.profiles.energy.airthroughput.StandardAirflowStateName;
+import schedframe.resources.computing.profiles.energy.airthroughput.ui.AirflowInterface;
+
+public class DeviceAirflowInterface implements AirflowInterface{
+
+	protected AirflowStateName currentAirflowState;
+	protected AirflowProfile airflowProfile;
+	protected PhysicalResource resource;
+	
+	public DeviceAirflowInterface(PhysicalResource resource, AirflowProfile airflowProfile){
+		this.resource = resource;
+		this.airflowProfile = airflowProfile;
+		this.currentAirflowState = StandardAirflowStateName.ON;
+	}
+	
+	public AirflowStateName getAirflowState() {
+		return currentAirflowState;
+	}
+
+	public boolean setAirflowState(AirflowStateName state) {
+		if(supportAirflowState(state)){
+			currentAirflowState = 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 supportAirflowState(AirflowStateName state) {
+		for(AirflowState airflowState: airflowProfile.getAirflowStates()){
+			if(airflowState.getName().getLabel().equals(state.getLabel())){
+				return true;
+			}
+		}
+		return false;
+	}
+
+	public List<AirflowState> getSupportedAirflowStates(){
+		List<AirflowState> airflowStates = new ArrayList<AirflowState>();
+		for(AirflowState airFlowState: airflowProfile.getAirflowStates()){
+			airflowStates.add(airFlowState);
+		}
+		return airflowStates;
+	}
+
+	public double getAirflow(AirflowStateName state) throws NoSuchFieldException {
+		double airflow = 0;
+		if(supportAirflowState(state)){
+			for(AirflowState airflowState: airflowProfile.getAirflowStates()){
+				if(airflowState.getName().getLabel().equals(state.getLabel())){
+					airflow = airflowState.getValue();
+					break;
+				}
+			}
+		}
+		return airflow;
+	}
+
+	public double getPowerConsumption(AirflowStateName state) throws NoSuchFieldException {
+		double powerConsumption = 0;
+		if(supportAirflowState(state)){
+			for(AirflowState airflowState: airflowProfile.getAirflowStates()){
+				if(airflowState.getName().getLabel().equals(state.getLabel())){
+					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(currentAirflowState));
+			} catch (NoSuchFieldException e) {
+			}
+		}
+		return airflow;
+	}
+	
+	public List<AirflowValue> getAirflowHistory(){
+		return airflowProfile.getAirflowHistory();
+	}
+	
+	public Parameters getParameters() {
+		return airflowProfile.getParameters();
+	}
+
+}
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/devices/PhysicalResource.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/devices/PhysicalResource.java	(revision 1287)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/devices/PhysicalResource.java	(revision 1396)
@@ -12,5 +12,5 @@
 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.airthroughput.ui.AirflowInterface;
 import schedframe.resources.computing.profiles.energy.power.ui.PowerInterface;
 import schedframe.resources.computing.profiles.energy.thermal.ui.ThermalInterface;
@@ -70,9 +70,9 @@
 	}
 	
-	public AirThroughputInterface getAirThroughputInterface(){
+	public AirflowInterface getAirflowInterface(){
 		Extension extension = getExtension(ExtensionType.ENERGY_EXTENSION);
 		if(extension != null){
 			EnergyExtension ee = (EnergyExtension)extension;
-			return ee.getAirThroughputInterface();
+			return ee.getAirflowInterface();
 		}
 		return null;
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/devices/coolemall/FanAirflowInterface.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/devices/coolemall/FanAirflowInterface.java	(revision 1396)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/devices/coolemall/FanAirflowInterface.java	(revision 1396)
@@ -0,0 +1,22 @@
+package schedframe.resources.devices.coolemall;
+
+import schedframe.resources.computing.profiles.energy.airthroughput.AirflowProfile;
+import schedframe.resources.computing.profiles.energy.airthroughput.CustomAirflowStateName;
+import schedframe.resources.devices.PhysicalResource;
+import schedframe.resources.devices.DeviceAirflowInterface;
+
+public class FanAirflowInterface extends DeviceAirflowInterface {
+
+	public FanAirflowInterface(PhysicalResource resource, AirflowProfile airflowProfile) {
+		super(resource, airflowProfile);
+		this.currentAirflowState = new CustomAirflowStateName("2");
+	}
+	
+	public boolean turnOn(){
+		return setAirflowState(new CustomAirflowStateName("2"));
+	}
+
+	public boolean turnOff(){
+		return setAirflowState(new CustomAirflowStateName("1"));
+	}
+}
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/devices/coolemall/FanAirThroughputInterface.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/devices/coolemall/FanAirThroughputInterface.java	(revision 1317)
+++ 	(revision )
@@ -1,22 +1,0 @@
-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.DeviceAirThroughputInterface;
-
-public class FanAirThroughputInterface extends DeviceAirThroughputInterface {
-
-	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/Device.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/devices/Device.java	(revision 1207)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/devices/Device.java	(revision 1396)
@@ -25,5 +25,5 @@
 		this.extensionList = new ExtensionListImpl(1);
 		initCharacteristics(devDesc);
-		accept(new EnergyExtension.Builder().resource(this).powerProfile(devDesc.getPowerProfile()).airFlowProfile(devDesc.getAirThroughputProfile()).thermalProfile(devDesc.getThermalProfile()).build());	
+		accept(new EnergyExtension.Builder().resource(this).powerProfile(devDesc.getPowerProfile()).airflowProfile(devDesc.getAirflowProfile()).thermalProfile(devDesc.getThermalProfile()).build());	
 	}
 
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/devices/DeviceAirThroughputInterface.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/devices/DeviceAirThroughputInterface.java	(revision 1380)
+++ 	(revision )
@@ -1,111 +1,0 @@
-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 DeviceAirThroughputInterface implements AirThroughputInterface{
-
-	protected AirThroughputStateName currentAirThroughputState;
-	protected AirThroughputProfile airThroughputProfile;
-	protected PhysicalResource resource;
-	
-	public DeviceAirThroughputInterface(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(){
-		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/DeviceEnergyExtension.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/devices/DeviceEnergyExtension.java	(revision 1275)
+++ 	(revision )
@@ -1,210 +1,0 @@
-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.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.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);
-				
-				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/units/StandardResourceUnitName.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/units/StandardResourceUnitName.java	(revision 477)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/units/StandardResourceUnitName.java	(revision 1396)
@@ -46,5 +46,5 @@
     }
 
-    public String getName(){
+    public String getLabel(){
     	return this.name;
     }
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/units/ResourceUnitFactory.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/units/ResourceUnitFactory.java	(revision 1384)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/units/ResourceUnitFactory.java	(revision 1396)
@@ -18,19 +18,19 @@
 	
 	public static ResourceUnit createUnit(String unitName, String resId, int totalAmount, int usedAmount){
-		if(unitName.equalsIgnoreCase(StandardResourceUnitName.CPU.getName()))
+		if(unitName.equalsIgnoreCase(StandardResourceUnitName.CPU.getLabel()))
 			return new PEUnit(resId, totalAmount, usedAmount);
-		if(unitName.equalsIgnoreCase(StandardResourceUnitName.PE.getName()))
+		if(unitName.equalsIgnoreCase(StandardResourceUnitName.PE.getLabel()))
 			return new PEUnit(resId, totalAmount, usedAmount);
-		else if(unitName.equalsIgnoreCase(StandardResourceUnitName.MEMORY.getName()))
+		else if(unitName.equalsIgnoreCase(StandardResourceUnitName.MEMORY.getLabel()))
 			 return new Memory(resId, totalAmount, usedAmount);
-		else if(unitName.equalsIgnoreCase(StandardResourceUnitName.STORAGE.getName()))
+		else if(unitName.equalsIgnoreCase(StandardResourceUnitName.STORAGE.getLabel()))
 			 return new Storage(resId, totalAmount, usedAmount);
-		else if(unitName.equalsIgnoreCase(StandardResourceUnitName.GPU.getName()))
+		else if(unitName.equalsIgnoreCase(StandardResourceUnitName.GPU.getLabel()))
 			 return new GPU(resId, totalAmount, usedAmount);
-		else if (unitName.equalsIgnoreCase(StandardResourceUnitName.CPUSPEED.getName()))
+		else if (unitName.equalsIgnoreCase(StandardResourceUnitName.CPUSPEED.getLabel()))
 			return new CpuSpeed(resId, totalAmount, usedAmount); 
-		else if (unitName.equalsIgnoreCase(StandardResourceUnitName.COST.getName()))
+		else if (unitName.equalsIgnoreCase(StandardResourceUnitName.COST.getLabel()))
 			return new Cost(resId, totalAmount);
-		else if (unitName.equalsIgnoreCase(StandardResourceUnitName.APPLICATION.getName()))
+		else if (unitName.equalsIgnoreCase(StandardResourceUnitName.APPLICATION.getLabel()))
 			return new Applications(resId); 
 		else
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/units/ResourceUnitNameFactory.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/units/ResourceUnitNameFactory.java	(revision 477)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/units/ResourceUnitNameFactory.java	(revision 1396)
@@ -6,26 +6,26 @@
 	public static ResourceUnitName createResourceUnitName(String unitName){
 
-		if(unitName.equals(StandardResourceUnitName.MEMORY.getName()))
+		if(unitName.equals(StandardResourceUnitName.MEMORY.getLabel()))
 			return StandardResourceUnitName.MEMORY;
 		
-		else if (unitName.equals(StandardResourceUnitName.STORAGE.getName()))
+		else if (unitName.equals(StandardResourceUnitName.STORAGE.getLabel()))
 			return StandardResourceUnitName.STORAGE;
 		
-		else if (unitName.equals(StandardResourceUnitName.PE.getName()))
+		else if (unitName.equals(StandardResourceUnitName.PE.getLabel()))
 			return StandardResourceUnitName.PE;
 		
-		else if (unitName.equals(StandardResourceUnitName.CPUSPEED.getName()))
+		else if (unitName.equals(StandardResourceUnitName.CPUSPEED.getLabel()))
 			return StandardResourceUnitName.CPUSPEED;
 		
-		else if (unitName.equals(StandardResourceUnitName.GPU.getName()))
+		else if (unitName.equals(StandardResourceUnitName.GPU.getLabel()))
 			return StandardResourceUnitName.GPU;
 		
-		else if (unitName.equals(StandardResourceUnitName.APPLICATION.getName()))
+		else if (unitName.equals(StandardResourceUnitName.APPLICATION.getLabel()))
 			return StandardResourceUnitName.APPLICATION;
 		
-		else if (unitName.equals(StandardResourceUnitName.COST.getName()))
+		else if (unitName.equals(StandardResourceUnitName.COST.getLabel()))
 			return StandardResourceUnitName.COST;
 
-		else return new UserResourceUnitName(unitName);
+		else return new CustomResourceUnitName(unitName);
 	}
 }
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/units/CustomResourceUnitName.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/units/CustomResourceUnitName.java	(revision 1396)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/units/CustomResourceUnitName.java	(revision 1396)
@@ -0,0 +1,15 @@
+package schedframe.resources.units;
+
+public class CustomResourceUnitName implements ResourceUnitName {
+
+	protected String name;
+
+	public CustomResourceUnitName(String name) {
+		this.name = name;
+	}
+
+	public String getLabel() {
+		return name;
+	}
+
+}
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/units/ResourceUnitName.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/units/ResourceUnitName.java	(revision 477)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/units/ResourceUnitName.java	(revision 1396)
@@ -3,5 +3,5 @@
 public interface ResourceUnitName {
 	
-	public String getName();
+	public String getLabel();
 
 }
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/units/UserResourceUnitName.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/units/UserResourceUnitName.java	(revision 477)
+++ 	(revision )
@@ -1,15 +1,0 @@
-package schedframe.resources.units;
-
-public class UserResourceUnitName implements ResourceUnitName {
-
-	protected String name;
-
-	public UserResourceUnitName(String name) {
-		this.name = name;
-	}
-
-	public String getName() {
-		return name;
-	}
-
-}
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/CustomResourceType.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/CustomResourceType.java	(revision 1396)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/CustomResourceType.java	(revision 1396)
@@ -0,0 +1,16 @@
+package schedframe.resources;
+
+
+public class CustomResourceType implements ResourceType {
+
+	protected String name;
+
+	public CustomResourceType(String name) {
+		this.name = name;
+	}
+
+	public String getName() {
+		return name;
+	}
+	
+}
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/AirflowStateNameFactory.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/AirflowStateNameFactory.java	(revision 1396)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/AirflowStateNameFactory.java	(revision 1396)
@@ -0,0 +1,16 @@
+package schedframe.resources.computing.profiles.energy.airthroughput;
+
+
+public class AirflowStateNameFactory {
+
+	public static AirflowStateName createAirflowStateName (String airflowStateName){
+		
+		if(airflowStateName.equals(StandardAirflowStateName.ON.getLabel()))
+			return StandardAirflowStateName.ON;
+		
+		else if(airflowStateName.equals(StandardAirflowStateName.OFF.getLabel()))
+			return StandardAirflowStateName.OFF;
+
+		else return new CustomAirflowStateName(airflowStateName);
+	}
+}
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/ui/ComputingResourceAirflowInterface.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/ui/ComputingResourceAirflowInterface.java	(revision 1396)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/ui/ComputingResourceAirflowInterface.java	(revision 1396)
@@ -0,0 +1,112 @@
+package schedframe.resources.computing.profiles.energy.airthroughput.ui;
+
+import java.util.ArrayList;
+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.AirflowProfile;
+import schedframe.resources.computing.profiles.energy.airthroughput.AirflowState;
+import schedframe.resources.computing.profiles.energy.airthroughput.AirflowStateName;
+import schedframe.resources.computing.profiles.energy.airthroughput.StandardAirflowStateName;
+
+public class ComputingResourceAirflowInterface implements AirflowInterface{
+
+	protected AirflowStateName currentAirflowState;
+	protected AirflowProfile airflowProfile;
+	protected ComputingResource resource;
+	
+	public ComputingResourceAirflowInterface(ComputingResource resource, AirflowProfile airflowProfile){
+		this.resource = resource;
+		this.airflowProfile = airflowProfile;
+		this.currentAirflowState = StandardAirflowStateName.ON;
+	}
+	
+	public AirflowStateName getAirflowState() {
+		return currentAirflowState;
+	}
+
+	public boolean setAirflowState(AirflowStateName state) {
+		if(supportAirflowState(state)){
+			currentAirflowState = 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 supportAirflowState(AirflowStateName state) {
+		for(AirflowState airflowState: airflowProfile.getAirflowStates()){
+			if(airflowState.getName().equals(state.getLabel())){
+				return true;
+			}
+		}
+		return false;
+	}
+
+	public List<AirflowState> getSupportedAirflowStates() {
+		List<AirflowState> airflowStates = new ArrayList<AirflowState>();
+		for(AirflowState airflowState: airflowProfile.getAirflowStates()){
+			airflowStates.add(airflowState);
+		}
+		return airflowStates;
+	}
+
+	public double getAirflow(AirflowStateName state) throws NoSuchFieldException {
+		double airflow = 0;
+		if(supportAirflowState(state)){
+			for(AirflowState airflowState: airflowProfile.getAirflowStates()){
+				if(airflowState.getName().equals(state.getLabel())){
+					airflow = airflowState.getValue();
+					break;
+				}
+			}
+		}
+		return airflow;
+	}
+
+	public double getPowerConsumption(AirflowStateName state) throws NoSuchFieldException {
+		double powerConsumption = 0;
+		if(supportAirflowState(state)){
+			for(AirflowState airflowState: airflowProfile.getAirflowStates()){
+				if(airflowState.getName().equals(state.getLabel())){
+					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(currentAirflowState));
+			} catch (NoSuchFieldException e) {
+			}
+		}
+		return airflow;
+	}
+	
+	public List<AirflowValue> getAirflowHistory(){
+		return airflowProfile.getAirflowHistory();
+	}
+	
+	
+	public Parameters getParameters() {
+		return airflowProfile.getParameters();
+	}
+
+}
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/ui/AirflowInterface.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/ui/AirflowInterface.java	(revision 1396)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/ui/AirflowInterface.java	(revision 1396)
@@ -0,0 +1,31 @@
+package schedframe.resources.computing.profiles.energy.airthroughput.ui;
+
+import java.util.List;
+
+import schedframe.Parameters;
+import schedframe.resources.computing.profiles.energy.airthroughput.AirflowValue;
+import schedframe.resources.computing.profiles.energy.airthroughput.AirflowState;
+import schedframe.resources.computing.profiles.energy.airthroughput.AirflowStateName;
+
+public interface AirflowInterface {
+	
+	public AirflowStateName getAirflowState();
+	
+	public boolean setAirflowState(AirflowStateName airflowState);
+	
+	public boolean supportAirflowState(AirflowStateName powerState);
+	
+	public List<AirflowState> getSupportedAirflowStates();
+	
+	public double getAirflow(AirflowStateName state) throws NoSuchFieldException;
+	
+	public double getPowerConsumption(AirflowStateName 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 1380)
+++ 	(revision )
@@ -1,112 +1,0 @@
-package schedframe.resources.computing.profiles.energy.airthroughput.ui;
-
-import java.util.ArrayList;
-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;
-import schedframe.resources.computing.profiles.energy.airthroughput.AirThroughputStateName;
-import schedframe.resources.computing.profiles.energy.airthroughput.StandardAirThroughputStateName;
-
-public class ComputingResourceAirThroughputInterface implements AirThroughputInterface{
-
-	protected AirThroughputStateName currentAirThroughputState;
-	protected AirThroughputProfile airThroughputProfile;
-	protected ComputingResource resource;
-	
-	public ComputingResourceAirThroughputInterface(ComputingResource 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() {
-		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/computing/profiles/energy/airthroughput/ui/AirThroughputInterface.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/ui/AirThroughputInterface.java	(revision 1380)
+++ 	(revision )
@@ -1,31 +1,0 @@
-package schedframe.resources.computing.profiles.energy.airthroughput.ui;
-
-import java.util.List;
-
-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;
-
-public interface AirThroughputInterface {
-	
-	public AirThroughputStateName getAirThroughputState();
-	
-	public boolean setAirThroughputState(AirThroughputStateName airThroughputState);
-	
-	public boolean supportAirThroughputState(AirThroughputStateName powerState);
-	
-	public List<AirThroughputState> getSupportedAirThroughputStates();
-	
-	public double getAirFlow(AirThroughputStateName state) throws NoSuchFieldException;
-	
-	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/plugin/DefaultAirflowEstimationPlugin.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/plugin/DefaultAirflowEstimationPlugin.java	(revision 1396)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/plugin/DefaultAirflowEstimationPlugin.java	(revision 1396)
@@ -0,0 +1,34 @@
+package schedframe.resources.computing.profiles.energy.airthroughput.plugin;
+
+import schedframe.Parameters;
+import schedframe.PluginConfiguration;
+import schedframe.events.Event;
+import schedframe.resources.computing.ComputingResource;
+import schedframe.scheduling.manager.tasks.JobRegistry;
+
+public class DefaultAirflowEstimationPlugin implements AirflowEstimationPlugin {
+
+	@Override
+	public String getName() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public void init(Parameters properties) {
+		// TODO Auto-generated method stub
+
+	}
+
+	@Override
+	public PluginConfiguration getConfiguration() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public double estimateAirflow(Event event, JobRegistry jobRegistry, ComputingResource resource) {
+		throw new RuntimeException("This interface is depracated. For air throughput estimation please use the estimateAirThroughput method form EnergyEstimationPlugin interface.");
+	}
+
+}
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/plugin/AirflowEstimationPlugin.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/plugin/AirflowEstimationPlugin.java	(revision 1396)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/plugin/AirflowEstimationPlugin.java	(revision 1396)
@@ -0,0 +1,11 @@
+package schedframe.resources.computing.profiles.energy.airthroughput.plugin;
+
+import schedframe.Plugin;
+import schedframe.events.Event;
+import schedframe.resources.computing.ComputingResource;
+import schedframe.scheduling.manager.tasks.JobRegistry;
+
+public interface AirflowEstimationPlugin extends Plugin {
+	
+	public double estimateAirflow(Event event, JobRegistry jobRegistry, ComputingResource resource);
+}
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/plugin/DefaultAirThroughputEstimationPlugin.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/plugin/DefaultAirThroughputEstimationPlugin.java	(revision 770)
+++ 	(revision )
@@ -1,34 +1,0 @@
-package schedframe.resources.computing.profiles.energy.airthroughput.plugin;
-
-import schedframe.Parameters;
-import schedframe.PluginConfiguration;
-import schedframe.events.Event;
-import schedframe.resources.computing.ComputingResource;
-import schedframe.scheduling.manager.tasks.JobRegistry;
-
-public class DefaultAirThroughputEstimationPlugin implements AirThroughputEstimationPlugin {
-
-	@Override
-	public String getName() {
-		// TODO Auto-generated method stub
-		return null;
-	}
-
-	@Override
-	public void init(Parameters properties) {
-		// TODO Auto-generated method stub
-
-	}
-
-	@Override
-	public PluginConfiguration getConfiguration() {
-		// TODO Auto-generated method stub
-		return null;
-	}
-
-	@Override
-	public double estimateAirThroughput(Event event, JobRegistry jobRegistry, ComputingResource resource) {
-		throw new RuntimeException("This interface is depracated. For air throughput estimation please use the estimateAirThroughput method form EnergyEstimationPlugin interface.");
-	}
-
-}
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/plugin/AirThroughputEstimationPlugin.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/plugin/AirThroughputEstimationPlugin.java	(revision 748)
+++ 	(revision )
@@ -1,11 +1,0 @@
-package schedframe.resources.computing.profiles.energy.airthroughput.plugin;
-
-import schedframe.Plugin;
-import schedframe.events.Event;
-import schedframe.resources.computing.ComputingResource;
-import schedframe.scheduling.manager.tasks.JobRegistry;
-
-public interface AirThroughputEstimationPlugin extends Plugin {
-	
-	public double estimateAirThroughput(Event event, JobRegistry jobRegistry, ComputingResource resource);
-}
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/AirFlowValue.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/AirFlowValue.java	(revision 495)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/AirFlowValue.java	(revision 1396)
@@ -3,7 +3,7 @@
 import schedframe.resources.computing.profiles.energy.MeasurementHistory;
 
-public class AirFlowValue extends MeasurementHistory{
+public class AirflowValue extends MeasurementHistory{
 
-	public AirFlowValue(long timestamp, double value){
+	public AirflowValue(long timestamp, double value){
 		super(timestamp, value);
 	}
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/AirflowValue.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/AirflowValue.java	(revision 1396)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/AirflowValue.java	(revision 1396)
@@ -0,0 +1,11 @@
+package schedframe.resources.computing.profiles.energy.airthroughput;
+
+import schedframe.resources.computing.profiles.energy.MeasurementHistory;
+
+public class AirflowValue extends MeasurementHistory{
+
+	public AirflowValue(long timestamp, double value){
+		super(timestamp, value);
+	}
+	
+}
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/CustomAirflowStateName.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/CustomAirflowStateName.java	(revision 1396)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/CustomAirflowStateName.java	(revision 1396)
@@ -0,0 +1,17 @@
+package schedframe.resources.computing.profiles.energy.airthroughput;
+
+
+public class CustomAirflowStateName implements AirflowStateName{
+
+	protected String name;
+
+	public CustomAirflowStateName(String name) {
+		this.name = name;
+	}
+
+	public String getLabel() {
+		return name;
+	}
+
+
+}
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/AirflowProfile.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/AirflowProfile.java	(revision 1396)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/AirflowProfile.java	(revision 1396)
@@ -0,0 +1,65 @@
+package schedframe.resources.computing.profiles.energy.airthroughput;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.joda.time.DateTimeUtils;
+
+import schedframe.Parameters;
+import schedframe.resources.computing.profiles.energy.airthroughput.plugin.AirflowEstimationPlugin;
+
+public class AirflowProfile {
+	
+	protected List<AirflowValue> airflowHistory;
+	
+	protected AirflowEstimationPlugin airflowEstimationPlugin;
+	protected List <AirflowState> airflowStates;
+	protected Parameters parameters;
+
+	public AirflowProfile(AirflowEstimationPlugin airflowEstimationPlugin, List<AirflowState> airflowStates) {
+		super();
+		this.airflowEstimationPlugin = airflowEstimationPlugin;
+		this.airflowStates = airflowStates;
+		this.airflowHistory = new ArrayList<AirflowValue>();
+	}
+
+	public List<AirflowState> getAirflowStates() {
+		return airflowStates;
+	}
+	
+	public void addToAirFlowHistory(double airflow) {
+
+		if (airflowHistory.size() == 0) {
+			AirflowValue usage = new AirflowValue(DateTimeUtils.currentTimeMillis(), airflow);
+			airflowHistory.add(usage);
+			return;
+		}
+
+		int lastIdx = airflowHistory.size() - 1;
+		double lastAirflow = airflowHistory.get(lastIdx).getValue();
+		if (lastAirflow != airflow) {
+			AirflowValue usage = airflowHistory.get(lastIdx);
+			long currentTime = DateTimeUtils.currentTimeMillis();
+			if (usage.getTimestamp() == currentTime) {
+				usage.setValue(airflow);
+				if(lastIdx > 0 && airflowHistory.get(lastIdx - 1).getValue() == airflow)
+					airflowHistory.remove(usage);
+			} else {
+				usage = new AirflowValue(DateTimeUtils.currentTimeMillis(), airflow);
+				airflowHistory.add(usage);
+			}
+		}
+	}
+
+	public List<AirflowValue> getAirflowHistory() {
+		return airflowHistory;
+	}
+	
+	public void init(Parameters params){
+		this.parameters = params;
+	}
+
+	public Parameters getParameters() {
+		return parameters;
+	}
+}
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/AirflowState.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/AirflowState.java	(revision 1396)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/AirflowState.java	(revision 1396)
@@ -0,0 +1,31 @@
+package schedframe.resources.computing.profiles.energy.airthroughput;
+
+import schedframe.Parameters;
+
+public class AirflowState {
+
+	protected AirflowStateName name;
+	protected double value;
+	protected double powerUsage;
+	
+	public AirflowState(AirflowStateName name, double value, double powerUsage) {
+		super();
+		this.name = name;
+		this.value = value;
+		this.powerUsage = powerUsage;
+	}
+	
+	public AirflowStateName getName() {
+		return name;
+	}
+	public double getValue() {
+		return value;
+	}
+	public double getPowerUsage() {
+		return powerUsage;
+	}
+	
+	public void init(Parameters parameters){
+		
+	}
+}
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/AirflowStateName.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/AirflowStateName.java	(revision 1396)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/AirflowStateName.java	(revision 1396)
@@ -0,0 +1,7 @@
+package schedframe.resources.computing.profiles.energy.airthroughput;
+
+public interface AirflowStateName {
+
+	public String getLabel();
+
+}
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/StandardAirflowStateName.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/StandardAirflowStateName.java	(revision 1396)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/StandardAirflowStateName.java	(revision 1396)
@@ -0,0 +1,12 @@
+package schedframe.resources.computing.profiles.energy.airthroughput;
+
+public enum  StandardAirflowStateName implements AirflowStateName{
+
+	ON,
+	OFF;
+
+	public String getLabel() {
+		return toString();
+	}
+	
+}
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/AirflowInterfaceFactory.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/AirflowInterfaceFactory.java	(revision 1396)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/AirflowInterfaceFactory.java	(revision 1396)
@@ -0,0 +1,31 @@
+package schedframe.resources.computing.profiles.energy.airthroughput;
+
+import schedframe.resources.StandardResourceType;
+import schedframe.resources.computing.ComputingResource;
+import schedframe.resources.computing.profiles.energy.airthroughput.ui.AirflowInterface;
+import schedframe.resources.computing.profiles.energy.airthroughput.ui.ComputingResourceAirflowInterface;
+import schedframe.resources.devices.PhysicalResource;
+import schedframe.resources.devices.DeviceAirflowInterface;
+import schedframe.resources.devices.coolemall.FanAirflowInterface;
+
+public class AirflowInterfaceFactory {
+	
+	public static AirflowInterface createAirflowInterface(PhysicalResource resource, AirflowProfile atp){
+		if(atp == null)
+			return null;
+		AirflowInterface airflowInterface = null;
+		if(resource.getType().getName().equals(StandardResourceType.CRAH.getName()))
+			airflowInterface = new DeviceAirflowInterface(resource, atp);
+		else if(resource.getType().getName().equals(StandardResourceType.Fan.getName()))
+			airflowInterface = new FanAirflowInterface(resource, atp);
+		else if(resource.getType().getName().equals(StandardResourceType.Inlet.getName()))
+			airflowInterface = new FanAirflowInterface(resource, atp);
+		else if(resource.getType().getName().equals(StandardResourceType.Outlet.getName()))
+			airflowInterface = new FanAirflowInterface(resource, atp);
+		else if(resource.getType().getName().equals(StandardResourceType.CoolingDevice.getName()))
+			airflowInterface = new DeviceAirflowInterface(resource, atp);
+		else
+			airflowInterface = new ComputingResourceAirflowInterface((ComputingResource)resource, atp);
+		return airflowInterface;
+	}
+}
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 1207)
+++ 	(revision )
@@ -1,65 +1,0 @@
-package schedframe.resources.computing.profiles.energy.airthroughput;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.joda.time.DateTimeUtils;
-
-import schedframe.Parameters;
-import schedframe.resources.computing.profiles.energy.airthroughput.plugin.AirThroughputEstimationPlugin;
-
-public class AirThroughputProfile {
-	
-	protected List<AirFlowValue> airFlowHistory;
-	
-	protected AirThroughputEstimationPlugin airThroughputEstimationPlugin;
-	protected List <AirThroughputState> airThroughputStates;
-	protected Parameters parameters;
-
-	public AirThroughputProfile(AirThroughputEstimationPlugin airThroughputEstimationPlugin, List<AirThroughputState> airThroughputStates) {
-		super();
-		this.airThroughputEstimationPlugin = airThroughputEstimationPlugin;
-		this.airThroughputStates = airThroughputStates;
-		this.airFlowHistory = new ArrayList<AirFlowValue>();
-	}
-
-	public List<AirThroughputState> getAirThroughputStates() {
-		return airThroughputStates;
-	}
-	
-	public void addToAirFlowHistory(double airFlow) {
-
-		if (airFlowHistory.size() == 0) {
-			AirFlowValue usage = new AirFlowValue(DateTimeUtils.currentTimeMillis(), airFlow);
-			airFlowHistory.add(usage);
-			return;
-		}
-
-		int lastIdx = airFlowHistory.size() - 1;
-		double lastAirFlow = airFlowHistory.get(lastIdx).getValue();
-		if (lastAirFlow != airFlow) {
-			AirFlowValue usage = airFlowHistory.get(lastIdx);
-			long currentTime = DateTimeUtils.currentTimeMillis();
-			if (usage.getTimestamp() == currentTime) {
-				usage.setValue(airFlow);
-				if(lastIdx > 0 && airFlowHistory.get(lastIdx - 1).getValue() == airFlow)
-					airFlowHistory.remove(usage);
-			} else {
-				usage = new AirFlowValue(DateTimeUtils.currentTimeMillis(), airFlow);
-				airFlowHistory.add(usage);
-			}
-		}
-	}
-
-	public List<AirFlowValue> getAirThroughputHistory() {
-		return airFlowHistory;
-	}
-	
-	public void init(Parameters params){
-		this.parameters = params;
-	}
-
-	public Parameters getParameters() {
-		return parameters;
-	}
-}
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/AirThroughputState.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/AirThroughputState.java	(revision 477)
+++ 	(revision )
@@ -1,31 +1,0 @@
-package schedframe.resources.computing.profiles.energy.airthroughput;
-
-import schedframe.Parameters;
-
-public class AirThroughputState {
-
-	protected String name;
-	protected double value;
-	protected double powerUsage;
-	
-	public AirThroughputState(String name, double value, double powerUsage) {
-		super();
-		this.name = name;
-		this.value = value;
-		this.powerUsage = powerUsage;
-	}
-	
-	public String getName() {
-		return name;
-	}
-	public double getValue() {
-		return value;
-	}
-	public double getPowerUsage() {
-		return powerUsage;
-	}
-	
-	public void init(Parameters parameters){
-		
-	}
-}
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/UserAirThroughputStateName.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/UserAirThroughputStateName.java	(revision 753)
+++ 	(revision )
@@ -1,17 +1,0 @@
-package schedframe.resources.computing.profiles.energy.airthroughput;
-
-
-public class UserAirThroughputStateName implements AirThroughputStateName{
-
-	protected String name;
-
-	public UserAirThroughputStateName(String name) {
-		this.name = name;
-	}
-
-	public String getName() {
-		return name;
-	}
-
-
-}
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/AirThroughputStateName.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/AirThroughputStateName.java	(revision 753)
+++ 	(revision )
@@ -1,7 +1,0 @@
-package schedframe.resources.computing.profiles.energy.airthroughput;
-
-public interface AirThroughputStateName {
-
-	public String getName();
-
-}
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 1207)
+++ 	(revision )
@@ -1,12 +1,0 @@
-package schedframe.resources.computing.profiles.energy.airthroughput;
-
-public enum  StandardAirThroughputStateName implements AirThroughputStateName{
-
-	ON,
-	OFF;
-
-	public String getName() {
-		return toString();
-	}
-	
-}
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 1318)
+++ 	(revision )
@@ -1,31 +1,0 @@
-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.DeviceAirThroughputInterface;
-import schedframe.resources.devices.coolemall.FanAirThroughputInterface;
-
-public class AirThroughputInterfaceFactory {
-	
-	public static AirThroughputInterface createAirThroughputInterface(PhysicalResource resource, AirThroughputProfile atp){
-		if(atp == null)
-			return null;
-		AirThroughputInterface airThroughputInterface = null;
-		if(resource.getType().getName().equals(StandardResourceType.CRAH.getName()))
-			airThroughputInterface = new DeviceAirThroughputInterface(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 DeviceAirThroughputInterface(resource, atp);
-		else
-			airThroughputInterface = new ComputingResourceAirThroughputInterface((ComputingResource)resource, atp);
-		return airThroughputInterface;
-	}
-}
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/EnergyExtension.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/EnergyExtension.java	(revision 1389)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/EnergyExtension.java	(revision 1396)
@@ -10,7 +10,7 @@
 import schedframe.resources.computing.extensions.ExtensionException;
 import schedframe.resources.computing.extensions.ExtensionType;
-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.airthroughput.AirflowInterfaceFactory;
+import schedframe.resources.computing.profiles.energy.airthroughput.AirflowProfile;
+import schedframe.resources.computing.profiles.energy.airthroughput.ui.AirflowInterface;
 import schedframe.resources.computing.profiles.energy.power.PowerInterfaceFactory;
 import schedframe.resources.computing.profiles.energy.power.PowerProfile;
@@ -30,6 +30,6 @@
 	protected PowerProfile powerProfile;
 	
-	protected AirThroughputInterface airFlowInterface;
-	protected AirThroughputProfile airFlowProfile;
+	protected AirflowInterface airflowInterface;
+	protected AirflowProfile airflowProfile;
 	
 	protected ThermalInterface thermalInterface;
@@ -74,6 +74,6 @@
 		protected PowerProfile powerProfile;
 		
-		protected AirThroughputInterface airFlowInterface;
-		protected AirThroughputProfile airFlowProfile;
+		protected AirflowInterface airflowInterface;
+		protected AirflowProfile airflowProfile;
 		
 		protected ThermalInterface thermalInterface;
@@ -84,5 +84,5 @@
 		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 airflowProfile(AirflowProfile atp){this.airflowProfile = atp; this.airflowInterface = AirflowInterfaceFactory.createAirflowInterface(resource, airflowProfile); return this; }
 
         public Builder thermalProfile(ThermalProfile tp){this.thermalProfile = tp; this.thermalInterface = ThermalInterfaceFactory.createThermalInterface(resource, thermalProfile); return this; }
@@ -98,6 +98,6 @@
 		this.powerProfile = builder.powerProfile;
 		
-		this.airFlowInterface = builder.airFlowInterface ;
-		this.airFlowProfile = builder.airFlowProfile;
+		this.airflowInterface = builder.airflowInterface ;
+		this.airflowProfile = builder.airflowProfile;
 		
 		this.thermalInterface = builder.thermalInterface;
@@ -163,6 +163,6 @@
 				
 			case AIRFLOW_STATE_CHANGED:
-				double airFlow = powerProfile.getEnergyEstimationPlugin().estimateAirThroughput(enEvent, new JobRegistryImpl(resource.getFullName()), resource);
-				airFlowProfile.addToAirFlowHistory(airFlow);
+				double airflow = powerProfile.getEnergyEstimationPlugin().estimateAirflow(enEvent, new JobRegistryImpl(resource.getFullName()), resource);
+				airflowProfile.addToAirFlowHistory(airflow);
 				break;
 				
@@ -204,10 +204,10 @@
 	}
 
-	public AirThroughputInterface getAirThroughputInterface() {
-		return airFlowInterface;
-	}
-
-	public AirThroughputProfile getAirFlowProfile() {
-		return airFlowProfile;
+	public AirflowInterface getAirflowInterface() {
+		return airflowInterface;
+	}
+
+	public AirflowProfile getAirFlowProfile() {
+		return airflowProfile;
 	}
 	
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 1374)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/ui/ComputingResourcePowerInterface.java	(revision 1396)
@@ -74,5 +74,5 @@
 	public boolean supportPowerState(PowerStateName state) {
 		for(PowerState powerState: powerProfile.getSupportedPowerStates()){
-			if(powerState.getName().getName().equals(state.getName())){
+			if(powerState.getName().getLabel().equals(state.getLabel())){
 				return true;
 			}
@@ -86,5 +86,5 @@
 		if(supportPowerState(state)){
 			for(PowerState powerState: powerProfile.getSupportedPowerStates()){
-				if(powerState.getName().getName().equals(state.getName())){
+				if(powerState.getName().getLabel().equals(state.getLabel())){
 					powerConsumption = powerState.getPowerUsage();
 					break;
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/PowerStateName.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/PowerStateName.java	(revision 477)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/PowerStateName.java	(revision 1396)
@@ -3,5 +3,5 @@
 public interface PowerStateName {
 	
-	public String getName();
+	public String getLabel();
 
 }
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 1207)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/plugin/EnergyEstimationPlugin.java	(revision 1396)
@@ -10,5 +10,5 @@
 	public double estimatePowerConsumption(EnergyEvent event, JobRegistry jobRegistry, PhysicalResource resource);
 
-	public double estimateAirThroughput(EnergyEvent event, JobRegistry jobRegistry, PhysicalResource resource);
+	public double estimateAirflow(EnergyEvent event, JobRegistry jobRegistry, PhysicalResource resource);
 
 	public double estimateTemperature(EnergyEvent event, JobRegistry jobRegistry, PhysicalResource resource);
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/StandardPowerStateName.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/StandardPowerStateName.java	(revision 477)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/StandardPowerStateName.java	(revision 1396)
@@ -10,5 +10,5 @@
 	HIBERNATE;
 
-	public String getName() {
+	public String getLabel() {
 		return toString();
 	}
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/PowerStateNameFactory.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/PowerStateNameFactory.java	(revision 477)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/PowerStateNameFactory.java	(revision 1396)
@@ -6,20 +6,20 @@
 	public static PowerStateName createPowerStateName (String powerStateName){
 		
-		if(powerStateName.equals(StandardPowerStateName.ON.getName()))
+		if(powerStateName.equals(StandardPowerStateName.ON.getLabel()))
 			return StandardPowerStateName.ON;
 		
-		else if(powerStateName.equals(StandardPowerStateName.OFF.getName()))
+		else if(powerStateName.equals(StandardPowerStateName.OFF.getLabel()))
 			return StandardPowerStateName.OFF;
 		
-		else if(powerStateName.equals(StandardPowerStateName.HIBERNATE.getName()))
+		else if(powerStateName.equals(StandardPowerStateName.HIBERNATE.getLabel()))
 			return StandardPowerStateName.HIBERNATE;
 		
-		else if(powerStateName.equals(StandardPowerStateName.SLEEP.getName()))
+		else if(powerStateName.equals(StandardPowerStateName.SLEEP.getLabel()))
 			return StandardPowerStateName.SLEEP;
 		
-		else if(powerStateName.equals(StandardPowerStateName.SUSPEND.getName()))
+		else if(powerStateName.equals(StandardPowerStateName.SUSPEND.getLabel()))
 			return StandardPowerStateName.SUSPEND;
 		
-		else return new UserPowerStateName(powerStateName);
+		else return new CustomPowerStateName(powerStateName);
 	}
 }
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/CustomPowerStateName.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/CustomPowerStateName.java	(revision 1396)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/CustomPowerStateName.java	(revision 1396)
@@ -0,0 +1,16 @@
+package schedframe.resources.computing.profiles.energy.power;
+
+public class CustomPowerStateName implements PowerStateName {
+
+	protected String name;
+
+	public CustomPowerStateName(String name) {
+		this.name = name;
+	}
+
+	public String getLabel() {
+		return name;
+	}
+
+
+}
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/UserPowerStateName.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/UserPowerStateName.java	(revision 477)
+++ 	(revision )
@@ -1,16 +1,0 @@
-package schedframe.resources.computing.profiles.energy.power;
-
-public class UserPowerStateName implements PowerStateName {
-
-	protected String name;
-
-	public UserPowerStateName(String name) {
-		this.name = name;
-	}
-
-	public String getName() {
-		return name;
-	}
-
-
-}
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/computing/ComputingResource.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/computing/ComputingResource.java	(revision 1392)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/computing/ComputingResource.java	(revision 1396)
@@ -57,5 +57,5 @@
 		initCharacteristics(resDesc);
 		accept(new LoadExtension(resDesc.getLoadProfile(), this));
-		accept(new EnergyExtension.Builder().resource(this).powerProfile(resDesc.getPowerProfile()).airFlowProfile(resDesc.getAirThroughputProfile()).thermalProfile(resDesc.getThermalProfile()).build());	
+		accept(new EnergyExtension.Builder().resource(this).powerProfile(resDesc.getPowerProfile()).airflowProfile(resDesc.getAirflowProfile()).thermalProfile(resDesc.getThermalProfile()).build());	
 	}
 
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/ResourceHistoryItem.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/ResourceHistoryItem.java	(revision 1396)
+++ DCWoRMS/branches/coolemall/src/schedframe/resources/ResourceHistoryItem.java	(revision 1396)
@@ -0,0 +1,34 @@
+package schedframe.resources;
+
+
+public class ResourceHistoryItem {
+	
+	private long timestamp;	
+	private String resourceName;
+	private String action;
+	private String paramter;
+	
+	public ResourceHistoryItem(long timestamp, String resourceName, String action, String paramter) {
+		super();
+		this.timestamp = timestamp;
+		this.resourceName = resourceName;
+		this.action = action;
+		this.paramter = paramter;
+	}
+	
+	public long getTimestamp() {
+		return timestamp;
+	}
+	
+	public String getResourceName() {
+		return resourceName;
+	}
+	
+	public String getAction() {
+		return action;
+	}
+	
+	public String getParamter() {
+		return paramter;
+	}
+}
Index: DCWoRMS/branches/coolemall/src/schedframe/resources/ResourceHistoryChanges.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/ResourceHistoryChanges.java	(revision 1207)
+++ 	(revision )
@@ -1,34 +1,0 @@
-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/UserResourceType.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/resources/UserResourceType.java	(revision 477)
+++ 	(revision )
@@ -1,16 +1,0 @@
-package schedframe.resources;
-
-
-public class UserResourceType implements ResourceType {
-
-	protected String name;
-
-	public UserResourceType(String name) {
-		this.name = name;
-	}
-
-	public String getName() {
-		return name;
-	}
-	
-}
Index: DCWoRMS/branches/coolemall/src/schedframe/StaticResourceLoadCalendar.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/StaticResourceLoadCalendar.java	(revision 477)
+++ 	(revision )
@@ -1,70 +1,0 @@
-package schedframe;
-import gridsim.ResourceCalendar;
-
-import java.util.LinkedList;
-import java.util.Properties;
-
-import schedframe.exceptions.ModuleException;
-import schedframe.scheduling.plugin.grid.Module;
-import schedframe.scheduling.plugin.grid.ModuleType;
-
-public class StaticResourceLoadCalendar extends ResourceCalendar implements Module{
-	
-	private static long seed_; 
-	private static double timeZone_;
-	private static double peakLoad_;
-	private static double offPeakLoad_;
-	private static double holidayLoad_;
-	private static LinkedList<Integer> Weekends_;
-	private static LinkedList<Integer> Holidays_;
-	
-	static{
-		seed_ = 11L * 13L * 17L * 19L * 23L + 1L; 
-		timeZone_ = 0.0;
-		peakLoad_ = 0.0; // the resource load during peak hour
-		offPeakLoad_ = 0.0; // the resource load during off-peak hr
-		holidayLoad_ = 0.0; // the resource load during holiday
-		
-		// incorporates weekends so the grid resource is on 7 days a week
-		Weekends_ = new LinkedList<Integer>();
-		Weekends_.add(java.util.Calendar.SATURDAY);
-		Weekends_.add(java.util.Calendar.SUNDAY);
-
-		// incorporates holidays. However, no holidays are set in this example
-		Holidays_ = new LinkedList<Integer>();
-	}
-
-
-	public StaticResourceLoadCalendar(double timeZone, double peakLoad,
-			double offPeakLoad, double relativeHolidayLoad,
-			LinkedList weekendList, LinkedList holidayList, long seed) {
-		super(timeZone, peakLoad, offPeakLoad, relativeHolidayLoad, weekendList,
-				holidayList, seed);
-		// TODO Auto-generated constructor stub
-	}
-
-	public StaticResourceLoadCalendar(){
-		super(timeZone_, peakLoad_, offPeakLoad_, 
-				holidayLoad_, Weekends_, Holidays_, seed_);
-	}
-
-	@Override
-	public void init(Properties properties) throws ModuleException {
-		// TODO Auto-generated method stub
-		
-	}
-
-	@Override
-	public void dispose() throws ModuleException {
-		// TODO Auto-generated method stub
-		
-	}
-
-	@Override
-	public ModuleType getType() {
-		return ModuleType.RESOURCE_CALENDAR;
-	}
-
-
-
-}
