Index: DCWoRMS/trunk/src/dcworms/schedframe/scheduling/plugin/local/DCWormsTimeOperations.java
===================================================================
--- DCWoRMS/trunk/src/dcworms/schedframe/scheduling/plugin/local/DCWormsTimeOperations.java	(revision 490)
+++ DCWoRMS/trunk/src/dcworms/schedframe/scheduling/plugin/local/DCWormsTimeOperations.java	(revision 490)
@@ -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/src/dcworms/schedframe/scheduling/utils/JobDescription.java
===================================================================
--- DCWoRMS/trunk/src/dcworms/schedframe/scheduling/utils/JobDescription.java	(revision 490)
+++ DCWoRMS/trunk/src/dcworms/schedframe/scheduling/utils/JobDescription.java	(revision 490)
@@ -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/src/dcworms/schedframe/scheduling/utils/TaskDescription.java
===================================================================
--- DCWoRMS/trunk/src/dcworms/schedframe/scheduling/utils/TaskDescription.java	(revision 490)
+++ DCWoRMS/trunk/src/dcworms/schedframe/scheduling/utils/TaskDescription.java	(revision 490)
@@ -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/src/dcworms/schedframe/scheduling/Executable.java
===================================================================
--- DCWoRMS/trunk/src/dcworms/schedframe/scheduling/Executable.java	(revision 490)
+++ DCWoRMS/trunk/src/dcworms/schedframe/scheduling/Executable.java	(revision 490)
@@ -0,0 +1,367 @@
+package dcworms.schedframe.scheduling;
+
+
+import gridsim.GridSim;
+import gridsim.gssim.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/src/dcworms/schedframe/scheduling/ExecTask.java
===================================================================
--- DCWoRMS/trunk/src/dcworms/schedframe/scheduling/ExecTask.java	(revision 490)
+++ DCWoRMS/trunk/src/dcworms/schedframe/scheduling/ExecTask.java	(revision 490)
@@ -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/src/dcworms/schedframe/scheduling/queues/AbstractStatsSupportingQueue.java
===================================================================
--- DCWoRMS/trunk/src/dcworms/schedframe/scheduling/queues/AbstractStatsSupportingQueue.java	(revision 490)
+++ DCWoRMS/trunk/src/dcworms/schedframe/scheduling/queues/AbstractStatsSupportingQueue.java	(revision 490)
@@ -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/src/gridsim/gssim/filter/ExecTaskFilter.java
===================================================================
--- DCWoRMS/trunk/src/gridsim/gssim/filter/ExecTaskFilter.java	(revision 481)
+++ DCWoRMS/trunk/src/gridsim/gssim/filter/ExecTaskFilter.java	(revision 490)
@@ -1,7 +1,7 @@
 package gridsim.gssim.filter;
 
+import dcworms.schedframe.scheduling.Executable;
 import eduni.simjava.Sim_event;
 import gridsim.filter.FilterResult;
-import gssim.schedframe.scheduling.Executable;
 
 /**
@@ -11,6 +11,6 @@
 public class ExecTaskFilter extends FilterResult {
 
-	public ExecTaskFilter(int gridletID, int tag) {
-		super(gridletID, tag);
+	public ExecTaskFilter(int taskId, int tag) {
+		super(taskId, tag);
 	}
 
Index: DCWoRMS/trunk/src/simulator/GenericUser.java
===================================================================
--- DCWoRMS/trunk/src/simulator/GenericUser.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/GenericUser.java	(revision 490)
@@ -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/src/simulator/stats/implementation/DCWormsStatistics.java
===================================================================
--- DCWoRMS/trunk/src/simulator/stats/implementation/DCWormsStatistics.java	(revision 481)
+++ DCWoRMS/trunk/src/simulator/stats/implementation/DCWormsStatistics.java	(revision 490)
@@ -19,4 +19,5 @@
 import java.util.TreeMap;
 
+import org.apache.commons.lang.ArrayUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -55,5 +56,5 @@
 import schedframe.exceptions.ResourceException;
 import schedframe.resources.ResourceType;
-import schedframe.resources.StandardResourceType;
+import schedframe.resources.UserResourceType;
 import schedframe.resources.computing.ComputingResource;
 import schedframe.resources.computing.extensions.Extension;
@@ -87,7 +88,7 @@
 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;
-import gssim.schedframe.scheduling.ExecTask;
-import gssim.schedframe.scheduling.Executable;
 
 public class DCWormsStatistics implements SimulationStatistics {
@@ -149,5 +150,5 @@
 	protected HashMap<String, List<String>> task_processorsMap;
 
-	protected JobRegistryImpl jr;
+	protected JobRegistry jr;
 
 	
@@ -168,5 +169,5 @@
 
 		this.resourceController = resourceController;
-		 jr = new JobRegistryImpl("COMPUTING_GRID_0#BROKER");
+		jr = new JobRegistryImpl("");
 		init();
 	}
@@ -231,8 +232,5 @@
 			simulationStatsFile.close();
 		}
-
-	}
-
-
+	}
 
 	/************* RESOURCE STATISTICS SECTION **************/
@@ -241,29 +239,17 @@
 		
 		//TEMPORARY CONFIGURATION SECTION
