Index: /DCWoRMS/trunk/src/example/energy/CPUEnergyEstimationPlugin.java
===================================================================
--- /DCWoRMS/trunk/src/example/energy/CPUEnergyEstimationPlugin.java	(revision 477)
+++ /DCWoRMS/trunk/src/example/energy/CPUEnergyEstimationPlugin.java	(revision 497)
@@ -1,5 +1,4 @@
 package example.energy;
 
-import schedframe.resources.ResourceStatus;
 import schedframe.resources.computing.ComputingResource;
 import schedframe.resources.computing.Processor;
@@ -14,20 +13,19 @@
 			ComputingResource resource) {
 		Processor cpu = (Processor)resource;
-		if(resource.getPowerInterface().getPowerState().getName().equals(StandardPowerStateName.OFF))
+		if(resource.getPowerInterface().getPowerState().equals(StandardPowerStateName.OFF))
 			return 0;
-		if(resource.getStatus() == ResourceStatus.BUSY)
+		else {
 			try {
 				return cpu.getPowerInterface().getPowerConsumption(cpu.getPowerInterface().getPState());
 			} catch (NoSuchFieldException e) {
-				return 0;
+				try {
+					return cpu.getPowerInterface().getPowerConsumption(StandardPowerStateName.ON);
+				} catch (NoSuchFieldException e1) {
+				}
 			}
-		else 
-			return 1; 
+			return 1;
+		}
+
 	}
 
-	public String getName() {
-		return getClass().getName();
-	}
-
-
 }
Index: /DCWoRMS/trunk/src/example/energy/DataCenterEnergyEstimationPlugin.java
===================================================================
--- /DCWoRMS/trunk/src/example/energy/DataCenterEnergyEstimationPlugin.java	(revision 477)
+++ /DCWoRMS/trunk/src/example/energy/DataCenterEnergyEstimationPlugin.java	(revision 497)
@@ -18,12 +18,7 @@
 			power += (powerUsage == null ? 0 : powerUsage.getValue());
 		}
-		
-		//System.out.println( new DateTime() + "ENERGY CONSUMPT BY: " + resMan.getResourceName() +" IS: " + power);
+
 		return power;
 	}
 
-	public String getName() {
-		return getClass().getName();
-	}
-
 }
Index: /DCWoRMS/trunk/src/example/energy/ComputingNodeEnergyEstimationPlugin.java
===================================================================
--- /DCWoRMS/trunk/src/example/energy/ComputingNodeEnergyEstimationPlugin.java	(revision 477)
+++ /DCWoRMS/trunk/src/example/energy/ComputingNodeEnergyEstimationPlugin.java	(revision 497)
@@ -17,11 +17,10 @@
 			try{
 				power = power + cpu.getPowerInterface().getRecentPowerUsage().getValue();
-			} catch(Exception e){
-				//power = power + cpu.getPowerInterface().getPowerConsumption(cpu.getPowerInterface().getPowerState());
+			} catch (Exception e){
+				
 			}
 		}
-
 		try {
-			power += node.getPowerInterface().getPowerConsumption(node.getPowerInterface().getPowerState());
+			power = power + node.getPowerInterface().getPowerConsumption(node.getPowerInterface().getPowerState());
 		} catch (NoSuchFieldException e) {
 		}
@@ -30,7 +29,4 @@
 	}
 
-	public String getName() {
-		return getClass().getName();
-	}
 
 }
