Index: /DCWoRMS/trunk/build/classes/example/energy/CPUEnergyEstimationPlugin.java
===================================================================
--- /DCWoRMS/trunk/build/classes/example/energy/CPUEnergyEstimationPlugin.java	(revision 477)
+++ /DCWoRMS/trunk/build/classes/example/energy/CPUEnergyEstimationPlugin.java	(revision 539)
@@ -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/build/classes/example/energy/BaseEnergyEstimationPlugin.java
===================================================================
--- /DCWoRMS/trunk/build/classes/example/energy/BaseEnergyEstimationPlugin.java	(revision 477)
+++ /DCWoRMS/trunk/build/classes/example/energy/BaseEnergyEstimationPlugin.java	(revision 539)
@@ -31,5 +31,5 @@
 
 	@Override
-	public double estimateEnergyDissipation(EnergyEvent event, JobRegistry jobRegistry, ComputingResource resourceManager) {
+	public double estimateAirThroughput(EnergyEvent event, JobRegistry jobRegistry, ComputingResource resourceManager) {
 		throw new RuntimeException("Not implemented.");
 	}
@@ -44,3 +44,6 @@
 	}
 
+	public String getName() {
+		return getClass().getName();
+	}
 }
Index: /DCWoRMS/trunk/build/classes/example/energy/DataCenterEnergyEstimationPlugin.java
===================================================================
--- /DCWoRMS/trunk/build/classes/example/energy/DataCenterEnergyEstimationPlugin.java	(revision 477)
+++ /DCWoRMS/trunk/build/classes/example/energy/DataCenterEnergyEstimationPlugin.java	(revision 539)
@@ -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/build/classes/example/energy/ComputingNodeEnergyEstimationPlugin.java
===================================================================
--- /DCWoRMS/trunk/build/classes/example/energy/ComputingNodeEnergyEstimationPlugin.java	(revision 477)
+++ /DCWoRMS/trunk/build/classes/example/energy/ComputingNodeEnergyEstimationPlugin.java	(revision 539)
@@ -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/build/classes/example/localplugin/FCFSClusterLocalPlugin.java
===================================================================
--- /DCWoRMS/trunk/build/classes/example/localplugin/FCFSClusterLocalPlugin.java	(revision 477)
+++ /DCWoRMS/trunk/build/classes/example/localplugin/FCFSClusterLocalPlugin.java	(revision 539)
@@ -1,5 +1,5 @@
 package example.localplugin;
 
-import gridsim.Gridlet;
+import gridsim.dcworms.DCWormsTags;
 
 import java.util.ArrayList;
@@ -31,5 +31,5 @@
 import schedframe.scheduling.tasks.WorkloadUnit;
 
-public class FCFSClusterLocalPlugin extends BaseLocalPlugin {
+public class FCFSClusterLocalPlugin extends BaseLocalSchedulingPlugin {
 
 	public SchedulingPlanInterface<?> schedule(SchedulingEvent event, TaskQueueList queues, JobRegistry jobRegistry,
@@ -49,13 +49,13 @@
 
 			for (int i = 0; i < q.size(); i++) {
-				WorkloadUnit<?> job = q.get(i);
+				WorkloadUnit job = q.get(i);
 				TaskInterface<?> task = (TaskInterface<?>) job;
 				// if status of the tasks in READY
-				if (task.getStatus() == Gridlet.READY) {
+				if (task.getStatus() == DCWormsTags.READY) {
 					
 					/****************3 ways to schedule task****************/
 					
 					/****************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) {
 
@@ -178,5 +110,5 @@
 				}
 
-				ProcessingElements result = new ProcessingElements(processors.get(0).getParent().getName());
+				ProcessingElements result = new ProcessingElements();
 				result.addAll(choosenResources);
 				map.put(StandardResourceUnitName.PE, result);
@@ -204,5 +136,5 @@
 						return map;
 					}
-				}
+				} else return map;
 			}
 		}
@@ -221,7 +153,3 @@
 	}
 
-	public String getName() {
-		return getClass().getName();
-	}
-
 }
Index: /DCWoRMS/trunk/build/classes/example/localplugin/FCFS_BFLocalPlugin.java
===================================================================
--- /DCWoRMS/trunk/build/classes/example/localplugin/FCFS_BFLocalPlugin.java	(revision 477)
+++ /DCWoRMS/trunk/build/classes/example/localplugin/FCFS_BFLocalPlugin.java	(revision 539)
@@ -1,9 +1,8 @@
 package example.localplugin;
 
-import gridsim.Gridlet;
+import gridsim.dcworms.DCWormsTags;
 import schedframe.events.scheduling.SchedulingEvent;
 import schedframe.scheduling.manager.resources.ResourceManager;
 import schedframe.scheduling.manager.tasks.JobRegistry;
-import schedframe.scheduling.plan.SchedulingPlanInterface;
 import schedframe.scheduling.plan.impl.SchedulingPlan;
 import schedframe.scheduling.plugin.grid.ModuleList;
@@ -13,26 +12,25 @@
 import schedframe.scheduling.tasks.WorkloadUnit;
 
-public class FCFS_BFLocalPlugin extends BaseLocalPlugin {
+public class FCFS_BFLocalPlugin extends BaseLocalSchedulingPlugin {
 
-	public SchedulingPlanInterface<?> schedule(SchedulingEvent event, TaskQueueList queues, JobRegistry jobRegistry,
+	public SchedulingPlan schedule(SchedulingEvent event, TaskQueueList queues, JobRegistry jobRegistry,
 			 ResourceManager resManager, ModuleList modules) {
 
 		SchedulingPlan plan = new SchedulingPlan();
-		// chose the events types to serve.
-		// Different actions for different events are possible.
+		// 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);
 			
-			TaskQueue q = queues.get(0);
 			// check all tasks in queue
 			for (int i = 0; i < q.size(); i++) {
-				WorkloadUnit<?> job = q.get(i);
+				WorkloadUnit job = q.get(i);
 				TaskInterface<?> task = (TaskInterface<?>) job;
 				
 				// if status of the tasks in READY
-				if (task.getStatus() == Gridlet.READY) {
+				if (task.getStatus() == DCWormsTags.READY) {
 					addToSchedulingPlan(plan, task);
 				}
@@ -43,9 +41,4 @@
 	}
 
-	public String getName() {
-		return getClass().getName();
-	}
-
-
 }
 
Index: /DCWoRMS/trunk/build/classes/example/localplugin/FCFSNodePowerManagementClusterLocalPlugin.java
===================================================================
--- /DCWoRMS/trunk/build/classes/example/localplugin/FCFSNodePowerManagementClusterLocalPlugin.java	(revision 477)
+++ /DCWoRMS/trunk/build/classes/example/localplugin/FCFSNodePowerManagementClusterLocalPlugin.java	(revision 539)
@@ -1,5 +1,5 @@
 package example.localplugin;
 
-import gridsim.Gridlet;
+import gridsim.dcworms.DCWormsTags;
 
 import java.util.ArrayList;
@@ -30,29 +30,25 @@
 import schedframe.scheduling.tasks.WorkloadUnit;
 
-public class FCFSNodePowerManagementClusterLocalPlugin extends BaseLocalPlugin {
+public class FCFSNodePowerManagementClusterLocalPlugin extends BaseLocalSchedulingPlugin {
 
 	public FCFSNodePowerManagementClusterLocalPlugin () {
 	}
 
-	public SchedulingPlanInterface schedule(SchedulingEvent event, TaskQueueList queues, JobRegistry jobRegistry,
+	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);
+				WorkloadUnit job = q.get(i);
 				TaskInterface<?> task = (TaskInterface<?>) job;
-				// if status of the tasks in READY
-				if (task.getStatus() == Gridlet.READY) {
+				if (task.getStatus() == DCWormsTags.READY) {
 
 					Map<ResourceUnitName, ResourceUnit> choosenResources = chooseResourcesForExecution(resourceManager, task);
@@ -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/build/classes/example/localplugin/FCFSConsolidationClusterLocalPlugin.java
===================================================================
--- /DCWoRMS/trunk/build/classes/example/localplugin/FCFSConsolidationClusterLocalPlugin.java	(revision 477)
+++ /DCWoRMS/trunk/build/classes/example/localplugin/FCFSConsolidationClusterLocalPlugin.java	(revision 539)
@@ -1,5 +1,5 @@
 package example.localplugin;
 
-import gridsim.Gridlet;
+import gridsim.dcworms.DCWormsTags;
 
 import java.util.ArrayList;
@@ -30,10 +30,10 @@
 import schedframe.scheduling.tasks.WorkloadUnit;
 
-public class FCFSConsolidationClusterLocalPlugin extends BaseLocalPlugin {
+public class FCFSConsolidationClusterLocalPlugin extends BaseLocalSchedulingPlugin {
 
 	public FCFSConsolidationClusterLocalPlugin () {
 	}
 
-	public SchedulingPlanInterface schedule(SchedulingEvent event, TaskQueueList queues, JobRegistry jobRegistry,
+	public SchedulingPlanInterface<?> schedule(SchedulingEvent event, TaskQueueList queues, JobRegistry jobRegistry,
 			ResourceManager resManager, ModuleList modules) {
 
@@ -51,8 +51,8 @@
 
 			for (int i = 0; i < q.size(); i++) {
-				WorkloadUnit<?> job = q.get(i);
+				WorkloadUnit job = q.get(i);
 				TaskInterface<?> task = (TaskInterface<?>) job;
 				// if status of the tasks in READY
-				if (task.getStatus() == Gridlet.READY) {
+				if (task.getStatus() == DCWormsTags.READY) {
 
 					Map<ResourceUnitName, ResourceUnit> choosenResources = null;
@@ -140,8 +140,4 @@
 		return suitableNodes;
 	}
-	
-	public String getName() {
-		return getClass().getName();
-	}
 
 }
Index: /DCWoRMS/trunk/build/classes/example/localplugin/FCFSCPUFreqScalingClusterLocalPlugin.java
===================================================================
--- /DCWoRMS/trunk/build/classes/example/localplugin/FCFSCPUFreqScalingClusterLocalPlugin.java	(revision 477)
+++ /DCWoRMS/trunk/build/classes/example/localplugin/FCFSCPUFreqScalingClusterLocalPlugin.java	(revision 539)
@@ -1,5 +1,5 @@
 package example.localplugin;
 
-import gridsim.Gridlet;
+import gridsim.dcworms.DCWormsTags;
 
 import java.util.ArrayList;
@@ -18,6 +18,5 @@
 import schedframe.resources.units.ResourceUnitName;
 import schedframe.resources.units.StandardResourceUnitName;
-import schedframe.scheduling.ResourceHistoryItem;
-import schedframe.scheduling.UsedResourceList;
+import schedframe.scheduling.UsedResourcesList;
 import schedframe.scheduling.manager.resources.ClusterResourceManager;
 import schedframe.scheduling.manager.resources.ResourceManager;
@@ -28,9 +27,9 @@
 import schedframe.scheduling.queue.TaskQueue;
 import schedframe.scheduling.queue.TaskQueueList;
-import schedframe.scheduling.tasks.SubmittedTask;
 import schedframe.scheduling.tasks.TaskInterface;
 import schedframe.scheduling.tasks.WorkloadUnit;
+import dcworms.schedframe.scheduling.Executable;
 
-public class FCFSCPUFreqScalingClusterLocalPlugin extends BaseLocalPlugin {
+public class FCFSCPUFreqScalingClusterLocalPlugin extends BaseLocalSchedulingPlugin {
 
 	List<Processor> allocatedCPUs;
@@ -39,5 +38,5 @@
 	}
 
-	public SchedulingPlanInterface schedule(SchedulingEvent event, TaskQueueList queues, JobRegistry jobRegistry,
+	public SchedulingPlanInterface<?> schedule(SchedulingEvent event, TaskQueueList queues, JobRegistry jobRegistry,
 			ResourceManager resManager, ModuleList modules) {
 
@@ -55,8 +54,8 @@
 			// check all tasks in queue
 			for (int i = 0; i < q.size(); i++) {
-				WorkloadUnit<?> job = q.get(i);
+				WorkloadUnit job = q.get(i);
 				TaskInterface<?> task = (TaskInterface<?>) job;
 				// if status of the tasks in READY
-				if (task.getStatus() == Gridlet.READY) {
+				if (task.getStatus() == DCWormsTags.READY) {
 
 					Map<ResourceUnitName, ResourceUnit> choosenResources = chooseResourcesForExecution(resourceManager, task);
@@ -76,6 +75,6 @@
 		case TASK_FINISHED:
 			TaskFinishedEvent finEvent = (TaskFinishedEvent) event;
-			SubmittedTask subTask = (SubmittedTask )jobRegistry.getSubmittedTask(finEvent.getJobId(), finEvent.getTaskId());
-			UsedResourceList<ResourceHistoryItem> usedResourcesList = subTask.getUsedResources();
+			Executable exec = (Executable) jobRegistry.getExecutable(finEvent.getJobId(), finEvent.getTaskId());
+			UsedResourcesList usedResourcesList = exec.getUsedResources();
 			ProcessingElements pes = (ProcessingElements)usedResourcesList.getLast().getResourceUnits().get(StandardResourceUnitName.PE);
 			List<Processor> processors =  new ArrayList<Processor>();
@@ -89,6 +88,6 @@
 		case TASK_REQUESTED_TIME_EXPIRED:
 			TaskRequestedTimeExpiredEvent timExpEvent = (TaskRequestedTimeExpiredEvent) event;
-			 subTask = (SubmittedTask )jobRegistry.getSubmittedTask(timExpEvent.getJobId(), timExpEvent.getTaskId());
-			usedResourcesList = subTask.getUsedResources();
+			exec = (Executable) jobRegistry.getExecutable(timExpEvent.getJobId(), timExpEvent.getTaskId());
+			usedResourcesList = exec.getUsedResources();
 			pes = (ProcessingElements)usedResourcesList.getLast().getResourceUnits().get(StandardResourceUnitName.PE);
 			processors =  new ArrayList<Processor>();
@@ -98,8 +97,8 @@
 			// check all tasks in queue
 			for (int i = 0; i < q.size(); i++) {
-				WorkloadUnit<?> job = q.get(i);
+				WorkloadUnit job = q.get(i);
 				TaskInterface<?> task = (TaskInterface<?>) job;
 				// if status of the tasks in READY
-				if (task.getStatus() == Gridlet.READY) {
+				if (task.getStatus() == DCWormsTags.READY) {
 
 					Map<ResourceUnitName, ResourceUnit> choosenResources = chooseResourcesForExecution(resourceManager, task);
@@ -188,8 +187,4 @@
 		}
 	}
-	
-	public String getName() {
-		return getClass().getName();
-	}
 
 }
Index: /DCWoRMS/trunk/build/classes/example/localplugin/BaseLocalSchedulingPlugin.java
===================================================================
--- /DCWoRMS/trunk/build/classes/example/localplugin/BaseLocalSchedulingPlugin.java	(revision 539)
+++ /DCWoRMS/trunk/build/classes/example/localplugin/BaseLocalSchedulingPlugin.java	(revision 539)
@@ -0,0 +1,118 @@
+package example.localplugin;
+
+import java.util.Map;
+
+import schedframe.Parameters;
+import schedframe.PluginConfiguration;
+import schedframe.events.scheduling.SchedulingEvent;
+import schedframe.events.scheduling.SchedulingEventType;
+import schedframe.events.scheduling.SchedulingResponseType;
+import schedframe.resources.units.ResourceUnit;
+import schedframe.resources.units.ResourceUnitName;
+import schedframe.scheduling.TaskList;
+import schedframe.scheduling.manager.resources.ResourceManager;
+import schedframe.scheduling.manager.tasks.JobRegistryImpl;
+import schedframe.scheduling.plan.impl.Allocation;
+import schedframe.scheduling.plan.impl.ScheduledTask;
+import schedframe.scheduling.plan.impl.SchedulingPlan;
+import schedframe.scheduling.plugin.SchedulingPluginConfiguration;
+import schedframe.scheduling.plugin.grid.ModuleList;
+import schedframe.scheduling.plugin.local.LocalSchedulingPlugin;
+import schedframe.scheduling.queue.TaskQueue;
+import schedframe.scheduling.queue.TaskQueueList;
+import schedframe.scheduling.tasks.TaskInterface;
+import schemas.StringValueWithUnit;
+
+public abstract class BaseLocalSchedulingPlugin implements LocalSchedulingPlugin {
+
+	SchedulingPluginConfiguration plugConf;
+	
+	public PluginConfiguration getConfiguration() {
+		return plugConf;
+	}
+	
+	public SchedulingResponseType handleResourceAllocationViolation(SchedulingEvent event,
+			TaskQueueList queues, 
+			JobRegistryImpl jobRegistry, 
+					ResourceManager resourceManager, ModuleList modules){
+		SchedulingResponseType responeEvent = null;
+		switch(event.getType()){
+			case TASK_REQUESTED_TIME_EXPIRED: 
+				responeEvent = SchedulingResponseType.KILL_TASK;
+				break;
+		}
+		return responeEvent;
+	}
+	
+	public int placeTasksInQueues(TaskList newTasks,
+			TaskQueueList queues, 
+			ResourceManager resourceManager, ModuleList moduleList) {
+		
+		// get the first queue from all available queues.
+		TaskQueue queue = queues.get(0);
+
+		for(int i = 0; i < newTasks.size(); i++){
+			TaskInterface<?> task = newTasks.get(i);
+			queue.add(task);
+		}
+		
+		return 0;
+	}
+	
+	public void addToSchedulingPlan(SchedulingPlan plan, TaskInterface<?> task, Map<ResourceUnitName, ResourceUnit> choosenResources ){
+		
+		Allocation allocation = new Allocation();
+		allocation.setProcessesCount(1);
+		allocation.setSpecificResources(choosenResources);
+		
+		ScheduledTask scheduledTask = new ScheduledTask(task);
+		scheduledTask.setTaskId(task.getId());
+		scheduledTask.setJobId(task.getJobId());
+		scheduledTask.addAllocation(allocation);		
+		
+		plan.addTask(scheduledTask);
+	}
+	
+	public void addToSchedulingPlan(SchedulingPlan plan, TaskInterface<?> task, String providerName){
+		
+		Allocation allocation = new Allocation();
+		allocation.setProcessesCount(1);
+		allocation.setProviderName(providerName);
+		
+		ScheduledTask scheduledTask = new ScheduledTask(task);
+		scheduledTask.setTaskId(task.getId());
+		scheduledTask.setJobId(task.getJobId());
+		scheduledTask.addAllocation(allocation);		
+		
+		plan.addTask(scheduledTask);
+	}
+	
+	public void addToSchedulingPlan(SchedulingPlan plan, TaskInterface<?> task){
+		
+		Allocation allocation = new Allocation();
+		allocation.setProcessesCount(1);
+		allocation.setProviderName(null);
+		
+		ScheduledTask scheduledTask = new ScheduledTask(task);
+		scheduledTask.setTaskId(task.getId());
+		scheduledTask.setJobId(task.getJobId());
+		scheduledTask.addAllocation(allocation);		
+		
+		plan.addTask(scheduledTask);
+	}
+
+	public void init(Parameters parameters) {
+		plugConf = new SchedulingPluginConfiguration();
+		try{
+			StringValueWithUnit freq = parameters.get("frequency").get(0);
+			plugConf.addServedEvent(SchedulingEventType.TIMER, Double.valueOf(freq.getContent()).intValue());
+		} catch(Exception e){
+			
+		}
+	}
+
+	public String getName() {
+		return getClass().getName();
+	}
+
+}
Index: /DCWoRMS/trunk/build/classes/example/localplugin/FCFSRackLocalPlugin.java
===================================================================
--- /DCWoRMS/trunk/build/classes/example/localplugin/FCFSRackLocalPlugin.java	(revision 539)
+++ /DCWoRMS/trunk/build/classes/example/localplugin/FCFSRackLocalPlugin.java	(revision 539)
@@ -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/build/classes/example/localplugin/FCFSRandomClusterLocalPlugin.java
===================================================================
--- /DCWoRMS/trunk/build/classes/example/localplugin/FCFSRandomClusterLocalPlugin.java	(revision 477)
+++ /DCWoRMS/trunk/build/classes/example/localplugin/FCFSRandomClusterLocalPlugin.java	(revision 539)
@@ -1,5 +1,5 @@
 package example.localplugin;
 
-import gridsim.Gridlet;
+import gridsim.dcworms.DCWormsTags;
 
 import java.util.List;
@@ -19,5 +19,5 @@
 import schedframe.scheduling.tasks.WorkloadUnit;
 
-public class FCFSRandomClusterLocalPlugin extends BaseLocalPlugin {
+public class FCFSRandomClusterLocalPlugin extends BaseLocalSchedulingPlugin {
 
 	private Random rand;
@@ -41,19 +41,16 @@
 			// 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);
+				WorkloadUnit job = q.get(i);
 				TaskInterface<?> task = (TaskInterface<?>) job;
 				// if status of the tasks in READY
-				if (task.getStatus() == Gridlet.READY) {
-					/*for(ResourceUnitName key:resManager.getSharedResourceUnits().keySet()){
-						System.out.println(key.getName());
-					}*/
-					addToSchedulingPlan(plan, task);
-					/*String nodeName = chooseRandomProvider(resourceManager);
+				if (task.getStatus() == DCWormsTags.READY) {
+
+					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/build/classes/example/timeestimation/BaseTimeEstimationPlugin.java
===================================================================
--- /DCWoRMS/trunk/build/classes/example/timeestimation/BaseTimeEstimationPlugin.java	(revision 539)
+++ /DCWoRMS/trunk/build/classes/example/timeestimation/BaseTimeEstimationPlugin.java	(revision 539)
@@ -0,0 +1,19 @@
+package example.timeestimation;
+
+import schedframe.Parameters;
+import schedframe.PluginConfiguration;
+import schedframe.scheduling.plugin.estimation.ExecutionTimeEstimationPlugin;
+
+public abstract class BaseTimeEstimationPlugin implements ExecutionTimeEstimationPlugin{
+	
+	public PluginConfiguration getConfiguration() {
+		return null;
+	}
+
+	public String getName() {
+		return getClass().getName();
+	}
+
+	public void init(Parameters parameters) {
+	}
+}
Index: /DCWoRMS/trunk/build/classes/example/timeestimation/DefaultTimeEstimationPlugin.java
===================================================================
--- /DCWoRMS/trunk/build/classes/example/timeestimation/DefaultTimeEstimationPlugin.java	(revision 477)
+++ /DCWoRMS/trunk/build/classes/example/timeestimation/DefaultTimeEstimationPlugin.java	(revision 539)
@@ -1,10 +1,9 @@
 package example.timeestimation;
 
-import gssim.schedframe.scheduling.ExecTask;
 
 import java.util.Map;
 
-import schedframe.Parameters;
-import schedframe.PluginConfiguration;
+import dcworms.schedframe.scheduling.ExecTask;
+
 import schedframe.events.scheduling.SchedulingEvent;
 import schedframe.resources.units.PEUnit;
@@ -16,13 +15,14 @@
 /**
  * 
- * @author Marcin Krystek
+ * @author Marcin Krystek && Wojciech Piatek
  *
  */
-public class DefaultTimeEstimationPlugin implements schedframe.scheduling.plugin.estimation.ExecutionTimeEstimationPlugin{
+
+public class DefaultTimeEstimationPlugin extends BaseTimeEstimationPlugin{
 
 	/*
 	 * This method should return an estimation of time required to execute the task.
 	 * Requested calculation should be done based on the resources allocated for the task,
-	 * task description and task remaining length (in instructions).
+	 * task description and task completion percentage.
 	 * 
 	 * Example implementation calculate the estimation based on cpu processing power.
@@ -30,7 +30,7 @@
 	 * of number of allocated cpus and their speed.
 	 */
-	public double execTimeEstimation(SchedulingEvent event,
+	public double execTimeEstimation(SchedulingEvent event, ExecTask task,
 			Map<ResourceUnitName, ResourceUnit> allocatedResources,
-			ExecTask task, double completionPercentage) {
+			double completionPercentage) {
 		
 		// collect all information necessary to do the calculation
@@ -43,5 +43,7 @@
 		int cnt = peUnit.getUsedAmount();
 
-		double remainingLength =  task.getLength() * (1- completionPercentage);
+		// estimate remainingTaskLength
+		double remainingLength =  task.getLength() * (1 - completionPercentage/100);
+		
 		// do the calculation
 		double execTime = (remainingLength / (cnt * speed));
@@ -57,14 +59,3 @@
 	}
 
-	public PluginConfiguration getConfiguration() {
-		return null;
-	}
-
-	public String getName() {
-		return "ExampleTimeEstimationPlugin";
-	}
-
-	public void init(Parameters parameters) {
-	}
-
 }
Index: /DCWoRMS/trunk/build/classes/example/globalplugin/GridFCFSLoadBalancingPlugin.java
===================================================================
--- /DCWoRMS/trunk/build/classes/example/globalplugin/GridFCFSLoadBalancingPlugin.java	(revision 477)
+++ /DCWoRMS/trunk/build/classes/example/globalplugin/GridFCFSLoadBalancingPlugin.java	(revision 539)
@@ -19,6 +19,6 @@
 import schedframe.scheduling.plugin.grid.ModuleList;
 import schedframe.scheduling.plugin.grid.ResourceDiscovery;
+import schedframe.scheduling.queue.QueueDescription;
 import schedframe.scheduling.queue.TaskQueue;
-import schedframe.scheduling.queue.QueueDescription;
 import schedframe.scheduling.queue.TaskQueueList;
 import schedframe.scheduling.tasks.TaskInterface;
@@ -29,5 +29,5 @@
 	private Log log = LogFactory.getLog(GridFCFSLoadBalancingPlugin.class);
 	
-	public SchedulingPlanInterface schedule(SchedulingEvent event,
+	public SchedulingPlanInterface<?> schedule(SchedulingEvent event,
 			TaskQueueList queues, 
 			JobRegistry jobRegistry,
@@ -53,5 +53,5 @@
 		
 		for(int i = 0; i < size; i++) {
-			WorkloadUnit<?> job = q.remove(0);
+			WorkloadUnit job = q.remove(0);
 			TaskInterface<?> task = (TaskInterface<?>)job;
 
@@ -74,16 +74,8 @@
 	}
 
-	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;
 		long minLoad = Long.MAX_VALUE;
+		
 		for(int i = 0; i < availableResources.size(); i++){
 			SchedulerDescription sd = availableResources.get(i);
Index: /DCWoRMS/trunk/build/classes/example/globalplugin/GridFCFSRandomPlugin.java
===================================================================
--- /DCWoRMS/trunk/build/classes/example/globalplugin/GridFCFSRandomPlugin.java	(revision 477)
+++ /DCWoRMS/trunk/build/classes/example/globalplugin/GridFCFSRandomPlugin.java	(revision 539)
@@ -53,5 +53,5 @@
 		
 		for(int i = 0; i < size; i++) {
-			WorkloadUnit<?> job = q.remove(0);
+			WorkloadUnit job = q.remove(0);
 			TaskInterface<?> task = (TaskInterface<?>)job;
 			
@@ -75,12 +75,3 @@
 	}
 
-
-	public String getName() {
-		return getClass().getName();
-	}
-
-	public void init(Properties properties) {
-		// no extra initialization is expected.
-	}
-
 }
Index: /DCWoRMS/trunk/build/classes/example/globalplugin/GridFCFSRoundRobinPlugin.java
===================================================================
--- /DCWoRMS/trunk/build/classes/example/globalplugin/GridFCFSRoundRobinPlugin.java	(revision 477)
+++ /DCWoRMS/trunk/build/classes/example/globalplugin/GridFCFSRoundRobinPlugin.java	(revision 539)
@@ -47,5 +47,5 @@
 		
 		for(int i = 0; i < size; i++) {
-			WorkloadUnit<?> job = q.remove(0);
+			WorkloadUnit job = q.remove(0);
 			TaskInterface<?> task = (TaskInterface<?>)job;
 			
@@ -65,5 +65,4 @@
 			allocation.setProcessesCount(1);
 			allocation.setProviderName(sd.getProvider().getProviderId());
-			System.out.println("----" + sd.getProvider().getProviderId());
 			ScheduledTask scheduledTask = new ScheduledTask(task);
 			scheduledTask.setTaskId(task.getId());
@@ -76,8 +75,3 @@
 	}
 
-	public String getName() {
-		return getClass().getName();
-	}
-
-
 }
Index: /DCWoRMS/trunk/build/classes/example/globalplugin/BaseGlobalPlugin.java
===================================================================
--- /DCWoRMS/trunk/build/classes/example/globalplugin/BaseGlobalPlugin.java	(revision 477)
+++ /DCWoRMS/trunk/build/classes/example/globalplugin/BaseGlobalPlugin.java	(revision 539)
@@ -4,5 +4,5 @@
 import schedframe.PluginConfiguration;
 import schedframe.events.scheduling.SchedulingEventType;
-import schedframe.scheduling.WorkloadUnitListImpl;
+import schedframe.scheduling.TaskList;
 import schedframe.scheduling.manager.resources.ResourceManager;
 import schedframe.scheduling.plugin.SchedulingPluginConfiguration;
@@ -11,5 +11,5 @@
 import schedframe.scheduling.queue.TaskQueue;
 import schedframe.scheduling.queue.TaskQueueList;
-import schedframe.scheduling.tasks.WorkloadUnit;
+import schedframe.scheduling.tasks.TaskInterface;
 import schemas.StringValueWithUnit;
 
@@ -22,5 +22,5 @@
 	}
 	
-	public int placeJobsInQueues(WorkloadUnitListImpl newJobs, TaskQueueList queues, ResourceManager resourceManager,
+	public int placeTasksInQueues(TaskList newTasks, TaskQueueList queues, ResourceManager resourceManager,
 			ModuleList moduleList) {
 
@@ -28,6 +28,6 @@
 		TaskQueue queue = queues.get(0);
 
-		for (int i = 0; i < newJobs.size(); i++) {
-			WorkloadUnit<?> task = newJobs.get(i);
+		for (int i = 0; i < newTasks.size(); i++) {
+			TaskInterface<?> task = newTasks.get(i);
 			queue.add(task);
 		}
@@ -46,4 +46,7 @@
 	}
 	
+	public String getName() {
+		return getClass().getName();
+	}
 	
 }
Index: /DCWoRMS/trunk/build/classes/dcworms/schedframe/scheduling/plugin/local/DCWormsTimeOperations.java
===================================================================
--- /DCWoRMS/trunk/build/classes/dcworms/schedframe/scheduling/plugin/local/DCWormsTimeOperations.java	(revision 539)
+++ /DCWoRMS/trunk/build/classes/dcworms/schedframe/scheduling/plugin/local/DCWormsTimeOperations.java	(revision 539)
@@ -0,0 +1,25 @@
+package dcworms.schedframe.scheduling.plugin.local;
+
+import org.joda.time.DateTime;
+
+import schedframe.scheduling.plugin.local.TimeOperations;
+
+public class DCWormsTimeOperations extends TimeOperations {
+
+	public DCWormsTimeOperations(){
+		this(0);
+	}
+	
+	public DCWormsTimeOperations(long timeDelta){
+		super(timeDelta);
+	}
+
+	/**
+	 * Get Calendar object representing current logic time
+	 * @return current time
+	 */
+	public DateTime getTime() {
+		return new DateTime();
+	}
+
+}
Index: /DCWoRMS/trunk/build/classes/dcworms/schedframe/scheduling/utils/TaskDescription.java
===================================================================
--- /DCWoRMS/trunk/build/classes/dcworms/schedframe/scheduling/utils/TaskDescription.java	(revision 539)
+++ /DCWoRMS/trunk/build/classes/dcworms/schedframe/scheduling/utils/TaskDescription.java	(revision 539)
@@ -0,0 +1,108 @@
+package dcworms.schedframe.scheduling.utils;
+
+import java.io.StringReader;
+
+import org.exolab.castor.xml.MarshalException;
+import org.exolab.castor.xml.ResolverException;
+import org.exolab.castor.xml.Unmarshaller;
+import org.exolab.castor.xml.ValidationException;
+import org.exolab.castor.xml.XMLContext;
+
+import org.qcg.broker.schemas.jobdesc.Task;
+
+import schedframe.DescriptionContainer;
+
+public class TaskDescription implements DescriptionContainer<Task> {
+
+	
+	protected static Unmarshaller unmarshaller;
+	static {
+		XMLContext context = new XMLContext();
+		try {
+			context.addClass(org.qcg.broker.schemas.jobdesc.Task.class);
+			unmarshaller = context.createUnmarshaller();
+		} catch (ResolverException e) {
+			e.printStackTrace();
+			unmarshaller = null;
+		}
+	}
+	
+	protected String xml;
+	protected Task task;
+	protected String taskId;
+	protected String userDn;
+	protected long submissionTime;
+	protected long taskLength;
+	protected long waitTime;
+	
+	
+	public TaskDescription(String xmlTask){
+		xml = xmlTask;
+	}
+	
+	public String getTaskId(){
+		return taskId;
+	}
+	
+	public void setTaskId(String id){
+		this.taskId = id;
+	}
+	
+	
+	
+	public void discardUnused(){
+		xml = null;
+		task = null;
+	}
+	
+	public Task getDescription() {
+		if(task == null){
+			try {
+				task = (Task) unmarshaller.unmarshal(new StringReader(xml));
+			} catch (MarshalException e) {
+				e.printStackTrace();
+			} catch (ValidationException e) {
+				e.printStackTrace();
+			}
+		}
+		
+		return task;
+	}
+
+	public String getDocument() throws Exception {
+		return xml;
+	}
+
+	public String getUserDn() {
+		return userDn;
+	}
+
+	public void setUserDn(String userDn) {
+		this.userDn = userDn;
+	}
+
+	public long getSubmissionTime() {
+		return submissionTime;
+	}
+
+	public void setSubmissionTime(long submissionTime) {
+		this.submissionTime = submissionTime;
+	}
+
+	public long getTaskLength() {
+		return taskLength;
+	}
+
+	public void setTaskLength(long taskLength) {
+		this.taskLength = taskLength;
+	}
+	
+	public long getWorkloadLogWaitTime() {
+		return waitTime;
+	}
+
+	public void setWorkloadLogWaitTime(long waitTime) {
+		this.waitTime = waitTime;
+	}
+
+}
Index: /DCWoRMS/trunk/build/classes/dcworms/schedframe/scheduling/utils/JobDescription.java
===================================================================
--- /DCWoRMS/trunk/build/classes/dcworms/schedframe/scheduling/utils/JobDescription.java	(revision 539)
+++ /DCWoRMS/trunk/build/classes/dcworms/schedframe/scheduling/utils/JobDescription.java	(revision 539)
@@ -0,0 +1,73 @@
+package dcworms.schedframe.scheduling.utils;
+
+import java.io.StringReader;
+import java.util.ArrayList;
+
+import org.exolab.castor.xml.MarshalException;
+import org.exolab.castor.xml.ResolverException;
+import org.exolab.castor.xml.Unmarshaller;
+import org.exolab.castor.xml.ValidationException;
+import org.exolab.castor.xml.XMLContext;
+
+import schedframe.DescriptionContainer;
+
+import org.qcg.broker.schemas.jobdesc.QcgJob;
+
+
+public class JobDescription extends ArrayList<TaskDescription> implements DescriptionContainer<QcgJob>{
+
+	private static final long serialVersionUID = 7853990656207447619L;
+	protected static Unmarshaller unmarshaller;
+	static {
+		XMLContext context = new XMLContext();
+		try {
+			context.addClass(org.qcg.broker.schemas.jobdesc.QcgJob.class);
+			unmarshaller = context.createUnmarshaller();
+		} catch (ResolverException e) {
+			e.printStackTrace();
+			unmarshaller = null;
+		}
+	}
+	
+	protected String xml;
+	protected QcgJob job;
+	protected String jobId;
+	
+	public JobDescription(String xmlJobDesc) throws MarshalException, ValidationException{
+		xml = xmlJobDesc;
+	}
+	
+	public String getJobId(){
+		return this.jobId;
+	}
+	
+	public void setJobId(String id){
+		this.jobId = id;
+	}
+	
+	public void discardUnused(){
+		job = null;
+		xml = null;
+		for(int i = 0; i < size(); i++){
+			get(i).discardUnused();
+		}
+	}
+	
+	public QcgJob getDescription() {
+		if(job == null){
+			try {
+				job = (QcgJob) unmarshaller.unmarshal(new StringReader(xml));
+			} catch (MarshalException e) {
+				e.printStackTrace();
+			} catch (ValidationException e) {
+				e.printStackTrace();
+			}
+		}
+		return job;
+	}
+
+	public String getDocument() throws Exception {
+		return xml;
+	}
+
+}
Index: /DCWoRMS/trunk/build/classes/dcworms/schedframe/scheduling/Executable.java
===================================================================
--- /DCWoRMS/trunk/build/classes/dcworms/schedframe/scheduling/Executable.java	(revision 539)
+++ /DCWoRMS/trunk/build/classes/dcworms/schedframe/scheduling/Executable.java	(revision 539)
@@ -0,0 +1,367 @@
+package dcworms.schedframe.scheduling;
+
+
+import gridsim.GridSim;
+import gridsim.dcworms.DCWormsTags;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.commons.lang.ArrayUtils;
+import org.joda.time.DateTime;
+import org.joda.time.DateTimeUtilsExt;
+import org.joda.time.ReadableDuration;
+
+
+import schedframe.resources.computing.ComputingResource;
+import schedframe.resources.units.ProcessingElements;
+import schedframe.resources.units.StandardResourceUnitName;
+import schedframe.scheduling.ResourceHistoryItem;
+import schedframe.scheduling.UsedResourcesList;
+import schedframe.scheduling.WorkloadUnitHandler;
+import schedframe.scheduling.manager.tasks.JobRegistryImpl;
+import schedframe.scheduling.tasks.AbstractProcesses;
+import schedframe.scheduling.tasks.AbstractProcessesGroup;
+import schedframe.scheduling.tasks.Task;
+import schedframe.scheduling.tasks.requirements.ResourceParameterName;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+public class Executable implements ExecTask{
+
+	protected Task task;
+	protected String processesSetId;
+	
+	protected int status; 
+	protected double length;
+	protected Map<ResourceParameterName, Object> specificResources;
+	
+	protected String reservationId;
+	protected double completionPercentage;
+	
+	protected int estimatedDuration;
+	//TO DO remove and benefit from visitedResources
+	protected String schedName;
+	protected UsedResourcesList usedResources;
+	//TO DO consider removing
+	protected List<String> visitedResources;
+
+	protected double submissionTime;
+    protected double arrivalTime;
+	protected double execStartTime ;
+    protected double totalCompletionTime; 
+	protected double finishTime; 
+	
+	public Executable(Task t){
+		this.task = t;
+		this.status = DCWormsTags.CREATED;
+		
+		this.usedResources = new UsedResourcesList();
+		this.visitedResources = new ArrayList<String>();
+		init();
+	}
+	
+	public Executable(Task t, AbstractProcesses procesesSet){
+		this.task = t;
+		this.status = DCWormsTags.CREATED;
+		this.processesSetId = procesesSet.getId(); 
+		
+		this.usedResources = new UsedResourcesList();
+		this.visitedResources = new ArrayList<String>();
+		init();
+	}
+	
+	protected void init() {
+		double currentTime = DateTimeUtilsExt.getDateTimeAt(arrivalTime).getMillis() / 1000;
+		this.submissionTime =  currentTime;
+        this.totalCompletionTime = 0.0;
+	 }
+	
+	public int getUserId() {
+		return task.getSenderId();
+	}
+	public String getUserDN() {
+		return task.getUserDN();
+	}
+
+	public String getJobId() {
+		return task.getJobId();
+	}
+	
+	public String getTaskId(){
+		return this.task.getId();
+	}
+	
+	public String getId() {
+		if(processesSetId == null)
+			return task.getId();
+		else 
+			return task.getId() + "_" + processesSetId;
+	}
+	
+	public String getProcessesId(){
+		return this.processesSetId;
+	}
+	
+    public int getUniqueId(){
+    	if(processesSetId == null){
+    		return (task.getJobId() + "_" + task.getId()).hashCode();
+    	} else {
+    		return (task.getJobId() + "_" + task.getId() + "_" + processesSetId).hashCode();
+    	}
+    }
+    
+	public List<AbstractProcesses> getProcesses() {
+		return task.getProcesses();
+	}
+
+	public List<AbstractProcesses> getProcesses(
+			AbstractProcessesGroup processGroup) {
+		return task.getProcesses(processGroup);
+	}
+
+	public List<AbstractProcessesGroup> getProcessesGroups() {
+		return task.getProcessesGroups();
+	}
+
+	public org.qcg.broker.schemas.resreqs.Task getDescription() {
+		return task.getDescription();
+	}
+
+	public String getDocument() throws Exception {
+		return task.getDocument();
+	}
+	
+	public long getLength() {
+		return task.getLength();
+	}
+
+	public int getStatus() {
+		return status;
+	}
+	
+	public boolean isFinished()
+    {
+		return task.isFinished();
+    }
+	
+	public void setStatus(int newStatus) throws Exception {
+		int prevStatus = status;
+	    
+        if (status == newStatus) {
+            return;
+        }
+
+        if (newStatus < DCWormsTags.CREATED || newStatus > DCWormsTags.FAILED_RESOURCE_UNAVAILABLE) {
+            throw new Exception("Executable.setStatuts() : Error - " +
+                    "Invalid integer range for Execiutable status.");
+        }
+
+        status = newStatus;
+        double currentTime = DateTimeUtilsExt.currentTimeMillis() / 1000; // time in seconds 
+    
+		
+		if (newStatus == DCWormsTags.SUCCESS || newStatus == DCWormsTags.CANCELED) {
+            finishTime = DateTimeUtilsExt.currentTimeMillis() / 1000;
+        }
+		
+		if(newStatus == DCWormsTags.SUBMITTED){
+			 arrivalTime = GridSim.clock();
+		}
+
+        if (prevStatus == DCWormsTags.INEXEC) {
+            if (status == DCWormsTags.CANCELED || status == DCWormsTags.PAUSED ||
+                status == DCWormsTags.SUCCESS) {
+                totalCompletionTime += (currentTime -  execStartTime);
+            }
+        }
+
+        if (prevStatus == DCWormsTags.RESUMED && status == DCWormsTags.SUCCESS) {
+            totalCompletionTime += (currentTime -  execStartTime);
+        }
+
+        if (status == DCWormsTags.INEXEC ||
+            (prevStatus == DCWormsTags.PAUSED && status == DCWormsTags.RESUMED) ) {
+        	execStartTime = currentTime;
+        	
+    		ProcessingElements pes = (ProcessingElements) getUsedResources().getLast().getResourceUnits().get(StandardResourceUnitName.PE);
+    		for (ComputingResource resource : pes) {
+
+    			trackResource(resource.getName());
+    			
+    			ComputingResource parent = resource.getParent();
+				List<String> visitedResource = getVisitedResources();
+				String [] visitedResourcesArray = visitedResource.toArray(new String[visitedResource.size()]);
+    			while (parent != null && !ArrayUtils.contains(visitedResourcesArray, parent.getName())) {
+    				trackResource(parent.getName());
+    				parent = parent.getParent();
+    			}
+    		}
+        }
+	}
+	
+	public void addSpecificResource(ResourceParameterName resourceName, Object value){
+		if(this.specificResources == null)
+			this.specificResources = new HashMap<ResourceParameterName, Object>();
+		
+		this.specificResources.put(resourceName, value);
+	}
+
+	public boolean expectSpecificResource(ResourceParameterName resourceName){
+		if(this.specificResources == null)
+			return false;
+
+		return this.specificResources.containsKey(resourceName);
+	}
+	
+	public Object getExpectedSpecificResource(ResourceParameterName resourceName){
+		if(this.specificResources == null)
+			return null;
+		
+		return this.specificResources.get(resourceName);
+	}
+	
+	public void setReservationId(String reservationId){
+		this.reservationId = reservationId;
+	}
+	
+	public boolean requireReservation(){
+		return (reservationId != null);
+	}
+	
+	public String getReservationId(){
+		return this.reservationId;
+	}
+	
+	public double getCompletionPercentage() {
+		return completionPercentage;
+	}
+
+	public void setCompletionPercentage(double completionPercentage) {
+		this.completionPercentage = completionPercentage;
+	}
+
+	public void addUsedResources(ResourceHistoryItem usedResources){
+		this.usedResources.add(usedResources);
+	}
+	
+	public UsedResourcesList getUsedResources(){
+		return this.usedResources;
+	}
+	
+    public void setSchedulerName(int resourceId)
+    {
+        this.schedName = GridSim.getEntityName(resourceId);
+    }
+
+    public String getSchedulerName()
+    {
+        return schedName;
+    }
+	
+	public int getEstimatedDuration(){
+		return this.estimatedDuration;
+	}
+	
+	public void setEstimatedDuration(int value){
+		this.estimatedDuration = value;
+	}
+
+	public boolean isRegistered() {
+		return task.isRegistered();
+	}
+
+	public void register(JobRegistryImpl jobRegistry) {
+		task.register(jobRegistry);
+	}
+	
+	public void trackResource(String resName){
+		visitedResources.add(resName);
+	}
+	
+	public List<String> getVisitedResources(){
+		return visitedResources;
+	}
+	
+	public ReadableDuration getExpectedDuration() throws NoSuchFieldException {
+		return task.getExpectedDuration();
+	}
+
+	public double getParameterDoubleValue(ResourceParameterName parameterName)
+			throws NoSuchFieldException, IllegalArgumentException {
+		return task.getParameterDoubleValue(parameterName);
+	}
+
+	public String getParameterStringValue(ResourceParameterName parameterName)
+			throws NoSuchFieldException, IllegalArgumentException {
+		return task.getParameterStringValue(parameterName);
+	}
+	
+	public double getCpuCntRequest() throws NoSuchFieldException{
+		return getParameterDoubleValue(ResourceParameterName.CPUCOUNT);
+	}
+	
+	public double getMemoryRequest() throws NoSuchFieldException{
+		return getParameterDoubleValue(ResourceParameterName.MEMORY);
+	}
+	
+	public DateTime getExecutionEndTime() throws NoSuchFieldException {
+		return task.getExecutionEndTime();
+	}
+
+	public DateTime getExecutionStartTime() throws NoSuchFieldException {
+		return task.getExecutionStartTime();
+	}
+
+	public DateTime getSubmissionTimeToBroker() {
+		return task.getSubmissionTimeToBroker();
+	}
+
+	public long getWorkloadLogWaitTime() {
+		return task.getWorkloadLogWaitTime();
+	}
+
+    public double getExecStartTime() {
+        return execStartTime;
+    }
+
+    public double getFinishTime() {
+        return finishTime;
+    }
+
+    public double getSubmissionTime() {
+        return submissionTime;
+    }
+    
+    public double getWaitingTime()
+    {
+        return execStartTime - submissionTime;
+    }
+    
+    public void finalizeExecutable(){
+		try {
+			setStatus(DCWormsTags.SUCCESS);
+		} catch (Exception e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+    }
+    
+	public void accept(WorkloadUnitHandler wuh) {
+		wuh.handleExecutable(this);
+	}
+    
+	public boolean equals(Object obj){
+		if(obj instanceof Executable){
+			Executable t = (Executable) obj;
+			return getId().equals(t.getId());
+		}
+		return false;
+	}
+
+}
Index: /DCWoRMS/trunk/build/classes/dcworms/schedframe/scheduling/ExecTask.java
===================================================================
--- /DCWoRMS/trunk/build/classes/dcworms/schedframe/scheduling/ExecTask.java	(revision 539)
+++ /DCWoRMS/trunk/build/classes/dcworms/schedframe/scheduling/ExecTask.java	(revision 539)
@@ -0,0 +1,15 @@
+package dcworms.schedframe.scheduling;
+
+import java.util.List;
+
+import schedframe.scheduling.tasks.TaskInterface;
+import schedframe.scheduling.tasks.requirements.ResourceParameterName;
+
+public interface ExecTask extends TaskInterface<org.qcg.broker.schemas.resreqs.Task> {
+
+	public boolean expectSpecificResource(ResourceParameterName resourceName);	
+	public Object getExpectedSpecificResource(ResourceParameterName resourceName);
+
+	public void trackResource(String resName);
+	public List<String> getVisitedResources();
+}
Index: /DCWoRMS/trunk/build/classes/dcworms/schedframe/scheduling/queues/AbstractStatsSupportingQueue.java
===================================================================
--- /DCWoRMS/trunk/build/classes/dcworms/schedframe/scheduling/queues/AbstractStatsSupportingQueue.java	(revision 539)
+++ /DCWoRMS/trunk/build/classes/dcworms/schedframe/scheduling/queues/AbstractStatsSupportingQueue.java	(revision 539)
@@ -0,0 +1,106 @@
+package dcworms.schedframe.scheduling.queues;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import schedframe.scheduling.queue.Queue;
+
+
+import eduni.simjava.Sim_stat;
+import eduni.simjava.Sim_system;
+
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ * @param <K>
+ */
+
+public abstract class AbstractStatsSupportingQueue<K> extends ArrayList<K> implements Queue<K>{
+
+	private static final long serialVersionUID = 2067736388365966634L;
+	protected double lastUpdateTime;
+	protected Sim_stat stats;
+	protected String measureName;
+	
+	protected AbstractStatsSupportingQueue(){
+		this.stats = null;
+		this.lastUpdateTime = 0.0;
+		this.measureName = null;
+	}
+	
+	public boolean add(K o) {
+		boolean ret = super.add(o);
+		updateStats();
+		return ret;
+	}
+
+	public void add(int index, K element) {
+		super.add(index, element);
+		updateStats();
+	}
+
+	public boolean addAll(Collection<? extends K> c) {
+		boolean ret = super.addAll(c);
+		updateStats();
+		return ret;
+	}
+
+	public boolean addAll(int index, Collection<? extends K> c) {
+		boolean ret = super.addAll(index, c);
+		updateStats();
+		return ret;
+	}
+
+	public void clear() {
+		super.clear();
+		updateStats();
+	}
+
+	public boolean remove(Object o) {
+		boolean ret = super.remove(o);
+		updateStats();
+		return ret;
+	}
+
+	public K remove(int index) {
+		 K ret = super.remove(index);
+		 updateStats();
+		 return ret;
+	}
+
+	public boolean removeAll(Collection<?> c) {
+		boolean ret = super.removeAll(c);
+		updateStats();
+		return ret;
+	}
+
+	public boolean retainAll(Collection<?> c) {
+		boolean ret = super.retainAll(c);
+		updateStats();
+		return ret;
+	}
+
+	public K set(int index, K element) {
+		K ret = super.set(index, element);
+		updateStats();
+		return ret;
+	}
+	
+	
+	public void setStats(Sim_stat stats, String measureName){
+		this.stats = stats;
+		this.measureName = measureName;
+	}
+	
+	protected void updateStats() {
+		if(stats == null)
+			return;
+		
+		double time = Sim_system.clock();
+		stats.update(measureName, size(), lastUpdateTime); //continuous
+		lastUpdateTime = time;
+	}
+	
+}
Index: /DCWoRMS/trunk/build/classes/gridsim/dcworms/filter/ExecTaskFilter.java
===================================================================
--- /DCWoRMS/trunk/build/classes/gridsim/dcworms/filter/ExecTaskFilter.java	(revision 539)
+++ /DCWoRMS/trunk/build/classes/gridsim/dcworms/filter/ExecTaskFilter.java	(revision 539)
@@ -0,0 +1,45 @@
+package gridsim.dcworms.filter;
+
+import dcworms.schedframe.scheduling.Executable;
+import eduni.simjava.Sim_event;
+import gridsim.filter.FilterResult;
+
+/**
+ * @author wojtek
+ *
+ */
+public class ExecTaskFilter extends FilterResult {
+
+	public ExecTaskFilter(int taskId, int tag) {
+		super(taskId, tag);
+	}
+
+	public boolean match(Sim_event ev) {
+
+		if (ev == null) {
+			return false;
+		}
+
+		boolean result = false;
+		try {
+
+			if (tag_ == ev.get_tag()) {
+				Object obj = ev.get_data();
+
+				if (obj instanceof Executable) {
+
+					Executable exec = (Executable) obj;
+
+					if (exec.getUniqueId() == eventID_) {
+						result = true;
+					}
+				}
+			}
+		} catch (Exception e) {
+			result = false;
+		}
+
+		return result;
+	}
+
+}
Index: /DCWoRMS/trunk/build/classes/gridsim/dcworms/DCWormsTags.java
===================================================================
--- /DCWoRMS/trunk/build/classes/gridsim/dcworms/DCWormsTags.java	(revision 539)
+++ /DCWoRMS/trunk/build/classes/gridsim/dcworms/DCWormsTags.java	(revision 539)
@@ -0,0 +1,53 @@
+package gridsim.dcworms;
+
+import gridsim.GridSimTags;
+
+/**
+ * @author Marcin Krystek
+ */
+public class DCWormsTags extends GridSimTags {
+	
+	protected static final int DCWORMSBASE = 600; 
+	
+	public static final int UPDATE= DCWORMSBASE - 1;
+	
+	public static final int TIMER = DCWORMSBASE + 1;
+	
+	public static final int TASK_READY_FOR_EXECUTION = DCWORMSBASE + 2;
+	
+	public static final int TASK_EXECUTION_FINISHED = DCWORMSBASE + 3;
+	
+
+	/**
+	 * Message tag: query resource about its current state in object form (load, queues, etc.)
+	 */ 
+	public static final int QUERY_RESOURCE_DESC = DCWORMSBASE + 4; 
+
+	public static final int QUERY_RESOURCE_DESC_RESULT = DCWORMSBASE + 5; 
+	
+	public static final int TASK_REQUESTED_TIME_EXPIRED = DCWORMSBASE + 6;
+
+	
+    public static final int CREATED = 0;
+
+    public static final int SUBMITTED = 1;
+    
+    public static final int READY = 2;
+
+    public static final int QUEUED = 3;
+
+    public static final int INEXEC = 4;
+
+    public static final int SUCCESS = 5;
+
+    public static final int FAILED = 6;
+
+    public static final int CANCELED = 7;
+
+    public static final int PAUSED = 8;
+
+    public static final int RESUMED = 9;
+
+    public static final int FAILED_RESOURCE_UNAVAILABLE = 10;
+
+}
Index: /DCWoRMS/trunk/build/classes/simulator/DCWormsUsers.java
===================================================================
--- /DCWoRMS/trunk/build/classes/simulator/DCWormsUsers.java	(revision 539)
+++ /DCWoRMS/trunk/build/classes/simulator/DCWormsUsers.java	(revision 539)
@@ -0,0 +1,328 @@
+package simulator;
+
+import dcworms.schedframe.scheduling.utils.JobDescription;
+import dcworms.schedframe.scheduling.utils.TaskDescription;
+import eduni.simjava.Sim_event;
+import eduni.simjava.Sim_system;
+import gridsim.GridSim;
+import gridsim.GridSimTags;
+import gridsim.IO_data;
+import gridsim.dcworms.DCWormsTags;
+import gridsim.net.InfoPacket;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeMap;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.joda.time.DateTime;
+
+import qcg.shared.constants.BrokerConstants;
+import schedframe.scheduling.tasks.Job;
+import schedframe.scheduling.tasks.JobInterface;
+import schedframe.scheduling.tasks.Task;
+import schedframe.scheduling.tasks.TaskInterface;
+import simulator.utils.XsltTransformations;
+import simulator.workload.WorkloadLoader;
+
+public class DCWormsUsers extends GridSim implements GenericUser {
+
+	/**A job generator, which produces jobs and tasks. These jobs are then sent by this entity */
+	protected WorkloadLoader workloadLoader;
+	
+	/** The name of the entity, to which the created tasks will be sent */
+	protected String destName;
+	
+	/** Indicates, that all tasks that returned to this object are finished */
+	protected boolean allTasksAreFinished;
+	
+	/** Stores the list of jobs, that have been returned to this object */
+	protected List<JobInterface<?>> returnedJobs;
+	protected Set<String> sendJobsIds;
+	protected Set<String> returnedJobsIds;
+	
+	protected XsltTransformations xsltTransformer;
+	
+	/**
+	 * Indicates, that an error has occurred - it is used for debug purposes
+	 */
+	protected boolean error;
+	
+	private static Log log = LogFactory.getLog(DCWormsUsers.class);
+	
+	/**
+	 * Constructs the users object with the given parameters
+	 * @param name the name of the users entity (must be unique across all entities in the whole simulation)
+	 * @param destinationName the name of the entity, to which the created tasks will be sent 
+	 * @param jobGenerator the job generator, which produces jobs and tasks, that will be sent by this class
+	 * @throws Exception if any occurs (see {@link GridSim#GridSim(String, double)})
+	 */
+	public DCWormsUsers(String name, String destinationName, WorkloadLoader workload) throws Exception {
+		super(name, DCWormsConstants.DEFAULT_BAUD_RATE);
+		this.workloadLoader = workload;
+		destName = destinationName;
+		allTasksAreFinished = true;
+		error = false;
+		
+		sendJobsIds = new HashSet<String>();
+		returnedJobsIds = new HashSet<String>();
+		
+		this.xsltTransformer = new XsltTransformations();
+	}
+
+	@Override
+	public void body() {
+		sendJobs();
+		collectJobs();
+
+		//GridSim dependent code for shutting down the simulation
+		shutdownGridStatisticsEntity();
+		terminateIOEntities();
+		shutdownUserEntity();
+	}
+
+	/**
+	 * Collects the jobs sent to broker(s)
+	 */
+	protected void collectJobs() {
+		final int FACTOR = Math.min(10, workloadLoader.getTaskCount()); //the refresh rate of the gauge: at most 10 times
+		final int denominator = workloadLoader.getTaskCount() / FACTOR;
+		allTasksAreFinished = true;
+		returnedJobs = new ArrayList<JobInterface<?>>();
+		int counter = 0;
+		int oldRemeinder = 0;
+		boolean hundredPercent = false;
+		
+		Sim_event ev = new Sim_event();
+		sim_get_next(ev);
+		while (Sim_system.running()) {
+			switch (ev.get_tag()) {
+			case GridSimTags.END_OF_SIMULATION:
+				//no action
+				break;
+			
+			case GridSimTags.INFOPKT_SUBMIT:
+				processPingRequest(ev);
+				break;
+				
+			case GridSimTags.GRIDLET_RETURN:
+				JobInterface<?> returnedJob = (JobInterface<?>) ev.get_data();
+				
+				String jobId = returnedJob.getId();
+
+				
+				if (returnedJobs.contains(returnedJob)) {
+					if(log.isErrorEnabled())
+						log.error("Received the same job twice (job ID " + jobId + ")");
+					error = true;
+					break;
+				} 
+				
+				returnedJobs.add(returnedJob);
+				returnedJobsIds.add(jobId);
+				
+				if(returnedJob.getStatus() == BrokerConstants.JOB_STATUS_FINISHED) {
+					if(log.isDebugEnabled())
+						log.debug("Received finished job " + jobId);
+					
+				} else {
+					if(returnedJob.getStatus() == BrokerConstants.JOB_STATUS_CANCELED) {
+						if(log.isWarnEnabled()){
+							String str = "Warning! An uncomplished job (Job ID: "+jobId+") has returned to users. Job was canceled.";
+							log.warn(str);
+						}
+					}
+					
+					allTasksAreFinished = false;
+				}
+				
+				counter += returnedJob.getTaskCount();
+				int remainder = (counter / denominator);
+				if (remainder != oldRemeinder) {
+					int gauge = ((counter * 100) / (workloadLoader.getTaskCount()));
+					if(log.isInfoEnabled())
+						log.info(gauge + "% ");
+					
+					oldRemeinder = remainder;
+					if (gauge == 100)
+						hundredPercent = true;
+				}
+			
+				break;
+			} 
+			
+			//if all the Gridlets have been collected
+			if (counter == workloadLoader.getTaskCount()) {
+				break;
+			}
+			
+			sim_get_next(ev);
+		}
+		
+		//if all the Gridlets have been collected
+		if (counter == workloadLoader.getTaskCount()) {
+			if (! hundredPercent) {
+				if(log.isInfoEnabled())
+					log.info("100%");
+			}
+			if(log.isInfoEnabled())
+				log.info(get_name() + ": Received all "+workloadLoader.getJobCount()+" jobs and " + counter + " tasks");			
+		} else {
+			if(log.isErrorEnabled())
+				log.error(get_name() + ": ERROR DID NOT RECEIVED all tasks - some tasks were not finished! (received "+counter+" of "+workloadLoader.getTaskCount()+")");
+		}
+		
+		Iterator <String> itr = sendJobsIds.iterator();
+		String jobId;
+		if(log.isInfoEnabled()){
+			log.info("Missing tasks: ");
+			while(itr.hasNext()){
+				jobId = itr.next();
+				if(!returnedJobsIds.contains(jobId)){
+					log.info(jobId + ", ");
+				}
+			}
+		}
+		
+	}
+
+	/**
+	 * Sends jobs to broker entities
+	 */
+	protected void sendJobs() {
+		
+		Map<Long, List<Job>> jobTimes = new TreeMap<Long, List<Job>>();
+		int destID = GridSim.getEntityId(destName);
+		//destID=GridSim.getEntityId("BROKER@COMPUTING_GRID_0");
+		List<JobDescription> jobs = workloadLoader.getJobs();
+		//TaskRequirements taskReq = new TaskRequirementsImpl();
+		//double values[] = null;
+
+		for (JobDescription job : jobs) {
+			long l_submissionTime = Long.MAX_VALUE;
+			//pick the lowest submission time
+			for (TaskDescription task : job) {
+				if (task.getSubmissionTime() < l_submissionTime)
+					l_submissionTime = task.getSubmissionTime();
+			}
+
+			//store the submission time expressed in seconds after the simulation start time
+			long submissionTime = l_submissionTime;
+			
+			Job newJob = prepareJob(job, submissionTime);
+			
+			List<Job> list = jobTimes.get(submissionTime);
+			if (list == null) {
+				list = new ArrayList<Job>();
+				jobTimes.put(submissionTime, list);
+			}
+			list.add(newJob);
+		}
+		for (Long submissionTime : jobTimes.keySet()) {
+			List<Job> list = jobTimes.get(submissionTime);
+			for(int i = 0; i < list.size(); i++){
+				this.sendJobsIds.add(list.get(i).getId());
+				send(destID, submissionTime, GridSimTags.GRIDLET_SUBMIT, list.get(i));
+			}
+			
+			//send(output, submissionTime, GridSimTags.GRIDLET_SUBMIT, new IO_data(list, GssConstants.DEFAULT_GRIDLET_SIZE, destID));
+			//send(destID, submissionTime, GridSimTags.GRIDLET_SUBMIT, list);
+			
+		}
+		System.out.println("finished sending jobs");
+	}
+	
+	public List<JobDescription> getAllSentJobs() {
+		return (List<JobDescription>) workloadLoader.getJobs();
+	}
+	
+	public List<TaskDescription> getAllSentTasks() {
+		List<TaskDescription> result = new ArrayList<TaskDescription>();
+		List<JobDescription> sentJobs = getAllSentJobs();
+		for (JobDescription job : sentJobs) {
+			result.addAll(job);
+		}
+		return result;
+	}
+	
+	public List<JobInterface<?>> getAllReceivedJobs() {
+		return returnedJobs;
+	}
+
+	public int getFinishedTasksCount() {
+		int result = 0;
+		for (JobInterface<?> job : returnedJobs) {
+			for (TaskInterface<?> task: job.getTask()) {
+				if(task.getStatus() == DCWormsTags.SUCCESS)
+					result++;
+			}
+		}
+		return result;
+	}
+	
+	public String getUserName() {
+		return get_name();
+	}
+	
+	public boolean isError() {
+		return error;
+	}
+	
+	/**
+	 * Performs action concerning a ping request to this entity
+	 * @param ev the event object
+	 */
+	protected void processPingRequest(Sim_event ev) {
+        InfoPacket pkt = (InfoPacket) ev.get_data();
+        pkt.setTag(GridSimTags.INFOPKT_RETURN);
+        pkt.setDestID(pkt.getSrcID());
+
+		// sends back to the sender
+		send(output, GridSimTags.SCHEDULE_NOW, GridSimTags.INFOPKT_RETURN,
+				new IO_data(pkt, pkt.getSize(), pkt.getSrcID()));
+    }
+		
+	protected Job prepareJob(JobDescription jobDescription, long submissionTime){
+
+		Job newJob = new Job(jobDescription.getJobId());
+		DateTime submitionTime = new DateTime();
+        submitionTime = submitionTime.plusMillis((int)submissionTime*1000);
+			try {
+				
+				// transform job description to resource requirements
+
+				newJob.setSenderId(this.get_id());
+				
+				for (TaskDescription taskDescription : jobDescription) {
+					
+					String xmlResReq = this.xsltTransformer.taskToResourceRequirements(
+										taskDescription.getDocument(),
+										jobDescription.getJobId(),
+										taskDescription.getUserDn(),
+										submitionTime);
+
+					Task newTask = new Task(xmlResReq);
+					newTask.setSenderId(this.get_id());
+					newTask.setStatus((int)BrokerConstants.TASK_STATUS_UNSUBMITTED);
+					newTask.setLength(taskDescription.getTaskLength());
+					newTask.setWorkloadLogWaitTime(taskDescription.getWorkloadLogWaitTime());
+			//		newTask.setSubmissionTime(taskDescription.getSubmissionTime());
+					
+					newJob.add(newTask);
+				}
+
+				jobDescription.discardUnused();
+				
+			} catch (Exception e){
+				log.error(e.getMessage());
+				e.printStackTrace();
+			}
+		
+		return newJob;
+	}
+}
Index: /DCWoRMS/trunk/build/classes/simulator/workload/generator/impl/QcgJobGenerator.java
===================================================================
--- /DCWoRMS/trunk/build/classes/simulator/workload/generator/impl/QcgJobGenerator.java	(revision 477)
+++ /DCWoRMS/trunk/build/classes/simulator/workload/generator/impl/QcgJobGenerator.java	(revision 539)
@@ -58,5 +58,5 @@
 import org.xml.sax.InputSource;
 
-import simulator.WormsConstants;
+import simulator.DCWormsConstants;
 import simulator.utils.GSSimXML;
 import simulator.utils.XsltTransformations;
@@ -259,5 +259,5 @@
 			
 			//initially - a standard value
-			taskCountToBeGenerated = WormsConstants.DEFAULT_TASK_COUNT_IN_SINGLE_JOB; 
+			taskCountToBeGenerated = DCWormsConstants.DEFAULT_TASK_COUNT_IN_SINGLE_JOB; 
 			
 			try {
Index: /DCWoRMS/trunk/build/classes/simulator/workload/WorkloadLoader.java
===================================================================
--- /DCWoRMS/trunk/build/classes/simulator/workload/WorkloadLoader.java	(revision 477)
+++ /DCWoRMS/trunk/build/classes/simulator/workload/WorkloadLoader.java	(revision 539)
@@ -2,6 +2,4 @@
 
 import org.qcg.broker.schemas.jobdesc.QcgJob;
-import gssim.schedframe.scheduling.utils.JobDescription;
-import gssim.schedframe.scheduling.utils.TaskDescription;
 
 import java.io.IOException;
@@ -24,4 +22,7 @@
 import org.exolab.castor.xml.MarshalException;
 import org.exolab.castor.xml.ValidationException;
+
+import dcworms.schedframe.scheduling.utils.JobDescription;
+import dcworms.schedframe.scheduling.utils.TaskDescription;
 
 
Index: /DCWoRMS/trunk/build/classes/simulator/DCWormsConstants.java
===================================================================
--- /DCWoRMS/trunk/build/classes/simulator/DCWormsConstants.java	(revision 539)
+++ /DCWoRMS/trunk/build/classes/simulator/DCWormsConstants.java	(revision 539)
@@ -0,0 +1,102 @@
+package simulator;
+
+import eduni.simjava.Sim_stat;
+
+public class DCWormsConstants {
+
+	public static final String START_TIME="start_time";
+	
+	public static final String END_TIME = "end_time";
+	
+	public static final String RESOURCES = "resources";
+
+	
+	/**
+	 * the links have the maximal baud rate - no delays
+	 */
+	public static final double DEFAULT_BAUD_RATE = Double.MAX_VALUE;
+	
+	/**
+	 * Default name suffix of the allocation policy for every resource
+	 */
+	public static final String DEFAULT_RESOURCE_MANAGER_NAME = "ResourceManager";
+	
+	/**
+	 * The cost of processing per time unit
+	 */
+	public static final float DEFAULT_RESOURCE_PROCESSING_COST = 1f;
+	
+	/**
+	 * The default number of tasks in a single job
+	 */
+	public static final int DEFAULT_TASK_COUNT_IN_SINGLE_JOB = 1;
+
+	/**
+	 * The name of the broker interface entity (the entity that invokes proper methods on the given plugin)
+	 */
+	public static final String BrokerInterfaceEntityName = "BrokerInterfaceEntity";
+	
+	/**
+	 * The name of the output file with generated graphs
+	 */
+	public static final String GraphsFileName = "GssGraphs.sjg";
+	
+	/**
+	 * The name of the file where the resources' statistical data are to be stored
+	 */
+	public static final String resourceStatisticsOutputFileName = "Stats_Resources.txt"; 
+	
+	/**
+	 * The name of the file where the tasks' statistical data are to be stored
+	 */
+	public static final String tasksStatisitcsOutputFileName = "Stats_Tasks.txt";  
+
+	
+	public static final String MANAGEMENT_SYSTEM = "ManagementSystem";
+
+	
+/*
+ *  
+ * STATISTICAL INFORMATION VARIABLES AND METHODS 
+ * 
+ */
+	
+	/**
+	 * The utilization measure name
+	 */
+	public static final String USAGE_MEASURE_NAME = "Resource's utilization";
+	
+	/**
+	 * The waiting tasks queue length measure name
+	 */
+	public static final String TASKS_QUEUE_LENGTH_MEASURE_NAME = "Mean queue task count";
+	
+	/**
+	 * The paused tasks list length measure name
+	 */
+	public static final String PAUSED_TASKS_LIST_LENGTH_MEASURE_NAME = "Paused tasks list length";
+	
+	/**
+	 * @param queuesCount the number of queues for which the measures are to be added
+	 * @return a Sim_stat object to be used in all resources
+	 */
+	public static Sim_stat getResourcesStatisticsObject(int queuesCount) {		
+		Sim_stat stat = new Sim_stat();
+		//stat.add_measure(Sim_stat.ARRIVAL_RATE);
+		//stat.add_measure(Sim_stat.QUEUE_LENGTH);
+		//stat.add_measure(Sim_stat.RESIDENCE_TIME);
+		//stat.add_measure(Sim_stat.SERVICE_TIME);
+		stat.add_measure(Sim_stat.THROUGHPUT);
+		//stat.add_measure(Sim_stat.UTILISATION);
+		//stat.add_measure(Sim_stat.WAITING_TIME);
+		
+		stat.add_measure(USAGE_MEASURE_NAME, Sim_stat.STATE_BASED, true); //continuous
+		for (int i = 0; i < queuesCount; ++i) {
+			stat.add_measure(TASKS_QUEUE_LENGTH_MEASURE_NAME+"_"+Integer.toString(i), Sim_stat.STATE_BASED, true); //continuous
+		}
+		stat.add_measure(PAUSED_TASKS_LIST_LENGTH_MEASURE_NAME, Sim_stat.STATE_BASED, true); //continuous
+		//stat.add_measure(TASKS_AR_QUEUE_LENGTH_MEASURE_NAME, Sim_stat.STATE_BASED, true); //continuous
+		return stat;
+	}
+
+}
Index: /DCWoRMS/trunk/build/classes/simulator/GenericUser.java
===================================================================
--- /DCWoRMS/trunk/build/classes/simulator/GenericUser.java	(revision 477)
+++ /DCWoRMS/trunk/build/classes/simulator/GenericUser.java	(revision 539)
@@ -2,8 +2,9 @@
 
 
-import gssim.schedframe.scheduling.utils.JobDescription;
-import gssim.schedframe.scheduling.utils.TaskDescription;
 
 import java.util.List;
+
+import dcworms.schedframe.scheduling.utils.JobDescription;
+import dcworms.schedframe.scheduling.utils.TaskDescription;
 
 import schedframe.scheduling.tasks.Job;
Index: /DCWoRMS/trunk/build/classes/simulator/DataCenterWorkloadSimulator.java
===================================================================
--- /DCWoRMS/trunk/build/classes/simulator/DataCenterWorkloadSimulator.java	(revision 477)
+++ /DCWoRMS/trunk/build/classes/simulator/DataCenterWorkloadSimulator.java	(revision 539)
@@ -1,5 +1,4 @@
 package simulator;
 
-//import eduni.cloudsim.GSSIM;
 import java.io.File;
 import java.io.FileReader;
@@ -26,5 +25,5 @@
 import simulator.reader.ResourceReader;
 import simulator.stats.AccumulatedStatistics;
-import simulator.stats.implementation.GSSimStatistics;
+import simulator.stats.implementation.DCWormsStatistics;
 import simulator.utils.LogErrStream;
 import simulator.workload.WorkloadLoader;
@@ -40,5 +39,5 @@
  * {@link #main(String[])} method used to invoke the program. This class also
  * provides second possibility to start the simulator, namely one may use the
- * {@link #performSimulation(ConfigurationOptions, GSSimStatistics)} method.
+ * {@link #performSimulation(ConfigurationOptions, DCWormsStatistics)} method.
  * In this case, the input parameter, describing the simulation options, must be
  * earlier prepared. The results of the simulation can be acquired using the
@@ -98,6 +97,6 @@
 	 */
 	public static void main(String[] args) {
-		DataCenterWorkloadSimulator gssim = new DataCenterWorkloadSimulator();
-		gssim.run(args);
+		DataCenterWorkloadSimulator dcworms = new DataCenterWorkloadSimulator();
+		dcworms.run(args);
 	}
 
@@ -117,5 +116,5 @@
 				@Override
 				public String getDescription() {
-					return "WoRMS experiment file";
+					return "DCWoRMS experiment file";
 				}
 			};
@@ -198,5 +197,5 @@
 	}
 
-	private void runMultiuser(String rootDirPath, DataCenterWorkloadSimulator gssim) {
+	private void runMultiuser(String rootDirPath, DataCenterWorkloadSimulator dcworms) {
 		throw new RuntimeException("not supported yet");
 	}
@@ -269,5 +268,5 @@
 		rc.setInitList(null);
 		
-		WormsUsers wl = new WormsUsers("Users",
+		DCWormsUsers wl = new DCWormsUsers("Users",
 				rc.getScheduler().get_name(), workload);
 		
@@ -275,5 +274,5 @@
 		long stopSimulation = System.currentTimeMillis();
 
-		GSSimStatistics stats = new GSSimStatistics(simulationIdentifier,
+		DCWormsStatistics stats = new DCWormsStatistics(simulationIdentifier,
 				options, wl, statsOutputPath, rc);
 		accumulatedStatistics.add(stats);
Index: /DCWoRMS/trunk/build/classes/simulator/stats/implementation/TaskStats.java
===================================================================
--- /DCWoRMS/trunk/build/classes/simulator/stats/implementation/TaskStats.java	(revision 477)
+++ /DCWoRMS/trunk/build/classes/simulator/stats/implementation/TaskStats.java	(revision 539)
@@ -1,7 +1,8 @@
 package simulator.stats.implementation;
 
-import gssim.schedframe.scheduling.Executable;
 
 import java.util.List;
+
+import dcworms.schedframe.scheduling.Executable;
 
 import simulator.stats.implementation.out.StatsSerializer;
@@ -45,15 +46,10 @@
 
 	public String getUserDN() {
-		return this.task.getUserDn();
+		return this.task.getUserDN();
 	}
 
 	public String getResName() {
-		String resNames[] = this.task.getAllResourceName();
-		String resName = "";
-		for (int i = 0; i < resNames.length; i++) {
-			resName += resNames[i];
-			if (resNames.length > 1)
-				resName += " ";
-		}
+		String resName = this.task.getSchedulerName();
+
 		return resName;
 	}
Index: /DCWoRMS/trunk/build/classes/simulator/stats/implementation/ResourcePowerStats.java
===================================================================
--- /DCWoRMS/trunk/build/classes/simulator/stats/implementation/ResourcePowerStats.java	(revision 539)
+++ /DCWoRMS/trunk/build/classes/simulator/stats/implementation/ResourcePowerStats.java	(revision 539)
@@ -0,0 +1,32 @@
+package simulator.stats.implementation;
+
+import schedframe.resources.ResourceType;
+import simulator.stats.implementation.out.StatsSerializer;
+
+public class ResourcePowerStats extends ResourceDynamicStats implements StatsInterface{
+
+	protected double sumValue;
+
+	private String[] headers = { "resourceName", "timestamp", "consumption" };
+	
+	public ResourcePowerStats (String resourceName, ResourceType resourceType, String usageType) {
+		super(resourceName, resourceType, usageType);
+	}
+
+	public void setSumValue(double sumValue) {
+		this.sumValue = sumValue;
+	}
+
+	public double getSumValue() {
+		return sumValue;
+	}
+
+	public Object serialize(StatsSerializer serializer) {
+		return serializer.visit(this);
+	}
+
+	public String[] getHeaders() {
+		return headers;
+	}
+
+}
Index: /DCWoRMS/trunk/build/classes/simulator/stats/implementation/out/StatsSerializer.java
===================================================================
--- /DCWoRMS/trunk/build/classes/simulator/stats/implementation/out/StatsSerializer.java	(revision 477)
+++ /DCWoRMS/trunk/build/classes/simulator/stats/implementation/out/StatsSerializer.java	(revision 539)
@@ -4,5 +4,6 @@
 import simulator.stats.implementation.GSSAccumulatorsStats;
 import simulator.stats.implementation.JobStats;
-import simulator.stats.implementation.ResourceEnergyStats;
+import simulator.stats.implementation.ResourceAirFlowStats;
+import simulator.stats.implementation.ResourcePowerStats;
 import simulator.stats.implementation.ResourceStats;
 import simulator.stats.implementation.ResourceUsageStats;
@@ -26,6 +27,7 @@
 	public Object visit(ResourceUsageStats arg);
 	
-	public Object visit(ResourceEnergyStats arg);
+	public Object visit(ResourcePowerStats arg);
 
+	public Object visit(ResourceAirFlowStats arg);
 	
 	public Object visit(GSSAccumulatorsStats arg);
Index: /DCWoRMS/trunk/build/classes/simulator/stats/implementation/out/StringSerializer.java
===================================================================
--- /DCWoRMS/trunk/build/classes/simulator/stats/implementation/out/StringSerializer.java	(revision 477)
+++ /DCWoRMS/trunk/build/classes/simulator/stats/implementation/out/StringSerializer.java	(revision 539)
@@ -11,5 +11,6 @@
 import simulator.stats.implementation.GSSAccumulatorsStats;
 import simulator.stats.implementation.JobStats;
-import simulator.stats.implementation.ResourceEnergyStats;
+import simulator.stats.implementation.ResourceAirFlowStats;
+import simulator.stats.implementation.ResourcePowerStats;
 import simulator.stats.implementation.ResourceStats;
 import simulator.stats.implementation.ResourceUsageStats;
@@ -258,5 +259,5 @@
 
 	public Object visit(ResourceUsageStats resourceUsageStats) {
-		Map<Long, Integer> resourceUsage = resourceUsageStats.getUsage();
+		Map<Long, Double> resourceUsage = resourceUsageStats.getHistory();
 		
 		int mapSize = resourceUsage.size();
@@ -297,5 +298,5 @@
 			buffer.append(resourceUsageStats.getResourceName());
 			buffer.append(fieldSeparator);
-			Integer value = resourceUsage.get(timestamp);
+			Double value = resourceUsage.get(timestamp);
 			buffer.append(timestamp);
 			buffer.append(fieldSeparator);
@@ -306,12 +307,13 @@
 
 		}
-
-		buffer.append("mean: " + resourceUsageStats.getMeanUsage());
-		buffer.append(System.getProperty("line.separator"));
-		return buffer.toString();
-	}
-
-	public Object visit(ResourceEnergyStats resourceEnergyStats) {
-		Map<Long, Double> resourceEnergy = resourceEnergyStats.getEnergy();
+		if(resourceUsage.size() > 0){
+			buffer.append("mean: " + resourceUsageStats.getMeanValue());
+			buffer.append(System.getProperty("line.separator"));	
+		}
+		return buffer.toString();
+	}
+
+	public Object visit(ResourcePowerStats resourceEnergyStats) {
+		Map<Long, Double> resourceEnergy = resourceEnergyStats.getHistory();
 		
 		int mapSize = resourceEnergy.size();
@@ -361,6 +363,67 @@
 
 		}
-		buffer.append("mean: "+resourceEnergyStats.getMeanUsage() + " sum: " +resourceEnergyStats.getSumUsage());
-		buffer.append(System.getProperty("line.separator"));
+		
+		if(resourceEnergy.size() > 0) {
+			buffer.append("mean: "+resourceEnergyStats.getMeanValue() + " sum: " +resourceEnergyStats.getSumValue());
+			buffer.append(System.getProperty("line.separator"));	
+		}
+
+		return buffer.toString();
+	}
+
+	public Object visit(ResourceAirFlowStats resourceAirFlowStats) {
+		Map<Long, Double> resourceAirFlow = resourceAirFlowStats.getHistory();
+		
+		int mapSize = resourceAirFlow.size();
+		/*
+		 * FIXME:
+		 * Integer.MAX_VALUE = 2147483647. We assume, that each line contains 
+		 * max 30 signs - this gives max 71582788 lines. If resourceUsage map
+		 * contains more elements then we have a problem, because content of
+		 * resourceUsage map will not fit in the buffer.
+		 * This will need further attention in the future.
+		 */
+		int maxSize = (Integer.MAX_VALUE / 30 ) - 1;
+		if(mapSize >= maxSize){
+			log.error("Resource usage data is to long to fit in the buffer.");
+			return null;
+		}
+		
+		int size = 30 * resourceAirFlow.size();
+		
+		StringBuffer buffer = null;
+
+		if(printedHeaders.add(resourceAirFlowStats.getUsageType())) {
+			buffer = new StringBuffer(size + 42);
+			String[] headers = resourceAirFlowStats.getHeaders();
+			for(int i = 0; i < headers.length; i++)
+			{
+				buffer.append(headers[i]);
+				buffer.append(fieldSeparator);
+			}
+			buffer.append(System.getProperty("line.separator"));
+		} else {
+			buffer = new StringBuffer(size);
+		}
+		
+		
+		for (Long timestamp : resourceAirFlow.keySet()) {
+			
+			buffer.append(resourceAirFlowStats.getResourceName());
+			buffer.append(fieldSeparator);
+			Double value = resourceAirFlow.get(timestamp);
+			buffer.append(timestamp);
+			buffer.append(fieldSeparator);
+			buffer.append(DataCenterWorkloadSimulator.DFAULT_NUMBER_FORMAT
+					.format(value));
+			buffer.append(fieldSeparator);
+			buffer.append(System.getProperty("line.separator"));
+
+		}
+		
+		if(resourceAirFlow.size() > 0) {
+			buffer.append("mean: "+resourceAirFlowStats.getMeanValue() + " sum: " +resourceAirFlowStats.getSumValue());
+			buffer.append(System.getProperty("line.separator"));	
+		}
 
 		return buffer.toString();
Index: /DCWoRMS/trunk/build/classes/simulator/stats/implementation/DCWormsStatistics.java
===================================================================
--- /DCWoRMS/trunk/build/classes/simulator/stats/implementation/DCWormsStatistics.java	(revision 539)
+++ /DCWoRMS/trunk/build/classes/simulator/stats/implementation/DCWormsStatistics.java	(revision 539)
@@ -0,0 +1,1405 @@
+package simulator.stats.implementation;
+
+import java.awt.Color;
+import java.awt.Paint;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.PrintStream;
+import java.text.NumberFormat;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.SortedMap;
+import java.util.TreeMap;
+
+import org.apache.commons.lang.ArrayUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jfree.chart.ChartFactory;
+import org.jfree.chart.ChartRenderingInfo;
+import org.jfree.chart.ChartUtilities;
+import org.jfree.chart.JFreeChart;
+import org.jfree.chart.axis.AxisLocation;
+import org.jfree.chart.axis.DateAxis;
+import org.jfree.chart.axis.NumberAxis;
+import org.jfree.chart.encoders.ImageFormat;
+import org.jfree.chart.labels.CategoryItemLabelGenerator;
+import org.jfree.chart.labels.ItemLabelAnchor;
+import org.jfree.chart.labels.ItemLabelPosition;
+import org.jfree.chart.labels.StandardCategoryItemLabelGenerator;
+import org.jfree.chart.plot.CategoryPlot;
+import org.jfree.chart.plot.CombinedDomainXYPlot;
+import org.jfree.chart.plot.PlotOrientation;
+import org.jfree.chart.plot.XYPlot;
+import org.jfree.chart.renderer.category.CategoryItemRenderer;
+import org.jfree.chart.renderer.category.GanttRenderer;
+import org.jfree.chart.renderer.xy.XYStepAreaRenderer;
+import org.jfree.chart.title.TextTitle;
+import org.jfree.chart.title.Title;
+import org.jfree.data.gantt.TaskSeries;
+import org.jfree.data.gantt.TaskSeriesCollection;
+import org.jfree.data.time.FixedMillisecond;
+import org.jfree.data.xy.XYDataset;
+import org.jfree.data.xy.XYSeries;
+import org.jfree.data.xy.XYSeriesCollection;
+import org.jfree.ui.TextAnchor;
+import org.joda.time.DateTimeUtilsExt;
+
+import schedframe.ExecutablesList;
+import schedframe.ResourceController;
+import schedframe.exceptions.ResourceException;
+import schedframe.resources.ResourceType;
+import schedframe.resources.UserResourceType;
+import schedframe.resources.computing.ComputingResource;
+import schedframe.resources.computing.extensions.Extension;
+import schedframe.resources.computing.extensions.ExtensionList;
+import schedframe.resources.computing.extensions.ExtensionType;
+import schedframe.resources.computing.profiles.energy.EnergyExtension;
+import schedframe.resources.computing.profiles.energy.airthroughput.AirFlowValue;
+import schedframe.resources.computing.profiles.energy.power.PowerUsage;
+import schedframe.resources.units.PEUnit;
+import schedframe.resources.units.ProcessingElements;
+import schedframe.resources.units.ResourceUnit;
+import schedframe.resources.units.ResourceUnitName;
+import schedframe.resources.units.StandardResourceUnitName;
+import schedframe.scheduling.ResourceHistoryItem;
+import schedframe.scheduling.Scheduler;
+import schedframe.scheduling.manager.tasks.JobRegistry;
+import schedframe.scheduling.manager.tasks.JobRegistryImpl;
+import schedframe.scheduling.tasks.Job;
+import schedframe.scheduling.tasks.JobInterface;
+import simulator.ConfigurationOptions;
+import simulator.DCWormsConstants;
+import simulator.DataCenterWorkloadSimulator;
+import simulator.GenericUser;
+import simulator.stats.GSSAccumulator;
+import simulator.stats.SimulationStatistics;
+import simulator.stats.implementation.out.AbstractStringSerializer;
+import simulator.stats.implementation.out.StringSerializer;
+import csiro.mit.utils.jfreechart.timetablechart.TimetableChartFactory;
+import csiro.mit.utils.jfreechart.timetablechart.data.Timetable;
+import csiro.mit.utils.jfreechart.timetablechart.data.TimetableEventGroup;
+import csiro.mit.utils.jfreechart.timetablechart.data.TimetableEventSource;
+import csiro.mit.utils.jfreechart.timetablechart.renderer.TimetableRenderer;
+import dcworms.schedframe.scheduling.ExecTask;
+import dcworms.schedframe.scheduling.Executable;
+import eduni.simjava.Sim_stat;
+
+public class DCWormsStatistics implements SimulationStatistics {
+
+	private Log log = LogFactory.getLog(DCWormsStatistics.class);
+
+	protected static float ALPHA = 0.5f;
+	protected static int GANTT_WIDTH = 1200;
+	
+	protected static final int MILLI_SEC = 1000;
+
+	protected static final String RAW_TASKS_STATISTICS_OUTPUT_FILE_NAME = "Tasks.txt";
+	protected static final String JOBS_STATISTICS_OUTPUT_FILE_NAME = "Jobs.txt";
+
+	protected static final String SIMULATION_STATISTICS_OUTPUT_FILE_NAME = "Simulation.txt";
+	protected static final String RESOURCEUTILIZATION_STATISTICS_OUTPUT_FILE_NAME = "ResourceUtilization.txt";
+	protected static final String ENERGYUSAGE_STATISTICS_OUTPUT_FILE_NAME = "EnergyUsage.txt";
+	protected static final String AIRFLOW_STATISTICS_OUTPUT_FILE_NAME = "AirThroughput.txt";
+
+	protected static final String DIAGRAMS_FILE_NAME_PREFIX = "Chart_";
+	protected static final String STATS_FILE_NAME_PREFIX = "Stats_";
+
+	protected static final String TASK_SEPARATOR = ";";
+	protected static final String JOB_SEPARATOR = ";";
+
+	protected String outputFolderName;
+
+	protected String simulationIdentifier;
+	protected ConfigurationOptions configuration;
+
+	protected GSSAccumulatorsStats accStats;
+	protected Map<String, GSSAccumulator> statsData;
+	
+	protected GenericUser users;
+	protected ResourceController resourceController;
+	protected boolean generateDiagrams = true;
+	protected AbstractStringSerializer serializer;
+	protected long startSimulationTime;
+	protected long endSimulationTime;
+	
+	//RESOURCES
+	protected Map<String, List<ResStat>> basicResStats;
+	protected Map<String, Double> basicResLoad;
+	
+	protected Map<String, TimetableEventSource> peGanttMap;
+	protected Map<String, TimetableEventGroup> taskGanttMap;
+	
+	protected Timetable ganttDiagramTimetable;
+	protected Map<ResourceType, List<XYDataset>> resourcePowerUsageDiagrams;
+	protected Map<ResourceType, List<XYDataset>> resourceAirFlowDiagrams;
+	protected Map<ResourceType, List<XYDataset>> resourceLoadDiagrams;
+	
+	//TASKS
+	protected int numOfdelayedTasks = 0;
+	protected int numOfNotExecutedTasks = 0;
+	protected double maxCj = 0;
+
+	protected boolean allTasksFinished;
+	protected TaskSeriesCollection ganttDiagramTaskSeriesCollection;
+	protected TaskSeriesCollection ganttDiagramWaitingTimeSeriesCollection;
+	protected HashMap<String, List<String>> task_processorsMap;
+
+	protected JobRegistry jr;
+
+	
+	public DCWormsStatistics(String simulationIdentifier, ConfigurationOptions co, GenericUser users,
+			String outputFolderName, ResourceController resourceController) {
+		this.simulationIdentifier = simulationIdentifier;
+		this.configuration = co;
+		this.users = users;
+
+		this.outputFolderName = outputFolderName;
+
+		this.serializer = new StringSerializer();
+		this.serializer.setDefaultNumberFormat(DataCenterWorkloadSimulator.DFAULT_NUMBER_FORMAT);
+
+		this.resourceController = resourceController;
+		this.jr = new JobRegistryImpl("");
+		init();
+	}
+
+	public void generateStatistics() {
+
+		this.startSimulationTime = DateTimeUtilsExt.getOffsetTime().getTimeInMillis();
+		this.endSimulationTime = DateTimeUtilsExt.currentTimeMillis();
+
+		long s = 0;
+		long e = 0;
+
+		log.info("gatherResourceStatistics");
+		s = System.currentTimeMillis();
+		gatherResourceStatistics();
+		e = System.currentTimeMillis();
+		log.info("time in sec: " + ((e - s) / MILLI_SEC));
+		
+		log.info("gatherTaskStatistics");
+		s = System.currentTimeMillis();
+		gatherTaskStatistics();
+		e = System.currentTimeMillis();
+		log.info("time in sec: " + ((e - s) / MILLI_SEC));
+
+		log.info("saveSimulationStatistics");
+		s = System.currentTimeMillis();
+		saveSimulationStatistics();
+		e = System.currentTimeMillis();
+		log.info("time in sec: " + ((e - s) / MILLI_SEC));
+	}
+
+
+	public String getOutputFolderName() {
+		return outputFolderName;
+	}
+
+	private void init() {
+
+		task_processorsMap = new HashMap<String, List<String>>();
+		accStats = new GSSAccumulatorsStats();
+		statsData = new HashMap<String, GSSAccumulator>();
+	}
+
+	public void saveSimulationStatistics() {
+		PrintStream simulationStatsFile = null;
+		if (configuration.createsimulationstatistics) {
+			try {
+				File file = new File(outputFolderName + STATS_FILE_NAME_PREFIX + simulationIdentifier + "_"
+						+ SIMULATION_STATISTICS_OUTPUT_FILE_NAME);
+				simulationStatsFile = new PrintStream(new FileOutputStream(file));
+			} catch (IOException e) {
+				e.printStackTrace();
+			}
+		}
+		if (simulationStatsFile != null) {
+			Object txt = accStats.serialize(this.serializer);
+			simulationStatsFile.println(txt);
+		}
+
+		if (simulationStatsFile != null) {
+			simulationStatsFile.close();
+		}
+	}
+
+	/************* RESOURCE STATISTICS SECTION **************/
+	private void gatherResourceStatistics() {
+		
+		HashMap<String, List<Stats>> type_stats = new HashMap<String, List<Stats>>();
+		
+		for(String resourceName: resourceController.getComputingResourceLayers()){
+			List<Stats> cStats = new ArrayList<Stats>();
+			cStats.add(Stats.textLoad);
+			if(ArrayUtils.contains(configuration.resForUtilizationChart, resourceName))
+				cStats.add(Stats.chartLoad);
+			cStats.add(Stats.textEnergy);
+			if(ArrayUtils.contains(configuration.resForEnergyChart, resourceName))
+				cStats.add(Stats.chartEnergy);
+			cStats.add(Stats.textAirFlow);
+			if(ArrayUtils.contains(configuration.resForAirFlowChart, resourceName))
+				cStats.add(Stats.chartAirFlow);
+			type_stats.put(resourceName, cStats);
+		}		
+		
+		peGanttMap = new HashMap<String, TimetableEventSource>();
+		taskGanttMap = new HashMap<String, TimetableEventGroup>();		
+		
+		resourceLoadDiagrams = new HashMap<ResourceType, List<XYDataset>>();
+		resourcePowerUsageDiagrams = new HashMap<ResourceType, List<XYDataset>>();
+		resourceAirFlowDiagrams = new HashMap<ResourceType, List<XYDataset>>();
+		
+		ganttDiagramTimetable = new Timetable(new FixedMillisecond(
+				startSimulationTime), new FixedMillisecond(endSimulationTime));
+		
+		PrintStream resourceLoadStatsFile = null;
+		try {
+			File file = new File(outputFolderName + STATS_FILE_NAME_PREFIX
+					+ simulationIdentifier + "_"
+					+ RESOURCEUTILIZATION_STATISTICS_OUTPUT_FILE_NAME);
+			resourceLoadStatsFile = new PrintStream(new FileOutputStream(file));
+		} catch (IOException e) {
+			resourceLoadStatsFile = null;
+		}
+		
+		PrintStream energyStatsFile = null;
+		try {
+			File file = new File(outputFolderName + STATS_FILE_NAME_PREFIX
+					+ simulationIdentifier + "_"
+					+ ENERGYUSAGE_STATISTICS_OUTPUT_FILE_NAME);
+			energyStatsFile = new PrintStream(new FileOutputStream(file));
+		} catch (IOException e) {
+			energyStatsFile = null;
+		}
+		
+		PrintStream airFlowStatsFile = null;
+		try {
+			File file = new File(outputFolderName + STATS_FILE_NAME_PREFIX
+					+ simulationIdentifier + "_"
+					+ AIRFLOW_STATISTICS_OUTPUT_FILE_NAME);
+			airFlowStatsFile = new PrintStream(new FileOutputStream(file));
+		} catch (IOException e) {
+			airFlowStatsFile = null;
+		}
+
+		basicResStats = gatherPEStats(jr.getExecutableTasks());
+		peStatsPostProcessing(basicResStats);
+		basicResLoad = calculatePELoad( basicResStats);
+
+		if (configuration.creatediagrams_gantt) {
+			createPEGanttDiagram(basicResStats);
+		}
+		
+		for(String resourceName: resourceController.getComputingResourceLayers()){
+			List<ComputingResource> resources = null;
+
+			resources = new ArrayList<ComputingResource>();
+			for(ComputingResource compRes: resourceController.getComputingResources() ){
+				resources.addAll(compRes.getDescendantsByType(new UserResourceType(resourceName)));
+			}
+			if(resourceController.getComputingResources().get(0).getType().getName().equals(resourceName))
+				resources.addAll(resourceController.getComputingResources());
+		
+			if(type_stats.containsKey(resourceName)){
+				for(ComputingResource resource: resources){
+					ResourceUsageStats resourceUsage = null;
+					ResourcePowerStats energyUsage = null;
+					ResourceAirFlowStats airFlow = null;
+					if(type_stats.get(resourceName).contains(Stats.textLoad)){
+						resourceUsage = gatherResourceLoadStats(resource, basicResStats);
+						resourceUsage.setMeanValue(calculateMeanValue(resourceUsage));
+						if (resourceLoadStatsFile != null) {
+							Object txt = resourceUsage.serialize(serializer);
+							resourceLoadStatsFile.println(txt);
+						}
+					}
+					if(type_stats.get(resourceName).contains(Stats.chartLoad)){
+						if (configuration.creatediagrams_resutilization) {
+							createResourceLoadDiagram(resourceUsage);
+						}
+					}
+					if(type_stats.get(resourceName).contains(Stats.textEnergy)){
+						energyUsage = gatherResourcePowerConsumptionStats(resource);
+						energyUsage.setMeanValue(calculateMeanValue(energyUsage));
+						energyUsage.setSumValue(energyUsage.getMeanValue() * (endSimulationTime - startSimulationTime) / (3600 * MILLI_SEC));
+						
+						EnergyExtension een = (EnergyExtension )(resource.getExtensionList().getExtension(ExtensionType.ENERGY_EXTENSION));
+						if(resourceController.getComputingResources().contains(resource)) {
+							if( een != null /*&& een.getPp() != null*/ ){
+								accStats.meanEnergyUsage.add(energyUsage.getMeanValue());
+							}
+
+						} else if( een != null && een.getPowerProfile() != null ){
+							ComputingResource parent = resource.getParent();
+							een = (EnergyExtension )(parent.getExtensionList().getExtension(ExtensionType.ENERGY_EXTENSION));
+							boolean top = true;
+							while(parent != null){
+								if(een != null &&  een.getPowerProfile() != null) {
+									top = false;
+									break;
+								}
+								parent = parent.getParent();
+							}
+							if(top == true){
+								accStats.meanEnergyUsage.add(energyUsage.getMeanValue());
+							}
+						}
+						if (energyStatsFile != null) {
+							Object txt = energyUsage.serialize(serializer);
+							energyStatsFile.println(txt);
+						}
+					}
+					if(type_stats.get(resourceName).contains(Stats.chartEnergy)){
+
+						if (configuration.creatediagrams_respowerusage) {
+							createResourceEnergyDiagramData(energyUsage);
+						}
+					}
+					
+					if(type_stats.get(resourceName).contains(Stats.textAirFlow)){
+						airFlow = gatherResourceAirFlowStats(resource);
+						airFlow.setMeanValue(calculateMeanValue(airFlow));
+						airFlow.setSumValue(airFlow.getMeanValue() * (endSimulationTime - startSimulationTime) / (3600 * MILLI_SEC));
+						
+						EnergyExtension een = (EnergyExtension)(resource.getExtensionList().getExtension(ExtensionType.ENERGY_EXTENSION));
+						if(resourceController.getComputingResources().contains(resource)) {
+							if( een != null /*&& een.getPp() != null*/ ){
+								accStats.meanAirFlow.add(airFlow.meanValue);
+							}
+
+						} else if( een != null && een.getAirFlowProfile() != null ){
+							ComputingResource parent = resource.getParent();
+							een = (EnergyExtension)(parent.getExtensionList().getExtension(ExtensionType.ENERGY_EXTENSION));
+							boolean top = true;
+							while(parent != null){
+								if(een != null &&  een.getAirFlowProfile() != null) {
+									top = false;
+									break;
+								}
+								parent = parent.getParent();
+							}
+							if(top == true){
+								accStats.meanAirFlow.add(airFlow.meanValue);
+							}
+						}
+						if (airFlowStatsFile != null) {
+							Object txt = airFlow.serialize(serializer);
+							airFlowStatsFile.println(txt);
+						}
+					}
+					if(type_stats.get(resourceName).contains(Stats.chartAirFlow)){
+
+						if (configuration.creatediagrams_resairflow) {
+							createResourceAirFlowDiagramData(airFlow);
+						}
+					}
+				}
+			}
+		}
+		
+		saveResourceGanttDiagrams();
+		createAccumulatedResourceSimulationStatistic();
+		
+		if (airFlowStatsFile != null) {
+			airFlowStatsFile.close();
+		}
+		if (energyStatsFile != null) {
+			energyStatsFile.close();
+		}
+		if (resourceLoadStatsFile != null) {
+			resourceLoadStatsFile.close();
+		}
+	}
+
+	
+	private void peStatsPostProcessing(Map<String, List<ResStat>> basicResStats){
+		ResourceType resType = null;
+
+		for(String key: basicResStats.keySet()){
+			List<ResStat> resStats = basicResStats.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) {
+			return;
+		}
+		for(ComputingResource resource: resources){
+			if(!basicResStats.containsKey(resource.getName())){
+				basicResStats.put(resource.getName(), new ArrayList<ResStat>());
+			}
+		}
+	}
+	
+	private Map<String, List<ResStat>> gatherPEStats( ExecutablesList executables) {
+		
+		Map<String, List<ResStat>> basicResStats = new TreeMap<String, List<ResStat>>(new MapPEIdComparator());
+
+		for (ExecTask execTask:executables) {
+			Executable exec = (Executable) execTask;
+
+			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);
+			//ProcessingElements pes = (ProcessingElements) resUnit ;
+			if(resUnit instanceof ProcessingElements){
+				ProcessingElements pes = (ProcessingElements) resUnit;
+				for(ComputingResource pe: pes){
+					String peName = pe.getName();
+					long startDate = Double.valueOf(exec.getExecStartTime()).longValue() * MILLI_SEC;
+					long endDate = Double.valueOf(exec.getFinishTime()).longValue() * MILLI_SEC;
+
+					String uniqueTaskID = execTask.getJobId() + "_" + execTask.getId();
+					
+					ResStat resStat = new ResStat(peName, pe.getType(), startDate, endDate, uniqueTaskID);
+					
+					List<ResStat> resStats = basicResStats.get(peName);
+					if (resStats == null) {
+						resStats = new ArrayList<ResStat>();
+						resStats.add(resStat);
+						basicResStats.put(peName, resStats);
+					} else {
+						resStats.add(resStat);
+					}
+
+					List<String> peNames = task_processorsMap.get(uniqueTaskID);
+					if (peNames == null) {
+						peNames = new ArrayList<String>();
+						peNames.add(peName);
+						task_processorsMap.put(uniqueTaskID, peNames);
+					} else {
+						peNames.add(peName);
+					}
+				}
+			} else if (resUnit instanceof PEUnit){
+				PEUnit peUnit = (PEUnit) resUnit ;
+			}
+
+		}
+		return basicResStats;
+	}
+	
+	private ResourceUsageStats gatherResourceLoadStats(ComputingResource resource, Map<String, List<ResStat>> basicStats) {
+		ResourceUsageStats usageStats = new ResourceUsageStats(resource.getName(), resource.getType(), "resourceLoadStats");
+		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++;
+				}
+			} catch (ResourceException e) {
+				// TODO Auto-generated catch block
+				e.printStackTrace();
+			}
+		}
+		for(Long key: usageStats.getHistory().keySet()){
+			Double value = usageStats.getHistory().get(key)/cnt;
+			usageStats.getHistory().put(key, value);
+		}
+
+		return usageStats;
+	}
+	
+	private Map<Long, Double> createResourceLoadData(ResourceUsageStats usageStats, List<ResStat> resStats) {
+
+		TreeMap<Long, Double> ganttData = (TreeMap<Long, Double>)usageStats.getHistory();
+		for (ResStat resStat : resStats) {
+			
+			long start_time = resStat.getStartDate();
+			long end_time = resStat.getEndDate();
+			if (end_time > start_time) {
+				Double end = ganttData.get(end_time);
+				if (end == null) {
+					ganttData.put(end_time, 0.0);
+					Long left = getLeftKey(ganttData, end_time);
+					if (left != null) {
+						Double leftValue = ganttData.get(left);
+						ganttData.put(end_time, leftValue);
+					}
+				}
+
+				Double start = ganttData.get(start_time);
+				if (start == null) {
+					ganttData.put(start_time, 0.0);
+					Long left = getLeftKey(ganttData, start_time);
+					if (left != null) {
+						Double leftValue = ganttData.get(left);
+						ganttData.put(start_time, leftValue);
+					}
+				}
+
+				SortedMap<Long, Double> sm = ganttData.subMap(start_time,
+						end_time);
+				for (Long key : sm.keySet()) {
+					Double keyVal = ganttData.get(key);
+					ganttData.put(key, keyVal + 1);
+				}
+			}
+		}
+
+		return ganttData;
+	}
+
+	private Long getLeftKey(TreeMap<Long, Double> ganttData, Long toKey) {
+
+		SortedMap<Long, Double> sm = ganttData.headMap(toKey);
+		if (sm.isEmpty()) {
+			return null;
+		}
+		return sm.lastKey();
+	}
+	
+	
+	private ResourcePowerStats gatherResourcePowerConsumptionStats(ComputingResource resource) {
+		double power = 0;
+		ResourcePowerStats resEnergyUsage = new ResourcePowerStats(resource.getName(), resource.getType(), "resourcePowerConsumptionStats");
+		Map<Long, Double> usage = resEnergyUsage.getHistory();
+		
+		ExtensionList extensionList = resource.getExtensionList();
+		if(extensionList != null){
+			for (Extension extension : extensionList) {
+				if (extension.getType() == ExtensionType.ENERGY_EXTENSION) {
+					EnergyExtension ee = (EnergyExtension)extension;
+					if(ee.getPowerProfile() == null)
+						break;
+					List<PowerUsage> powerUsage = ee.getPowerProfile().getPowerUsageHistory();
+					if(powerUsage.size() == 0)
+						break;
+					long lastTime = DateTimeUtilsExt.getOffsetTime().getTimeInMillis();
+					long endSimulationTime = DateTimeUtilsExt.currentTimeMillis();
+					double lastPower = 0;
+					powerUsage.add(new PowerUsage(endSimulationTime, ee.getPowerProfile().getPowerUsageHistory().get(ee.getPowerProfile().getPowerUsageHistory().size()-1).getValue()));
+					for(PowerUsage pu:powerUsage){
+						usage.put(pu.getTimestamp(), pu.getValue());
+						
+					///	System.out.println(resource.getName() + ":"+new DateTime(pu.getTimestamp())+";"+pu.getValue());
+						power = power + (pu.getTimestamp() - lastTime) * lastPower/ (3600 * MILLI_SEC);
+						lastPower = pu.getValue();
+						lastTime = pu.getTimestamp();
+					}
+				}
+			}
+		}
+		//System.out.println(power);
+		return resEnergyUsage;
+	}
+	
+	
+	private ResourceAirFlowStats gatherResourceAirFlowStats(ComputingResource resource) {
+
+		ResourceAirFlowStats resAirFlow = new ResourceAirFlowStats(resource.getName(), resource.getType(), "resourceAirFlowStats");
+		Map<Long, Double> airFlow = resAirFlow.getHistory();
+		
+		ExtensionList extensionList = resource.getExtensionList();
+		if(extensionList != null){
+			for (Extension extension : extensionList) {
+				if (extension.getType() == ExtensionType.ENERGY_EXTENSION) {
+					EnergyExtension ee = (EnergyExtension)extension;
+					if(ee.getAirFlowProfile() == null)
+						break;
+					List<AirFlowValue> airFlowHistory = ee.getAirFlowProfile().getAirThroughputHistory();
+					if(airFlowHistory.size() == 0)
+						break;
+					long endSimulationTime = DateTimeUtilsExt.currentTimeMillis();
+					airFlowHistory.add(new AirFlowValue(endSimulationTime, ee.getAirFlowProfile().getAirThroughputHistory().get(ee.getAirFlowProfile().getAirThroughputHistory().size()-1).getValue()));
+					for(AirFlowValue af:airFlowHistory){
+						airFlow.put(af.getTimestamp(), af.getValue());
+					}
+				}
+			}
+		}
+		return resAirFlow;
+	}
+	
+	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);
+
+		List<XYDataset> loadDiagram = resourceLoadDiagrams.get(resLoadStats.getResourceType());
+		if(loadDiagram == null){
+			loadDiagram = new ArrayList<XYDataset>();
+			loadDiagram.add(dataset);
+			resourceLoadDiagrams.put(resLoadStats.getResourceType(), loadDiagram);
+		} else {
+			loadDiagram.add(dataset);
+		}
+	}
+	
+	private void createResourceEnergyDiagramData(ResourceDynamicStats powerConsumptionStats) {
+
+		XYDataset dataset = createResourceChartDataSet(powerConsumptionStats,
+				startSimulationTime, endSimulationTime);
+		
+		List<XYDataset> energyDiagramData = resourcePowerUsageDiagrams.get(powerConsumptionStats.getResourceType());
+		if(energyDiagramData == null){
+			energyDiagramData = new ArrayList<XYDataset>();
+			energyDiagramData.add(dataset);
+			resourcePowerUsageDiagrams.put(powerConsumptionStats.getResourceType(), energyDiagramData);
+		} else {
+			energyDiagramData.add(dataset);
+		}
+	}
+
+	private void createResourceAirFlowDiagramData(ResourceDynamicStats airFlowStats) {
+
+		XYDataset dataset = createResourceChartDataSet(airFlowStats,
+				startSimulationTime, endSimulationTime);
+		
+		List<XYDataset> airFlowDiagramData = resourceAirFlowDiagrams.get(airFlowStats.getResourceType());
+		if(airFlowDiagramData == null){
+			airFlowDiagramData = new ArrayList<XYDataset>();
+			airFlowDiagramData.add(dataset);
+			resourceAirFlowDiagrams.put(airFlowStats.getResourceType(), airFlowDiagramData);
+		} else {
+			airFlowDiagramData.add(dataset);
+		}
+	}
+
+	private XYDataset createResourceChartDataSet(
+			ResourceDynamicStats dynamicStats, long start, long end) {
+
+		Map<Long, Double> chartData = getResourceChartRawData(dynamicStats);
+		XYSeriesCollection dataset = new XYSeriesCollection();
+		XYSeries data = new XYSeries(dynamicStats.getResourceName(), false, true);
+		//data.add(start, 0);
+		for (Long key : chartData.keySet()) {
+			Double val = chartData.get(key);
+			data.add(key, val);
+		}
+		data.add(end, 0);
+		dataset.addSeries(data);
+		return dataset;
+	}
+
+	private Map<Long, Double> getResourceChartRawData(
+			ResourceDynamicStats dynamicStats) {
+
+		Map<Long, Double> history = dynamicStats.getHistory();
+		Map<Long, Double> chartData = new TreeMap<Long, Double>();
+		for (Long key : history.keySet()) {
+			chartData.put(key, history.get(key));
+		}
+		return chartData;
+	}
+
+	private boolean saveResourceGanttDiagrams() {
+
+		if (!generateDiagrams)
+			return false;
+
+		String fileName = new File(outputFolderName, DIAGRAMS_FILE_NAME_PREFIX
+				+ simulationIdentifier + "_").getAbsolutePath();
+
+		String chartName = "Gantt diagram for "
+				+ DataCenterWorkloadSimulator.SIMULATOR_NAME;
+		String simulationTime = "Simulation time";
+		Title subtitle = new TextTitle("created for \"" + simulationIdentifier
+				+ "\" at " + Calendar.getInstance().getTime().toString());
+
+		JFreeChart peDiagram = null;
+		if (configuration.creatediagrams_gantt) {
+			peDiagram = getPEGanttDiagram(chartName, subtitle,
+					simulationTime);
+			if (!saveCategoryChart(peDiagram, fileName + "Gantt",
+					"{0}"))
+				return false;
+		}
+
+		JFreeChart resourceLoadDiagram = null;
+		if (configuration.creatediagrams_resutilization) {
+			String axisName = "UTILIZATION [%]";
+			for(ResourceType resType: resourceLoadDiagrams.keySet()){
+				resourceLoadDiagram = getResourceDynamicDiagram(resourceLoadDiagrams.get(resType), simulationTime, chartName,
+						subtitle, axisName);
+				if (!saveXYPlotChart(resourceLoadDiagram, fileName + "Resources Load - "+resType))
+					return false;
+			}
+		}
+		
+		JFreeChart resourceEnergyDiagram = null;
+		if (configuration.creatediagrams_respowerusage) {
+			String axisName = "POWER [W]";
+			for(ResourceType resType: resourcePowerUsageDiagrams.keySet()){
+				resourceEnergyDiagram = getResourceDynamicDiagram(resourcePowerUsageDiagrams.get(resType), simulationTime, chartName,
+						subtitle, axisName);
+				if (!saveXYPlotChart(resourceEnergyDiagram, fileName + "Energy - "+resType))
+					return false;
+			}
+		}
+		
+		JFreeChart resourceAirFlowDiagram = null;
+		if (configuration.creatediagrams_resairflow) {
+			String axisName = "AIR FLOW [m^3/min]";
+			for(ResourceType resType: resourceAirFlowDiagrams.keySet()){
+				resourceAirFlowDiagram = getResourceDynamicDiagram(resourceAirFlowDiagrams.get(resType), simulationTime, chartName,
+						subtitle, axisName);
+				if (!saveXYPlotChart(resourceAirFlowDiagram, fileName + "AirThroughput - "+resType))
+					return false;
+			}
+		}
+		return true;
+	}
+	
+	private JFreeChart getPEGanttDiagram(String chartName, Title subtitle,
+			String simulationTime) {
+		String processors = "Processing Elements";
+		boolean tooltip = true;
+		boolean legend = true;
+		JFreeChart chart = TimetableChartFactory.createTimetableChart(
+				chartName, processors, simulationTime,
+				ganttDiagramTimetable, legend, tooltip);
+		chart.addSubtitle(subtitle);
+		TimetableRenderer rend = (TimetableRenderer) chart.getCategoryPlot()
+				.getRenderer();
+		rend.setBackgroundBarPaint(null);
+		return chart;
+	}
+	
+	private JFreeChart getResourceDynamicDiagram(List<XYDataset> diagramData, String simulationTime, String chartName, Title subtitle,
+			String axisName) {
+		boolean urls = false;
+		boolean tooltip = true;
+		boolean legend = true;
+		CombinedDomainXYPlot cPlot = new CombinedDomainXYPlot();
+		DateAxis xAxis = new DateAxis(simulationTime);
+		JFreeChart chart = null;
+
+		for (XYDataset dataset : diagramData) {
+			JFreeChart tChart = ChartFactory.createXYStepAreaChart("", "",
+				null, dataset, PlotOrientation.VERTICAL, legend, tooltip, urls);
+			XYPlot tPlot = tChart.getXYPlot();
+			NumberAxis yAxis = new NumberAxis(axisName);
+			yAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
+			tPlot.setRangeAxis(yAxis);
+			XYStepAreaRenderer rend = (XYStepAreaRenderer) tPlot.getRenderer();
+			rend.setShapesVisible(false);
+			cPlot.add(tPlot);
+		}
+		cPlot.setDomainAxis(xAxis);
+		cPlot.setDomainAxisLocation(AxisLocation.TOP_OR_LEFT);
+		chart = new JFreeChart(chartName, cPlot);
+		chart.addSubtitle(subtitle);
+		return chart;
+	}
+	
+	private boolean saveXYPlotChart(JFreeChart c, String fileName) {
+		c.setNotify(false);
+		c.setAntiAlias(true);
+		c.setTextAntiAlias(true);
+		c.setBorderVisible(false);
+
+		int height = 900;
+
+		CombinedDomainXYPlot cPlot = (CombinedDomainXYPlot) c.getPlot();
+		int nPlots = cPlot.getSubplots().size();
+
+		if (nPlots > 3) {
+			height = nPlots * 300;
+		}
+		int width = GANTT_WIDTH;
+
+		if (configuration.creatediagrams_resources_scale != -1)
+			width = (int) ((endSimulationTime - startSimulationTime) * configuration.creatediagrams_resources_scale);
+		ChartRenderingInfo info = new ChartRenderingInfo();
+		File f = new File(fileName + "." + ImageFormat.PNG);
+		final String dcwormsSubtitle = "Created by "
+				+ DataCenterWorkloadSimulator.SIMULATOR_NAME
+				+ " http://www.gssim.org/";
+		c.addSubtitle(new TextTitle(dcwormsSubtitle));
+		boolean encodeAlpha = false;
+		int compression = 9;// values 0-9
+		try {
+			ChartUtilities.saveChartAsPNG(f, c, width, height, info,
+					encodeAlpha, compression);
+		} catch (IOException e) {
+			e.printStackTrace();
+			return false;
+		}
+		return true;
+	}
+	
+	private void createPEGanttDiagram(Map<String,List<ResStat>> basicResStats) {
+		for(String peName: basicResStats.keySet()){
+			TimetableEventSource pe = new TimetableEventSource(peName);
+			ganttDiagramTimetable.addEventSource(pe);
+			peGanttMap.put(peName, pe);
+			for(ResStat resStat: basicResStats.get(peName)){
+
+				pe = peGanttMap.get(resStat.getPeName());
+				if(pe == null){
+					//pe = new TimetableEventSource(resStat.getPeName());
+				//	ganttDiagramPeTimetable.addEventSource(pe);
+				//	peGanttMap.put(resStat.getPeName(), pe);
+				}
+				TimetableEventGroup task = taskGanttMap.get(resStat.getTaskID());
+				long startDate = resStat.getStartDate();
+				long endDate = resStat.getEndDate();
+				if (task == null) {
+					task = new TimetableEventGroup(resStat.getTaskID());
+					taskGanttMap.put(resStat.getTaskID(), task);
+					ganttDiagramTimetable.addEventGroup(task);
+				}
+				ganttDiagramTimetable.addEvent(pe, task,
+						new FixedMillisecond(startDate), new FixedMillisecond(endDate));
+			}
+		}
+	}
+
+
+	//TO DO
+	private void createAccumulatedResourceSimulationStatistic() {
+
+		List<ComputingResource> resources = resourceController.getComputingResources();
+		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);
+				/*ResourceEnergyStats energyUsage = gatherResourceEnergyStats(compRes);
+				energyUsage.setMeanUsage(calculateEnergyLoad(energyUsage));
+				accStats.meanEnergyUsage.add(energyUsage.meanUsage);*/
+			//}	
+		}
+	}
+
+	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);
+			double sum = 0;
+			for(ResStat resStat:resStats){
+				sum += (resStat.endDate - resStat.startDate);
+			}
+			double load = sum / (endSimulationTime - startSimulationTime);
+			peLoad.put(resName, load);
+		}
+		return peLoad;
+	}
+	
+	private  Double calculateResourceLoad(ComputingResource resource, Map<String, Double> peLoad ){
+		int peCnt = 0;
+		double sum = 0;
+		for(String resName: peLoad.keySet()){
+
+			try {
+				if(resource.getDescendantByName(resName) != null || resource.getName().compareTo(resName) == 0){
+					Double load = peLoad.get(resName);
+					sum += load;
+					peCnt++;
+				}
+			} catch (ResourceException e) {
+				// TODO Auto-generated catch block
+				e.printStackTrace();
+			}
+		}
+		
+		return sum/peCnt;
+	}
+
+	
+	private double calculateMeanValue(ResourceDynamicStats resDynamicStats ){
+		double meanValue = 0;
+		long time = 0;
+		double value = 0;
+		
+		Map<Long, Double> history = resDynamicStats.getHistory();
+		for (Long key : history.keySet()) {
+			
+			if (time != 0) {
+				meanValue += (value * (key - time)) / (endSimulationTime - startSimulationTime);
+				time = key;
+			} else {
+				time = key;
+			}
+			value = history.get(key);
+		}
+		return meanValue;
+	}
+	
+	
+
+	
+	
+	
+	
+
+
+	/************* TASK STATISTICS SECTION **************/
+	public void gatherTaskStatistics() {
+
+		List<JobInterface<?>> jobs = users.getAllReceivedJobs();
+		Collections.sort(jobs, new JobIdComparator());
+
+		ganttDiagramTaskSeriesCollection = new TaskSeriesCollection();
+		ganttDiagramWaitingTimeSeriesCollection = new TaskSeriesCollection();
+
+		PrintStream taskStatsFile = null;
+		try {
+			File file = new File(outputFolderName + STATS_FILE_NAME_PREFIX + simulationIdentifier + "_"
+					+ RAW_TASKS_STATISTICS_OUTPUT_FILE_NAME);
+			taskStatsFile = new PrintStream(new FileOutputStream(file));
+		} catch (IOException e) {
+			taskStatsFile = null;
+		}
+
+		PrintStream jobStatsFile = null;
+		if (configuration.createjobsstatistics) {
+			try {
+				File file = new File(outputFolderName + STATS_FILE_NAME_PREFIX + simulationIdentifier + "_"
+						+ JOBS_STATISTICS_OUTPUT_FILE_NAME);
+				jobStatsFile = new PrintStream(new FileOutputStream(file));
+			} catch (IOException e) {
+				jobStatsFile = null;
+			}
+		}
+
+		for (int i = 0; i < jobs.size(); i++) {
+			Job job = (Job) jobs.get(i);
+
+			List<Executable> execList = jr.getExecutableTasks().getJobExecutables(job.getId());
+			List<TaskStats> taskStatsList = new ArrayList<TaskStats>();
+
+			this.serializer.setFieldSeparator(TASK_SEPARATOR);
+
+			for (int j = 0; j < execList.size(); j++) {
+
+				Executable task = (Executable) execList.get(j);
+
+				TaskStats taskStats = createTaskStats(task);
+				if (taskStats != null && taskStatsFile != null) {
+					Object txt = taskStats.serialize(serializer);
+					taskStatsFile.println(txt);
+				}
+				if (taskStats != null && taskStats.getExecFinishDate() != -1) {
+					if (configuration.createsimulationstatistics) {
+						createAccumulatedTaskSimulationStatistic(taskStats);
+					}
+					allTasksFinished &= task.isFinished();
+					if (generateDiagrams) {
+						if (configuration.creatediagrams_tasks)
+							createTaskDiagramData(task);
+						if (configuration.creatediagrams_taskswaitingtime)
+							createTaskWaitingTimeDiagramData(task);
+					}
+					taskStatsList.add(taskStats);
+				}
+			}
+			if (configuration.createjobsstatistics && taskStatsList.size() > 0) {
+
+				this.serializer.setFieldSeparator(JOB_SEPARATOR);
+				JobStats jobStats = createJobStats(taskStatsList);
+				if (jobStatsFile != null) {
+					Object txt = jobStats.serialize(serializer);
+					jobStatsFile.println(txt);
+				}
+			}
+		}
+
+		if (configuration.createsimulationstatistics) {
+			accStats.makespan.add(maxCj);
+			accStats.delayedTasks.add(numOfdelayedTasks);
+			accStats.failedRequests.add(users.getAllSentTasks().size() - users.getFinishedTasksCount());
+			if(resourceController.getScheduler().getType().getName().equals("GS")){
+				for(Scheduler sched: resourceController.getScheduler().getChildren()){
+					accStats.meanQueueLength.add(getSchedulerQueueStats(sched));
+				}
+			}
+			else {
+				accStats.meanQueueLength.add(getSchedulerQueueStats(resourceController.getScheduler()));
+			}
+		}
+
+		saveTaskGanttDiagrams();
+
+		if (taskStatsFile != null) {
+			taskStatsFile.close();
+		}
+		if (jobStatsFile != null) {
+			jobStatsFile.close();
+		}
+	}
+
+	private double getSchedulerQueueStats(Scheduler scheduler) {
+
+		Sim_stat stats = scheduler.get_stat();
+		List<Object[]> measures = stats.get_measures();
+		for (Object[] info : measures) {
+			String measure = (String) info[0];
+			if (measure
+					.startsWith(DCWormsConstants.TASKS_QUEUE_LENGTH_MEASURE_NAME)) {
+				return stats.average(measure);
+			}
+		}
+		return 0;
+	}
+	
+	private TaskStats createTaskStats(Executable task) {
+		TaskStats taskStats = new TaskStats(task, startSimulationTime);
+		String uniqueTaskID = taskStats.getJobID() + "_" + taskStats.getTaskID();
+		taskStats.setProcessorsName(task_processorsMap.get(uniqueTaskID));
+		return taskStats;
+	}
+
+	private JobStats createJobStats(List<TaskStats> tasksStats) {
+
+		String jobID = ((TaskStats) tasksStats.get(0)).getJobID();
+		JobStats jobStats = new JobStats(jobID);
+		double maxCj = 0;
+
+		for (int i = 0; i < tasksStats.size(); i++) {
+
+			TaskStats task = (TaskStats) tasksStats.get(i);
+			jobStats.meanTaskStartTime.add(task.getStartTime());
+			jobStats.meanTaskCompletionTime.add(task.getCompletionTime());
+			maxCj = Math.max(maxCj, task.getCompletionTime());
+			jobStats.meanTaskExecutionTime.add(task.getExecutionTime());
+			jobStats.meanTaskWaitingTime.add(task.getWaitingTime());
+			jobStats.meanTaskFlowTime.add(task.getFlowTime());
+			jobStats.meanTaskGQ_WaitingTime.add(task.getGQ_WaitingTime());
+			jobStats.lateness.add(task.getLateness());
+			jobStats.tardiness.add(task.getTardiness());
+		}
+		jobStats.makespan.add(maxCj);
+
+		return jobStats;
+	}
+
+	private void createAccumulatedTaskSimulationStatistic(TaskStats taskStats) {
+		accStats.meanTaskFlowTime.add(taskStats.getFlowTime());
+		accStats.meanTaskExecutionTime.add(taskStats.getExecutionTime());
+		accStats.meanTaskCompletionTime.add(taskStats.getCompletionTime());
+		accStats.meanTaskWaitingTime.add(taskStats.getWaitingTime());
+		accStats.meanTaskStartTime.add(taskStats.getStartTime());
+
+		accStats.lateness.add(taskStats.getLateness());
+		accStats.tardiness.add(taskStats.getTardiness());
+
+		if (taskStats.getExecFinishDate() == -1) {
+			numOfNotExecutedTasks++;
+		}
+		if (taskStats.getTardiness() > 0.0) {
+			numOfdelayedTasks++;
+		}
+
+		maxCj = Math.max(maxCj, taskStats.getCompletionTime());
+	}
+
+	private void createTaskDiagramData(Executable task) {
+		String uniqueTaskID = task.getJobId() + "_" + task.getId();
+
+		String resID = task.getSchedulerName();
+
+		long execStartTime = Double.valueOf(task.getExecStartTime()).longValue() * MILLI_SEC;
+		long execEndTime = Double.valueOf(task.getFinishTime()).longValue() * MILLI_SEC;
+
+		TaskSeries taskRes = ganttDiagramTaskSeriesCollection.getSeries(resID);
+		if (taskRes == null) {
+			taskRes = new TaskSeries(resID);
+			ganttDiagramTaskSeriesCollection.add(taskRes);
+		}
+		org.jfree.data.gantt.Task ganttTask = new org.jfree.data.gantt.Task(uniqueTaskID, new Date(execStartTime),
+				new Date(execEndTime));
+		if (!task.isFinished()) {
+			ganttTask.setPercentComplete(1.0);
+		}
+		taskRes.add(ganttTask);
+	}
+
+	private void createTaskWaitingTimeDiagramData(Executable task) {
+		String uniqueTaskID = task.getJobId() + "_" + task.getId();
+
+		String resID = task.getSchedulerName();
+
+		long execStartTime = Double.valueOf(task.getExecStartTime()).longValue() * MILLI_SEC;
+		long execEndTime = Double.valueOf(task.getFinishTime()).longValue() * MILLI_SEC;
+
+		TaskSeries waitRes = ganttDiagramWaitingTimeSeriesCollection.getSeries(resID);
+		if (waitRes == null) {
+			waitRes = new TaskSeries(resID);
+			ganttDiagramWaitingTimeSeriesCollection.add(waitRes);
+		}
+
+		long sub = Double.valueOf(task.getSubmissionTime()).longValue() * MILLI_SEC;
+		org.jfree.data.gantt.Task wait_exec = new org.jfree.data.gantt.Task(uniqueTaskID, new Date(sub), new Date(
+				execEndTime));
+		org.jfree.data.gantt.Task exec = new org.jfree.data.gantt.Task(uniqueTaskID, new Date(execStartTime), new Date(
+				execEndTime));
+		if (!task.isFinished()) {
+			exec.setPercentComplete(1.0);
+		}
+		wait_exec.addSubtask(wait_exec);
+		wait_exec.addSubtask(exec);
+		waitRes.add(wait_exec);
+	}
+
+	private boolean saveTaskGanttDiagrams() {
+
+		JFreeChart taskDiagram = null;
+		JFreeChart waitingTimeDiagram = null;
+
+		if (!generateDiagrams)
+			return false;
+
+		String fileName = new File(outputFolderName, DIAGRAMS_FILE_NAME_PREFIX + simulationIdentifier + "_")
+				.getAbsolutePath();
+
+		String chartName = "Gantt diagram for " + DataCenterWorkloadSimulator.SIMULATOR_NAME;
+		String simulationTime = "Simulation time";
+		Title subtitle = new TextTitle("created for \"" + simulationIdentifier + "\" at "
+				+ Calendar.getInstance().getTime().toString());
+
+		if (configuration.creatediagrams_tasks) {
+			taskDiagram = getTaskDiagram(chartName, subtitle, simulationTime);
+			if (!saveCategoryChart(taskDiagram, fileName + "Tasks", null /* "{0}" */))
+				return false;
+		}
+
+		if (configuration.creatediagrams_taskswaitingtime) {
+			waitingTimeDiagram = getWaitingTimeDiagram(chartName, subtitle, simulationTime);
+			if (!saveCategoryChart(waitingTimeDiagram, fileName + "Waiting_Time", null /* "Task {1} at {0}" */))
+				return false;
+		}
+
+		return true;
+	}
+
+	private JFreeChart getTaskDiagram(String chartName, Title subtitle, String simulationTime) {
+		String tasks = "Tasks";
+		boolean urls = false;
+		boolean tooltip = true;
+		boolean legend = true;
+		JFreeChart chart = ChartFactory.createGanttChart(chartName, tasks, simulationTime,
+				ganttDiagramTaskSeriesCollection, legend, tooltip, urls);
+		chart.addSubtitle(subtitle);
+		GanttRenderer re = (GanttRenderer) chart.getCategoryPlot().getRenderer();
+		re.setCompletePaint(Color.black);
+		return chart;
+	}
+
+	private JFreeChart getWaitingTimeDiagram(String chartName, Title subtitle, String simulationTime) {
+		String tasks = "Tasks";
+		boolean urls = false;
+		boolean tooltip = true;
+		boolean legend = true;
+		JFreeChart chart = ChartFactory.createGanttChart(chartName, tasks, simulationTime,
+				ganttDiagramWaitingTimeSeriesCollection, legend, tooltip, urls);
+		chart.addSubtitle(subtitle);
+		chart.getPlot().setForegroundAlpha(ALPHA);
+		GanttRenderer re = (GanttRenderer) chart.getCategoryPlot().getRenderer();
+		re.setCompletePaint(Color.black);
+		return chart;
+	}
+
+	private boolean saveCategoryChart(JFreeChart c, String fileName, String labelFormat) {
+		c.setNotify(false);
+		c.setAntiAlias(true);
+		c.setTextAntiAlias(true);
+		c.setBorderVisible(false);
+
+		CategoryPlot categoryplot = (CategoryPlot) c.getPlot();
+		categoryplot.setDomainGridlinesVisible(true);
+
+		if (labelFormat != null) {
+			CategoryItemRenderer rend = categoryplot.getRenderer();
+			rend.setBaseItemLabelsVisible(true);
+			ItemLabelPosition position = new ItemLabelPosition(ItemLabelAnchor.CENTER, TextAnchor.CENTER);
+			rend.setBasePositiveItemLabelPosition(position);
+			NumberFormat nf = NumberFormat.getInstance();
+			CategoryItemLabelGenerator gen = new StandardCategoryItemLabelGenerator(labelFormat, nf);
+			rend.setBaseItemLabelGenerator(gen);
+		}
+
+		int rows = c.getCategoryPlot().getDataset().getColumnKeys().size();
+
+		int height = 900;
+		if (rows > 45) {
+			height = rows * 20;
+		}
+		int width = calculateChartWidth(c);
+		CategoryItemRenderer rend = c.getCategoryPlot().getRenderer();
+
+		for (int i = 0; i < c.getCategoryPlot().getDataset().getRowKeys().size(); i++) {
+			Paint collor = c.getCategoryPlot().getDrawingSupplier().getNextPaint();
+			rend.setSeriesOutlinePaint(i, collor);
+			rend.setSeriesPaint(i, collor);
+		}
+
+		ChartRenderingInfo info = new ChartRenderingInfo();
+		// info.setEntityCollection(null);
+		File f = new File(fileName + "." + ImageFormat.PNG);
+		final String dcwormsSubtitle = "Created by " + DataCenterWorkloadSimulator.SIMULATOR_NAME + " http://www.gssim.org/";
+		c.addSubtitle(new TextTitle(dcwormsSubtitle));
+		boolean encodeAlpha = false;
+		int compression = 9;
+		try {
+			ChartUtilities.saveChartAsPNG(f, c, width, height, info, encodeAlpha, compression);
+
+		} catch (IOException e) {
+			e.printStackTrace();
+			return false;
+		} catch (Exception e) {
+			if (log.isErrorEnabled())
+				log.error("The png file (" + fileName
+						+ ")\nwill not be generated (It can be too large data size problem)", e);
+		} catch (Throwable t) {
+			log.error("The png file (" + fileName + ")\nwill not be generated (It can be too large data size problem)",
+					t);
+		}
+
+		return true;
+	}
+
+	private int calculateChartWidth(JFreeChart c) {
+
+		int ganttWidth = GANTT_WIDTH;
+		int rows = c.getCategoryPlot().getDataset().getColumnKeys().size();
+
+		if (rows > 45) {
+			int height = rows * 20;
+			ganttWidth = Math.max((int) (height * 1.5), GANTT_WIDTH);
+		}
+		return ganttWidth;
+	}
+
+	private static class JobIdComparator implements Comparator<JobInterface<?>> {
+
+		public int compare(JobInterface<?> o1, JobInterface<?> o2) {
+			Integer o1int;
+			Integer o2int;
+			try{
+				o1int = Integer.parseInt(o1.getId());
+				o2int = Integer.parseInt(o2.getId());
+				return o1int.compareTo(o2int);
+			} catch(NumberFormatException e){
+				return o1.getId().compareTo(o2.getId());
+			}
+		}
+	}
+	
+	private static class MapPEIdComparator implements Comparator<String> {
+
+		public int compare(String o1, String o2)  {
+			Integer o1int;
+			Integer o2int;
+
+			o1int = Integer.parseInt(o1.substring(o1.indexOf("_")+1));
+			o2int = Integer.parseInt(o2.substring(o2.indexOf("_")+1));
+			return o1int.compareTo(o2int);
+		}
+	}
+
+	public GSSAccumulator getStats(String name) {
+		return statsData.get(name);
+	}
+	
+	private void createStatsData() {
+		statsData.put(MAKESPAN, accStats.makespan);
+		statsData.put(TASK_COMPLETION_TIME, accStats.meanTaskCompletionTime);
+		statsData.put(TASK_EXECUTION_TIME, accStats.meanTaskExecutionTime);
+		statsData.put(TASK_START_TIME, accStats.meanTaskStartTime);
+		statsData.put(TASK_FLOW_TIME, accStats.meanTaskFlowTime);
+		statsData.put(TASK_WAITING_TIME, accStats.meanTaskWaitingTime);
+		statsData.put(TASK_LATENESS, accStats.lateness);
+		statsData.put(TASK_TARDINESS, accStats.tardiness);
+		statsData.put(DELAYED_TASKS, accStats.delayedTasks);
+		statsData.put(FAILED_REQUESTS, accStats.failedRequests);
+		statsData.put(RESOURCES_TOTAL_LOAD, accStats.meanTotalLoad);
+		statsData.put(RESOURCES_RESERVATION_LOAD, accStats.meanReservationLoad);
+		statsData.put(RESOURCES_RESERVATION_LOAD, accStats.meanEnergyUsage);
+		statsData.put(RESOURCES_QUEUE_LENGTH, accStats.meanQueueLength);
+	}
+
+
+	public boolean accumulatedStats() {
+		return configuration.createsimulationstatistics;
+	}
+
+}
+
+class ResStat{
+	
+	public long getStartDate() {
+		return startDate;
+	}
+	public void setStartDate(long startDate) {
+		this.startDate = startDate;
+	}
+	public long getEndDate() {
+		return endDate;
+	}
+	public void setEndDate(long endDate) {
+		this.endDate = endDate;
+	}
+	public String getTaskID() {
+		return taskID;
+	}
+	public void setTaskID(String taskID) {
+		this.taskID = taskID;
+	}
+
+	public ResStat( String peName, long startDate, long endDate, String taskID) {
+		super();
+		this.startDate = startDate;
+		this.endDate = endDate;
+		this.taskID = taskID;
+		this.peName = peName;
+	}
+	public String getPeName() {
+		return peName;
+	}
+	public void setPeName(String peName) {
+		this.peName = peName;
+	}
+	public ResStat(String peName, ResourceType resType, long startDate, long endDate, String taskID) {
+		super();
+		this.peName = peName;
+		this.resType = resType;
+		this.startDate = startDate;
+		this.endDate = endDate;
+		this.taskID = taskID;
+	}
+	String peName;
+	ResourceType resType;
+	long startDate;
+	long endDate;
+	String taskID;
+
+	public ResourceType getResType() {
+		return resType;
+	}
+	public void setResType(ResourceType resType) {
+		this.resType = resType;
+	}
+}
+
+enum Stats{
+	textLoad,
+	chartLoad,
+	textEnergy,
+	chartEnergy,
+	textAirFlow,
+	chartAirFlow;
+}
Index: /DCWoRMS/trunk/build/classes/simulator/stats/implementation/ResourceDynamicStats.java
===================================================================
--- /DCWoRMS/trunk/build/classes/simulator/stats/implementation/ResourceDynamicStats.java	(revision 539)
+++ /DCWoRMS/trunk/build/classes/simulator/stats/implementation/ResourceDynamicStats.java	(revision 539)
@@ -0,0 +1,53 @@
+package simulator.stats.implementation;
+
+import java.util.Map;
+import java.util.TreeMap;
+
+import schedframe.resources.ResourceType;
+
+public abstract class ResourceDynamicStats {
+	
+	protected Map<Long, Double> history;
+	protected String resourceName;
+	protected String usageType;
+	protected ResourceType resourceType;
+	protected double meanValue;
+
+	private String[] headers = { "resourceName", "timestamp", "usage" };
+
+	public ResourceDynamicStats(String resourceName, ResourceType resourceType, String usageType) {
+		this.resourceName = resourceName;
+		this.resourceType = resourceType;
+		this.usageType = usageType;
+		this.history = new TreeMap<Long, Double>();
+		this.meanValue = 0;
+	}
+
+	public void setMeanValue(double meanValue) {
+		this.meanValue = meanValue;
+	}
+	
+	public double getMeanValue() {
+		return meanValue;
+	}
+
+	public String getResourceName() {
+		return this.resourceName;
+	}
+	
+	public ResourceType getResourceType() {
+		return resourceType;
+	}
+	
+	public String getUsageType() {
+		return this.usageType;
+	}	
+
+	public Map<Long, Double> getHistory() {
+		return this.history;
+	}
+
+	public String[] getHeaders() {
+		return headers;
+	}
+}
Index: /DCWoRMS/trunk/build/classes/simulator/stats/implementation/ResourceAirFlowStats.java
===================================================================
--- /DCWoRMS/trunk/build/classes/simulator/stats/implementation/ResourceAirFlowStats.java	(revision 539)
+++ /DCWoRMS/trunk/build/classes/simulator/stats/implementation/ResourceAirFlowStats.java	(revision 539)
@@ -0,0 +1,32 @@
+package simulator.stats.implementation;
+
+import schedframe.resources.ResourceType;
+import simulator.stats.implementation.out.StatsSerializer;
+
+public class ResourceAirFlowStats extends ResourceDynamicStats implements StatsInterface{
+
+	protected double sumValue;
+	
+	private String[] headers = { "resourceName", "timestamp", "airFlow" };
+	
+	public ResourceAirFlowStats (String resourceName, ResourceType resourceType, String usageType) {
+		super(resourceName, resourceType, usageType);
+	}
+
+	public void setSumValue(double sumValue) {
+		this.sumValue = sumValue;
+	}
+
+	public double getSumValue() {
+		return sumValue;
+	}
+	
+	public Object serialize(StatsSerializer serializer) {
+		return serializer.visit(this);
+	}
+
+	public String[] getHeaders() {
+		return headers;
+	}
+
+}
Index: /DCWoRMS/trunk/build/classes/simulator/stats/implementation/ResourceUsageStats.java
===================================================================
--- /DCWoRMS/trunk/build/classes/simulator/stats/implementation/ResourceUsageStats.java	(revision 477)
+++ /DCWoRMS/trunk/build/classes/simulator/stats/implementation/ResourceUsageStats.java	(revision 539)
@@ -1,56 +1,13 @@
 package simulator.stats.implementation;
 
-import java.util.Map;
-import java.util.TreeMap;
-
 import schedframe.resources.ResourceType;
-import schedframe.resources.StandardResourceType;
 import simulator.stats.implementation.out.StatsSerializer;
 
-/**
- * 
- * @author Marcin Krystek
- * 
- */
-public class ResourceUsageStats implements StatsInterface {
+public class ResourceUsageStats extends ResourceDynamicStats implements StatsInterface {
 
-	protected Map<Long, Integer> usage;
-	protected String resourceName;
-	protected String usageType;
-	protected ResourceType resourceType;
-	protected double meanUsage;
-	
-	public void setMeanUsage(double meanUsage) {
-		this.meanUsage = meanUsage;
-	}
-
-	private String[] headers = { "resourceName", "timestamp", "usage" };
+	private String[] headers = { "resourceName", "timestamp", "utilization" };
 
 	public ResourceUsageStats(String resourceName, ResourceType resourceType, String usageType) {
-		this.resourceName = resourceName;
-		this.resourceType = resourceType;
-		this.usageType = usageType;
-		this.usage = new TreeMap<Long, Integer>();
-		this.meanUsage = 0;
-	}
-
-	public double getMeanUsage() {
-		return meanUsage;
-	}
-
-	public String getResourceName() {
-		return this.resourceName;
-	}
-	
-	public ResourceType getResourceType() {
-		return resourceType;
-	}
-	
-	public String getUsageType() {
-		return this.usageType;
-	}	
-
-	public Map<Long, Integer> getUsage() {
-		return this.usage;
+		super(resourceName, resourceType, usageType);
 	}
 
@@ -62,4 +19,3 @@
 		return headers;
 	}
-
 }
Index: /DCWoRMS/trunk/build/classes/simulator/stats/implementation/GSSAccumulatorsStats.java
===================================================================
--- /DCWoRMS/trunk/build/classes/simulator/stats/implementation/GSSAccumulatorsStats.java	(revision 477)
+++ /DCWoRMS/trunk/build/classes/simulator/stats/implementation/GSSAccumulatorsStats.java	(revision 539)
@@ -10,4 +10,5 @@
 	public GSSAccumulator meanQueueLength;
 	public GSSAccumulator meanEnergyUsage;
+	public GSSAccumulator meanAirFlow;
 
 	public GSSAccumulator meanTaskStartTime;
@@ -29,5 +30,6 @@
 		meanReservationLoad = new GSSAccumulator();
 		meanQueueLength = new GSSAccumulator();
-		meanEnergyUsage = new GSSAccumulator();
+		meanEnergyUsage = new GSSAccumulator(); 
+		meanAirFlow = new GSSAccumulator(); 
 
 		meanTaskStartTime = new GSSAccumulator();
Index: /DCWoRMS/trunk/build/classes/simulator/stats/AccumulatedStatistics.java
===================================================================
--- /DCWoRMS/trunk/build/classes/simulator/stats/AccumulatedStatistics.java	(revision 477)
+++ /DCWoRMS/trunk/build/classes/simulator/stats/AccumulatedStatistics.java	(revision 539)
@@ -10,5 +10,5 @@
 import java.util.List;
 
-import simulator.stats.implementation.GSSimStatistics;
+import simulator.stats.implementation.DCWormsStatistics;
 import gridsim.Accumulator;
 
Index: /DCWoRMS/trunk/build/classes/simulator/utils/XsltTransformations.java
===================================================================
--- /DCWoRMS/trunk/build/classes/simulator/utils/XsltTransformations.java	(revision 477)
+++ /DCWoRMS/trunk/build/classes/simulator/utils/XsltTransformations.java	(revision 539)
@@ -1,6 +1,4 @@
 package simulator.utils;
 
-import gssim.schedframe.scheduling.utils.JobDescription;
-import gssim.schedframe.scheduling.utils.TaskDescription;
 
 import java.io.IOException;
@@ -20,4 +18,7 @@
 import javax.xml.transform.stream.StreamSource;
 import javax.xml.xpath.XPathExpressionException;
+
+import dcworms.schedframe.scheduling.utils.JobDescription;
+import dcworms.schedframe.scheduling.utils.TaskDescription;
 
 /**
Index: /DCWoRMS/trunk/build/classes/simulator/reader/ResourceReader.java
===================================================================
--- /DCWoRMS/trunk/build/classes/simulator/reader/ResourceReader.java	(revision 477)
+++ /DCWoRMS/trunk/build/classes/simulator/reader/ResourceReader.java	(revision 539)
@@ -11,7 +11,9 @@
 import java.util.Deque;
 import java.util.HashMap;
+import java.util.LinkedHashSet;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
 
 import org.exolab.castor.types.AnyNode;
@@ -54,4 +56,6 @@
 	private String globalSchedulingPluginName;
 	
+	private Set<String> compResLayers;
+	
 	public ResourceReader(ConfigurationOptions options) throws IOException {
 
@@ -59,4 +63,5 @@
 		globalSchedulingPluginName = "example.globalplugin.GridFCFSRoundRobinPlugin";
 		prepareCalendar();
+		compResLayers = new LinkedHashSet<String>();
 	}
 
@@ -64,21 +69,5 @@
 			UnknownParameter {
 
-		//File file = new File("src/test/rewolucja/schemas/example/coolemall/example4.xml");
 		File file = new File(resDescFileName);
-		//File file = new File("example/tomekp/experiment1/tomExp3.xml");
-		/*long s =System.currentTimeMillis();
-		System.out.println("start: ");
-		List<Processor> list = new ArrayList<Processor>();
-		for(int i =0;i<3000000;i++){
-			schemas.ComputingResource compResDef = new schemas.ComputingResource();
-			compResDef.setName("a"+i);
-			compResDef.setClazz("Processor");
-			CompResourceDescription resDesc = new CompResourceDescription(compResDef);
-			Processor proc = new Processor(resDesc);
-			list.add(proc);
-		}
-		long e = System.currentTimeMillis();
-		System.out.println("end: ");
-		System.out.println(e-s);*/
 		Environment env = Environment.unmarshal(new FileReader(file));
 		
@@ -97,4 +86,5 @@
 		ResourceController rc = new ResourceController(mainScheduler, computingResources);
 		rc.setInitList(toInit);
+		rc.setCompResLayers(compResLayers);
 		return rc;
 	}
@@ -177,5 +167,4 @@
 
 		List<ComputingResource> mainCompResourceList = new ArrayList<ComputingResource>();
-		
 		Deque<ComputingResourceDescription> toExamine = new ArrayDeque<ComputingResourceDescription>();
 		Deque<ComputingResource> resStructure = new ArrayDeque<ComputingResource>();
@@ -192,4 +181,5 @@
 			ComputingResource parentResource = resStructure.pop();
 			toInit.add(parentResource);
+			compResLayers.add(parentResource.getType().getName());
 			List<AbstractResourceDescription> childrenResDesc = parentResDesc.getChildren();
 			if (childrenResDesc == null){
@@ -250,5 +240,5 @@
 		//TODO - refactor (remove - create scheduler on the basis of resource description)
 		Scheduler mainScheduler = null;
-		if(mainSchedulers.size() == 1 && mainSchedulers.get(0).get_name().equals("grid")){
+		if(mainSchedulers.size() == 1 /*&& mainSchedulers.get(0).get_name().equals("grid")*/){
 			mainScheduler = mainSchedulers.get(0);
 		}
@@ -261,7 +251,5 @@
 			ManagedResources managedResources = new ManagedResources(mainCompResourceList, new HashMap<ResourceUnitName, List<ResourceUnit>>());
 			mainScheduler = ResourceFactory.createScheduler(StandardResourceType.GS, "grid", schedulingPlugin , execTimeEstimationPlugin,  queues, managedResources);
-			/*ManagementSystem ms = new GridBroker("grid",
-					globalSchedulingPluginName, execTimeEstimationPlugin);
-			mainScheduler = new Scheduler(ms, mainCompResourceList);*/
+
 			for(Scheduler lr: mainSchedulers){
 				mainScheduler.addChild(lr);
@@ -280,8 +268,8 @@
 		TaskQueueList queues = new TaskQueueList(1);
 		
-		if(schedulerDef.getQueue() != null && schedulerDef.getQueueCount() > 0){
-			int queueCount = schedulerDef.getQueueCount();
+		if(schedulerDef.getQueues()!= null){
+			int queueCount = schedulerDef.getQueues().getQueueCount();
 			for(int i = 0; i < queueCount; i++){
-				schemas.QueueType queueDef = schedulerDef.getQueue(i);
+				schemas.QueueType queueDef = schedulerDef.getQueues().getQueue(i);
 				TaskQueue queue = new TaskQueue(queueDef.getReservation());
 				queue.setName(queueDef.getName());
Index: /DCWoRMS/trunk/build/classes/simulator/ConfigurationOptions.java
===================================================================
--- /DCWoRMS/trunk/build/classes/simulator/ConfigurationOptions.java	(revision 477)
+++ /DCWoRMS/trunk/build/classes/simulator/ConfigurationOptions.java	(revision 539)
@@ -8,5 +8,4 @@
 import java.util.PropertyResourceBundle;
 import java.util.ResourceBundle;
-import java.util.logging.FileHandler;
 
 /**
@@ -26,10 +25,5 @@
 	 * =============================================================================================
 	 */
-	/** Grid scheduler's plugin path */
-	public static final String GRID_SCHEDULING_PLUGIN_NAME_MODIFIER = "gridschedulingpluginname";
-	/** Forecast finish time plugin path */
-	public static final String EXEC_TIME_ESTIMATION_PLUGIN_NAME_MODIFIER = "exectimeestimationpluginname";
-	/** Local allocation policy plugin path */
-	public static final String LOCAL_ALLOC_POLICY_PLUGIN_NAME_MODIFIER = "localallocpolicypluginname";
+
 	/** The path to the resource description file */
 	public static final String RESOURCE_DESC_MODIFIER = "resdesc";
@@ -58,5 +52,4 @@
 	public static final String READ_SCENARIO_INPUT_FOLDER = READ_SCENARIO_MODIFIER
 			+ ".inputfolder";
-	public static final String READ_SCENARIO_INPUT_TAR = READ_SCENARIO_MODIFIER+ ".tar";
 	
 	/** The name of the workload file */
@@ -64,33 +57,25 @@
 			+ ".workloadfilename";
 
-	/** Shall a detailed history be printed */
-	public static final String PRINT_HISTORY_MODIFIER = "printhistory";
-
 	/** The default name of a workload file */
 	public static final String DEFAULT_WORKLOAD_FILE_NAME = "workload.swf";
 
 	public static final String CREATE_XML_SUPPLEMENT_FILES = "createXMLSupplement";
-	
-	public static final String PROVIDER_LIST_FILE = "in/provider.list";
-	
-	/** Network topology file path */
-	public static final String NETWORK_TOPOLOGY_FILE_MODIFIER = "networktopologyfilename";
+
 	
 	public static final String CREATEDIAGRAMS = "creatediagrams";
-	public static final String CREATEDIAGRAMS_PROCESSORS = CREATEDIAGRAMS +".processors";
-	public static final String CREATEDIAGRAMS_RESERVATIONS = CREATEDIAGRAMS + ".reservations";
-	public static final String CREATEDIAGRAMS_RESOURCES = CREATEDIAGRAMS + ".resources";
-	public static final String CREATEDIAGRAMS_ENERGYUSAGE = CREATEDIAGRAMS + ".energyusage";
-	public static final String CREATEDIAGRAMS_RESOURCES_SCALE = CREATEDIAGRAMS_RESOURCES + ".scale";
+	public static final String CREATEDIAGRAMS_GANTT = CREATEDIAGRAMS +".gantt";
 	public static final String CREATEDIAGRAMS_TASKS = CREATEDIAGRAMS + ".tasks";
 	public static final String CREATEDIAGRAMS_TASKSWAITINGTIME = CREATEDIAGRAMS + ".taskswaitingtime";
+	public static final String CREATEDIAGRAMS_UTILIZATION = CREATEDIAGRAMS + ".resutilization";
+	public static final String CREATEDIAGRAMS_ENERGYUSAGE = CREATEDIAGRAMS + ".respowerusage";
+	public static final String CREATEDIAGRAMS_AIRFLOW = CREATEDIAGRAMS + ".resairflow";
+	public static final String CREATEDIAGRAMS_RESOURCES_SCALE = CREATEDIAGRAMS_UTILIZATION + ".scale";
+
 	
 	public static final String CREATESTATISTICS = "createstatistics";
 	public static final String ACCUMULATED_RESOURCES_STATISTICS = CREATESTATISTICS + ".accumulatedresources";
 	public static final String EXTENDED_TASKS_STATISTICS = CREATESTATISTICS + ".extendedtasks";
-	public static final String GRIDLET_HISTORY_STATISTICS = CREATESTATISTICS + ".gridlethistory";
 	public static final String JOBS_STATISTICS = CREATESTATISTICS + ".jobs";
 	public static final String SIMULATION_STATISTICS = CREATESTATISTICS + ".simulation";
-	public static final String FORMAT_STATISTICS_OUTPUT = CREATESTATISTICS + ".formatoutput";
 	
 	/**
@@ -116,29 +101,5 @@
 	/* =============================================================================================== */
 	
-	public String providerListFile = null;
-
-	/**
-	 * the full grid scheduling plugin name with package prefix, e.g.
-	 * simulator.plugin.gridscheduling.raPlugin.RAPlugin (the plugin is loaded
-	 * using {@link Class#forName(java.lang.String)} and
-	 * {@link Class#newInstance()} methods)
-	 */
-	public String gridSchedulingPluginName = null;
-
-	/**
-	 * the full forecast finish time plugin name with package prefix, e.g.
-	 * simulator.plugin.gridscheduling.raPlugin.RAPlugin (the plugin is loaded
-	 * using {@link Class#forName(java.lang.String)} and
-	 * {@link Class#newInstance()} methods)
-	 */
-	public String exectimeestimationplugin = null;
-
-	/**
-	 * the full local allocation policy plugin name with package prefix, e.g.
-	 * simulator.plugin.gridscheduling.raPlugin.RAPlugin (the plugin is loaded
-	 * using {@link Class#forName(java.lang.String)} and
-	 * {@link Class#newInstance()} methods)
-	 */
-	public String localAllocPolicyPluginName = null;
+
 
 	/**
@@ -180,8 +141,4 @@
 	public String inputWorkloadFileName = DEFAULT_WORKLOAD_FILE_NAME;
 
-	/**
-	 * a txt file name with topology description
-	 */
-	public String networkTopologyFileName = null;
 	
 	/**
@@ -199,9 +156,4 @@
 	public boolean overwriteFiles = false;
 
-	/**
-	 * true if the history files are to be generated (makes the simulation
-	 * slower)
-	 */
-	public boolean printHistory = false;
 	
 	/**
@@ -210,21 +162,20 @@
 	public int numberOfSimulations = 1; //default value
 
-	public boolean creatediagrams_processors = true;
-	public boolean creatediagrams_reservations = true;
-	public boolean creatediagrams_resources = true;
-	public boolean creatediagrams_energyusage = true;
-	public boolean creatediagrams_tasks = true;
-	public boolean creatediagrams_taskswaitingtime = true;
-	public double     creatediagrams_resources_scale = 1;
-	
-	public boolean createaccumulatedresourcesstatistics = true;
-	public boolean createextendedtasksstatistics = true;
-	public boolean creategridlethistorystatistics = true;
+	public boolean creatediagrams_gantt = false;
+	public boolean creatediagrams_tasks = false;
+	public boolean creatediagrams_taskswaitingtime = false;
+	
+	public boolean creatediagrams_resutilization = false;
+	public boolean creatediagrams_respowerusage = false;
+	public boolean creatediagrams_resairflow = false;
+	public double  creatediagrams_resources_scale = 1;
+
 	public boolean createjobsstatistics = true;
 	public boolean createsimulationstatistics = true;
-	public boolean formatstatisticsoutput = false;
-	
-	public static final String ENV_DESC_MODIFIER = "envdesc";
-	public String envDescFileName = null;
+	
+	public String [] resForEnergyChart;
+	public String [] resForAirFlowChart;
+	public String [] resForUtilizationChart;
+	
 	/**
 	 * An empty constructor.
@@ -257,34 +208,6 @@
 			return null;
 		}
-
-		try {
-			co.gridSchedulingPluginName = bundle
-					.getString(GRID_SCHEDULING_PLUGIN_NAME_MODIFIER);
-		} catch(MissingResourceException e){
-			co.gridSchedulingPluginName = null;
-		}
-
-		try {
-			co.exectimeestimationplugin = bundle
-					.getString(EXEC_TIME_ESTIMATION_PLUGIN_NAME_MODIFIER);
-		} catch(MissingResourceException e){
-			co.exectimeestimationplugin = null;
-		}
-
-		try {
-			co.localAllocPolicyPluginName = bundle
-					.getString(LOCAL_ALLOC_POLICY_PLUGIN_NAME_MODIFIER);
-		} catch(MissingResourceException e){
-			co.localAllocPolicyPluginName = null;
-		}
-
 		
 		co.resdescFileName = bundle.getString(RESOURCE_DESC_MODIFIER);
-		
-		try {
-			co.envDescFileName = bundle.getString(ENV_DESC_MODIFIER);
-		} catch(MissingResourceException e){
-			co.envDescFileName = null;
-		}
 		
 		try {
@@ -314,12 +237,4 @@
 		}
 
-
-		try {
-			co.networkTopologyFileName = bundle
-					.getString(NETWORK_TOPOLOGY_FILE_MODIFIER);
-		} catch(MissingResourceException e){
-			co.networkTopologyFileName = null;
-		}
-		
 		if (co.createScenario == false) {
 			// read scenario
@@ -329,11 +244,4 @@
 			} catch (MissingResourceException e) {
 				co.inputFolder = null;
-			}
-			
-			try {
-				co.inputTar = getSeparatorTerminatedPath(bundle
-					.getString(READ_SCENARIO_INPUT_TAR));
-			} catch (MissingResourceException e) {
-				co.inputTar = null;
 			}
 			
@@ -357,12 +265,5 @@
 			co.createXMLSupplement = false;
 		}
-		
-		try {
-			co.printHistory = Boolean.valueOf(
-					bundle.getString(PRINT_HISTORY_MODIFIER)).booleanValue();
-		} catch(MissingResourceException e){
-			co.printHistory = false;
-		}
-		
+
 		// create diagrams
 		
@@ -372,23 +273,20 @@
 					bundle.getString(CREATEDIAGRAMS)).booleanValue();
 		} catch(MissingResourceException e){
-			createDiagrams = true;
-		}
-		try {
-			co.creatediagrams_processors = Boolean.valueOf(
-					bundle.getString(CREATEDIAGRAMS_PROCESSORS)).booleanValue() && createDiagrams;
-		} catch(MissingResourceException e){
-			co.creatediagrams_processors = createDiagrams;
-		}
-		try {
-			co.creatediagrams_reservations = Boolean.valueOf(
-					bundle.getString(CREATEDIAGRAMS_RESERVATIONS)).booleanValue() && createDiagrams;
-		} catch(MissingResourceException e){
-			co.creatediagrams_reservations = createDiagrams;
-		}
-		try {
-			co.creatediagrams_resources = Boolean.valueOf(
-					bundle.getString(CREATEDIAGRAMS_RESOURCES)).booleanValue() && createDiagrams;
-		} catch(MissingResourceException e){
-			co.creatediagrams_resources = createDiagrams;
+			createDiagrams = false;
+		}
+		try {
+			co.creatediagrams_gantt = Boolean.valueOf(
+					bundle.getString(CREATEDIAGRAMS_GANTT)).booleanValue();
+		} catch(MissingResourceException e){
+			co.creatediagrams_gantt = createDiagrams;
+		}
+
+		try {
+			co.resForUtilizationChart = bundle.getString(CREATEDIAGRAMS_UTILIZATION).split(";");
+			if(co.resForUtilizationChart.length > 0){
+				co.creatediagrams_resutilization = true;
+			}
+		} catch(MissingResourceException e){
+			co.creatediagrams_resutilization = createDiagrams;
 		}
 		try {
@@ -399,12 +297,24 @@
 		}
 		try {
-			co.creatediagrams_energyusage = Boolean.valueOf(
-					bundle.getString(CREATEDIAGRAMS_ENERGYUSAGE)).booleanValue() && createDiagrams;
-		} catch(MissingResourceException e){
-			co.creatediagrams_energyusage = createDiagrams;
-		}
+			co.resForEnergyChart = bundle.getString(CREATEDIAGRAMS_ENERGYUSAGE).split(";");
+			if(co.resForEnergyChart.length > 0){
+				co.creatediagrams_respowerusage = true;
+			}
+		} catch(MissingResourceException e){
+			co.creatediagrams_respowerusage = createDiagrams;
+		}
+		
+		try {
+			co.resForAirFlowChart = bundle.getString(CREATEDIAGRAMS_AIRFLOW).split(";");
+			if(co.resForAirFlowChart.length > 0){
+				co.creatediagrams_resairflow = true;
+			}
+		} catch(MissingResourceException e){
+			co.creatediagrams_resairflow = createDiagrams;
+		}
+		
 		try {
 			co.creatediagrams_tasks = Boolean.valueOf(
-					bundle.getString(CREATEDIAGRAMS_TASKS)).booleanValue() && createDiagrams;
+					bundle.getString(CREATEDIAGRAMS_TASKS)).booleanValue();
 		} catch(MissingResourceException e){
 			co.creatediagrams_tasks = createDiagrams;
@@ -412,9 +322,8 @@
 		try {
 			co.creatediagrams_taskswaitingtime = Boolean.valueOf(
-					bundle.getString(CREATEDIAGRAMS_TASKSWAITINGTIME)).booleanValue() && createDiagrams;
+					bundle.getString(CREATEDIAGRAMS_TASKSWAITINGTIME)).booleanValue();
 		} catch(MissingResourceException e){
 			co.creatediagrams_taskswaitingtime = createDiagrams;
 		}
-		
 		
 		try {
@@ -427,22 +336,4 @@
 
 		try {
-			co.createaccumulatedresourcesstatistics = Boolean.valueOf(
-					bundle.getString(ACCUMULATED_RESOURCES_STATISTICS)).booleanValue();
-		} catch(MissingResourceException e){
-			co.createaccumulatedresourcesstatistics = true;
-		}
-		try {
-			co.createextendedtasksstatistics = Boolean.valueOf(
-					bundle.getString(EXTENDED_TASKS_STATISTICS)).booleanValue();
-		} catch(MissingResourceException e){
-			co.createextendedtasksstatistics = true;
-		}
-		try {
-			co.creategridlethistorystatistics = Boolean.valueOf(
-					bundle.getString(GRIDLET_HISTORY_STATISTICS)).booleanValue();
-		} catch(MissingResourceException e){
-			co.creategridlethistorystatistics = true;
-		}
-		try {
 			co.createjobsstatistics = Boolean.valueOf(
 					bundle.getString(JOBS_STATISTICS)).booleanValue();
@@ -456,11 +347,5 @@
 			co.createsimulationstatistics = true;
 		}
-		try {
-			co.formatstatisticsoutput = Boolean.valueOf(
-					bundle.getString(FORMAT_STATISTICS_OUTPUT)).booleanValue();
-		} catch(MissingResourceException e){
-			co.formatstatisticsoutput = false;
-		}
-		
+
 		try {
 			co.numberOfSimulations = Integer.valueOf(bundle.getString(NUMBER_OF_SIMULATIONS)).intValue();
@@ -469,69 +354,4 @@
 		}
 		return co;
-	}
-
-	/**
-	 * Creates a new configuration object in the CREATE_SCENARIO mode.
-	 * 
-	 * @param gridSchedulingPluginName
-	 * @param forecastFinishTimePluginName
-	 * @param localAllocPolicyPluginName
-	 * @param resdescFileName
-	 * @param taskParamFileName
-	 * @param outputFolder
-	 * @param outputWorkloadFileName
-	 * @param overwriteFiles
-	 * @param printHistory
-	 */
-	public ConfigurationOptions(String gridSchedulingPluginName,
-			String exectimeestimationplugin,
-			String localAllocPolicyPluginName, String resdescFileName,
-			String taskParamFileName, String outputFolder,
-			String outputWorkloadFileName, boolean overwriteFiles,
-			boolean printHistory) {
-		super();
-		this.gridSchedulingPluginName = gridSchedulingPluginName;
-		this.exectimeestimationplugin = exectimeestimationplugin;
-		this.localAllocPolicyPluginName = localAllocPolicyPluginName;
-		this.resdescFileName = resdescFileName;
-		this.workloadDescFileName = taskParamFileName;
-		this.outputFolder = getSeparatorTerminatedPath(outputFolder);
-		this.outputWorkloadFileName = outputWorkloadFileName;
-		this.overwriteFiles = overwriteFiles;
-		this.printHistory = printHistory;
-
-		// the create mode
-		this.createScenario = true;
-	}
-
-	/**
-	 * Creates a new configuration object in the READ_SCENARIO mode.
-	 * 
-	 * @param gridSchedulingPluginName
-	 * @param forecastFinishTimePluginName
-	 * @param localAllocPolicyPluginName
-	 * @param resdescFileName
-	 * @param inputFolder
-	 * @param inputWorkloadFileName
-	 * @param overwriteFiles
-	 * @param printHistory
-	 */
-	public ConfigurationOptions(String gridSchedulingPluginName,
-			String exectimeestimationplugin,
-			String localAllocPolicyPluginName, String resdescFileName,
-			String inputFolder, String inputWorkloadFileName,
-			boolean overwriteFiles, boolean printHistory) {
-		super();
-		this.gridSchedulingPluginName = gridSchedulingPluginName;
-		this.exectimeestimationplugin = exectimeestimationplugin;
-		this.localAllocPolicyPluginName = localAllocPolicyPluginName;
-		this.resdescFileName = resdescFileName;
-		this.inputFolder = getSeparatorTerminatedPath(inputFolder);
-		this.inputWorkloadFileName = inputWorkloadFileName;
-		this.overwriteFiles = overwriteFiles;
-		this.printHistory = printHistory;
-		//FileHandler.loadDataset(new File("iris.data"), 4, ",");
-		// the read mode
-		this.createScenario = false;
 	}
 
Index: /DCWoRMS/trunk/build/classes/test/ariel/workload.swf
===================================================================
--- /DCWoRMS/trunk/build/classes/test/ariel/workload.swf	(revision 539)
+++ /DCWoRMS/trunk/build/classes/test/ariel/workload.swf	(revision 539)
@@ -0,0 +1,19 @@
+;Automatically generated workload description by the Grid Scheduling Simulator
+;		j|		s|		w|		r|		c|		c|		m|		p|		t|		m|		s|		u|		g|		e|		q|		p|		p|		t|
+;		o|		u|		a|		u|		p|		p|		e|		r|		i|		e|		t|		i|		i|		x|		u|		a|		r|		h|
+;		b|		b|		i|		n|		u|		u|		m|		o|		m|		m|		a|		d|		d|		e|		e|		r|		e|		i|
+;		 |		m|		t|		t|		 |		 |		 |		c|		e|		 |		t|		 |		 |		c|		u|		t|		c|		n|
+;		 |		i|		 |		i|		a|		t|		u|		 |		 |		r|		u|		 |		 |		u|		e|		i|		 |		k|
+;		 |		t|		 |		m|		l|		i|		s|		r|		r|		e|		s|		 |		 |		t|		 |		t|		j|		 |
+;		 |		 |		 |		e|		l|		m|		e|		e|		e|		q|		 |		 |		 |		a|		n|		i|		o|		t|
+;		 |		 |		 |		 |		o|		e|		d|		q|		q|		 |		 |		 |		 |		b|		r|		o|		b|		i|
+;		 |		 |		 |		 |		c|		 |		 |		 |		 |		 |		 |		 |		 |		l|		 |		n|		 |		m|
+;		 |		 |		 |		 |		 |		 |		 |		 |		 |		 |		 |		 |		 |		e|		 |		 |		 |		e|
+;StartTime: Mon Nov 03 00:00:00 CET 2008
+;PUSpeed: 1
+
+
+		1			0			-1		14400	1		-1		-1		1		-1		-1		-1		-1		-1		1		1		1		-1		-1
+		2			1800		-1		14400	1		-1		-1		1		-1		-1		-1		-1		-1		1		1		1		-1		-1
+		3			3600		-1		14400	1		-1		-1		1		-1		-1		-1		-1		-1		1		1		1		-1		-1
+		4			5400		-1		14400	1		-1		-1		1		-1		-1		-1		-1		-1		1		1		1		-1		-1
Index: /DCWoRMS/trunk/build/classes/test/ariel/RunExperiment.java
===================================================================
--- /DCWoRMS/trunk/build/classes/test/ariel/RunExperiment.java	(revision 539)
+++ /DCWoRMS/trunk/build/classes/test/ariel/RunExperiment.java	(revision 539)
@@ -0,0 +1,19 @@
+package test.ariel;
+import simulator.DataCenterWorkloadSimulator;
+
+
+public class RunExperiment {
+	
+	public static void main(String args[]){
+		RunExperiment runner = new RunExperiment();
+		runner.run();
+	}
+	
+	public void run(){
+		String args[] = {
+				"src/test/ariel/experiment1.properties"
+				};
+		DataCenterWorkloadSimulator.main(args);
+	}
+
+}
Index: /DCWoRMS/trunk/build/classes/test/ariel/CPUFreqScalingExecTimeEstimationPlugin.java
===================================================================
--- /DCWoRMS/trunk/build/classes/test/ariel/CPUFreqScalingExecTimeEstimationPlugin.java	(revision 539)
+++ /DCWoRMS/trunk/build/classes/test/ariel/CPUFreqScalingExecTimeEstimationPlugin.java	(revision 539)
@@ -0,0 +1,46 @@
+package test.ariel;
+
+import java.util.Map;
+
+import schedframe.events.scheduling.SchedulingEvent;
+import schedframe.resources.computing.Processor;
+import schedframe.resources.units.PEUnit;
+import schedframe.resources.units.ProcessingElements;
+import schedframe.resources.units.ResourceUnit;
+import schedframe.resources.units.ResourceUnitName;
+import schedframe.resources.units.StandardResourceUnitName;
+import dcworms.schedframe.scheduling.ExecTask;
+import example.timeestimation.BaseTimeEstimationPlugin;
+
+public class CPUFreqScalingExecTimeEstimationPlugin extends BaseTimeEstimationPlugin{
+
+	public double execTimeEstimation(SchedulingEvent event, ExecTask task,
+			Map<ResourceUnitName, ResourceUnit> allocatedResources,
+			double completionPercentage) {
+
+		PEUnit peUnit = (PEUnit) allocatedResources.get(StandardResourceUnitName.PE);
+
+		double speed;
+		if(peUnit instanceof ProcessingElements){
+			ProcessingElements pe = (ProcessingElements)peUnit;
+			Processor cpu = (Processor)pe.get(0);
+			speed = cpu.getPowerInterface().getPState().getFrequency()/1000;
+		}
+		else 
+			speed = peUnit.getSpeed();
+		
+		int cnt = peUnit.getUsedAmount();
+
+		double remainingLength =  task.getLength() * (1 - completionPercentage/100);
+
+		double execTime = (remainingLength / (cnt * speed));
+
+		if (Double.compare(execTime, 0.001) < 0) {
+			execTime = 0.001;
+		}
+
+		execTime = Math.ceil(execTime);
+		return execTime;
+	}
+
+}
Index: /DCWoRMS/trunk/build/classes/test/ariel/FCFSCPUFreqScalingPlugin.java
===================================================================
--- /DCWoRMS/trunk/build/classes/test/ariel/FCFSCPUFreqScalingPlugin.java	(revision 539)
+++ /DCWoRMS/trunk/build/classes/test/ariel/FCFSCPUFreqScalingPlugin.java	(revision 539)
@@ -0,0 +1,109 @@
+package test.ariel;
+
+import gridsim.dcworms.DCWormsTags;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import schedframe.events.scheduling.SchedulingEvent;
+import schedframe.events.scheduling.TaskFinishedEvent;
+import schedframe.events.scheduling.TaskRequestedTimeExpiredEvent;
+import schedframe.resources.ResourceStatus;
+import schedframe.resources.computing.ComputingNode;
+import schedframe.resources.computing.ComputingResource;
+import schedframe.resources.computing.Processor;
+import schedframe.resources.units.Memory;
+import schedframe.resources.units.ProcessingElements;
+import schedframe.resources.units.ResourceUnit;
+import schedframe.resources.units.ResourceUnitName;
+import schedframe.resources.units.StandardResourceUnitName;
+import schedframe.scheduling.UsedResourcesList;
+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;
+import dcworms.schedframe.scheduling.Executable;
+import example.localplugin.BaseLocalSchedulingPlugin;
+
+public class FCFSCPUFreqScalingPlugin extends BaseLocalSchedulingPlugin {
+
+	int cnt;
+
+	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 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) {
+
+					Map<ResourceUnitName, ResourceUnit> choosenResources = chooseResourcesForExecution(resourceManager, task);
+					if (choosenResources != null) {
+						addToSchedulingPlan(plan, task, choosenResources);
+					}
+					
+					for(Processor cpu: resourceManager.getProcessors()){
+						cpu.getPowerInterface().setPState("P"+cnt);
+					}
+				}
+			}
+			break;
+		}
+		cnt++;
+		return plan;
+	}
+
+	private Map<ResourceUnitName, ResourceUnit> chooseResourcesForExecution(
+			ClusterResourceManager resourceManager, TaskInterface<?> task) {
+
+		Map<ResourceUnitName, ResourceUnit> map = new HashMap<ResourceUnitName, ResourceUnit>();
+		List<Processor> processors = resourceManager.getProcessors();
+		int cpuRequest;
+		try {
+			cpuRequest = Double.valueOf(task.getCpuCntRequest()).intValue();
+		} catch (NoSuchFieldException e) {
+			cpuRequest = 1;
+		}
+
+		if (cpuRequest != 0) {
+
+			List<Processor> choosenProcessor = new ArrayList<Processor>();				
+			for (int i = 0; i < processors.size() && cpuRequest > 0; i++) {
+				if (processors.get(i).getStatus() == ResourceStatus.FREE) {
+					choosenProcessor.add(processors.get(i));
+					cpuRequest--;
+				}
+			}
+
+			ProcessingElements result = new ProcessingElements();
+			result.addAll(choosenProcessor);
+			map.put(StandardResourceUnitName.PE, result);
+		}
+	
+		return map;
+	}
+
+
+}
Index: /DCWoRMS/trunk/build/classes/test/ariel/resources.xml
===================================================================
--- /DCWoRMS/trunk/build/classes/test/ariel/resources.xml	(revision 539)
+++ /DCWoRMS/trunk/build/classes/test/ariel/resources.xml	(revision 539)
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<environment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+	xsi:noNamespaceSchemaLocation="../../../simulator/schemas/resources/WormsResSchema.xsd">
+	
+	<timeEstimationPlugin>
+		<name>test.ariel.CPUFreqScalingExecTimeEstimationPlugin</name>
+	</timeEstimationPlugin>
+	<!-- Simple data center description -->
+	<resources>
+		<computingResource class="DataCenter" name="compRes">
+			<computingResource class="Processor" count="4">
+				<profile>
+					<powerProfile>
+						<energyEstimationPlugin>
+							<name>example.energy.CPUEnergyEstimationPlugin</name>
+						</energyEstimationPlugin>		
+						<parameter name="pState">
+							<property name="name">
+								<value>P0</value>
+							</property>	
+							<property name="frequency">
+								<value unit="Hz">2000</value>
+							</property>		
+							<property name="powerUsage">
+								<value unit="W">350</value>
+							</property>						
+						</parameter>
+						<parameter name="pState">
+							<property name="name">
+								<value>P1</value>
+							</property>	
+							<property name="frequency">
+								<value unit="H`">1500</value>
+							</property>		
+							<property name="powerUsage">
+								<value unit="W">343</value>
+							</property>						
+						</parameter>	
+						<parameter name="pState">
+							<property name="name">
+								<value>P2</value>
+							</property>	
+							<property name="frequency">
+								<value unit="H`">1000</value>
+							</property>		
+							<property name="powerUsage">
+								<value unit="W">337</value>
+							</property>						
+						</parameter>
+						<parameter name="pState">
+							<property name="name">
+								<value>P3</value>
+							</property>	
+							<property name="frequency">
+								<value unit="H`">500</value>
+							</property>		
+							<property name="powerUsage">
+								<value unit="W">330</value>
+							</property>						
+						</parameter>								
+					</powerProfile>
+				</profile>
+			</computingResource>
+		</computingResource>
+		<scheduler class="Cluster" name="cluster">
+			<schedulingPlugin>
+				<name>test.ariel.FCFSCPUFreqScalingPlugin</name>
+			</schedulingPlugin>	
+			<managedComputingResources include="false">
+				<resourceName>compRes</resourceName>
+			</managedComputingResources>
+		</scheduler>	
+	</resources>
+
+</environment>
Index: /DCWoRMS/trunk/build/classes/test/ariel/experiment1.properties
===================================================================
--- /DCWoRMS/trunk/build/classes/test/ariel/experiment1.properties	(revision 539)
+++ /DCWoRMS/trunk/build/classes/test/ariel/experiment1.properties	(revision 539)
@@ -0,0 +1,17 @@
+# Use single *.swf file as workload description.
+
+# Path to xml file which describes resource characteristics.
+resdesc=src/test/ariel/resources.xml
+
+# and swf file, which name is declared by readscenario.workloadfilename parameter.
+# Swf file must be placed in readscenario.inputfolder directory.  
+readscenario.workloadfilename=src/test/ariel/workload.swf
+
+# Choose directory where all result files should be placed.
+stats.outputfolder=../experiment_result
+
+
+creatediagrams.gantt=true
+
+creatediagrams.respowerusage=Processor
+
Index: /DCWoRMS/trunk/build/classes/schedframe/resources/units/ResourceUnit.java
===================================================================
--- /DCWoRMS/trunk/build/classes/schedframe/resources/units/ResourceUnit.java	(revision 477)
+++ /DCWoRMS/trunk/build/classes/schedframe/resources/units/ResourceUnit.java	(revision 539)
@@ -23,4 +23,6 @@
 	public void init(Parameters parameters);
 	
+	public Parameters getParameters();
+	
 	public ResourceUnitProvisioner getProvisioner();
 }
Index: /DCWoRMS/trunk/build/classes/schedframe/resources/units/AbstractResourceUnit.java
===================================================================
--- /DCWoRMS/trunk/build/classes/schedframe/resources/units/AbstractResourceUnit.java	(revision 477)
+++ /DCWoRMS/trunk/build/classes/schedframe/resources/units/AbstractResourceUnit.java	(revision 539)
@@ -78,5 +78,8 @@
 	public ResourceUnitProvisioner getProvisioner() {
         return provisioner;
-
+	}
+	
+	public Parameters getParameters(){
+		return null;
 	}
 
Index: /DCWoRMS/trunk/build/classes/schedframe/resources/computing/DataCenter.java
===================================================================
--- /DCWoRMS/trunk/build/classes/schedframe/resources/computing/DataCenter.java	(revision 477)
+++ /DCWoRMS/trunk/build/classes/schedframe/resources/computing/DataCenter.java	(revision 539)
@@ -3,5 +3,5 @@
 import schedframe.resources.computing.description.ComputingResourceDescription;
 import schedframe.resources.computing.profiles.energy.EnergyExtension;
-import schedframe.resources.computing.profiles.energy.power.PowerProfileFactory;
+import schedframe.resources.computing.profiles.energy.power.PowerInterfaceFactory;
 import schedframe.resources.computing.profiles.energy.power.ui.PowerInterface;
 
@@ -11,5 +11,5 @@
 		super(resDesc);
 		//extensionList.add(new EnergyExtension(this, resDesc.getPowerInterface(), resDesc.getEnergyEstimationPlugin()));
-		PowerInterface pi = PowerProfileFactory.createPowerInterface(this, resDesc.getPowerProfile());
+		PowerInterface pi = PowerInterfaceFactory.createPowerInterface(this, resDesc.getPowerProfile());
 		accept(new EnergyExtension(pi, resDesc.getPowerProfile()));
 	}
Index: /DCWoRMS/trunk/build/classes/schedframe/resources/computing/ComputingNode.java
===================================================================
--- /DCWoRMS/trunk/build/classes/schedframe/resources/computing/ComputingNode.java	(revision 477)
+++ /DCWoRMS/trunk/build/classes/schedframe/resources/computing/ComputingNode.java	(revision 539)
@@ -10,5 +10,5 @@
 import schedframe.resources.computing.extensions.ExtensionType;
 import schedframe.resources.computing.profiles.energy.EnergyExtension;
-import schedframe.resources.computing.profiles.energy.power.PowerProfileFactory;
+import schedframe.resources.computing.profiles.energy.power.PowerInterfaceFactory;
 import schedframe.resources.computing.profiles.energy.power.ui.ComputingNodePowerInterface;
 import schedframe.resources.computing.profiles.energy.power.ui.PowerInterface;
@@ -26,5 +26,5 @@
 		
 		//extensionList.add(new EnergyExtension(this, resDesc.getPowerInterface(), resDesc.getEnergyEstimationPlugin()));
-		PowerInterface pi = PowerProfileFactory.createPowerInterface(this, resDesc.getPowerProfile());
+		PowerInterface pi = PowerInterfaceFactory.createPowerInterface(this, resDesc.getPowerProfile());
 		accept(new EnergyExtension(pi, resDesc.getPowerProfile()));	
 	}
@@ -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;
 	}
 
Index: /DCWoRMS/trunk/build/classes/schedframe/resources/computing/ComputingResource.java
===================================================================
--- /DCWoRMS/trunk/build/classes/schedframe/resources/computing/ComputingResource.java	(revision 477)
+++ /DCWoRMS/trunk/build/classes/schedframe/resources/computing/ComputingResource.java	(revision 539)
@@ -2,5 +2,5 @@
 
 import gridsim.GridSimTags;
-import gridsim.gssim.WormsTags;
+import gridsim.dcworms.DCWormsTags;
 
 import java.util.ArrayList;
@@ -28,4 +28,5 @@
 import schedframe.resources.computing.profiles.energy.EnergyEventType;
 import schedframe.resources.computing.profiles.energy.EnergyExtension;
+import schedframe.resources.computing.profiles.energy.airthroughput.ui.AirThroughputInterface;
 import schedframe.resources.computing.profiles.energy.power.ui.PowerInterface;
 import schedframe.resources.computing.properties.DefaultPropertiesBuilder;
@@ -68,5 +69,5 @@
 	}
 
-	//TODO remove if possible (check if all scenarios can be realized - statistics issue) , since it's temporary method
+	//TODO remove if possible (check if all scenarios can be realized - statistics issue), since it's a temporary method
 	private void addFakeProcessors() {
 		if(getResourceCharacteristic().getResourceUnits().get(StandardResourceUnitName.PE) != null){
@@ -145,5 +146,4 @@
 		sec.execute(event);
 
-		
 		//old, correctly working method
 		/*if (extensionList != null) {
@@ -157,5 +157,5 @@
 		//if(scheduler != null && (parent != null && scheduler != parent.getScheduler())/*scheduler.getResources().contains(this)*/){
 		//	String src = event.getSource() != null ? event.getSource() : name;
-		//	scheduler.sendInternal(GridSimTags.SCHEDULE_NOW, GssimTags.UPDATE, src);
+		//	scheduler.sendInternal(GridSimTags.SCHEDULE_NOW, DCWormsTags.UPDATE, src);
 		//}
 		//triggerEventUp(event);
@@ -188,5 +188,5 @@
 	}
 	
-	protected List<? extends ComputingResource> searchDescendants(List<ResourceValidator> validators, boolean cutoff) {
+	protected List<? extends ComputingResource> searchDescendants(List<ResourceValidator> validators, boolean cutOff) {
 
 		List<ComputingResource> descendants = new ArrayList<ComputingResource>();
@@ -198,6 +198,4 @@
 				ComputingResource resource = toExamine.pop();
 				List<ComputingResource> resources = resource.getChildren();
-				/*if (resources == null)
-					continue;*/
 				int numberOfRes = resources.size();
 				for (int i = 0; i < numberOfRes; i++) {
@@ -205,5 +203,5 @@
 					if (resourceChild.match(validators)) {
 						descendants.add(resourceChild);
-						if(cutoff == false) {
+						if(cutOff == false) {
 							toExamine.addLast(resourceChild);
 						}
@@ -243,4 +241,16 @@
 		return null;
 	}
+	
+	public AirThroughputInterface getAirThroughputInterface(){
+		if (extensionList != null) {
+			for (Extension extension : extensionList) {
+				if (extension.getType() == ExtensionType.ENERGY_EXTENSION) {
+					EnergyExtension ee = (EnergyExtension)extension;
+					return ee.getAirThroughputInterface();
+				}
+			}
+		}
+		return null;
+	}
 
 	public Scheduler getScheduler() {
@@ -257,5 +267,5 @@
 	}
 
-	class SimpleEventHandler implements EventHandler{
+	class ComputingResourceEventHandler implements EventHandler{
 		
 		public void handleResourceEvent(Event event){
@@ -275,5 +285,5 @@
 			if(scheduler != null && (parent != null && scheduler != parent.getScheduler())/*scheduler.getResources().contains(this)*/){
 				String src = event.getSource() != null ? event.getSource() : name;
-				scheduler.sendInternal(GridSimTags.SCHEDULE_NOW, WormsTags.UPDATE, src);
+				scheduler.sendInternal(GridSimTags.SCHEDULE_NOW, DCWormsTags.UPDATE, src);
 			} else if(parent != null)
 				parent.getEventHandler().handleSchedulingEvent(event);
@@ -282,13 +292,21 @@
 	
 	public EventHandler getEventHandler(){
-		return new SimpleEventHandler();
+		return new ComputingResourceEventHandler();
 	}
 	
 	public void initiate(){
+		
 		ResourceEventCommand rec = new ResourceEventCommand(this);
-		EnergyEvent event = new EnergyEvent(EnergyEventType.POWER_STATE_CHANGED, "Resource controller");
+		EnergyEvent event = new EnergyEvent(EnergyEventType.AIRFLOW_STATE_CHANGED, "Resource controller");
 		event.setReason(EventReason.SIM_INIT);
 		rec.execute(event);
+		
+		rec = new ResourceEventCommand(this);
+		event = new EnergyEvent(EnergyEventType.POWER_STATE_CHANGED, "Resource controller");
+		event.setReason(EventReason.SIM_INIT);
+		rec.execute(event);
+		
 		//alternative way
+		//getEventHandler().handleResourceEvent(new EnergyEvent(EnergyEventType.AIRFLOW_STATE_CHANGED, "Resource controller"));
 		//getEventHandler().handleResourceEvent(new EnergyEvent(EnergyEventType.POWER_STATE_CHANGED, "Resource controller"));
 	}
Index: /DCWoRMS/trunk/build/classes/schedframe/resources/computing/Processor.java
===================================================================
--- /DCWoRMS/trunk/build/classes/schedframe/resources/computing/Processor.java	(revision 477)
+++ /DCWoRMS/trunk/build/classes/schedframe/resources/computing/Processor.java	(revision 539)
@@ -8,5 +8,5 @@
 import schedframe.resources.computing.extensions.ExtensionType;
 import schedframe.resources.computing.profiles.energy.EnergyExtension;
-import schedframe.resources.computing.profiles.energy.power.PowerProfileFactory;
+import schedframe.resources.computing.profiles.energy.power.PowerInterfaceFactory;
 import schedframe.resources.computing.profiles.energy.power.ui.PowerInterface;
 import schedframe.resources.computing.profiles.energy.power.ui.ProcessorPowerInterface;
@@ -22,5 +22,5 @@
 		super(resDesc);
 		//extensionList.add(new EnergyExtension(this, resDesc.getPowerInterface(), resDesc.getEnergyEstimationPlugin()));
-		PowerInterface pi = PowerProfileFactory.createPowerInterface(this, resDesc.getPowerProfile());
+		PowerInterface pi = PowerInterfaceFactory.createPowerInterface(this, resDesc.getPowerProfile());
 		accept(new EnergyExtension(pi, resDesc.getPowerProfile()));	
 	}
Index: /DCWoRMS/trunk/build/classes/schedframe/resources/computing/ResourceFactory.java
===================================================================
--- /DCWoRMS/trunk/build/classes/schedframe/resources/computing/ResourceFactory.java	(revision 477)
+++ /DCWoRMS/trunk/build/classes/schedframe/resources/computing/ResourceFactory.java	(revision 539)
@@ -11,5 +11,5 @@
 import schedframe.scheduling.policy.local.LocalManagementSystem;
 import schedframe.scheduling.queue.TaskQueueList;
-import simulator.WormsConstants;
+import simulator.DCWormsConstants;
 
 
@@ -20,4 +20,6 @@
 		if (resDesc.getType().equals(StandardResourceType.DataCenter))
 			return new DataCenter(resDesc);
+		else if (resDesc.getType().equals(StandardResourceType.Rack))
+			return  new Rack(resDesc);
 		else if (resDesc.getType().equals(StandardResourceType.ComputingNode))
 			return  new ComputingNode(resDesc);
@@ -46,5 +48,5 @@
 			}
 			case LS: {
-				ms = new LocalManagementSystem(id, WormsConstants.MANAGEMENT_SYSTEM,
+				ms = new LocalManagementSystem(id, DCWormsConstants.MANAGEMENT_SYSTEM,
 						schedulingPlugin, execTimeEstimationPlugin, queues);
 				return new Scheduler(ms, type, managedResources);
@@ -52,5 +54,5 @@
 
 		default:{
-				ms = new LocalManagementSystem(id, WormsConstants.MANAGEMENT_SYSTEM,
+				ms = new LocalManagementSystem(id, DCWormsConstants.MANAGEMENT_SYSTEM,
 						schedulingPlugin, execTimeEstimationPlugin, queues);
 				return new Scheduler(ms, type, managedResources);
Index: /DCWoRMS/trunk/build/classes/schedframe/resources/computing/Rack.java
===================================================================
--- /DCWoRMS/trunk/build/classes/schedframe/resources/computing/Rack.java	(revision 477)
+++ /DCWoRMS/trunk/build/classes/schedframe/resources/computing/Rack.java	(revision 539)
@@ -6,5 +6,5 @@
 import schedframe.resources.computing.description.ComputingResourceDescription;
 import schedframe.resources.computing.profiles.energy.EnergyExtension;
-import schedframe.resources.computing.profiles.energy.power.PowerProfileFactory;
+import schedframe.resources.computing.profiles.energy.power.PowerInterfaceFactory;
 import schedframe.resources.computing.profiles.energy.power.ui.PowerInterface;
 
@@ -14,5 +14,5 @@
 	public Rack (ComputingResourceDescription resDesc) {
 		super(resDesc);
-		PowerInterface pi = PowerProfileFactory.createPowerInterface(this, resDesc.getPowerProfile());
+		PowerInterface pi = PowerInterfaceFactory.createPowerInterface(this, resDesc.getPowerProfile());
 		accept(new EnergyExtension(pi, resDesc.getPowerProfile()));	
 	}
Index: /DCWoRMS/trunk/build/classes/schedframe/resources/computing/Core.java
===================================================================
--- /DCWoRMS/trunk/build/classes/schedframe/resources/computing/Core.java	(revision 477)
+++ /DCWoRMS/trunk/build/classes/schedframe/resources/computing/Core.java	(revision 539)
@@ -3,5 +3,5 @@
 import schedframe.resources.computing.description.ComputingResourceDescription;
 import schedframe.resources.computing.profiles.energy.EnergyExtension;
-import schedframe.resources.computing.profiles.energy.power.PowerProfileFactory;
+import schedframe.resources.computing.profiles.energy.power.PowerInterfaceFactory;
 import schedframe.resources.computing.profiles.energy.power.ui.PowerInterface;
 import schedframe.resources.units.CpuSpeed;
@@ -13,5 +13,5 @@
 	public Core (ComputingResourceDescription resDesc) {
 		super(resDesc);
-		PowerInterface pi = PowerProfileFactory.createPowerInterface(this, resDesc.getPowerProfile());
+		PowerInterface pi = PowerInterfaceFactory.createPowerInterface(this, resDesc.getPowerProfile());
 		accept(new EnergyExtension(pi, resDesc.getPowerProfile()));	
 	}
Index: /DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/power/PowerProfile.java
===================================================================
--- /DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/power/PowerProfile.java	(revision 477)
+++ /DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/power/PowerProfile.java	(revision 539)
@@ -19,14 +19,16 @@
 	protected Map<String, PState> supportedPStates;
 	
+	protected Parameters parameters;
+	
 
-	public PowerProfile(EnergyEstimationPlugin energyEstimationPlugin, List<schedframe.resources.computing.profiles.energy.power.PowerState> supportedPowerStates) {
+	public PowerProfile(EnergyEstimationPlugin energyEstimationPlugin, List<PowerState> powerStates) {
 		this.energyEstimationPlugin = energyEstimationPlugin;
 		this.powerUsage = new ArrayList<PowerUsage>();
-		this.supportedPowerStates = supportedPowerStates;
+		this.supportedPowerStates = powerStates;
 	}
 	
-	public PowerProfile(EnergyEstimationPlugin energyEstimationPlugin, List<schedframe.resources.computing.profiles.energy.power.PowerState> supportedPowerStates,  List<schedframe.resources.computing.profiles.energy.power.PState> pStates) {
+	public PowerProfile(EnergyEstimationPlugin energyEstimationPlugin, List<PowerState> powerStates,  List<PState> pStates) {
 		this.energyEstimationPlugin = energyEstimationPlugin;
-		this.supportedPowerStates = supportedPowerStates;
+		this.supportedPowerStates = powerStates;
 		this.powerUsage = new ArrayList<PowerUsage>();
 		if(pStates.size() > 0)
@@ -98,7 +100,12 @@
 	}
 
-	public void init(Parameters parameters){
-		
+	public void init(Parameters params){
+		this.parameters = params;
+	}
+	
+	public Parameters getParameters() {
+		return parameters;
 	}
 
+
 }
Index: /DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/power/plugin/EnergyEstimationPlugin.java
===================================================================
--- /DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/power/plugin/EnergyEstimationPlugin.java	(revision 477)
+++ /DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/power/plugin/EnergyEstimationPlugin.java	(revision 539)
@@ -10,5 +10,5 @@
 	public double estimatePowerConsumption(EnergyEvent event, JobRegistry jobRegistry, ComputingResource resource);
 
-	public double estimateEnergyDissipation(EnergyEvent event, JobRegistry jobRegistry, ComputingResource resource);
+	public double estimateAirThroughput(EnergyEvent event, JobRegistry jobRegistry, ComputingResource resource);
 
 	public double estimateTemperature(EnergyEvent event, JobRegistry jobRegistry, ComputingResource resource);
Index: /DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/power/PowerUsage.java
===================================================================
--- /DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/power/PowerUsage.java	(revision 477)
+++ /DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/power/PowerUsage.java	(revision 539)
@@ -1,24 +1,10 @@
 package schedframe.resources.computing.profiles.energy.power;
 
-public class PowerUsage {
+import schedframe.resources.computing.profiles.energy.MeasurementHistory;
 
-	protected long timestamp;
-	protected double value;
+public class PowerUsage extends MeasurementHistory{
 
 	public PowerUsage(long timestamp, double value){
-		this.timestamp = timestamp;
-		this.value = value;
-	}
-	
-	public long getTimestamp() {
-		return timestamp;
-	}
-
-	public double getValue() {
-		return value;
-	}
-	
-	public void setValue(double value) {
-		this.value = value;
+		super(timestamp, value);
 	}
 	
Index: /DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/power/ui/ComputingNodePowerInterface.java
===================================================================
--- /DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/power/ui/ComputingNodePowerInterface.java	(revision 477)
+++ /DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/power/ui/ComputingNodePowerInterface.java	(revision 539)
@@ -10,5 +10,5 @@
 import schedframe.resources.computing.profiles.energy.power.StandardPowerStateName;
 
-public class ComputingNodePowerInterface extends AbstractPowerInterface{
+public class ComputingNodePowerInterface extends ComputingResourcePowerInterface{
 
 	public static long START_TIME = 600000;
@@ -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/build/classes/schedframe/resources/computing/profiles/energy/power/ui/ComputingResourcePowerInterface.java
===================================================================
--- /DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/power/ui/ComputingResourcePowerInterface.java	(revision 539)
+++ /DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/power/ui/ComputingResourcePowerInterface.java	(revision 539)
@@ -0,0 +1,123 @@
+package schedframe.resources.computing.profiles.energy.power.ui;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.joda.time.DateTimeUtils;
+
+import schedframe.Parameters;
+import schedframe.resources.ResourceStatus;
+import schedframe.resources.computing.ComputingResource;
+import schedframe.resources.computing.profiles.energy.EnergyEvent;
+import schedframe.resources.computing.profiles.energy.EnergyEventType;
+import schedframe.resources.computing.profiles.energy.power.PowerProfile;
+import schedframe.resources.computing.profiles.energy.power.PowerState;
+import schedframe.resources.computing.profiles.energy.power.PowerStateName;
+import schedframe.resources.computing.profiles.energy.power.PowerUsage;
+import schedframe.resources.computing.profiles.energy.power.StandardPowerStateName;
+
+public class ComputingResourcePowerInterface implements PowerInterface{
+
+	protected PowerStateName currentPowerState;
+	protected PowerProfile powerProfile;
+	protected ComputingResource resource;
+	
+	public ComputingResourcePowerInterface(ComputingResource resource, PowerProfile powerProfile){
+		this.resource = resource;
+		this.powerProfile = powerProfile;
+		this.currentPowerState = StandardPowerStateName.ON;
+	}
+	
+	public boolean setPowerState(PowerStateName state) {
+		if(supportPowerState(state)){
+			currentPowerState = state;
+
+			for(ComputingResource child:resource.getChildren()){
+				if(child.getPowerInterface().supportPowerState(state)){
+					boolean status = child.getPowerInterface().setPowerState(state);
+					if(status == false) {
+						resource.handleEvent(new EnergyEvent(EnergyEventType.POWER_STATE_CHANGED, resource));
+					}
+				}
+			}
+
+			if(state == StandardPowerStateName.OFF){
+				resource.setStatus(ResourceStatus.UNAVAILABLE);
+			}
+			else if(state == StandardPowerStateName.ON){
+				resource.setStatus(ResourceStatus.FREE);
+			}
+			//notifications from all levels
+			resource.handleEvent(new EnergyEvent(EnergyEventType.POWER_STATE_CHANGED, resource.getName()));
+
+			//notification from last level
+			//if (resource.getChildren() == null) resource.handleEvent(new EnergyEvent(EnergyEventType.POWER_STATE_CHANGED, resource));
+			
+			return true;
+		}
+		return false;
+	}
+	
+
+	public PowerStateName getPowerState() {
+		return currentPowerState;
+	}
+
+	public List<PowerState> getSupportedPowerStates() throws NoSuchFieldException {
+		List<PowerState> powerStates = new ArrayList<PowerState>();
+		for(PowerState powerState: powerProfile.getSupportedPowerStates()){
+			powerStates.add(powerState);
+		}
+		return powerStates;
+	}
+
+	public boolean supportPowerState(PowerStateName state) {
+		try {
+			for(PowerState powerState: powerProfile.getSupportedPowerStates()){
+				if(powerState.getName().equals(state)){
+					return true;
+				}
+			}
+		} catch (NoSuchFieldException e) {
+			return false;
+		}
+		return false;
+		
+	}
+	
+	public double getPowerConsumption(PowerStateName state) throws NoSuchFieldException {
+		double powerConsumption = 0;
+		if(supportPowerState(state)){
+			for(PowerState powerState: powerProfile.getSupportedPowerStates()){
+				if(powerState.getName().equals(state)){
+					powerConsumption = powerState.getPowerUsage();
+					break;
+				}
+			}
+		}
+		return powerConsumption;
+	}
+
+	public PowerUsage getRecentPowerUsage() {
+		PowerUsage powerUsage = null;
+		int lastIdx = getPowerUsageHistory().size() - 1;
+		if(lastIdx >= 0)
+			powerUsage = getPowerUsageHistory().get(lastIdx);
+		else {	
+			try {
+				powerUsage = new PowerUsage(DateTimeUtils.currentTimeMillis(), getPowerConsumption(currentPowerState));
+			} catch (NoSuchFieldException e) {
+			}
+		}
+		return powerUsage;
+	}
+	
+	public List<PowerUsage> getPowerUsageHistory(){
+		return powerProfile.getPowerUsageHistory();
+	}
+	
+	public Parameters getParameters() {
+		return powerProfile.getParameters();
+	}
+
+}
Index: /DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/power/ui/PowerInterface.java
===================================================================
--- /DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/power/ui/PowerInterface.java	(revision 477)
+++ /DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/power/ui/PowerInterface.java	(revision 539)
@@ -3,4 +3,5 @@
 import java.util.List;
 
+import schedframe.Parameters;
 import schedframe.resources.computing.profiles.energy.power.PowerState;
 import schedframe.resources.computing.profiles.energy.power.PowerStateName;
@@ -25,3 +26,4 @@
 	List<PowerUsage> getPowerUsageHistory();
 	
+	public Parameters getParameters();
 }
Index: /DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/power/ui/ProcessorPowerInterface.java
===================================================================
--- /DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/power/ui/ProcessorPowerInterface.java	(revision 477)
+++ /DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/power/ui/ProcessorPowerInterface.java	(revision 539)
@@ -1,10 +1,12 @@
 package schedframe.resources.computing.profiles.energy.power.ui;
+
+
+import gridsim.GridSimTags;
+import gridsim.dcworms.DCWormsTags;
 
 import java.util.Map;
 
-import schedframe.events.ResourceEventCommand;
 import schedframe.resources.ResourceStatus;
 import schedframe.resources.computing.ComputingResource;
-import schedframe.resources.computing.Processor;
 import schedframe.resources.computing.profiles.energy.EnergyEvent;
 import schedframe.resources.computing.profiles.energy.EnergyEventType;
@@ -16,5 +18,5 @@
 import schedframe.resources.units.StandardResourceUnitName;
 
-public class ProcessorPowerInterface extends AbstractPowerInterface {
+public class ProcessorPowerInterface extends ComputingResourcePowerInterface {
 
 	protected PState currentPState;
@@ -36,5 +38,4 @@
 		if(powerState != currentPowerState){
 			currentPowerState = powerState;
-			//Processor cpu = (Processor) resource;
 			if(powerState == StandardPowerStateName.OFF){
 				resource.setStatus(ResourceStatus.UNAVAILABLE);
@@ -42,6 +43,5 @@
 				resource.setStatus(ResourceStatus.FREE);
 			}
-			resource.handleEvent(new EnergyEvent(EnergyEventType.POWER_STATE_CHANGED, resource.getName()));
-			//cpu.handleEvent(new EnergyEvent(EnergyEventType.POWER_STATE_CHANGED, cpu.getName()));			
+			resource.handleEvent(new EnergyEvent(EnergyEventType.POWER_STATE_CHANGED, resource.getName()));		
 		}
 
@@ -79,11 +79,11 @@
 
 		if(newPState != currentPState){
-			double factor = newPState.getFrequency()/currentPState.getFrequency();
+			//double factor = newPState.getFrequency()/currentPState.getFrequency();
 			currentPState = newPState;
-			CpuSpeed speed = (CpuSpeed)resource.getResourceCharacteristic().getResourceUnits().get(StandardResourceUnitName.CPUSPEED).get(0);
-			speed.setAmount(Double.valueOf(currentPState.getFrequency()).intValue());
+			//CpuSpeed speed = (CpuSpeed)resource.getResourceCharacteristic().getResourceUnits().get(StandardResourceUnitName.CPUSPEED).get(0);
+			//speed.setAmount(Double.valueOf(currentPState.getFrequency()).intValue());
 			//new ResourceEventCommand(resource).execute(EnergyEventType.FREQUENCY_CHANGED);
 			resource.handleEvent(new EnergyEvent(EnergyEventType.FREQUENCY_CHANGED, resource.getName()));
-			//resource.getScheduler().sendInternal(GridSimTags.SCHEDULE_NOW, GssimTags.UPDATE, resource.getName());
+			//resource.getScheduler().sendInternal(GridSimTags.SCHEDULE_NOW, DCWormsTags.UPDATE, resource.getName());
 			return true;
 		}
Index: /DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/power/ui/DataCenterPowerInterface.java
===================================================================
--- /DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/power/ui/DataCenterPowerInterface.java	(revision 477)
+++ /DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/power/ui/DataCenterPowerInterface.java	(revision 539)
@@ -7,9 +7,6 @@
 import schedframe.resources.computing.profiles.energy.power.StandardPowerStateName;
 
-public class DataCenterPowerInterface extends AbstractPowerInterface{
+public class DataCenterPowerInterface extends ComputingResourcePowerInterface{
 
-
-
-	
 	public DataCenterPowerInterface(ComputingResource resource, PowerProfile pp){
 		super(resource, pp);
Index: /DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/power/PowerInterfaceFactory.java
===================================================================
--- /DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/power/PowerInterfaceFactory.java	(revision 539)
+++ /DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/power/PowerInterfaceFactory.java	(revision 539)
@@ -0,0 +1,51 @@
+package schedframe.resources.computing.profiles.energy.power;
+
+import schedframe.resources.StandardResourceType;
+import schedframe.resources.computing.ComputingResource;
+import schedframe.resources.computing.profiles.energy.power.ui.PowerInterface;
+
+public class PowerInterfaceFactory {
+
+
+
+	//new1
+	/*public static PowerInterface createPowerProfile(ResourceType resourceType, List<PowerState> powerStates, List<PState> pStates, String eepn){
+
+		PowerInterface powerProfile;
+
+		switch(resourceType){
+			case DataCenter: powerProfile = new DataCenterPowerInterfaceNew(eepn, powerStates); break;
+			case ComputingNode: powerProfile = new ComputingNodePowerInterfaceNew(eepn, powerStates); break;
+			case Processor: powerProfile = new CPUPowerInterfaceNew(eepn, powerStates, pStates); break;
+			default:
+				throw new IllegalArgumentException("ResourceType " + resourceType + " is not supported.");
+		}
+
+		return powerProfile;
+	}*/
+	
+	public static PowerInterface createPowerInterface(ComputingResource resource, PowerProfile pp){
+		if(pp == null)
+			return null;
+		PowerInterface powerInterface;
+
+		if(resource.getType().getName().equals(StandardResourceType.DataCenter.getName()))
+			powerInterface = new schedframe.resources.computing.profiles.energy.power.ui.DataCenterPowerInterface(resource, pp);
+		else if (resource.getType().getName().equals(StandardResourceType.ComputingNode.getName()))
+			powerInterface = new schedframe.resources.computing.profiles.energy.power.ui.ComputingNodePowerInterface(resource, pp);
+		else if (resource.getType().getName().equals(StandardResourceType.Processor.getName()))
+			powerInterface = new schedframe.resources.computing.profiles.energy.power.ui.ProcessorPowerInterface(resource, pp);
+		else 
+			powerInterface = new schedframe.resources.computing.profiles.energy.power.ui.ComputingResourcePowerInterface(resource, pp);
+
+		/*switch(resource.getType()){
+			case DataCenter: powerInterface = new test.rewolucja.energy.profile.implementation.alternative2.DataCenterPowerInterfaceNew(resource, pp); break;
+			case ComputingNode: powerInterface = new test.rewolucja.energy.profile.implementation.alternative2.ComputingNodePowerInterfaceNew(resource, pp); break;
+			case Processor: powerInterface = new test.rewolucja.energy.profile.implementation.alternative2.CPUPowerInterfaceNew(resource, pp); break;
+			default:
+				throw new IllegalArgumentException("ResourceType " + resource.getType() + " is not supported.");
+		}*/
+
+		return powerInterface;
+	}
+}
Index: /DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/EnergyEventType.java
===================================================================
--- /DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/EnergyEventType.java	(revision 477)
+++ /DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/EnergyEventType.java	(revision 539)
@@ -15,5 +15,8 @@
 	FREQUENCY_CHANGED(64),
 	VOLTAGE_CHANGED(128),
-	RESOURCE_FAILED(256)
+	
+	AIRFLOW_STATE_CHANGED(256),
+	
+	RESOURCE_FAILED(512)
 	;
 
Index: /DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/airthroughput/AirFlowValue.java
===================================================================
--- /DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/airthroughput/AirFlowValue.java	(revision 539)
+++ /DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/airthroughput/AirFlowValue.java	(revision 539)
@@ -0,0 +1,11 @@
+package schedframe.resources.computing.profiles.energy.airthroughput;
+
+import schedframe.resources.computing.profiles.energy.MeasurementHistory;
+
+public class AirFlowValue extends MeasurementHistory{
+
+	public AirFlowValue(long timestamp, double value){
+		super(timestamp, value);
+	}
+	
+}
Index: /DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/airthroughput/AirThroughputProfile.java
===================================================================
--- /DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/airthroughput/AirThroughputProfile.java	(revision 477)
+++ /DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/airthroughput/AirThroughputProfile.java	(revision 539)
@@ -1,5 +1,8 @@
 package schedframe.resources.computing.profiles.energy.airthroughput;
 
+import java.util.ArrayList;
 import java.util.List;
+
+import org.joda.time.DateTimeUtils;
 
 import schedframe.Parameters;
@@ -8,6 +11,9 @@
 public class AirThroughputProfile {
 	
-	AirThroughputEstimationPlugin airThroughputEstimationPlugin;
+	protected List<AirFlowValue> airFlowHistory;
+	
+	protected AirThroughputEstimationPlugin airThroughputEstimationPlugin;
 	protected List <AirThroughputState> airThroughputStates;
+	protected Parameters parameters;
 
 	public AirThroughputProfile(AirThroughputEstimationPlugin airThroughputEstimationPlugin, List<AirThroughputState> airThroughputStates) {
@@ -15,4 +21,5 @@
 		this.airThroughputEstimationPlugin = airThroughputEstimationPlugin;
 		this.airThroughputStates = airThroughputStates;
+		this.airFlowHistory = new ArrayList<AirFlowValue>();
 	}
 
@@ -21,6 +28,38 @@
 	}
 	
-	public void init(Parameters parameters){
-		
+	public void addToPowerUsageHistory(double airFlow) {
+
+		if (airFlowHistory.size() == 0) {
+			AirFlowValue usage = new AirFlowValue(DateTimeUtils.currentTimeMillis(), airFlow);
+			airFlowHistory.add(usage);
+			return;
+		}
+
+		int lastIdx = airFlowHistory.size() - 1;
+		double lastAirFlow = airFlowHistory.get(lastIdx).getValue();
+		if (lastAirFlow != airFlow) {
+			AirFlowValue usage = airFlowHistory.get(lastIdx);
+			long currentTime = DateTimeUtils.currentTimeMillis();
+			if (usage.getTimestamp() == currentTime) {
+				usage.setValue(airFlow);
+				if(lastIdx > 0 && airFlowHistory.get(lastIdx - 1).getValue() == airFlow)
+					airFlowHistory.remove(usage);
+			} else {
+				usage = new AirFlowValue(DateTimeUtils.currentTimeMillis(), airFlow);
+				airFlowHistory.add(usage);
+			}
+		}
+	}
+
+	public List<AirFlowValue> getAirThroughputHistory() {
+		return airFlowHistory;
+	}
+	
+	public void init(Parameters params){
+		this.parameters = params;
+	}
+
+	public Parameters getParameters() {
+		return parameters;
 	}
 }
Index: /DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/airthroughput/ui/AirThroughputInterface.java
===================================================================
--- /DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/airthroughput/ui/AirThroughputInterface.java	(revision 539)
+++ /DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/airthroughput/ui/AirThroughputInterface.java	(revision 539)
@@ -0,0 +1,21 @@
+package schedframe.resources.computing.profiles.energy.airthroughput.ui;
+
+import java.util.List;
+
+import schedframe.Parameters;
+import schedframe.resources.computing.profiles.energy.airthroughput.AirThroughputState;
+
+public interface AirThroughputInterface {
+	
+	public String getAirThroughputState();
+	
+	public boolean setAirThroughputState(String airThroughputState);
+	
+	public boolean supportAirThroughputState(String powerState);
+	
+	public List<AirThroughputState> getSupportedAirThroughputStates() throws NoSuchFieldException;
+	
+	public double getPowerConsumption(String state) throws NoSuchFieldException;
+	
+	public Parameters getParameters();
+}
Index: /DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/airthroughput/ui/DefaultAirThroughputInterface.java
===================================================================
--- /DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/airthroughput/ui/DefaultAirThroughputInterface.java	(revision 539)
+++ /DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/airthroughput/ui/DefaultAirThroughputInterface.java	(revision 539)
@@ -0,0 +1,74 @@
+package schedframe.resources.computing.profiles.energy.airthroughput.ui;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import schedframe.Parameters;
+import schedframe.resources.computing.ComputingResource;
+import schedframe.resources.computing.profiles.energy.EnergyEvent;
+import schedframe.resources.computing.profiles.energy.EnergyEventType;
+import schedframe.resources.computing.profiles.energy.airthroughput.AirThroughputProfile;
+import schedframe.resources.computing.profiles.energy.airthroughput.AirThroughputState;
+
+public class DefaultAirThroughputInterface implements AirThroughputInterface{
+
+	protected String currentAirThroughputState;
+	protected AirThroughputProfile airThroughputProfile;
+	protected ComputingResource resource;
+	
+	public DefaultAirThroughputInterface(ComputingResource resource, AirThroughputProfile airThroughputProfile){
+		this.resource = resource;
+		this.airThroughputProfile = airThroughputProfile;
+	}
+	
+	public String getAirThroughputState() {
+		return currentAirThroughputState;
+	}
+
+	public boolean setAirThroughputState(String state) {
+		if(supportAirThroughputState(state)){
+			currentAirThroughputState = state;
+			
+			//TO DO - notifications should be called for all resources starting form the lowest layer
+			resource.handleEvent(new EnergyEvent(EnergyEventType.AIRFLOW_STATE_CHANGED, resource.getName()));
+
+			return true;
+		}
+		return false;
+	}
+
+	public boolean supportAirThroughputState(String state) {
+		for(AirThroughputState airFlowState: airThroughputProfile.getAirThroughputStates()){
+			if(airFlowState.getName().equals(state)){
+				return true;
+			}
+		}
+		return false;
+	}
+
+	public List<AirThroughputState> getSupportedAirThroughputStates() throws NoSuchFieldException {
+		List<AirThroughputState> airThroughputStates = new ArrayList<AirThroughputState>();
+		for(AirThroughputState airFlowState: airThroughputProfile.getAirThroughputStates()){
+			airThroughputStates.add(airFlowState);
+		}
+		return airThroughputStates;
+	}
+
+	public double getPowerConsumption(String state) throws NoSuchFieldException {
+		double powerConsumption = 0;
+		if(supportAirThroughputState(state)){
+			for(AirThroughputState airFlowState: airThroughputProfile.getAirThroughputStates()){
+				if(airFlowState.getName().equals(state)){
+					powerConsumption = airFlowState.getPowerUsage();
+					break;
+				}
+			}
+		}
+		return powerConsumption;
+	}
+
+	public Parameters getParameters() {
+		return airThroughputProfile.getParameters();
+	}
+
+}
Index: /DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/airthroughput/AirThroughputInterfaceFactory.java
===================================================================
--- /DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/airthroughput/AirThroughputInterfaceFactory.java	(revision 539)
+++ /DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/airthroughput/AirThroughputInterfaceFactory.java	(revision 539)
@@ -0,0 +1,16 @@
+package schedframe.resources.computing.profiles.energy.airthroughput;
+
+import schedframe.resources.computing.ComputingResource;
+import schedframe.resources.computing.profiles.energy.airthroughput.ui.AirThroughputInterface;
+import schedframe.resources.computing.profiles.energy.airthroughput.ui.DefaultAirThroughputInterface;
+
+public class AirThroughputInterfaceFactory {
+	
+	public static AirThroughputInterface createAirThroughputInterface(ComputingResource resource, AirThroughputProfile atp){
+		if(atp == null)
+			return null;
+		AirThroughputInterface airThroughputInterface = new DefaultAirThroughputInterface(resource, atp);
+
+		return airThroughputInterface;
+	}
+}
Index: /DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/EnergyExtension.java
===================================================================
--- /DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/EnergyExtension.java	(revision 477)
+++ /DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/EnergyExtension.java	(revision 539)
@@ -11,9 +11,11 @@
 import schedframe.resources.computing.extensions.ExtensionException;
 import schedframe.resources.computing.extensions.ExtensionType;
+import schedframe.resources.computing.profiles.energy.airthroughput.AirThroughputProfile;
+import schedframe.resources.computing.profiles.energy.airthroughput.ui.AirThroughputInterface;
 import schedframe.resources.computing.profiles.energy.power.PowerProfile;
 import schedframe.resources.computing.profiles.energy.power.ui.PowerInterface;
 import schedframe.scheduling.manager.tasks.JobRegistryImpl;
 
-public class EnergyExtension implements Extension/*, ResourceVisitor */{
+public class EnergyExtension implements Extension{
 
 	private Log log = LogFactory.getLog(EnergyExtension.class);
@@ -21,5 +23,8 @@
 	protected PowerInterface powerInterface;
 	protected PowerProfile powerProfile;
-
+	
+	protected AirThroughputInterface airFlowInterface;
+	protected AirThroughputProfile airFlowProfile;
+	
   	protected ComputingResource computingResource;
 
@@ -29,10 +34,17 @@
 	}
 
-	@Override
+	public EnergyExtension(PowerInterface powerInterface, PowerProfile powerProfile,
+			AirThroughputInterface airFlowInterface, AirThroughputProfile airFlowProfile) {
+		super();
+		this.powerInterface = powerInterface;
+		this.powerProfile = powerProfile;
+		this.airFlowInterface = airFlowInterface;
+		this.airFlowProfile = airFlowProfile;
+	}
+
 	public boolean supportsEvent(Event event) {
 
 		if(powerProfile == null || powerProfile.getEnergyEstimationPlugin() == null)
 			return false;
-		
 		if(event.getType().getName().equals(EnergyEventType.POWER_STATE_CHANGED.getName()))
 			return true;
@@ -43,10 +55,14 @@
 		else if(event.getType().getName().equals(EnergyEventType.TASK_FINISHED.getName()))
 			return true;
+		
+		if(airFlowProfile == null)
+			return false;	
+		if(event.getType().getName().equals(EnergyEventType.AIRFLOW_STATE_CHANGED.getName()))
+			return true;
+		
 		else return false;
 
 	}
-	
 
-	@Override
 	public void handleEvent(Event event) {
 		EnergyEvent enEvent = (EnergyEvent)event;
@@ -87,15 +103,19 @@
 			//System.out.println(this.resource.getName() + " - ESTIMATED ENERGY:" + power);
 			powerProfile.addToPowerUsageHistory(power);
-
+			break;
+		case AIRFLOW_STATE_CHANGED:
+			System.out.println("=====");
+			double airFlow = powerProfile.getEnergyEstimationPlugin().estimateAirThroughput(enEvent, new JobRegistryImpl(computingResource.getName()), computingResource);
+			airFlowProfile.addToPowerUsageHistory(airFlow);
+			power = powerProfile.getEnergyEstimationPlugin().estimatePowerConsumption(enEvent, new JobRegistryImpl(computingResource.getName()), computingResource);
+			powerProfile.addToPowerUsageHistory(power);
 			break;
 		}
 	}
-	
-	@Override
+
 	public void init(Properties properties) throws ExtensionException {
 		// TODO Auto-generated method stub
 	}
 
-	@Override
 	public ExtensionType getType() {
 		return ExtensionType.ENERGY_EXTENSION;
@@ -118,4 +138,11 @@
 	}
 
+	public AirThroughputInterface getAirThroughputInterface() {
+		return airFlowInterface;
+	}
+
+	public AirThroughputProfile getAirFlowProfile() {
+		return airFlowProfile;
+	}
 
 }
Index: /DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/MeasurementHistory.java
===================================================================
--- /DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/MeasurementHistory.java	(revision 539)
+++ /DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/MeasurementHistory.java	(revision 539)
@@ -0,0 +1,25 @@
+package schedframe.resources.computing.profiles.energy;
+
+public class MeasurementHistory {
+	
+	protected long timestamp;
+	protected double value;
+
+	public MeasurementHistory (long timestamp, double value){
+		this.timestamp = timestamp;
+		this.value = value;
+	}
+	
+	public long getTimestamp() {
+		return timestamp;
+	}
+
+	public double getValue() {
+		return value;
+	}
+	
+	public void setValue(double value) {
+		this.value = value;
+	}
+	
+}
Index: /DCWoRMS/trunk/build/classes/schedframe/ResourceController.java
===================================================================
--- /DCWoRMS/trunk/build/classes/schedframe/ResourceController.java	(revision 477)
+++ /DCWoRMS/trunk/build/classes/schedframe/ResourceController.java	(revision 539)
@@ -19,4 +19,5 @@
 	protected static List<ComputingResource> computingResources;
 	protected Deque<Initializable> toInit;
+	protected Set<String> compResLayers;
 	
 	public  ResourceController(Scheduler logicalStructure, List<ComputingResource> compResources){
@@ -144,3 +145,12 @@
 	}
 
+	public Set<String> getComputingResourceLayers() {
+		return compResLayers;
+	}
+
+	public void setCompResLayers(Set<String> compResLayers) {
+		this.compResLayers = compResLayers;
+	}
+
+
 }
Index: /DCWoRMS/trunk/build/classes/schedframe/ExecutablesList.java
===================================================================
--- /DCWoRMS/trunk/build/classes/schedframe/ExecutablesList.java	(revision 539)
+++ /DCWoRMS/trunk/build/classes/schedframe/ExecutablesList.java	(revision 539)
@@ -0,0 +1,155 @@
+package schedframe;
+
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import java.util.ListIterator;
+
+import dcworms.schedframe.scheduling.ExecTask;
+import dcworms.schedframe.scheduling.Executable;
+
+public class ExecutablesList implements List<ExecTask> {
+
+	private List<ExecTask> executables;
+	
+	public ExecutablesList (){
+		executables = Collections.synchronizedList(new ArrayList<ExecTask>());
+	}
+
+	public List<Executable> getJobExecutables(String jobId){
+		List<Executable> list = new ArrayList<Executable>();
+		synchronized (executables)  {
+			for(int i = 0; i < executables.size(); i++){
+				Executable exec = (Executable)executables.get(i);
+				
+				if(exec.getJobId().equals(jobId))
+					list.add(exec);
+			}
+		}
+		return list;
+	}
+	
+	public List<Executable> getTaskExecutables(String jobId, String taskId){
+		
+		List<Executable> list = new ArrayList<Executable>();
+		synchronized (executables)  {
+			for(int i = 0; i < executables.size(); i++){
+				Executable exec = (Executable)executables.get(i);
+				
+				if(exec.getJobId().equals(jobId) && exec.getId().equals(taskId))
+					list.add(exec);
+			}
+		}
+		return list;
+	}
+	
+	public Executable getTaskExecutable(Integer executableId){
+		synchronized (executables)  {
+			for (ExecTask task : executables) {
+				Executable exec = (Executable)task;
+				if (exec.getUniqueId() == executableId) {
+					return exec;
+				}
+			}
+		}
+		return null;
+	}
+	
+	
+	public boolean add(ExecTask arg0) {
+		return executables.add(arg0);
+	}
+
+	public void add(int arg0, ExecTask arg1) {
+		executables.add(arg0, arg1);
+	}
+
+	public boolean addAll(Collection<? extends ExecTask> arg0) {
+		return executables.addAll(arg0);
+	}
+
+	public boolean addAll(int arg0, Collection<? extends ExecTask> arg1) {
+		return executables.addAll(arg0, arg1);
+	}
+
+	public void clear() {
+		executables.clear();
+	}
+
+	public boolean contains(Object arg0) {
+		return executables.contains(arg0);
+	}
+
+	public boolean containsAll(Collection<?> arg0) {
+		return executables.containsAll(arg0);
+	}
+
+	public ExecTask get(int arg0) {
+		return executables.get(arg0);
+	}
+
+	public int indexOf(Object arg0) {
+		return indexOf(arg0);
+	}
+
+	public boolean isEmpty() {
+		return executables.isEmpty();
+	}
+
+	public Iterator<ExecTask> iterator() {
+		return executables.iterator();
+	}
+
+	public int lastIndexOf(Object arg0) {
+		return executables.lastIndexOf(arg0);
+	}
+
+	public ListIterator<ExecTask> listIterator() {
+		return executables.listIterator();
+	}
+
+	public ListIterator<ExecTask> listIterator(int arg0) {
+		return executables.listIterator(arg0);
+	}
+
+	public boolean remove(Object arg0) {
+		return executables.remove(arg0);
+	}
+
+	public ExecTask remove(int arg0) {
+		return executables.remove(arg0);
+	}
+
+	public boolean removeAll(Collection<?> arg0) {
+		return executables.removeAll(arg0);
+	}
+
+	public boolean retainAll(Collection<?> arg0) {
+		return executables.retainAll(arg0);
+	}
+
+	public ExecTask set(int arg0, ExecTask arg1) {
+		return executables.set(arg0, arg1);
+	}
+
+	public int size() {
+		return executables.size();
+	}
+
+	public List<ExecTask> subList(int arg0, int arg1) {
+		return executables.subList(arg0, arg1);
+	}
+
+	public Object[] toArray() {
+		return executables.toArray();
+	}
+
+	public <T> T[] toArray(T[] arg0) {
+		return executables.toArray(arg0);
+	}
+	
+}
+
Index: /DCWoRMS/trunk/build/classes/schedframe/scheduling/TaskList.java
===================================================================
--- /DCWoRMS/trunk/build/classes/schedframe/scheduling/TaskList.java	(revision 539)
+++ /DCWoRMS/trunk/build/classes/schedframe/scheduling/TaskList.java	(revision 539)
@@ -0,0 +1,10 @@
+package schedframe.scheduling;
+
+import java.util.List;
+
+import schedframe.scheduling.tasks.TaskInterface;
+
+
+public interface TaskList extends List<TaskInterface<?>>{
+
+}
Index: /DCWoRMS/trunk/build/classes/schedframe/scheduling/queue/TaskQueue.java
===================================================================
--- /DCWoRMS/trunk/build/classes/schedframe/scheduling/queue/TaskQueue.java	(revision 477)
+++ /DCWoRMS/trunk/build/classes/schedframe/scheduling/queue/TaskQueue.java	(revision 539)
@@ -1,13 +1,13 @@
 package schedframe.scheduling.queue;
 
-import gridsim.Gridlet;
-import gssim.schedframe.scheduling.queues.AbstractStatsSupportingQueue;
+import gridsim.dcworms.DCWormsTags;
 
 import org.joda.time.DateTime;
 
-import schedframe.scheduling.tasks.WorkloadUnit;
+import dcworms.schedframe.scheduling.queues.AbstractStatsSupportingQueue;
 
-public class TaskQueue extends AbstractStatsSupportingQueue<WorkloadUnit<?>> implements Queue<WorkloadUnit<?>>{
+import schedframe.scheduling.tasks.TaskInterface;
 
+public class TaskQueue extends AbstractStatsSupportingQueue<TaskInterface<?>> implements Queue<TaskInterface<?>>{
 
 	private static final long serialVersionUID = 6576299222910508209L;
@@ -17,35 +17,30 @@
 	protected boolean supportReservation;
 	
-	
 	public TaskQueue (boolean supportReservation){
-		name = "Queue";
-		priority = 0;
+		this.name = "Queue";
+		this.priority = 0;
 		this.supportReservation = supportReservation;
-
 	}
 	
-	public boolean add(WorkloadUnit<?> wu){
+	public boolean add(TaskInterface<?> task){
 		try {
-			wu.setStatus(Gridlet.QUEUED);
+			task.setStatus(DCWormsTags.QUEUED);
 		} catch(Exception e){
 			throw new RuntimeException(e);
 		}
-		//updateStats();
-		return super.add(wu);
+		return super.add(task);
 	}
 	
-	public void add(int pos, WorkloadUnit<?> wu){
+	public void add(int pos, TaskInterface<?> task){
 		try {
-			wu.setStatus(Gridlet.QUEUED);
+			task.setStatus(DCWormsTags.QUEUED);
 		} catch(Exception e){
 			throw new RuntimeException(e);
 		}
-		//updateStats();
-		 super.add(pos, wu);
+		 super.add(pos, task);
 	}
 	
 	public DateTime getArrivalTime(int pos) throws IndexOutOfBoundsException {
-		//return get(pos).getSubmissionTimeToBroker();
-		return null;
+		return get(pos).getSubmissionTimeToBroker();
 	}
 
@@ -69,35 +64,3 @@
 		return supportReservation;
 	}
-	
-	
-	/*public boolean contains (WorkloadUnitInterface<?> wu) {
-		for(int i = 0; i< size();i++){
-			try {
-				if(get(i).getId().equals(wu.getId()))
-					return true;
-			} catch (NoSuchFieldException e) {
-				return false;
-			}
-		}
-		return false;
-	}
-	
-	public boolean remove (WorkloadUnitInterface<?> wu) {
-		boolean found = false;
-		int index = 0;
-		for(int i = 0; i< size() && !found;i++){
-			try {
-				if(get(i).getId().equals(wu.getId()))
-				{
-					found = true;
-					index = i;
-				}
-				
-			} catch (NoSuchFieldException e) {
-				return false;
-			}
-		}
-		remove(index);
-		return true;
-	}*/
 }
Index: /DCWoRMS/trunk/build/classes/schedframe/scheduling/tasks/Task.java
===================================================================
--- /DCWoRMS/trunk/build/classes/schedframe/scheduling/tasks/Task.java	(revision 477)
+++ /DCWoRMS/trunk/build/classes/schedframe/scheduling/tasks/Task.java	(revision 539)
@@ -30,5 +30,4 @@
 import schedframe.scheduling.WorkloadUnitHandler;
 import schedframe.scheduling.manager.tasks.JobRegistryImpl;
-import schedframe.scheduling.policy.AbstractManagementSystem;
 import schedframe.scheduling.tasks.requirements.ResourceParameterName;
 
@@ -38,5 +37,5 @@
  *
  */
-public class Task /*extends AbstractTask*/ implements TaskInterface<org.qcg.broker.schemas.resreqs.Task> {
+public class Task implements TaskInterface<org.qcg.broker.schemas.resreqs.Task> {
 	
 	protected static Unmarshaller unmarshaller;
@@ -72,6 +71,5 @@
 	private int senderId;
 	private long workloadLogWaitTime;
-	//String resPathHistory;
-	
+
 	public Task(org.qcg.broker.schemas.resreqs.Task task){
 		this.task = task;
@@ -80,5 +78,4 @@
 		this.brokerSubmitTime = null;
 		this.duration = null;
-	//	this.gridletID_ = (getJobId() + "_" + getId()).hashCode();
 		prepareTopology();
 	}
@@ -91,5 +88,4 @@
 		this.brokerSubmitTime = null;
 		this.duration = null;
-	//	this.gridletID_ = (getJobId() + getId()).hashCode();
 		prepareTopology();
 	}
@@ -269,5 +265,5 @@
 	}
 
-	public String getUserDn() {
+	public String getUserDN() {
 		return this.task.getUserDN();
 	}
@@ -471,29 +467,11 @@
 	}*/
 
+
 	@Override
-	public List <Task> getTask() {
-		List<Task> tasks = new ArrayList<Task>();
-		tasks.add(this);
-		return tasks;
-	}
-
-	@Override
-	public Task getTask(String taskId) throws NoSuchFieldException {
-		// TODO Auto-generated method stub
-		return null;
-	}
-
-	@Override
-	public int getTaskCount() {
+	public int getUserId() {
 		// TODO Auto-generated method stub
 		return 0;
 	}
 
-	@Override
-	public int getUserID() {
-		// TODO Auto-generated method stub
-		return 0;
-	}
-
 	public boolean isRegistered() {
 		return isRegistered;
Index: /DCWoRMS/trunk/build/classes/schedframe/scheduling/tasks/Processes.java
===================================================================
--- /DCWoRMS/trunk/build/classes/schedframe/scheduling/tasks/Processes.java	(revision 477)
+++ /DCWoRMS/trunk/build/classes/schedframe/scheduling/tasks/Processes.java	(revision 539)
@@ -1,5 +1,3 @@
 package schedframe.scheduling.tasks;
-
-import java.util.List;
 
 import org.qcg.broker.schemas.resreqs.ComputingResourceBaseTypeItem;
@@ -196,43 +194,15 @@
 	}
 
-	public org.qcg.broker.schemas.resreqs.Processes getDescription(){
-		return this.pr;
-	}
-
-	@Override
-	public List getTask() {
-		// TODO Auto-generated method stub
-		return null;
-	}
-
-	@Override
-	public TaskInterface getTask(String taskId) throws NoSuchFieldException {
-		// TODO Auto-generated method stub
-		return null;
-	}
-
-	@Override
-	public int getTaskCount() {
+	public int getStatus() {
+		return this.status;
+	}
+
+	@Override
+	public int getUserId() {
 		// TODO Auto-generated method stub
 		return 0;
 	}
 
-	@Override
-	public int getStatus() {
-		// TODO Auto-generated method stub
-		return 0;
-	}
-
-	@Override
-	public int getUserID() {
-		// TODO Auto-generated method stub
-		return 0;
-	}
-
-	@Override
-	public String getDocument() throws Exception {
-		// TODO Auto-generated method stub
-		return null;
-	}
+
 
 	@Override
Index: /DCWoRMS/trunk/build/classes/schedframe/scheduling/tasks/Job.java
===================================================================
--- /DCWoRMS/trunk/build/classes/schedframe/scheduling/tasks/Job.java	(revision 477)
+++ /DCWoRMS/trunk/build/classes/schedframe/scheduling/tasks/Job.java	(revision 539)
@@ -18,5 +18,4 @@
 import schedframe.scheduling.WorkloadUnitHandler;
 import schedframe.scheduling.manager.tasks.JobRegistryImpl;
-import schedframe.scheduling.policy.AbstractManagementSystem;
 
 
@@ -179,5 +178,5 @@
 	}
 	
-	public int getUserID(){
+	public int getUserId(){
 		return this.senderId;
 	}
@@ -204,6 +203,6 @@
 		
 		List<Task> readyTasks = new ArrayList<Task>();
-
 		int size = tasks.size();
+		
 		for(int i = 0; i < size; i++){
 			int parCnt;
@@ -216,12 +215,9 @@
 			} catch(Exception e){
 				parCnt = 0;
-				//e.printStackTrace();
-			}
-			if(parCnt == 0)
-			{
+			}
+			if(parCnt == 0) {
 				readyTasks.add(task);
 			}
-			else
-			{
+			else {
 				for(int j = 0; j < parCnt; j++){
 					ParentType par = task.getDescription().getWorkflow().getParent(j);
Index: /DCWoRMS/trunk/build/classes/schedframe/scheduling/tasks/WorkloadUnit.java
===================================================================
--- /DCWoRMS/trunk/build/classes/schedframe/scheduling/tasks/WorkloadUnit.java	(revision 477)
+++ /DCWoRMS/trunk/build/classes/schedframe/scheduling/tasks/WorkloadUnit.java	(revision 539)
@@ -1,52 +1,19 @@
 package schedframe.scheduling.tasks;
 
-import java.util.List;
-
-import schedframe.DescriptionContainer;
 import schedframe.scheduling.WorkloadUnitHandler;
 import schedframe.scheduling.manager.tasks.JobRegistryImpl;
-import schedframe.scheduling.policy.AbstractManagementSystem;
 
-public interface WorkloadUnit<T> extends DescriptionContainer<T> {
+public interface WorkloadUnit {
 
-	/**
-	 * 
-	 * @return job identifier
-	 * @throws NoSuchFieldException if there is no tasks for this job, and job id can not be obtained
-	 */
-	public abstract String getId() throws NoSuchFieldException;
+	public String getId();
 	
-	/**
-	 * 
-	 * @return list of tasks which belongs to this job
-	 */
-	public abstract List<? extends TaskInterface<?>> getTask();
+	public int getUserId();
 	
-	/**
-	 * 
-	 * @param taskId
-	 * @return task with specified taskId
-	 * @throws NoSuchFieldException if task with taskId does not exist in this job
-	 */
-	public abstract TaskInterface<?> getTask(String taskId) throws NoSuchFieldException;
-	
-	/**
-	 * 
-	 * @return number of tasks in this job 
-	 */
-	public abstract int getTaskCount();
-	
-	/**
-	 * 
-	 * @return constant which represents current status of this job
-	 */
 	public int getStatus();
 	
 	public void setStatus(int status) throws Exception;
-	
+
 	public boolean isFinished();
-	
-	public int getUserID();
-	
+
 	public boolean isRegistered();
 
Index: /DCWoRMS/trunk/build/classes/schedframe/scheduling/tasks/TaskInterface.java
===================================================================
--- /DCWoRMS/trunk/build/classes/schedframe/scheduling/tasks/TaskInterface.java	(revision 477)
+++ /DCWoRMS/trunk/build/classes/schedframe/scheduling/tasks/TaskInterface.java	(revision 539)
@@ -6,4 +6,5 @@
 import org.joda.time.ReadableDuration;
 
+import schedframe.DescriptionContainer;
 import schedframe.scheduling.tasks.requirements.ResourceParameterName;
 
@@ -14,5 +15,5 @@
  *
  */
-public interface TaskInterface<T> extends WorkloadUnit<T> {
+public interface TaskInterface<T> extends WorkloadUnit, DescriptionContainer<T> {
 	
 	/**
@@ -20,5 +21,5 @@
 	 * @return task identifier
 	 */
-	public abstract String getId();
+	//public abstract String getId();
 	
 	/**
@@ -33,5 +34,5 @@
 	 * submitted this task. 
 	 */
-	public abstract String getUserDn();
+	public abstract String getUserDN();
 	
 	/**
@@ -87,16 +88,10 @@
 	 */
 	public long getLength();
-	
-	/**
-	 * 
-	 * @param length measured in instructions.
-	 */
-	public void setLength(long length);
-	
+
 	/**
 	 * 
 	 * @return constant which represent current task status
 	 */
-	public int getStatus();
+	//public int getStatus();
 	
 	
@@ -107,5 +102,5 @@
 	public List<AbstractProcesses> getProcesses(AbstractProcessesGroup processGroup);
 	
-	public void setStatus(int status) throws Exception;
+	//public void setStatus(int status) throws Exception;
 	
 	public double getCpuCntRequest() throws NoSuchFieldException;
@@ -114,8 +109,5 @@
 	
 	public long getWorkloadLogWaitTime();
-	
-	//public void addToResPath(String resName);
-	
-	//public String getResPath();
+
 		
 }
Index: /DCWoRMS/trunk/build/classes/schedframe/scheduling/tasks/AbstractProcesses.java
===================================================================
--- /DCWoRMS/trunk/build/classes/schedframe/scheduling/tasks/AbstractProcesses.java	(revision 477)
+++ /DCWoRMS/trunk/build/classes/schedframe/scheduling/tasks/AbstractProcesses.java	(revision 539)
@@ -3,5 +3,5 @@
 import schedframe.scheduling.tasks.requirements.ResourceParameterName;
 
-public abstract class AbstractProcesses<T> implements WorkloadUnit<T>{
+public abstract class AbstractProcesses implements WorkloadUnit{
 	
 	
Index: /DCWoRMS/trunk/build/classes/schedframe/scheduling/tasks/JobInterface.java
===================================================================
--- /DCWoRMS/trunk/build/classes/schedframe/scheduling/tasks/JobInterface.java	(revision 477)
+++ /DCWoRMS/trunk/build/classes/schedframe/scheduling/tasks/JobInterface.java	(revision 539)
@@ -11,5 +11,5 @@
  *
  */
-public interface JobInterface<T> extends WorkloadUnit<T> {
+public interface JobInterface<T> extends WorkloadUnit, DescriptionContainer<T> {
 
 	/**
@@ -18,5 +18,5 @@
 	 * @throws NoSuchFieldException if there is no tasks for this job, and job id can not be obtained
 	 */
-	public abstract String getId() throws NoSuchFieldException;
+	//public abstract String getId() throws NoSuchFieldException;
 	
 	/**
@@ -44,6 +44,6 @@
 	 * @return constant which represents current status of this job
 	 */
-	public int getStatus();
+	//public int getStatus();
 	
-	public int getUserID();
+	//public int getUserID();
 }
Index: /DCWoRMS/trunk/build/classes/schedframe/scheduling/policy/AbstractManagementSystem.java
===================================================================
--- /DCWoRMS/trunk/build/classes/schedframe/scheduling/policy/AbstractManagementSystem.java	(revision 477)
+++ /DCWoRMS/trunk/build/classes/schedframe/scheduling/policy/AbstractManagementSystem.java	(revision 539)
@@ -8,7 +8,10 @@
 import org.joda.time.DateTimeUtilsExt;
 
+import dcworms.schedframe.scheduling.ExecTask;
+import dcworms.schedframe.scheduling.Executable;
+import dcworms.schedframe.scheduling.queues.AbstractStatsSupportingQueue;
+
 import schedframe.PluginConfiguration;
 import schedframe.events.scheduling.SchedulingEventType;
-import schedframe.resources.units.StandardResourceUnitName;
 import schedframe.scheduling.Scheduler;
 import schedframe.scheduling.WorkloadUnitHandler;
@@ -16,6 +19,6 @@
 import schedframe.scheduling.manager.resources.ResourceManager;
 import schedframe.scheduling.manager.resources.ResourceManagerFactory;
+import schedframe.scheduling.manager.tasks.JobRegistry;
 import schedframe.scheduling.manager.tasks.JobRegistryImpl;
-import schedframe.scheduling.manager.tasks.JobRegistry;
 import schedframe.scheduling.plan.AllocationInterface;
 import schedframe.scheduling.plan.SchedulingPlanInterface;
@@ -27,15 +30,12 @@
 import schedframe.scheduling.queue.TaskQueueList;
 import schedframe.scheduling.tasks.Job;
+import schedframe.scheduling.tasks.TaskInterface;
 import schedframe.scheduling.tasks.WorkloadUnit;
-import simulator.WormsConstants;
+import simulator.DCWormsConstants;
 import eduni.simjava.Sim_event;
 import gridsim.GridSim;
 import gridsim.GridSimTags;
-import gridsim.Gridlet;
 import gridsim.IO_data;
-import gridsim.gssim.WormsTags;
-import gssim.schedframe.scheduling.ExecTask;
-import gssim.schedframe.scheduling.Executable;
-import gssim.schedframe.scheduling.queues.AbstractStatsSupportingQueue;
+import gridsim.dcworms.DCWormsTags;
 
 public abstract class AbstractManagementSystem {
@@ -45,15 +45,13 @@
 	protected String name;
 
+	protected TaskQueueList queues;
 	protected ResourceManager resourceManager;
-
-	protected TaskQueueList queues;
-
+	protected JobRegistryImpl jobRegistry;
+	protected ModuleList moduleList;
+	
 	protected SchedulingPlugin schedulingPlugin;
-
 	protected ExecutionTimeEstimationPlugin execTimeEstimationPlugin;
 
-	protected ModuleList moduleList;
-	
-	protected JobRegistryImpl jobRegistry;
+	protected Scheduler scheduler;
 	
 
@@ -67,4 +65,17 @@
 	}
 	
+	public void init(Scheduler sched, ManagedResources managedResources) {
+		scheduler = sched;
+		resourceManager = ResourceManagerFactory.createResourceManager(scheduler, managedResources);
+		scheduler.set_stat(DCWormsConstants.getResourcesStatisticsObject(queues.size()));
+		for(int i = 0; i < queues.size(); i++){
+			TaskQueue q = queues.get(i);
+			if(q instanceof AbstractStatsSupportingQueue<?>){
+				AbstractStatsSupportingQueue<?> queue = (AbstractStatsSupportingQueue<?>) q;
+				queue.setStats(scheduler.get_stat(), DCWormsConstants.TASKS_QUEUE_LENGTH_MEASURE_NAME + "_" + Integer.toString(i));
+			}
+		}
+	}
+	
 	public void processEvent(Sim_event ev) {
 		processOtherEvent(ev);
@@ -81,10 +92,7 @@
 	}
 	
+	
 	public String getName() {
 		return name;
-	}
-
-	public PluginConfiguration getSchedulingPluginConfiguration() {
-		return schedulingPlugin.getConfiguration();
 	}
 	
@@ -106,4 +114,12 @@
 		return jobRegistry;
 	}
+	
+	public Scheduler getScheduler() {
+		return scheduler;
+	}
+	
+	public PluginConfiguration getSchedulingPluginConfiguration() {
+		return schedulingPlugin.getConfiguration();
+	}
 
 	public boolean pluginSupportsEvent(int eventType){
@@ -111,68 +127,38 @@
 	}
 
-	public abstract void notifySubmittedWorkloadUnit(WorkloadUnit<?> wu, boolean ack);
-
-	public abstract void notifyCanceledWorkloadUnit(WorkloadUnit<?> wu);
-
-	public abstract void notifyReturnedWorkloadUnit(WorkloadUnit<?> wu);
-
-	protected abstract void executeSchedulingPlan(SchedulingPlanInterface decision);
-
-
-
+	public TaskQueueList getQueues(){
+		return queues;
+	}
+	
+	public Map<String, Integer> getQueuesSize() {
+		Map<String, Integer> queue_size = new HashMap<String, Integer>();
+		for (TaskQueue queue : queues) {
+			queue_size.put(queue.getName(), queue.size());
+		}
+		return queue_size;
+	}
+	
 	//POPRAWIC  (ale co? bo teraz chyba jest ok)
-	protected void submitWorkloadUnit(WorkloadUnit<?> wu, AllocationInterface allocation) {
+	protected void submitTask(TaskInterface<?> task, AllocationInterface<?> allocation) {
 		String providerName = allocation.getProviderName();
 		if (providerName == null) {
 			return;
 		}
-		//Executable exec = (Executable) wu;
-		removeFromQueue(wu);
-		scheduler.send(providerName, GridSimTags.SCHEDULE_NOW, GridSimTags.GRIDLET_SUBMIT, wu);	
-	}
-	
-	protected boolean sendCanceledWorkloadUnit(int tag, Executable task, int executableId, int destId) {
-		
-		if (tag != GridSimTags.GRIDLET_CANCEL) {
-			return false;
-		}
-
-		long taskSize = 0;
-		if (task != null) {
-			taskSize = task.getGridletOutputSize();
-		}
-
-		// if no Gridlet found, then create a new Gridlet but set its status
-		// to FAILED. Then, most importantly, set the resource parameters
-		// because the user will search/filter based on a resource ID.
-		else if (task == null) {
-			try {
-				taskSize = 100;
-				task = jobRegistry.getTaskExecutable(executableId);
-				task.setGridletStatus(Gridlet.FAILED);
-				int cost = resourceManager.getSharedResourceUnits().get(StandardResourceUnitName.COST) != null ? resourceManager
-						.getSharedResourceUnits().get(StandardResourceUnitName.COST).get(0).getAmount()
-						: 1;
-				task.setResourceParameter(scheduler.get_id(), cost);
-			} catch (Exception e) {
-				// empty ...
-			}
-		}
-		scheduler.send(scheduler.getOutputPort(), GridSimTags.SCHEDULE_NOW, tag,  new IO_data(task, taskSize, destId));
-
-		return true;
-	}
-
-	protected boolean sendFinishedWorkloadUnit(WorkloadUnit<?> wu) {
+		removeFromQueue(task);
+		scheduler.send(providerName, GridSimTags.SCHEDULE_NOW, GridSimTags.GRIDLET_SUBMIT, task);	
+	}
+
+	protected boolean sendFinishedWorkloadUnit(WorkloadUnit wu) {
 		
 		Executable exec = (Executable) wu;
 		if(scheduler.getParent() == null)
 		{
-			Job job = jobRegistry.get(exec.getJobId());
+			Job job = jobRegistry.getJob(exec.getJobId());
 
 			if(job.isFinished()){
 				scheduler.send(job.getSenderId(), GridSimTags.SCHEDULE_NOW, GridSimTags.GRIDLET_RETURN, job);
 				return true;
-			}else return true;
+			}
+			else return true;
 		}
 	
@@ -183,10 +169,4 @@
 
 	protected void sendExecutableReadyEvent(ExecTask exec) {
-
-		/*if (wu instanceof JobInterface) {
-			scheduler.sendInternal(Long.valueOf(0).doubleValue(), GssimTags.TASK_READY_FOR_EXECUTION,
-					wu);
-			return;
-		}*/
 
 		long delay = 0;
@@ -201,5 +181,5 @@
 		}
 
-		scheduler.sendInternal(Long.valueOf(delay).doubleValue(), WormsTags.TASK_READY_FOR_EXECUTION,
+		scheduler.sendInternal(Long.valueOf(delay).doubleValue(), DCWormsTags.TASK_READY_FOR_EXECUTION,
 				exec);
 	}
@@ -213,5 +193,5 @@
 				if (obj != null) {
 					int delay = (Integer) obj;
-					scheduler.sendInternal(delay, WormsTags.TIMER, null);
+					scheduler.sendInternal(delay, DCWormsTags.TIMER, null);
 				}
 			}
@@ -219,8 +199,8 @@
 	}
 	
-	protected boolean removeFromQueue(WorkloadUnit<?> wu) {
+	protected boolean removeFromQueue(TaskInterface<?> task) {
 		for(TaskQueue queue : queues){
-			if(queue.contains(wu)){
-				queue.remove(wu);
+			if(queue.contains(task)){
+				queue.remove(task);
 				return true;
 			}
@@ -228,37 +208,12 @@
 		return false;
 	}
-
-	public TaskQueueList getAccessQueues(){
-		return queues;
-	}
-	
-	public Map<String, Integer> getQueuesSize() {
-		Map<String, Integer> queue_size = new HashMap<String, Integer>();
-		for (TaskQueue queue : queues) {
-			queue_size.put(queue.getName(), queue.size());
-		}
-		return queue_size;
-	}
-
-	public void init(Scheduler sched, ManagedResources managedResources) {
-		scheduler = sched;
-		resourceManager = ResourceManagerFactory.createResourceManager(scheduler, managedResources);
-		scheduler.set_stat(WormsConstants.getResourcesStatisticsObject(queues.size()));
-		for(int i = 0; i < queues.size(); i++){
-			TaskQueue q = queues.get(i);
-			if(q instanceof AbstractStatsSupportingQueue<?>){
-				AbstractStatsSupportingQueue<?> queue = (AbstractStatsSupportingQueue<?>) q;
-				queue.setStats(scheduler.get_stat(), WormsConstants.TASKS_QUEUE_LENGTH_MEASURE_NAME + "_" + Integer.toString(i));
-			}
-		}
-	}
-
-	protected Scheduler scheduler;
-
-	public Scheduler getScheduler() {
-		return scheduler;
-	}
 	
 	public abstract WorkloadUnitHandler getWorkloadUnitHandler();
+	
+	public abstract void notifySubmittedWorkloadUnit(WorkloadUnit wu, boolean ack);
+
+	public abstract void notifyReturnedWorkloadUnit(WorkloadUnit wu);
+
+	protected abstract void executeSchedulingPlan(SchedulingPlanInterface<?> decision);
 
 }
Index: /DCWoRMS/trunk/build/classes/schedframe/scheduling/policy/local/LocalManagementSystem.java
===================================================================
--- /DCWoRMS/trunk/build/classes/schedframe/scheduling/policy/local/LocalManagementSystem.java	(revision 477)
+++ /DCWoRMS/trunk/build/classes/schedframe/scheduling/policy/local/LocalManagementSystem.java	(revision 539)
@@ -1,14 +1,13 @@
 package schedframe.scheduling.policy.local;
 
+import dcworms.schedframe.scheduling.ExecTask;
+import dcworms.schedframe.scheduling.Executable;
 import eduni.simjava.Sim_event;
 import eduni.simjava.Sim_system;
 import gridsim.Accumulator;
 import gridsim.GridSimTags;
-import gridsim.Gridlet;
 import gridsim.ResourceCalendar;
-import gridsim.gssim.WormsTags;
-import gridsim.gssim.filter.SubTaskFilter;
-import gssim.schedframe.scheduling.ExecTask;
-import gssim.schedframe.scheduling.Executable;
+import gridsim.dcworms.DCWormsTags;
+import gridsim.dcworms.filter.ExecTaskFilter;
 
 import java.util.ArrayList;
@@ -27,9 +26,7 @@
 import qcg.shared.constants.BrokerConstants;
 import schedframe.ResourceController;
-import schedframe.events.scheduling.EventReason;
 import schedframe.events.scheduling.SchedulingEvent;
 import schedframe.events.scheduling.SchedulingEventType;
 import schedframe.events.scheduling.StartTaskExecutionEvent;
-import schedframe.events.scheduling.TaskCanceledEvent;
 import schedframe.events.scheduling.TaskFinishedEvent;
 import schedframe.events.scheduling.TaskRequestedTimeExpiredEvent;
@@ -45,7 +42,8 @@
 import schedframe.scheduling.ResourceHistoryItem;
 import schedframe.scheduling.Scheduler;
-import schedframe.scheduling.UsedResourceList;
+import schedframe.scheduling.TaskList;
+import schedframe.scheduling.TaskListImpl;
+import schedframe.scheduling.UsedResourcesList;
 import schedframe.scheduling.WorkloadUnitHandler;
-import schedframe.scheduling.WorkloadUnitListImpl;
 import schedframe.scheduling.manager.resources.LocalResourceManager;
 import schedframe.scheduling.manager.resources.ManagedResources;
@@ -63,9 +61,8 @@
 import schedframe.scheduling.tasks.Job;
 import schedframe.scheduling.tasks.JobInterface;
-import schedframe.scheduling.tasks.SubmittedTask;
 import schedframe.scheduling.tasks.Task;
 import schedframe.scheduling.tasks.TaskInterface;
 import schedframe.scheduling.tasks.WorkloadUnit;
-import simulator.WormsConstants;
+import simulator.DCWormsConstants;
 import simulator.utils.DoubleMath;
 
@@ -83,6 +80,4 @@
 
 		super(providerId, entityName, execTimeEstimationPlugin, queues);
-
-		//schedulingPlugin = (LocalSchedulingPlugin) InstanceFactory.createInstance(schedulingPluginClassName, LocalSchedulingPlugin.class);
 		
 		if (schedPlugin == null) {
@@ -90,13 +85,11 @@
 		}
 		this.schedulingPlugin =  schedPlugin;
-		accTotalLoad = new Accumulator();
-		moduleList = new ModuleListImpl(1);
-
+		this.moduleList = new ModuleListImpl(1);
+		
+		this.accTotalLoad = new Accumulator();
 	}
 
 	public void init(Scheduler sched, ManagedResources managedResources) {
 		super.init(sched, managedResources);
-		//scheduler = sched;
-		//resourceManager = ResourceManagerFactory.createResourceManager(scheduler);
 		double load = 0;
 		accTotalLoad.add(load);
@@ -112,23 +105,21 @@
 		switch (tag) {
 
-		case WormsTags.TIMER:
+		case DCWormsTags.TIMER:
 			if (pluginSupportsEvent(tag)) {
 				SchedulingEvent event = new SchedulingEvent(SchedulingEventType.TIMER);
-				SchedulingPlanInterface decision =  schedulingPlugin.schedule(event, 
+				SchedulingPlanInterface<?> decision =  schedulingPlugin.schedule(event, 
 						queues,  getJobRegistry(), getResourceManager(), moduleList);
 				executeSchedulingPlan(decision);
 			}
 			sendTimerEvent();
-
 			break;
 
-		case WormsTags.TASK_READY_FOR_EXECUTION:
-			
-			ExecTask data = (ExecTask) ev.get_data();
-			try {
-				data.setStatus(Gridlet.READY);
+		case DCWormsTags.TASK_READY_FOR_EXECUTION:
+			ExecTask execTask = (ExecTask) ev.get_data();
+			try {
+				execTask.setStatus(DCWormsTags.READY);
 				if (pluginSupportsEvent(tag)) {
-					SchedulingEvent event = new StartTaskExecutionEvent(data.getJobId(), data.getId());
-					SchedulingPlanInterface decision =  schedulingPlugin.schedule(event,
+					SchedulingEvent event = new StartTaskExecutionEvent(execTask.getJobId(), execTask.getId());
+					SchedulingPlanInterface<?> decision =  schedulingPlugin.schedule(event,
 							queues,  getJobRegistry(), getResourceManager(), moduleList);
 					executeSchedulingPlan(decision);
@@ -139,61 +130,48 @@
 			break;
 
-		case WormsTags.TASK_EXECUTION_FINISHED:
+		case DCWormsTags.TASK_EXECUTION_FINISHED:
 			obj = ev.get_data();
-			ExecTask task = (ExecTask) obj;
-			if (task.getStatus() == Gridlet.INEXEC) {
-				finalizeExecutable(task);
-				SubmittedTask subTask = (SubmittedTask)task;
-				sendFinishedWorkloadUnit((ExecTask)subTask.getGridlet());
-				//task.setGridletStatus(Gridlet.SUCCESS);
-				//task.finalizeGridlet();
-				log.debug(task.getJobId() + "_" + task.getId() + " finished execution on " + new DateTime());
-				log.info(WormsConstants.USAGE_MEASURE_NAME + ": " + calculateTotalLoad(jobRegistry.getRunningTasks().size()));
-				/*UsedResourceList<ResourceHistoryItem> lastUsedList = task.getUsedResources();
-				Map<ResourceUnitName, AbstractResourceUnit> lastUsed = lastUsedList.getLast()
-						.getResourceUnits();
-				getAllocationManager().freeResources(lastUsed);
-				ProcessingElements pes = (ProcessingElements) lastUsed.get(StandardResourceUnitName.PROCESSINGELEMENTS);
-				for (ComputingResource resource : pes) {
-					resource.handleEvent(new EnergyEvent(EnergyEventType.TASK_FINISHED, task));
+			execTask = (ExecTask) obj;
+			if (execTask.getStatus() == DCWormsTags.INEXEC) {
+				
+				finalizeExecutable(execTask);
+				sendFinishedWorkloadUnit(execTask);
+				log.debug(execTask.getJobId() + "_" + execTask.getId() + " finished execution on " + new DateTime());
+				log.info(DCWormsConstants.USAGE_MEASURE_NAME + ": " + calculateTotalLoad(jobRegistry.getRunningTasks().size()));
+				if (pluginSupportsEvent(tag)) {
+					SchedulingEvent event = new TaskFinishedEvent(execTask.getJobId(), execTask.getId());
+					SchedulingPlanInterface<?> decision = schedulingPlugin.schedule(event,
+							queues, getJobRegistry(), getResourceManager(), moduleList);
+					executeSchedulingPlan(decision);
 				}
-				SubTaskFilter filter = new SubTaskFilter(task.getGridletID(), GssimTags.TASK_REQUESTED_TIME_EXPIRED);
-				scheduler.sim_cancel(filter, null);
-				super.sendFinishJob((Executable) task.getGridlet());*/
-			}
+			}
+
+			Job job = jobRegistry.getJob(execTask.getJobId());
+			if(!job.isFinished()){
+				getWorkloadUnitHandler().handleJob(job);
+			}
+			break;
+			
+		case DCWormsTags.TASK_REQUESTED_TIME_EXPIRED:
+			obj = ev.get_data();
+			execTask = (Executable) obj;
 			if (pluginSupportsEvent(tag)) {
-				SchedulingEvent event = new TaskFinishedEvent(task.getJobId(), task.getId());
-				SchedulingPlanInterface decision = schedulingPlugin.schedule(event,
+				SchedulingEvent event = new TaskRequestedTimeExpiredEvent(execTask.getJobId(), execTask.getId());
+				SchedulingPlanInterface<?> decision = schedulingPlugin.schedule(event,
 						queues, getJobRegistry(), getResourceManager(), moduleList);
 				executeSchedulingPlan(decision);
 			}
-			Job job = jobRegistry.get(task.getJobId());
-			if(!job.isFinished()){
-				getWorkloadUnitHandler().handleJob(job);
-			}
-
 			break;
-		case WormsTags.TASK_REQUESTED_TIME_EXPIRED:
-			obj = ev.get_data();
-			task = (SubmittedTask) obj;
-			if (pluginSupportsEvent(tag)) {
-				SchedulingEvent event = new TaskRequestedTimeExpiredEvent(task.getJobId(), task.getId());
-				SchedulingPlanInterface decision = schedulingPlugin.schedule(event,
-						queues, getJobRegistry(), getResourceManager(), moduleList);
-				executeSchedulingPlan(decision);
-			}
-
-			break;
-		case WormsTags.UPDATE:
+			
+		case DCWormsTags.UPDATE:
 			updateProcessingTimes(ev);
 			break;
 		}
 	}
-	
-
-	public void notifyReturnedWorkloadUnit(WorkloadUnit<?> wu) {
-		if (pluginSupportsEvent(WormsTags.TASK_EXECUTION_FINISHED)) {
+
+	public void notifyReturnedWorkloadUnit(WorkloadUnit wu) {
+		if (pluginSupportsEvent(DCWormsTags.TASK_EXECUTION_FINISHED)) {
 			SchedulingEvent event = new SchedulingEvent(SchedulingEventType.TASK_FINISHED);
-			SchedulingPlanInterface decision =  schedulingPlugin.schedule(event,
+			SchedulingPlanInterface<?> decision =  schedulingPlugin.schedule(event,
 					queues, getJobRegistry(), getResourceManager(), moduleList);
 			executeSchedulingPlan(decision);
@@ -203,117 +181,47 @@
 		//}
 	}
-
-	public void notifyCanceledWorkloadUnit(WorkloadUnit<?> job) {
-
-		if (!pluginSupportsEvent(GridSimTags.GRIDLET_CANCEL))
-			return;
-
-		Executable executable = (Executable) job;
-		String jobID = executable.getJobId();
-
-		SchedulingPlanInterface decision = null;
-
-		try {
-			executable.setStatus((int) BrokerConstants.JOB_STATUS_CANCELED);
-
-			TaskCanceledEvent event = new TaskCanceledEvent(executable.getJobId(), executable.getTaskId());
-			event.setReason(EventReason.RESERVATION_EXCEEDED);
-			decision = schedulingPlugin
-					.schedule(event, queues, getJobRegistry(), getResourceManager(), moduleList);
-
-			if (decision == null)
-				return;
-
-			executeSchedulingPlan(decision);
-
-		} catch (Exception e) {
-			log.error("Exception during scheduling. " + e.getMessage());
-			e.printStackTrace();
-		}
-	}
-	
-	protected void executeSchedulingPlan(SchedulingPlanInterface decision) {
-
-		ArrayList<ScheduledTaskInterface> taskSchedulingDecisions = decision.getTasks();
+	
+	protected void executeSchedulingPlan(SchedulingPlanInterface<?> decision) {
+
+		ArrayList<ScheduledTaskInterface<?>> taskSchedulingDecisions = decision.getTasks();
 		for (int i = 0; i < taskSchedulingDecisions.size(); i++) {
-			try {
-				ScheduledTaskInterface taskDecision = taskSchedulingDecisions.get(i);
-
-				// not scheduled again are returned to the user.
-				if (taskDecision.getStatus() == AllocationStatus.REJECTED) {
-					continue;
+			ScheduledTaskInterface<?> taskDecision = taskSchedulingDecisions.get(i);
+
+			if (taskDecision.getStatus() == AllocationStatus.REJECTED) {
+				continue;
+			}
+
+			ArrayList<AllocationInterface<?>> allocations = taskDecision.getAllocations();
+
+			TaskInterface<?> task = taskDecision.getTask();
+			for (int j = 0; j < allocations.size(); j++) {
+
+				AllocationInterface<?> allocation = allocations.get(j);
+				if (allocation.isProcessing()) {
+					ExecTask exec = (ExecTask) task;					
+					executeTask(exec, allocation.getRequestedResources());
+				} else if(resourceManager.getSchedulerName(allocation.getProviderName()) != null){
+					allocation.setProviderName(resourceManager.getSchedulerName(allocation.getProviderName()));
+					submitTask(task, allocation);
+				} else {
+					ExecTask exec = (ExecTask) task;
+					executeTask(exec, chooseResourcesForExecution(allocation.getProviderName(), exec));
 				}
-
-				ArrayList<AllocationInterface> allocations = taskDecision.getAllocations();
-
-				WorkloadUnit<?> task = taskDecision.getTask();
-				for (int j = 0; j < allocations.size(); j++) {
-
-					AllocationInterface allocation = allocations.get(j);
-					if (allocation.isProcessing()) {
-						
-						ExecTask exec = (ExecTask) task;
-						
-
-						//Executable e = (Executable)task;
-						/*SubmittedTask submittedTask = jobRegistry.getSubmittedTask(e.getJobId(), e.getId());
-						if(submittedTask == null)
-						{	submittedTask = new SubmittedTask(e);
-							jobRegistry.addTask(submittedTask);
-						}*/
-
-						/*e.visitResource(scheduler.get_name());
-						Scheduler parentScheduler = scheduler.getParent();
-						while (parentScheduler != null && !e.getVisitedResources().contains(parentScheduler.get_name())) {
-							e.visitResource(parentScheduler.get_name());
-							parentScheduler = parentScheduler.getParent();
-						}*/
-						
-												
-						executeTask(exec, allocation.getRequestedResources());
-					//} else if(GridSim.getEntityId(allocation.getProviderName()) != -1 || scheduler.getScheduler(allocation.getProviderName())!=null){
-					} else if(resourceManager.getSchedulerName(allocation.getProviderName()) != null){
-						allocation.setProviderName(resourceManager.getSchedulerName(allocation.getProviderName()));
-						submitWorkloadUnit(task, allocation);
-					} else {
-
-						ExecTask exec = (ExecTask) task;
-						
-							//Executable exec = jobRegistry.createExecutable(t, allocation);
-							//exec.setResourceParameter(scheduler.get_id(), 1);
-						/*e.visitResource(scheduler.get_name());
-						Scheduler parentScheduler = scheduler.getParent();
-						while (parentScheduler != null && !e.getVisitedResources().contains(parentScheduler.get_name())) {
-							e.visitResource(parentScheduler.get_name());
-							parentScheduler = parentScheduler.getParent();
-						}*/
-						executeTask(exec, chooseResourcesForExecution(allocation.getProviderName(), (ExecTask)task));
-					}
-				}
-
-			} catch (Exception e) {
-				e.printStackTrace();
-			}
+			}
+
 		}
 	}
 
 	protected void executeTask(ExecTask task, Map<ResourceUnitName, ResourceUnit> choosenResources) {
-	//	Executable exec = (Executable) task;
-	
-		SubmittedTask submittedTask = (SubmittedTask)task;
+
+		Executable exec = (Executable)task;
 		boolean allocationStatus = getAllocationManager().allocateResources(choosenResources);
 		if(allocationStatus == false)
 			return;
 		removeFromQueue(task);
-		//SubmittedTask submittedTask = (SubmittedTask)task;
-		/* submittedTask = jobRegistry.getSubmittedTask(exec.getJobId(), exec.getId());
-		if(submittedTask == null)
-		{	submittedTask = new SubmittedTask(exec);
-			jobRegistry.addTask(submittedTask);
-		}*/
-		double completionPercentage = (submittedTask.getLength() - submittedTask.getRemainingGridletLength())/submittedTask.getLength();
+
 		SchedulingEvent event = new SchedulingEvent(SchedulingEventType.START_TASK_EXECUTION);
 		int time = Double.valueOf(
-				execTimeEstimationPlugin.execTimeEstimation(event, choosenResources, task, completionPercentage)).intValue();
+				execTimeEstimationPlugin.execTimeEstimation(event, task, choosenResources, exec.getCompletionPercentage())).intValue();
 		log.debug(task.getJobId() + "_" + task.getId() + " starts executing on " + new DateTime()
 				+ " will finish after " + time);
@@ -322,31 +230,34 @@
 			return;
 
-		submittedTask.setEstimatedDuration(time);
+		exec.setEstimatedDuration(time);
 		DateTime currentTime = new DateTime();
 		ResourceHistoryItem resHistItem = new ResourceHistoryItem(choosenResources, currentTime);
-		submittedTask.addUsedResources(resHistItem);
-		submittedTask.setFinishTime(currentTime.getMillis() / 1000);
-		
-		jobRegistry.saveHistory(submittedTask, time, choosenResources);
-		
-		scheduler.sendInternal(time, WormsTags.TASK_EXECUTION_FINISHED,
-				submittedTask);
-
+		exec.addUsedResources(resHistItem);
 		try {
-			long expectedDuration = submittedTask.getExpectedDuration().getMillis() / 1000;
-			scheduler.sendInternal(expectedDuration, WormsTags.TASK_REQUESTED_TIME_EXPIRED, submittedTask);
+			exec.setStatus(DCWormsTags.INEXEC);
+		} catch (Exception e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+		scheduler.sendInternal(time, DCWormsTags.TASK_EXECUTION_FINISHED, exec);
+
+		try {
+			long expectedDuration = exec.getExpectedDuration().getMillis() / 1000;
+			scheduler.sendInternal(expectedDuration, DCWormsTags.TASK_REQUESTED_TIME_EXPIRED, exec);
 		} catch (NoSuchFieldException e) {
-			double t = submittedTask.getEstimatedDuration();
-			scheduler.sendInternal(t, WormsTags.TASK_REQUESTED_TIME_EXPIRED, submittedTask);
-		}
-		
-		submittedTask.setGridletStatus(Gridlet.INEXEC);
-		log.info(WormsConstants.USAGE_MEASURE_NAME + ": " + calculateTotalLoad(jobRegistry.getRunningTasks().size()));
+			double t = exec.getEstimatedDuration();
+			scheduler.sendInternal(t, DCWormsTags.TASK_REQUESTED_TIME_EXPIRED, exec);
+		}
+
+		log.info(DCWormsConstants.USAGE_MEASURE_NAME + ": " + calculateTotalLoad(jobRegistry.getRunningTasks().size()));
 		
 		PEUnit peUnit = (PEUnit)choosenResources.get(StandardResourceUnitName.PE);
-		if(peUnit instanceof ProcessingElements){
+		
+		notifyComputingResources(peUnit, EnergyEventType.TASK_STARTED, exec);
+		
+		/*if(peUnit instanceof ProcessingElements){
 			ProcessingElements pes = (ProcessingElements) peUnit;
 			for (ComputingResource resource : pes) {
-				resource.handleEvent(new EnergyEvent(EnergyEventType.TASK_FINISHED, submittedTask));
+				resource.handleEvent(new EnergyEvent(EnergyEventType.TASK_STARTED, exec));
 			}
 		} else {
@@ -355,12 +266,9 @@
 				resource = ResourceController.getComputingResourceByName(peUnit.getResourceId());
 			} catch (ResourceException e) {
-				
-			}
-			resource.handleEvent(new EnergyEvent(EnergyEventType.TASK_FINISHED, submittedTask));
-		}
-		/*ProcessingElements pes = (ProcessingElements) choosenResources.get(StandardResourceUnitName.PE);
-		for (ComputingResource resource : pes) {
-			resource.handleEvent(new EnergyEvent(EnergyEventType.TASK_STARTED, submittedTask));
-		}*/
+				return;
+			}
+			resource.handleEvent(new EnergyEvent(EnergyEventType.TASK_STARTED, exec));
+		}
+*/
 
 		/*for(ExecTaskInterface etask : jobRegistry.getRunningTasks()){
@@ -371,48 +279,22 @@
 	}
 	
-	public void finalizeExecutable(ExecTask exec){
-		
-		SubmittedTask subTask = (SubmittedTask)exec;
-		subTask.setGridletStatus(Gridlet.SUCCESS);
-		subTask.finalizeGridlet();
-		UsedResourceList<ResourceHistoryItem> lastUsedList = subTask.getUsedResources();
-		Map<ResourceUnitName, ResourceUnit> lastUsed = lastUsedList.getLast()
-				.getResourceUnits();
-		getAllocationManager().freeResources(lastUsed);
-		
-		PEUnit peUnit = (PEUnit)lastUsed.get(StandardResourceUnitName.PE);
-		if(peUnit instanceof ProcessingElements){
-			ProcessingElements pes = (ProcessingElements) peUnit;
-			for (ComputingResource resource : pes) {
-				resource.handleEvent(new EnergyEvent(EnergyEventType.TASK_FINISHED, subTask));
-			}
-		} else {
-			ComputingResource resource = null;
-			try {
-				resource = ResourceController.getComputingResourceByName(peUnit.getResourceId());
-			} catch (ResourceException e) {
-				
-			}
-			resource.handleEvent(new EnergyEvent(EnergyEventType.TASK_FINISHED, subTask));
-		}
-		/*ProcessingElements pes = (ProcessingElements) lastUsed.get(StandardResourceUnitName.PE);
-		for (ComputingResource resource : pes) {
-			resource.handleEvent(new EnergyEvent(EnergyEventType.TASK_FINISHED, subTask));
-		}*/
-		SubTaskFilter filter = new SubTaskFilter(subTask.getGridletID(), WormsTags.TASK_REQUESTED_TIME_EXPIRED);
+	public void finalizeExecutable(ExecTask execTask){
+		
+		Executable exec = (Executable)execTask;
+		exec.finalizeExecutable();
+		
+		ExecTaskFilter filter = new ExecTaskFilter(exec.getUniqueId(), DCWormsTags.TASK_REQUESTED_TIME_EXPIRED);
 		scheduler.sim_cancel(filter, null);
 		
-		Executable executable = (Executable) subTask.getGridlet();
-		Job job = jobRegistry.get(executable.getJobId());
-
-		Task task = null;
+		Task task;
+		Job job = jobRegistry.getJob(exec.getJobId());
 		try {
-			task = job.getTask(executable.getTaskId());
+			task = job.getTask(exec.getTaskId());
 		} catch (NoSuchFieldException e) {
-			e.printStackTrace();
-		}
-		if(executable.getProcessesId() == null){
-			try {
-				task.setStatus(executable.getStatus());
+			return;
+		}
+		if(exec.getProcessesId() == null){
+			try {
+				task.setStatus(exec.getStatus());
 			} catch (Exception e) {
 				e.printStackTrace();
@@ -422,10 +304,33 @@
 			for(int i = 0; i < processesList.size(); i++){
 				AbstractProcesses processes = processesList.get(i);
-				if(processes.getId().equals(executable.getProcessesId())){
-					processes.setStatus(executable.getStatus());
+				if(processes.getId().equals(exec.getProcessesId())){
+					processes.setStatus(exec.getStatus());
 					break;
 				}
 			}
 		}
+		
+		UsedResourcesList lastUsedList = exec.getUsedResources();
+		Map<ResourceUnitName, ResourceUnit> lastUsed = lastUsedList.getLast()
+				.getResourceUnits();
+		getAllocationManager().freeResources(lastUsed);
+		
+		PEUnit peUnit = (PEUnit)lastUsed.get(StandardResourceUnitName.PE);
+		notifyComputingResources(peUnit, EnergyEventType.TASK_FINISHED, exec);
+		/*if(peUnit instanceof ProcessingElements){
+			ProcessingElements pes = (ProcessingElements) peUnit;
+			for (ComputingResource resource : pes) {
+				resource.handleEvent(new EnergyEvent(EnergyEventType.TASK_FINISHED, exec));
+			}
+		} else {
+			ComputingResource resource = null;
+			try {
+				resource = ResourceController.getComputingResourceByName(peUnit.getResourceId());
+			} catch (ResourceException e) {
+				return;
+			}
+			resource.handleEvent(new EnergyEvent(EnergyEventType.TASK_FINISHED, exec));
+		}*/
+
 		//sendFinishedWorkloadUnit(executable);
 	}
@@ -441,15 +346,32 @@
 		while (iter.hasNext()) {
 			ExecTask task = iter.next();
-			SubmittedTask subTask = (SubmittedTask)task;
-			UsedResourceList<ResourceHistoryItem> usedResourcesList = subTask.getUsedResources();
-			ResourceUnit unit = usedResourcesList.getLast().getResourceUnits()
+			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) unit);
-			subTask.updateGridletFinishedSoFar(load);
+			double load = getMIShare(timeSpan, peUnit);
 			addTotalLoad(load);
 		}
 	}
-
+	private void notifyComputingResources(PEUnit peUnit, EnergyEventType eventType, Object obj){
+
+		if(peUnit instanceof ProcessingElements){
+			ProcessingElements pes = (ProcessingElements) peUnit;
+			for (ComputingResource resource : pes) {
+				resource.handleEvent(new EnergyEvent(eventType, obj));
+			}
+		} else {
+			ComputingResource resource = null;
+			try {
+				resource = ResourceController.getComputingResourceByName(peUnit.getResourceId());
+			} catch (ResourceException e) {
+				return;
+			}
+			resource.handleEvent(new EnergyEvent(eventType, obj));
+		}
+	}
+	
 	private double getMIShare(double timeSpan, PEUnit pes) {
 		double localLoad;
@@ -470,7 +392,7 @@
 	protected void updateProcessingTimes(Sim_event ev) {
 		updateProcessingProgress();
-		for (ExecTask task : jobRegistry.getRunningTasks()) {
-			SubmittedTask subTask = (SubmittedTask)task;
-			List<String> visitedResource = subTask.getVisitedResources();
+		for (ExecTask execTask : jobRegistry.getRunningTasks()) {
+			Executable exec = (Executable)execTask;
+			List<String> visitedResource = exec.getVisitedResources();
 			String originResource = ev.get_data().toString();
 			if(!ArrayUtils.contains(visitedResource.toArray(new String[visitedResource.size()]), originResource)){
@@ -478,20 +400,16 @@
 			}
 			
-			Map<ResourceUnitName, ResourceUnit> choosenResources = subTask.getUsedResources().getLast().getResourceUnits();
-			double completionPercentage = (task.getLength() - subTask.getRemainingGridletLength())/task.getLength();
-			double time = execTimeEstimationPlugin.execTimeEstimation(new SchedulingEvent(SchedulingEventType.RESOURCE_STATE_CHANGED), 
-					choosenResources, task, completionPercentage);
-
-			/*if(!subTask.getVisitedResources().contains(ev.get_data().toString())) {
+			Map<ResourceUnitName, ResourceUnit> choosenResources = exec.getUsedResources().getLast().getResourceUnits();
+			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
+			if( DoubleMath.subtract((exec.getExecStartTime() + exec.getEstimatedDuration()), (new DateTime().getMillis()/1000 + time)) == 0.0){
 				continue;
-			}*/
-			//check if the new estimated end time is equal to the previous one; if yes the continue without update
-			if( DoubleMath.subtract((subTask.getExecStartTime() + subTask.getEstimatedDuration()), (new DateTime().getMillis()/1000 + time)) == 0.0){
-				continue;
-			}
-			SubTaskFilter filter = new SubTaskFilter(subTask.getGridletID(), WormsTags.TASK_EXECUTION_FINISHED);
+			}
+			exec.setEstimatedDuration(time);
+			ExecTaskFilter filter = new ExecTaskFilter(exec.getUniqueId(), DCWormsTags.TASK_EXECUTION_FINISHED);
 			scheduler.sim_cancel(filter, null);
-			scheduler.sendInternal(time, WormsTags.TASK_EXECUTION_FINISHED, task);
-
+			scheduler.sendInternal(time, DCWormsTags.TASK_EXECUTION_FINISHED, execTask);
 		}
 	}	
@@ -511,5 +429,4 @@
 				numberOfPE = numberOfPE + resUnit.getAmount();
 			}
-			//numberOfPE = getResourceManager().getPE().size();
 		} catch (Exception e) {
 			numberOfPE = 1;
@@ -532,5 +449,6 @@
 			ExecTask task) {
 
-		ResourceManager resourceManager = this.resourceManager;
+		Map<ResourceUnitName, ResourceUnit> map = new HashMap<ResourceUnitName, ResourceUnit>();
+		LocalResourceManager resourceManager = getResourceManager();
 		if(resourceName != null){
 			ComputingResource resource = null;
@@ -540,9 +458,6 @@
 				return null;
 			}
-
 			resourceManager = new LocalResourceManager(resource);
 		}
-		Map<ResourceUnitName, ResourceUnit> map = new HashMap<ResourceUnitName, ResourceUnit>();
-
 
 		int cpuRequest;
@@ -553,15 +468,14 @@
 		}
 
-		//PEUnit processingUnits = null;
 		if (cpuRequest != 0) {
 			
 			List<ResourceUnit> availableUnits = null;
 			try {
-				availableUnits = getResourceManager().getPE();
+				availableUnits = resourceManager.getPE();
 			} catch (ResourceException e) {
 				return null;
 			}
+			
 			List<ResourceUnit> choosenPEUnits = new ArrayList<ResourceUnit>();
-
 			for (int i = 0; i < availableUnits.size() && cpuRequest > 0; i++) {
 				PEUnit peUnit = (PEUnit) availableUnits .get(i);
@@ -576,67 +490,16 @@
 				return null;
 			}
-
-			/*try {
-				List<? extends ComputingResource> processingElements = resourceManager.getResourcesOfType(StandardResourceType.Processor);
-				List<ComputingResource> choosenResources = new ArrayList<ComputingResource>();
-				int peSize = processingElements.size();
-				for (int i = 0; i < peSize && cpuRequest > 0; i++) {
-					if (processingElements.get(i).getStatus() == ResourceStatus.FREE) {
-						choosenResources.add(processingElements.get(i));
-						cpuRequest--;
-					}
-				}
-				if (cpuRequest > 0)
-				{	
-					return null;
-				}
-				processingUnits = new ProcessingElements(choosenResources);
-			} catch (Exception e) {
-	
-				List<ResourceUnit> procResUnit = resourceManager.getDistributedResourceUnits(StandardResourceUnitName.PE);
-
-				for(ResourceUnit resUnit: procResUnit){
-					if (resUnit.getFreeAmount() >= cpuRequest)
-					{	
-						processingUnits = new PEUnit(resUnit.getResourceId(), cpuRequest, cpuRequest);
-						break;
-					} 
-				}
-			}*/
 			map.put(StandardResourceUnitName.PE, choosenPEUnits.get(0));
 		}
-		/*int memoryRequest;
-		try {
-			memoryRequest = Double.valueOf(task.getMemoryRequest()).intValue();
-		} catch (NoSuchFieldException e) {
-			memoryRequest = 0;
-		}
-		if (memoryRequest != 0) {
-			List<ResourceUnit> resUnit = resourceManager.getSharedResourceUnits().get(StandardResourceUnitName.MEMORY);
-
-			Memory memory = null;
-			for (ResourceUnit memUnit : resUnit) {
-				Memory m = (Memory) memUnit;
-
-				if (m.getFreeAmount() >= memoryRequest) {	
-					System.out.println(m.getResourceId()+ ";"+m.getAmount()+";"+m.getFreeAmount());
-					memory = new Memory(m, memoryRequest, memoryRequest);
-				}
-			}
-			if(memory == null)
-				return null;
-			map.put(StandardResourceUnitName.MEMORY, memory);
-		}*/
+
 		return  map;
 	}
-
-
-	
-	public void notifySubmittedWorkloadUnit(WorkloadUnit<?> job, boolean ack) {
+	
+	public void notifySubmittedWorkloadUnit(WorkloadUnit wu, boolean ack) {
 		updateProcessingProgress();
-		registerWorkloadUnit(job);
-	}
-
-	private void registerWorkloadUnit(WorkloadUnit<?> wu){
+		registerWorkloadUnit(wu);
+	}
+
+	private void registerWorkloadUnit(WorkloadUnit wu){
 		if(!wu.isRegistered()){
 			wu.register(jobRegistry);
@@ -647,5 +510,5 @@
 	class LocalWorkloadUnitHandler implements WorkloadUnitHandler{
 		
-		public void handleJob(Job job){
+		public void handleJob(JobInterface<?> job){
 
 			if (log.isInfoEnabled())
@@ -654,30 +517,26 @@
 			List<JobInterface<?>> jobsList = new ArrayList<JobInterface<?>>();
 			jobsList.add(job);
-			WorkloadUnitListImpl readyTasks = new WorkloadUnitListImpl();
-			for(Task task: jobRegistry.getReadyTasks(jobsList)){
+			TaskListImpl availableTasks = new TaskListImpl();
+			for(Task task: jobRegistry.getAvailableTasks(jobsList)){
 				task.setStatus((int)BrokerConstants.TASK_STATUS_QUEUED);
-				readyTasks.add(task);
-			}
-
-			for(WorkloadUnit<?> e:readyTasks){	
-				registerWorkloadUnit(e);
-			}
-		}
-		
-		public void handleTask(TaskInterface<?> ti){
-			Task task = (Task)ti;
-			
-			if(task.getProcesses() == null){
+				availableTasks.add(task);
+			}
+
+			for(TaskInterface<?> task: availableTasks){	
+				registerWorkloadUnit(task);
+			}
+		}
+		
+		public void handleTask(TaskInterface<?> t){
+			Task task = (Task)t;
+			List<AbstractProcesses> processes = task.getProcesses();
+
+			if(processes == null || processes.size() == 0){
 				Executable exec = new Executable(task);
-				exec.setUserID(task.getSenderId());
-				exec.setLength(task.getLength());
 				registerWorkloadUnit(exec);
 			} else {
-				List<AbstractProcesses> processesList = task.getProcesses();
-				for(int i = 0; i < processesList.size(); i++){	
-					AbstractProcesses processes = processesList.get(i);
-					Executable exec = new Executable(task, processes);
-					exec.setUserID(task.getSenderId());
-					exec.setLength(task.getLength());
+				for(int j = 0; j < processes.size(); j++){
+					AbstractProcesses procesesSet = processes.get(j);
+					Executable exec = new Executable(task, procesesSet);
 					registerWorkloadUnit(exec);
 				}
@@ -686,49 +545,25 @@
 		
 		public void handleExecutable(ExecTask task){
+			
 			Executable exec = (Executable) task;
-
-			// int cost =
-			// this.resourceManager.getResourceCharacteristic().getResUnits() !=
-			// null ?
-			// this.resourceManager.getResourceCharacteristic().getResUnits().get(ResourceParameterName.COST).getAmount()
-			// : 1;
-
-			exec.visitResource(scheduler.get_name());
+			jobRegistry.addExecTask(exec);
+			
+			exec.trackResource(scheduler.get_name());
 			Scheduler parentScheduler = scheduler.getParent();
-			while (parentScheduler != null && !exec.getVisitedResources().contains(parentScheduler.get_name())) {
-				exec.visitResource(parentScheduler.get_name());
+			List<String> visitedResource = exec.getVisitedResources();
+			String [] visitedResourcesArray = visitedResource.toArray(new String[visitedResource.size()]);
+			while (parentScheduler != null && !ArrayUtils.contains(visitedResourcesArray, parentScheduler.get_name())) {
+				exec.trackResource(parentScheduler.get_name());
 				parentScheduler = parentScheduler.getParent();
 			}
-			
-			exec.setResourceParameter(scheduler.get_id(), 1);
-			SubmittedTask subTask = new SubmittedTask(exec);
-			jobRegistry.addTask(subTask);
-			WorkloadUnitListImpl newTasks = new WorkloadUnitListImpl();
-			newTasks.add(subTask);
-		
-			schedulingPlugin.placeJobsInQueues(newTasks, queues, getResourceManager(), moduleList);
-
-			if (subTask.getStatus() == Gridlet.QUEUED) {
+			exec.setSchedulerName(scheduler.get_id());
+			
+			TaskList newTasks = new TaskListImpl();
+			newTasks.add(exec);
+		
+			schedulingPlugin.placeTasksInQueues(newTasks, queues, getResourceManager(), moduleList);
+
+			if (exec.getStatus() == DCWormsTags.QUEUED) {
 				sendExecutableReadyEvent(exec);
-			}
-		}
-		
-		public void handleSubmittedTask(SubmittedTask task){
-
-			task.visitResource(scheduler.get_name());
-			Scheduler parentScheduler = scheduler.getParent();
-			while (parentScheduler != null && !task.getVisitedResources().contains(parentScheduler.get_name())) {
-				task.visitResource(parentScheduler.get_name());
-				parentScheduler = parentScheduler.getParent();
-			}
-
-			jobRegistry.addTask(task);
-			WorkloadUnitListImpl newTasks = new WorkloadUnitListImpl();
-			newTasks.add(task);
-		
-			schedulingPlugin.placeJobsInQueues(newTasks, queues, getResourceManager(), moduleList);
-
-			if (task.getStatus() == Gridlet.QUEUED) {
-				sendExecutableReadyEvent(task);
 			}
 		}
Index: /DCWoRMS/trunk/build/classes/schedframe/scheduling/policy/global/GlobalManagementSystem.java
===================================================================
--- /DCWoRMS/trunk/build/classes/schedframe/scheduling/policy/global/GlobalManagementSystem.java	(revision 477)
+++ /DCWoRMS/trunk/build/classes/schedframe/scheduling/policy/global/GlobalManagementSystem.java	(revision 539)
@@ -11,14 +11,12 @@
 import org.qcg.broker.schemas.schedulingplan.types.AllocationStatus;
 
+import dcworms.schedframe.scheduling.ExecTask;
+import dcworms.schedframe.scheduling.Executable;
+
 import qcg.shared.constants.BrokerConstants;
-
-import schedframe.events.scheduling.EventReason;
-import schedframe.events.scheduling.SchedulingEvent;
 import schedframe.events.scheduling.TaskArrivedEvent;
-import schedframe.events.scheduling.TaskCanceledEvent;
 import schedframe.events.scheduling.TimerEvent;
-import schedframe.scheduling.Scheduler;
+import schedframe.scheduling.TaskListImpl;
 import schedframe.scheduling.WorkloadUnitHandler;
-import schedframe.scheduling.WorkloadUnitListImpl;
 import schedframe.scheduling.plan.AllocationInterface;
 import schedframe.scheduling.plan.ScheduledTaskInterface;
@@ -31,17 +29,12 @@
 import schedframe.scheduling.tasks.Job;
 import schedframe.scheduling.tasks.JobInterface;
-import schedframe.scheduling.tasks.SubmittedTask;
 import schedframe.scheduling.tasks.Task;
 import schedframe.scheduling.tasks.TaskInterface;
 import schedframe.scheduling.tasks.WorkloadUnit;
-
 import eduni.simjava.Sim_event;
 import gridsim.GridSim;
 import gridsim.GridSimTags;
-import gridsim.Gridlet;
 import gridsim.IO_data;
-import gridsim.gssim.WormsTags;
-import gssim.schedframe.scheduling.ExecTask;
-import gssim.schedframe.scheduling.Executable;
+import gridsim.dcworms.DCWormsTags;
 
 public class GlobalManagementSystem extends AbstractManagementSystem {
@@ -54,7 +47,4 @@
 		super(providerId, entityName,  execTimeEstimationPlugin, queues);
 
-		/*schedulingPlugin = (GlobalSchedulingPlugin) InstanceFactory.createInstance(
-				schedulingPluginClassName,
-				GlobalSchedulingPlugin.class);*/
 		if(schedPlugin == null){
 			throw new Exception("Can not create global scheduling plugin instance");
@@ -69,8 +59,8 @@
 		switch (tag) {
 
-		case WormsTags.TIMER:
-			if (pluginSupportsEvent(WormsTags.TIMER)) {
+		case DCWormsTags.TIMER:
+			if (pluginSupportsEvent(DCWormsTags.TIMER)) {
 				TimerEvent event = new  TimerEvent();
-				SchedulingPlanInterface decision =  schedulingPlugin.schedule(event, 
+				SchedulingPlanInterface<?> decision =  schedulingPlugin.schedule(event, 
 						queues,  getJobRegistry(), getResourceManager(), moduleList);
 				executeSchedulingPlan(decision);
@@ -81,5 +71,5 @@
 	}
 	
-	public void notifySubmittedWorkloadUnit(WorkloadUnit<?> wu, boolean ack) {
+	public void notifySubmittedWorkloadUnit(WorkloadUnit wu, boolean ack) {
 		if (!pluginSupportsEvent(GridSimTags.GRIDLET_SUBMIT)) {
 			log.error("Plugin " + schedulingPlugin.getClass()
@@ -90,54 +80,29 @@
 		
 		registerWorkloadUnit(wu);
-		/*Job job = (Job) wu;
-		jobRegistry.addJob(job);
-
-		if (log.isInfoEnabled())
-			log.info("Received job " + job.getId() + " at " + new DateTime(DateTimeUtilsExt.currentTimeMillis()));
-
+
+	}
+	
+	private void registerWorkloadUnit(WorkloadUnit wu){
+		if(!wu.isRegistered()){
+			wu.register(jobRegistry);
+		}
+		wu.accept(getWorkloadUnitHandler());
+	}
+	
+
+	protected void schedule(JobInterface<?> job){
 		List<JobInterface<?>> jobsList = new ArrayList<JobInterface<?>>();
 		jobsList.add(job);
-		WorkloadUnitList readyWorkloadUnits = new WorkloadUnitList();
-		readyWorkloadUnits.addAll(jobRegistry.getReadyTasks(jobsList));
-		schedulingPlugin.placeJobsInQueues(readyWorkloadUnits, queues, getResourceManager(), moduleList);
-
-		schedule(new TaskArrivedEvent());*/
-
-	}
-	
-	private void registerWorkloadUnit(WorkloadUnit<?> wu){
-		if(!wu.isRegistered()){
-			wu.register(jobRegistry);
-		}
-		wu.accept(getWorkloadUnitHandler());
-	}
-	
-
-	protected void scheduleReadyTasks(Job job){
-		List<JobInterface<?>> jobsList = new ArrayList<JobInterface<?>>();
-		jobsList.add(job);
-		WorkloadUnitListImpl readyWorkloadUnits = new WorkloadUnitListImpl();
-		readyWorkloadUnits.addAll(jobRegistry.getReadyTasks(jobsList));
-		schedulingPlugin.placeJobsInQueues(readyWorkloadUnits, queues, getResourceManager(), moduleList);
-
-		schedule(new TaskArrivedEvent());
-	}
-	
-	protected void schedule(SchedulingEvent schedulingEvent) {
-
-		try {
-			SchedulingPlanInterface decision = schedulingPlugin.schedule(
-					schedulingEvent, queues, getJobRegistry(),  getResourceManager(), moduleList);
-			if (decision == null)
-				return;
-
+		TaskListImpl readyTasks = new TaskListImpl();
+		readyTasks.addAll(jobRegistry.getAvailableTasks(jobsList));
+		
+		schedulingPlugin.placeTasksInQueues(readyTasks, queues, getResourceManager(), moduleList);
+		SchedulingPlanInterface<?> decision = schedulingPlugin.schedule(
+				new TaskArrivedEvent(), queues, getJobRegistry(),  getResourceManager(), moduleList);
+		if (decision != null)
 			executeSchedulingPlan(decision);
-
-		} catch (Exception e) {
-			e.printStackTrace();
-		}
-	}
-	
-	public void notifyReturnedWorkloadUnit(WorkloadUnit<?> wu) {
+	}
+
+	public void notifyReturnedWorkloadUnit(WorkloadUnit wu) {
 		Executable exec = (Executable) wu;
 
@@ -149,12 +114,11 @@
 		
 		try {
-			Job job = jobRegistry.get(exec.getJobId());
-			/*Task task = job.getTask(exec.getTaskId());
+			Job job = jobRegistry.getJob(exec.getJobId());
+			Task task = job.getTask(exec.getTaskId());
 			if(exec.getProcessesId() == null){
 				try {
 					task.setStatus(exec.getStatus());
 				} catch (Exception e) {
-					// TODO Auto-generated catch block
-					e.printStackTrace();
+
 				}
 			} else {
@@ -167,5 +131,5 @@
 					}
 				}
-			}*/
+			}
 			
 			if(job.isFinished()){
@@ -173,12 +137,5 @@
 			}
 			else {
-				scheduleReadyTasks(job);
-				/*List<JobInterface<?>> jobs = new ArrayList<JobInterface<?>>();
-				jobs.add(jobRegistry.getJobInfo(job.getId()));
-				WorkloadUnitList readyWorkloadUnits = new WorkloadUnitList();
-				readyWorkloadUnits.addAll(jobRegistry.getReadyTasks(jobs));
-				schedulingPlugin.placeJobsInQueues(readyWorkloadUnits, queues,
-						getResourceManager(), moduleList);
-				schedule(new TaskArrivedEvent());*/
+				schedule(job);
 			}
 			
@@ -189,67 +146,91 @@
 	}
 
-	public void notifyCanceledWorkloadUnit(WorkloadUnit<?> wu){;
-
-		Executable task = (Executable) wu;
-		String jobID = task.getJobId();
-		String taskID = task.getId();
-		
-		if(log.isDebugEnabled())
-			log.debug("Received canceled job" + jobID + "_" + taskID);
-		
-		TaskInterface<?> ti = jobRegistry.getTaskInfo(jobID, taskID) ;
-		try {
-
-			ti.setStatus((int)BrokerConstants.JOB_STATUS_CANCELED);
-			
-			TaskCanceledEvent event = new TaskCanceledEvent(jobID, taskID);
-			event.setReason(EventReason.RESERVATION_EXCEEDED);
-			schedule(event);
-			
-		} catch (Exception e) {
-			log.error("Exception during scheduling. " + e.getMessage());
-			e.printStackTrace();
-		}
-	}
-	
-	protected void executeSchedulingPlan(SchedulingPlanInterface decision) {
-
-		ArrayList<ScheduledTaskInterface> taskSchedulingDecisions = decision.getTasks();
+	protected void executeSchedulingPlan(SchedulingPlanInterface<?> decision) {
+
+		ArrayList<ScheduledTaskInterface<?>> taskSchedulingDecisions = decision.getTasks();
 		for (int i = 0; i < taskSchedulingDecisions.size(); i++) {
 
-			try {
-				ScheduledTaskInterface taskDecision = taskSchedulingDecisions.get(i);
-	
-				//log.info(decision.getDocument());
-	
-				String jobID = taskDecision.getJobId();
-				String taskID = taskDecision.getTaskId();
-				
-				// Task allocations that were rejected because of lack of resources or which were canceled and 
-				// not scheduled again are returned to the user.
-				if(taskDecision.getStatus() == AllocationStatus.REJECTED){
-					Job job = jobRegistry.get(jobID);
-					scheduler.send(job.getSenderId(), GridSimTags.SCHEDULE_NOW, GridSimTags.GRIDLET_RETURN, job);
-					continue;
-				}
-				
-				ArrayList<AllocationInterface> allocations = taskDecision.getAllocations();
-
-				Task task = (Task) jobRegistry.getTaskInfo(jobID, taskID);
-				for (int j = 0; j < allocations.size(); j++) {
-
-					AllocationInterface allocation = allocations.get(j);
-					Executable exec = jobRegistry.createExecutable(task, allocation);
-					submitWorkloadUnit(exec, allocation);
-					task.setStatus((int)BrokerConstants.TASK_STATUS_QUEUED);
-				}								
-
-			}catch (Exception e){
-				e.printStackTrace();
-			}
-		}
-	}
-
-	protected void submitWorkloadUnit(WorkloadUnit<?> job, AllocationInterface allocation) {
+			ScheduledTaskInterface<?> taskDecision = taskSchedulingDecisions.get(i);
+
+			//log.info(decision.getDocument());
+
+			String jobID = taskDecision.getJobId();
+			String taskID = taskDecision.getTaskId();
+			
+			// Task allocations that were rejected because of lack of resources or which were canceled and 
+			// not scheduled again are returned to the user.
+			if(taskDecision.getStatus() == AllocationStatus.REJECTED){
+				Job job = jobRegistry.getJob(jobID);
+				scheduler.send(job.getSenderId(), GridSimTags.SCHEDULE_NOW, GridSimTags.GRIDLET_RETURN, job);
+				continue;
+			}
+			
+			Task task = (Task) jobRegistry.getTaskInfo(jobID, taskID);
+			
+			ArrayList<AllocationInterface<?>> allocations = taskDecision.getAllocations();
+			for (int j = 0; j < allocations.size(); j++) {
+
+				AllocationInterface<?> allocation = allocations.get(j);
+				Executable exec = createExecutable(task, allocation);
+				submitTask(exec, allocation);
+				task.setStatus((int)BrokerConstants.TASK_STATUS_QUEUED);
+			}								
+		}
+	}
+
+	private Executable createExecutable(Task task, AllocationInterface<?> allocation) {
+
+		String refersTo = allocation.getProcessGroupId(); // null;//allocation.getRefersTo();
+		if(refersTo == null)
+			refersTo = task.getId();
+			
+		Executable exec = null;
+
+		if(refersTo.equals(task.getId())){
+			exec = new Executable(task);
+		} else {
+			List<AbstractProcesses> processes = task.getProcesses();
+			if(processes == null) {
+				try {
+					log.error("Allocation: " + allocation.getDocument() + "\nrefers to unknown task or processes set." +
+							" Set correct value (task id or prcesses set id) for allocation refersTo attribute.");
+				} catch (Exception e) {
+					e.printStackTrace();
+				}
+			}
+			boolean found = false;
+			for(int j = 0; j < processes.size() && !found; j++){
+				AbstractProcesses procesesSet = processes.get(j);
+				if(refersTo.equals(procesesSet.getId())){
+					exec = new Executable(task, procesesSet);
+					found = true;
+				}
+			}
+			if(!found){
+				log.error("Allocation refers to unknown proceses set.");
+			}
+		}
+
+		exec.setReservationId(allocation.getReservationId());
+			
+		/*HostInterface<?> host = allocation.getHost();
+		ComputingResourceTypeInterface<?> crt = host.getMachineParameters();
+		if(crt != null){
+			ComputingResourceTypeItemInterface<?> crti = crt.getComputingResourceTypeItem(0);
+			if(crti != null){
+				ParameterPropertyInterface<?> properties[] = crti.getHostParameter().getProperty();
+				for(int p = 0; p < properties.length; p++){
+					ParameterPropertyInterface<?> property = properties[p];
+					if("chosenCPUs".equals(property.getName())){
+						Object cpuNames = property.getValue();
+						exec.addSpecificResource(ResourceParameterName.FREECPUS, cpuNames);
+					}
+				}
+			}
+		}*/
+		return exec;
+	}
+	
+	protected void submitTask(TaskInterface<?> task, AllocationInterface<?> allocation) {
 
 		String providerName = allocation.getProviderName();
@@ -257,30 +238,24 @@
 			return;
 		}
-		TaskInterface<?> task = (TaskInterface<?>) job;
 		removeFromQueue(task);
 		
 		int resID = GridSim.getEntityId(providerName);
-		IO_data data = new IO_data(job, 0, resID);
+		IO_data data = new IO_data(task, 0, resID);
 		scheduler.send(scheduler.getOutputPort(), GridSimTags.SCHEDULE_NOW, GridSimTags.GRIDLET_SUBMIT, data);	
-		
-		//scheduler.send(providerName, GridSimTags.SCHEDULE_NOW, GridSimTags.GRIDLET_SUBMIT, job);			
+		//scheduler.send(providerName, GridSimTags.SCHEDULE_NOW, GridSimTags.GRIDLET_SUBMIT, job);	
+		
 		if(log.isDebugEnabled())
-			try {
-				log.debug("Submitted job " + job.getId() + " to " + providerName);
-			} catch (NoSuchFieldException e) {
-				// TODO Auto-generated catch block
-				e.printStackTrace();
-			}
+			log.debug("Submitted job " + task.getId() + " to " + providerName);
+
 	}
 
 	class GlobalWorkloadUnitHandler implements  WorkloadUnitHandler{
 
-		public void handleJob(Job job){
-
-			jobRegistry.addJob(job);
+		public void handleJob(JobInterface<?> job){
 			if (log.isInfoEnabled())
 				log.info("Received job " + job.getId() + " at " + new DateTime(DateTimeUtilsExt.currentTimeMillis()));
 
-			scheduleReadyTasks(job);
+			jobRegistry.addJob(job);
+			schedule(job);
 		}
 		
@@ -292,8 +267,4 @@
 			throw new RuntimeException("Not implemented since it isn't expected that tasks are send directly to the global scheduler.");
 		}
-
-		public void handleSubmittedTask(SubmittedTask task) {
-			throw new RuntimeException("Not implemented since it isn't expected that tasks are send directly to the global scheduler.");
-		}
 	}
 
@@ -301,5 +272,4 @@
 		return new GlobalWorkloadUnitHandler();
 	}
-	
 
 
Index: /DCWoRMS/trunk/build/classes/schedframe/scheduling/policy/global/GridBroker.java
===================================================================
--- /DCWoRMS/trunk/build/classes/schedframe/scheduling/policy/global/GridBroker.java	(revision 477)
+++ /DCWoRMS/trunk/build/classes/schedframe/scheduling/policy/global/GridBroker.java	(revision 539)
@@ -19,5 +19,4 @@
 public class GridBroker extends GlobalManagementSystem { 
 
-	
 	private static Log log = LogFactory.getLog(GridBroker.class);
 
@@ -27,25 +26,11 @@
 	public GridBroker(String name, SchedulingPlugin schedulingPlugin, ExecutionTimeEstimationPlugin execTimeEstimationPlugin, TaskQueueList queues) throws Exception {
 		super(name, "BROKER",  schedulingPlugin, execTimeEstimationPlugin, queues);
-		
-		//make use of plug-in interface
-		
-		//Properties prop = new Properties();
-		//prop.put("plugin.name", name);
-		//prop.put("plugin.utils.timeoperations", "gssim.scheduling.plugin.local.GssimTimeOperations");
-		//schedulingPlugin.init(prop);
+
 		otherGridSchedulersIds = new HashSet<Integer>();
-		
 		moduleList = new ModuleListImpl(2);
-		//this.moduleList.add(new GridResourceDiscovery(this.getScheduler()));
-		//moduleList.add(new GridReservationManagerNew(this));
-		
-		if(log.isDebugEnabled())
-			log.debug(name + ": Creating a broker interface object");
 	}
 
 	public void init(Scheduler scheduler, ManagedResources managedResources) {
 		super.init(scheduler, managedResources);
-		//this.scheduler = scheduler;
-		//this.resourceManager = ResourceManagerFactory.createResourceManager(scheduler, managedResources);
 		this.moduleList.add((GridResourceDiscovery)resourceManager);
 	}
@@ -57,5 +42,4 @@
 		}
 		return providerIds;
-		//return GridSim.getGridResourceList();
 	}
 
Index: /DCWoRMS/trunk/build/classes/schedframe/scheduling/WorkloadUnitHandler.java
===================================================================
--- /DCWoRMS/trunk/build/classes/schedframe/scheduling/WorkloadUnitHandler.java	(revision 477)
+++ /DCWoRMS/trunk/build/classes/schedframe/scheduling/WorkloadUnitHandler.java	(revision 539)
@@ -1,17 +1,15 @@
 package schedframe.scheduling;
 
-import schedframe.scheduling.tasks.Job;
-import schedframe.scheduling.tasks.SubmittedTask;
+import dcworms.schedframe.scheduling.ExecTask;
+import schedframe.scheduling.tasks.JobInterface;
 import schedframe.scheduling.tasks.TaskInterface;
-import gssim.schedframe.scheduling.ExecTask;
 
-public 	interface WorkloadUnitHandler{
+public interface WorkloadUnitHandler{
 	
-	public void handleJob(Job job);
+	public void handleJob(JobInterface<?> job);
 	
 	public void handleTask(TaskInterface<?> task);
 	
 	public void handleExecutable(ExecTask task);
-	
-	public void handleSubmittedTask(SubmittedTask task);
+
 }
Index: /DCWoRMS/trunk/build/classes/schedframe/scheduling/Cluster.java
===================================================================
--- /DCWoRMS/trunk/build/classes/schedframe/scheduling/Cluster.java	(revision 477)
+++ /DCWoRMS/trunk/build/classes/schedframe/scheduling/Cluster.java	(revision 539)
@@ -13,5 +13,5 @@
 import gridsim.GridSimTags;
 import gridsim.IO_data;
-import gridsim.gssim.WormsTags;
+import gridsim.dcworms.DCWormsTags;
 
 public class Cluster extends Scheduler{
@@ -23,5 +23,5 @@
 	protected void processOtherRequest(Sim_event ev) {
 		switch (ev.get_tag()) {
-		case WormsTags.QUERY_RESOURCE_DESC:
+		case DCWormsTags.QUERY_RESOURCE_DESC:
 			SchedulerDescription desc = new SchedulerDescription(new LocalSystem(get_name(), null, null));
 			Map<ResourceUnitName, List<ResourceUnit>> units = managementSystem.getResourceManager().getSharedResourceUnits();
@@ -30,5 +30,5 @@
 
 			IO_data data = new IO_data(desc, 0, ev.get_src());
-			send(ev.get_src(), GridSimTags.SCHEDULE_NOW, WormsTags.QUERY_RESOURCE_DESC_RESULT, data);
+			send(ev.get_src(), GridSimTags.SCHEDULE_NOW, DCWormsTags.QUERY_RESOURCE_DESC_RESULT, data);
 			break;
 
Index: /DCWoRMS/trunk/build/classes/schedframe/scheduling/GridResourceDiscovery.java
===================================================================
--- /DCWoRMS/trunk/build/classes/schedframe/scheduling/GridResourceDiscovery.java	(revision 477)
+++ /DCWoRMS/trunk/build/classes/schedframe/scheduling/GridResourceDiscovery.java	(revision 539)
@@ -5,5 +5,5 @@
 import gridsim.GridSimTags;
 import gridsim.IO_data;
-import gridsim.gssim.WormsTags;
+import gridsim.dcworms.DCWormsTags;
 
 import java.util.ArrayList;
@@ -58,9 +58,9 @@
 		for(int i = 0; i < resourceList.size(); i++){
 			int resourceId = resourceList.get(i).get_id();
-			gridBroker.send(resourceId, GridSimTags.SCHEDULE_NOW, WormsTags.QUERY_RESOURCE_DESC, null);
+			gridBroker.send(resourceId, GridSimTags.SCHEDULE_NOW, DCWormsTags.QUERY_RESOURCE_DESC, null);
 		}
 		
 		//filter only the query response messages
-		Sim_type_p pred = new Sim_type_p(WormsTags.QUERY_RESOURCE_DESC_RESULT);
+		Sim_type_p pred = new Sim_type_p(DCWormsTags.QUERY_RESOURCE_DESC_RESULT);
 		Sim_event ev = new Sim_event();
 		
@@ -80,9 +80,9 @@
 		for(int i = 0; i < gridBroker.getChildren().size(); i++){
 			int resourceId = gridBroker.getChildren().get(i).get_id();
-			gridBroker.send(resourceId, GridSimTags.SCHEDULE_NOW, WormsTags.QUERY_RESOURCE_DESC, null);
+			gridBroker.send(resourceId, GridSimTags.SCHEDULE_NOW, DCWormsTags.QUERY_RESOURCE_DESC, null);
 		}
 		
 		//filter only the query response messages
-		Sim_type_p pred = new Sim_type_p(WormsTags.QUERY_RESOURCE_DESC_RESULT);
+		Sim_type_p pred = new Sim_type_p(DCWormsTags.QUERY_RESOURCE_DESC_RESULT);
 		Sim_event ev = new Sim_event();
 		
Index: /DCWoRMS/trunk/build/classes/schedframe/scheduling/manager/tasks/JobRegistry.java
===================================================================
--- /DCWoRMS/trunk/build/classes/schedframe/scheduling/manager/tasks/JobRegistry.java	(revision 477)
+++ /DCWoRMS/trunk/build/classes/schedframe/scheduling/manager/tasks/JobRegistry.java	(revision 539)
@@ -1,8 +1,10 @@
 package schedframe.scheduling.manager.tasks;
 
-import gssim.schedframe.scheduling.ExecTask;
 
 import java.util.List;
 
+import dcworms.schedframe.scheduling.ExecTask;
+
+import schedframe.ExecutablesList;
 import schedframe.scheduling.tasks.JobInterface;
 import schedframe.scheduling.tasks.TaskInterface;
@@ -11,8 +13,4 @@
 public interface JobRegistry {
 
-	//public List<JobInterface<?>> getActiveJobs();
-
-	//public List<TaskInterface<?>> getActiveTasks();
-	
 	public JobInterface<?> getJobInfo(String jobId);
 
@@ -31,10 +29,10 @@
 
 
-	//public List<SubmittedTask> getSubmittedTasks();
+	public ExecutablesList getExecutableTasks(); 
 	
-	public ExecTask getSubmittedTask(String jobId, String taskId);
+	public ExecTask getExecutable(String jobId, String taskId);
 
 	
-	public List<? extends TaskInterface<?>> getReadyTasks(List<JobInterface<?>> jobsList);
+	public List<? extends TaskInterface<?>> getAvailableTasks(List<JobInterface<?>> jobsList);
 
 }
Index: /DCWoRMS/trunk/build/classes/schedframe/scheduling/manager/tasks/JobRegistryImpl.java
===================================================================
--- /DCWoRMS/trunk/build/classes/schedframe/scheduling/manager/tasks/JobRegistryImpl.java	(revision 477)
+++ /DCWoRMS/trunk/build/classes/schedframe/scheduling/manager/tasks/JobRegistryImpl.java	(revision 539)
@@ -1,31 +1,21 @@
 package schedframe.scheduling.manager.tasks;
 
-import gridsim.Gridlet;
-import gssim.schedframe.scheduling.ExecTask;
-import gssim.schedframe.scheduling.Executable;
+import gridsim.dcworms.DCWormsTags;
 
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 
 import org.apache.commons.lang.ArrayUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.joda.time.DateTime;
 import org.qcg.broker.schemas.resreqs.ParentType;
 import org.qcg.broker.schemas.resreqs.types.TaskStatesName;
 
+import dcworms.schedframe.scheduling.ExecTask;
+
 import qcg.shared.constants.BrokerConstants;
-import schedframe.resources.units.ResourceUnit;
-import schedframe.resources.units.ResourceUnitName;
-import schedframe.scheduling.ResourceHistoryItem;
-import schedframe.scheduling.plan.AllocationInterface;
-import schedframe.scheduling.tasks.AbstractProcesses;
+import schedframe.ExecutablesList;
 import schedframe.scheduling.tasks.JobInterface;
-import schedframe.scheduling.tasks.SubmittedTask;
 import schedframe.scheduling.tasks.Task;
-import simulator.WormsConstants;
 
 public class JobRegistryImpl extends AbstractJobRegistry {
@@ -37,21 +27,17 @@
 	private String context;
 
-	//TO DO - change data structure
-	protected static final List<ExecTask> submittedTasks = Collections.synchronizedList(new ArrayList<ExecTask>());;
-	//protected static final List<ExecTaskInterface> submittedTasks = new CopyOnWriteArrayList<ExecTaskInterface>();
+	//TO DO - consider data structure
+	protected static final ExecutablesList executables = new ExecutablesList();
+	//protected static final List<ExecTask> executables = Collections.synchronizedList(new ArrayList<ExecTask>());;
+	//protected static final List<ExecTaskInterface> executables = new CopyOnWriteArrayList<ExecTaskInterface>();
 
-	public JobRegistryImpl(String context_) {
-		context = context_;
+	public JobRegistryImpl(String context) {
+		this.context = context;
 	}
 
-	/*protected void setContext(String context_) {
-		context = context_;
-	}*/
-
-	public boolean addTask(ExecTask newTask) {
-		if(getSubmittedTask(newTask.getJobId(), newTask.getId()) == null)
-		{
-			synchronized (submittedTasks)  {
-				submittedTasks.add(newTask);
+	public boolean addExecTask(ExecTask newTask) {
+		if(getExecutable(newTask.getJobId(), newTask.getId()) == null) {
+			synchronized (executables)  {
+				executables.add(newTask);
 			}
 			return true;
@@ -60,17 +46,16 @@
 	}
 
+	public ExecutablesList getExecutableTasks() {
+		return executables;
+	}
 	public List<ExecTask> getTasks(int status) {
 		List<ExecTask> taskList = new ArrayList<ExecTask>();
-		synchronized (submittedTasks)  {
-			for (ExecTask task: submittedTasks) {
+		synchronized (executables)  {
+			for (ExecTask task: executables) {
 				if (task.getStatus() == status) {
-					//SubmittedTask subTask = (SubmittedTask) task;
 					List<String> visitedResource = task.getVisitedResources();
-					if(ArrayUtils.contains(visitedResource.toArray(new String[visitedResource.size()]), context)){
+					if(ArrayUtils.contains(visitedResource.toArray(new String[visitedResource.size()]), context)) {
 						taskList.add(task);
 					}
-					/*if(subTask.getVisitedResources().contains(context)){
-						taskList.add(subTask);
-					}*/
 				}
 			}
@@ -80,49 +65,23 @@
 
 	public List<ExecTask> getQueuedTasks() {
-		return getTasks(Gridlet.QUEUED);
+		return getTasks(DCWormsTags.QUEUED);
 	}
 	
 	public List<ExecTask> getRunningTasks() {
-		return getTasks(Gridlet.INEXEC);
+		return getTasks(DCWormsTags.INEXEC);
 	}
 	
 	public List<ExecTask> getReadyTasks() {
-		return getTasks(Gridlet.READY);
+		return getTasks(DCWormsTags.READY);
 	}
 	
 	public List<ExecTask> getFinishedTasks() {
-		return getTasks(Gridlet.SUCCESS);
+		return getTasks(DCWormsTags.SUCCESS);
 	}
 	
-	
-	public List<ExecTask> getAllSubmittedTasks() {
-		List<ExecTask> taskList;
-		synchronized (submittedTasks)  {
-			taskList = new ArrayList<ExecTask>(submittedTasks);
-		}
-		return taskList;
-	}
-
-	public List<SubmittedTask> getSubmittedTasks() {
-		List<SubmittedTask> taskList = new ArrayList<SubmittedTask>();
-		synchronized (submittedTasks)  {
-			for (ExecTask task : submittedTasks) {
-				SubmittedTask subTask = (SubmittedTask) task;
-				List<String> visitedResource = subTask.getVisitedResources();
-				if(ArrayUtils.contains(visitedResource.toArray(new String[visitedResource.size()]), context)){
-					taskList.add(subTask);
-				}
-				/*if(subTask.getVisitedResources().contains(context)){
-					taskList.add(subTask);
-				}*/
-			}
-		}
-		return taskList;
-	}
-	
-	public ExecTask getSubmittedTask(String jobId, String taskId){
-		synchronized (submittedTasks)  {
-			for (ExecTask task : submittedTasks) {
-				if (task.getJobId().compareTo(jobId) == 0 && task.getId().compareTo(taskId)==0) {
+	public ExecTask getExecutable(String jobId, String taskId){
+		synchronized (executables)  {
+			for (ExecTask task : executables) {
+				if (task.getJobId().compareTo(jobId) == 0 && task.getId().compareTo(taskId) == 0) {
 					return task;
 				}
@@ -131,9 +90,8 @@
 		return null;
 	}
-	
 
 	@SuppressWarnings("unchecked")
-	public List<Task> getReadyTasks(List<JobInterface<?>> wuList) {
-		List<Task> readyTasks = new ArrayList<Task>();
+	public List<Task> getAvailableTasks(List<JobInterface<?>> wuList) {
+		List<Task> availableTasks = new ArrayList<Task>();
 		List<Task> waitingTasks = new ArrayList<Task>();
 		
@@ -143,195 +101,17 @@
 		}
 
-		readyTasks.addAll(getPrecedenceConstrainedReadyTasks(waitingTasks));
-		return readyTasks;
-	}
-	
-	public Executable getTaskExecutable(Integer executableId){
-		synchronized (submittedTasks)  {
-			for (ExecTask task : submittedTasks) {
-				SubmittedTask subTask = (SubmittedTask) task;
-				Executable exec = (Executable)subTask.getGridlet();
-				if (exec.getGridletID() == executableId) {
-					return exec;
-				}
-			}
-		}
-		return null;
-	}
-	
-	public List<Executable> getJobExecutables(String jobId){
-		List<Executable> list = new ArrayList<Executable>();
-		synchronized (submittedTasks)  {
-			for(int i = 0; i < submittedTasks.size(); i++){
-				SubmittedTask subTask = (SubmittedTask) submittedTasks.get(i);
-				Executable exec = (Executable)subTask.getGridlet();
-				
-				if(exec.getJobId().equals(jobId))
-					list.add(exec);
-			}
-		}
-		return list;
-	}
-	
-	public JobRegistryImpl clone() {
-		JobRegistryImpl jr = null;
-		try {
-			jr = (JobRegistryImpl) super.clone();
-		} catch (CloneNotSupportedException e) {
-			// TODO Auto-generated catch block
-			e.printStackTrace();
-		}
-
-		return jr;
-	}
-
-	/*public AbstractExecutable getTaskExecutabls(String jobId, String taskId){
-		List<AbstractExecutable> list = new ArrayList<AbstractExecutable>();
-		synchronized (submittedTasks)  {
-			for(int i = 0; i < size(); i++){
-				SubmittedTask subTask = (SubmittedTask) submittedTasks.get(i);
-				AbstractExecutable exec = (AbstractExecutable)subTask.getGridlet();
-				
-				if(exec.getJobId().equals(jobId) && exec.getId().equals(taskId))
-					return exec;
-			}
-		}
-		return null;
-	}*/
-	
-	
-	public Executable createExecutable(Task task, AllocationInterface allocation) {
-
-		String refersTo = allocation.getProcessGroupId(); // null;//allocation.getRefersTo();
-		if(refersTo == null)
-			refersTo = task.getId();
-			
-		Executable exec = null;
-
-		if(refersTo.equals(task.getId())){
-			exec = new Executable(task);
-		} else {
-			List<AbstractProcesses> processes = task.getProcesses();
-			if(processes == null) {
-				try {
-					log.error("Allocation: " + allocation.getDocument() + "\nrefers to unknown task or processes set." +
-							" Set correct value (task id or prcesses set id) for allocation refersTo attribute.");
-				} catch (Exception e) {
-					e.printStackTrace();
-				}
-			}
-			boolean found = false;
-			for(int j = 0; j < processes.size() && !found; j++){
-				AbstractProcesses procesesSet = processes.get(j);
-				if(refersTo.equals(procesesSet.getId())){
-					exec = new Executable(task, procesesSet);
-					found = true;
-				}
-			}
-			if(!found){
-				log.error("Allocation refers to unknown proceses set.");
-			}
-		}
-		
-	//	exec.setUserID(task.getSenderId());
-		exec.setLength(task.getLength());
-		exec.setReservationId(allocation.getReservationId());
-			
-		/*HostInterface<?> host = allocation.getHost();
-		ComputingResourceTypeInterface<?> crt = host.getMachineParameters();
-		if(crt != null){
-			ComputingResourceTypeItemInterface<?> crti = crt.getComputingResourceTypeItem(0);
-			if(crti != null){
-				ParameterPropertyInterface<?> properties[] = crti.getHostParameter().getProperty();
-				for(int p = 0; p < properties.length; p++){
-					ParameterPropertyInterface<?> property = properties[p];
-					if("chosenCPUs".equals(property.getName())){
-						Object cpuNames = property.getValue();
-						exec.addSpecificResource(ResourceParameterName.FREECPUS, cpuNames);
-					}
-				}
-			}
-		}*/
-		return exec;
-	}
-	
-
-	public List<Executable> createExecutables(Task task) {
-
-		List<AbstractProcesses> processes = task.getProcesses();
-		
-		List<Executable> executables = new ArrayList<Executable>();
-
-		if(processes == null || processes.size()==0){
-			Executable exec = new Executable(task);
-			exec.setUserID(task.getSenderId());
-			exec.setLength(task.getLength());
-			executables.add(exec);
-		} else {
-
-			boolean found = false;
-			for(int j = 0; j < processes.size() && !found; j++){
-				AbstractProcesses procesesSet = processes.get(j);
-				Executable exec = new Executable(task, procesesSet);
-				exec.setUserID(task.getSenderId());
-				exec.setLength(task.getLength());
-				executables.add(exec);
-			}
-		}
-
-		return  executables;
+		availableTasks.addAll(getPrecedenceConstrainedAvailableTasks(waitingTasks));
+		return availableTasks;
 	}
 
 
-	/**************************************/
-	protected static Map<Integer, Map<String, Object>> history = new HashMap<Integer, Map<String,Object>>();
-	
-	public static Map<Integer, Map<String, Object>> getAllocationHistory(){
-		return history;
-	}
-	
-	public void saveHistory (SubmittedTask submittedTask, int estimatedTime, Map<ResourceUnitName, ResourceUnit> choosenResources){
+	private List<Task> getPrecedenceConstrainedAvailableTasks(List<Task> tasks){
 		
-		/*submittedTask.setEstimatedDuration(estimatedTime);
-
-		DateTime currentTime = new DateTime();
-		ResourceHistoryItem resHistItem = new ResourceHistoryItem(choosenResources, currentTime);
-		submittedTask.addUsedResources(resHistItem);*/
-
-		ResourceHistoryItem resHistItem = submittedTask.getUsedResources().getLast();
-		DateTime currentTime = new DateTime();
-		Map<String, Object> historyItem = new HashMap<String, Object>();
-		List<ResourceHistoryItem> list = new ArrayList<ResourceHistoryItem>(1);
-		list.add(resHistItem);
-		historyItem.put(WormsConstants.RESOURCES, list);
-		historyItem.put(WormsConstants.START_TIME, currentTime);
-		currentTime = currentTime.plusSeconds(estimatedTime);
-		historyItem.put(WormsConstants.END_TIME, currentTime);
-
-		history.put(Integer.valueOf(submittedTask.getGridletID()), historyItem);
-		/*ProcessingElements pes = (ProcessingElements) choosenResources.get(ResourceParameterName.PROCESSINGELEMENTS);
-		for (ComputingResource resource : pes) {
-			//submittedTask.addToResPath(resource.getName());
-			submittedTask.visitResource(resource.getName());
-			ComputingResource parent = resource.getParent();
-			while (parent != null && !submittedTask.getResPath().contains(parent.getName() + "_")) {
-				submittedTask.addToResPath(parent.getName());
-				parent = parent.getParent();
-			}
-			while (parent != null && !submittedTask.getVisitedResources().contains(parent.getName() + "_")) {
-				submittedTask.visitResource(parent.getName());
-				parent = parent.getParent();
-			}
-		}*/
-	}
-
-	private List<Task> getPrecedenceConstrainedReadyTasks(List<Task> tasks){
+		List<Task> availableTasks = new ArrayList<Task>();
+		int size = tasks.size();
 		
-		List<Task> readyTasks = new ArrayList<Task>();
-
-		int size = tasks.size();
 		for(int i = 0; i < size; i++){
 			int parCnt;
-			int previousTaskReadyCnt = 0;
+			int previousTaskSucceedCnt = 0;
 			Task task = tasks.get(i);
 			if(task.getStatus() != (int)BrokerConstants.TASK_STATUS_UNSUBMITTED)
@@ -341,12 +121,9 @@
 			} catch(Exception e){
 				parCnt = 0;
-				//e.printStackTrace();
 			}
-			if(parCnt == 0)
-			{
-				readyTasks.add(task);
+			if(parCnt == 0){
+				availableTasks.add(task);
 			}
-			else
-			{
+			else {
 				for(int j = 0; j < parCnt; j++){
 					ParentType par = task.getDescription().getWorkflow().getParent(j);
@@ -356,16 +133,16 @@
 						}
 					}
-					previousTaskReadyCnt++;
+					previousTaskSucceedCnt++;
 				}
 				
-				if(previousTaskReadyCnt == parCnt && task.getDescription().getWorkflow().getAnd() != null)
-					readyTasks.add(task);
-				else if(previousTaskReadyCnt > 0 && task.getDescription().getWorkflow().getOr() != null)
-					readyTasks.add(task);
-				else if (previousTaskReadyCnt == parCnt)
-					readyTasks.add(task);
+				if(previousTaskSucceedCnt == parCnt && task.getDescription().getWorkflow().getAnd() != null)
+					availableTasks.add(task);
+				else if(previousTaskSucceedCnt > 0 && task.getDescription().getWorkflow().getOr() != null)
+					availableTasks.add(task);
+				else if (previousTaskSucceedCnt == parCnt)
+					availableTasks.add(task);
 			}
 		}		
-		return readyTasks;
+		return availableTasks;
 	}
 	
@@ -380,3 +157,4 @@
 		return false;
 	}
+
 }
Index: /DCWoRMS/trunk/build/classes/schedframe/scheduling/manager/tasks/AbstractJobRegistry.java
===================================================================
--- /DCWoRMS/trunk/build/classes/schedframe/scheduling/manager/tasks/AbstractJobRegistry.java	(revision 477)
+++ /DCWoRMS/trunk/build/classes/schedframe/scheduling/manager/tasks/AbstractJobRegistry.java	(revision 539)
@@ -2,5 +2,4 @@
 
 
-import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
 
@@ -14,23 +13,16 @@
 
 
-public abstract class AbstractJobRegistry /*extends ConcurrentHashMap<String, Job> */implements JobRegistry, Cloneable{
+public abstract class AbstractJobRegistry /*extends ConcurrentHashMap<String, Job>*/ implements JobRegistry, Cloneable{
 	
 	private static final long serialVersionUID = 8409060063583755824L;
+
 	
-	private static Log log = LogFactory.getLog(AbstractJobRegistry.class);
-	
-	protected static final ConcurrentHashMap<String, Job> jobs = new ConcurrentHashMap<String, Job>();
+	protected static final ConcurrentHashMap<String, JobInterface<?>> jobs = new ConcurrentHashMap<String, JobInterface<?>>();
 	
 	protected AbstractJobRegistry(){
-		//log.warn("Methods from JobRegistry interface are not implemented.");
 	}
 	
 	public boolean addJob(JobInterface<?> job) {
-		try {
-			 jobs.put(job.getId(), (Job) job);
-		} catch (NoSuchFieldException e) {
-			log.error(e.getMessage());
-			return false;
-		}
+		jobs.put(job.getId(),  job);
 		return true;
 	}
@@ -38,5 +30,5 @@
 	public boolean addTask(TaskInterface<?> task) {
 		if(jobs.containsKey(task.getJobId())){
-			jobs.get(task.getJobId()).add((Task)task);
+			getJob(task.getJobId()).add((Task)task);
 			return true;
 		} else {
@@ -45,15 +37,11 @@
 	}
 
-	public Job get(String jobId){
+	public JobInterface<?> getJobInfo(String jobId) {
 		return jobs.get(jobId);
 	}
-	
-	public JobInterface<?> getJobInfo(String jobID) {
-		return jobs.get(jobID);
-	}
 
-	public TaskInterface<?> getTaskInfo(String jobID, String taskId) {
+	public TaskInterface<?> getTaskInfo(String jobId, String taskId) {
 		Task task = null;
-		Job job = jobs.get(jobID);
+		Job job = getJob(jobId);
 		
 		if(job == null)
@@ -63,21 +51,11 @@
 			task = job.getTask(taskId);
 		} catch (NoSuchFieldException e) {
-			log.error(e.getMessage());
 		}
 		return task;
 	}
 	
-	/*public List<JobInterface<?>> getActiveJobs() {
-		log.error("getActiveJobs() not implemented.");
-		return null;
+	public Job getJob(String jobId){
+		return (Job)jobs.get(jobId);
 	}
 
-	public List<TaskInterface<?>> getActiveTasks() {
-		log.error("getActiveTasks() not implemented.");
-		return null;
-	}*/
-
-
-	
-
 }
Index: /DCWoRMS/trunk/build/classes/schedframe/scheduling/manager/resources/LocalResourceManager.java
===================================================================
--- /DCWoRMS/trunk/build/classes/schedframe/scheduling/manager/resources/LocalResourceManager.java	(revision 477)
+++ /DCWoRMS/trunk/build/classes/schedframe/scheduling/manager/resources/LocalResourceManager.java	(revision 539)
@@ -13,5 +13,4 @@
 import java.util.Properties;
 import java.util.Set;
-import java.util.Stack;
 
 import schedframe.exceptions.ResourceException;
@@ -175,15 +174,4 @@
 		return resourceUnit;
 	}
-	/*public List<AbstractResourceUnit> getAvailableResourceUnits(String resourceName) throws Exception {
-		ComputingResource resource = getResourceByName(resourceName);
-		List<AbstractResourceUnit> resourceUnits = new ArrayList<AbstractResourceUnit>();
-		while(resource != null){
-			for(List<AbstractResourceUnit> resUnits: resource.getResourceCharacteristic().getResourceUnits().values())
-				resUnits.addAll(resourceUnits);
-			resource = resource.getParent();
-		}
-		
-		return resourceUnits;
-	}*/
 
 	public List<? extends ComputingResource> filterResources(Properties properties) {
@@ -242,5 +230,5 @@
 				computingResources = (List<ComputingResource>) getResourcesOfType(StandardResourceType.Core);
 			} catch (ResourceException e) {
-				throw new RuntimeException("GSSIM internal error");
+				throw new RuntimeException("DCWorms internal error");
 			}
 			PEUnit peUnit = new ProcessingElements(computingResources);
@@ -253,5 +241,5 @@
 				computingResources = (List<ComputingResource>) getResourcesOfType(StandardResourceType.Processor);
 			} catch (ResourceException e) {
-				throw new RuntimeException("GSSIM internal error");
+				throw new RuntimeException("DCWorms internal error");
 			}
 			PEUnit peUnit = new ProcessingElements(computingResources);
@@ -318,20 +306,4 @@
 			return false;
 		}
-		/*ResourceUnit peUnit = resources.get(StandardResourceUnitName.PE);
-
-		if (peUnit != null) {
-			if (peUnit instanceof ProcessingElements) {
-				ProcessingElements choosenProcessors = (ProcessingElements) peUnit;
-
-				for (int i = 0; i < choosenProcessors.size(); i++) {
-					choosenProcessors.get(i).setStatus(ResourceStatus.BUSY);
-				}
-			}
-		}*/
-
-		/*Memory m = (Memory) resources.get(StandardResourceUnitName.MEMORY);
-		if (m != null) {
-			m.getProvisioner().setState(ResourceUnitState.BUSY);
-		}*/
 		
 		for(ResourceUnitName resUnitName: resources.keySet()){
@@ -345,19 +317,4 @@
 	public void freeResources(Map<ResourceUnitName, ResourceUnit> resources) {
 		
-		/*ResourceUnit peUnit = resources.get(StandardResourceUnitName.PE);
-		
-		if (peUnit instanceof ProcessingElements) {
-			ProcessingElements processingElements = (ProcessingElements) peUnit;
-
-			for (int i = 0; i < processingElements.size(); i++) {
-				processingElements.get(i).setStatus(ResourceStatus.FREE);
-			}
-		}*/
-
-		/*Memory m = (Memory) resources.get(StandardResourceUnitName.MEMORY);
-		if (m != null) {
-			m.getProvisioner().setState(ResourceUnitState.FREE);
-		}*/
-		
 		for(ResourceUnitName resUnitName: resources.keySet()){
 			ResourceUnit resUnit = resources.get(resUnitName);
@@ -366,4 +323,3 @@
 	}
 
-
 }
Index: /DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/ScheduledTaskInterface.java
===================================================================
--- /DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/ScheduledTaskInterface.java	(revision 477)
+++ /DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/ScheduledTaskInterface.java	(revision 539)
@@ -4,5 +4,5 @@
 
 import schedframe.DescriptionContainer;
-import schedframe.scheduling.tasks.WorkloadUnit;
+import schedframe.scheduling.tasks.TaskInterface;
 
 public interface ScheduledTaskInterface<T> extends DescriptionContainer<T> {
@@ -190,7 +190,7 @@
 	
 
-	public ArrayList<AllocationInterface> getAllocations();
+	public ArrayList<AllocationInterface<?>> getAllocations();
 	
-	public WorkloadUnit<?> getTask();
+	public TaskInterface<?> getTask();
 
 }
Index: /DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/impl/ScheduledTask.java
===================================================================
--- /DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/impl/ScheduledTask.java	(revision 477)
+++ /DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/impl/ScheduledTask.java	(revision 539)
@@ -6,12 +6,10 @@
 import org.exolab.castor.xml.MarshalException;
 import org.exolab.castor.xml.ValidationException;
+import org.qcg.broker.schemas.schedulingplan.types.AllocationStatus;
 
 import schedframe.scheduling.plan.AllocationInterface;
 import schedframe.scheduling.plan.ScheduledTaskInterface;
 import schedframe.scheduling.plan.ScheduledTimeInterface;
-import schedframe.scheduling.tasks.WorkloadUnit;
-
-
-import org.qcg.broker.schemas.schedulingplan.types.AllocationStatus;
+import schedframe.scheduling.tasks.TaskInterface;
 
 public class ScheduledTask implements ScheduledTaskInterface<org.qcg.broker.schemas.schedulingplan.Task> {
@@ -22,10 +20,10 @@
 	public ScheduledTask(){
 		t = new org.qcg.broker.schemas.schedulingplan.Task();
-		allocationList = new ArrayList<AllocationInterface>();
+		allocationList = new ArrayList<AllocationInterface<?>>();
 	}
 	
 	public ScheduledTask(org.qcg.broker.schemas.schedulingplan.Task value){
 		t = value;
-		allocationList = new ArrayList<AllocationInterface>();
+		allocationList = new ArrayList<AllocationInterface<?>>();
 	}
 	
@@ -178,17 +176,17 @@
 	
 
-	protected WorkloadUnit<?> task;
-	protected ArrayList<AllocationInterface> allocationList;
+	protected TaskInterface<?> task;
+	protected ArrayList<AllocationInterface<?>> allocationList;
 
-	public ScheduledTask(WorkloadUnit<?> task){
+	public ScheduledTask(TaskInterface<?> task){
 		this();
 		this.task = task;
 	}
 
-	public ArrayList<AllocationInterface> getAllocations() {
+	public ArrayList<AllocationInterface<?>> getAllocations() {
 		return this.allocationList;
 	}
 	
-	public WorkloadUnit<?> getTask(){
+	public TaskInterface<?> getTask(){
 		return this.task;
 	}
Index: /DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/impl/SchedulingPlan.java
===================================================================
--- /DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/impl/SchedulingPlan.java	(revision 477)
+++ /DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/impl/SchedulingPlan.java	(revision 539)
@@ -18,10 +18,10 @@
 	public SchedulingPlan(){
 		sp = new org.qcg.broker.schemas.schedulingplan.SchedulingPlan();
-		taskList = new ArrayList<ScheduledTaskInterface>();
+		taskList = new ArrayList<ScheduledTaskInterface<?>>();
 	}
 	
 	public SchedulingPlan(org.qcg.broker.schemas.schedulingplan.SchedulingPlan value){
 		sp = value;
-		taskList = new ArrayList<ScheduledTaskInterface>();
+		taskList = new ArrayList<ScheduledTaskInterface<?>>();
 	}
 	
@@ -106,7 +106,7 @@
 
 	
-	protected ArrayList<ScheduledTaskInterface> taskList;
+	protected ArrayList<ScheduledTaskInterface<?>> taskList;
 
-	public ArrayList<ScheduledTaskInterface> getTasks() {
+	public ArrayList<ScheduledTaskInterface<?>> getTasks() {
 
 		return this.taskList;
Index: /DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/SchedulingPlanInterface.java
===================================================================
--- /DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/SchedulingPlanInterface.java	(revision 477)
+++ /DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/SchedulingPlanInterface.java	(revision 539)
@@ -99,4 +99,4 @@
 
 
-	public ArrayList<ScheduledTaskInterface> getTasks();
+	public ArrayList<ScheduledTaskInterface<?>> getTasks();
 }
Index: /DCWoRMS/trunk/build/classes/schedframe/scheduling/Scheduler.java
===================================================================
--- /DCWoRMS/trunk/build/classes/schedframe/scheduling/Scheduler.java	(revision 477)
+++ /DCWoRMS/trunk/build/classes/schedframe/scheduling/Scheduler.java	(revision 539)
@@ -8,5 +8,5 @@
 import gridsim.GridSimTags;
 import gridsim.IO_data;
-import gridsim.gssim.WormsTags;
+import gridsim.dcworms.DCWormsTags;
 
 import java.util.ArrayList;
@@ -28,6 +28,6 @@
 import schedframe.scheduling.manager.resources.ManagedResources;
 import schedframe.scheduling.policy.AbstractManagementSystem;
+import schedframe.scheduling.queue.QueueDescription;
 import schedframe.scheduling.queue.TaskQueue;
-import schedframe.scheduling.queue.QueueDescription;
 import schedframe.scheduling.tasks.WorkloadUnit;
 
@@ -117,5 +117,5 @@
 				if (obj != null) {
 					int delay = (Integer) obj;
-					send(this.get_id(), delay, WormsTags.TIMER);
+					send(this.get_id(), delay, DCWormsTags.TIMER);
 				}
 			}
@@ -133,13 +133,4 @@
 				// managemetnSystem_.setEndSimulation();
 				run = false;
-				/*Sim_stat stats = get_stat();
-				List<Object[]> measures = stats.get_measures();
-				for (Object[] info : measures) {
-					String measure = (String) info[0];
-					if (measure
-							.startsWith(GssimConstants.TASKS_QUEUE_LENGTH_MEASURE_NAME)) {
-						System.out.println("====="+this.get_name()+";"+stats.average(measure));
-					}
-				}*/
 				break;
 			}
@@ -155,13 +146,13 @@
 
 		case GridSimTags.GRIDLET_SUBMIT:
-			processGSSIMJobSubmit(ev, false);
+			processWorkloadUnitSubmit(ev, false);
 			break;
 
 		case GridSimTags.GRIDLET_SUBMIT_ACK:
-			processGSSIMJobSubmit(ev, true);
+			processWorkloadUnitSubmit(ev, true);
 			break;
 
 		case GridSimTags.GRIDLET_RETURN:
-			processGSSIMJobReturn(ev);
+			processWorkloadUnitReturn(ev);
 			break;
 
@@ -174,5 +165,5 @@
 	protected void processOtherRequest(Sim_event ev) {
 		switch (ev.get_tag()) {
-		case WormsTags.QUERY_RESOURCE_DESC:
+		case DCWormsTags.QUERY_RESOURCE_DESC:
 			SchedulerDescription desc = new SchedulerDescription(new LocalSystem(get_name(), null, null));
 			Map<ResourceUnitName, List<ResourceUnit>> units = managementSystem.getResourceManager().getSharedResourceUnits();
@@ -181,5 +172,5 @@
 
 			IO_data data = new IO_data(desc, 0, ev.get_src());
-			send(ev.get_src(), GridSimTags.SCHEDULE_NOW, WormsTags.QUERY_RESOURCE_DESC_RESULT, data);
+			send(ev.get_src(), GridSimTags.SCHEDULE_NOW, DCWormsTags.QUERY_RESOURCE_DESC_RESULT, data);
 			break;
 
@@ -189,16 +180,12 @@
 		}
 	}
-	
-	/*public boolean processOtherEvent(Sim_event ev) {
-		return false;
-	}*/
-	
-	protected void processGSSIMJobReturn(Sim_event ev) {
-		WorkloadUnit<?> job = (WorkloadUnit<?>) ev.get_data();
+
+	protected void processWorkloadUnitReturn(Sim_event ev) {
+		WorkloadUnit job = (WorkloadUnit) ev.get_data();
 		managementSystem.notifyReturnedWorkloadUnit(job);
 	}
 
-	protected void processGSSIMJobSubmit(Sim_event ev, boolean ack) {
-		WorkloadUnit<?> job = (WorkloadUnit<?>) ev.get_data();
+	protected void processWorkloadUnitSubmit(Sim_event ev, boolean ack) {
+		WorkloadUnit job = (WorkloadUnit) ev.get_data();
 		managementSystem.notifySubmittedWorkloadUnit(job, ack);
 	}
@@ -223,9 +210,4 @@
 		this.send(this.get_id(), delay, tag, data);
 	}
-	
-	/*protected void send(int dest, int tag, int transaction, Object obj){
-		IO_data data = new Transaction_IO_data(transaction, obj, 8, dest);
-		super.send(dest, GridSimTags.SCHEDULE_NOW, tag, data);
-	}*/
 	
 	public Sim_port getOutputPort() {
@@ -271,5 +253,5 @@
 	public List<QueueDescription> getQueuesDescription(){
 		List<QueueDescription> queues = new ArrayList<QueueDescription>();
-		for(TaskQueue queue: managementSystem.getAccessQueues()){
+		for(TaskQueue queue: managementSystem.getQueues()){
 			QueueDescription qd;
 			try {
Index: /DCWoRMS/trunk/build/classes/schedframe/scheduling/plugin/estimation/ExecutionTimeEstimationPlugin.java
===================================================================
--- /DCWoRMS/trunk/build/classes/schedframe/scheduling/plugin/estimation/ExecutionTimeEstimationPlugin.java	(revision 477)
+++ /DCWoRMS/trunk/build/classes/schedframe/scheduling/plugin/estimation/ExecutionTimeEstimationPlugin.java	(revision 539)
@@ -1,8 +1,8 @@
 package schedframe.scheduling.plugin.estimation;
 
-import gssim.schedframe.scheduling.ExecTask;
 
-import java.util.List;
 import java.util.Map;
+
+import dcworms.schedframe.scheduling.ExecTask;
 
 import schedframe.Plugin;
@@ -32,6 +32,5 @@
 	 * @return estimated execution time of a task of specified length
 	 */
-	public double execTimeEstimation(SchedulingEvent event, Map<ResourceUnitName, ResourceUnit> allocatedResources, 
-									ExecTask task, 
+	public double execTimeEstimation(SchedulingEvent event, ExecTask task, Map<ResourceUnitName, ResourceUnit> allocatedResources, 
 									double completionPercentage);
 	
Index: /DCWoRMS/trunk/build/classes/schedframe/scheduling/plugin/SchedulingPlugin.java
===================================================================
--- /DCWoRMS/trunk/build/classes/schedframe/scheduling/plugin/SchedulingPlugin.java	(revision 477)
+++ /DCWoRMS/trunk/build/classes/schedframe/scheduling/plugin/SchedulingPlugin.java	(revision 539)
@@ -3,5 +3,6 @@
 import schedframe.Plugin;
 import schedframe.events.scheduling.SchedulingEvent;
-import schedframe.scheduling.WorkloadUnitListImpl;
+import schedframe.scheduling.TaskList;
+import schedframe.scheduling.TaskListImpl;
 import schedframe.scheduling.manager.resources.ResourceManager;
 import schedframe.scheduling.manager.tasks.JobRegistry;
@@ -12,5 +13,5 @@
 public interface SchedulingPlugin extends Plugin{
 
-	public int placeJobsInQueues(WorkloadUnitListImpl newJobs,
+	public int placeTasksInQueues(TaskList newTasks,
 			TaskQueueList queues, 
 			ResourceManager resourceManager, ModuleList modules);
Index: /DCWoRMS/trunk/build/classes/schedframe/scheduling/TaskListImpl.java
===================================================================
--- /DCWoRMS/trunk/build/classes/schedframe/scheduling/TaskListImpl.java	(revision 539)
+++ /DCWoRMS/trunk/build/classes/schedframe/scheduling/TaskListImpl.java	(revision 539)
@@ -0,0 +1,19 @@
+package schedframe.scheduling;
+
+import java.util.ArrayList;
+
+import schedframe.scheduling.tasks.TaskInterface;
+
+
+public class TaskListImpl extends ArrayList<TaskInterface<?>> implements TaskList {
+
+	private static final long serialVersionUID = -3824600938144742457L;
+
+	public TaskListImpl(){
+		super();
+	}
+	
+	public TaskListImpl(int initialSize){
+		super(initialSize);
+	}	
+}
Index: /DCWoRMS/trunk/build/classes/schedframe/scheduling/UsedResourcesList.java
===================================================================
--- /DCWoRMS/trunk/build/classes/schedframe/scheduling/UsedResourcesList.java	(revision 539)
+++ /DCWoRMS/trunk/build/classes/schedframe/scheduling/UsedResourcesList.java	(revision 539)
@@ -0,0 +1,12 @@
+package schedframe.scheduling;
+
+import java.util.LinkedList;
+
+public class UsedResourcesList extends LinkedList<ResourceHistoryItem>{
+
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 1L;
+	
+}
Index: /DCWoRMS/trunk/build/classes/schedframe/events/TaskEvent.java
===================================================================
--- /DCWoRMS/trunk/build/classes/schedframe/events/TaskEvent.java	(revision 477)
+++ /DCWoRMS/trunk/build/classes/schedframe/events/TaskEvent.java	(revision 539)
@@ -7,8 +7,8 @@
 public class TaskEvent {
 
-	protected WorkloadUnit<?> task;
+	protected WorkloadUnit task;
 	protected String resourceName;
 	
-	public TaskEvent(WorkloadUnit<?> task,
+	public TaskEvent(WorkloadUnit task,
 			 String resourceName) {
 		super();
@@ -17,5 +17,5 @@
 	}
 	
-	public WorkloadUnit<?> getTask() {
+	public WorkloadUnit getTask() {
 		return task;
 	}
Index: /DCWoRMS/trunk/build/classes/schedframe/Property.java
===================================================================
--- /DCWoRMS/trunk/build/classes/schedframe/Property.java	(revision 477)
+++ /DCWoRMS/trunk/build/classes/schedframe/Property.java	(revision 539)
@@ -3,7 +3,7 @@
 import java.util.ArrayList;
 
-import schemas.StringValueWithUnit;
+import schemas.StringValueWithUnitType;
 
-public class Property extends ArrayList<StringValueWithUnit>{
+public class Property extends ArrayList<StringValueWithUnitType>{
 
 	/**
Index: /DCWoRMS/trunk/build/classes/org/joda/time/VCMilisProvider.java
===================================================================
--- /DCWoRMS/trunk/build/classes/org/joda/time/VCMilisProvider.java	(revision 477)
+++ /DCWoRMS/trunk/build/classes/org/joda/time/VCMilisProvider.java	(revision 539)
@@ -39,5 +39,4 @@
 		long vc = Math.round(Sim_system.clock());
 		//System.out.println("SIMJAVA TIME: "+Sim_system.clock());
-		//System.out.println("CLOUD TIME: "+GSSIM.clock());
 		
 		// change virtual seconds to milliseconds
