Index: xssim/branches/tpiontek/src/example/localplugin/FCFSConsolidationClusterLocalPlugin.java
===================================================================
--- xssim/branches/tpiontek/src/example/localplugin/FCFSConsolidationClusterLocalPlugin.java	(revision 192)
+++ xssim/branches/tpiontek/src/example/localplugin/FCFSConsolidationClusterLocalPlugin.java	(revision 269)
@@ -6,21 +6,14 @@
 import java.util.Collections;
 import java.util.Comparator;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.Properties;
 
-import schedframe.resources.units.Memory;
-import schedframe.resources.units.ResourceUnit;
+import schedframe.resources.PowerState;
 import schedframe.scheduling.TaskInterface;
 import schedframe.scheduling.events.SchedulingEvent;
 import schedframe.scheduling.plugin.grid.ModuleList;
-import schedframe.scheduling.utils.ResourceParameterName;
 import test.rewolucja.GSSIMJobInterface;
-import test.rewolucja.resources.ProcessingElements;
-import test.rewolucja.resources.ResourceStatus;
 import test.rewolucja.resources.manager.implementation.ClusterResourceManager;
 import test.rewolucja.resources.manager.interfaces.ResourceManagerInterface;
-import test.rewolucja.resources.physical.base.ComputingResource;
 import test.rewolucja.resources.physical.implementation.ComputingNode;
 import test.rewolucja.scheduling.JobRegistryInterface;