Index: /DCWoRMS/trunk/src/example/localplugin/FCFSRackLocalPlugin.java
===================================================================
--- /DCWoRMS/trunk/src/example/localplugin/FCFSRackLocalPlugin.java	(revision 497)
+++ /DCWoRMS/trunk/src/example/localplugin/FCFSRackLocalPlugin.java	(revision 497)
@@ -0,0 +1,56 @@
+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;
+import schedframe.scheduling.tasks.WorkloadUnit;
+
+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++) {
+				WorkloadUnit job = q.get(i);
+				TaskInterface<?> task = (TaskInterface<?>) job;
+				// 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/FCFSClusterLocalPlugin.java
===================================================================
--- /DCWoRMS/trunk/src/example/localplugin/FCFSClusterLocalPlugin.java	(revision 493)
+++ /DCWoRMS/trunk/src/example/localplugin/FCFSClusterLocalPlugin.java	(revision 497)
@@ -57,5 +57,5 @@
 					
 					/****************1. Choosing particular resources to perform execution****************/
-					Map<ResourceUnitName, ResourceUnit> choosenResources = chooseResourcesForExecution2(resourceManager, task);
+					Map<ResourceUnitName, ResourceUnit> choosenResources = chooseResourcesForExecution(resourceManager, task);
 					if (choosenResources != null) {
 						addToSchedulingPlan(plan, task, choosenResources);
@@ -80,72 +80,4 @@
 
 	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 = 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(StandardResourceUnitName.PE, 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) {
-				try{
-					if (node.getFreeMemory() >= memoryRequest) {		
-						memory = new Memory(node.getMemory(), memoryRequest, memoryRequest);
-					}		
-				} catch(NoSuchFieldException e){
-					memory = null;
-				}
-			}
-			if(memory != null)
-				map.put(StandardResourceUnitName.MEMORY, memory);
-			else return null;
-		}
-
-		return map;
-	}
-
-
-	private Map<ResourceUnitName, ResourceUnit> chooseResourcesForExecution2(
 			ClusterResourceManager resourceManager, TaskInterface<?> task) {
 
@@ -204,5 +136,5 @@
 						return map;
 					}
-				}
+				} else return map;
 			}
 		}
Index: /DCWoRMS/trunk/src/example/localplugin/FCFSNodePowerManagementClusterLocalPlugin.java
===================================================================
--- /DCWoRMS/trunk/src/example/localplugin/FCFSNodePowerManagementClusterLocalPlugin.java	(revision 493)
+++ /DCWoRMS/trunk/src/example/localplugin/FCFSNodePowerManagementClusterLocalPlugin.java	(revision 497)
@@ -40,18 +40,14 @@
 		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++) {
 				WorkloadUnit job = q.get(i);
 				TaskInterface<?> task = (TaskInterface<?>) job;
-				// if status of the tasks in READY
 				if (task.getStatus() == DCWormsTags.READY) {
 
@@ -65,7 +61,5 @@
 				}
 			}
-
 			turnOffIdleNodes(resourceManager.getComputingNodes());
-
 			break;
 		}
@@ -151,9 +145,4 @@
 		return cpuRequest > 0 ? false : true;
 	}
-	
-	public String getName() {
-		return getClass().getName();
-	}
-
 
 }
Index: /DCWoRMS/trunk/src/example/localplugin/FCFSRandomClusterLocalPlugin.java
===================================================================
--- /DCWoRMS/trunk/src/example/localplugin/FCFSRandomClusterLocalPlugin.java	(revision 493)
+++ /DCWoRMS/trunk/src/example/localplugin/FCFSRandomClusterLocalPlugin.java	(revision 497)
@@ -41,6 +41,6 @@
 			// BaseLocalPlugin.placeJobsInQueues() method)
 			TaskQueue q = queues.get(0);
+			
 			// check all tasks in queue
-
 			for (int i = 0; i < q.size(); i++) {
 				WorkloadUnit job = q.get(i);
@@ -48,12 +48,9 @@
 				// if status of the tasks in READY
 				if (task.getStatus() == DCWormsTags.READY) {
-					/*for(ResourceUnitName key:resManager.getSharedResourceUnits().keySet()){
-						System.out.println(key.getName());
-					}*/
-					addToSchedulingPlan(plan, task);
-					/*String nodeName = chooseRandomProvider(resourceManager);
+
+					String nodeName = chooseRandomProvider(resourceManager);
 					if (nodeName != null) {
 						addToSchedulingPlan(plan, task, nodeName);
-					}*/
+					}
 				}
 			}
@@ -68,9 +65,4 @@
 		return nodes.get(nodeIdx).getName();
 	}
-	
-	public String getName() {
-		return getClass().getName();
-	}
-
 
 }
Index: /DCWoRMS/trunk/src/example/localplugin/FCFSConsolidationClusterLocalPlugin.java
===================================================================
--- /DCWoRMS/trunk/src/example/localplugin/FCFSConsolidationClusterLocalPlugin.java	(revision 493)
+++ /DCWoRMS/trunk/src/example/localplugin/FCFSConsolidationClusterLocalPlugin.java	(revision 497)
@@ -140,8 +140,4 @@
 		return suitableNodes;
 	}