-		StandardResourceType [] resForAnalyze = {StandardResourceType.DataCenter, StandardResourceType.ComputingNode, StandardResourceType.Processor};
-		HashMap<StandardResourceType, List<Stats>> type_stats = new HashMap<StandardResourceType, List<Stats>>();
-		
-		List<Stats> crStats = new ArrayList<Stats>();
-		crStats.add(Stats.textLoad);
-		crStats.add(Stats.chartLoad);
-		crStats.add(Stats.textEnergy);
-		crStats.add(Stats.chartEnergy);
-		type_stats.put(StandardResourceType.DataCenter, crStats);
-		
-		List<Stats> cnStats = new ArrayList<Stats>();
-		cnStats.add(Stats.textLoad);
-		cnStats.add(Stats.chartLoad);
-		cnStats.add(Stats.textEnergy);
-		cnStats.add(Stats.chartEnergy);
-		type_stats.put(StandardResourceType.ComputingNode, cnStats);
-		
-		List<Stats> cpuStats = new ArrayList<Stats>();
-		cpuStats.add(Stats.textLoad);
-		cpuStats.add(Stats.chartLoad);
-		cpuStats.add(Stats.textEnergy);
-		//cpuStats.add(Stats.chartEnergy);
-		type_stats.put(StandardResourceType.Processor, cpuStats);
-		
-		
+		
+		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);
+			type_stats.put(resourceName, cStats);
+		}		
 		
 		peGanttMap = new HashMap<String, TimetableEventSource>();
@@ -305,17 +291,17 @@
 		}
 		