@@ -31,4 +24,6 @@
 
 public class FCFSConsolidationClusterLocalPlugin extends BaseLocalPlugin {
+	
+	private int scenario = 1;
 
 	public FCFSConsolidationClusterLocalPlugin () {
@@ -56,10 +51,36 @@
 				if (task.getStatus() == Gridlet.READY) {
 
-					Map<ResourceParameterName, ResourceUnit> choosenResources = chooseResourcesForExecution(resourceManager, task);
-					if (choosenResources  != null) {
-						addToSchedulingPlan(plan, task, choosenResources);
+					ComputingNode node = chooseResourcesForExecution(resourceManager, PowerState.ON, task);
+					if (node  != null) {
+						System.out.println("Uruchamiam na zasobie: " + node.getName());
+						addToSchedulingPlan(plan, task, node.getName());
 					} 
+					else
+					{
+						node = chooseResourcesForExecution(resourceManager, PowerState.OFF, task);
+						
+						if( node != null)
+						{
+							System.out.println("Wlaczam wezel: " + node.getName());
+							node.getPowerInterface().setPowerState( PowerState.ON);
+							i--;
+						}	
+					}
 				}
 			}
+			
+			switch( scenario)
+			{
+				case 0: break;
+				case 1:
+					List<ComputingNode> nodes = resourceManager.getComputingNodes();
+					for( ComputingNode node : nodes)
+						if( node.getFreeProcessors().size() == node.getProcessorsNumber())
+						{
+							node.getPowerInterface().setPowerState( PowerState.OFF);
+						}
+					break;
+			}
+			
 
 			break;
@@ -68,8 +89,9 @@
 	}
 	
-	private HashMap<ResourceParameterName, ResourceUnit> chooseResourcesForExecution(ClusterResourceManager resourceManager, TaskInterface<?> task) {
+	private ComputingNode chooseResourcesForExecution(ClusterResourceManager resourceManager, PowerState status, TaskInterface<?> task) {
 
 		List<ComputingNode> nodes = resourceManager.getComputingNodes();
-		nodes = findSuitableNodes(task, nodes);
+		nodes = findSuitableNodes(task, status, nodes);
+		
 		Collections.sort(nodes, new Comparator<ComputingNode>(){
 		    public int compare(ComputingNode node1, ComputingNode node2){    
@@ -77,41 +99,12 @@
 		    }
 		});
+		
 		if(nodes.size() > 0)
-		{
-			ComputingNode node = nodes.get(0);
-			HashMap<ResourceParameterName, ResourceUnit> map = new HashMap<ResourceParameterName, 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(ResourceParameterName.PROCESSINGELEMENTS, result);
-			
-			int memoryRequest;
-			try {
-				memoryRequest = Double.valueOf(task.getMemoryRequest()).intValue();
-			} catch (NoSuchFieldException e) {
-				memoryRequest = 0;
-			}
-			if (memoryRequest != 0) {
-				Memory memory = new Memory(node.getMemoryUnit(), memoryRequest, memoryRequest);
-				map.put(ResourceParameterName.MEMORY, memory);
-			}
-			return map;
-		} else 
-			return null;
+			return nodes.get(0);
+				 
+		return null;
 	}
 	
-	private List<ComputingNode> findSuitableNodes(TaskInterface<?> task, List<ComputingNode> nodes){
+	private List<ComputingNode> findSuitableNodes(TaskInterface<?> task, PowerState status, List<ComputingNode> nodes){
 		int cpuRequest;
 		try {
@@ -120,16 +113,21 @@
 			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)
+		{
+				switch( status)
+				{
+					case ON:
+						if(node.getFreeProcessorsNumber() >= cpuRequest)
+							suitableNodes.add(node);
+						break;
+					case OFF:
+						if( node.getProcessorsNumber() >= cpuRequest)
+							suitableNodes.add(node);
+						break;
+				}
 		}
-		List<ComputingNode> suitableNodes = new ArrayList<ComputingNode>();
-		for(ComputingNode node: nodes){
-			if(node.getFreeProcessorsNumber() >= cpuRequest && node.getFreeMemory() >= memoryRequest){
-				suitableNodes.add(node);
-			}
-		}
+	
 		return suitableNodes;
 	}
Index: xssim/branches/tpiontek/src/example/localplugin/wojtek/FCFSCPUFreqScalingClusterLocalPlugin.java
===================================================================
--- xssim/branches/tpiontek/src/example/localplugin/wojtek/FCFSCPUFreqScalingClusterLocalPlugin.java	(revision 269)
+++ xssim/branches/tpiontek/src/example/localplugin/wojtek/FCFSCPUFreqScalingClusterLocalPlugin.java	(revision 269)
@@ -0,0 +1,190 @@
+package example.localplugin;
+
+import gridsim.Gridlet;
+import gridsim.gssim.ResourceHistoryItem;
+import gridsim.gssim.SubmittedTask;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+
+import schedframe.resources.units.ResourceUnit;
+import schedframe.scheduling.TaskInterface;
+import schedframe.scheduling.events.SchedulingEvent;
+import schedframe.scheduling.events.TaskFinishedEvent;
+import schedframe.scheduling.events.TaskRequestedTimeExpiredEvent;
+import schedframe.scheduling.plugin.grid.ModuleList;
+import schedframe.scheduling.utils.ResourceParameterName;
+import test.rewolucja.GSSIMJobInterface;
+import test.rewolucja.energy.profile.PStateType;
+import test.rewolucja.resources.ProcessingElements;
+import test.rewolucja.resources.ResourceStatus;
+import test.rewolucja.resources.manager.implementation.ClusterResourceManager;
+import test.rewolucja.resources.manager.interfaces.ResourceManagerInterface;
+import test.rewolucja.resources.physical.base.ComputingResource;
+import test.rewolucja.resources.physical.implementation.Processor;
+import test.rewolucja.scheduling.JobRegistryInterface;
+import test.rewolucja.scheduling.UsedResourceList;
+import test.rewolucja.scheduling.plan.SchedulingPlanInterfaceNew;
+import test.rewolucja.scheduling.plan.SchedulingPlanNew;
+import test.rewolucja.scheduling.queue.Queue;
+import test.rewolucja.scheduling.queue.QueueList;
+
+public class FCFSCPUFreqScalingClusterLocalPlugin extends BaseLocalPlugin {
+
+	List<Processor> allocatedCPUs;
+	public FCFSCPUFreqScalingClusterLocalPlugin () {
+		allocatedCPUs = new ArrayList<Processor>();
+	}
+
+	public SchedulingPlanInterfaceNew schedule(SchedulingEvent event, QueueList queues, JobRegistryInterface jobRegistry,
+			ResourceManagerInterface resManager, ModuleList modules) {
+
+		ClusterResourceManager resourceManager = (ClusterResourceManager) resManager;
+		SchedulingPlanNew plan = new SchedulingPlanNew();
+		// our tasks are placed only in first queue (see
+		// BaseLocalPlugin.placeJobsInQueues() method)
+		Queue q = queues.get(0);
+		// chose the events types to serve.
+		// Different actions for different events are possible.
+		switch (event.getType()) {
+		
+		case START_TASK_EXECUTION:
+
+			// check all tasks in queue
+			for (int i = 0; i < q.size(); i++) {
+				GSSIMJobInterface<?> job = q.get(i);
+				TaskInterface<?> task = (TaskInterface<?>) job;
+				// if status of the tasks in READY
+				if (task.getStatus() == Gridlet.READY) {
+
+					Map<ResourceParameterName, ResourceUnit> choosenResources = chooseResourcesForExecution(resourceManager, task);
+					if (choosenResources  != null) {
+						addToSchedulingPlan(plan, task, choosenResources);
+						ProcessingElements pes = (ProcessingElements)choosenResources.get(ResourceParameterName.PROCESSINGELEMENTS);
+						List<Processor> processors =  new ArrayList<Processor>();
+						for(ComputingResource res : pes){
+							processors.add((Processor) res);
+						}
+						adjustFrequency(ResourceStatus.BUSY,processors);
+					} 
+				}
+			}
+			break;
+			
+		case TASK_FINISHED:
+			TaskFinishedEvent finEvent = (TaskFinishedEvent) event;
+			SubmittedTask subTask = jobRegistry.getSubmittedTask(finEvent.getJobId(), finEvent.getTaskId());
+			UsedResourceList<ResourceHistoryItem> usedResourcesList = subTask.getUsedResources();
+			ProcessingElements pes = (ProcessingElements)usedResourcesList.getLast().getResourceUnits().get(ResourceParameterName.PROCESSINGELEMENTS);
+			List<Processor> processors =  new ArrayList<Processor>();
+			for(ComputingResource res : pes){
+				processors.add((Processor) res);
+				allocatedCPUs.add((Processor) res);
+			}
+			adjustFrequency(ResourceStatus.FREE, processors);
+			break;
+			
+		case TASK_REQUESTED_TIME_EXPIRED:
+			TaskRequestedTimeExpiredEvent timExpEvent = (TaskRequestedTimeExpiredEvent) event;
+			 subTask = jobRegistry.getSubmittedTask(timExpEvent.getJobId(), timExpEvent.getTaskId());
+			usedResourcesList = subTask.getUsedResources();
+			pes = (ProcessingElements)usedResourcesList.getLast().getResourceUnits().get(ResourceParameterName.PROCESSINGELEMENTS);
+			processors =  new ArrayList<Processor>();
+			for(ComputingResource res : pes){
+				allocatedCPUs.remove((Processor) res);
+			}
+			// check all tasks in queue
+			for (int i = 0; i < q.size(); i++) {
+				GSSIMJobInterface<?> job = q.get(i);
+				TaskInterface<?> task = (TaskInterface<?>) job;
+				// if status of the tasks in READY
+				if (task.getStatus() == Gridlet.READY) {
+
+					Map<ResourceParameterName, ResourceUnit> choosenResources = chooseResourcesForExecution(resourceManager, task);
+					if (choosenResources  != null) {
+						addToSchedulingPlan(plan, task, choosenResources);
+						pes = (ProcessingElements)choosenResources.get(ResourceParameterName.PROCESSINGELEMENTS);
+						processors =  new ArrayList<Processor>();
+						for(ComputingResource res : pes){
+							processors.add((Processor) res);
+						}
+						adjustFrequency(ResourceStatus.BUSY, processors);
+					} 
+				}
+			}
+			break;
+		}
+		return plan;
+	}
+	
+	private HashMap<ResourceParameterName, ResourceUnit> chooseResourcesForExecution(
+			ClusterResourceManager resourceManager, TaskInterface<?> task) {
+
+		HashMap<ResourceParameterName, ResourceUnit> map = new HashMap<ResourceParameterName, 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(ResourceParameterName.PROCESSINGELEMENTS, result);
+		}
+		return map;
+	}
+
+	private void adjustFrequency(ResourceStatus status, List<Processor> processors){
+		switch(status){
+		case BUSY:
+			for(Processor cpu: processors){
+				if(cpu.getPowerInterface().getSupportedPStates().containsKey(PStateType.P0))
+					cpu.getPowerInterface().setPState(PStateType.P0);
+			}
+			break;
+		case FREE:
+			for(Processor cpu: processors){
+				if(cpu.getPowerInterface().getSupportedPStates().containsKey(PStateType.P3))
+					cpu.getPowerInterface().setPState(PStateType.P3);
+			}
+			break;
+		}
+	}
+	
+	public String getName() {
+		return getClass().getName();
+	}
+
+	public void init(Properties properties) {
+		// no extra initialization is expected.
+	}
+
+}
Index: xssim/branches/tpiontek/src/example/localplugin/wojtek/FCFSEnergyAwareClusterLocalPlugin.java
===================================================================
--- xssim/branches/tpiontek/src/example/localplugin/wojtek/FCFSEnergyAwareClusterLocalPlugin.java	(revision 269)
+++ xssim/branches/tpiontek/src/example/localplugin/wojtek/FCFSEnergyAwareClusterLocalPlugin.java	(revision 269)
@@ -0,0 +1,108 @@
+package example.localplugin;
+
+import gridsim.Gridlet;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+import java.util.Properties;
+
+import schedframe.scheduling.TaskInterface;
+import schedframe.scheduling.events.SchedulingEvent;
+import schedframe.scheduling.plugin.grid.ModuleList;
+import test.rewolucja.GSSIMJobInterface;
+import test.rewolucja.resources.manager.implementation.ClusterResourceManager;
+import test.rewolucja.resources.manager.interfaces.ResourceManagerInterface;
+import test.rewolucja.resources.physical.implementation.ComputingNode;
+import test.rewolucja.scheduling.JobRegistryInterface;
+import test.rewolucja.scheduling.plan.SchedulingPlanInterfaceNew;
+import test.rewolucja.scheduling.plan.SchedulingPlanNew;
+import test.rewolucja.scheduling.queue.Queue;
+import test.rewolucja.scheduling.queue.QueueList;
+
+public class FCFSEnergyAwareClusterLocalPlugin extends BaseLocalPlugin {
+
+	public FCFSEnergyAwareClusterLocalPlugin () {
+	}
+
+	public SchedulingPlanInterfaceNew schedule(SchedulingEvent event, QueueList queues, JobRegistryInterface jobRegistry,
+			ResourceManagerInterface resManager, ModuleList modules) {
+
+		ClusterResourceManager resourceManager = (ClusterResourceManager) resManager;
+		SchedulingPlanNew plan = new SchedulingPlanNew();
+		// 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)
+			Queue q = queues.get(0);
+			// check all tasks in queue
+
+			for (int i = 0; i < q.size(); i++) {
+				GSSIMJobInterface<?> job = q.get(i);
+				TaskInterface<?> task = (TaskInterface<?>) job;
+				// if status of the tasks in READY
+				if (task.getStatus() == Gridlet.READY) {
+
+					String nodeName = chooseProviderForExecution(resourceManager, task);
+					if (nodeName != null) {
+						addToSchedulingPlan(plan, task, nodeName);
+					}
+				}
+			}
+
+			break;
+		}
+		return plan;
+	}
+
+	private String chooseProviderForExecution(ClusterResourceManager resourceManager, TaskInterface<?> task) {
+		int cpuRequest;
+		try {
+			cpuRequest = Double.valueOf(task.getCpuCntRequest()).intValue();
+		} catch (NoSuchFieldException e) {
+			cpuRequest = 1;
+		}
+		List<ComputingNode> nodes = resourceManager.getComputingNodes();
+		nodes = findSuitableNodes(cpuRequest, nodes);
+		Collections.sort(nodes, new Comparator<ComputingNode>(){
+			 
+		    public int compare(ComputingNode node1, ComputingNode node2){    
+		        return node1.getCategory().getName().compareTo(node2.getCategory().getName());
+		   
+		    }
+		});
+
+		return nodes.size() == 0 ? null : nodes.get(0).getName();
+	}
+	
+	private List<ComputingNode> findSuitableNodes(int cpuRequest, List<ComputingNode> nodes){
+		List<ComputingNode> avNodes = new ArrayList<ComputingNode>();
+		for(ComputingNode node: nodes){
+			if(node.getFreeProcessorsNumber() >= cpuRequest){
+				avNodes.add(node);
+			}
+		}
+		return avNodes;
+	}
+	
+	public String getName() {
+		return getClass().getName();
+	}
+
+	public void init(Properties properties) {
+		// no extra initialization is expected.
+	}
+
+	class CategoryComparator implements Comparator<String>{
+		 
+	    public int compare(String cat1, String cat2){    
+	        return cat1.compareTo(cat2);
+	   
+	    }
+	}
+}
+
Index: xssim/branches/tpiontek/src/example/localplugin/wojtek/FCFSClusterLocalPlugin.java
===================================================================
--- xssim/branches/tpiontek/src/example/localplugin/wojtek/FCFSClusterLocalPlugin.java	(revision 269)
+++ xssim/branches/tpiontek/src/example/localplugin/wojtek/FCFSClusterLocalPlugin.java	(revision 269)
@@ -0,0 +1,169 @@
+package example.localplugin;
+
+import gridsim.Gridlet;
+import gridsim.gssim.SubmittedTask;
+import gssim.schedframe.scheduling.ExecTaskInterface;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+
+import schedframe.resources.units.Memory;
+import schedframe.resources.units.ResourceUnit;
+import schedframe.scheduling.TaskInterface;
+import schedframe.scheduling.events.SchedulingEvent;
+import schedframe.scheduling.plugin.grid.ModuleList;
+import schedframe.scheduling.utils.ResourceParameterName;
+import test.rewolucja.GSSIMJobInterface;
+import test.rewolucja.resources.ProcessingElements;
+import test.rewolucja.resources.ResourceStatus;
+import test.rewolucja.resources.ResourceType;
+import test.rewolucja.resources.manager.implementation.ClusterResourceManager;
+import test.rewolucja.resources.manager.interfaces.ResourceManagerInterface;
+import test.rewolucja.resources.physical.base.ComputingResource;
+import test.rewolucja.resources.physical.implementation.Processor;
+import test.rewolucja.resources.physical.implementation.ComputingNode;
+import test.rewolucja.scheduling.JobRegistryInterface;
+import test.rewolucja.scheduling.plan.SchedulingPlanInterfaceNew;
+import test.rewolucja.scheduling.plan.SchedulingPlanNew;
+import test.rewolucja.scheduling.queue.Queue;
+import test.rewolucja.scheduling.queue.QueueList;
+
+public class FCFSClusterLocalPlugin extends BaseLocalPlugin {
+
+	public FCFSClusterLocalPlugin() {
+	}
+
+	public SchedulingPlanInterfaceNew schedule(SchedulingEvent event, QueueList queues, JobRegistryInterface jobRegistry,
+			ResourceManagerInterface resManager, ModuleList modules) {
+
+		ClusterResourceManager resourceManager = (ClusterResourceManager) resManager;
+		SchedulingPlanNew plan = new SchedulingPlanNew();
+		// 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)
+			Queue q = queues.get(0);
+			// check all tasks in queue
+
+			for (int i = 0; i < q.size(); i++) {
+				GSSIMJobInterface<?> job = q.get(i);
+				TaskInterface<?> task = (TaskInterface<?>) job;
+				// if status of the tasks in READY
+				if (task.getStatus() == Gridlet.READY) {
+
+					SubmittedTask subTask = (SubmittedTask) task;
+					
+					/****************3 ways to schedule task****************/
+					
+					/****************1. Choosing particular resources to perform execution****************/
+					Map<ResourceParameterName, ResourceUnit> choosenResources = chooseResourcesForExecution(resourceManager, subTask);
+					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 HashMap<ResourceParameterName, ResourceUnit> chooseResourcesForExecution(
+			ClusterResourceManager resourceManager, ExecTaskInterface task) {
+
+		HashMap<ResourceParameterName, ResourceUnit> map = new HashMap<ResourceParameterName, 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 = null;
+			processors = resourceManager.getProcessors();
+			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(processors.get(0).getParent().getName());
+			result.addAll(choosenResources);
+			map.put(ResourceParameterName.PROCESSINGELEMENTS, result);
+
+		}
+		int memoryRequest;
+		try {
+			memoryRequest = Double.valueOf(task.getMemoryRequest()).intValue();
+		} catch (NoSuchFieldException e) {
+			memoryRequest = 0;
+		}
+		if (memoryRequest != 0) {
+			List<ComputingNode> nodes = resourceManager.getComputingNodes();
+
+			Memory memory = null;
+			for (ComputingNode node : nodes) {
+
+				if (node.getFreeMemory() >= memoryRequest) {
+					memory = new Memory(node.getMemoryUnit(), memoryRequest, memoryRequest);
+				} else
+					return null;
+			}
+			map.put(ResourceParameterName.MEMORY, memory);
+		}
+
+		return map;
+	}
+
+	@SuppressWarnings("unchecked")
+	private String chooseProviderForExecution(ResourceManagerInterface unitsManager) {
+		List<ComputingResource> processingElements;
+		Properties properties = new Properties();
+		properties.setProperty("type", ResourceType.COMPUTING_NODE.toString());
+		// properties.setProperty("status", ResourceStatus.FREE.toString());
+		processingElements = (List<ComputingResource>) unitsManager.filterResources(properties);
+		return processingElements.get(0).getName();
+	}
+
+	public String getName() {
+		return getClass().getName();
+	}
+
+	public void init(Properties properties) {
+		// no extra initialization is expected.
+	}
+
+}
Index: xssim/branches/tpiontek/src/example/localplugin/wojtek/FCFSNodePowerManagementClusterLocalPlugin.java
===================================================================
--- xssim/branches/tpiontek/src/example/localplugin/wojtek/FCFSNodePowerManagementClusterLocalPlugin.java	(revision 269)
+++ xssim/branches/tpiontek/src/example/localplugin/wojtek/FCFSNodePowerManagementClusterLocalPlugin.java	(revision 269)
@@ -0,0 +1,162 @@
+package example.localplugin;
+
+import gridsim.Gridlet;
+
+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 java.util.Properties;
+
+import schedframe.resources.PowerState;
+import schedframe.resources.units.ResourceUnit;
+import schedframe.scheduling.TaskInterface;
+import schedframe.scheduling.events.SchedulingEvent;
+import schedframe.scheduling.plugin.grid.ModuleList;
+import schedframe.scheduling.utils.ResourceParameterName;
+import test.rewolucja.GSSIMJobInterface;
+import test.rewolucja.resources.ProcessingElements;
+import test.rewolucja.resources.ResourceStatus;
+import test.rewolucja.resources.manager.implementation.ClusterResourceManager;
+import test.rewolucja.resources.manager.interfaces.ResourceManagerInterface;
+import test.rewolucja.resources.physical.base.ComputingResource;
+import test.rewolucja.resources.physical.implementation.ComputingNode;
+import test.rewolucja.scheduling.JobRegistryInterface;
+import test.rewolucja.scheduling.plan.SchedulingPlanInterfaceNew;
+import test.rewolucja.scheduling.plan.SchedulingPlanNew;
+import test.rewolucja.scheduling.queue.Queue;
+import test.rewolucja.scheduling.queue.QueueList;
+
+public class FCFSNodePowerManagementClusterLocalPlugin extends BaseLocalPlugin {
+
+	public FCFSNodePowerManagementClusterLocalPlugin () {
+	}
+
+	public SchedulingPlanInterfaceNew schedule(SchedulingEvent event, QueueList queues, JobRegistryInterface jobRegistry,
+			ResourceManagerInterface resManager, ModuleList modules) {
+
+		ClusterResourceManager resourceManager = (ClusterResourceManager) resManager;
+		SchedulingPlanNew plan = new SchedulingPlanNew();
+		// 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)
+			Queue q = queues.get(0);
+			// check all tasks in queue
+
+			for (int i = 0; i < q.size(); i++) {
+				GSSIMJobInterface<?> job = q.get(i);
+				TaskInterface<?> task = (TaskInterface<?>) job;
+				// if status of the tasks in READY
+				if (task.getStatus() == Gridlet.READY) {
+
+					Map<ResourceParameterName, 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 HashMap<ResourceParameterName, 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.getCategory().getName().compareTo(node2.getCategory().getName());
+		    }
+		});
+		if(nodes.size() > 0)
+		{
+			HashMap<ResourceParameterName, ResourceUnit> map = new HashMap<ResourceParameterName, 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(ResourceParameterName.PROCESSINGELEMENTS, 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(PowerState.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.getCategory().getName().compareTo(node2.getCategory().getName());
+		    }
+		});
+		for (int i = 0; i < nodes.size() && cpuRequest > 0; i++) {
+			ComputingNode node = nodes.get(i);
+			if(node.getPowerInterface().getPowerState() == PowerState.OFF){
+				node.getPowerInterface().setPowerState(PowerState.ON);
+				cpuRequest -= node.getProcessorsNumber();
+			}
+		}
+		return cpuRequest > 0 ? false : true;
+	}
+	
+	public String getName() {
+		return getClass().getName();
+	}
+
+	public void init(Properties properties) {
+		// no extra initialization is expected.
+	}
+
+}
Index: xssim/branches/tpiontek/src/example/localplugin/wojtek/FCFSRandomClusterLocalPlugin.java
===================================================================
--- xssim/branches/tpiontek/src/example/localplugin/wojtek/FCFSRandomClusterLocalPlugin.java	(revision 269)
+++ xssim/branches/tpiontek/src/example/localplugin/wojtek/FCFSRandomClusterLocalPlugin.java	(revision 269)
@@ -0,0 +1,119 @@
+package example.localplugin;
+
+import gridsim.Gridlet;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+import java.util.Random;
+
+import schedframe.scheduling.TaskInterface;
+import schedframe.scheduling.events.SchedulingEvent;
+import schedframe.scheduling.plugin.grid.ModuleList;
+import test.rewolucja.GSSIMJobInterface;
+import test.rewolucja.energy.profile.PStateType;
+import test.rewolucja.resources.manager.implementation.ClusterResourceManager;
+import test.rewolucja.resources.manager.interfaces.ResourceManagerInterface;
+import test.rewolucja.resources.physical.implementation.ComputingNode;
+import test.rewolucja.resources.physical.implementation.Processor;
+import test.rewolucja.scheduling.JobRegistryInterface;
+import test.rewolucja.scheduling.plan.SchedulingPlanInterfaceNew;
+import test.rewolucja.scheduling.plan.SchedulingPlanNew;
+import test.rewolucja.scheduling.queue.Queue;
+import test.rewolucja.scheduling.queue.QueueList;
+
+public class FCFSRandomClusterLocalPlugin extends BaseLocalPlugin {
+
+	private Random rand;
+	private boolean init = true;
+	
+	public FCFSRandomClusterLocalPlugin() {
+		rand = new Random(5);
+	}
+
+	public SchedulingPlanInterfaceNew schedule(SchedulingEvent event, QueueList queues, JobRegistryInterface jobRegistry,
+			 ResourceManagerInterface resManager, ModuleList modules) {
+		
+		ClusterResourceManager resourceManager = (ClusterResourceManager) resManager;
+		
+		if( init)
+		{
+			List<Processor> cpus = resourceManager.getProcessors();
+			
+			for( Processor cpu : cpus)
+				cpu.getPowerInterface().setPState( PStateType.P0);
+			
+			init = false;
+		}
+		
+
+		
+		SchedulingPlanNew plan = new SchedulingPlanNew();
+		// 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)
+			Queue q = queues.get(0);
+			// check all tasks in queue
+
+			for (int i = 0; i < q.size(); i++) {
+				GSSIMJobInterface<?> job = q.get(i);
+				TaskInterface<?> task = (TaskInterface<?>) job;
+				// if status of the tasks in READY
+				if (task.getStatus() == Gridlet.READY) {
+					String nodeName = chooseRandomProvider(resourceManager, task);
+					if (nodeName != null) {
+						addToSchedulingPlan(plan, task, nodeName);
+					}
+				}
+			}
+			break;
+		}
+		return plan;
+	}
+
+	private List<ComputingNode> findSuitableNodes(int cpuRequest, List<ComputingNode> nodes){
+		List<ComputingNode> avNodes = new ArrayList<ComputingNode>();
+		for(ComputingNode node: nodes){
+			if(node.getFreeProcessorsNumber() >= cpuRequest){
+				avNodes.add(node);
+			}
+		}
+		return avNodes;
+	}
+	
+	private String chooseRandomProvider(ClusterResourceManager resourceManager, TaskInterface<?> task) {
+		
+		int cpuRequest;
+		try {
+			cpuRequest = Double.valueOf(task.getCpuCntRequest()).intValue();
+		} catch (NoSuchFieldException e) {
+			cpuRequest = 1;
+		}
+		
+		List<ComputingNode> nodes = resourceManager.getComputingNodes();
+		
+		nodes = findSuitableNodes(cpuRequest, nodes);
+		
+		if( nodes.size() > 0)
+		{	
+			int nodeIdx = rand.nextInt(nodes.size());
+			return nodes.get(nodeIdx).getName();
+		}
+		else
+			return null;
+	}
+	
+	public String getName() {
+		return getClass().getName();
+	}
+
+	public void init(Properties properties) {
+		// no extra initialization is expected.
+	}
+
+}
+
Index: xssim/branches/tpiontek/src/example/localplugin/FCFSPreferedRandomClusterLocalPlugin.java
===================================================================
--- xssim/branches/tpiontek/src/example/localplugin/FCFSPreferedRandomClusterLocalPlugin.java	(revision 258)
+++ xssim/branches/tpiontek/src/example/localplugin/FCFSPreferedRandomClusterLocalPlugin.java	(revision 269)
@@ -2,4 +2,6 @@
 
 import gridsim.Gridlet;
+import gridsim.gssim.ResourceHistoryItem;
+import gridsim.gssim.SubmittedTask;
 
 import java.util.ArrayList;
@@ -11,14 +13,19 @@
 import schedframe.scheduling.TaskInterface;
 import schedframe.scheduling.events.SchedulingEvent;
+import schedframe.scheduling.events.TaskFinishedEvent;
 import schedframe.scheduling.plugin.grid.ModuleList;
+import schedframe.scheduling.utils.ResourceParameterName;
 import test.rewolucja.GSSIMJobInterface;
 import test.rewolucja.energy.profile.PStateType;
+import test.rewolucja.resources.ProcessingElements;
 import test.rewolucja.resources.ResourceStatus;
 import test.rewolucja.resources.ResourceType;
 import test.rewolucja.resources.manager.implementation.ClusterResourceManager;
 import test.rewolucja.resources.manager.interfaces.ResourceManagerInterface;
+import test.rewolucja.resources.physical.base.ComputingResource;
 import test.rewolucja.resources.physical.implementation.ComputingNode;
 import test.rewolucja.resources.physical.implementation.Processor;
 import test.rewolucja.scheduling.JobRegistryInterface;
+import test.rewolucja.scheduling.UsedResourceList;
 import test.rewolucja.scheduling.plan.SchedulingPlanInterfaceNew;
 import test.rewolucja.scheduling.plan.SchedulingPlanNew;
@@ -31,5 +38,5 @@
 	private boolean init = true;
 	
-	int scenario = 2;
+	int scenario = 3;
 	String prefered = null;
 	
@@ -59,6 +66,19 @@
 		// Different actions for different events are possible.
 		switch (event.getType()) {
+		case TASK_FINISHED:
+			if( scenario == 2)
+			{	
+				TaskFinishedEvent finEvent = (TaskFinishedEvent) event;
+				SubmittedTask subTask = jobRegistry.getSubmittedTask(finEvent.getJobId(), finEvent.getTaskId());
+				UsedResourceList<ResourceHistoryItem> usedResourcesList = subTask.getUsedResources();
+				ProcessingElements pes = (ProcessingElements)usedResourcesList.getLast().getResourceUnits().get(ResourceParameterName.PROCESSINGELEMENTS);
+				
+				for( ComputingResource cr : pes)
+				{
+					((Processor)cr).getPowerInterface().setPowerState( PowerState.OFF);
+				}
+			}
+			
 		case START_TASK_EXECUTION:
-		case TASK_FINISHED:
 			// our tasks are placed only in first queue (see
 			// BaseLocalPlugin.placeJobsInQueues() method)
@@ -76,4 +96,9 @@
 					if (node != null) {
 						List<Processor> cpus = chooseProcessorsForExecution(node, ResourceStatus.FREE, task);
+						
+						int type = Integer.parseInt( task.getJobId()) % 4;
+						String model = cpus.get(0).getComputingNode().getCategory().getName();
+						//System.out.println(type + " -> " + model);
+						
 						addToSchedulingPlan(plan, task, cpus);
 					}
@@ -91,5 +116,7 @@
 								for( Processor cpu: cpus)
 									cpu.getPowerInterface().setPowerState( PowerState.ON);
-								}
+								
+								i--;
+							}
 							break;
 						}