-	
-	public String getName() {
-		return getClass().getName();
-	}
 
 }
Index: /DCWoRMS/trunk/src/example/localplugin/FCFSCPUFreqScalingClusterLocalPlugin.java
===================================================================
--- /DCWoRMS/trunk/src/example/localplugin/FCFSCPUFreqScalingClusterLocalPlugin.java	(revision 493)
+++ /DCWoRMS/trunk/src/example/localplugin/FCFSCPUFreqScalingClusterLocalPlugin.java	(revision 497)
@@ -187,8 +187,4 @@
 		}
 	}
-	
-	public String getName() {
-		return getClass().getName();
-	}
 
 }
Index: WoRMS/trunk/src/example/localplugin/FCFSEnergyAwareClusterLocalPlugin.java
===================================================================
--- /DCWoRMS/trunk/src/example/localplugin/FCFSEnergyAwareClusterLocalPlugin.java	(revision 493)
+++ 	(revision )
@@ -1,103 +1,0 @@
-package example.localplugin;
-
-import gridsim.dcworms.DCWormsTags;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.List;
-
-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;
-import schedframe.scheduling.tasks.WorkloadUnit;
-
-public class FCFSEnergyAwareClusterLocalPlugin extends BaseLocalSchedulingPlugin {
-
-	public FCFSEnergyAwareClusterLocalPlugin () {
-	}
-
-	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++) {
-				WorkloadUnit job = q.get(i);
-				TaskInterface<?> task = (TaskInterface<?>) job;
-				// if status of the tasks in READY
-				if (task.getStatus() == DCWormsTags.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.getResourceCharacteristic().getParameters().get("category").get(0).getContent().compareTo(node2.getResourceCharacteristic().getParameters().get("category").get(0).getContent());
-		   
-		    }
-		});
-
-		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();
-	}
-
-	class CategoryComparator implements Comparator<String>{
-		 
-	    public int compare(String cat1, String cat2){    
-	        return cat1.compareTo(cat2);
-	   
-	    }
-	}
-}
-
Index: WoRMS/trunk/src/example/localplugin/RackLocalPlugin.java
===================================================================
--- /DCWoRMS/trunk/src/example/localplugin/RackLocalPlugin.java	(revision 493)
+++ 	(revision )
@@ -1,61 +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;
-import schedframe.scheduling.tasks.WorkloadUnit;
-
-public class RackLocalPlugin  extends BaseLocalSchedulingPlugin {
-
-	public RackLocalPlugin() {
-	}
-
-	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++) {
-				WorkloadUnit job = q.get(i);
-				TaskInterface<?> task = (TaskInterface<?>) job;
-				// 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;
-	}
-
-	
-	public String getName() {
-		return getClass().getName();
-	}
-
-
-}
Index: /DCWoRMS/trunk/src/example/timeestimation/DefaultTimeEstimationPlugin.java
===================================================================
--- /DCWoRMS/trunk/src/example/timeestimation/DefaultTimeEstimationPlugin.java	(revision 490)
+++ /DCWoRMS/trunk/src/example/timeestimation/DefaultTimeEstimationPlugin.java	(revision 497)
@@ -44,5 +44,5 @@
 
 		// estimate remainingTaskLength
-		double remainingLength =  task.getLength() * (1 - completionPercentage);
+		double remainingLength =  task.getLength() * (1 - completionPercentage/100);
 		
 		// do the calculation
Index: /DCWoRMS/trunk/src/example/globalplugin/GridFCFSLoadBalancingPlugin.java
===================================================================
--- /DCWoRMS/trunk/src/example/globalplugin/GridFCFSLoadBalancingPlugin.java	(revision 481)
+++ /DCWoRMS/trunk/src/example/globalplugin/GridFCFSLoadBalancingPlugin.java	(revision 497)
@@ -74,12 +74,4 @@
 	}
 
