Index: DCWoRMS/branches/coolemall/src/example/localplugin/coolemall/recs/RECS_FCFS_Consolidation_SP.java
===================================================================
--- DCWoRMS/branches/coolemall/src/example/localplugin/coolemall/recs/RECS_FCFS_Consolidation_SP.java	(revision 916)
+++ DCWoRMS/branches/coolemall/src/example/localplugin/coolemall/recs/RECS_FCFS_Consolidation_SP.java	(revision 916)
@@ -0,0 +1,193 @@
+package example.localplugin.coolemall.recs;
+
+import example.localplugin.BaseLocalSchedulingPlugin;
+import gridsim.dcworms.DCWormsTags;
+
+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.exceptions.ResourceException;
+import schedframe.resources.ResourceStatus;
+import schedframe.resources.UserResourceType;
+import schedframe.resources.computing.ComputingNode;
+import schedframe.resources.computing.ComputingResource;
+import schedframe.resources.computing.Core;
+import schedframe.resources.computing.Processor;
+import schedframe.resources.computing.profiles.energy.power.StandardPowerStateName;
+import schedframe.resources.computing.recs.Node;
+import schedframe.resources.units.Memory;
+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.grid.ModuleList;
+import schedframe.scheduling.queue.TaskQueue;
+import schedframe.scheduling.queue.TaskQueueList;
+import schedframe.scheduling.tasks.TaskInterface;
+
+public class RECS_FCFS_Consolidation_SP extends BaseLocalSchedulingPlugin {
+
+	public RECS_FCFS_Consolidation_SP () {
+	}
+
+	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:
+			// our tasks are placed only in first queue (see
+			// BaseLocalSchedulingPlugin.placeJobsInQueues() method)
+			TaskQueue q = queues.get(0);
+			// check all tasks in queue
+			List<Node> nodes;
+			try {
+				nodes = (List<Node>) resourceManager.getResourcesOfType(new UserResourceType("Node"));
+			} catch (ResourceException e) {
+				break;
+			}
+			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 = null;
+					try {
+						choosenResources = chooseResourcesForExecution(nodes, task);
+					} catch (NoSuchFieldException e) {
+						// TODO Auto-generated catch block
+						e.printStackTrace();
+					}
+					if (choosenResources  != null) {
+						addToSchedulingPlan(plan, task, choosenResources);
+					} 
+				}
+			}
+			turnOffIdleNodes(nodes);
+
+			break;
+		}
+		return plan;
+	}
+	
+	private Map<ResourceUnitName, ResourceUnit> chooseResourcesForExecution(List<Node> nodes, TaskInterface<?> task) throws NoSuchFieldException {
+
+		nodes = findSuitableNodes(task, nodes);
+		Collections.sort(nodes, new Comparator<Node>(){
+		    public int compare(Node node1, Node node2){   
+		    	int freeCores1 = 0, freeCores2 = 0;
+		    	int freeCpus1 = 0, freeCpus2 = 0;
+		    	
+		    	List<Processor> processors1 = node1.getProcessors();
+		    	for(Processor processor: processors1){
+		    		freeCores1 = freeCores1 + processor.getFreeCores().size();
+		    	}
+		    	
+		    	List<Processor> processors2 = node2.getProcessors();
+		    	for(Processor processor: processors2){
+		    		freeCores2 = freeCores2 + processor.getFreeCores().size();
+		    	}
+		    	
+		    	if(freeCores1 == 0 && freeCores2 == 0){
+		    		freeCpus1 = node1.getFreeProcessorsNumber();
+		    		freeCpus2 = node2.getFreeProcessorsNumber();
+		    		
+		    		if(freeCpus1 > freeCpus2) {
+		    			return -1;
+		    		} else if(freeCpus1 < freeCpus2) {
+		    			return 1;
+		    		} else {
+		    			return 0;
+		    		}
+		    	} else {
+		    		if(freeCores1 > freeCores2) {
+		    			return -1;
+		    		} else if(freeCores1 < freeCores2) {
+		    			return 1;
+		    		} else {
+		    			return 0;
+		    		}
+		    	}
+		    }
+		});
+		if(nodes.size() > 0)
+		{
+			Node node = nodes.get(0);
+			Map<ResourceUnitName, ResourceUnit> map = new HashMap<ResourceUnitName, ResourceUnit>();
+			List<ComputingResource> choosenResources =  new ArrayList<ComputingResource>();
+			int cpuRequest;
+			try {
+				cpuRequest = Double.valueOf(task.getCpuCntRequest()).intValue();
+			} catch (NoSuchFieldException e) {
+				cpuRequest = 0;
+			}
+			for (int i = 0; i < node.getProcessors().size() && cpuRequest > 0; i++) {
+				if (node.getProcessors().get(i).getStatus() == ResourceStatus.FREE) {
+					choosenResources.add(node.getProcessors().get(i));
+					cpuRequest--;
+				}
+			}
+			ProcessingElements result = new ProcessingElements(node.getName());
+			result.addAll(choosenResources);
+			map.put(StandardResourceUnitName.PE, result);
+			
+			int memoryRequest;
+			try {
+				memoryRequest = Double.valueOf(task.getMemoryRequest()).intValue();
+			} catch (NoSuchFieldException e) {
+				memoryRequest = 0;
+			}
+			if (memoryRequest != 0) {
+				Memory memory = new Memory(node.getMemory(), memoryRequest, memoryRequest);
+				map.put(StandardResourceUnitName.MEMORY, memory);
+			}
+			return map;
+		} else 
+			return null;
+	}
+	
+	private List<Node> findSuitableNodes(TaskInterface<?> task, List<Node> nodes) throws NoSuchFieldException{
+		int cpuRequest;
+		try {
+			cpuRequest = Double.valueOf(task.getCpuCntRequest()).intValue();
+		} catch (NoSuchFieldException e) {
+			cpuRequest = 1;
+		}
+		int memoryRequest;
+		try {
+			memoryRequest = Double.valueOf(task.getMemoryRequest()).intValue();
+		} catch (NoSuchFieldException e) {
+			memoryRequest = 0;
+		}
+		List<Node> suitableNodes = new ArrayList<Node>();
+		for(Node node: nodes){
+			if(node.getFreeProcessorsNumber() >= cpuRequest && node.getFreeMemory() >= memoryRequest){
+				suitableNodes.add(node);
+			}
+		}
+		return suitableNodes;
+	}
+
+	private void turnOffIdleNodes(List<Node> nodes){
+		for(Node node : nodes){
+			JobRegistry jr = new JobRegistryImpl(node.getName());
+			if(jr.getRunningTasks().size() == 0)
+				node.getPowerInterface().setPowerState(StandardPowerStateName.OFF);
+		}
+	}
+}
Index: DCWoRMS/branches/coolemall/src/example/localplugin/coolemall/recs/RECS_FCFS_LB_SP.java
===================================================================
--- DCWoRMS/branches/coolemall/src/example/localplugin/coolemall/recs/RECS_FCFS_LB_SP.java	(revision 916)
+++ DCWoRMS/branches/coolemall/src/example/localplugin/coolemall/recs/RECS_FCFS_LB_SP.java	(revision 916)
@@ -0,0 +1,90 @@
+package example.localplugin.coolemall.recs;
+
+import java.util.List;
+
+import schedframe.events.scheduling.SchedulingEvent;
+import schedframe.exceptions.ResourceException;
+import schedframe.resources.UserResourceType;
+import schedframe.resources.computing.ComputingResource;
+import schedframe.resources.computing.recs.Node;
+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.grid.ModuleList;
+import schedframe.scheduling.queue.TaskQueue;
+import schedframe.scheduling.queue.TaskQueueList;
+import schedframe.scheduling.tasks.TaskInterface;
+import example.localplugin.BaseLocalSchedulingPlugin;
+import gridsim.dcworms.DCWormsTags;
+
+public class RECS_FCFS_LB_SP extends BaseLocalSchedulingPlugin {
+
+	public RECS_FCFS_LB_SP () {
+	}
+
+	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);
+			
+			// 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) {
+
+					String nodeName = chooseProvider(resourceManager);
+					if (nodeName != null) {
+						addToSchedulingPlan(plan, task, nodeName);
+					}
+				}
+			}
+			break;
+		}
+		return plan;
+	}
+
+	@SuppressWarnings("unchecked")
+	private String chooseProvider(ClusterResourceManager resourceManager) {
+		List<ComputingResource> nodes = null;
+		try {
+			nodes = (List<ComputingResource>) resourceManager.getResourcesOfType(new UserResourceType("Node"));
+		} catch (ResourceException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+		int nodeIdx = findLeastLoadedResourceIdx(nodes);
+		return nodes.get(nodeIdx).getName();
+	}
+	
+	private int findLeastLoadedResourceIdx(List<ComputingResource> nodes ){
+		int resourceIdx = -1;
+		int minLoad = Integer.MAX_VALUE;
+		
+		for(int i = 0; i < nodes.size(); i++){
+			Node node = (Node) nodes.get(i);
+			JobRegistry jr = new JobRegistryImpl(node.getName());
+			int totalLoad = jr.getRunningTasks().size(); 
+			if(totalLoad < minLoad){
+				resourceIdx = i;
+				minLoad = totalLoad;
+			}
+		}
+		return resourceIdx;
+	}
+
+}
+
Index: DCWoRMS/branches/coolemall/src/example/localplugin/coolemall/recs/RECS_FCFS_Random_SP.java
===================================================================
--- DCWoRMS/branches/coolemall/src/example/localplugin/coolemall/recs/RECS_FCFS_Random_SP.java	(revision 916)
+++ DCWoRMS/branches/coolemall/src/example/localplugin/coolemall/recs/RECS_FCFS_Random_SP.java	(revision 916)
@@ -0,0 +1,76 @@
+package example.localplugin.coolemall.recs;
+
+import java.util.List;
+import java.util.Random;
+
+import schedframe.events.scheduling.SchedulingEvent;
+import schedframe.exceptions.ResourceException;
+import schedframe.resources.UserResourceType;
+import schedframe.resources.computing.ComputingResource;
+import schedframe.scheduling.manager.resources.ClusterResourceManager;
+import schedframe.scheduling.manager.resources.ResourceManager;
+import schedframe.scheduling.manager.tasks.JobRegistry;
+import schedframe.scheduling.plan.SchedulingPlanInterface;
+import schedframe.scheduling.plan.impl.SchedulingPlan;
+import schedframe.scheduling.plugin.grid.ModuleList;
+import schedframe.scheduling.queue.TaskQueue;
+import schedframe.scheduling.queue.TaskQueueList;
+import schedframe.scheduling.tasks.TaskInterface;
+import example.localplugin.BaseLocalSchedulingPlugin;
+import gridsim.dcworms.DCWormsTags;
+
+public class RECS_FCFS_Random_SP extends BaseLocalSchedulingPlugin {
+
+	private Random rand;
+	
+	public RECS_FCFS_Random_SP () {
+		rand = new Random(47);
+	}
+
+	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);
+			
+			// 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) {
+
+					String nodeName = chooseRandomProvider(resourceManager);
+					if (nodeName != null) {
+						addToSchedulingPlan(plan, task, nodeName);
+					}
+				}
+			}
+			break;
+		}
+		return plan;
+	}
+
+	@SuppressWarnings("unchecked")
+	private String chooseRandomProvider(ClusterResourceManager resourceManager) {
+		List<ComputingResource> nodes = null;
+		try {
+			nodes = (List<ComputingResource>) resourceManager.getResourcesOfType(new UserResourceType("Node"));
+		} catch (ResourceException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+		int nodeIdx = rand.nextInt(nodes.size());
+		return nodes.get(nodeIdx).getName();
+	}
+
+}
+
Index: DCWoRMS/branches/coolemall/src/example/localplugin/coolemall/recs/RECS_Random_SP.java
===================================================================
--- DCWoRMS/branches/coolemall/src/example/localplugin/coolemall/recs/RECS_Random_SP.java	(revision 851)
+++ 	(revision )
@@ -1,76 +1,0 @@
-package example.localplugin.coolemall.recs;
-
-import java.util.List;
-import java.util.Random;
-
-import schedframe.events.scheduling.SchedulingEvent;
-import schedframe.exceptions.ResourceException;
-import schedframe.resources.UserResourceType;
-import schedframe.resources.computing.ComputingResource;
-import schedframe.scheduling.manager.resources.ClusterResourceManager;
-import schedframe.scheduling.manager.resources.ResourceManager;
-import schedframe.scheduling.manager.tasks.JobRegistry;
-import schedframe.scheduling.plan.SchedulingPlanInterface;
-import schedframe.scheduling.plan.impl.SchedulingPlan;
-import schedframe.scheduling.plugin.grid.ModuleList;
-import schedframe.scheduling.queue.TaskQueue;
-import schedframe.scheduling.queue.TaskQueueList;
-import schedframe.scheduling.tasks.TaskInterface;
-import example.localplugin.BaseLocalSchedulingPlugin;
-import gridsim.dcworms.DCWormsTags;
-
-public class RECS_Random_SP extends BaseLocalSchedulingPlugin {
-
-	private Random rand;
-	
-	public RECS_Random_SP () {
-		rand = new Random(47);
-	}
-
-	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);
-			
-			// 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) {
-
-					String nodeName = chooseRandomProvider(resourceManager);
-					if (nodeName != null) {
-						addToSchedulingPlan(plan, task, nodeName);
-					}
-				}
-			}
-			break;
-		}
-		return plan;
-	}
-
-	@SuppressWarnings("unchecked")
-	private String chooseRandomProvider(ClusterResourceManager resourceManager) {
-		List<ComputingResource> nodes = null;
-		try {
-			nodes = (List<ComputingResource>) resourceManager.getResourcesOfType(new UserResourceType("Node"));
-		} catch (ResourceException e) {
-			// TODO Auto-generated catch block
-			e.printStackTrace();
-		}
-		int nodeIdx = rand.nextInt(nodes.size());
-		return nodes.get(nodeIdx).getName();
-	}
-
-}
-
Index: DCWoRMS/branches/coolemall/src/example/localplugin/coolemall/recs/RECS_Consolidation_SP.java
===================================================================
--- DCWoRMS/branches/coolemall/src/example/localplugin/coolemall/recs/RECS_Consolidation_SP.java	(revision 883)
+++ 	(revision )
@@ -1,193 +1,0 @@
-package example.localplugin.coolemall.recs;
-
-import example.localplugin.BaseLocalSchedulingPlugin;
-import gridsim.dcworms.DCWormsTags;
-
-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.exceptions.ResourceException;
-import schedframe.resources.ResourceStatus;
-import schedframe.resources.UserResourceType;
-import schedframe.resources.computing.ComputingNode;
-import schedframe.resources.computing.ComputingResource;
-import schedframe.resources.computing.Core;
-import schedframe.resources.computing.Processor;
-import schedframe.resources.computing.profiles.energy.power.StandardPowerStateName;
-import schedframe.resources.computing.recs.Node;
-import schedframe.resources.units.Memory;
-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.grid.ModuleList;
-import schedframe.scheduling.queue.TaskQueue;
-import schedframe.scheduling.queue.TaskQueueList;
-import schedframe.scheduling.tasks.TaskInterface;
-
-public class RECS_Consolidation_SP extends BaseLocalSchedulingPlugin {
-
-	public RECS_Consolidation_SP () {
-	}
-
-	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:
-			// our tasks are placed only in first queue (see
-			// BaseLocalSchedulingPlugin.placeJobsInQueues() method)
-			TaskQueue q = queues.get(0);
-			// check all tasks in queue
-			List<Node> nodes;
-			try {
-				nodes = (List<Node>) resourceManager.getResourcesOfType(new UserResourceType("Node"));
-			} catch (ResourceException e) {
-				break;
-			}
-			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 = null;
-					try {
-						choosenResources = chooseResourcesForExecution(nodes, task);
-					} catch (NoSuchFieldException e) {
-						// TODO Auto-generated catch block
-						e.printStackTrace();
-					}
-					if (choosenResources  != null) {
-						addToSchedulingPlan(plan, task, choosenResources);
-					} 
-				}
-			}
-			turnOffIdleNodes(nodes);
-
-			break;
-		}
-		return plan;
-	}
-	
-	private Map<ResourceUnitName, ResourceUnit> chooseResourcesForExecution(List<Node> nodes, TaskInterface<?> task) throws NoSuchFieldException {
-
-		nodes = findSuitableNodes(task, nodes);
-		Collections.sort(nodes, new Comparator<Node>(){
-		    public int compare(Node node1, Node node2){   
-		    	int freeCores1 = 0, freeCores2 = 0;
-		    	int freeCpus1 = 0, freeCpus2 = 0;
-		    	
-		    	List<Processor> processors1 = node1.getProcessors();
-		    	for(Processor processor: processors1){
-		    		freeCores1 = freeCores1 + processor.getFreeCores().size();
-		    	}
-		    	
-		    	List<Processor> processors2 = node2.getProcessors();
-		    	for(Processor processor: processors2){
-		    		freeCores2 = freeCores2 + processor.getFreeCores().size();
-		    	}
-		    	
-		    	if(freeCores1 == 0 && freeCores2 == 0){
-		    		freeCpus1 = node1.getFreeProcessorsNumber();
-		    		freeCpus2 = node2.getFreeProcessorsNumber();
-		    		
-		    		if(freeCpus1 > freeCpus2) {
-		    			return -1;
-		    		} else if(freeCpus1 < freeCpus2) {
-		    			return 1;
-		    		} else {
-		    			return 0;
-		    		}
-		    	} else {
-		    		if(freeCores1 > freeCores2) {
-		    			return -1;
-		    		} else if(freeCores1 < freeCores2) {
-		    			return 1;
-		    		} else {
-		    			return 0;
-		    		}
-		    	}
-		    }
-		});
-		if(nodes.size() > 0)
-		{
-			Node node = nodes.get(0);
-			Map<ResourceUnitName, ResourceUnit> map = new HashMap<ResourceUnitName, ResourceUnit>();
-			List<ComputingResource> choosenResources =  new ArrayList<ComputingResource>();
-			int cpuRequest;
-			try {
-				cpuRequest = Double.valueOf(task.getCpuCntRequest()).intValue();
-			} catch (NoSuchFieldException e) {
-				cpuRequest = 0;
-			}
-			for (int i = 0; i < node.getProcessors().size() && cpuRequest > 0; i++) {
-				if (node.getProcessors().get(i).getStatus() == ResourceStatus.FREE) {
-					choosenResources.add(node.getProcessors().get(i));
-					cpuRequest--;
-				}
-			}
-			ProcessingElements result = new ProcessingElements(node.getName());
-			result.addAll(choosenResources);
-			map.put(StandardResourceUnitName.PE, result);
-			
-			int memoryRequest;
-			try {
-				memoryRequest = Double.valueOf(task.getMemoryRequest()).intValue();
-			} catch (NoSuchFieldException e) {
-				memoryRequest = 0;
-			}
-			if (memoryRequest != 0) {
-				Memory memory = new Memory(node.getMemory(), memoryRequest, memoryRequest);
-				map.put(StandardResourceUnitName.MEMORY, memory);
-			}
-			return map;
-		} else 
-			return null;
-	}
-	
-	private List<Node> findSuitableNodes(TaskInterface<?> task, List<Node> nodes) throws NoSuchFieldException{
-		int cpuRequest;
-		try {
-			cpuRequest = Double.valueOf(task.getCpuCntRequest()).intValue();
-		} catch (NoSuchFieldException e) {
-			cpuRequest = 1;
-		}
-		int memoryRequest;
-		try {
-			memoryRequest = Double.valueOf(task.getMemoryRequest()).intValue();
-		} catch (NoSuchFieldException e) {
-			memoryRequest = 0;
-		}
-		List<Node> suitableNodes = new ArrayList<Node>();
-		for(Node node: nodes){
-			if(node.getFreeProcessorsNumber() >= cpuRequest && node.getFreeMemory() >= memoryRequest){
-				suitableNodes.add(node);
-			}
-		}
-		return suitableNodes;
-	}
-
-	private void turnOffIdleNodes(List<Node> nodes){
-		for(Node node : nodes){
-			JobRegistry jr = new JobRegistryImpl(node.getName());
-			if(jr.getRunningTasks().size() == 0)
-				node.getPowerInterface().setPowerState(StandardPowerStateName.OFF);
-		}
-	}
-}
Index: DCWoRMS/branches/coolemall/src/example/localplugin/coolemall/recs/RECS_LB_SP.java
===================================================================
--- DCWoRMS/branches/coolemall/src/example/localplugin/coolemall/recs/RECS_LB_SP.java	(revision 851)
+++ 	(revision )
@@ -1,90 +1,0 @@
-package example.localplugin.coolemall.recs;
-
-import java.util.List;
-
-import schedframe.events.scheduling.SchedulingEvent;
-import schedframe.exceptions.ResourceException;
-import schedframe.resources.UserResourceType;
-import schedframe.resources.computing.ComputingResource;
-import schedframe.resources.computing.recs.Node;
-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.grid.ModuleList;
-import schedframe.scheduling.queue.TaskQueue;
-import schedframe.scheduling.queue.TaskQueueList;
-import schedframe.scheduling.tasks.TaskInterface;
-import example.localplugin.BaseLocalSchedulingPlugin;
-import gridsim.dcworms.DCWormsTags;
-
-public class RECS_LB_SP extends BaseLocalSchedulingPlugin {
-
-	public RECS_LB_SP () {
-	}
-
-	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);
-			
-			// 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) {
-
-					String nodeName = chooseProvider(resourceManager);
-					if (nodeName != null) {
-						addToSchedulingPlan(plan, task, nodeName);
-					}
-				}
-			}
-			break;
-		}
-		return plan;
-	}
-
-	@SuppressWarnings("unchecked")
-	private String chooseProvider(ClusterResourceManager resourceManager) {
-		List<ComputingResource> nodes = null;
-		try {
-			nodes = (List<ComputingResource>) resourceManager.getResourcesOfType(new UserResourceType("Node"));
-		} catch (ResourceException e) {
-			// TODO Auto-generated catch block
-			e.printStackTrace();
-		}
-		int nodeIdx = findLeastLoadedResourceIdx(nodes);
-		return nodes.get(nodeIdx).getName();
-	}
-	
-	private int findLeastLoadedResourceIdx(List<ComputingResource> nodes ){
-		int resourceIdx = -1;
-		int minLoad = Integer.MAX_VALUE;
-		
-		for(int i = 0; i < nodes.size(); i++){
-			Node node = (Node) nodes.get(i);
-			JobRegistry jr = new JobRegistryImpl(node.getName());
-			int totalLoad = jr.getRunningTasks().size(); 
-			if(totalLoad < minLoad){
-				resourceIdx = i;
-				minLoad = totalLoad;
-			}
-		}
-		return resourceIdx;
-	}
-
-}
-
