Index: DCWoRMS/branches/coolemall/src/example/load/AppBasedProcessorLoadEstimationPlugin.java
===================================================================
--- DCWoRMS/branches/coolemall/src/example/load/AppBasedProcessorLoadEstimationPlugin.java	(revision 1423)
+++ DCWoRMS/branches/coolemall/src/example/load/AppBasedProcessorLoadEstimationPlugin.java	(revision 1423)
@@ -0,0 +1,44 @@
+package example.load;
+
+import schedframe.resources.computing.Processor;
+import schedframe.resources.computing.profiles.energy.ResourceEvent;
+import schedframe.resources.devices.PhysicalResource;
+import schedframe.scheduling.manager.tasks.JobRegistry;
+import schedframe.scheduling.tasks.phases.PhaseSystemLoad;
+import dcworms.schedframe.scheduling.ExecTask;
+
+public class AppBasedProcessorLoadEstimationPlugin  extends BaseLoadEstimationPlugin{
+	
+	public double estimateUtlization(ResourceEvent event, JobRegistry jobRegistry, PhysicalResource resource) {
+		Processor proc = (Processor) resource;
+		double sumCoresLoad = 0;
+		
+		double nrOfThreadsOnCpu = proc.getCores().size();
+		
+		if(proc.getResourceCharacteristic().getParameters().get("threads") != null){
+			nrOfThreadsOnCpu = nrOfThreadsOnCpu * Integer.valueOf(proc.getResourceCharacteristic().getParameters().get("threads").get(0).getContent()).intValue();
+		}
+
+		for(ExecTask task: jobRegistry.getRunningTasks()){
+			double cpuUsage = 1 / nrOfThreadsOnCpu;
+
+			for(PhaseSystemLoad pb: task.getExecutionProfile().getCurrentExecutionPhase().getSystemLoad()){
+				if(pb.getResouceName().equals("PM_CPU_Usage")){
+					cpuUsage = pb.getUtilization();
+					break;
+				}
+			}
+			sumCoresLoad = sumCoresLoad + cpuUsage;
+		}
+
+
+		double processorLoad = 100 * sumCoresLoad;	
+		double calendarLoad = resource.getLoadInterface().getLoadCalendar().getCurrentLoad();
+		double totalLoad = processorLoad + calendarLoad;
+		if (totalLoad > 100)
+			return 100;
+		else return totalLoad;
+	}
+
+
+}
Index: DCWoRMS/branches/coolemall/src/example/load/ProcessorLoadEstimationPlugin.java
===================================================================
--- DCWoRMS/branches/coolemall/src/example/load/ProcessorLoadEstimationPlugin.java	(revision 1415)
+++ DCWoRMS/branches/coolemall/src/example/load/ProcessorLoadEstimationPlugin.java	(revision 1423)
@@ -1,11 +1,10 @@
 package example.load;
 
+import schedframe.resources.ResourceStatus;
+import schedframe.resources.computing.Core;
 import schedframe.resources.computing.Processor;
 import schedframe.resources.computing.profiles.energy.ResourceEvent;
 import schedframe.resources.devices.PhysicalResource;
 import schedframe.scheduling.manager.tasks.JobRegistry;
-import schedframe.scheduling.manager.tasks.JobRegistryImpl;
-import schedframe.scheduling.tasks.phases.PhaseSystemLoad;
-import dcworms.schedframe.scheduling.ExecTask;
 
 public class ProcessorLoadEstimationPlugin extends BaseLoadEstimationPlugin{
@@ -14,25 +13,16 @@
 		Processor proc = (Processor) resource;
 		double sumCoresLoad = 0;
-		
-		double nrOfThreadsOnCpu = proc.getCores().size();
-		
-		if(proc.getResourceCharacteristic().getParameters().get("threads") != null){
-			nrOfThreadsOnCpu = nrOfThreadsOnCpu * Integer.valueOf(proc.getResourceCharacteristic().getParameters().get("threads").get(0).getContent()).intValue();
+		if(proc.getStatus().equals(ResourceStatus.BUSY)){
+			sumCoresLoad = 1;
+		} else {
+			if(proc.getCores().size() > 0){
+				for(Core core: proc.getCores()){
+					if(core.getStatus().equals(ResourceStatus.BUSY)){
+						sumCoresLoad = sumCoresLoad + 1;
+					}
+				}
+				sumCoresLoad = sumCoresLoad / proc.getCores().size();	
+			}
 		}
-
-
-		JobRegistry jr = new JobRegistryImpl(proc.getFullName());
-		for(ExecTask task: jr.getRunningTasks()){
-			double cpuUsage = 1 / nrOfThreadsOnCpu;
-
-			for(PhaseSystemLoad pb: task.getExecutionProfile().getCurrentResourceConsumption().getSystemLoad()){
-				if(pb.getResouceName().equals("PM_CPU_Usage")){
-					cpuUsage = pb.getUtilization();
-				}
-			}
-			sumCoresLoad = sumCoresLoad + cpuUsage;
-
-		}
-
 
 		double processorLoad = 100 * sumCoresLoad;	