@@ -163,32 +190,49 @@
 	private ComputingNode chooseRandomProvider(ClusterResourceManager resourceManager, ResourceStatus status, TaskInterface<?> task) {
 		
+		String preferedNode = null;
+		
 		int cpuRequest = getCpuRequest(task);
 		
 		List<ComputingNode> nodes = null;
 		
-		String prefered = null;
-		
-		nodes = findSuitableNodes(prefered, cpuRequest, status, resourceManager.getComputingNodes());
-		if( nodes.size() > 0)
+		switch( scenario)
+		{
+			case 3:
+				int type = Integer.parseInt( task.getJobId()) % 4;
+				switch( type)
+				{
+					case 0: preferedNode = "B"; break;
+					default: preferedNode = "A"; break;
+				}
+				break;
+			default:
+				preferedNode = prefered;
+				break;
+				
+		}
+		
+		nodes = findSuitableNodes(preferedNode, cpuRequest, status, resourceManager.getComputingNodes());
+		switch( nodes.size())
+		{
+			case 0: break;
+			case 1: return nodes.get(0);
+			default:
+				int nodeIdx = rand.nextInt(nodes.size());
+				ComputingNode node = nodes.get(nodeIdx);		
+				return node;
+		}
+		
+		
+		if( preferedNode != null)
 		{	
-			int nodeIdx = rand.nextInt(nodes.size());
-			ComputingNode node = nodes.get(nodeIdx);
-						
-			return node;
-		}
-		else
-		{
-			System.out.println("NO resources: " + prefered);
-		}
-		
-		if( prefered != null)
-		{	
-			nodes = findSuitableNodes( getUnprefered(), cpuRequest, status, resourceManager.getComputingNodes());
-			if( nodes.size() > 0)
-			{	
-				int nodeIdx = rand.nextInt(nodes.size());
-				ComputingNode node = nodes.get(nodeIdx);
-							
-				return node;
+			nodes = findSuitableNodes( getUnprefered(preferedNode), cpuRequest, status, resourceManager.getComputingNodes());
+			switch( nodes.size())
+			{
+				case 0: break;
+				case 1: return nodes.get(0);
+				default: 
+					int nodeIdx = rand.nextInt(nodes.size());
+					ComputingNode node = nodes.get(nodeIdx);		
+					return node;
 			}
 		}
@@ -215,10 +259,10 @@
 	}
 	
-	private String getUnprefered()
+	private String getUnprefered( String preferedNode)
 	{
-		if( prefered.equals("A"))
+		if( preferedNode.equals("A"))
 			return "B";
 		
-		if( prefered.equals("B"))
+		if( preferedNode.equals("B"))
 			return "A";
 		
Index: xssim/branches/tpiontek/src/example/localplugin/FCFSClusterLocalPlugin.java
===================================================================
--- xssim/branches/tpiontek/src/example/localplugin/FCFSClusterLocalPlugin.java	(revision 204)
+++ 	(revision )
@@ -1,169 +1,0 @@
-package example.localplugin;
-
-import gridsim.Gridlet;
-import gridsim.gssim.SubmittedTask;
-import gssim.schedframe.scheduling.ExecTaskInterface;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-
-import schedframe.resources.units.Memory;
-import schedframe.resources.units.ResourceUnit;
-import schedframe.scheduling.TaskInterface;
-import schedframe.scheduling.events.SchedulingEvent;
-import schedframe.scheduling.plugin.grid.ModuleList;
-import schedframe.scheduling.utils.ResourceParameterName;
-import test.rewolucja.GSSIMJobInterface;
-import test.rewolucja.resources.ProcessingElements;
-import test.rewolucja.resources.ResourceStatus;
-import test.rewolucja.resources.ResourceType;
-import test.rewolucja.resources.manager.implementation.ClusterResourceManager;
-import test.rewolucja.resources.manager.interfaces.ResourceManagerInterface;
-import test.rewolucja.resources.physical.base.ComputingResource;
-import test.rewolucja.resources.physical.implementation.Processor;
-import test.rewolucja.resources.physical.implementation.ComputingNode;
-import test.rewolucja.scheduling.JobRegistryInterface;
-import test.rewolucja.scheduling.plan.SchedulingPlanInterfaceNew;
-import test.rewolucja.scheduling.plan.SchedulingPlanNew;
-import test.rewolucja.scheduling.queue.Queue;
-import test.rewolucja.scheduling.queue.QueueList;
-
-public class FCFSClusterLocalPlugin extends BaseLocalPlugin {
-
-	public FCFSClusterLocalPlugin() {
-	}
-
-	public SchedulingPlanInterfaceNew schedule(SchedulingEvent event, QueueList queues, JobRegistryInterface jobRegistry,
-			ResourceManagerInterface resManager, ModuleList modules) {
-
-		ClusterResourceManager resourceManager = (ClusterResourceManager) resManager;
-		SchedulingPlanNew plan = new SchedulingPlanNew();
-		// 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)
-			Queue q = queues.get(0);
-			// check all tasks in queue
-
-			for (int i = 0; i < q.size(); i++) {
-				GSSIMJobInterface<?> job = q.get(i);
-				TaskInterface<?> task = (TaskInterface<?>) job;
-				// if status of the tasks in READY
-				if (task.getStatus() == Gridlet.READY) {
-
-					SubmittedTask subTask = (SubmittedTask) task;
-					
-					/****************3 ways to schedule task****************/
-					
-					/****************1. Choosing particular resources to perform execution****************/
-					Map<ResourceParameterName, ResourceUnit> choosenResources = chooseResourcesForExecution(resourceManager, subTask);
-					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 HashMap<ResourceParameterName, ResourceUnit> chooseResourcesForExecution(
-			ClusterResourceManager resourceManager, ExecTaskInterface task) {
-
-		HashMap<ResourceParameterName, ResourceUnit> map = new HashMap<ResourceParameterName, 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 = null;
-			processors = resourceManager.getProcessors();
-			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(processors.get(0).getParent().getName());
-			result.addAll(choosenResources);
-			map.put(ResourceParameterName.PROCESSINGELEMENTS, result);
-
-		}
-		int memoryRequest;
-		try {
-			memoryRequest = Double.valueOf(task.getMemoryRequest()).intValue();
-		} catch (NoSuchFieldException e) {
-			memoryRequest = 0;
-		}
-		if (memoryRequest != 0) {
-			List<ComputingNode> nodes = resourceManager.getComputingNodes();
-
-			Memory memory = null;
-			for (ComputingNode node : nodes) {
-
-				if (node.getFreeMemory() >= memoryRequest) {
-					memory = new Memory(node.getMemoryUnit(), memoryRequest, memoryRequest);
-				} else
-					return null;
-			}
-			map.put(ResourceParameterName.MEMORY, memory);
-		}
-
-		return map;
-	}
-
-	@SuppressWarnings("unchecked")
-	private String chooseProviderForExecution(ResourceManagerInterface unitsManager) {
-		List<ComputingResource> processingElements;
-		Properties properties = new Properties();
-		properties.setProperty("type", ResourceType.COMPUTING_NODE.toString());
-		// properties.setProperty("status", ResourceStatus.FREE.toString());
-		processingElements = (List<ComputingResource>) unitsManager.filterResources(properties);
-		return processingElements.get(0).getName();
-	}
-
-	public String getName() {
-		return getClass().getName();
-	}
-
-	public void init(Properties properties) {
-		// no extra initialization is expected.
-	}
-
-}
Index: xssim/branches/tpiontek/src/example/localplugin/FCFSNodePowerManagementClusterLocalPlugin.java
===================================================================
--- xssim/branches/tpiontek/src/example/localplugin/FCFSNodePowerManagementClusterLocalPlugin.java	(revision 192)
+++ 	(revision )
@@ -1,162 +1,0 @@
-package example.localplugin;
-
-import gridsim.Gridlet;
-
-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 java.util.Properties;
-
-import schedframe.resources.PowerState;
-import schedframe.resources.units.ResourceUnit;
-import schedframe.scheduling.TaskInterface;
-import schedframe.scheduling.events.SchedulingEvent;
-import schedframe.scheduling.plugin.grid.ModuleList;
-import schedframe.scheduling.utils.ResourceParameterName;
-import test.rewolucja.GSSIMJobInterface;
-import test.rewolucja.resources.ProcessingElements;
-import test.rewolucja.resources.ResourceStatus;
-import test.rewolucja.resources.manager.implementation.ClusterResourceManager;
-import test.rewolucja.resources.manager.interfaces.ResourceManagerInterface;
-import test.rewolucja.resources.physical.base.ComputingResource;
-import test.rewolucja.resources.physical.implementation.ComputingNode;
-import test.rewolucja.scheduling.JobRegistryInterface;
-import test.rewolucja.scheduling.plan.SchedulingPlanInterfaceNew;
-import test.rewolucja.scheduling.plan.SchedulingPlanNew;
-import test.rewolucja.scheduling.queue.Queue;
-import test.rewolucja.scheduling.queue.QueueList;
-
-public class FCFSNodePowerManagementClusterLocalPlugin extends BaseLocalPlugin {
-
-	public FCFSNodePowerManagementClusterLocalPlugin () {
-	}
-
-	public SchedulingPlanInterfaceNew schedule(SchedulingEvent event, QueueList queues, JobRegistryInterface jobRegistry,
-			ResourceManagerInterface resManager, ModuleList modules) {
-
-		ClusterResourceManager resourceManager = (ClusterResourceManager) resManager;
-		SchedulingPlanNew plan = new SchedulingPlanNew();
-		// 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)
-			Queue q = queues.get(0);
-			// check all tasks in queue
-
-			for (int i = 0; i < q.size(); i++) {
-				GSSIMJobInterface<?> job = q.get(i);
-				TaskInterface<?> task = (TaskInterface<?>) job;
-				// if status of the tasks in READY
-				if (task.getStatus() == Gridlet.READY) {
-
-					Map<ResourceParameterName, 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 HashMap<ResourceParameterName, 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.getCategory().getName().compareTo(node2.getCategory().getName());
-		    }
-		});
-		if(nodes.size() > 0)
-		{
-			HashMap<ResourceParameterName, ResourceUnit> map = new HashMap<ResourceParameterName, 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(ResourceParameterName.PROCESSINGELEMENTS, 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(PowerState.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.getCategory().getName().compareTo(node2.getCategory().getName());
-		    }
-		});
-		for (int i = 0; i < nodes.size() && cpuRequest > 0; i++) {
-			ComputingNode node = nodes.get(i);
-			if(node.getPowerInterface().getPowerState() == PowerState.OFF){
-				node.getPowerInterface().setPowerState(PowerState.ON);
-				cpuRequest -= node.getProcessorsNumber();
-			}
-		}
-		return cpuRequest > 0 ? false : true;
-	}
-	
-	public String getName() {
-		return getClass().getName();
-	}
-
-	public void init(Properties properties) {
-		// no extra initialization is expected.
-	}
-
-}
Index: xssim/branches/tpiontek/src/example/localplugin/FCFSRandomClusterLocalPlugin.java
===================================================================
--- xssim/branches/tpiontek/src/example/localplugin/FCFSRandomClusterLocalPlugin.java	(revision 252)
+++ 	(revision )
@@ -1,119 +1,0 @@
-package example.localplugin;
-
-import gridsim.Gridlet;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Properties;
-import java.util.Random;
-
-import schedframe.scheduling.TaskInterface;
-import schedframe.scheduling.events.SchedulingEvent;
-import schedframe.scheduling.plugin.grid.ModuleList;
-import test.rewolucja.GSSIMJobInterface;
-import test.rewolucja.energy.profile.PStateType;
-import test.rewolucja.resources.manager.implementation.ClusterResourceManager;
-import test.rewolucja.resources.manager.interfaces.ResourceManagerInterface;
-import test.rewolucja.resources.physical.implementation.ComputingNode;
-import test.rewolucja.resources.physical.implementation.Processor;
-import test.rewolucja.scheduling.JobRegistryInterface;
-import test.rewolucja.scheduling.plan.SchedulingPlanInterfaceNew;
-import test.rewolucja.scheduling.plan.SchedulingPlanNew;
-import test.rewolucja.scheduling.queue.Queue;
-import test.rewolucja.scheduling.queue.QueueList;
-
-public class FCFSRandomClusterLocalPlugin extends BaseLocalPlugin {
-
-	private Random rand;
-	private boolean init = true;
-	
-	public FCFSRandomClusterLocalPlugin() {
-		rand = new Random(5);
-	}
-
-	public SchedulingPlanInterfaceNew schedule(SchedulingEvent event, QueueList queues, JobRegistryInterface jobRegistry,
-			 ResourceManagerInterface resManager, ModuleList modules) {
-		
-		ClusterResourceManager resourceManager = (ClusterResourceManager) resManager;
-		
-		if( init)
-		{
-			List<Processor> cpus = resourceManager.getProcessors();
-			
-			for( Processor cpu : cpus)
-				cpu.getPowerInterface().setPState( PStateType.P0);
-			
-			init = false;
-		}
-		
-
-		
-		SchedulingPlanNew plan = new SchedulingPlanNew();
-		// 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)
-			Queue q = queues.get(0);
-			// check all tasks in queue
-
-			for (int i = 0; i < q.size(); i++) {
-				GSSIMJobInterface<?> job = q.get(i);
-				TaskInterface<?> task = (TaskInterface<?>) job;
-				// if status of the tasks in READY
-				if (task.getStatus() == Gridlet.READY) {
-					String nodeName = chooseRandomProvider(resourceManager, task);
-					if (nodeName != null) {
-						addToSchedulingPlan(plan, task, nodeName);
-					}
-				}
-			}
-			break;
-		}
-		return plan;
-	}
-
-	private List<ComputingNode> findSuitableNodes(int cpuRequest, List<ComputingNode> nodes){
-		List<ComputingNode> avNodes = new ArrayList<ComputingNode>();
-		for(ComputingNode node: nodes){
-			if(node.getFreeProcessorsNumber() >= cpuRequest){
-				avNodes.add(node);
-			}
-		}
-		return avNodes;
-	}
-	
-	private String chooseRandomProvider(ClusterResourceManager resourceManager, TaskInterface<?> task) {
-		
-		int cpuRequest;
-		try {
-			cpuRequest = Double.valueOf(task.getCpuCntRequest()).intValue();
-		} catch (NoSuchFieldException e) {
-			cpuRequest = 1;
-		}
-		
-		List<ComputingNode> nodes = resourceManager.getComputingNodes();
-		
-		nodes = findSuitableNodes(cpuRequest, nodes);
-		
-		if( nodes.size() > 0)
-		{	
-			int nodeIdx = rand.nextInt(nodes.size());
-			return nodes.get(nodeIdx).getName();
-		}
-		else
-			return null;
-	}
-	
-	public String getName() {
-		return getClass().getName();
-	}
-
-	public void init(Properties properties) {
-		// no extra initialization is expected.
-	}
-
-}
-
Index: xssim/branches/tpiontek/src/example/localplugin/FCFSCPUFreqScalingClusterLocalPlugin.java
===================================================================
--- xssim/branches/tpiontek/src/example/localplugin/FCFSCPUFreqScalingClusterLocalPlugin.java	(revision 204)
+++ 	(revision )
@@ -1,190 +1,0 @@
-package example.localplugin;
-
-import gridsim.Gridlet;
-import gridsim.gssim.ResourceHistoryItem;
-import gridsim.gssim.SubmittedTask;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-
-import schedframe.resources.units.ResourceUnit;
-import schedframe.scheduling.TaskInterface;
-import schedframe.scheduling.events.SchedulingEvent;
-import schedframe.scheduling.events.TaskFinishedEvent;
-import schedframe.scheduling.events.TaskRequestedTimeExpiredEvent;
-import schedframe.scheduling.plugin.grid.ModuleList;
-import schedframe.scheduling.utils.ResourceParameterName;
-import test.rewolucja.GSSIMJobInterface;
-import test.rewolucja.energy.profile.PStateType;
-import test.rewolucja.resources.ProcessingElements;
-import test.rewolucja.resources.ResourceStatus;
-import test.rewolucja.resources.manager.implementation.ClusterResourceManager;
-import test.rewolucja.resources.manager.interfaces.ResourceManagerInterface;
-import test.rewolucja.resources.physical.base.ComputingResource;
-import test.rewolucja.resources.physical.implementation.Processor;
-import test.rewolucja.scheduling.JobRegistryInterface;
-import test.rewolucja.scheduling.UsedResourceList;
-import test.rewolucja.scheduling.plan.SchedulingPlanInterfaceNew;
-import test.rewolucja.scheduling.plan.SchedulingPlanNew;
-import test.rewolucja.scheduling.queue.Queue;
-import test.rewolucja.scheduling.queue.QueueList;
-
-public class FCFSCPUFreqScalingClusterLocalPlugin extends BaseLocalPlugin {
-
-	List<Processor> allocatedCPUs;
-	public FCFSCPUFreqScalingClusterLocalPlugin () {
-		allocatedCPUs = new ArrayList<Processor>();
-	}
-
-	public SchedulingPlanInterfaceNew schedule(SchedulingEvent event, QueueList queues, JobRegistryInterface jobRegistry,
-			ResourceManagerInterface resManager, ModuleList modules) {
-
-		ClusterResourceManager resourceManager = (ClusterResourceManager) resManager;
-		SchedulingPlanNew plan = new SchedulingPlanNew();
-		// our tasks are placed only in first queue (see
-		// BaseLocalPlugin.placeJobsInQueues() method)
-		Queue q = queues.get(0);
-		// chose the events types to serve.
-		// Different actions for different events are possible.
-		switch (event.getType()) {
-		
-		case START_TASK_EXECUTION:
-
-			// check all tasks in queue
-			for (int i = 0; i < q.size(); i++) {
-				GSSIMJobInterface<?> job = q.get(i);
-				TaskInterface<?> task = (TaskInterface<?>) job;
-				// if status of the tasks in READY
-				if (task.getStatus() == Gridlet.READY) {
-
-					Map<ResourceParameterName, ResourceUnit> choosenResources = chooseResourcesForExecution(resourceManager, task);
-					if (choosenResources  != null) {
-						addToSchedulingPlan(plan, task, choosenResources);
-						ProcessingElements pes = (ProcessingElements)choosenResources.get(ResourceParameterName.PROCESSINGELEMENTS);
-						List<Processor> processors =  new ArrayList<Processor>();
-						for(ComputingResource res : pes){
-							processors.add((Processor) res);
-						}
-						adjustFrequency(ResourceStatus.BUSY,processors);
-					} 
-				}
-			}
-			break;
-			
-		case TASK_FINISHED:
-			TaskFinishedEvent finEvent = (TaskFinishedEvent) event;
-			SubmittedTask subTask = jobRegistry.getSubmittedTask(finEvent.getJobId(), finEvent.getTaskId());
-			UsedResourceList<ResourceHistoryItem> usedResourcesList = subTask.getUsedResources();
-			ProcessingElements pes = (ProcessingElements)usedResourcesList.getLast().getResourceUnits().get(ResourceParameterName.PROCESSINGELEMENTS);
-			List<Processor> processors =  new ArrayList<Processor>();
-			for(ComputingResource res : pes){
-				processors.add((Processor) res);
-				allocatedCPUs.add((Processor) res);
-			}
-			adjustFrequency(ResourceStatus.FREE, processors);
-			break;
-			
-		case TASK_REQUESTED_TIME_EXPIRED:
-			TaskRequestedTimeExpiredEvent timExpEvent = (TaskRequestedTimeExpiredEvent) event;
-			 subTask = jobRegistry.getSubmittedTask(timExpEvent.getJobId(), timExpEvent.getTaskId());
-			usedResourcesList = subTask.getUsedResources();
-			pes = (ProcessingElements)usedResourcesList.getLast().getResourceUnits().get(ResourceParameterName.PROCESSINGELEMENTS);
-			processors =  new ArrayList<Processor>();
-			for(ComputingResource res : pes){
-				allocatedCPUs.remove((Processor) res);
-			}
-			// check all tasks in queue
-			for (int i = 0; i < q.size(); i++) {
-				GSSIMJobInterface<?> job = q.get(i);
-				TaskInterface<?> task = (TaskInterface<?>) job;
-				// if status of the tasks in READY
-				if (task.getStatus() == Gridlet.READY) {
-
-					Map<ResourceParameterName, ResourceUnit> choosenResources = chooseResourcesForExecution(resourceManager, task);
-					if (choosenResources  != null) {
-						addToSchedulingPlan(plan, task, choosenResources);
-						pes = (ProcessingElements)choosenResources.get(ResourceParameterName.PROCESSINGELEMENTS);
-						processors =  new ArrayList<Processor>();
-						for(ComputingResource res : pes){
-							processors.add((Processor) res);
-						}
-						adjustFrequency(ResourceStatus.BUSY, processors);
-					} 
-				}
-			}
-			break;
-		}
-		return plan;
-	}
-	
-	private HashMap<ResourceParameterName, ResourceUnit> chooseResourcesForExecution(
-			ClusterResourceManager resourceManager, TaskInterface<?> task) {
-
-		HashMap<ResourceParameterName, ResourceUnit> map = new HashMap<ResourceParameterName, 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(ResourceParameterName.PROCESSINGELEMENTS, result);
-		}
-		return map;
-	}
-
-	private void adjustFrequency(ResourceStatus status, List<Processor> processors){
-		switch(status){
-		case BUSY:
-			for(Processor cpu: processors){
-				if(cpu.getPowerInterface().getSupportedPStates().containsKey(PStateType.P0))
-					cpu.getPowerInterface().setPState(PStateType.P0);
-			}
-			break;
-		case FREE:
-			for(Processor cpu: processors){
-				if(cpu.getPowerInterface().getSupportedPStates().containsKey(PStateType.P3))
-					cpu.getPowerInterface().setPState(PStateType.P3);
-			}
-			break;
-		}
-	}
-	
-	public String getName() {
-		return getClass().getName();
-	}
-
-	public void init(Properties properties) {
-		// no extra initialization is expected.
-	}
-
-}
Index: xssim/branches/tpiontek/src/example/localplugin/FCFSEnergyAwareClusterLocalPlugin.java
===================================================================
--- xssim/branches/tpiontek/src/example/localplugin/FCFSEnergyAwareClusterLocalPlugin.java	(revision 192)
+++ 	(revision )
@@ -1,108 +1,0 @@
-package example.localplugin;
-
-import gridsim.Gridlet;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.List;
-import java.util.Properties;
-
-import schedframe.scheduling.TaskInterface;
-import schedframe.scheduling.events.SchedulingEvent;
-import schedframe.scheduling.plugin.grid.ModuleList;
-import test.rewolucja.GSSIMJobInterface;
-import test.rewolucja.resources.manager.implementation.ClusterResourceManager;
-import test.rewolucja.resources.manager.interfaces.ResourceManagerInterface;
-import test.rewolucja.resources.physical.implementation.ComputingNode;
-import test.rewolucja.scheduling.JobRegistryInterface;
-import test.rewolucja.scheduling.plan.SchedulingPlanInterfaceNew;
-import test.rewolucja.scheduling.plan.SchedulingPlanNew;
-import test.rewolucja.scheduling.queue.Queue;
-import test.rewolucja.scheduling.queue.QueueList;
-
-public class FCFSEnergyAwareClusterLocalPlugin extends BaseLocalPlugin {
-
-	public FCFSEnergyAwareClusterLocalPlugin () {
-	}
-
-	public SchedulingPlanInterfaceNew schedule(SchedulingEvent event, QueueList queues, JobRegistryInterface jobRegistry,
-			ResourceManagerInterface resManager, ModuleList modules) {
-
-		ClusterResourceManager resourceManager = (ClusterResourceManager) resManager;
-		SchedulingPlanNew plan = new SchedulingPlanNew();
-		// 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)
-			Queue q = queues.get(0);
-			// check all tasks in queue
-
-			for (int i = 0; i < q.size(); i++) {
-				GSSIMJobInterface<?> job = q.get(i);
-				TaskInterface<?> task = (TaskInterface<?>) job;
-				// if status of the tasks in READY
-				if (task.getStatus() == Gridlet.READY) {
-
-					String nodeName = chooseProviderForExecution(resourceManager, task);
-					if (nodeName != null) {
-						addToSchedulingPlan(plan, task, nodeName);
-					}
-				}
-			}
-
-			break;
-		}
-		return plan;
-	}
-
-	private String chooseProviderForExecution(ClusterResourceManager resourceManager, TaskInterface<?> task) {
-		int cpuRequest;
-		try {
-			cpuRequest = Double.valueOf(task.getCpuCntRequest()).intValue();
-		} catch (NoSuchFieldException e) {
-			cpuRequest = 1;
-		}
-		List<ComputingNode> nodes = resourceManager.getComputingNodes();
-		nodes = findSuitableNodes(cpuRequest, nodes);
-		Collections.sort(nodes, new Comparator<ComputingNode>(){
-			 
-		    public int compare(ComputingNode node1, ComputingNode node2){    
-		        return node1.getCategory().getName().compareTo(node2.getCategory().getName());
-		   
-		    }
-		});
-
-		return nodes.size() == 0 ? null : nodes.get(0).getName();
-	}
-	
-	private List<ComputingNode> findSuitableNodes(int cpuRequest, List<ComputingNode> nodes){
-		List<ComputingNode> avNodes = new ArrayList<ComputingNode>();
-		for(ComputingNode node: nodes){
-			if(node.getFreeProcessorsNumber() >= cpuRequest){
-				avNodes.add(node);
-			}
-		}
-		return avNodes;
-	}
-	
-	public String getName() {
-		return getClass().getName();
-	}
-
-	public void init(Properties properties) {
-		// no extra initialization is expected.
-	}
-
-	class CategoryComparator implements Comparator<String>{
-		 
-	    public int compare(String cat1, String cat2){    
-	        return cat1.compareTo(cat2);
-	   
-	    }
-	}
-}
-
Index: xssim/branches/tpiontek/src/example/timeestimation/ExecTimeEstimationPlugin.java
===================================================================
--- xssim/branches/tpiontek/src/example/timeestimation/ExecTimeEstimationPlugin.java	(revision 250)
+++ xssim/branches/tpiontek/src/example/timeestimation/ExecTimeEstimationPlugin.java	(revision 269)
@@ -54,5 +54,5 @@
 		if( type == 0 && ((Processor)pes.get(0)).getComputingNode().getCategory().getName().equals("A"))
 		{
-			factor = 0.6;
+			factor = 0.5;
 		}
 		
Index: xssim/branches/tpiontek/src/simulator/stats/implementation/GSSimStatistics.java
===================================================================
--- xssim/branches/tpiontek/src/simulator/stats/implementation/GSSimStatistics.java	(revision 267)
+++ xssim/branches/tpiontek/src/simulator/stats/implementation/GSSimStatistics.java	(revision 269)
@@ -203,4 +203,6 @@
 		e = System.currentTimeMillis();
 		log.info("time in sec: " + ((e - s) / 1000));
+		
+		System.out.println("SIMULATION DURATION = " + (endSimulationTime - startSimulationTime) / 1000);
 	}
 