-	public String getName() {
-		return getClass().getName();
-	}
-
-	public void init(Properties properties) {
-		// no extra initialization is expected.
-	}
-	
 	private int findLeastLoadedResourceIdx(List<SchedulerDescription> availableResources){
 		int resourceIdx = -1;
Index: /DCWoRMS/trunk/src/example/globalplugin/GridFCFSRandomPlugin.java
===================================================================
--- /DCWoRMS/trunk/src/example/globalplugin/GridFCFSRandomPlugin.java	(revision 478)
+++ /DCWoRMS/trunk/src/example/globalplugin/GridFCFSRandomPlugin.java	(revision 497)
@@ -75,12 +75,3 @@
 	}
 
-
-	public String getName() {
-		return getClass().getName();
-	}
-
-	public void init(Properties properties) {
-		// no extra initialization is expected.
-	}
-
 }
Index: /DCWoRMS/trunk/src/example/globalplugin/GridFCFSRoundRobinPlugin.java
===================================================================
--- /DCWoRMS/trunk/src/example/globalplugin/GridFCFSRoundRobinPlugin.java	(revision 478)
+++ /DCWoRMS/trunk/src/example/globalplugin/GridFCFSRoundRobinPlugin.java	(revision 497)
@@ -75,8 +75,3 @@
 	}
 
-	public String getName() {
-		return getClass().getName();
-	}
-
-
 }
Index: /DCWoRMS/trunk/src/example/globalplugin/BaseGlobalPlugin.java
===================================================================
--- /DCWoRMS/trunk/src/example/globalplugin/BaseGlobalPlugin.java	(revision 490)
+++ /DCWoRMS/trunk/src/example/globalplugin/BaseGlobalPlugin.java	(revision 497)
@@ -46,4 +46,7 @@
 	}
 	
+	public String getName() {
+		return getClass().getName();
+	}
 	
 }
