Index: DCWoRMS/branches/coolemall/src/simulator/stats/implementation/DCWormsStatistics.java
===================================================================
--- DCWoRMS/branches/coolemall/src/simulator/stats/implementation/DCWormsStatistics.java	(revision 1337)
+++ DCWoRMS/branches/coolemall/src/simulator/stats/implementation/DCWormsStatistics.java	(revision 1357)
@@ -862,4 +862,49 @@
 	}
 	
+	private ResourceUsageStats gatherResourceOccupancyStatsNew(ComputingResource resource, Map<String, List<ResStat>> basicStats) {
+
+		String usageType = null;
+		if(resource.getResourceCharacteristic().getParameters().get("load-sensor")!= null){
+			usageType = resource.getResourceCharacteristic().getParameters().get("load-sensor").get(0).getContent();
+		}
+		ResourceUsageStats usageStats = new ResourceUsageStats(resource.getFullName(), resource.getType(), usageType);
+		int cnt = 0;
+		
+		ResourceType resType = null;
+
+		for(String key: basicStats.keySet()){
+			List<ResStat> resStats = basicStats.get(key);
+			resType = resStats.get(0).getResType();
+			break;
+		}
+		List<ComputingResource> resources = null;
+		try {
+			resources = new ArrayList<ComputingResource>();
+			for(ComputingResource compRes: resourceController.getComputingResources()){
+				resources.addAll(compRes.getDescendantsByType(resType));
+			}
+		} catch (Exception e) {
+
+		}
+		
+		List<String> resourcesNames = new ArrayList<String>(resources.size());
+		for(ComputingResource compRes: resources){
+			resourcesNames.add(compRes.getFullName());
+		}
+		
+		
+		for(String resName: basicStats.keySet()){
+				if( resourcesNames.contains(resName)  || resource.getFullName().compareTo(resName) == 0){
+					createResourceLoadData(usageStats, basicStats.get(resName));
+					cnt++;
+				}
+		}
+		for(Long key: usageStats.getHistory().keySet()){
+			Double value = usageStats.getHistory().get(key)/cnt;
+			usageStats.getHistory().put(key, value);
+		}
+		return usageStats;
+	}
+
 	private ResourceAvailabilityStats gatherResourceAvailabilityStats(ComputingResource resource) {
 		String usageType = new String ("usedNodes");
Index: DCWoRMS/branches/coolemall/src/simulator/workload/WorkloadLoader.java
===================================================================
--- DCWoRMS/branches/coolemall/src/simulator/workload/WorkloadLoader.java	(revision 1207)
+++ DCWoRMS/branches/coolemall/src/simulator/workload/WorkloadLoader.java	(revision 1357)
@@ -9,4 +9,5 @@
 import java.util.ArrayList;
 import java.util.Date;
+import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Locale;
@@ -70,5 +71,5 @@
 		this.generatedJobsCnt = 0;
 		this.generatedTasksCnt = 0;
-		this.jobsMap = new TreeMap<String, JobDescription>();
+		this.jobsMap = new LinkedHashMap<String, JobDescription>();
 		this.appProfilesFolder = appProfilesFolder;
 		this.applicationProfiles = new TreeMap<String, ApplicationProfileDescription>();
Index: DCWoRMS/branches/coolemall/src/schedframe/scheduling/policy/local/LocalManagementSystem.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/scheduling/policy/local/LocalManagementSystem.java	(revision 1332)
+++ DCWoRMS/branches/coolemall/src/schedframe/scheduling/policy/local/LocalManagementSystem.java	(revision 1357)
@@ -256,5 +256,5 @@
 		
 		PEUnit peUnit = (PEUnit)choosenResources.get(StandardResourceUnitName.PE);
-		notifyComputingResources(peUnit, EnergyEventType.TASK_STARTED, exec);
+		updateComputingResources(peUnit, EnergyEventType.TASK_STARTED, exec);
 		
 		updateTaskExecution(exec, SchedulingEventType.START_TASK_EXECUTION);
@@ -311,5 +311,5 @@
 		
 		PEUnit peUnit = (PEUnit)lastUsed.get(StandardResourceUnitName.PE);
-		notifyComputingResources(peUnit, EnergyEventType.TASK_FINISHED, exec);
+		updateComputingResources(peUnit, EnergyEventType.TASK_FINISHED, exec);
 	}
 	
@@ -342,5 +342,5 @@
 	}
 	
-	private void notifyComputingResources(PEUnit peUnit, EnergyEventType eventType, Object obj){
+	private void updateComputingResources(PEUnit peUnit, EnergyEventType eventType, Object obj){
 		if(peUnit instanceof ProcessingElements){
 			ProcessingElements pes = (ProcessingElements) peUnit;
@@ -427,9 +427,9 @@
 				scheduler.sendInternal(phaseDuration, DCWormsTags.TASK_EXECUTION_FINISHED, execTask);
 				PEUnit peUnit = (PEUnit)exec.getUsedResources().getLast().getResourceUnits().get(StandardResourceUnitName.PE);
-				notifyComputingResources(peUnit, EnergyEventType.RESOURCE_UTILIZATION_CHANGED, exec);
+				updateComputingResources(peUnit, EnergyEventType.RESOURCE_UTILIZATION_CHANGED, exec);
 			} else {
 				scheduler.sendInternal(phaseDuration, DCWormsTags.TASK_EXECUTION_CHANGED, execTask);
 				PEUnit peUnit = (PEUnit)exec.getUsedResources().getLast().getResourceUnits().get(StandardResourceUnitName.PE);
-				notifyComputingResources(peUnit, EnergyEventType.RESOURCE_UTILIZATION_CHANGED, exec);
+				updateComputingResources(peUnit, EnergyEventType.RESOURCE_UTILIZATION_CHANGED, exec);
 			}
 		}
Index: DCWoRMS/branches/coolemall/src/schedframe/scheduling/policy/global/GlobalManagementSystem.java
===================================================================
--- DCWoRMS/branches/coolemall/src/schedframe/scheduling/policy/global/GlobalManagementSystem.java	(revision 493)
+++ DCWoRMS/branches/coolemall/src/schedframe/scheduling/policy/global/GlobalManagementSystem.java	(revision 1357)
@@ -250,5 +250,5 @@
 	}
 
-	class GlobalWorkloadUnitHandler implements  WorkloadUnitHandler{
+	class GlobalWorkloadUnitHandler implements WorkloadUnitHandler{
 
 		public void handleJob(JobInterface<?> job){
