Index: /DCWoRMS/branches/coolemall/src/test/transitions/FCFS_ConsolidationHighPerf_NodePowMan_SP_Delay.java
===================================================================
--- /DCWoRMS/branches/coolemall/src/test/transitions/FCFS_ConsolidationHighPerf_NodePowMan_SP_Delay.java	(revision 1442)
+++ /DCWoRMS/branches/coolemall/src/test/transitions/FCFS_ConsolidationHighPerf_NodePowMan_SP_Delay.java	(revision 1443)
@@ -55,6 +55,4 @@
 			// BaseLocalSchedulingPlugin.placeJobsInQueues() method)
 			TaskQueue q = queues.get(0);
-			cnt++;
-			System.out.println("----" + cnt);
 			List<Node> notSelectedNodes = resourceManager.getNodes();
 			
@@ -123,5 +121,4 @@
 			pe.addAll(choosenResources);
 			map.put(StandardResourceUnitName.PE, pe);
-			System.out.println(new DateTime() + "---" + node.getFullName() +  "; " + task.getJobId());
 			return map;
 		}
@@ -212,5 +209,4 @@
 					NodePowerInterface nodePI = (NodePowerInterface)node.getPowerInterface();
 					nodePI.turnOn();
-					System.out.println(new DateTime() +"====" + node.getFullName()  + "; " + task.getJobId());
 					startedNode = node;
 					break;