Index: /DCWoRMS/trunk/src/simulator/stats/implementation/DCWormsStatistics.java
===================================================================
--- /DCWoRMS/trunk/src/simulator/stats/implementation/DCWormsStatistics.java	(revision 496)
+++ /DCWoRMS/trunk/src/simulator/stats/implementation/DCWormsStatistics.java	(revision 497)
@@ -315,5 +315,5 @@
 					if(type_stats.get(resourceName).contains(Stats.textLoad)){
 						resourceUsage = gatherResourceLoadStats(resource, basicResStats);
-						resourceUsage.setMeanValue(calculateResourceLoad(resource, basicResLoad));
+						resourceUsage.setMeanValue(calculateMeanValue(resourceUsage));
 						if (resourceLoadStatsFile != null) {
 							Object txt = resourceUsage.serialize(serializer);
@@ -452,4 +452,6 @@
 
 			List<ResourceHistoryItem> resHistItemList = exec.getUsedResources();
+			if(resHistItemList.size() == 0)
+				return basicResStats;
 			Map<ResourceUnitName, ResourceUnit> res = resHistItemList.get(resHistItemList.size() - 1).getResourceUnits();
 			ResourceUnit resUnit = res.get(StandardResourceUnitName.PE);
@@ -492,12 +494,12 @@
 	}
 	
-	private ResourceUsageStats gatherResourceLoadStats(ComputingResource resource, Map<String,List<ResStat>> basicStats) {
+	private ResourceUsageStats gatherResourceLoadStats(ComputingResource resource, Map<String, List<ResStat>> basicStats) {
 		ResourceUsageStats usageStats = new ResourceUsageStats(resource.getName(), resource.getType(), "resourceLoadStats");
-		int cnt =0;
+		int cnt = 0;
 		for(String resName: basicStats.keySet()){
 			try {
 				if(resource.getDescendantByName(resName) != null || resource.getName().compareTo(resName) == 0){
+					createResourceLoadData(usageStats, basicStats.get(resName));
 					cnt++;
-					createResourceLoadData(usageStats, basicStats.get(resName));
 				}
 			} catch (ResourceException e) {
@@ -508,5 +510,5 @@
 		for(Long key: usageStats.getHistory().keySet()){
 			Double value = usageStats.getHistory().get(key)/cnt;
-			usageStats.getHistory().put(key, 100*value);
+			usageStats.getHistory().put(key, value);
 		}
 
@@ -627,4 +629,9 @@
 	private void createResourceLoadDiagram(ResourceUsageStats resLoadStats) {
 
+		for(Long key: resLoadStats.getHistory().keySet()){
+			Double value = resLoadStats.getHistory().get(key) * 100;
+			resLoadStats.getHistory().put(key, value);
+		}
+
 		XYDataset dataset = createResourceChartDataSet(resLoadStats,
 				startSimulationTime, endSimulationTime);
@@ -861,5 +868,5 @@
 
 
-
+	//TO DO
 	private void createAccumulatedResourceSimulationStatistic() {
 
@@ -867,4 +874,7 @@
 		for(ComputingResource compRes: resources){
 			//for(ComputingResource child :compRes.getChildren()){
+			
+				//ResourceUsageStats resourceUsage = gatherResourceLoadStats(compRes, basicResStats);
+				//double load = calculateMeanValue(resourceUsage);
 				double load = calculateResourceLoad(compRes, basicResLoad);
 				accStats.meanTotalLoad.add(load);
@@ -876,6 +886,6 @@
 	}
 
-	private HashMap<String, Double> calculatePELoad(Map<String,List<ResStat>> basicResStats){
-		HashMap<String, Double> peLoad = new HashMap<String, Double>();
+	private Map<String, Double> calculatePELoad(Map<String, List<ResStat>> basicResStats){
+		Map<String, Double> peLoad = new HashMap<String, Double>();
 		for(String resName: basicResStats.keySet()){
 			List<ResStat> resStats = basicResStats.get(resName);
Index: /DCWoRMS/trunk/src/schedframe/scheduling/policy/local/LocalManagementSystem.java
===================================================================
--- /DCWoRMS/trunk/src/schedframe/scheduling/policy/local/LocalManagementSystem.java	(revision 493)
+++ /DCWoRMS/trunk/src/schedframe/scheduling/policy/local/LocalManagementSystem.java	(revision 497)
@@ -6,4 +6,5 @@
 import eduni.simjava.Sim_system;
 import gridsim.Accumulator;
+import gridsim.GridSimTags;
 import gridsim.ResourceCalendar;
 import gridsim.dcworms.DCWormsTags;
@@ -115,5 +116,4 @@
 
 		case DCWormsTags.TASK_READY_FOR_EXECUTION:
-			
 			ExecTask execTask = (ExecTask) ev.get_data();
 			try {
@@ -347,10 +347,10 @@
 			ExecTask task = iter.next();
 			Executable exec = (Executable)task;
+			exec.setCompletionPercentage(exec.getCompletionPercentage() + 100 * timeSpan/exec.getEstimatedDuration());
+			
 			UsedResourcesList usedResourcesList = exec.getUsedResources();
 			PEUnit peUnit = (PEUnit)usedResourcesList.getLast().getResourceUnits()
 					.get(StandardResourceUnitName.PE);
-
 			double load = getMIShare(timeSpan, peUnit);
-			exec.setCompletionPercentage(100 * timeSpan/exec.getEstimatedDuration());
 			addTotalLoad(load);
 		}
@@ -401,6 +401,6 @@
 			
 			Map<ResourceUnitName, ResourceUnit> choosenResources = exec.getUsedResources().getLast().getResourceUnits();
-			double time = execTimeEstimationPlugin.execTimeEstimation(new SchedulingEvent(SchedulingEventType.RESOURCE_STATE_CHANGED), 
-					execTask, choosenResources, exec.getCompletionPercentage());
+			int time =  Double.valueOf(execTimeEstimationPlugin.execTimeEstimation(new SchedulingEvent(SchedulingEventType.RESOURCE_STATE_CHANGED), 
+					execTask, choosenResources, exec.getCompletionPercentage())).intValue();
 
 			//check if the new estimated end time is equal to the previous one; if yes the continue without update
@@ -408,4 +408,5 @@
 				continue;
 			}
+			exec.setEstimatedDuration(time);
 			ExecTaskFilter filter = new ExecTaskFilter(exec.getUniqueId(), DCWormsTags.TASK_EXECUTION_FINISHED);
 			scheduler.sim_cancel(filter, null);
@@ -449,5 +450,5 @@
 
 		Map<ResourceUnitName, ResourceUnit> map = new HashMap<ResourceUnitName, ResourceUnit>();
-		ResourceManager resourceManager = this.resourceManager;
+		LocalResourceManager resourceManager = getResourceManager();
 		if(resourceName != null){
 			ComputingResource resource = null;
@@ -471,5 +472,5 @@
 			List<ResourceUnit> availableUnits = null;
 			try {
-				availableUnits = getResourceManager().getPE();
+				availableUnits = resourceManager.getPE();
 			} catch (ResourceException e) {
 				return null;
Index: /DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/power/ui/ComputingNodePowerInterface.java
===================================================================
--- /DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/power/ui/ComputingNodePowerInterface.java	(revision 495)
+++ /DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/power/ui/ComputingNodePowerInterface.java	(revision 497)
@@ -28,13 +28,18 @@
 		currentPowerState = state;
 		ComputingNode computingNode = (ComputingNode) resource;
+		boolean pePowerStateChangeStatus = false;
 		if(computingNode.getProcessors() != null)
 		{
 			for(ComputingResource child:computingNode.getProcessors()){
-				child.getPowerInterface().setPowerState(state);
+				if(child.getPowerInterface() != null){
+					pePowerStateChangeStatus = child.getPowerInterface().setPowerState(state);	
+				}
 			}
-		} else {
+		} 
+		
+		if(!pePowerStateChangeStatus){
 			computingNode.handleEvent(new EnergyEvent(EnergyEventType.POWER_STATE_CHANGED, computingNode.getName()));
 		}
-		
+
 		if(state == StandardPowerStateName.OFF){
 			computingNode.setStatus(ResourceStatus.UNAVAILABLE);
@@ -46,31 +51,4 @@
 		return true;
 	}
-	
-	/*public double getPowerConsumption(PowerState state) {
-		if(currentPowerState == PowerState.OFF)
-			return 0;
-		else if(currentPowerState == PowerState.ON)
-			return 750;
-		else return 500;
-	}*/
-
-	/*public boolean supportPowerState(PowerState state) {
-		switch(state){
-			case ON: 
-				return true;
-			case OFF: 
-				return true;
-			case SLEEP: 
-				return true;
-			case HIBERNATE: 
-				return true;
-			default: 
-				return false;
-		}
-	}
-
-	public List<PowerState> getSupportedPowerStates() {
-		return Arrays.asList(new PowerState[]{PowerState.ON, PowerState.OFF, PowerState.SLEEP, PowerState.HIBERNATE});
-	}*/
 
 	public void turnOn(){
Index: /DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/power/ui/ProcessorPowerInterface.java
===================================================================
--- /DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/power/ui/ProcessorPowerInterface.java	(revision 495)
+++ /DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/power/ui/ProcessorPowerInterface.java	(revision 497)
@@ -81,5 +81,5 @@
 			currentPState = newPState;
 			CpuSpeed speed = (CpuSpeed)resource.getResourceCharacteristic().getResourceUnits().get(StandardResourceUnitName.CPUSPEED).get(0);
-			speed.setAmount(Double.valueOf(currentPState.getFrequency()).intValue());
+			//speed.setAmount(Double.valueOf(currentPState.getFrequency()).intValue());
 			//new ResourceEventCommand(resource).execute(EnergyEventType.FREQUENCY_CHANGED);
 			resource.handleEvent(new EnergyEvent(EnergyEventType.FREQUENCY_CHANGED, resource.getName()));
Index: /DCWoRMS/trunk/src/schedframe/resources/computing/ComputingNode.java
===================================================================
--- /DCWoRMS/trunk/src/schedframe/resources/computing/ComputingNode.java	(revision 495)
+++ /DCWoRMS/trunk/src/schedframe/resources/computing/ComputingNode.java	(revision 497)
@@ -39,10 +39,10 @@
 	
 	public ComputingNodePowerInterface getPowerInterface(){
-		ComputingNodePowerInterface powerProfile = null;
+		ComputingNodePowerInterface powerInterface = null;
 		if(extensionList.isExtensionAvailable(ExtensionType.ENERGY_EXTENSION)){
 			EnergyExtension ee = (EnergyExtension)extensionList.getExtension(ExtensionType.ENERGY_EXTENSION);
-			powerProfile = (ComputingNodePowerInterface)ee.getPowerInterface();
+			powerInterface = (ComputingNodePowerInterface)ee.getPowerInterface();
 		}
-		return powerProfile;
+		return powerInterface;
 	}
 
