Index: /DCWoRMS/trunk/src/example/localplugin/FCFSBF_ConsolidationClusterPlugin.java
===================================================================
--- /DCWoRMS/trunk/src/example/localplugin/FCFSBF_ConsolidationClusterPlugin.java	(revision 525)
+++ /DCWoRMS/trunk/src/example/localplugin/FCFSBF_ConsolidationClusterPlugin.java	(revision 525)
@@ -0,0 +1,141 @@
+package example.localplugin;
+
+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.resources.ResourceStatus;
+import schedframe.resources.computing.ComputingNode;
+import schedframe.resources.computing.ComputingResource;
+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.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 FCFSBF_ConsolidationClusterPlugin extends BaseLocalSchedulingPlugin {
+
+	public FCFSBF_ConsolidationClusterPlugin () {
+	}
+
+	public SchedulingPlanInterface<?> schedule(SchedulingEvent event, TaskQueueList queues, JobRegistry jobRegistry,
+			ResourceManager resManager, ModuleList modules) {
+
+		ClusterResourceManager resourceManager = (ClusterResourceManager) resManager;
+		SchedulingPlan plan = new SchedulingPlan();
+		// chose 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
+			// BaseLocalPlugin.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) {
+
+					Map<ResourceUnitName, ResourceUnit> choosenResources = null;
+					try {
+						choosenResources = chooseResourcesForExecution(resourceManager, task);
+					} catch (NoSuchFieldException e) {
+						// TODO Auto-generated catch block
+						e.printStackTrace();
+					}
+					if (choosenResources  != null) {
+						addToSchedulingPlan(plan, task, choosenResources);
+					} 
+				}
+			}
+
+			break;
+		}
+		return plan;
+	}
+	
+	private Map<ResourceUnitName, ResourceUnit> chooseResourcesForExecution(ClusterResourceManager resourceManager, TaskInterface<?> task) throws NoSuchFieldException {
+
+		List<ComputingNode> nodes = resourceManager.getComputingNodes();
+		nodes = findSuitableNodes(task, nodes);
+		Collections.sort(nodes, new Comparator<ComputingNode>(){
+		    public int compare(ComputingNode node1, ComputingNode node2){   
+		        return node1.getResourceCharacteristic().getParameters().get("category").get(0).getContent().compareTo(node2.getResourceCharacteristic().getParameters().get("category").get(0).getContent());
+		    }
+		});
+		if(nodes.size() > 0)
+		{
+			ComputingNode 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 = 1;
+			}
+			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<ComputingNode> findSuitableNodes(TaskInterface<?> task, List<ComputingNode> 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<ComputingNode> suitableNodes = new ArrayList<ComputingNode>();
+		for(ComputingNode node: nodes){
+			if(node.getFreeProcessorsNumber() >= cpuRequest && node.getFreeMemory() >= memoryRequest){
+				suitableNodes.add(node);
+			}
+		}
+		return suitableNodes;
+	}
+
+}
Index: /DCWoRMS/trunk/src/example/localplugin/FCFSBF_LocalPlugin.java
===================================================================
--- /DCWoRMS/trunk/src/example/localplugin/FCFSBF_LocalPlugin.java	(revision 525)
+++ /DCWoRMS/trunk/src/example/localplugin/FCFSBF_LocalPlugin.java	(revision 525)
@@ -0,0 +1,42 @@
+package example.localplugin;
+
+import gridsim.dcworms.DCWormsTags;
+import schedframe.events.scheduling.SchedulingEvent;
+import schedframe.scheduling.manager.resources.ResourceManager;
+import schedframe.scheduling.manager.tasks.JobRegistry;
+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 FCFSBF_LocalPlugin extends BaseLocalSchedulingPlugin {
+
+	public SchedulingPlan schedule(SchedulingEvent event, TaskQueueList queues, JobRegistry jobRegistry,
+			 ResourceManager resManager, ModuleList modules) {
+
+		SchedulingPlan plan = new SchedulingPlan();
+		// Chose 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 BaseLocalPlugin.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) {
+					addToSchedulingPlan(plan, task);
+				}
+			}
+			break;
+		}
+		return plan;
+	}
+
+}
+
Index: /DCWoRMS/trunk/src/example/localplugin/FCFSBF_DFSClusterPlugin.java
===================================================================
--- /DCWoRMS/trunk/src/example/localplugin/FCFSBF_DFSClusterPlugin.java	(revision 525)
+++ /DCWoRMS/trunk/src/example/localplugin/FCFSBF_DFSClusterPlugin.java	(revision 525)
@@ -0,0 +1,125 @@
+package example.localplugin;
+
+import gridsim.dcworms.DCWormsTags;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import schedframe.events.scheduling.SchedulingEvent;
+import schedframe.resources.ResourceStatus;
+import schedframe.resources.computing.ComputingResource;
+import schedframe.resources.computing.Processor;
+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.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 FCFSBF_DFSClusterPlugin extends BaseLocalSchedulingPlugin {
+
+	List<Processor> allocatedCPUs;
+	public FCFSBF_DFSClusterPlugin () {
+		allocatedCPUs = new ArrayList<Processor>();
+	}
+
+	public SchedulingPlanInterface<?> schedule(SchedulingEvent event, TaskQueueList queues, JobRegistry jobRegistry,
+			ResourceManager resManager, ModuleList modules) {
+
+		ClusterResourceManager resourceManager = (ClusterResourceManager) resManager;
+		SchedulingPlan plan = new SchedulingPlan();
+		// our tasks are placed only in first queue (see
+		// BaseLocalPlugin.placeJobsInQueues() method)
+		TaskQueue q = queues.get(0);
+		// chose the events types to serve.
+		// Different actions for different events are possible.
+		switch (event.getType()) {
+		
+		case START_TASK_EXECUTION:
+		case TASK_FINISHED:
+			// 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);
+					} 
+				}
+			}
+			adjustFrequency(resourceManager.getProcessors());
+		}
+		return plan;
+	}
+	
+	private Map<ResourceUnitName, ResourceUnit> chooseResourcesForExecution(
+			ClusterResourceManager resourceManager, TaskInterface<?> task) {
+
+		Map<ResourceUnitName, ResourceUnit> map = new HashMap<ResourceUnitName, ResourceUnit>();
+
+		int cpuRequest;
+		try {
+			cpuRequest = Double.valueOf(task.getCpuCntRequest()).intValue();
+		} catch (NoSuchFieldException e) {
+			cpuRequest = 1;
+		}
+
+		if (cpuRequest != 0) {
+			List<ComputingResource> choosenResources = null;
+			List<Processor> processors = resourceManager.getProcessors();
+			processors.removeAll(allocatedCPUs);
+			if (processors.size() < cpuRequest) {
+				// log.warn("Task requires more cpus than is availiable in this resource.");
+				return null;
+			}
+
+			choosenResources = new ArrayList<ComputingResource>();
+
+			for (int i = 0; i < processors.size() && cpuRequest > 0; i++) {
+				if (processors.get(i).getStatus() == ResourceStatus.FREE) {
+					choosenResources.add(processors.get(i));
+					cpuRequest--;
+				}
+			}
+			if (cpuRequest > 0) {
+				// log.info("Task " + task.getJobId() + "_" + task.getId() +
+				// " requires more cpus than is availiable in this moment.");
+				return null;
+			}
+
+			ProcessingElements result = new ProcessingElements();
+			result.addAll(choosenResources);
+			map.put(StandardResourceUnitName.PE, result);
+		}
+		return map;
+	}
+	
+	private void adjustFrequency(List<Processor> processors){
+
+		for(Processor cpu: processors){
+			if(cpu.getStatus() == ResourceStatus.FREE) {
+				if(cpu.getPowerInterface().getSupportedPStates().containsKey("P3"))
+					cpu.getPowerInterface().setPState("P3");
+			}
+			else{
+				if(cpu.getPowerInterface().getSupportedPStates().containsKey("P0"))
+					cpu.getPowerInterface().setPState("P0");
+			}
+
+		}
+
+	}
+
+
+}
Index: /DCWoRMS/trunk/src/example/localplugin/FCFSBF_RackPlugin.java
===================================================================
--- /DCWoRMS/trunk/src/example/localplugin/FCFSBF_RackPlugin.java	(revision 525)
+++ /DCWoRMS/trunk/src/example/localplugin/FCFSBF_RackPlugin.java	(revision 525)
@@ -0,0 +1,54 @@
+package example.localplugin;
+
+import gridsim.dcworms.DCWormsTags;
+import schedframe.events.scheduling.SchedulingEvent;
+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;
+
+public class FCFSBF_RackPlugin  extends BaseLocalSchedulingPlugin {
+
+	public FCFSBF_RackPlugin() {
+	}
+
+	public SchedulingPlanInterface<?> schedule(SchedulingEvent event, TaskQueueList queues, JobRegistry jobRegistry,
+			ResourceManager resManager, ModuleList modules) {
+
+		ClusterResourceManager resourceManager = (ClusterResourceManager) resManager;
+		SchedulingPlan plan = new SchedulingPlan();
+		// chose 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
+			// BaseLocalPlugin.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) {
+					System.out.println(resourceManager.getSchedulers().get(0).get_name());
+					String nodeName = resourceManager.getSchedulers().get(0).get_name();
+					if (nodeName != null) {
+						addToSchedulingPlan(plan, task, nodeName);
+					}
+				}
+			}
+
+			break;
+		}
+		return plan;
+	}
+
+
+}
Index: /DCWoRMS/trunk/src/example/localplugin/FCFSBF_ClusterPlugin.java
===================================================================
--- /DCWoRMS/trunk/src/example/localplugin/FCFSBF_ClusterPlugin.java	(revision 525)
+++ /DCWoRMS/trunk/src/example/localplugin/FCFSBF_ClusterPlugin.java	(revision 525)
@@ -0,0 +1,153 @@
+package example.localplugin;
+
+import gridsim.dcworms.DCWormsTags;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+
+import schedframe.events.scheduling.SchedulingEvent;
+import schedframe.resources.ResourceStatus;
+import schedframe.resources.StandardResourceType;
+import schedframe.resources.computing.ComputingNode;
+import schedframe.resources.computing.ComputingResource;
+import schedframe.resources.computing.Processor;
+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.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 FCFSBF_ClusterPlugin extends BaseLocalSchedulingPlugin {
+
+	public SchedulingPlanInterface<?> schedule(SchedulingEvent event, TaskQueueList queues, JobRegistry jobRegistry,
+			ResourceManager resManager, ModuleList modules) {
+
+		ClusterResourceManager resourceManager = (ClusterResourceManager) resManager;
+		SchedulingPlan plan = new SchedulingPlan();
+		// chose 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 BaseLocalPlugin.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) {
+					
+					/****************3 ways to schedule task****************/
+					
+					/****************1. Choosing particular resources to perform execution****************/
+					Map<ResourceUnitName, ResourceUnit> choosenResources = chooseResourcesForExecution(resourceManager, task);
+					if (choosenResources != null) {
+						addToSchedulingPlan(plan, task, choosenResources);
+					}
+					
+					/****************2. Choosing resource scheduler/provider to submit task.  If the given resource doesn't contains/isn't 
+					a scheduler, random resources from the given resource will be chosen in order to perform execution****************/
+					/*String provName = chooseProviderForExecution(resourceManager);
+					if (provName != null) {
+						addToSchedulingPlan(plan, task, provName);
+					}*/
+
+					/****************3. Scheduler will choose random resources to perform execution****************/
+					//addToSchedulingPlan(plan, task);
+				}
+			}
+
+			break;
+		}
+		return plan;
+	}
+
+	private Map<ResourceUnitName, ResourceUnit> chooseResourcesForExecution(
+			ClusterResourceManager resourceManager, TaskInterface<?> task) {
+
+		Map<ResourceUnitName, ResourceUnit> map = new HashMap<ResourceUnitName, ResourceUnit>();
+		List<ComputingNode> nodes = resourceManager.getComputingNodes();
+		for (ComputingNode node : nodes) {
+			int cpuRequest;
+			try {
+				cpuRequest = Double.valueOf(task.getCpuCntRequest()).intValue();
+			} catch (NoSuchFieldException e) {
+				cpuRequest = 1;
+			}
+
+			if (cpuRequest != 0) {
+
+				List<Processor> processors = node.getProcessors();
+				if (processors.size() < cpuRequest) {
+					continue;
+				}
+
+				List<ComputingResource> choosenResources = new ArrayList<ComputingResource>();				
+				for (int i = 0; i < processors.size() && cpuRequest > 0; i++) {
+					if (processors.get(i).getStatus() == ResourceStatus.FREE) {
+						choosenResources.add(processors.get(i));
+						cpuRequest--;
+					}
+				}
+				if (cpuRequest > 0) {
+					continue;
+				}
+
+				ProcessingElements result = new ProcessingElements();
+				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 = null;
+					try{
+						if (node.getFreeMemory() >= memoryRequest) {		
+							memory = new Memory(node.getMemory(), memoryRequest, memoryRequest);
+						}		
+					} catch(NoSuchFieldException e){
+						continue;
+					}
+					if(memory == null)
+						continue;
+					else {
+						map.put(StandardResourceUnitName.MEMORY, memory);
+						return map;
+					}
+				} else return map;
+			}
+		}
+	
+		return null;
+	}
+
+	@SuppressWarnings("unchecked")
+	private String chooseProviderForExecution(ResourceManager unitsManager) {
+		List<ComputingResource> processingElements;
+		Properties properties = new Properties();
+		properties.setProperty("type", StandardResourceType.ComputingNode.toString());
+		// properties.setProperty("status", ResourceStatus.FREE.toString());
+		processingElements = (List<ComputingResource>) unitsManager.filterResources(properties);
+		return processingElements.get(0).getName();
+	}
+
+}
Index: /DCWoRMS/trunk/src/example/localplugin/FCFSBF_NodePowerManagementClusterPlugin.java
===================================================================
--- /DCWoRMS/trunk/src/example/localplugin/FCFSBF_NodePowerManagementClusterPlugin.java	(revision 525)
+++ /DCWoRMS/trunk/src/example/localplugin/FCFSBF_NodePowerManagementClusterPlugin.java	(revision 525)
@@ -0,0 +1,146 @@
+package example.localplugin;
+
+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.resources.ResourceStatus;
+import schedframe.resources.computing.ComputingNode;
+import schedframe.resources.computing.ComputingResource;
+import schedframe.resources.computing.profiles.energy.power.StandardPowerStateName;
+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.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 FCFSBF_NodePowerManagementClusterPlugin extends BaseLocalSchedulingPlugin {
+
+	public FCFSBF_NodePowerManagementClusterPlugin () {
+	}
+
+	public SchedulingPlanInterface<?> schedule(SchedulingEvent event, TaskQueueList queues, JobRegistry jobRegistry,
+			ResourceManager resManager, ModuleList modules) {
+
+		ClusterResourceManager resourceManager = (ClusterResourceManager) resManager;
+		SchedulingPlan plan = new SchedulingPlan();
+
+		switch (event.getType()) {
+		case START_TASK_EXECUTION:
+		case TASK_FINISHED:
+
+			TaskQueue q = queues.get(0);
+
+			for (int i = 0; i < q.size(); i++) {
+				TaskInterface<?> task = q.get(i);
+				if (task.getStatus() == DCWormsTags.READY) {
+
+					Map<ResourceUnitName, ResourceUnit> choosenResources = chooseResourcesForExecution(resourceManager, task);
+					if (choosenResources  != null) {
+						addToSchedulingPlan(plan, task, choosenResources);
+					} else {
+						if(harnessIdleNodesToWork(task, resourceManager.getComputingNodes()))
+							i--;
+					}
+				}
+			}
+			turnOffIdleNodes(resourceManager.getComputingNodes());
+			break;
+		}
+		return plan;
+	}
+	
+	private Map<ResourceUnitName, ResourceUnit> chooseResourcesForExecution(ClusterResourceManager resourceManager, TaskInterface<?> task) {
+
+		List<ComputingNode> nodes = resourceManager.getComputingNodes();
+		nodes = findSuitableNodes(task, nodes);
+		Collections.sort(nodes, new Comparator<ComputingNode>(){
+		    public int compare(ComputingNode node1, ComputingNode node2){    
+		        return node1.getResourceCharacteristic().getParameters().get("category").get(0).getContent().compareTo(node2.getResourceCharacteristic().getParameters().get("category").get(0).getContent());
+		    }
+		});
+		if(nodes.size() > 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 = 1;
+			}
+			for (int i = 0; i < nodes.get(0).getProcessors().size() && cpuRequest > 0; i++) {
+				if (nodes.get(0).getProcessors().get(i).getStatus() == ResourceStatus.FREE) {
+					choosenResources.add(nodes.get(0).getProcessors().get(i));
+					cpuRequest--;
+				}
+			}
+			ProcessingElements result = new ProcessingElements(nodes.get(0).getName());
+			result.addAll(choosenResources);
+			map.put(StandardResourceUnitName.PE, result);
+			return map;
+		} else 
+			return null;
+	}
+	
+	private List<ComputingNode> findSuitableNodes(TaskInterface<?> task, List<ComputingNode> nodes){
+		int cpuRequest;
+		try {
+			cpuRequest = Double.valueOf(task.getCpuCntRequest()).intValue();
+		} catch (NoSuchFieldException e) {
+			cpuRequest = 1;
+		}
+		List<ComputingNode> avNodes = new ArrayList<ComputingNode>();
+		for(ComputingNode node: nodes){
+			if(node.getFreeProcessorsNumber() >= cpuRequest){
+				avNodes.add(node);
+			}
+		}
+		return avNodes;
+	}
+
+	private void turnOffIdleNodes(List<ComputingNode> nodes){
+		for(ComputingNode node : nodes){
+			if(node.getFreeProcessorsNumber() == node.getProcessorsNumber()){
+				node.getPowerInterface().setPowerState(StandardPowerStateName.OFF);
+			}
+		}
+	}
+	
+	private boolean harnessIdleNodesToWork(TaskInterface<?> task, List<ComputingNode> nodes){
+		int cpuRequest;
+		try {
+			cpuRequest = Double.valueOf(task.getCpuCntRequest()).intValue();
+		} catch (NoSuchFieldException e) {
+			cpuRequest = 1;
+		}
+		Collections.sort(nodes, new Comparator<ComputingNode>(){
+		    public int compare(ComputingNode node1, ComputingNode node2){    
+		        return node1.getResourceCharacteristic().getParameters().get("category").get(0).getContent().compareTo(node2.getResourceCharacteristic().getParameters().get("category").get(0).getContent());
+		    }
+		});
+		for (int i = 0; i < nodes.size() && cpuRequest > 0; i++) {
+			ComputingNode node = nodes.get(i);
+			if(node.getPowerInterface().getPowerState() == StandardPowerStateName.OFF){
+				node.getPowerInterface().setPowerState(StandardPowerStateName.ON);
+				cpuRequest -= node.getProcessorsNumber();
+			}
+		}
+		return cpuRequest > 0 ? false : true;
+	}
+
+}
Index: /DCWoRMS/trunk/src/example/localplugin/FCFSBF_RandomClusterPlugin.java
===================================================================
--- /DCWoRMS/trunk/src/example/localplugin/FCFSBF_RandomClusterPlugin.java	(revision 525)
+++ /DCWoRMS/trunk/src/example/localplugin/FCFSBF_RandomClusterPlugin.java	(revision 525)
@@ -0,0 +1,67 @@
+package example.localplugin;
+
+import gridsim.dcworms.DCWormsTags;
+
+import java.util.List;
+import java.util.Random;
+
+import schedframe.events.scheduling.SchedulingEvent;
+import schedframe.resources.computing.ComputingNode;
+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;
+
+public class FCFSBF_RandomClusterPlugin extends BaseLocalSchedulingPlugin {
+
+	private Random rand;
+	
+	public FCFSBF_RandomClusterPlugin() {
+		rand = new Random(5);
+	}
+
+	public SchedulingPlanInterface<?> schedule(SchedulingEvent event, TaskQueueList queues, JobRegistry jobRegistry,
+			 ResourceManager resManager, ModuleList modules) {
+
+		ClusterResourceManager resourceManager = (ClusterResourceManager) resManager;
+		SchedulingPlan plan = new SchedulingPlan();
+		// chose 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
+			// BaseLocalPlugin.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;
+	}
+
+	private String chooseRandomProvider(ClusterResourceManager resourceManager) {
+		List<ComputingNode> nodes = resourceManager.getComputingNodes();
+		int nodeIdx = rand.nextInt(nodes.size());
+		return nodes.get(nodeIdx).getName();
+	}
+
+}
+
Index: WoRMS/trunk/src/example/localplugin/FCFSRackLocalPlugin.java
===================================================================
--- /DCWoRMS/trunk/src/example/localplugin/FCFSRackLocalPlugin.java	(revision 514)
+++ 	(revision )
@@ -1,54 +1,0 @@
-package example.localplugin;
-
-import gridsim.dcworms.DCWormsTags;
-import schedframe.events.scheduling.SchedulingEvent;
-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;
-
-public class FCFSRackLocalPlugin  extends BaseLocalSchedulingPlugin {
-
-	public FCFSRackLocalPlugin() {
-	}
-
-	public SchedulingPlanInterface<?> schedule(SchedulingEvent event, TaskQueueList queues, JobRegistry jobRegistry,
-			ResourceManager resManager, ModuleList modules) {
-
-		ClusterResourceManager resourceManager = (ClusterResourceManager) resManager;
-		SchedulingPlan plan = new SchedulingPlan();
-		// chose 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
-			// BaseLocalPlugin.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) {
-					System.out.println(resourceManager.getSchedulers().get(0).get_name());
-					String nodeName = resourceManager.getSchedulers().get(0).get_name();
-					if (nodeName != null) {
-						addToSchedulingPlan(plan, task, nodeName);
-					}
-				}
-			}
-
-			break;
-		}
-		return plan;
-	}
-
-
-}
Index: WoRMS/trunk/src/example/localplugin/FCFSClusterLocalPlugin.java
===================================================================
--- /DCWoRMS/trunk/src/example/localplugin/FCFSClusterLocalPlugin.java	(revision 514)
+++ 	(revision )
@@ -1,153 +1,0 @@
-package example.localplugin;
-
-import gridsim.dcworms.DCWormsTags;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-
-import schedframe.events.scheduling.SchedulingEvent;
-import schedframe.resources.ResourceStatus;
-import schedframe.resources.StandardResourceType;
-import schedframe.resources.computing.ComputingNode;
-import schedframe.resources.computing.ComputingResource;
-import schedframe.resources.computing.Processor;
-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.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 FCFSClusterLocalPlugin extends BaseLocalSchedulingPlugin {
-
-	public SchedulingPlanInterface<?> schedule(SchedulingEvent event, TaskQueueList queues, JobRegistry jobRegistry,
-			ResourceManager resManager, ModuleList modules) {
-
-		ClusterResourceManager resourceManager = (ClusterResourceManager) resManager;
-		SchedulingPlan plan = new SchedulingPlan();
-		// chose 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 BaseLocalPlugin.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) {
-					
-					/****************3 ways to schedule task****************/
-					
-					/****************1. Choosing particular resources to perform execution****************/
-					Map<ResourceUnitName, ResourceUnit> choosenResources = chooseResourcesForExecution(resourceManager, task);
-					if (choosenResources != null) {
-						addToSchedulingPlan(plan, task, choosenResources);
-					}
-					
-					/****************2. Choosing resource scheduler/provider to submit task.  If the given resource doesn't contains/isn't 
-					a scheduler, random resources from the given resource will be chosen in order to perform execution****************/
-					/*String provName = chooseProviderForExecution(resourceManager);
-					if (provName != null) {
-						addToSchedulingPlan(plan, task, provName);
-					}*/
-
-					/****************3. Scheduler will choose random resources to perform execution****************/
-					//addToSchedulingPlan(plan, task);
-				}
-			}
-
-			break;
-		}
-		return plan;
-	}
-
-	private Map<ResourceUnitName, ResourceUnit> chooseResourcesForExecution(
-			ClusterResourceManager resourceManager, TaskInterface<?> task) {
-
-		Map<ResourceUnitName, ResourceUnit> map = new HashMap<ResourceUnitName, ResourceUnit>();
-		List<ComputingNode> nodes = resourceManager.getComputingNodes();
-		for (ComputingNode node : nodes) {
-			int cpuRequest;
-			try {
-				cpuRequest = Double.valueOf(task.getCpuCntRequest()).intValue();
-			} catch (NoSuchFieldException e) {
-				cpuRequest = 1;
-			}
-
-			if (cpuRequest != 0) {
-
-				List<Processor> processors = node.getProcessors();
-				if (processors.size() < cpuRequest) {
-					continue;
-				}
-
-				List<ComputingResource> choosenResources = new ArrayList<ComputingResource>();				
-				for (int i = 0; i < processors.size() && cpuRequest > 0; i++) {
-					if (processors.get(i).getStatus() == ResourceStatus.FREE) {
-						choosenResources.add(processors.get(i));
-						cpuRequest--;
-					}
-				}
-				if (cpuRequest > 0) {
-					continue;
-				}
-
-				ProcessingElements result = new ProcessingElements();
-				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 = null;
-					try{
-						if (node.getFreeMemory() >= memoryRequest) {		
-							memory = new Memory(node.getMemory(), memoryRequest, memoryRequest);
-						}		
-					} catch(NoSuchFieldException e){
-						continue;
-					}
-					if(memory == null)
-						continue;
-					else {
-						map.put(StandardResourceUnitName.MEMORY, memory);
-						return map;
-					}
-				} else return map;
-			}
-		}
-	
-		return null;
-	}
-
-	@SuppressWarnings("unchecked")
-	private String chooseProviderForExecution(ResourceManager unitsManager) {
-		List<ComputingResource> processingElements;
-		Properties properties = new Properties();
-		properties.setProperty("type", StandardResourceType.ComputingNode.toString());
-		// properties.setProperty("status", ResourceStatus.FREE.toString());
-		processingElements = (List<ComputingResource>) unitsManager.filterResources(properties);
-		return processingElements.get(0).getName();
-	}
-
-}
Index: WoRMS/trunk/src/example/localplugin/FCFSNodePowerManagementClusterLocalPlugin.java
===================================================================
--- /DCWoRMS/trunk/src/example/localplugin/FCFSNodePowerManagementClusterLocalPlugin.java	(revision 514)
+++ 	(revision )
@@ -1,146 +1,0 @@
-package example.localplugin;
-
-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.resources.ResourceStatus;
-import schedframe.resources.computing.ComputingNode;
-import schedframe.resources.computing.ComputingResource;
-import schedframe.resources.computing.profiles.energy.power.StandardPowerStateName;
-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.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 FCFSNodePowerManagementClusterLocalPlugin extends BaseLocalSchedulingPlugin {
-
-	public FCFSNodePowerManagementClusterLocalPlugin () {
-	}
-
-	public SchedulingPlanInterface<?> schedule(SchedulingEvent event, TaskQueueList queues, JobRegistry jobRegistry,
-			ResourceManager resManager, ModuleList modules) {
-
-		ClusterResourceManager resourceManager = (ClusterResourceManager) resManager;
-		SchedulingPlan plan = new SchedulingPlan();
-
-		switch (event.getType()) {
-		case START_TASK_EXECUTION:
-		case TASK_FINISHED:
-
-			TaskQueue q = queues.get(0);
-
-			for (int i = 0; i < q.size(); i++) {
-				TaskInterface<?> task = q.get(i);
-				if (task.getStatus() == DCWormsTags.READY) {
-
-					Map<ResourceUnitName, ResourceUnit> choosenResources = chooseResourcesForExecution(resourceManager, task);
-					if (choosenResources  != null) {
-						addToSchedulingPlan(plan, task, choosenResources);
-					} else {
-						if(harnessIdleNodesToWork(task, resourceManager.getComputingNodes()))
-							i--;
-					}
-				}
-			}
-			turnOffIdleNodes(resourceManager.getComputingNodes());
-			break;
-		}
-		return plan;
-	}
-	
-	private Map<ResourceUnitName, ResourceUnit> chooseResourcesForExecution(ClusterResourceManager resourceManager, TaskInterface<?> task) {
-
-		List<ComputingNode> nodes = resourceManager.getComputingNodes();
-		nodes = findSuitableNodes(task, nodes);
-		Collections.sort(nodes, new Comparator<ComputingNode>(){
-		    public int compare(ComputingNode node1, ComputingNode node2){    
-		        return node1.getResourceCharacteristic().getParameters().get("category").get(0).getContent().compareTo(node2.getResourceCharacteristic().getParameters().get("category").get(0).getContent());
-		    }
-		});
-		if(nodes.size() > 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 = 1;
-			}
-			for (int i = 0; i < nodes.get(0).getProcessors().size() && cpuRequest > 0; i++) {
-				if (nodes.get(0).getProcessors().get(i).getStatus() == ResourceStatus.FREE) {
-					choosenResources.add(nodes.get(0).getProcessors().get(i));
-					cpuRequest--;
-				}
-			}
-			ProcessingElements result = new ProcessingElements(nodes.get(0).getName());
-			result.addAll(choosenResources);
-			map.put(StandardResourceUnitName.PE, result);
-			return map;
-		} else 
-			return null;
-	}
-	
-	private List<ComputingNode> findSuitableNodes(TaskInterface<?> task, List<ComputingNode> nodes){
-		int cpuRequest;
-		try {
-			cpuRequest = Double.valueOf(task.getCpuCntRequest()).intValue();
-		} catch (NoSuchFieldException e) {
-			cpuRequest = 1;
-		}
-		List<ComputingNode> avNodes = new ArrayList<ComputingNode>();
-		for(ComputingNode node: nodes){
-			if(node.getFreeProcessorsNumber() >= cpuRequest){
-				avNodes.add(node);
-			}
-		}
-		return avNodes;
-	}
-
-	private void turnOffIdleNodes(List<ComputingNode> nodes){
-		for(ComputingNode node : nodes){
-			if(node.getFreeProcessorsNumber() == node.getProcessorsNumber()){
-				node.getPowerInterface().setPowerState(StandardPowerStateName.OFF);
-			}
-		}
-	}
-	
-	private boolean harnessIdleNodesToWork(TaskInterface<?> task, List<ComputingNode> nodes){
-		int cpuRequest;
-		try {
-			cpuRequest = Double.valueOf(task.getCpuCntRequest()).intValue();
-		} catch (NoSuchFieldException e) {
-			cpuRequest = 1;
-		}
-		Collections.sort(nodes, new Comparator<ComputingNode>(){
-		    public int compare(ComputingNode node1, ComputingNode node2){    
-		        return node1.getResourceCharacteristic().getParameters().get("category").get(0).getContent().compareTo(node2.getResourceCharacteristic().getParameters().get("category").get(0).getContent());
-		    }
-		});
-		for (int i = 0; i < nodes.size() && cpuRequest > 0; i++) {
-			ComputingNode node = nodes.get(i);
-			if(node.getPowerInterface().getPowerState() == StandardPowerStateName.OFF){
-				node.getPowerInterface().setPowerState(StandardPowerStateName.ON);
-				cpuRequest -= node.getProcessorsNumber();
-			}
-		}
-		return cpuRequest > 0 ? false : true;
-	}
-
-}
Index: WoRMS/trunk/src/example/localplugin/FCFSRandomClusterLocalPlugin.java
===================================================================
--- /DCWoRMS/trunk/src/example/localplugin/FCFSRandomClusterLocalPlugin.java	(revision 514)
+++ 	(revision )
@@ -1,67 +1,0 @@
-package example.localplugin;
-
-import gridsim.dcworms.DCWormsTags;
-
-import java.util.List;
-import java.util.Random;
-
-import schedframe.events.scheduling.SchedulingEvent;
-import schedframe.resources.computing.ComputingNode;
-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;
-
-public class FCFSRandomClusterLocalPlugin extends BaseLocalSchedulingPlugin {
-
-	private Random rand;
-	
-	public FCFSRandomClusterLocalPlugin() {
-		rand = new Random(5);
-	}
-
-	public SchedulingPlanInterface<?> schedule(SchedulingEvent event, TaskQueueList queues, JobRegistry jobRegistry,
-			 ResourceManager resManager, ModuleList modules) {
-
-		ClusterResourceManager resourceManager = (ClusterResourceManager) resManager;
-		SchedulingPlan plan = new SchedulingPlan();
-		// chose 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
-			// BaseLocalPlugin.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;
-	}
-
-	private String chooseRandomProvider(ClusterResourceManager resourceManager) {
-		List<ComputingNode> nodes = resourceManager.getComputingNodes();
-		int nodeIdx = rand.nextInt(nodes.size());
-		return nodes.get(nodeIdx).getName();
-	}
-
-}
-
Index: WoRMS/trunk/src/example/localplugin/FCFS_BFLocalPlugin.java
===================================================================
--- /DCWoRMS/trunk/src/example/localplugin/FCFS_BFLocalPlugin.java	(revision 514)
+++ 	(revision )
@@ -1,42 +1,0 @@
-package example.localplugin;
-
-import gridsim.dcworms.DCWormsTags;
-import schedframe.events.scheduling.SchedulingEvent;
-import schedframe.scheduling.manager.resources.ResourceManager;
-import schedframe.scheduling.manager.tasks.JobRegistry;
-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 FCFS_BFLocalPlugin extends BaseLocalSchedulingPlugin {
-
-	public SchedulingPlan schedule(SchedulingEvent event, TaskQueueList queues, JobRegistry jobRegistry,
-			 ResourceManager resManager, ModuleList modules) {
-
-		SchedulingPlan plan = new SchedulingPlan();
-		// Chose 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 BaseLocalPlugin.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) {
-					addToSchedulingPlan(plan, task);
-				}
-			}
-			break;
-		}
-		return plan;
-	}
-
-}
-
Index: WoRMS/trunk/src/example/localplugin/FCFSConsolidationClusterLocalPlugin.java
===================================================================
--- /DCWoRMS/trunk/src/example/localplugin/FCFSConsolidationClusterLocalPlugin.java	(revision 514)
+++ 	(revision )
@@ -1,141 +1,0 @@
-package example.localplugin;
-
-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.resources.ResourceStatus;
-import schedframe.resources.computing.ComputingNode;
-import schedframe.resources.computing.ComputingResource;
-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.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 FCFSConsolidationClusterLocalPlugin extends BaseLocalSchedulingPlugin {
-
-	public FCFSConsolidationClusterLocalPlugin () {
-	}
-
-	public SchedulingPlanInterface<?> schedule(SchedulingEvent event, TaskQueueList queues, JobRegistry jobRegistry,
-			ResourceManager resManager, ModuleList modules) {
-
-		ClusterResourceManager resourceManager = (ClusterResourceManager) resManager;
-		SchedulingPlan plan = new SchedulingPlan();
-		// chose 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
-			// BaseLocalPlugin.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) {
-
-					Map<ResourceUnitName, ResourceUnit> choosenResources = null;
-					try {
-						choosenResources = chooseResourcesForExecution(resourceManager, task);
-					} catch (NoSuchFieldException e) {
-						// TODO Auto-generated catch block
-						e.printStackTrace();
-					}
-					if (choosenResources  != null) {
-						addToSchedulingPlan(plan, task, choosenResources);
-					} 
-				}
-			}
-
-			break;
-		}
-		return plan;
-	}
-	
-	private Map<ResourceUnitName, ResourceUnit> chooseResourcesForExecution(ClusterResourceManager resourceManager, TaskInterface<?> task) throws NoSuchFieldException {
-
-		List<ComputingNode> nodes = resourceManager.getComputingNodes();
-		nodes = findSuitableNodes(task, nodes);
-		Collections.sort(nodes, new Comparator<ComputingNode>(){
-		    public int compare(ComputingNode node1, ComputingNode node2){   
-		        return node1.getResourceCharacteristic().getParameters().get("category").get(0).getContent().compareTo(node2.getResourceCharacteristic().getParameters().get("category").get(0).getContent());
-		    }
-		});
-		if(nodes.size() > 0)
-		{
-			ComputingNode 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 = 1;
-			}
-			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<ComputingNode> findSuitableNodes(TaskInterface<?> task, List<ComputingNode> 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<ComputingNode> suitableNodes = new ArrayList<ComputingNode>();
-		for(ComputingNode node: nodes){
-			if(node.getFreeProcessorsNumber() >= cpuRequest && node.getFreeMemory() >= memoryRequest){
-				suitableNodes.add(node);
-			}
-		}
-		return suitableNodes;
-	}
-
-}
Index: WoRMS/trunk/src/example/localplugin/FCFSCPUFreqScalingClusterLocalPlugin.java
===================================================================
--- /DCWoRMS/trunk/src/example/localplugin/FCFSCPUFreqScalingClusterLocalPlugin.java	(revision 514)
+++ 	(revision )
@@ -1,125 +1,0 @@
-package example.localplugin;
-
-import gridsim.dcworms.DCWormsTags;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import schedframe.events.scheduling.SchedulingEvent;
-import schedframe.resources.ResourceStatus;
-import schedframe.resources.computing.ComputingResource;
-import schedframe.resources.computing.Processor;
-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.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 FCFSCPUFreqScalingClusterLocalPlugin extends BaseLocalSchedulingPlugin {
-
-	List<Processor> allocatedCPUs;
-	public FCFSCPUFreqScalingClusterLocalPlugin () {
-		allocatedCPUs = new ArrayList<Processor>();
-	}
-
-	public SchedulingPlanInterface<?> schedule(SchedulingEvent event, TaskQueueList queues, JobRegistry jobRegistry,
-			ResourceManager resManager, ModuleList modules) {
-
-		ClusterResourceManager resourceManager = (ClusterResourceManager) resManager;
-		SchedulingPlan plan = new SchedulingPlan();
-		// our tasks are placed only in first queue (see
-		// BaseLocalPlugin.placeJobsInQueues() method)
-		TaskQueue q = queues.get(0);
-		// chose the events types to serve.
-		// Different actions for different events are possible.
-		switch (event.getType()) {
-		
-		case START_TASK_EXECUTION:
-		case TASK_FINISHED:
-			// 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);
-					} 
-				}
-			}
-			adjustFrequency(resourceManager.getProcessors());
-		}
-		return plan;
-	}
-	
-	private Map<ResourceUnitName, ResourceUnit> chooseResourcesForExecution(
-			ClusterResourceManager resourceManager, TaskInterface<?> task) {
-
-		Map<ResourceUnitName, ResourceUnit> map = new HashMap<ResourceUnitName, ResourceUnit>();
-
-		int cpuRequest;
-		try {
-			cpuRequest = Double.valueOf(task.getCpuCntRequest()).intValue();
-		} catch (NoSuchFieldException e) {
-			cpuRequest = 1;
-		}
-
-		if (cpuRequest != 0) {
-			List<ComputingResource> choosenResources = null;
-			List<Processor> processors = resourceManager.getProcessors();
-			processors.removeAll(allocatedCPUs);
-			if (processors.size() < cpuRequest) {
-				// log.warn("Task requires more cpus than is availiable in this resource.");
-				return null;
-			}
-
-			choosenResources = new ArrayList<ComputingResource>();
-
-			for (int i = 0; i < processors.size() && cpuRequest > 0; i++) {
-				if (processors.get(i).getStatus() == ResourceStatus.FREE) {
-					choosenResources.add(processors.get(i));
-					cpuRequest--;
-				}
-			}
-			if (cpuRequest > 0) {
-				// log.info("Task " + task.getJobId() + "_" + task.getId() +
-				// " requires more cpus than is availiable in this moment.");
-				return null;
-			}
-
-			ProcessingElements result = new ProcessingElements();
-			result.addAll(choosenResources);
-			map.put(StandardResourceUnitName.PE, result);
-		}
-		return map;
-	}
-	
-	private void adjustFrequency(List<Processor> processors){
-
-		for(Processor cpu: processors){
-			if(cpu.getStatus() == ResourceStatus.FREE) {
-				if(cpu.getPowerInterface().getSupportedPStates().containsKey("P3"))
-					cpu.getPowerInterface().setPState("P3");
-			}
-			else{
-				if(cpu.getPowerInterface().getSupportedPStates().containsKey("P0"))
-					cpu.getPowerInterface().setPState("P0");
-			}
-
-		}
-
-	}
-
-
-}