Index: WoRMS/branches/coolemall/src/test/transitions/FCFS_ConsolidationHighPerf_NodePowMan_SP.java
===================================================================
--- /DCWoRMS/branches/coolemall/src/test/transitions/FCFS_ConsolidationHighPerf_NodePowMan_SP.java	(revision 1442)
+++ 	(revision )
@@ -1,250 +1,0 @@
-package test.transitions;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import schedframe.events.scheduling.SchedulingEvent;
-import schedframe.resources.ResourceStatus;
-import schedframe.resources.StandardResourceType;
-import schedframe.resources.computing.Node;
-import schedframe.resources.computing.ComputingResource;
-import schedframe.resources.computing.Core;
-import schedframe.resources.computing.Processor;
-import schedframe.resources.computing.profiles.energy.airthroughput.CustomAirflowStateName;
-import schedframe.resources.computing.profiles.energy.power.PState;
-import schedframe.resources.computing.profiles.energy.power.PowerStateName;
-import schedframe.resources.computing.profiles.energy.power.StandardPowerStateName;
-import schedframe.resources.computing.profiles.energy.power.ui.NodePowerInterface;
-import schedframe.resources.devices.Device;
-import schedframe.resources.devices.Fan;
-import schedframe.resources.units.ProcessingElements;
-import schedframe.resources.units.ResourceUnit;
-import schedframe.resources.units.ResourceUnitName;
-import schedframe.resources.units.StandardResourceUnitName;
-import schedframe.scheduling.manager.resources.ClusterResourceManager;
-import schedframe.scheduling.manager.resources.ResourceManager;
-import schedframe.scheduling.manager.tasks.JobRegistry;
-import schedframe.scheduling.manager.tasks.JobRegistryImpl;
-import schedframe.scheduling.plan.SchedulingPlanInterface;
-import schedframe.scheduling.plan.impl.SchedulingPlan;
-import schedframe.scheduling.plugin.ModuleList;
-import schedframe.scheduling.queue.TaskQueue;
-import schedframe.scheduling.queue.TaskQueueList;
-import schedframe.scheduling.tasks.TaskInterface;
-import test.Node_Fan_Mapping;
-import example.localplugin.BaseLocalSchedulingPlugin;
-import gridsim.dcworms.DCWormsTags;
-
-public class FCFS_ConsolidationHighPerf_NodePowMan_SP extends BaseLocalSchedulingPlugin {
-
-	
-	public FCFS_ConsolidationHighPerf_NodePowMan_SP () {
-		Node_Fan_Mapping.init();
-	}
-
-	public SchedulingPlanInterface<?> schedule(SchedulingEvent event, TaskQueueList queues, JobRegistry jobRegistry,
-			 ResourceManager resManager, ModuleList modules) {
-
-		ClusterResourceManager resourceManager = (ClusterResourceManager) resManager;
-		SchedulingPlan plan = new SchedulingPlan();
-		// choose the events types to serve.
-		// Different actions for different events are possible.
-		switch (event.getType()) {
-		case START_TASK_EXECUTION:
-		case TASK_FINISHED:
-		//case TIMER:
-			// our tasks are placed only in first queue (see
-			// BaseLocalSchedulingPlugin.placeJobsInQueues() method)
-			TaskQueue q = queues.get(0);
-			
-			List<Node> notSelectedNodes = resourceManager.getNodes();
-			
-			// check all tasks in queue
-			for (int i = 0; i < q.size(); i++) {
-				TaskInterface<?> task = q.get(i);
-				// if status of the tasks in READY
-				if (task.getStatus() == DCWormsTags.READY) {
-
-					Map<ResourceUnitName, ResourceUnit> choosenResources = chooseResourcesForExecution(resourceManager, task);
-					if (choosenResources != null) {
-						addToSchedulingPlan(plan, task, choosenResources);
-						ProcessingElements pe = (ProcessingElements) choosenResources.get(StandardResourceUnitName.PE);
-						Node node = (Node) pe.get(0).getParent();
-						notSelectedNodes.remove(node);
-					}
-				}
-			}
-			manageResources(notSelectedNodes);
-			break;
-		}
-		return plan;
-	}
-
-	@SuppressWarnings("unchecked")
-	private Map<ResourceUnitName, ResourceUnit> chooseResourcesForExecution(
-			ClusterResourceManager resourceManager, TaskInterface<?> task) {
-
-		Map<ResourceUnitName, ResourceUnit> map = new HashMap<ResourceUnitName, ResourceUnit>();
-		
-		List<Node> nodes = resourceManager.getNodes();
-		List<Node> avNodes = filterNodes(nodes, task);
-		Node node;
-		if(avNodes.size() == 0){
-
-			nodes = (List<Node>) resourceManager.getResourcesByTypeWithStatus(StandardResourceType.Node, ResourceStatus.UNAVAILABLE);
-			node = turnOnFirstNode(nodes, task);
-			if(node == null)
-				return null;
-		} else {
-			node = findTheMostLoadedNode(avNodes);			
-		}
-
-		int cpuRequest;
-		try {
-			cpuRequest = Double.valueOf(task.getCpuCntRequest()).intValue();
-		} catch (NoSuchFieldException e) {
-			cpuRequest = 0;
-		}
-
-		if (cpuRequest != 0) {
-
-			List<ComputingResource> choosenResources = new ArrayList<ComputingResource>();	
-			
-			List<Processor> cpus = node.getProcessors();			
-			for (int i = 0; i < cpus.size() && cpuRequest > 0; i++) {
-				if (cpus.get(i).getStatus() == ResourceStatus.FREE || (cpus.get(i).getStatus() == ResourceStatus.UNAVAILABLE && cpus.get(i).getParent().getPowerInterface().getPowerState().getLabel().equals(StandardPowerStateName.OFF.getLabel() + "_" + StandardPowerStateName.ON.getLabel()))) {
-					choosenResources.add(cpus.get(i));
-					cpuRequest--;
-				}
-			}
-			if (cpuRequest > 0) {
-				return null;
-			}
-			//choosenResources.add(node.getProcessors().get(0));
-			ProcessingElements pe = new ProcessingElements();
-			pe.addAll(choosenResources);
-			map.put(StandardResourceUnitName.PE, pe);
-			System.out.println("---" + node.getFullName() +  "; " + task.getJobId());
-			return map;
-		}
-		return null;
-	}
-	
-	private List<Node> filterNodes(List<Node> nodes, TaskInterface<?> task){
-		List<Node> filteredNodes = new ArrayList<Node>();
-		int cpuRequest;
-		try {
-			cpuRequest = Double.valueOf(task.getCpuCntRequest()).intValue();
-		} catch (NoSuchFieldException e) {
-			cpuRequest = 0;
-		}
-		for (Node node : nodes) {
-
-			if (cpuRequest != 0) {
-
-				List<Processor> cpus = node.getProcessors();
-				if (cpus.size() < cpuRequest) {
-					if(cpus.size() == 0){
-						continue;
-					}
-				}
-
-				int freeCpus = 0;
-				for(Processor cpu: cpus){
-					if(cpu.getStatus() == ResourceStatus.FREE|| (cpu.getStatus() == ResourceStatus.UNAVAILABLE && cpu.getParent().getPowerInterface().getPowerState().getLabel().equals(StandardPowerStateName.OFF.getLabel() + "_" + StandardPowerStateName.ON.getLabel()))) 
-						freeCpus++;
-				}
-				
-				if(freeCpus < cpuRequest)
-					continue;
-				
-				filteredNodes.add(node);
-			}
-		}
-		
-		return filteredNodes;
-	}
-	
-	private Node findTheMostLoadedNode(List<Node> nodes){
-		Node mostLoadedNode = null;
-			
-		int maxRunningTask = -1;
-		int nrRunningTasks;
-		for(Node node: nodes){
-			JobRegistry jr = new JobRegistryImpl(node.getFullName());
-			nrRunningTasks = jr.getRunningTasks().size(); 
-			if(nrRunningTasks > maxRunningTask){
-				mostLoadedNode = node;
-				maxRunningTask = nrRunningTasks;
-			}
-		}
-		return mostLoadedNode;
-	}
-	
-	private Node turnOnFirstNode(List<Node> nodes, TaskInterface<?> task){
-		Node startedNode = null;
-
-		int cpuRequest;
-		try {
-			cpuRequest = Double.valueOf(task.getCpuCntRequest()).intValue();
-		} catch (NoSuchFieldException e) {
-			cpuRequest = 0;
-		}
-		
-		for(Node node: nodes){
-			
-			if (cpuRequest != 0) {
-
-				List<Processor> cpus = node.getProcessors();
-				if (cpus.size() < cpuRequest) {
-					if(cpus.size() == 0){
-						continue;
-					}
-				}
-				
-				int freeCpus = 0;
-				for(Processor cpu: cpus){
-					if(cpu.getStatus() == ResourceStatus.FREE || cpu.getStatus() == ResourceStatus.UNAVAILABLE)
-						freeCpus++;
-				}
-				
-				if(freeCpus < cpuRequest)
-					continue;
-				else if(node.getPowerInterface().getPowerState().getLabel().equals(StandardPowerStateName.OFF.getLabel())){
-					NodePowerInterface nodePI = (NodePowerInterface)node.getPowerInterface();
-					nodePI.turnOn();
-					System.out.println("====" + node.getFullName());
-					startedNode = node;
-					break;
-				}				
-			}
-		}
-		return startedNode;
-	}
-	
-	protected void manageResources(List<Node> notSelectedNodes) {
-		turnOffIdleNodes(notSelectedNodes);
-	}
-
-	private void turnOffIdleNodes(List<Node> nodes){
-		for(Node node : nodes){
-
-			int freeCpus = 0;
-			for(Processor cpu: node.getProcessors ()){
-				if(cpu.getStatus() == ResourceStatus.FREE)
-					freeCpus++;
-			}
-			
-			if(freeCpus == node.getProcessors().size() && node.getPowerInterface().getPowerState().getLabel().equals(StandardPowerStateName.ON.getLabel())) {
-				NodePowerInterface nodePI = (NodePowerInterface)node.getPowerInterface();
-				nodePI.turnOff();
-			}
-
-		}
-	}
-
-}