-		for(StandardResourceType resType: resForAnalyze){
+		for(String resourceName: resourceController.getComputingResourceLayers()){
 			List<ComputingResource> resources = null;
 			try {
 				resources = new ArrayList<ComputingResource>();
 				for(ComputingResource compRes: resourceController.getComputingResources() ){
-					resources.addAll(compRes.getDescendantsByType(resType));
-				}
-				/*if(resourceController.getComputingResources().get(0).getType().equals(resType))
-					resources.addAll(resourceController.getComputingResources());*/
+					resources.addAll(compRes.getDescendantsByType(new UserResourceType(resourceName)));
+				}
+				if(resourceController.getComputingResources().get(0).getType().getName().equals(resourceName))
+					resources.addAll(resourceController.getComputingResources());
 			} catch (Exception e) {
 				continue;
 			}
-			if(type_stats.containsKey(resType)){
+			if(type_stats.containsKey(resourceName)){
 				Map<String, GSSAccumulator> energyCategoryStats = new TreeMap<String, GSSAccumulator>();
 				Map<String, GSSAccumulator> loadCategoryStats = new TreeMap<String, GSSAccumulator>();
@@ -323,5 +309,5 @@
 					ResourceUsageStats resourceUsage = null;
 					ResourceEnergyStats energyUsage = null;
-					if(type_stats.get(resType).contains(Stats.textLoad)){
+					if(type_stats.get(resourceName).contains(Stats.textLoad)){
 						resourceUsage = gatherResourceLoadStats(resource, basicResStats);
 						resourceUsage.setMeanUsage(calculateResourceLoad(resource, basicResLoad));
@@ -331,10 +317,10 @@
 						}
 					}
-					if(type_stats.get(resType).contains(Stats.chartLoad)){
+					if(type_stats.get(resourceName).contains(Stats.chartLoad)){
 						if (configuration.creatediagrams_resources) {
 							createResourceLoadDiagram(resourceUsage);
 						}
 					}
-					if(type_stats.get(resType).contains(Stats.textEnergy)){
+					if(type_stats.get(resourceName).contains(Stats.textEnergy)){
 						energyUsage = gatherResourceEnergyStats(resource);
 						energyUsage.setMeanUsage(calculateEnergyLoad(energyUsage));
@@ -352,6 +338,5 @@
 							boolean top = true;
 							while(parent != null){
-								if(een != null &&  een.getPowerProfile() != null)
-								{
+								if(een != null &&  een.getPowerProfile() != null) {
 									top = false;
 									break;
@@ -368,5 +353,5 @@
 						}
 					}
-					if(type_stats.get(resType).contains(Stats.chartEnergy)){
+					if(type_stats.get(resourceName).contains(Stats.chartEnergy)){
 
 						if (configuration.creatediagrams_energyusage) {
@@ -760,5 +745,5 @@
 	private JFreeChart getResourcesEnergyDiagram(ResourceType resType, String chartName,
 			Title subtitle, String simulationTime) {
-		String energy = "ENERGY [W]";
+		String energy = "POWER [W]";
 		boolean urls = false;
 		boolean tooltip = true;
Index: DCWoRMS/trunk/src/simulator/stats/implementation/TaskStats.java
===================================================================
--- DCWoRMS/trunk/src/simulator/stats/implementation/TaskStats.java	(revision 481)
+++ DCWoRMS/trunk/src/simulator/stats/implementation/TaskStats.java	(revision 490)
@@ -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;
Index: DCWoRMS/trunk/src/simulator/DCWormsUsers.java
===================================================================
--- DCWoRMS/trunk/src/simulator/DCWormsUsers.java	(revision 481)
+++ DCWoRMS/trunk/src/simulator/DCWormsUsers.java	(revision 490)
@@ -1,14 +1,13 @@
 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.Gridlet;
 import gridsim.IO_data;
 import gridsim.gssim.DCWormsTags;
 import gridsim.net.InfoPacket;
-import gssim.schedframe.scheduling.utils.JobDescription;
-import gssim.schedframe.scheduling.utils.TaskDescription;
 
 import java.util.ArrayList;
Index: DCWoRMS/trunk/src/simulator/utils/XsltTransformations.java
===================================================================
--- DCWoRMS/trunk/src/simulator/utils/XsltTransformations.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/utils/XsltTransformations.java	(revision 490)
@@ -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/src/simulator/reader/ResourceReader.java
===================================================================
--- DCWoRMS/trunk/src/simulator/reader/ResourceReader.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/reader/ResourceReader.java	(revision 490)
@@ -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>();
 	}
 
@@ -97,4 +102,5 @@
 		ResourceController rc = new ResourceController(mainScheduler, computingResources);
 		rc.setInitList(toInit);
+		rc.setCompResLayers(compResLayers);
 		return rc;
 	}
@@ -192,4 +198,5 @@
 			ComputingResource parentResource = resStructure.pop();
 			toInit.add(parentResource);
+			compResLayers.add(parentResource.getType().getName());
 			List<AbstractResourceDescription> childrenResDesc = parentResDesc.getChildren();
 			if (childrenResDesc == null){
Index: DCWoRMS/trunk/src/simulator/workload/WorkloadLoader.java
===================================================================
--- DCWoRMS/trunk/src/simulator/workload/WorkloadLoader.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/workload/WorkloadLoader.java	(revision 490)
@@ -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/src/simulator/ConfigurationOptions.java
===================================================================
--- DCWoRMS/trunk/src/simulator/ConfigurationOptions.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/ConfigurationOptions.java	(revision 490)
@@ -8,5 +8,4 @@
 import java.util.PropertyResourceBundle;
 import java.util.ResourceBundle;
-import java.util.logging.FileHandler;
 
 /**
@@ -53,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 */
@@ -59,16 +57,9 @@
 			+ ".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";
@@ -79,10 +70,8 @@
 	public static final String CREATEDIAGRAMS_TASKS = CREATEDIAGRAMS + ".tasks";
 	public static final String CREATEDIAGRAMS_TASKSWAITINGTIME = CREATEDIAGRAMS + ".taskswaitingtime";
-	public static final String CREATEDIAGRAMS_RESERVATIONS = CREATEDIAGRAMS + ".reservations";
 	
 	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";
@@ -111,5 +100,4 @@
 	/* =============================================================================================== */
 	
-	public String providerListFile = null;
 
 
@@ -152,8 +140,4 @@
 	public String inputWorkloadFileName = DEFAULT_WORKLOAD_FILE_NAME;
 
-	/**
-	 * a txt file name with topology description
-	 */
-	public String networkTopologyFileName = null;
 	
 	/**
@@ -171,9 +155,4 @@
 	public boolean overwriteFiles = false;
 
-	/**
-	 * true if the history files are to be generated (makes the simulation
-	 * slower)
-	 */
-	public boolean printHistory = false;
 	
 	/**
@@ -183,20 +162,19 @@
 
 	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 double  creatediagrams_resources_scale = 1;
 	
 	public boolean createaccumulatedresourcesstatistics = true;
 	public boolean createextendedtasksstatistics = true;
-	public boolean creategridlethistorystatistics = true;
 	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[] resForUtilizationChart;
+	
 	/**
 	 * An empty constructor.
@@ -231,10 +209,5 @@
 		
 		co.resdescFileName = bundle.getString(RESOURCE_DESC_MODIFIER);
-		
-		try {
-			co.envDescFileName = bundle.getString(ENV_DESC_MODIFIER);
-		} catch(MissingResourceException e){
-			co.envDescFileName = null;
-		}
+
 		
 		try {
@@ -264,12 +237,4 @@
 		}
 
-
-		try {
-			co.networkTopologyFileName = bundle
-					.getString(NETWORK_TOPOLOGY_FILE_MODIFIER);
-		} catch(MissingResourceException e){
-			co.networkTopologyFileName = null;
-		}
-		
 		if (co.createScenario == false) {
 			// read scenario
@@ -279,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;
 			}
 			
@@ -307,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
 		
@@ -330,13 +281,10 @@
 			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_UTILIZATION)).booleanValue() && createDiagrams;
+
+		try {
+			co.resForUtilizationChart = bundle.getString(CREATEDIAGRAMS_UTILIZATION).split(";");
+			if(co.resForUtilizationChart.length > 0){
+				co.creatediagrams_resources = true && createDiagrams;
+			}
 		} catch(MissingResourceException e){
 			co.creatediagrams_resources = createDiagrams;
@@ -349,6 +297,8 @@
 		}
 		try {
-			co.creatediagrams_energyusage = Boolean.valueOf(
-					bundle.getString(CREATEDIAGRAMS_ENERGYUSAGE)).booleanValue() && createDiagrams;
+			co.resForEnergyChart = bundle.getString(CREATEDIAGRAMS_ENERGYUSAGE).split(";");
+			if(co.resForEnergyChart.length > 0){
+				co.creatediagrams_energyusage = true && createDiagrams;
+			}
 		} catch(MissingResourceException e){
 			co.creatediagrams_energyusage = createDiagrams;
@@ -367,5 +317,4 @@
 		}
 		
-		
 		try {
 			co.statsOutputSubfolderNameCreate = bundle.getString(STATS_OUTPUT_SUBFOLDER_NAME);
@@ -388,10 +337,5 @@
 			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(
@@ -419,63 +363,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.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.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/src/schedframe/ExecutablesList.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/ExecutablesList.java	(revision 481)
+++ DCWoRMS/trunk/src/schedframe/ExecutablesList.java	(revision 490)
@@ -1,6 +1,4 @@
 package schedframe;
 
-import gssim.schedframe.scheduling.ExecTask;
-import gssim.schedframe.scheduling.Executable;
 
 import java.util.ArrayList;
@@ -11,11 +9,14 @@
 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){
Index: DCWoRMS/trunk/src/schedframe/scheduling/manager/tasks/JobRegistry.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/manager/tasks/JobRegistry.java	(revision 481)
+++ DCWoRMS/trunk/src/schedframe/scheduling/manager/tasks/JobRegistry.java	(revision 490)
@@ -1,7 +1,8 @@
 package schedframe.scheduling.manager.tasks;
 
-import gssim.schedframe.scheduling.ExecTask;
 
 import java.util.List;
+
+import dcworms.schedframe.scheduling.ExecTask;
 
 import schedframe.ExecutablesList;
Index: DCWoRMS/trunk/src/schedframe/scheduling/manager/tasks/JobRegistryImpl.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/manager/tasks/JobRegistryImpl.java	(revision 481)
+++ DCWoRMS/trunk/src/schedframe/scheduling/manager/tasks/JobRegistryImpl.java	(revision 490)
@@ -2,5 +2,4 @@
 
 import gridsim.gssim.DCWormsTags;
-import gssim.schedframe.scheduling.ExecTask;
 
 import java.util.ArrayList;
@@ -12,4 +11,6 @@
 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;
@@ -82,5 +83,5 @@
 		synchronized (executables)  {
 			for (ExecTask task : executables) {
-				if (task.getJobId().compareTo(jobId) == 0 && task.getId().compareTo(taskId)==0) {
+				if (task.getJobId().compareTo(jobId) == 0 && task.getId().compareTo(taskId) == 0) {
 					return task;
 				}
Index: DCWoRMS/trunk/src/schedframe/scheduling/manager/resources/LocalResourceManager.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/manager/resources/LocalResourceManager.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/manager/resources/LocalResourceManager.java	(revision 490)
@@ -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/src/schedframe/scheduling/queue/TaskQueue.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/queue/TaskQueue.java	(revision 481)
+++ DCWoRMS/trunk/src/schedframe/scheduling/queue/TaskQueue.java	(revision 490)
@@ -2,7 +2,8 @@
 
 import gridsim.gssim.DCWormsTags;
-import gssim.schedframe.scheduling.queues.AbstractStatsSupportingQueue;
 
 import org.joda.time.DateTime;
+
+import dcworms.schedframe.scheduling.queues.AbstractStatsSupportingQueue;
 
 import schedframe.scheduling.tasks.TaskInterface;
Index: DCWoRMS/trunk/src/schedframe/scheduling/tasks/Task.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/tasks/Task.java	(revision 481)
+++ DCWoRMS/trunk/src/schedframe/scheduling/tasks/Task.java	(revision 490)
@@ -78,5 +78,4 @@
 		this.brokerSubmitTime = null;
 		this.duration = null;
-	//	this.gridletID_ = (getJobId() + "_" + getId()).hashCode();
 		prepareTopology();
 	}
@@ -89,5 +88,4 @@
 		this.brokerSubmitTime = null;
 		this.duration = null;
-	//	this.gridletID_ = (getJobId() + getId()).hashCode();
 		prepareTopology();
 	}
Index: DCWoRMS/trunk/src/schedframe/scheduling/tasks/Job.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/tasks/Job.java	(revision 481)
+++ DCWoRMS/trunk/src/schedframe/scheduling/tasks/Job.java	(revision 490)
@@ -203,6 +203,6 @@
 		
 		List<Task> readyTasks = new ArrayList<Task>();
-
 		int size = tasks.size();
+		
 		for(int i = 0; i < size; i++){
 			int parCnt;
@@ -215,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/src/schedframe/scheduling/plugin/SchedulingPlugin.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/plugin/SchedulingPlugin.java	(revision 481)
+++ DCWoRMS/trunk/src/schedframe/scheduling/plugin/SchedulingPlugin.java	(revision 490)
@@ -3,4 +3,5 @@
 import schedframe.Plugin;
 import schedframe.events.scheduling.SchedulingEvent;
+import schedframe.scheduling.TaskList;
 import schedframe.scheduling.TaskListImpl;
 import schedframe.scheduling.manager.resources.ResourceManager;
@@ -12,5 +13,5 @@
 public interface SchedulingPlugin extends Plugin{
 
-	public int placeTasksInQueues(TaskListImpl newTasks,
+	public int placeTasksInQueues(TaskList newTasks,
 			TaskQueueList queues, 
 			ResourceManager resourceManager, ModuleList modules);
Index: DCWoRMS/trunk/src/schedframe/scheduling/plugin/estimation/ExecutionTimeEstimationPlugin.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/plugin/estimation/ExecutionTimeEstimationPlugin.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/plugin/estimation/ExecutionTimeEstimationPlugin.java	(revision 490)
@@ -1,7 +1,8 @@
 package schedframe.scheduling.plugin.estimation;
 
-import gssim.schedframe.scheduling.ExecTask;
 
 import java.util.Map;
+
+import dcworms.schedframe.scheduling.ExecTask;
 
 import schedframe.Plugin;
Index: DCWoRMS/trunk/src/schedframe/scheduling/policy/local/LocalManagementSystem.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/policy/local/LocalManagementSystem.java	(revision 481)
+++ DCWoRMS/trunk/src/schedframe/scheduling/policy/local/LocalManagementSystem.java	(revision 490)
@@ -1,4 +1,6 @@
 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;
@@ -7,6 +9,4 @@
 import gridsim.gssim.DCWormsTags;
 import gridsim.gssim.filter.ExecTaskFilter;
-import gssim.schedframe.scheduling.ExecTask;
-import gssim.schedframe.scheduling.Executable;
 
 import java.util.ArrayList;
@@ -41,6 +41,7 @@
 import schedframe.scheduling.ResourceHistoryItem;
 import schedframe.scheduling.Scheduler;
+import schedframe.scheduling.TaskList;
 import schedframe.scheduling.TaskListImpl;
-import schedframe.scheduling.UsedResourceList;
+import schedframe.scheduling.UsedResourcesList;
 import schedframe.scheduling.WorkloadUnitHandler;
 import schedframe.scheduling.manager.resources.LocalResourceManager;
@@ -78,6 +79,4 @@
 
 		super(providerId, entityName, execTimeEstimationPlugin, queues);
-
-		//schedulingPlugin = (LocalSchedulingPlugin) InstanceFactory.createInstance(schedulingPluginClassName, LocalSchedulingPlugin.class);
 		
 		if (schedPlugin == null) {
@@ -85,13 +84,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);
@@ -115,14 +112,13 @@
 			}
 			sendTimerEvent();
-
 			break;
 
 		case DCWormsTags.TASK_READY_FOR_EXECUTION:
 			
-			ExecTask data = (ExecTask) ev.get_data();
-			try {
-				data.setStatus(DCWormsTags.READY);
+			ExecTask execTask = (ExecTask) ev.get_data();
+			try {
+				execTask.setStatus(DCWormsTags.READY);
 				if (pluginSupportsEvent(tag)) {
-					SchedulingEvent event = new StartTaskExecutionEvent(data.getJobId(), data.getId());
+					SchedulingEvent event = new StartTaskExecutionEvent(execTask.getJobId(), execTask.getId());
 					SchedulingPlanInterface<?> decision =  schedulingPlugin.schedule(event,
 							queues,  getJobRegistry(), getResourceManager(), moduleList);
@@ -136,48 +132,36 @@
 		case DCWormsTags.TASK_EXECUTION_FINISHED:
 			obj = ev.get_data();
-			ExecTask exec = (ExecTask) obj;
-			if (exec.getStatus() == DCWormsTags.INEXEC) {
-				finalizeExecutable(exec);
-
-				sendFinishedWorkloadUnit(exec);
-				//task.setGridletStatus(Gridlet.SUCCESS);
-				//task.finalizeGridlet();
-				log.debug(exec.getJobId() + "_" + exec.getId() + " finished execution on " + new DateTime());
+			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()));
-				/*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));
+				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(exec.getJobId(), exec.getId());
+				SchedulingEvent event = new TaskRequestedTimeExpiredEvent(execTask.getJobId(), execTask.getId());
 				SchedulingPlanInterface<?> decision = schedulingPlugin.schedule(event,
 						queues, getJobRegistry(), getResourceManager(), moduleList);
 				executeSchedulingPlan(decision);
 			}
-			Job job = jobRegistry.getJob(exec.getJobId());
-			if(!job.isFinished()){
-				getWorkloadUnitHandler().handleJob(job);
-			}
-
 			break;
-		case DCWormsTags.TASK_REQUESTED_TIME_EXPIRED:
-			obj = ev.get_data();
-			exec = (Executable) obj;
-			if (pluginSupportsEvent(tag)) {
-				SchedulingEvent event = new TaskRequestedTimeExpiredEvent(exec.getJobId(), exec.getId());
-				SchedulingPlanInterface<?> decision = schedulingPlugin.schedule(event,
-						queues, getJobRegistry(), getResourceManager(), moduleList);
-				executeSchedulingPlan(decision);
-			}
-
-			break;
+			
 		case DCWormsTags.UPDATE:
 			updateProcessingTimes(ev);
@@ -185,5 +169,4 @@
 		}
 	}
-	
 
 	public void notifyReturnedWorkloadUnit(WorkloadUnit wu) {
@@ -223,5 +206,5 @@
 				} else {
 					ExecTask exec = (ExecTask) task;
-					executeTask(exec, chooseResourcesForExecution(allocation.getProviderName(), (ExecTask)task));
+					executeTask(exec, chooseResourcesForExecution(allocation.getProviderName(), exec));
 				}
 			}
@@ -237,5 +220,5 @@
 			return;
 		removeFromQueue(task);
-		//double completionPercentage = (submittedTask.getLength() - submittedTask.getRemainingGridletLength())/submittedTask.getLength();
+
 		SchedulingEvent event = new SchedulingEvent(SchedulingEventType.START_TASK_EXECUTION);
 		int time = Double.valueOf(
@@ -251,7 +234,11 @@
 		ResourceHistoryItem resHistItem = new ResourceHistoryItem(choosenResources, currentTime);
 		exec.addUsedResources(resHistItem);
-
-		scheduler.sendInternal(time, DCWormsTags.TASK_EXECUTION_FINISHED,
-				exec);
+		try {
+			exec.setStatus(DCWormsTags.INEXEC);
+		} catch (Exception e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+		scheduler.sendInternal(time, DCWormsTags.TASK_EXECUTION_FINISHED, exec);
 
 		try {
@@ -262,18 +249,15 @@
 			scheduler.sendInternal(t, DCWormsTags.TASK_REQUESTED_TIME_EXPIRED, exec);
 		}
-		
-		try {
-			exec.setStatus(DCWormsTags.INEXEC);
-		} catch (Exception e1) {
-			// TODO Auto-generated catch block
-			e1.printStackTrace();
-		}
+
 		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, exec));
+				resource.handleEvent(new EnergyEvent(EnergyEventType.TASK_STARTED, exec));
 			}
 		} else {
@@ -282,12 +266,9 @@
 				resource = ResourceController.getComputingResourceByName(peUnit.getResourceId());
 			} catch (ResourceException e) {
-				
-			}
-			resource.handleEvent(new EnergyEvent(EnergyEventType.TASK_FINISHED, exec));
-		}
-		/*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()){
@@ -301,46 +282,15 @@
 		
 		Executable exec = (Executable)execTask;
-		try {
-			exec.setStatus(DCWormsTags.SUCCESS);
-		} catch (Exception e1) {
-			// TODO Auto-generated catch block
-			e1.printStackTrace();
-		}
 		exec.finalizeExecutable();
-		UsedResourceList<ResourceHistoryItem> lastUsedList = exec.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, exec));
-			}
-		} else {
-			ComputingResource resource = null;
-			try {
-				resource = ResourceController.getComputingResourceByName(peUnit.getResourceId());
-			} catch (ResourceException e) {
-				
-			}
-			resource.handleEvent(new EnergyEvent(EnergyEventType.TASK_FINISHED, exec));
-		}
-		/*ProcessingElements pes = (ProcessingElements) lastUsed.get(StandardResourceUnitName.PE);
-		for (ComputingResource resource : pes) {
-			resource.handleEvent(new EnergyEvent(EnergyEventType.TASK_FINISHED, subTask));
-		}*/
+		
 		ExecTaskFilter filter = new ExecTaskFilter(exec.getUniqueId(), DCWormsTags.TASK_REQUESTED_TIME_EXPIRED);
 		scheduler.sim_cancel(filter, null);
 		
-
+		Task task;
 		Job job = jobRegistry.getJob(exec.getJobId());
-
-		Task task = null;
 		try {
 			task = job.getTask(exec.getTaskId());
 		} catch (NoSuchFieldException e) {
-			e.printStackTrace();
+			return;
 		}
 		if(exec.getProcessesId() == null){
@@ -360,4 +310,27 @@
 			}
 		}
+		
+		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);
 	}
@@ -374,14 +347,31 @@
 			ExecTask task = iter.next();
 			Executable exec = (Executable)task;
-			UsedResourceList<ResourceHistoryItem> usedResourcesList = exec.getUsedResources();
-			ResourceUnit unit = usedResourcesList.getLast().getResourceUnits()
+			UsedResourcesList usedResourcesList = exec.getUsedResources();
+			PEUnit peUnit = (PEUnit)usedResourcesList.getLast().getResourceUnits()
 					.get(StandardResourceUnitName.PE);
 
-			double load = getMIShare(timeSpan, (PEUnit) unit);
+			double load = getMIShare(timeSpan, peUnit);
 			exec.setCompletionPercentage(100 * timeSpan/exec.getEstimatedDuration());
 			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;
@@ -402,6 +392,6 @@
 	protected void updateProcessingTimes(Sim_event ev) {
 		updateProcessingProgress();
-		for (ExecTask task : jobRegistry.getRunningTasks()) {
-			Executable exec = (Executable)task;
+		for (ExecTask execTask : jobRegistry.getRunningTasks()) {
+			Executable exec = (Executable)execTask;
 			List<String> visitedResource = exec.getVisitedResources();
 			String originResource = ev.get_data().toString();
@@ -411,11 +401,7 @@
 			
 			Map<ResourceUnitName, ResourceUnit> choosenResources = exec.getUsedResources().getLast().getResourceUnits();
-			//double completionPercentage = (task.getLength() - subTask.getRemainingGridletLength())/task.getLength();
 			double time = execTimeEstimationPlugin.execTimeEstimation(new SchedulingEvent(SchedulingEventType.RESOURCE_STATE_CHANGED), 
-					task, choosenResources, exec.getCompletionPercentage());
-
-			/*if(!subTask.getVisitedResources().contains(ev.get_data().toString())) {
-				continue;
-			}*/
+					execTask, choosenResources, exec.getCompletionPercentage());
+
 			//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){
@@ -424,6 +410,5 @@
 			ExecTaskFilter filter = new ExecTaskFilter(exec.getUniqueId(), DCWormsTags.TASK_EXECUTION_FINISHED);
 			scheduler.sim_cancel(filter, null);
-			scheduler.sendInternal(time, DCWormsTags.TASK_EXECUTION_FINISHED, task);
-
+			scheduler.sendInternal(time, DCWormsTags.TASK_EXECUTION_FINISHED, execTask);
 		}
 	}	
@@ -443,5 +428,4 @@
 				numberOfPE = numberOfPE + resUnit.getAmount();
 			}
-			//numberOfPE = getResourceManager().getPE().size();
 		} catch (Exception e) {
 			numberOfPE = 1;
@@ -464,4 +448,5 @@
 			ExecTask task) {
 
+		Map<ResourceUnitName, ResourceUnit> map = new HashMap<ResourceUnitName, ResourceUnit>();
 		ResourceManager resourceManager = this.resourceManager;
 		if(resourceName != null){
@@ -472,9 +457,6 @@
 				return null;
 			}
-
 			resourceManager = new LocalResourceManager(resource);
 		}
-		Map<ResourceUnitName, ResourceUnit> map = new HashMap<ResourceUnitName, ResourceUnit>();
-
 
 		int cpuRequest;
@@ -485,5 +467,4 @@
 		}
 
-		//PEUnit processingUnits = null;
 		if (cpuRequest != 0) {
 			
@@ -494,6 +475,6 @@
 				return null;
 			}
+			
 			List<ResourceUnit> choosenPEUnits = new ArrayList<ResourceUnit>();
-
 			for (int i = 0; i < availableUnits.size() && cpuRequest > 0; i++) {
 				PEUnit peUnit = (PEUnit) availableUnits .get(i);
@@ -508,5 +489,4 @@
 				return null;
 			}
-
 			map.put(StandardResourceUnitName.PE, choosenPEUnits.get(0));
 		}
@@ -529,5 +509,5 @@
 	class LocalWorkloadUnitHandler implements WorkloadUnitHandler{
 		
-		public void handleJob(Job job){
+		public void handleJob(JobInterface<?> job){
 
 			if (log.isInfoEnabled())
@@ -536,17 +516,17 @@
 			List<JobInterface<?>> jobsList = new ArrayList<JobInterface<?>>();
 			jobsList.add(job);
-			TaskListImpl readyTasks = new TaskListImpl();
+			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;
+				availableTasks.add(task);
+			}
+
+			for(TaskInterface<?> task: availableTasks){	
+				registerWorkloadUnit(task);
+			}
+		}
+		
+		public void handleTask(TaskInterface<?> t){
+			Task task = (Task)t;
 			List<AbstractProcesses> processes = task.getProcesses();
 
@@ -564,22 +544,19 @@
 		
 		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.setSchedulerName(scheduler.get_id());
-			jobRegistry.addExecTask(exec);
-			TaskListImpl newTasks = new TaskListImpl();
+			
+			TaskList newTasks = new TaskListImpl();
 			newTasks.add(exec);
 		
Index: DCWoRMS/trunk/src/schedframe/scheduling/policy/global/GlobalManagementSystem.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/policy/global/GlobalManagementSystem.java	(revision 481)
+++ DCWoRMS/trunk/src/schedframe/scheduling/policy/global/GlobalManagementSystem.java	(revision 490)
@@ -11,10 +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.SchedulingEvent;
 import schedframe.events.scheduling.TaskArrivedEvent;
 import schedframe.events.scheduling.TimerEvent;
+import schedframe.scheduling.TaskListImpl;
 import schedframe.scheduling.WorkloadUnitHandler;
-import schedframe.scheduling.TaskListImpl;
 import schedframe.scheduling.plan.AllocationInterface;
 import schedframe.scheduling.plan.ScheduledTaskInterface;
@@ -35,6 +37,4 @@
 import gridsim.IO_data;
 import gridsim.gssim.DCWormsTags;
-import gssim.schedframe.scheduling.ExecTask;
-import gssim.schedframe.scheduling.Executable;
 
 public class GlobalManagementSystem extends AbstractManagementSystem {
@@ -80,17 +80,4 @@
 		
 		registerWorkloadUnit(wu);
-		/*Job job = (Job) wu;
-		jobRegistry.addJob(job);
-
-		if (log.isInfoEnabled())
-			log.info("Received job " + job.getId() + " at " + new DateTime(DateTimeUtilsExt.currentTimeMillis()));
-
-		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());*/
 
 	}
@@ -104,5 +91,5 @@
 	
 
-	protected void scheduleAvaialbleTasks(Job job){
+	protected void schedule(JobInterface<?> job){
 		List<JobInterface<?>> jobsList = new ArrayList<JobInterface<?>>();
 		jobsList.add(job);
@@ -111,15 +98,10 @@
 		
 		schedulingPlugin.placeTasksInQueues(readyTasks, queues, getResourceManager(), moduleList);
-		schedule(new TaskArrivedEvent());
-	}
-	
-	protected void schedule(SchedulingEvent schedulingEvent) {
-
 		SchedulingPlanInterface<?> decision = schedulingPlugin.schedule(
-				schedulingEvent, queues, getJobRegistry(),  getResourceManager(), moduleList);
+				new TaskArrivedEvent(), queues, getJobRegistry(),  getResourceManager(), moduleList);
 		if (decision != null)
 			executeSchedulingPlan(decision);
 	}
-	
+
 	public void notifyReturnedWorkloadUnit(WorkloadUnit wu) {
 		Executable exec = (Executable) wu;
@@ -133,11 +115,10 @@
 		try {
 			Job job = jobRegistry.getJob(exec.getJobId());
-			/*Task task = job.getTask(exec.getTaskId());
+			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 {
@@ -150,5 +131,5 @@
 					}
 				}
-			}*/
+			}
 			
 			if(job.isFinished()){
@@ -156,12 +137,5 @@
 			}
 			else {
-				scheduleAvaialbleTasks(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);
 			}
 			
@@ -269,6 +243,6 @@
 		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())
 			log.debug("Submitted job " + task.getId() + " to " + providerName);
@@ -278,11 +252,10 @@
 	class GlobalWorkloadUnitHandler implements  WorkloadUnitHandler{
 
-		public void handleJob(Job job){
-
+		public void handleJob(JobInterface<?> job){
 			if (log.isInfoEnabled())
 				log.info("Received job " + job.getId() + " at " + new DateTime(DateTimeUtilsExt.currentTimeMillis()));
 
 			jobRegistry.addJob(job);
-			scheduleAvaialbleTasks(job);
+			schedule(job);
 		}
 		
@@ -294,5 +267,4 @@
 			throw new RuntimeException("Not implemented since it isn't expected that tasks are send directly to the global scheduler.");
 		}
-
 	}
 
Index: DCWoRMS/trunk/src/schedframe/scheduling/policy/AbstractManagementSystem.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/policy/AbstractManagementSystem.java	(revision 481)
+++ DCWoRMS/trunk/src/schedframe/scheduling/policy/AbstractManagementSystem.java	(revision 490)
@@ -7,4 +7,8 @@
 import org.apache.commons.logging.LogFactory;
 import org.joda.time.DateTimeUtilsExt;
+
+import dcworms.schedframe.scheduling.ExecTask;
+import dcworms.schedframe.scheduling.Executable;
+import dcworms.schedframe.scheduling.queues.AbstractStatsSupportingQueue;
 
 import schedframe.PluginConfiguration;
@@ -34,7 +38,4 @@
 import gridsim.IO_data;
 import gridsim.gssim.DCWormsTags;
-import gssim.schedframe.scheduling.ExecTask;
-import gssim.schedframe.scheduling.Executable;
-import gssim.schedframe.scheduling.queues.AbstractStatsSupportingQueue;
 
 public abstract class AbstractManagementSystem {
@@ -144,5 +145,4 @@
 			return;
 		}
-		//Executable exec = (Executable) wu;
 		removeFromQueue(task);
 		scheduler.send(providerName, GridSimTags.SCHEDULE_NOW, GridSimTags.GRIDLET_SUBMIT, task);	
@@ -199,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;
 			}
Index: DCWoRMS/trunk/src/schedframe/scheduling/WorkloadUnitHandler.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/WorkloadUnitHandler.java	(revision 481)
+++ DCWoRMS/trunk/src/schedframe/scheduling/WorkloadUnitHandler.java	(revision 490)
@@ -1,12 +1,11 @@
 package schedframe.scheduling;
 
-import schedframe.scheduling.tasks.Job;
+import dcworms.schedframe.scheduling.ExecTask;
+import schedframe.scheduling.tasks.JobInterface;
+import schedframe.scheduling.tasks.TaskInterface;
 
-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);
Index: DCWoRMS/trunk/src/schedframe/scheduling/UsedResourcesList.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/UsedResourcesList.java	(revision 490)
+++ DCWoRMS/trunk/src/schedframe/scheduling/UsedResourcesList.java	(revision 490)
@@ -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/src/schedframe/scheduling/UsedResourceList.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/UsedResourceList.java	(revision 477)
+++ 	(revision )
@@ -1,12 +1,0 @@
-package schedframe.scheduling;
-
-import java.util.LinkedList;
-
-public class UsedResourceList<E> extends LinkedList<E>{
-
-	/**
-	 * 
-	 */
-	private static final long serialVersionUID = 1L;
-	
-}
Index: DCWoRMS/trunk/src/schedframe/ResourceController.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/ResourceController.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/ResourceController.java	(revision 490)
@@ -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/src/example/timeestimation/DefaultTimeEstimationPlugin.java
===================================================================
--- DCWoRMS/trunk/src/example/timeestimation/DefaultTimeEstimationPlugin.java	(revision 477)
+++ DCWoRMS/trunk/src/example/timeestimation/DefaultTimeEstimationPlugin.java	(revision 490)
@@ -1,7 +1,8 @@
 package example.timeestimation;
 
-import gssim.schedframe.scheduling.ExecTask;
 
 import java.util.Map;
+
+import dcworms.schedframe.scheduling.ExecTask;
 
 import schedframe.events.scheduling.SchedulingEvent;
Index: DCWoRMS/trunk/src/example/globalplugin/BaseGlobalPlugin.java
===================================================================
--- DCWoRMS/trunk/src/example/globalplugin/BaseGlobalPlugin.java	(revision 481)
+++ DCWoRMS/trunk/src/example/globalplugin/BaseGlobalPlugin.java	(revision 490)
@@ -4,5 +4,5 @@
 import schedframe.PluginConfiguration;
 import schedframe.events.scheduling.SchedulingEventType;
-import schedframe.scheduling.TaskListImpl;
+import schedframe.scheduling.TaskList;
 import schedframe.scheduling.manager.resources.ResourceManager;
 import schedframe.scheduling.plugin.SchedulingPluginConfiguration;
@@ -22,5 +22,5 @@
 	}
 	
-	public int placeTasksInQueues(TaskListImpl newTasks, TaskQueueList queues, ResourceManager resourceManager,
+	public int placeTasksInQueues(TaskList newTasks, TaskQueueList queues, ResourceManager resourceManager,
 			ModuleList moduleList) {
 
Index: DCWoRMS/trunk/src/example/localplugin/FCFSCPUFreqScalingClusterLocalPlugin.java
===================================================================
--- DCWoRMS/trunk/src/example/localplugin/FCFSCPUFreqScalingClusterLocalPlugin.java	(revision 481)
+++ DCWoRMS/trunk/src/example/localplugin/FCFSCPUFreqScalingClusterLocalPlugin.java	(revision 490)
@@ -2,5 +2,4 @@
 
 import gridsim.gssim.DCWormsTags;
-import gssim.schedframe.scheduling.Executable;
 
 import java.util.ArrayList;
@@ -19,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;
@@ -31,4 +29,5 @@
 import schedframe.scheduling.tasks.TaskInterface;
 import schedframe.scheduling.tasks.WorkloadUnit;
+import dcworms.schedframe.scheduling.Executable;
 
 public class FCFSCPUFreqScalingClusterLocalPlugin extends BaseLocalSchedulingPlugin {
@@ -77,5 +76,5 @@
 			TaskFinishedEvent finEvent = (TaskFinishedEvent) event;
 			Executable exec = (Executable) jobRegistry.getExecutable(finEvent.getJobId(), finEvent.getTaskId());
-			UsedResourceList<ResourceHistoryItem> usedResourcesList = exec.getUsedResources();
+			UsedResourcesList usedResourcesList = exec.getUsedResources();
 			ProcessingElements pes = (ProcessingElements)usedResourcesList.getLast().getResourceUnits().get(StandardResourceUnitName.PE);
 			List<Processor> processors =  new ArrayList<Processor>();
Index: DCWoRMS/trunk/src/example/localplugin/BaseLocalSchedulingPlugin.java
===================================================================
--- DCWoRMS/trunk/src/example/localplugin/BaseLocalSchedulingPlugin.java	(revision 481)
+++ DCWoRMS/trunk/src/example/localplugin/BaseLocalSchedulingPlugin.java	(revision 490)
@@ -10,5 +10,5 @@
 import schedframe.resources.units.ResourceUnit;
 import schedframe.resources.units.ResourceUnitName;
-import schedframe.scheduling.TaskListImpl;
+import schedframe.scheduling.TaskList;
 import schedframe.scheduling.manager.resources.ResourceManager;
 import schedframe.scheduling.manager.tasks.JobRegistryImpl;
@@ -45,5 +45,5 @@
 	}
 	
-	public int placeTasksInQueues(TaskListImpl newTasks,
+	public int placeTasksInQueues(TaskList newTasks,
 			TaskQueueList queues, 
 			ResourceManager resourceManager, ModuleList moduleList) {
