Index: DCWoRMS/trunk/.project
===================================================================
--- DCWoRMS/trunk/.project	(revision 477)
+++ DCWoRMS/trunk/.project	(revision 477)
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>XSchedulingSimulator</name>
+	<comment>@key 32303035303932372D3520477269644578706572696D656E7453696D </comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>com.omondo.uml.std.Builder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>edu.umd.cs.findbugs.plugin.eclipse.findbugsBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+		<nature>com.omondo.uml.std.Nature</nature>
+		<nature>edu.umd.cs.findbugs.plugin.eclipse.findbugsNature</nature>
+	</natures>
+</projectDescription>
Index: DCWoRMS/trunk/start-gssim.sh
===================================================================
--- DCWoRMS/trunk/start-gssim.sh	(revision 477)
+++ DCWoRMS/trunk/start-gssim.sh	(revision 477)
@@ -0,0 +1,3 @@
+#! /bin/bash
+module load gssim/1.0
+java -Xmx1536m -Dgssim.install.dir=$GSSIM_INSTALL_DIR simulator.GridSchedulingSimulator $*
Index: DCWoRMS/trunk/src/gridsim/GridSimShutdown.java
===================================================================
--- DCWoRMS/trunk/src/gridsim/GridSimShutdown.java	(revision 477)
+++ DCWoRMS/trunk/src/gridsim/GridSimShutdown.java	(revision 477)
@@ -0,0 +1,176 @@
+/*
+ * Title:        GridSim Toolkit
+ * Description:  GridSim (Grid Simulation) Toolkit for Modeling and Simulation
+ *               of Parallel and Distributed Systems such as Clusters and Grids
+ * Licence:      GPL - http://www.gnu.org/copyleft/gpl.html
+ *
+ * $Id: GridSimShutdown.java,v 1.4 2009/01/07 14:31:54 mkrystek Exp $
+ */
+
+package gridsim;
+
+import java.util.Calendar;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import eduni.simjava.Sim_event;
+
+
+/**
+ * GridimShutdown waits for termination of all GridSim user entities to
+ * determine the end of simulation.
+ * <p>
+ * This class will be created by GridSim upon initialization of the simulation,
+ * i.e. done via <tt>GridSim.init()</tt> method. Hence, do not need to worry
+ * about creating an object of this class.
+ * <p>
+ * This class signals the user-defined report-writer
+ * entity to interact with the GridStatistics entity to generate a report.
+ * Finally, it signals the end of simulation to GridInformationService (GIS)
+ * entity.
+ *
+ * @author       Manzur Murshed and Rajkumar Buyya
+ * @since        GridSim Toolkit 1.0
+ * @invariant $none
+ * @see gridsim.GridSim#init(int, Calendar, boolean)
+ * @see gridsim.GridSim#init(int, Calendar, boolean, String[], String[], String)
+ */
+public class GridSimShutdown extends GridSimCore
+{
+    protected int numUser_;
+    protected String reportWriterName_;
+    private Log log = LogFactory.getLog(GridSimShutdown.class);
+
+    /**
+     * Allocates a new GridSimShutdown object.
+     * <p>
+     * The total number of
+     * grid user entity plays an important role to determine whether all
+     * resources should be shut down or not.
+     * If one or more users are still not finish, then the resources will not
+     * be shut down. Therefore, it is important to give a correct number of
+     * total grid user entity. Otherwise, GridSim program will hang or encounter
+     * a weird behaviour.
+     *
+     * @param name       the name to be associated with this entity (as
+     *                   required by Sim_entity class from simjava package)
+     * @param numUser    total number of grid user entity
+     * @param reportWriterName  a <tt>ReportWriter</tt> entity name. This entity
+     *                          can be found inside a gridbroker package.
+     * @throws Exception This happens when creating this entity before
+     *                   initializing GridSim package or this entity name is
+     *                   <tt>null</tt> or empty
+     * @see gridsim.GridSim#init(int, Calendar, boolean, String[], String[],
+     *          String)
+     * @see gridsim.GridSim#init(int, Calendar, boolean)
+     * @see eduni.simjava.Sim_entity
+     * @pre name != null
+     * @pre numUser >= 0
+     * @post $none
+     */
+    public GridSimShutdown(String name, int numUser,
+                String reportWriterName) throws Exception
+    {
+        // NOTE: This entity doesn't use any I/O port.
+        //super(name, GridSimTags.DEFAULT_BAUD_RATE);
+        super(name);
+        this.numUser_ = numUser;
+        this.reportWriterName_ = reportWriterName;
+    }
+
+    /**
+     * Allocates a new GridSimShutdown object.
+     * <p>
+     * The total number of
+     * grid user entity plays an important role to determine whether all
+     * resources should be shut down or not.
+     * If one or more users are still not finish, then the resources will not
+     * be shut down. Therefore, it is important to give a correct number of
+     * total grid user entity. Otherwise, GridSim program will hang or encounter
+     * a weird behaviour.
+     *
+     * @param name       the name to be associated with this entity (as
+     *                   required by Sim_entity class from simjava package)
+     * @param numUser    total number of grid user entity
+     * @throws Exception This happens when creating this entity before
+     *                   initializing GridSim package or this entity name is
+     *                   <tt>null</tt> or empty
+     * @see gridsim.GridSim#init(int, Calendar, boolean, String[], String[],
+     *          String)
+     * @see gridsim.GridSim#init(int, Calendar, boolean)
+     * @see eduni.simjava.Sim_entity
+     * @pre name != null
+     * @pre numUser >= 0
+     * @post $none
+     */
+    public GridSimShutdown(String name, int numUser) throws Exception {
+        this(name, numUser, null);
+    }
+
+    /**
+     * The main method that shuts down resources and Grid Information
+     * Service (GIS). In addition, this method writes down a report at the
+     * end of a simulation based on <tt>reportWriterName</tt> defined in
+     * the Constructor.
+     * <br>
+     * <b>NOTE:</b> This method shuts down grid resources and GIS entities
+     *              <tt>AFTER</tt> all grid users have been shut down.
+     *              Therefore, the number of grid users given in the
+     *              Constructor <tt>must</tt> be correct. Otherwise, GridSim
+     *              package hangs forever or it does not terminate properly.
+     * @pre $none
+     * @post $none
+     */
+    public void body()
+    {
+        Sim_event ev = new Sim_event();
+
+        // wait for shutdown message from all users.
+        // NOTE: this can cause GridSim to be hanged if numUser_ doesn't match
+        // with number of user entities given during GridSim.init().
+        for (int i = 0; i < numUser_; i++) {
+            super.sim_get_next(ev);
+        }
+
+        // Shutdown GIS - now GIS is responsible for informing end of simulation
+        // This is to simplify design and coding, without introducing any static
+        // methods for GridSim and GIS.
+        super.send(GridSim.getGridInfoServiceEntityId(),
+                   GridSimTags.SCHEDULE_NOW, GridSimTags.END_OF_SIMULATION);
+
+        //super.sim_pause(100); //FIXME we don't want this line at all
+
+        // Invoke report Writer and shutdown
+        if (reportWriterName_ != null)
+        {
+            int repWriterID = GridSim.getEntityId(reportWriterName_);
+            if (repWriterID != -1)
+            {
+                super.send(repWriterID, GridSimTags.SCHEDULE_NOW,
+                        GridSimTags.END_OF_SIMULATION);
+            }
+            else
+            {
+            	if(log.isErrorEnabled())
+            		log.error(super.get_name() +
+                        ": User defined Report Writer entity " +
+                        reportWriterName_ + " does not exist.");
+            }
+        }
+        else
+        {
+            // check whether GridStatistics entity has been created or not
+            int id = GridSim.getGridStatisticsEntityId();
+            if (id != -1) {
+                super.send(id, 0.0, GridSimTags.END_OF_SIMULATION);
+            }
+        }
+
+        super.terminateIOEntities();
+    }
+
+
+    /////////////////////// PRIVATE METHODS //////////////////////////
+
+} // end class
Index: DCWoRMS/trunk/src/gridsim/gssim/filter/SubTaskFilter.java
===================================================================
--- DCWoRMS/trunk/src/gridsim/gssim/filter/SubTaskFilter.java	(revision 477)
+++ DCWoRMS/trunk/src/gridsim/gssim/filter/SubTaskFilter.java	(revision 477)
@@ -0,0 +1,45 @@
+package gridsim.gssim.filter;
+
+import schedframe.scheduling.tasks.SubmittedTask;
+import eduni.simjava.Sim_event;
+import gridsim.filter.FilterResult;
+
+/**
+ * @author wojtek
+ *
+ */
+public class SubTaskFilter extends FilterResult {
+
+	public SubTaskFilter(int gridletID, int tag) {
+		super(gridletID, 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 SubmittedTask) {
+
+					SubmittedTask subTask = (SubmittedTask) obj;
+
+					if (subTask.getGridletID() == eventID_) {
+						result = true;
+					}
+				}
+			}
+		} catch (Exception e) {
+			result = false;
+		}
+
+		return result;
+	}
+
+}
Index: DCWoRMS/trunk/src/gridsim/gssim/WormsTags.java
===================================================================
--- DCWoRMS/trunk/src/gridsim/gssim/WormsTags.java	(revision 477)
+++ DCWoRMS/trunk/src/gridsim/gssim/WormsTags.java	(revision 477)
@@ -0,0 +1,31 @@
+package gridsim.gssim;
+
+import gridsim.GridSimTags;
+
+/**
+ * @author Marcin Krystek
+ */
+public class WormsTags extends GridSimTags {
+	
+	protected static final int GSSIMBASE = 600; 
+	
+	public static final int UPDATE= GSSIMBASE - 1;
+	
+	public static final int TIMER = GSSIMBASE + 1;
+	
+	public static final int TASK_READY_FOR_EXECUTION = GSSIMBASE + 2;
+	
+	public static final int TASK_EXECUTION_FINISHED = GSSIMBASE + 3;
+	
+
+	/**
+	 * Message tag: query resource about its current state in object form (load, queues, etc.)
+	 */ 
+	public static final int QUERY_RESOURCE_DESC = GSSIMBASE + 4; 
+
+	public static final int QUERY_RESOURCE_DESC_RESULT = GSSIMBASE + 5; 
+	
+	public static final int TASK_REQUESTED_TIME_EXPIRED = GSSIMBASE + 6;
+
+
+}
Index: DCWoRMS/trunk/src/simulator/stats/SimulationStatistics.java
===================================================================
--- DCWoRMS/trunk/src/simulator/stats/SimulationStatistics.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/stats/SimulationStatistics.java	(revision 477)
@@ -0,0 +1,51 @@
+package simulator.stats;
+
+public interface SimulationStatistics {
+	
+	public static final String TASK_WAITING_TIME = "Task waiting time";
+
+	public static final String MAKESPAN = "Makespan";
+	
+	public static final String TASK_COMPLETION_TIME = "Task completion time";
+	
+	public static final String DELAYED_TASKS = "Delayed tasks";
+
+	public static final String TASK_TARDINESS = "Task tardiness";
+
+	public static final String TASK_LATENESS = "Task lateness";
+	
+	public static final String TASK_START_TIME = "Task start time";
+
+	public static final String TASK_FLOW_TIME = "Task flow time";
+
+	public static final String TASK_EXECUTION_TIME = "Task execution time";
+
+	public static final String FAILED_REQUESTS = "Failed requests (tasks)";
+	
+	public static final String RESOURCES_TOTAL_LOAD = "Resources total load";
+
+	public static final String RESOURCES_RESERVATION_LOAD = "Resources reservation load";
+	
+	public static final String ENERGY_USAGE = "Energy usage";
+
+	public static final String RESOURCES_QUEUE_LENGTH = "Resources queue length";
+
+	
+	public void generateStatistics();
+	
+	public void gatherTaskStatistics();
+	
+
+	
+	public void saveSimulationStatistics();
+	
+
+
+	public String getOutputFolderName();
+
+	public GSSAccumulator getStats(String resourcesTotalLoad);
+
+	public boolean accumulatedStats();
+
+	
+}
Index: DCWoRMS/trunk/src/simulator/stats/random/MinMaxDistribution.java
===================================================================
--- DCWoRMS/trunk/src/simulator/stats/random/MinMaxDistribution.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/stats/random/MinMaxDistribution.java	(revision 477)
@@ -0,0 +1,66 @@
+package simulator.stats.random;
+
+import cern.jet.random.AbstractDistribution;
+
+/**
+ * Represents a wrapper for a specific random distribution class. The purpose of this class is
+ * to provide the random values, with a given distribution, but within a given range [min; max] - inclusive. 
+ * Min may be called a lower bound, and max an upper bound.
+ * @author Stanislaw Szczepanowski
+ *
+ */
+public class MinMaxDistribution extends AbstractDistribution {
+
+	/**
+	 * The lower bound for the allowed random values (<code>null</code> if no bound was set)
+	 */
+	protected Double min;
+	
+	/**
+	 * The upper bound for the allowed random values (<code>null</code> if no bound was set)
+	 */
+	protected Double max;
+	
+	/**
+	 * The source distribution for random values
+	 */
+	protected AbstractDistribution source;
+	
+	/**
+	 * MinMax constructor. 
+	 * It constructs the class with a given original distribution and minimal and maximal values.
+	 * @param origDistribution the original distribution, which will be the source for random numbers. It must not be <code>null</code>.
+	 * @param min the minimal allowed value for the random numbers. If a <code>null</code> value is given, then no lower bound will be set.
+	 * @param max the maximal allowed value for the random numbers. If a <code>null</code> value is given, then no upper bound will be set.
+	 */
+	public MinMaxDistribution(AbstractDistribution origDistribution, Double min, Double max) {
+		source = origDistribution;
+		
+		if (min != null && max != null) {
+			if (min > max)
+				throw new IllegalArgumentException("ERROR: invalid parameters min > max");
+		}
+		
+		this.min = min;
+		this.max = max;
+	}
+	
+	@Override
+	public double nextDouble() {
+		double value;
+		
+		for (;;) {
+			value = source.nextDouble();
+			
+			if (min != null && Double.compare(value, min) < 0)
+				continue;
+			
+			if (max != null && Double.compare(value, max) > 0)
+				continue;
+
+			break;
+		}
+		
+		return value;
+	}
+}
Index: DCWoRMS/trunk/src/simulator/stats/AccumulatedStatistics.java
===================================================================
--- DCWoRMS/trunk/src/simulator/stats/AccumulatedStatistics.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/stats/AccumulatedStatistics.java	(revision 477)
@@ -0,0 +1,205 @@
+package simulator.stats;
+
+
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.PrintStream;
+import java.util.ArrayList;
+import java.util.List;
+
+import simulator.stats.implementation.WormsStatistics;
+import gridsim.Accumulator;
+
+
+public class AccumulatedStatistics {
+
+	protected static final String ACCUMULATED_SIMULATIONS_STATISTICS_OUTPUT_FILE_NAME = "Stats_Accumulated_Simulations.txt";  
+	
+	protected List<SimulationStatistics> simulations;
+
+	public AccumulatedStatistics(int noOfSimulations) {
+		simulations = new ArrayList<SimulationStatistics>(noOfSimulations);
+	}
+
+	public AccumulatedStatistics() {
+		simulations = new ArrayList<SimulationStatistics>();
+	}
+
+	public void add(SimulationStatistics simulationStatistics) {
+		simulations.add(simulationStatistics);
+	}
+
+	public void saveStatistics() {		
+
+		SimulationStatistics simulationStatisticsNew = simulations.get(0);
+
+		if(!simulationStatisticsNew.accumulatedStats())
+			return;
+		String dirName = simulationStatisticsNew.getOutputFolderName();
+		if(dirName == null)
+			return;
+
+		PrintStream out = null;
+		try {
+			File file = new File(dirName + ACCUMULATED_SIMULATIONS_STATISTICS_OUTPUT_FILE_NAME);
+			out = new PrintStream(new FileOutputStream(file));
+		}  catch (IOException e) {
+			e.printStackTrace();
+		}
+		
+		GSSAccumulator resourceLoad = getAccumulatedResourceLoad();
+		GSSAccumulator reservationLoad = getAccumulatedReservationLoad();
+		GSSAccumulator makespan = getAccumulatedMakespan();
+		GSSAccumulator taskExecutionTime = getAccumulatedJobExecutionTime();
+		GSSAccumulator taskQueueLength = getAccumulatedQueueJobCount();
+		GSSAccumulator taskCompletionTime = getAccumulatedCompletionTime();
+		GSSAccumulator taskWaitingTime = getAccumulatedWaitingTime();
+		GSSAccumulator taskFlowTime = getAccumulatedJobFlowTime();
+		GSSAccumulator taskLateness = getAccumulatedLateness();
+		GSSAccumulator delayedTasks = getAccumulatedDelayedTasks();
+		GSSAccumulator taskTardiness = getAccumulatedTardiness();
+		GSSAccumulator failedRequests = getAccumulatedFailedRequests();
+		
+		out.print("Delayed tasks (accumulated)");
+		out.println(delayedTasks);
+		out.print("Failed requests (accumulated)");
+		out.println(failedRequests);
+		out.print("Makespan (accumulated)");
+		out.println(makespan);		
+		out.print("Resources queue length (accumulated)");
+		out.println(taskQueueLength);
+		out.print("Mean (accumulated) resource load");
+		out.println(resourceLoad);		
+		out.print("Mean (accumulated) reservation load");
+		out.println(reservationLoad);		
+		out.print("Task completion time (accumulated)");
+		out.println(taskCompletionTime);		
+		out.print("Task execution time (accumulated)");
+		out.println(taskExecutionTime);		
+		out.print("Task flow time (accumulated)");
+		out.println(taskFlowTime);
+		out.print("Task waiting time (accumulated)");
+		out.println(taskWaitingTime);
+		out.print("Task lateness (accumulated)");
+		out.println(taskLateness);		
+		out.print("Task tardiness (accumulated)");
+		out.println(taskTardiness);		
+		out.println(); 
+		out.close();
+	}
+
+	public GSSAccumulator getAccumulatedResourceLoad() {
+		GSSAccumulator resourceMeanLoad = new GSSAccumulator();	
+		for (SimulationStatistics simStat : simulations) {
+			GSSAccumulator simulationResTotalLoad = simStat.getStats(SimulationStatistics.RESOURCES_TOTAL_LOAD); 
+			resourceMeanLoad.add(simulationResTotalLoad.getMean());
+		}
+		return resourceMeanLoad; 
+	}
+
+	public GSSAccumulator getAccumulatedReservationLoad(){
+		GSSAccumulator reservationMean = new GSSAccumulator();
+		for (SimulationStatistics simStat : simulations) {
+			Accumulator simulationResvTotalLoad = simStat.getStats(SimulationStatistics.RESOURCES_RESERVATION_LOAD);
+			reservationMean.add(simulationResvTotalLoad.getMean());
+		}
+		return reservationMean;
+	}
+
+	/*public GSSAccumulator getAccumulatedBokrerThroughput() {
+		GSSAccumulator meanThroughput = new GSSAccumulator();
+		
+		for (SimulationStatisticsNew simStat : simulations) {
+			double simulationMeanThroughput = simStat.getBrokerStats().average(Sim_stat.THROUGHPUT);
+			meanThroughput.add(simulationMeanThroughput);
+		}
+		return meanThroughput;
+	}*/
+
+	public GSSAccumulator getAccumulatedJobFlowTime() {
+		GSSAccumulator meanJobFlowTime = new GSSAccumulator();
+		for (SimulationStatistics simStat : simulations) {
+			Accumulator simulationJobFlowTime = simStat.getStats(SimulationStatistics.TASK_FLOW_TIME);
+			meanJobFlowTime.add(simulationJobFlowTime.getMean());
+		}
+		return meanJobFlowTime;
+	}
+
+	public GSSAccumulator getAccumulatedLateness() {
+		GSSAccumulator meanLateness = new GSSAccumulator();
+		for (SimulationStatistics simStat : simulations) {
+			Accumulator simulationLateness = simStat.getStats(SimulationStatistics.TASK_LATENESS);
+			meanLateness.add(simulationLateness.getMean());
+		}
+		return meanLateness;
+	}
+
+	public GSSAccumulator getAccumulatedFailedRequests() {
+		GSSAccumulator meanFailedRequests = new GSSAccumulator();
+		for (SimulationStatistics simStat : simulations) {
+			Accumulator simulationFailedRequestes = simStat.getStats(SimulationStatistics.FAILED_REQUESTS);
+			meanFailedRequests.add(simulationFailedRequestes.getMean());
+		}
+		return meanFailedRequests;
+	}
+
+	public GSSAccumulator getAccumulatedTardiness() {
+		GSSAccumulator meanTardiness = new GSSAccumulator();
+		for (SimulationStatistics simStat : simulations) {
+			Accumulator simulationJobTardiness = simStat.getStats(SimulationStatistics.TASK_TARDINESS);
+			meanTardiness.add(simulationJobTardiness.getMean());
+		}
+		return meanTardiness;
+	}
+
+	public GSSAccumulator getAccumulatedDelayedTasks() {
+		GSSAccumulator delayedTasks = new GSSAccumulator();
+		for (SimulationStatistics simStat : simulations) {
+			Accumulator simulationDelayedTasks = simStat.getStats(SimulationStatistics.DELAYED_TASKS);
+			delayedTasks.add(simulationDelayedTasks.getMean());
+		}
+		return delayedTasks;
+	}
+
+	public GSSAccumulator getAccumulatedCompletionTime() {
+		GSSAccumulator meanJobCompletionTime = new GSSAccumulator();
+		
+		for (SimulationStatistics simStat : simulations) {
+			Accumulator simulationJobTurnaroundTime = simStat.getStats(SimulationStatistics.TASK_COMPLETION_TIME);
+			meanJobCompletionTime.add(simulationJobTurnaroundTime.getMean());
+		}
+		return meanJobCompletionTime;
+	}
+
+	public GSSAccumulator getAccumulatedMakespan() {
+		GSSAccumulator meanMakespan = new GSSAccumulator();
+		for (SimulationStatistics simStat : simulations) {
+			meanMakespan.add(simStat.getStats(SimulationStatistics.MAKESPAN).getMean());
+		}
+		return meanMakespan;
+	}
+
+	public GSSAccumulator getAccumulatedWaitingTime() {
+		GSSAccumulator meanWaitingTime = new GSSAccumulator();
+		for (SimulationStatistics simStat : simulations)
+			meanWaitingTime.add(simStat.getStats(SimulationStatistics.TASK_WAITING_TIME).getMean());
+		return meanWaitingTime;
+	}
+
+	public GSSAccumulator getAccumulatedJobExecutionTime() {
+		GSSAccumulator meanJobExecutionTime = new GSSAccumulator();
+		for (SimulationStatistics simStat : simulations)
+			meanJobExecutionTime.add(simStat.getStats(SimulationStatistics.TASK_EXECUTION_TIME).getMean());
+		return meanJobExecutionTime;
+	}
+
+	public GSSAccumulator getAccumulatedQueueJobCount() {
+		GSSAccumulator meanQueuJobCount = new GSSAccumulator();
+		for (SimulationStatistics simStat : simulations)
+			meanQueuJobCount.add(simStat.getStats(SimulationStatistics.RESOURCES_QUEUE_LENGTH).getMean());
+		return meanQueuJobCount;
+	}
+
+}
Index: DCWoRMS/trunk/src/simulator/stats/implementation/ResourceUsageStats.java
===================================================================
--- DCWoRMS/trunk/src/simulator/stats/implementation/ResourceUsageStats.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/stats/implementation/ResourceUsageStats.java	(revision 477)
@@ -0,0 +1,65 @@
+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 {
+
+	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" };
+
+	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;
+	}
+
+	public Object serialize(StatsSerializer serializer) {
+		return serializer.visit(this);
+	}
+
+	public String[] getHeaders() {
+		return headers;
+	}
+
+}
Index: DCWoRMS/trunk/src/simulator/stats/implementation/AccumulatedResourceStats.java
===================================================================
--- DCWoRMS/trunk/src/simulator/stats/implementation/AccumulatedResourceStats.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/stats/implementation/AccumulatedResourceStats.java	(revision 477)
@@ -0,0 +1,55 @@
+package simulator.stats.implementation;
+
+import simulator.stats.GSSAccumulator;
+import simulator.stats.implementation.out.StatsSerializer;
+
+/**
+ * 
+ * @author Marcin Krystek
+ * 
+ */
+public class AccumulatedResourceStats implements StatsInterface {
+
+	// accumulated resource statistic
+	protected GSSAccumulator resourceLoad;
+	protected GSSAccumulator resourceReservationLoad;
+	protected String resourceName;
+
+	private String[] headers = { "Resource name", "Factor's name", "mean",
+			"stdev", "variance", "minimum", "maximum", "sum", "count" };
+
+	public AccumulatedResourceStats(String resourceName) {
+		this.resourceName = resourceName;
+		this.resourceLoad = new GSSAccumulator();
+		this.resourceReservationLoad = new GSSAccumulator();
+	}
+
+	public String getResourceName() {
+		return this.resourceName;
+	}
+
+	public void addResourceLoad(double load) {
+		this.resourceLoad.add(load);
+	}
+
+	public void addReservationLoad(double load) {
+		this.resourceReservationLoad.add(load);
+	}
+
+	public GSSAccumulator getResourceLoad() {
+		return this.resourceLoad;
+	}
+
+	public GSSAccumulator getResourceReservationLoad() {
+		return this.resourceReservationLoad;
+	}
+
+	public Object serialize(StatsSerializer serializer) {
+		return serializer.visit(this);
+	}
+
+	public String[] getHeaders() {
+		return headers;
+	}
+
+}
Index: DCWoRMS/trunk/src/simulator/stats/implementation/GSSAccumulatorsStats.java
===================================================================
--- DCWoRMS/trunk/src/simulator/stats/implementation/GSSAccumulatorsStats.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/stats/implementation/GSSAccumulatorsStats.java	(revision 477)
@@ -0,0 +1,72 @@
+package simulator.stats.implementation;
+
+import simulator.stats.GSSAccumulator;
+import simulator.stats.implementation.out.StatsSerializer;
+
+public class GSSAccumulatorsStats implements StatsInterface {
+
+	public GSSAccumulator meanTotalLoad;
+	public GSSAccumulator meanReservationLoad;
+	public GSSAccumulator meanQueueLength;
+	public GSSAccumulator meanEnergyUsage;
+
+	public GSSAccumulator meanTaskStartTime;
+	public GSSAccumulator meanTaskCompletionTime;
+	public GSSAccumulator meanTaskExecutionTime;
+	public GSSAccumulator meanTaskWaitingTime;
+	public GSSAccumulator meanTaskFlowTime;
+	public GSSAccumulator lateness;
+	public GSSAccumulator tardiness;
+	public GSSAccumulator delayedTasks;
+	public GSSAccumulator failedRequests;
+	public GSSAccumulator makespan;
+
+	private String[] headers = { "Resource name", "mean", "stdev", "variance",
+			"minimum", "maximum", "sum", "count" };
+
+	public GSSAccumulatorsStats() {
+		meanTotalLoad = new GSSAccumulator();
+		meanReservationLoad = new GSSAccumulator();
+		meanQueueLength = new GSSAccumulator();
+		meanEnergyUsage = new GSSAccumulator();
+
+		meanTaskStartTime = new GSSAccumulator();
+		meanTaskCompletionTime = new GSSAccumulator();
+		meanTaskExecutionTime = new GSSAccumulator();
+		meanTaskWaitingTime = new GSSAccumulator();
+		meanTaskFlowTime = new GSSAccumulator();
+		lateness = new GSSAccumulator();
+		tardiness = new GSSAccumulator();
+		delayedTasks = new GSSAccumulator();
+		failedRequests = new GSSAccumulator();
+		makespan = new GSSAccumulator();
+	}
+
+	/*
+	 * public static String getAcccumulatorHeader() {
+	 * 
+	 * String accumulatorSeparator = ";";
+	 * 
+	 * StringBuffer buffer = new StringBuffer(260);
+	 * 
+	 * buffer.append(header[0]); buffer.append(accumulatorSeparator);
+	 * buffer.append(header[1]); buffer.append(accumulatorSeparator);
+	 * buffer.append(header[2]); buffer.append(accumulatorSeparator);
+	 * buffer.append(header[3]); buffer.append(accumulatorSeparator);
+	 * buffer.append(header[4]); buffer.append(accumulatorSeparator);
+	 * buffer.append(header[5]); buffer.append(accumulatorSeparator);
+	 * buffer.append(header[6]); buffer.append(accumulatorSeparator);
+	 * buffer.append(header[7]); buffer.append(accumulatorSeparator);
+	 * buffer.append(header[8]); buffer.append(accumulatorSeparator);
+	 * 
+	 * return buffer.toString(); }
+	 */
+
+	public Object serialize(StatsSerializer serializer) {
+		return serializer.visit(this);
+	}
+
+	public String[] getHeaders() {
+		return headers;
+	}
+}
Index: DCWoRMS/trunk/src/simulator/stats/implementation/StatsInterface.java
===================================================================
--- DCWoRMS/trunk/src/simulator/stats/implementation/StatsInterface.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/stats/implementation/StatsInterface.java	(revision 477)
@@ -0,0 +1,10 @@
+package simulator.stats.implementation;
+
+import simulator.stats.implementation.out.StatsSerializer;
+
+public interface StatsInterface {
+
+	public Object serialize(StatsSerializer serializer);
+	public String[] getHeaders();
+	
+}
Index: DCWoRMS/trunk/src/simulator/stats/implementation/ResourceEnergyStats.java
===================================================================
--- DCWoRMS/trunk/src/simulator/stats/implementation/ResourceEnergyStats.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/stats/implementation/ResourceEnergyStats.java	(revision 477)
@@ -0,0 +1,66 @@
+package simulator.stats.implementation;
+
+import java.util.Map;
+import java.util.TreeMap;
+
+import schedframe.resources.ResourceType;
+import simulator.stats.implementation.out.StatsSerializer;
+
+public class ResourceEnergyStats {
+	protected Map<Long, Double> energy;
+	protected String resourceName;
+	protected String usageType;
+	protected ResourceType resourceType;
+	protected double meanUsage;
+	protected double sumUsage;
+	
+	public void setSumUsage(double sumUsage) {
+		this.sumUsage = sumUsage;
+	}
+
+	public double getSumUsage() {
+		return sumUsage;
+	}
+	public void setMeanUsage(double meanUsage) {
+		this.meanUsage = meanUsage;
+	}
+	
+	public double getMeanUsage() {
+		return meanUsage;
+	}
+	
+	private String[] headers = { "resourceName", "timestamp", "usage" };
+	
+	public ResourceEnergyStats (String resourceName, ResourceType resourceType, String usageType) {
+		this.resourceName = resourceName;
+		this.resourceType = resourceType;
+		this.usageType = usageType;
+		this.energy = new TreeMap<Long, Double>();
+		this.meanUsage = 0;
+	}
+
+	public String getResourceName() {
+		return this.resourceName;
+	}
+	
+	public ResourceType getResourceType() {
+		return resourceType;
+	}
+
+	public String getUsageType() {
+		return this.usageType;
+	}	
+
+	public Map<Long, Double> getEnergy() {
+		return this.energy;
+	}
+
+	public Object serialize(StatsSerializer serializer) {
+		return serializer.visit(this);
+	}
+
+	public String[] getHeaders() {
+		return headers;
+	}
+
+}
Index: DCWoRMS/trunk/src/simulator/stats/implementation/TaskStats.java
===================================================================
--- DCWoRMS/trunk/src/simulator/stats/implementation/TaskStats.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/stats/implementation/TaskStats.java	(revision 477)
@@ -0,0 +1,181 @@
+package simulator.stats.implementation;
+
+import gssim.schedframe.scheduling.Executable;
+
+import java.util.List;
+
+import simulator.stats.implementation.out.StatsSerializer;
+
+/**
+ * 
+ * @author Marcin Krystek
+ * 
+ */
+public class TaskStats implements StatsInterface {
+	protected List<String> processorsName;
+	protected double reservationStartDate;
+	protected double reservationFinishDate;
+
+	protected Executable task;
+	protected long startSimulationTimeSek;
+	
+	private String headers[] = { "JobID", "TaskID", "UserDN", "ResName", "CpuCnt",
+			"ExecStartDate", "ExecFinishDate", "ExecEndDate", "GB_SubDate",
+			"LB_SubDate", "CompletionTime", "ExecStartTime",
+			"ExecutionTime", "ReadyTime", "StartTime", "FlowTime",
+			"WaitingTime", "GQ_WaitingTime", "Lateness", "Tardiness",
+			"ReservStartDate", "ReservFinishDate", "ProcessorName", "Energy"};
+
+	public TaskStats(Executable task, long startSimulationTime) {
+		this.task = task;
+		this.startSimulationTimeSek = startSimulationTime / 1000;
+	}
+
+	public Object serialize(StatsSerializer serializer) {
+		return serializer.visit(this);
+	}
+
+	public String getJobID() {
+		return this.task.getJobId();
+	}
+
+	public String getTaskID() {
+		return this.task.getId();
+	}
+
+	public String 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 += " ";
+		}
+		return resName;
+	}
+
+	public long getCpuCnt() {
+		long cpuCnt = -1;
+		try {
+			cpuCnt = Double.valueOf(task.getCpuCntRequest()).longValue();
+		} catch (NoSuchFieldException e) {
+		}
+
+		return cpuCnt;
+	}
+
+	public double getExecStartDate() {
+		return task.getExecStartTime();
+	}
+
+	public double getExecFinishDate() {
+		return task.getFinishTime();
+	}
+
+	public double getExecEndDate() {
+		double ret = -1;
+		try {
+			ret = task.getExecutionEndTime().getMillis() / 1000;
+		} catch (NoSuchFieldException e) {
+			ret = task.getFinishTime();
+		}
+		return ret;
+	}
+
+	public double getGB_SubDate() {
+		return task.getSubmissionTimeToBroker().getMillis() / 1000;
+	}
+
+	public double getLB_SubDate() {
+		return task.getSubmissionTime();
+	}
+
+	public double getCompletionTime() {
+		return task.getFinishTime() - startSimulationTimeSek;
+	}
+
+	public double getExecutionTime() {
+		return task.getFinishTime() - task.getExecStartTime();
+	}
+
+	public double getExecStartTime() {
+		return task.getExecStartTime() - startSimulationTimeSek;
+	}
+
+	public double getReadyTime() {
+		double readyTime = 0;
+
+		try {
+			readyTime = task.getExecutionStartTime().getMillis() / 1000
+					- startSimulationTimeSek;
+		} catch (Exception ex) {
+			readyTime = task.getSubmissionTimeToBroker().getMillis()/1000 - startSimulationTimeSek;
+		}
+
+		return readyTime;
+	}
+
+	public double getStartTime() {
+		return task.getExecStartTime()
+				- task.getSubmissionTimeToBroker().getMillis() / 1000;
+	}
+
+	public double getFlowTime() {
+		return getCompletionTime() - getReadyTime();
+	}
+
+	public double getWaitingTime() {
+		return task.getWaitingTime();
+	}
+
+	public double getGQ_WaitingTime() {
+		return task.getSubmissionTime()
+				- task.getSubmissionTimeToBroker().getMillis() / 1000;
+	}
+
+	public double getLateness() {
+		double execEndDate = getExecEndDate();
+		double lateness = 0;
+		if (execEndDate != -1) {
+			lateness = task.getFinishTime() - execEndDate;
+		}
+		return lateness;
+	}
+
+	public double getTardiness() {
+		return Math.max(getLateness(), 0.0);
+	}
+
+	public void setProcessorsName(List<String> value) {
+		this.processorsName = value;
+	}
+
+	public void setReservationStartDate(double value) {
+		this.reservationStartDate = value;
+	}
+
+	public void setReservationFinishDate(double value) {
+		this.reservationFinishDate = value;
+	}
+
+	public List<String> getProcessorsName() {
+		return processorsName;
+	}
+
+	public double getReservationStartDate() {
+		return reservationStartDate;
+	}
+
+	public double getReservationFinishDate() {
+		return reservationFinishDate;
+	}
+
+	public String[] getHeaders() {
+		return headers;
+	}
+
+}
Index: DCWoRMS/trunk/src/simulator/stats/implementation/WormsStatistics.java
===================================================================
--- DCWoRMS/trunk/src/simulator/stats/implementation/WormsStatistics.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/stats/implementation/WormsStatistics.java	(revision 477)
@@ -0,0 +1,1441 @@
+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.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.DateTime;
+import org.joda.time.DateTimeUtilsExt;
+
+import schedframe.ResourceController;
+import schedframe.exceptions.ResourceException;
+import schedframe.resources.ResourceType;
+import schedframe.resources.StandardResourceType;
+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.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.JobRegistryImpl;
+import schedframe.scheduling.tasks.Job;
+import schedframe.scheduling.tasks.JobInterface;
+import simulator.ConfigurationOptions;
+import simulator.DataCenterWorkloadSimulator;
+import simulator.GenericUser;
+import simulator.WormsConstants;
+import simulator.stats.GSSAccumulator;
+import simulator.stats.SimulationStatistics;
+import simulator.stats.implementation.out.AbstractStringSerializer;
+import simulator.stats.implementation.out.FormatedStringSerializer;
+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 eduni.simjava.Sim_stat;
+import gssim.schedframe.scheduling.ExecTask;
+import gssim.schedframe.scheduling.Executable;
+
+public class WormsStatistics implements SimulationStatistics {
+
+	private Log log = LogFactory.getLog(WormsStatistics.class);
+
+	protected static float ALPHA = 0.5f;
+	protected static int GANTT_WIDTH = 1200;
+
+	//protected static final int BITS = 8;
+	//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 ENERGYUSAGE_STATISTICS_OUTPUT_FILE_NAME = "Energy.txt";
+	protected static final String RESOURCEUSAGE_STATISTICS_OUTPUT_FILE_NAME = "ResourceUtilization.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;
+	
+	private GenericUser users;
+	protected ResourceController resourceController;
+	protected boolean generateDiagrams = true;
+	protected AbstractStringSerializer serializer;
+	protected long startSimulationTime;
+	protected long endSimulationTime;
+	
+	
+	//RESOURCES
+	protected Timetable ganttDiagramPeTimetable;
+	protected Map<ResourceType, List<XYDataset>> resourceEnergyDiagrams;
+	protected Map<ResourceType, List<XYDataset>> resourceLoadDiagrams;
+	protected Map<String,List<ResStat>> basicResStats;
+	protected HashMap<String, Double> basicResLoad;
+	
+	protected Map<String, TimetableEventSource> peGanttMap;
+	protected Map<String, TimetableEventGroup> taskGanttMap;
+	
+	
+	//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 JobRegistryImpl jr;
+
+	
+	public WormsStatistics(String simulationIdentifier, ConfigurationOptions co, GenericUser users,
+			String outputFolderName, ResourceController resourceController) {
+		this.simulationIdentifier = simulationIdentifier;
+		this.configuration = co;
+		this.users = users;
+
+		this.outputFolderName = outputFolderName;
+
+		if (this.configuration.formatstatisticsoutput)
+			this.serializer = new FormatedStringSerializer();
+		else
+			this.serializer = new StringSerializer();
+
+		this.serializer.setDefaultNumberFormat(DataCenterWorkloadSimulator.DFAULT_NUMBER_FORMAT);
+
+		this.resourceController = resourceController;
+		 jr = new JobRegistryImpl("COMPUTING_GRID_0#BROKER");
+		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) / 1000));
+		
+		log.info("gatherTaskStatistics");
+		s = System.currentTimeMillis();
+		gatherTaskStatistics();
+		e = System.currentTimeMillis();
+		log.info("time in sec: " + ((e - s) / 1000));
+
+		log.info("saveSimulationStatistics");
+		s = System.currentTimeMillis();
+		saveSimulationStatistics();
+		e = System.currentTimeMillis();
+		log.info("time in sec: " + ((e - s) / 1000));
+	}
+
+
+	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() {
+		
+		
+		//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);
+		
+		
+		
+		peGanttMap = new HashMap<String, TimetableEventSource>();
+		taskGanttMap = new HashMap<String, TimetableEventGroup>();
+		
+		
+		resourceLoadDiagrams = new HashMap<ResourceType, List<XYDataset>>();
+		resourceEnergyDiagrams = new HashMap<ResourceType, List<XYDataset>>();
+		
+		ganttDiagramPeTimetable = new Timetable(new FixedMillisecond(
+				startSimulationTime), new FixedMillisecond(endSimulationTime));
+		
+		PrintStream resourceLoadStatsFile = null;
+		try {
+			File file = new File(outputFolderName + STATS_FILE_NAME_PREFIX
+					+ simulationIdentifier + "_"
+					+ RESOURCEUSAGE_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;
+		}
+		
+		basicResStats = gatherPEStats(JobRegistryImpl.getAllocationHistory());
+		peStatsPostProcessing(basicResStats);
+		basicResLoad = calculatePELoad( basicResStats);
+
+		if (configuration.creatediagrams_processors) {
+			createPEGanttDiagram(basicResStats);
+		}
+		
+		for(StandardResourceType resType: resForAnalyze){
+			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());*/
+			} catch (Exception e) {
+				continue;
+			}
+			if(type_stats.containsKey(resType)){
+				Map<String, GSSAccumulator> energyCategoryStats = new TreeMap<String, GSSAccumulator>();
+				Map<String, GSSAccumulator> loadCategoryStats = new TreeMap<String, GSSAccumulator>();
+				for(ComputingResource resource: resources){
+					ResourceUsageStats resourceUsage = null;
+					ResourceEnergyStats energyUsage = null;
+					if(type_stats.get(resType).contains(Stats.textLoad)){
+						resourceUsage = gatherResourceLoadStats(resource, basicResStats);
+						resourceUsage.setMeanUsage(calculateResourceLoad(resource, basicResLoad));
+						if (resourceLoadStatsFile != null) {
+							Object txt = resourceUsage.serialize(serializer);
+							resourceLoadStatsFile.println(txt);
+						}
+					}
+					if(type_stats.get(resType).contains(Stats.chartLoad)){
+						if (configuration.creatediagrams_resources) {
+							createResourceLoadDiagram(resourceUsage);
+						}
+					}
+					if(type_stats.get(resType).contains(Stats.textEnergy)){
+						energyUsage = gatherResourceEnergyStats(resource);
+						energyUsage.setMeanUsage(calculateEnergyLoad(energyUsage));
+						energyUsage.setSumUsage(energyUsage.getMeanUsage() * (endSimulationTime - startSimulationTime) / (3600 * 1000));
+						
+						EnergyExtension een = (EnergyExtension )(resource.getExtensionList().getExtension(ExtensionType.ENERGY_EXTENSION));
+						if(resourceController.getComputingResources().contains(resource)) {
+							if( een != null /*&& een.getPp() != null*/ ){
+								accStats.meanEnergyUsage.add(energyUsage.meanUsage);
+							}
+
+						} 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.meanUsage);
+							}
+						}
+						if (energyStatsFile != null) {
+							Object txt = energyUsage.serialize(serializer);
+							energyStatsFile.println(txt);
+						}
+					}
+					if(type_stats.get(resType).contains(Stats.chartEnergy)){
+
+						if (configuration.creatediagrams_energyusage) {
+							createResourceEnergyGanttDiagram(energyUsage);
+						}
+					}
+					
+					/*if(resType == ResourceType.ComputingNode){
+						ComputingNode compNode = (ComputingNode) resource;
+						if(energyCategoryStats.containsKey(resType+"#"+compNode.getCategory().getName())){
+							GSSAccumulator acc = energyCategoryStats.get(resType+"#"+compNode.getCategory().getName());
+							acc.add(energyUsage.meanUsage);
+							energyCategoryStats.put(resType+"#"+compNode.getCategory().getName(), acc);
+						} else{
+							GSSAccumulator acc = new GSSAccumulator();
+							acc.add(energyUsage.meanUsage);
+							energyCategoryStats.put(resType+"#"+compNode.getCategory().getName(), acc);
+						}
+						
+						if(loadCategoryStats.containsKey(resType+"#"+compNode.getCategory().getName())){
+							GSSAccumulator acc = loadCategoryStats.get(resType+"#"+compNode.getCategory().getName());
+							acc.add(resourceUsage.meanUsage);
+							loadCategoryStats.put(resType+"#"+compNode.getCategory().getName(), acc);
+						} else{
+							GSSAccumulator acc = new GSSAccumulator();
+							acc.add(resourceUsage.meanUsage);
+							loadCategoryStats.put(resType+"#"+compNode.getCategory().getName(), acc);
+						}
+					} else if(resType == ResourceType.Processor){
+						Processor proc = (Processor)resource;
+						if(energyCategoryStats.containsKey(resType+"#"+proc.getComputingNode().getCategory().getName())){
+							GSSAccumulator acc = energyCategoryStats.get(resType+"#"+proc.getComputingNode().getCategory().getName());
+							acc.add(energyUsage.meanUsage);
+							energyCategoryStats.put(resType+"#"+proc.getComputingNode().getCategory().getName(), acc);
+						} else{
+							GSSAccumulator acc = new GSSAccumulator();
+							acc.add(energyUsage.meanUsage);
+							energyCategoryStats.put(resType+"#"+proc.getComputingNode().getCategory().getName(), acc);
+						}
+						
+						if(loadCategoryStats.containsKey(resType+"#"+proc.getComputingNode().getCategory().getName())){
+							GSSAccumulator acc = loadCategoryStats.get(resType+"#"+proc.getComputingNode().getCategory().getName());
+							acc.add(resourceUsage.meanUsage);
+							loadCategoryStats.put(resType+"#"+proc.getComputingNode().getCategory().getName(), acc);
+						} else{
+							GSSAccumulator acc = new GSSAccumulator();
+							acc.add(resourceUsage.meanUsage);
+							loadCategoryStats.put(resType+"#"+proc.getComputingNode().getCategory().getName(), acc);
+						}
+					}*/
+				}
+				
+				if(energyCategoryStats.size() > 0)
+				{
+					energyStatsFile.println("\n=========BY CATEGORY===========");
+					for(String key: energyCategoryStats.keySet()){
+						GSSAccumulator acc = energyCategoryStats.get(key);
+						energyStatsFile.println(key + "- mean: "  + acc.getMean()+ " sum: " +acc.getMean() * (endSimulationTime-startSimulationTime) / (3600 * 1000) * acc.getCount());
+					}
+					energyStatsFile.println("\n\n");
+				}
+				
+				if(loadCategoryStats.size() > 0)
+				{
+					resourceLoadStatsFile.println("\n=========BY CATEGORY===========");
+					for(String key: loadCategoryStats.keySet()){
+						GSSAccumulator acc = loadCategoryStats.get(key);
+						resourceLoadStatsFile.println(key + "- mean: "  + acc.getMean());
+					}
+					resourceLoadStatsFile.println("\n\n");
+				}
+			}
+		}
+		
+		saveResourceGanttDiagrams();
+		createAccumulatedResourceSimulationStatistic();
+		if (energyStatsFile != null) {
+			energyStatsFile.close();
+		}
+		if (resourceLoadStatsFile != null) {
+			resourceLoadStatsFile.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(WormsConstants.TASKS_QUEUE_LENGTH_MEASURE_NAME)) {
+				return stats.average(measure);
+			}
+		}
+		return 0;
+	}
+	
+	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(Map<Integer, Map<String, Object>> history) {
+
+		Map<String, List<ResStat>> basicResStats = new TreeMap<String, List<ResStat>>(new MapPEIdComparator());
+		
+		for (Integer executableId : history.keySet()) {
+
+			Map<String, Object> historyItem = (Map<String, Object>) history.get(executableId);
+			List<ResourceHistoryItem> resHistItemList = (List<ResourceHistoryItem>) historyItem.get(WormsConstants.RESOURCES);
+			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 = ((DateTime) historyItem.get(WormsConstants.START_TIME)).getMillis();
+					long endDate = ((DateTime) historyItem.get(WormsConstants.END_TIME)).getMillis();
+					JobRegistryImpl jr = new JobRegistryImpl("stats");
+					ExecTask execTask = jr.getTaskExecutable(executableId);
+					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");
+		for(String resName: basicStats.keySet()){
+			try {
+				if(resource.getDescendantByName(resName) != null || resource.getName().compareTo(resName) == 0){
+					createResourceLoadData(usageStats, basicStats.get(resName));
+				}
+			} catch (ResourceException e) {
+				// TODO Auto-generated catch block
+				e.printStackTrace();
+			}
+		}
+		return usageStats;
+	}
+	
+	private TreeMap<Long, Integer> createResourceLoadData(ResourceUsageStats usageStats, List<ResStat> resStats) {
+
+		TreeMap<Long, Integer> ganttData = (TreeMap)usageStats.getUsage();
+		for (ResStat resStat : resStats) {
+			
+			long start_time = resStat.getStartDate();
+			long end_time = resStat.getEndDate();
+			if (end_time > start_time) {
+				Integer end = ganttData.get(end_time);
+				if (end == null) {
+					ganttData.put(end_time, 0);
+					Long left = getLeftKey(ganttData, end_time);
+					if (left != null) {
+						Integer leftValue = ganttData.get(left);
+						ganttData.put(end_time, leftValue);
+					}
+				}
+
+				Integer start = ganttData.get(start_time);
+				if (start == null) {
+					ganttData.put(start_time, 0);
+					Long left = getLeftKey(ganttData, start_time);
+					if (left != null) {
+						Integer leftValue = ganttData.get(left);
+						ganttData.put(start_time, leftValue);
+					}
+				}
+
+				SortedMap<Long, Integer> sm = ganttData.subMap(start_time,
+						end_time);
+				for (Long key : sm.keySet()) {
+					Integer keyVal = ganttData.get(key);
+					ganttData.put(key, keyVal + 1);
+				}
+			}
+		}
+		return ganttData;
+	}
+
+	private Long getLeftKey(TreeMap<Long, Integer> ganttData, Long toKey) {
+
+		SortedMap<Long, Integer> sm = ganttData.headMap(toKey);
+		if (sm.isEmpty()) {
+			return null;
+		}
+		return sm.lastKey();
+	}
+	
+	
+	private ResourceEnergyStats gatherResourceEnergyStats(ComputingResource resource) {
+		double power = 0;
+		ResourceEnergyStats resEnergyUsage = new ResourceEnergyStats(resource.getName(), resource.getType(), "resourceEnergyStats");
+		Map<Long, Double> usage = resEnergyUsage.getEnergy();
+		
+		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 * 1000);
+						lastPower = pu.getValue();
+						lastTime = pu.getTimestamp();
+					}
+				}
+			}
+		}
+		//System.out.println(power);
+		return resEnergyUsage;
+	}
+	
+	private void createResourceEnergyGanttDiagram(ResourceEnergyStats energyUsage) {
+
+		XYDataset dataset = createResourceEnergyGanttDataSet(energyUsage,
+				startSimulationTime, endSimulationTime);
+		
+		List<XYDataset> energyDiagram = resourceEnergyDiagrams.get(energyUsage.getResourceType());
+		if(energyDiagram == null){
+			energyDiagram = new ArrayList<XYDataset>();
+			energyDiagram.add(dataset);
+			resourceEnergyDiagrams.put(energyUsage.getResourceType(), energyDiagram);
+		} else {
+			energyDiagram.add(dataset);
+		}
+
+	}
+
+	private XYDataset createResourceEnergyGanttDataSet(
+			ResourceEnergyStats energyUsage, long start, long end) {
+
+		TreeMap<Long, Double> ganttdata = createResourceEnergyGanttData(energyUsage);
+		XYSeriesCollection dataset = new XYSeriesCollection();
+		XYSeries data = new XYSeries(energyUsage.getResourceName(), false, true);
+		//data.add(start, 0);
+		for (Long key : ganttdata.keySet()) {
+			Double val = ganttdata.get(key);
+			data.add(key, val);
+		}
+		data.add(end, 0);
+		dataset.addSeries(data);
+		return dataset;
+	}
+
+	private TreeMap<Long, Double> createResourceEnergyGanttData(
+			ResourceEnergyStats energyUsage) {
+
+		Map<Long, Double> energy = energyUsage.getEnergy();
+		TreeMap<Long, Double> ganttData = new TreeMap<Long, Double>();
+		for (Long euKey : energy.keySet()) {
+
+			ganttData.put(euKey, energy.get(euKey));
+		}
+		return ganttData;
+	}
+
+
+	private boolean saveResourceGanttDiagrams() {
+		JFreeChart resourceDiagram = null;
+		JFreeChart peDiagram = null;
+		JFreeChart resourceEnergyDiagram = 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_processors) {
+			peDiagram = getPeGanttDiagram(chartName, subtitle,
+					simulationTime);
+			if (!saveCategoryChart(peDiagram, fileName + "Gantt",
+					"{0}"))
+				return false;
+		}
+
+		if (configuration.creatediagrams_resources) {
+			for(ResourceType resType: resourceLoadDiagrams.keySet()){
+				resourceDiagram = getResourcesLoadDiagram(resType, chartName, subtitle,
+						simulationTime);
+				if (!saveXYPlotChart(resourceDiagram, fileName + "Resources Load - "+resType))
+					return false;
+			}
+
+		}
+		if (configuration.creatediagrams_energyusage) {
+			for(ResourceType resType: resourceEnergyDiagrams.keySet()){
+				resourceEnergyDiagram = getResourcesEnergyDiagram(resType, chartName,
+						subtitle, simulationTime);
+				if (!saveXYPlotChart(resourceEnergyDiagram, fileName + "Energy - "+resType))
+					return false;
+			}
+		}
+		return true;
+	}
+	
+	private JFreeChart getResourcesLoadDiagram(ResourceType resType, String chartName, Title subtitle,
+			String simulationTime) {
+		String cpu = "CPU";
+		boolean urls = false;
+		boolean tooltip = true;
+		boolean legend = true;
+		CombinedDomainXYPlot cPlot = new CombinedDomainXYPlot();
+		DateAxis xAxis = new DateAxis(simulationTime);
+		JFreeChart chart = null;
+
+		List<XYDataset> loadDiagram = resourceLoadDiagrams.get(resType);
+		for (XYDataset dataset : loadDiagram) {
+			JFreeChart tChart = ChartFactory.createXYStepAreaChart("", "",
+				null, dataset, PlotOrientation.VERTICAL, legend, tooltip,
+				urls);
+			XYPlot tPlot = tChart.getXYPlot();
+			NumberAxis yAxis = new NumberAxis(cpu);
+			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 JFreeChart getResourcesEnergyDiagram(ResourceType resType, String chartName,
+			Title subtitle, String simulationTime) {
+		String energy = "ENERGY [W]";
+		boolean urls = false;
+		boolean tooltip = true;
+		boolean legend = true;
+		CombinedDomainXYPlot cPlot = new CombinedDomainXYPlot();
+		DateAxis xAxis = new DateAxis(simulationTime);
+
+		List<XYDataset> energyDiagram = resourceEnergyDiagrams.get(resType);
+		for (XYDataset dataset : energyDiagram) {
+
+			JFreeChart tChart = ChartFactory.createXYStepAreaChart("", "",
+					null, dataset, PlotOrientation.VERTICAL, legend, tooltip,
+					urls);
+
+			XYPlot tPlot = tChart.getXYPlot();
+			NumberAxis yAxis = new NumberAxis(energy);
+			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);
+		JFreeChart chart = new JFreeChart(chartName, cPlot);
+		chart.addSubtitle(subtitle);
+		return chart;
+	}
+	
+	
+	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,
+				ganttDiagramPeTimetable, legend, tooltip);
+		chart.addSubtitle(subtitle);
+		TimetableRenderer rend = (TimetableRenderer) chart.getCategoryPlot()
+				.getRenderer();
+		rend.setBackgroundBarPaint(null);
+		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 gssimSubtitle = "Created by "
+				+ DataCenterWorkloadSimulator.SIMULATOR_NAME
+				+ " http://www.gssim.org/";
+		c.addSubtitle(new TextTitle(gssimSubtitle));
+		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);
+			ganttDiagramPeTimetable.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);
+					ganttDiagramPeTimetable.addEventGroup(task);
+				}
+				ganttDiagramPeTimetable.addEvent(pe, task,
+						new FixedMillisecond(startDate), new FixedMillisecond(endDate));
+			}
+		}
+	}
+
+	private void createResourceLoadDiagram(ResourceUsageStats resStats) {
+
+		XYDataset dataset = createResourceLoadDataSet(resStats);
+
+		List<XYDataset> loadDiagram = resourceLoadDiagrams.get(resStats.getResourceType());
+		if(loadDiagram == null){
+			loadDiagram = new ArrayList<XYDataset>();
+			loadDiagram.add(dataset);
+			resourceLoadDiagrams.put(resStats.getResourceType(), loadDiagram);
+		} else {
+			loadDiagram.add(dataset);
+		}
+	}
+
+	private XYDataset createResourceLoadDataSet(ResourceUsageStats resStats) {
+
+		XYSeriesCollection dataset = new XYSeriesCollection();
+		XYSeries data = new XYSeries(resStats.resourceName, false, true);
+		Map<Long, Integer> usage = resStats.getUsage();
+		
+		for (Long key : usage.keySet()) {
+			Integer val = usage.get(key);
+			double newv =100*val/basicResStats.size();
+			int newinv = (int)newv;
+			data.add(key, new Integer(newinv));
+		}
+		dataset.addSeries(data);
+		return dataset;
+	}
+
+	private void createAccumulatedResourceSimulationStatistic() {
+
+		List<ComputingResource> resources = resourceController.getComputingResources();
+		for(ComputingResource compRes: resources){
+			//for(ComputingResource child :compRes.getChildren()){
+				double load = calculateResourceLoad(compRes, basicResLoad);
+				accStats.meanTotalLoad.add(load);
+				/*ResourceEnergyStats energyUsage = gatherResourceEnergyStats(compRes);
+				energyUsage.setMeanUsage(calculateEnergyLoad(energyUsage));
+				accStats.meanEnergyUsage.add(energyUsage.meanUsage);*/
+			//}	
+		}
+	}
+
+	private HashMap<String, Double> calculatePELoad(Map<String,List<ResStat>> basicResStats){
+		HashMap<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, HashMap<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 calculateEnergyLoad(ResourceEnergyStats resEnergyStats ){
+		double meanEnergyUsage = 0;
+		long time = 0;
+		double usage = 0;
+		Map<Long, Double> enUsage = resEnergyStats.getEnergy();
+		for (Long key : enUsage.keySet()) {
+			
+			if (time != 0) {
+				meanEnergyUsage += (usage * (key - time))
+						/ (endSimulationTime - startSimulationTime);
+
+				time = key;
+			} else {
+				time = key;
+			}
+			usage = (double) enUsage.get(key);
+		}
+		return meanEnergyUsage;
+	}
+	
+	/*private void createPEGanttDiagram(String peName,
+			String uniqueTaskID, Map<String, Object> historyItem) {
+		TimetableEventSource pe = peGanttMap.get(peName);
+		if(pe == null){
+			pe = new TimetableEventSource(peName);
+			ganttDiagramPETimetable.addEventSource(pe);
+			peGanttMap.put(peName, pe);
+		}
+		TimetableEventGroup task = taskGanttMap.get(uniqueTaskID);
+		long startDate = ((DateTime) historyItem.get(GssimConstants.START_TIME))
+				.getMillis();
+		long endDate = ((DateTime) historyItem.get(GssimConstants.END_TIME))
+				.getMillis();
+		if (task == null) {
+			task = new TimetableEventGroup(uniqueTaskID);
+			taskGanttMap.put(uniqueTaskID, task);
+			ganttDiagramPETimetable.addEventGroup(task);
+		}
+		ganttDiagramPETimetable.addEvent(pe, task,
+				new FixedMillisecond(startDate), new FixedMillisecond(endDate));
+	}*/
+	
+
+
+	/************* 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<TaskInterface> execList = JobRegistry.getInstance("COMPUTING_GRID_0#BROKER").getAllSubmittedTasks();
+			List<Executable> execList = jr.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 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 resIDlist[] = task.getAllResourceName();
+		String resID = resIDlist[resIDlist.length - 1];
+
+		long execStartTime = Double.valueOf(task.getExecStartTime()).longValue() * 1000;
+		long execEndTime = Double.valueOf(task.getFinishTime()).longValue() * 1000;
+
+		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 resIDlist[] = task.getAllResourceName();
+		String resID = resIDlist[resIDlist.length - 1];
+
+		long execStartTime = Double.valueOf(task.getExecStartTime()).longValue() * 1000;
+		long execEndTime = Double.valueOf(task.getFinishTime()).longValue() * 1000;
+
+		TaskSeries waitRes = ganttDiagramWaitingTimeSeriesCollection.getSeries(resID);
+		if (waitRes == null) {
+			waitRes = new TaskSeries(resID);
+			ganttDiagramWaitingTimeSeriesCollection.add(waitRes);
+		}
+
+		long sub = Double.valueOf(task.getSubmissionTime()).longValue() * 1000;
+		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 gssimSubtitle = "Created by " + DataCenterWorkloadSimulator.SIMULATOR_NAME + " http://www.gssim.org/";
+		c.addSubtitle(new TextTitle(gssimSubtitle));
+		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;
+}
Index: DCWoRMS/trunk/src/simulator/stats/implementation/ResourceStats.java
===================================================================
--- DCWoRMS/trunk/src/simulator/stats/implementation/ResourceStats.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/stats/implementation/ResourceStats.java	(revision 477)
@@ -0,0 +1,78 @@
+package simulator.stats.implementation;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import schedframe.resources.computing.ComputingResource;
+import simulator.stats.implementation.out.StatsSerializer;
+
+public class ResourceStats implements StatsInterface {
+
+	// raw resource statistic
+	protected String resourceName;
+	protected int cpucnt;
+	protected int cpuspeed;
+	protected int memory;
+	protected double queueLength;
+	protected Map<String, Double> processorsLoad;
+	protected Map<String, Double> processorsReservationLoad;
+
+	private String[] headers = { "resourceName", "memory", "cpu", "cpu_speed",
+			"queue_length", "cpu_load", "reservation_load" };
+
+	public ResourceStats(ComputingResource compResource) {
+		this.resourceName = compResource.getName();
+		init();
+
+	}
+
+	public void init() {
+		this.cpucnt = 0;
+		this.cpuspeed = 0;
+		this.memory = 0;
+		this.queueLength = 0;
+		this.processorsLoad = new HashMap<String, Double>();
+		this.processorsReservationLoad = new HashMap<String, Double>();
+	}
+
+	public double getQueueLength() {
+		return queueLength;
+	}
+
+	public void setQueueLength(double queueLength) {
+		this.queueLength = queueLength;
+	}
+
+	public Map<String, Double> getPELoad() {
+		return processorsLoad;
+	}
+
+	public Map<String, Double> getProcessorsReservationLoad() {
+		return processorsReservationLoad;
+	}
+
+	public String getResourceName() {
+		return resourceName;
+	}
+
+	public int getCpucnt() {
+		return cpucnt;
+	}
+
+	public int getCpuspeed() {
+		return cpuspeed;
+	}
+
+	public int getMemory() {
+		return memory;
+	}
+
+	public Object serialize(StatsSerializer serializer) {
+		return serializer.visit(this);
+	}
+
+	public String[] getHeaders() {
+		return headers;
+	}
+
+}
Index: DCWoRMS/trunk/src/simulator/stats/implementation/out/StringSerializer.java
===================================================================
--- DCWoRMS/trunk/src/simulator/stats/implementation/out/StringSerializer.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/stats/implementation/out/StringSerializer.java	(revision 477)
@@ -0,0 +1,435 @@
+package simulator.stats.implementation.out;
+
+
+import java.util.Map;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import simulator.DataCenterWorkloadSimulator;
+import simulator.stats.implementation.AccumulatedResourceStats;
+import simulator.stats.implementation.GSSAccumulatorsStats;
+import simulator.stats.implementation.JobStats;
+import simulator.stats.implementation.ResourceEnergyStats;
+import simulator.stats.implementation.ResourceStats;
+import simulator.stats.implementation.ResourceUsageStats;
+import simulator.stats.implementation.TaskStats;
+
+/**
+ * 
+ * @author Marcin Krystek, Jarek Szymczak
+ *
+ */
+public class StringSerializer extends AbstractStringSerializer {
+
+	private Log log = LogFactory.getLog(StringSerializer.class);
+
+	public String visit(TaskStats taskStats) {
+		StringBuffer buffer = null;
+
+		if(printedHeaders.add("taskStats")) {
+			buffer = new StringBuffer(520);
+			String[] headers = taskStats.getHeaders();
+			if (headers.length >= 10) {
+
+				for(int i = 0; i < 10; i++)
+				{
+					buffer.append(headers[i]);
+					buffer.append(fieldSeparator);
+				}
+				
+				if (this.useExtended) {
+					
+					for(int i = 10; i < headers.length; i++)
+					{
+						buffer.append(headers[i]);
+						buffer.append(fieldSeparator);
+					}
+					
+				}
+
+			} else {
+				buffer.append(headers.toString());
+			}
+			buffer.append(System.getProperty("line.separator"));
+		} else {
+			buffer = new StringBuffer(260);
+		}
+		
+		buffer.append(taskStats.getJobID());
+		buffer.append(fieldSeparator);
+		buffer.append(taskStats.getTaskID());
+		buffer.append(fieldSeparator);
+		buffer.append(taskStats.getUserDN());
+		buffer.append(fieldSeparator);
+		buffer.append(taskStats.getResName());
+		buffer.append(fieldSeparator);
+		buffer.append(taskStats.getCpuCnt());
+		buffer.append(fieldSeparator);
+		buffer.append(Double.valueOf(taskStats.getExecStartDate()).longValue());
+		buffer.append(fieldSeparator);
+		buffer.append(Double.valueOf(taskStats.getExecFinishDate()).longValue());
+		buffer.append(fieldSeparator);
+		buffer.append(Double.valueOf(taskStats.getExecEndDate()).longValue());
+		buffer.append(fieldSeparator);
+		buffer.append(Double.valueOf(taskStats.getGB_SubDate()).longValue());
+		buffer.append(fieldSeparator);
+		buffer.append(Double.valueOf(taskStats.getLB_SubDate()).longValue());
+		buffer.append(fieldSeparator);
+		if (this.useExtended) {
+			buffer.append(Double.valueOf(taskStats.getCompletionTime())
+					.longValue());
+			buffer.append(fieldSeparator);
+			buffer.append(Double.valueOf(taskStats.getExecStartTime()).longValue());
+			buffer.append(fieldSeparator);
+			buffer.append(Double.valueOf(taskStats.getExecutionTime()).longValue());
+			buffer.append(fieldSeparator);
+			buffer.append(Double.valueOf(taskStats.getReadyTime()).longValue());
+			buffer.append(fieldSeparator);
+			buffer.append(Double.valueOf(taskStats.getStartTime()).longValue());
+			buffer.append(fieldSeparator);
+			buffer.append(Double.valueOf(taskStats.getFlowTime()).longValue());
+			buffer.append(fieldSeparator);
+			buffer.append(Double.valueOf(taskStats.getWaitingTime()).longValue());
+			buffer.append(fieldSeparator);
+			buffer.append(Double.valueOf(taskStats.getGQ_WaitingTime())
+					.longValue());
+			buffer.append(fieldSeparator);
+			buffer.append(Double.valueOf(taskStats.getLateness()).longValue());
+			buffer.append(fieldSeparator);
+			buffer.append(Double.valueOf(taskStats.getTardiness()).longValue());
+			buffer.append(fieldSeparator);
+			buffer.append(Double.valueOf(taskStats.getReservationStartDate())
+					.longValue());
+			buffer.append(fieldSeparator);
+			buffer.append(Double.valueOf(taskStats.getReservationFinishDate())
+					.longValue());
+			buffer.append(fieldSeparator);
+			buffer.append(taskStats.getProcessorsName());
+			buffer.append(fieldSeparator);
+		}
+		
+		
+		return buffer.toString();
+	}
+
+	public String visit(JobStats jobStats) {
+		
+		StringBuffer buffer = null;
+
+		if(printedHeaders.add("jobStats")) {
+			buffer = new StringBuffer(200);
+			String[] headers = jobStats.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(100);
+		}
+		
+		buffer.append(jobStats.getJobID());
+		buffer.append(fieldSeparator);
+		buffer.append(defaultNumberFormat
+				.format(jobStats.getMeanTaskCompletionTime().getMean()));
+		buffer.append(fieldSeparator);
+		buffer.append(defaultNumberFormat
+				.format(jobStats.getMeanTaskExecutionTime().getMean()));
+		buffer.append(fieldSeparator);
+		buffer.append(defaultNumberFormat
+				.format(jobStats.getMeanTaskStartTime().getMean()));
+		buffer.append(fieldSeparator);
+		buffer.append(defaultNumberFormat
+				.format(jobStats.getMeanTaskFlowTime().getMean()));
+		buffer.append(fieldSeparator);
+		buffer.append(defaultNumberFormat
+				.format(jobStats.getMeanTaskWaitingTime().getMean()));
+		buffer.append(fieldSeparator);
+		buffer.append(defaultNumberFormat
+				.format(jobStats.getMeanTaskGQ_WaitingTime().getMean()));
+		buffer.append(fieldSeparator);
+		buffer.append(defaultNumberFormat
+				.format(jobStats.getTardiness().getMean()));
+		buffer.append(fieldSeparator);
+		buffer.append(defaultNumberFormat
+				.format(jobStats.getLateness().getMean()));
+		buffer.append(fieldSeparator);
+		buffer.append(defaultNumberFormat
+				.format(jobStats.getMakespan().getMean()));
+		buffer.append(fieldSeparator);
+		
+		return buffer.toString();
+	}
+	
+	public String visit(ResourceStats resourceStats){
+		
+		StringBuffer buffer = null;
+
+		if(printedHeaders.add("resourceStats")) {
+			buffer = new StringBuffer(600);
+			String[] headers = resourceStats.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(300);
+		}
+		
+		buffer.append(resourceStats.getResourceName());
+		buffer.append(fieldSeparator);
+
+		buffer.append(resourceStats.getMemory());
+		buffer.append(fieldSeparator);
+
+		buffer.append(resourceStats.getCpucnt());
+		buffer.append(fieldSeparator);
+
+		buffer.append(resourceStats.getCpuspeed());
+		buffer.append(fieldSeparator);
+
+		buffer.append(DataCenterWorkloadSimulator.DFAULT_NUMBER_FORMAT
+				.format(resourceStats.getQueueLength()));
+		buffer.append(fieldSeparator);
+
+		/*Map<String, Double> processorsLoad = resourceStats.getProcessorsLoad();
+		for (String processorName : processorsLoad.keySet()) {
+
+			Double load = processorsLoad.get(processorName);
+			buffer.append(processorName);
+			buffer.append(" ");
+			buffer.append(GridSchedulingSimulator.DFAULT_NUMBER_FORMAT
+							.format(load));
+			buffer.append(":");
+
+		}*/
+
+		buffer.append(fieldSeparator);
+		Map<String, Double> processorsReservationLoad = resourceStats
+				.getProcessorsReservationLoad();
+		for (String processorName : processorsReservationLoad.keySet()) {
+
+			Double reservationLoad = processorsReservationLoad
+					.get(processorName);
+			buffer.append(processorName);
+			buffer.append(" ");
+			buffer.append(DataCenterWorkloadSimulator.DFAULT_NUMBER_FORMAT
+					.format(reservationLoad));
+			buffer.append(":");
+		}
+		buffer.append(fieldSeparator);
+		return buffer.toString();
+	}
+	
+	public String visit(AccumulatedResourceStats accResStats){
+		
+		StringBuffer buffer = null;
+
+		if(printedHeaders.add("accResStats")) {
+			buffer = new StringBuffer(340);
+			String[] headers = accResStats.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(170);
+		}
+		
+		buffer.append(accResStats.getResourceName());
+		buffer.append(fieldSeparator);
+		buffer.append("load");
+		buffer.append(accResStats.getResourceLoad().toString());
+		buffer.append(System.getProperty("line.separator"));
+		buffer.append(accResStats.getResourceName());
+		buffer.append(fieldSeparator);
+		buffer.append("reservationload");
+		buffer.append(accResStats.getResourceReservationLoad().toString());
+		buffer.append(System.getProperty("line.separator"));
+		
+		return buffer.toString();
+	}
+
+	public Object visit(ResourceUsageStats resourceUsageStats) {
+		Map<Long, Integer> resourceUsage = resourceUsageStats.getUsage();
+		
+		int mapSize = resourceUsage.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 * resourceUsage.size();
+		
+		StringBuffer buffer = null;
+
+		if(printedHeaders.add(resourceUsageStats.getUsageType())) {
+			buffer = new StringBuffer(size + 42);
+			String[] headers = resourceUsageStats.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 : resourceUsage.keySet()) {
+			
+			buffer.append(resourceUsageStats.getResourceName());
+			buffer.append(fieldSeparator);
+			Integer value = resourceUsage.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(resourceUsage.size() > 0){
+			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();
+		
+		int mapSize = resourceEnergy.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 * resourceEnergy.size();
+		
+		StringBuffer buffer = null;
+
+		if(printedHeaders.add(resourceEnergyStats.getUsageType())) {
+			buffer = new StringBuffer(size + 42);
+			String[] headers = resourceEnergyStats.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 : resourceEnergy.keySet()) {
+			
+			buffer.append(resourceEnergyStats.getResourceName());
+			buffer.append(fieldSeparator);
+			Double value = resourceEnergy.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(resourceEnergy.size() > 0) {
+			buffer.append("mean: "+resourceEnergyStats.getMeanUsage() + " sum: " +resourceEnergyStats.getSumUsage());
+			buffer.append(System.getProperty("line.separator"));	
+		}
+
+		return buffer.toString();
+	}
+
+	public Object visit(GSSAccumulatorsStats accStats) {
+
+		StringBuffer buffer = null;
+
+		if(printedHeaders.add("accStats")) {
+			buffer = new StringBuffer(2800);
+			String[] headers = accStats.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(1400);
+		}
+		
+		buffer.append("Delayed tasks");
+		buffer.append(accStats.delayedTasks);
+		buffer.append(System.getProperty("line.separator"));
+		buffer.append("Failed requests (tasks)");
+		buffer.append(accStats.failedRequests);
+		buffer.append(System.getProperty("line.separator"));
+		buffer.append("Makespan");
+		buffer.append(accStats.makespan);
+		buffer.append(System.getProperty("line.separator"));
+		buffer.append("Resources queue length");
+		buffer.append(accStats.meanQueueLength);
+		buffer.append(System.getProperty("line.separator"));
+		buffer.append("Resources total load");
+		buffer.append(accStats.meanTotalLoad);
+		buffer.append(System.getProperty("line.separator"));
+		buffer.append("Resources reservation load");
+		buffer.append(accStats.meanReservationLoad);
+		buffer.append(System.getProperty("line.separator"));
+		buffer.append("Energy usage");
+		buffer.append(accStats.meanEnergyUsage);
+		buffer.append(System.getProperty("line.separator"));
+		buffer.append("Task completion time");
+		buffer.append(accStats.meanTaskCompletionTime);
+		buffer.append(System.getProperty("line.separator"));
+		buffer.append("Task execution time");
+		buffer.append(accStats.meanTaskExecutionTime);
+		buffer.append(System.getProperty("line.separator"));
+		buffer.append("Task start time");
+		buffer.append(accStats.meanTaskStartTime);
+		buffer.append(System.getProperty("line.separator"));
+		buffer.append("Task flow time");
+		buffer.append(accStats.meanTaskFlowTime);
+		buffer.append(System.getProperty("line.separator"));
+		buffer.append("Task waiting time");
+		buffer.append(accStats.meanTaskWaitingTime);
+		buffer.append(System.getProperty("line.separator"));
+		buffer.append("Task lateness");
+		buffer.append(accStats.lateness);
+		buffer.append(System.getProperty("line.separator"));
+		buffer.append("Task tardiness");
+		buffer.append(accStats.tardiness);
+		
+		return buffer.toString();
+	}
+
+}
Index: DCWoRMS/trunk/src/simulator/stats/implementation/out/FormatedStringSerializer.java
===================================================================
--- DCWoRMS/trunk/src/simulator/stats/implementation/out/FormatedStringSerializer.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/stats/implementation/out/FormatedStringSerializer.java	(revision 477)
@@ -0,0 +1,570 @@
+package simulator.stats.implementation.out;
+
+import java.util.Map;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import simulator.DataCenterWorkloadSimulator;
+import simulator.stats.implementation.AccumulatedResourceStats;
+import simulator.stats.implementation.GSSAccumulatorsStats;
+import simulator.stats.implementation.JobStats;
+import simulator.stats.implementation.ResourceEnergyStats;
+import simulator.stats.implementation.ResourceStats;
+import simulator.stats.implementation.ResourceUsageStats;
+import simulator.stats.implementation.TaskStats;
+
+/**
+ * 
+ * @author Marcin Krystek, Jarek Szymczak
+ * 
+ *         This serializer needs correct implementation. Now it works as simple
+ *         StringSerializer.
+ * 
+ */
+
+public class FormatedStringSerializer extends AbstractStringSerializer {
+
+	private Log log = LogFactory.getLog(FormatedStringSerializer.class);
+	
+	private String fieldSeparator = "; ";
+
+	public String visit(TaskStats taskStats) {
+
+		StringBuffer buffer = null;
+
+		if(printedHeaders.add("taskStats")) {
+			buffer = new StringBuffer(520);
+			String[] headers = taskStats.getHeaders();
+			if (headers.length == 23) {
+
+				buffer.append(String.format("%5s", headers[0]));
+				buffer.append(fieldSeparator);
+				buffer.append(String.format("%7s", headers[1]));
+				buffer.append(fieldSeparator);
+				buffer.append(String.format("%7s", headers[2]));
+				buffer.append(fieldSeparator);
+				buffer.append(String.format("%14s", headers[3]));
+				buffer.append(fieldSeparator);
+				buffer.append(String.format("%7s", headers[4]));
+				buffer.append(fieldSeparator);
+				buffer.append(String.format("%14s", headers[5]));
+				buffer.append(fieldSeparator);
+				buffer.append(String.format("%15s", headers[6]));
+				buffer.append(fieldSeparator);
+				buffer.append(String.format("%13s", headers[7]));
+				buffer.append(fieldSeparator);
+				buffer.append(String.format("%13s", headers[8]));
+				buffer.append(fieldSeparator);
+				buffer.append(String.format("%13s", headers[9]));
+				buffer.append(fieldSeparator);
+
+				if (this.useExtended) {
+					buffer.append(String.format("%15s", headers[10]));
+					buffer.append(fieldSeparator);
+					buffer.append(String.format("%14s", headers[11]));
+					buffer.append(fieldSeparator);
+					buffer.append(String.format("%14s", headers[12]));
+					buffer.append(fieldSeparator);
+					buffer.append(String.format("%10s", headers[13]));
+					buffer.append(fieldSeparator);
+					buffer.append(String.format("%10s", headers[14]));
+					buffer.append(fieldSeparator);
+					buffer.append(String.format("%9s", headers[15]));
+					buffer.append(fieldSeparator);
+					buffer.append(String.format("%12s", headers[16]));
+					buffer.append(fieldSeparator);
+					buffer.append(String.format("%15s", headers[17]));
+					buffer.append(fieldSeparator);
+					buffer.append(String.format("%9s", headers[18]));
+					buffer.append(fieldSeparator);
+					buffer.append(String.format("%10s", headers[19]));
+					buffer.append(fieldSeparator);
+					buffer.append(String.format("%16s", headers[20]));
+					buffer.append(fieldSeparator);
+					buffer.append(String.format("%17s", headers[21]));
+					buffer.append(fieldSeparator);
+					buffer.append(String.format("%-17s", headers[22]));
+					buffer.append(fieldSeparator);
+				}
+
+			} else {
+				buffer.append(headers.toString());
+			}
+			buffer.append(System.getProperty("line.separator"));
+		} else {
+			buffer = new StringBuffer(260);
+		}
+
+		buffer.append(String.format("%5s", taskStats.getJobID()));
+		buffer.append(fieldSeparator);
+		buffer.append(String.format("%7s", taskStats.getTaskID()));
+		buffer.append(fieldSeparator);
+		buffer.append(String.format("%7s", taskStats.getUserDN()));
+		buffer.append(fieldSeparator);
+		buffer.append(String.format("%14s", taskStats.getResName()));
+		buffer.append(fieldSeparator);
+		buffer.append(String.format("%7d", taskStats.getCpuCnt()));
+		buffer.append(fieldSeparator);
+		buffer.append(String.format("%14d",
+				Double.valueOf(taskStats.getExecStartDate()).longValue()));
+		buffer.append(fieldSeparator);
+		buffer.append(String.format("%15d",
+				Double.valueOf(taskStats.getExecFinishDate()).longValue()));
+		buffer.append(fieldSeparator);
+		buffer.append(String.format("%13d",
+				Double.valueOf(taskStats.getExecEndDate()).longValue()));
+		buffer.append(fieldSeparator);
+		buffer.append(String.format("%13d",
+				Double.valueOf(taskStats.getGB_SubDate()).longValue()));
+		buffer.append(fieldSeparator);
+		buffer.append(String.format("%13d",
+				Double.valueOf(taskStats.getLB_SubDate()).longValue()));
+		buffer.append(fieldSeparator);
+
+		if (this.useExtended) {
+			buffer.append(String.format("%15d",
+					Double.valueOf(taskStats.getCompletionTime()).longValue()));
+			buffer.append(fieldSeparator);
+			buffer.append(String.format("%14d",
+					Double.valueOf(taskStats.getExecStartTime()).longValue()));
+			buffer.append(fieldSeparator);
+			buffer.append(String.format("%14d",
+					Double.valueOf(taskStats.getExecutionTime()).longValue()));
+			buffer.append(fieldSeparator);
+			buffer.append(String.format("%10d",
+					Double.valueOf(taskStats.getReadyTime()).longValue()));
+			buffer.append(fieldSeparator);
+			buffer.append(String.format("%10d",
+					Double.valueOf(taskStats.getStartTime()).longValue()));
+			buffer.append(fieldSeparator);
+			buffer.append(String.format("%9d",
+					Double.valueOf(taskStats.getFlowTime()).longValue()));
+			buffer.append(fieldSeparator);
+			buffer.append(String.format("%12d",
+					Double.valueOf(taskStats.getWaitingTime()).longValue()));
+			buffer.append(fieldSeparator);
+			buffer.append(String.format("%15d",
+					Double.valueOf(taskStats.getGQ_WaitingTime()).longValue()));
+			buffer.append(fieldSeparator);
+			buffer.append(String.format("%9d",
+					Double.valueOf(taskStats.getLateness()).longValue()));
+			buffer.append(fieldSeparator);
+			buffer.append(String.format("%10d",
+					Double.valueOf(taskStats.getTardiness()).longValue()));
+			buffer.append(fieldSeparator);
+			buffer.append(String.format("%16d",
+					Double.valueOf(taskStats.getReservationStartDate())
+							.longValue()));
+			buffer.append(fieldSeparator);
+			buffer.append(String.format("%17d",
+					Double.valueOf(taskStats.getReservationFinishDate())
+							.longValue()));
+			buffer.append(fieldSeparator);
+			buffer.append(String.format("%-17s", taskStats.getProcessorsName()));
+			buffer.append(fieldSeparator);
+
+		}
+
+		return buffer.toString();
+	}
+
+	public String visit(JobStats jobStats) {
+
+		StringBuffer buffer = null;
+
+		if(printedHeaders.add("jobStats")) {
+			buffer = new StringBuffer(200);
+			String[] headers = jobStats.getHeaders();
+			if (headers.length == 10) {
+
+				buffer.append(String.format("%5s", headers[0]));
+				buffer.append(fieldSeparator);
+				buffer.append(String.format("%23s", headers[1]));
+				buffer.append(fieldSeparator);
+				buffer.append(String.format("%22s", headers[2]));
+				buffer.append(fieldSeparator);
+				buffer.append(String.format("%18s", headers[3]));
+				buffer.append(fieldSeparator);
+				buffer.append(String.format("%17s", headers[4]));
+				buffer.append(fieldSeparator);
+				buffer.append(String.format("%20s", headers[5]));
+				buffer.append(fieldSeparator);
+				buffer.append(String.format("%23s", headers[6]));
+				buffer.append(fieldSeparator);
+				buffer.append(String.format("%9s", headers[7]));
+				buffer.append(fieldSeparator);
+				buffer.append(String.format("%10s", headers[8]));
+				buffer.append(fieldSeparator);
+				buffer.append(String.format("%9s", headers[9]));
+				buffer.append(fieldSeparator);
+
+			} else {
+				buffer.append(headers.toString());
+			}
+			buffer.append(System.getProperty("line.separator"));
+		} else {
+			buffer = new StringBuffer(100);
+		}
+
+		buffer.append(String.format("%5s", jobStats.getJobID()));
+		buffer.append(fieldSeparator);
+		buffer.append(String.format("%23s", defaultNumberFormat.format(jobStats
+				.getMeanTaskCompletionTime().getMean())));
+		buffer.append(fieldSeparator);
+		buffer.append(String.format("%22s", defaultNumberFormat.format(jobStats
+				.getMeanTaskExecutionTime().getMean())));
+		buffer.append(fieldSeparator);
+		buffer.append(String.format("%18s", defaultNumberFormat.format(jobStats
+				.getMeanTaskStartTime().getMean())));
+		buffer.append(fieldSeparator);
+		buffer.append(String.format("%17s", defaultNumberFormat.format(jobStats
+				.getMeanTaskFlowTime().getMean())));
+		buffer.append(fieldSeparator);
+		buffer.append(String.format("%20s", defaultNumberFormat.format(jobStats
+				.getMeanTaskWaitingTime().getMean())));
+		buffer.append(fieldSeparator);
+		buffer.append(String.format("%23s", defaultNumberFormat.format(jobStats
+				.getMeanTaskGQ_WaitingTime().getMean())));
+		buffer.append(fieldSeparator);
+		buffer.append(String.format("%9s",
+				defaultNumberFormat.format(jobStats.getTardiness().getMean())));
+		buffer.append(fieldSeparator);
+		buffer.append(String.format("%10s",
+				defaultNumberFormat.format(jobStats.getLateness().getMean())));
+		buffer.append(fieldSeparator);
+		buffer.append(String.format("%9s",
+				defaultNumberFormat.format(jobStats.getMakespan().getMean())));
+		buffer.append(fieldSeparator);
+
+		return buffer.toString();
+	}
+
+	public String visit(ResourceStats resourceStats) {
+
+		StringBuffer buffer = null;
+
+		if(printedHeaders.add("resourceStats")) {
+			buffer = new StringBuffer(600);
+			String[] headers = resourceStats.getHeaders();
+			if (headers.length == 7) {
+
+				buffer.append(String.format("%-20s", headers[0]));
+				buffer.append(fieldSeparator);
+				buffer.append(String.format("%6s", headers[1]));
+				buffer.append(fieldSeparator);
+				buffer.append(String.format("%3s", headers[2]));
+				buffer.append(fieldSeparator);
+				buffer.append(String.format("%9s", headers[3]));
+				buffer.append(fieldSeparator);
+				buffer.append(String.format("%12s", headers[4]));
+				buffer.append(fieldSeparator);
+				buffer.append(String.format("%-120s", headers[5]));
+				buffer.append(fieldSeparator);
+				buffer.append(String.format("%-120s", headers[6]));
+				buffer.append(fieldSeparator);
+			} else {
+				buffer.append(headers.toString());
+			}
+			buffer.append(System.getProperty("line.separator"));
+		} else {
+			buffer = new StringBuffer(300);
+		}
+
+		buffer.append(String.format("%-20s", resourceStats.getResourceName()));
+		buffer.append(fieldSeparator);
+
+		buffer.append(String.format("%6d", resourceStats.getMemory()));
+		buffer.append(fieldSeparator);
+
+		buffer.append(String.format("%3d", resourceStats.getCpucnt()));
+		buffer.append(fieldSeparator);
+
+		buffer.append(String.format("%9d", resourceStats.getCpuspeed()));
+		buffer.append(fieldSeparator);
+
+		buffer.append(String.format("%-12s",
+				DataCenterWorkloadSimulator.DFAULT_NUMBER_FORMAT
+						.format(resourceStats.getQueueLength())));
+		buffer.append(fieldSeparator);
+
+		StringBuffer tempBuffer = new StringBuffer();
+		
+		/*Map<String, Double> processorsLoad = resourceStats.getProcessorsLoad();
+		for (String processorName : processorsLoad.keySet()) {
+
+			Double load = processorsLoad.get(processorName);
+			tempBuffer.append(String.format("%-12s", processorName));
+			tempBuffer.append(" ");
+			tempBuffer.append(String.format("%-5s", GridSchedulingSimulator.DFAULT_NUMBER_FORMAT
+					.format(load)));
+			tempBuffer.append(": ");
+
+		}*/
+		
+		buffer.append(String.format("%-120s", tempBuffer.toString()));
+		buffer.append(fieldSeparator);
+		
+		tempBuffer = new StringBuffer();
+		
+		Map<String, Double> processorsReservationLoad = resourceStats
+				.getProcessorsReservationLoad();
+		for (String processorName : processorsReservationLoad.keySet()) {
+
+			Double reservationLoad = processorsReservationLoad
+					.get(processorName);
+			tempBuffer.append(String.format("%-12s", processorName));
+			tempBuffer.append(" ");
+			tempBuffer.append(String.format("%-5s", DataCenterWorkloadSimulator.DFAULT_NUMBER_FORMAT
+					.format(reservationLoad)));
+			tempBuffer.append(": ");
+		}
+		buffer.append(String.format("%-120s", tempBuffer.toString()));
+		buffer.append(fieldSeparator);
+		return buffer.toString();
+	}
+
+	public String visit(AccumulatedResourceStats accResStats) {
+
+		StringBuffer buffer = null;
+
+		if(printedHeaders.add("accResStats")) {
+			buffer = new StringBuffer(340);
+			String[] headers = accResStats.getHeaders();
+			if (headers.length == 9) {
+
+				buffer.append(String.format("%-27s", headers[0]));
+				buffer.append(fieldSeparator);
+				buffer.append(String.format("%-27s", headers[1]));
+				buffer.append(fieldSeparator);
+				buffer.append(String.format("%16s", headers[2]));
+				buffer.append(fieldSeparator);
+				buffer.append(String.format("%16s", headers[3]));
+				buffer.append(fieldSeparator);
+				buffer.append(String.format("%16s", headers[4]));
+				buffer.append(fieldSeparator);
+				buffer.append(String.format("%16s", headers[5]));
+				buffer.append(fieldSeparator);
+				buffer.append(String.format("%16s", headers[6]));
+				buffer.append(fieldSeparator);
+				buffer.append(String.format("%16s", headers[7]));
+				buffer.append(fieldSeparator);
+				buffer.append(String.format("%16s", headers[8]));
+				buffer.append(fieldSeparator);
+			} else {
+				buffer.append(headers.toString());
+			}
+			buffer.append(System.getProperty("line.separator"));
+		} else {
+			buffer = new StringBuffer(170);
+		}
+
+		buffer.append(String.format("%-27s", accResStats.getResourceName()));
+		buffer.append(fieldSeparator);
+		buffer.append(String.format("%-27s", "load"));
+		buffer.append(accResStats.getResourceLoad().toFormatedString());
+		buffer.append(System.getProperty("line.separator"));
+		buffer.append(String.format("%-27s", accResStats.getResourceName()));
+		buffer.append(fieldSeparator);
+		buffer.append(String.format("%-27s", "reservationload"));
+		buffer.append(accResStats.getResourceReservationLoad()
+				.toFormatedString());
+		buffer.append(System.getProperty("line.separator"));
+
+		return buffer.toString();
+	}
+
+	public Object visit(ResourceUsageStats resourceUsageStats) {
+		Map<Long, Integer> resourceUsage = resourceUsageStats.getUsage();
+
+		int mapSize = resourceUsage.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 * resourceUsage.size();
+
+		StringBuffer buffer = null;
+
+		if(printedHeaders.add(resourceUsageStats.getResourceType().getName())) {
+			buffer = new StringBuffer(size + 42);
+			String[] headers = resourceUsageStats.getHeaders();
+			if (headers.length == 3) {
+
+				buffer.append(String.format("%-20s", headers[0]));
+				buffer.append(fieldSeparator);
+				buffer.append(String.format("%15s", headers[1]));
+				buffer.append(fieldSeparator);
+				buffer.append(String.format("%5s", headers[2]));
+				buffer.append(fieldSeparator);
+
+			} else {
+				buffer.append(headers.toString());
+			}
+			buffer.append(System.getProperty("line.separator"));
+		} else {
+			buffer = new StringBuffer(size);
+		}
+
+		for (Long timestamp : resourceUsage.keySet()) {
+
+			buffer.append(String.format("%-20s",
+					resourceUsageStats.getResourceName()));
+			buffer.append(fieldSeparator);
+			Integer value = resourceUsage.get(timestamp);
+			buffer.append(String.format("%15d", timestamp));
+			buffer.append(fieldSeparator);
+			buffer.append(String.format("%5s",
+					DataCenterWorkloadSimulator.DFAULT_NUMBER_FORMAT.format(value)));
+			buffer.append(fieldSeparator);
+			buffer.append(System.getProperty("line.separator"));
+
+		}
+
+		return buffer.toString();
+	}
+
+	
+	public Object visit(GSSAccumulatorsStats accStats) {
+
+		StringBuffer buffer = null;
+
+		if(printedHeaders.add("accStats")) {
+			buffer = new StringBuffer(2800);
+			String[] headers = accStats.getHeaders();
+			if (headers.length == 8) {
+
+				buffer.append(String.format("%-26s", headers[0]));
+				buffer.append(fieldSeparator);
+				buffer.append(String.format("%16s", headers[1]));
+				buffer.append(fieldSeparator);
+				buffer.append(String.format("%16s", headers[2]));
+				buffer.append(fieldSeparator);
+				buffer.append(String.format("%16s", headers[3]));
+				buffer.append(fieldSeparator);
+				buffer.append(String.format("%16s", headers[4]));
+				buffer.append(fieldSeparator);
+				buffer.append(String.format("%16s", headers[5]));
+				buffer.append(fieldSeparator);
+				buffer.append(String.format("%16s", headers[6]));
+				buffer.append(fieldSeparator);
+				buffer.append(String.format("%16s", headers[7]));
+				buffer.append(fieldSeparator);
+			} else {
+				buffer.append(headers.toString());
+			}
+			buffer.append(System.getProperty("line.separator"));
+		} else {
+			buffer = new StringBuffer(1400);
+		}
+
+		buffer.append(String.format("%-26s", "Delayed tasks"));
+		buffer.append(accStats.delayedTasks.toFormatedString());
+		buffer.append(System.getProperty("line.separator"));
+		buffer.append(String.format("%-26s", "Failed requests (tasks)"));
+		buffer.append(accStats.failedRequests.toFormatedString());
+		buffer.append(System.getProperty("line.separator"));
+		buffer.append(String.format("%-26s", "Makespan"));
+		buffer.append(accStats.makespan.toFormatedString());
+		buffer.append(System.getProperty("line.separator"));
+		buffer.append(String.format("%-26s", "Resources queue length"));
+		buffer.append(accStats.meanQueueLength.toFormatedString());
+		buffer.append(System.getProperty("line.separator"));
+		buffer.append(String.format("%-26s", "Resources total load"));
+		buffer.append(accStats.meanTotalLoad.toFormatedString());
+		buffer.append(System.getProperty("line.separator"));
+		buffer.append(String.format("%-26s", "Resources reservation load"));
+		buffer.append(accStats.meanReservationLoad.toFormatedString());
+		buffer.append(System.getProperty("line.separator"));
+		buffer.append(String.format("%-26s", "Energy usage"));
+		buffer.append(accStats.meanEnergyUsage.toFormatedString());
+		buffer.append(System.getProperty("line.separator"));
+		buffer.append(String.format("%-26s", "Task completion time"));
+		buffer.append(accStats.meanTaskCompletionTime.toFormatedString());
+		buffer.append(System.getProperty("line.separator"));
+		buffer.append(String.format("%-26s", "Task execution time"));
+		buffer.append(accStats.meanTaskExecutionTime.toFormatedString());
+		buffer.append(System.getProperty("line.separator"));
+		buffer.append(String.format("%-26s", "Task start time"));
+		buffer.append(accStats.meanTaskStartTime.toFormatedString());
+		buffer.append(System.getProperty("line.separator"));
+		buffer.append(String.format("%-26s", "Task flow time"));
+		buffer.append(accStats.meanTaskFlowTime.toFormatedString());
+		buffer.append(System.getProperty("line.separator"));
+		buffer.append(String.format("%-26s", "Task waiting time"));
+		buffer.append(accStats.meanTaskWaitingTime.toFormatedString());
+		buffer.append(System.getProperty("line.separator"));
+		buffer.append(String.format("%-26s", "Task lateness"));
+		buffer.append(accStats.lateness.toFormatedString());
+		buffer.append(System.getProperty("line.separator"));
+		buffer.append(String.format("%-26s", "Task tardiness"));
+		buffer.append(accStats.tardiness.toFormatedString());
+
+		return buffer.toString();
+
+	}
+
+	public Object visit(ResourceEnergyStats resourceEnergyStats) {
+		Map<Long, Double> resourceEnergy = resourceEnergyStats.getEnergy();
+		
+		int mapSize = resourceEnergy.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 * resourceEnergy.size();
+		
+		StringBuffer buffer = null;
+
+		if(printedHeaders.add(resourceEnergyStats.getUsageType())) {
+			buffer = new StringBuffer(size + 42);
+			String[] headers = resourceEnergyStats.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 : resourceEnergy.keySet()) {
+			
+			buffer.append(resourceEnergyStats.getResourceName());
+			buffer.append(fieldSeparator);
+			Double value = resourceEnergy.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"));
+
+		}
+		buffer.append("mean: "+resourceEnergyStats.getMeanUsage() + " sum: " +resourceEnergyStats.getSumUsage());
+		buffer.append(System.getProperty("line.separator"));
+
+		return buffer.toString();
+	}
+}
Index: DCWoRMS/trunk/src/simulator/stats/implementation/out/AbstractStringSerializer.java
===================================================================
--- DCWoRMS/trunk/src/simulator/stats/implementation/out/AbstractStringSerializer.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/stats/implementation/out/AbstractStringSerializer.java	(revision 477)
@@ -0,0 +1,25 @@
+package simulator.stats.implementation.out;
+
+import java.text.NumberFormat;
+import java.util.HashSet;
+import java.util.Set;
+
+public abstract class AbstractStringSerializer implements StatsSerializer {
+	
+	protected boolean useExtended = true;
+	protected String fieldSeparator = ";";
+	protected NumberFormat defaultNumberFormat;
+	protected Set<String> printedHeaders = new HashSet<String>();
+	
+	public void useExtendedOutput(boolean arg){
+		this.useExtended = arg;
+	}
+	
+	public void setFieldSeparator(String separator){
+		this.fieldSeparator = separator;
+	}
+	
+	public void setDefaultNumberFormat(NumberFormat value){
+		this.defaultNumberFormat = value;
+	}
+}
Index: DCWoRMS/trunk/src/simulator/stats/implementation/out/StatsSerializer.java
===================================================================
--- DCWoRMS/trunk/src/simulator/stats/implementation/out/StatsSerializer.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/stats/implementation/out/StatsSerializer.java	(revision 477)
@@ -0,0 +1,33 @@
+package simulator.stats.implementation.out;
+
+import simulator.stats.implementation.AccumulatedResourceStats;
+import simulator.stats.implementation.GSSAccumulatorsStats;
+import simulator.stats.implementation.JobStats;
+import simulator.stats.implementation.ResourceEnergyStats;
+import simulator.stats.implementation.ResourceStats;
+import simulator.stats.implementation.ResourceUsageStats;
+import simulator.stats.implementation.TaskStats;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+public interface StatsSerializer {
+
+	public Object visit(TaskStats arg);
+	
+	public Object visit(JobStats arg);
+	
+	public Object visit(ResourceStats arg);
+	
+	public Object visit(AccumulatedResourceStats arg);
+	
+	public Object visit(ResourceUsageStats arg);
+	
+	public Object visit(ResourceEnergyStats arg);
+
+	
+	public Object visit(GSSAccumulatorsStats arg);
+	
+}
Index: DCWoRMS/trunk/src/simulator/stats/implementation/StatsAbstractClass.java
===================================================================
--- DCWoRMS/trunk/src/simulator/stats/implementation/StatsAbstractClass.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/stats/implementation/StatsAbstractClass.java	(revision 477)
@@ -0,0 +1,21 @@
+package simulator.stats.implementation;
+
+import simulator.stats.implementation.out.StatsSerializer;
+import java.util.UUID;
+
+public abstract class StatsAbstractClass {
+
+	protected UUID uuid;
+	
+	protected StatsAbstractClass(){
+		uuid = UUID.randomUUID();
+	}
+	
+	public abstract Object serialize(StatsSerializer serializer);
+	public abstract String[] getHeaders();
+	
+	public UUID getUUID() {
+		return uuid;
+	}
+	
+}
Index: DCWoRMS/trunk/src/simulator/stats/implementation/JobStats.java
===================================================================
--- DCWoRMS/trunk/src/simulator/stats/implementation/JobStats.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/stats/implementation/JobStats.java	(revision 477)
@@ -0,0 +1,95 @@
+package simulator.stats.implementation;
+
+import java.io.PrintStream;
+
+import simulator.stats.GSSAccumulator;
+import simulator.stats.implementation.out.StatsSerializer;
+
+/**
+ * 
+ * @author Marcin Krystek
+ * 
+ */
+public class JobStats implements StatsInterface {
+
+	protected String jobID;
+	protected GSSAccumulator meanTaskCompletionTime;
+	protected GSSAccumulator meanTaskExecutionTime;
+	protected GSSAccumulator meanTaskStartTime;
+	protected GSSAccumulator meanTaskFlowTime;
+	protected GSSAccumulator meanTaskWaitingTime;
+	protected GSSAccumulator meanTaskGQ_WaitingTime;
+	protected GSSAccumulator lateness;
+	protected GSSAccumulator tardiness;
+	protected GSSAccumulator makespan;
+
+	JobStats(String jobID) {
+		this.jobID = jobID;
+		init();
+	}
+
+	private String[] headers = { "jobID", "meanTaskCompletionTime",
+			"meanTaskExecutionTime", "meanTaskStartTime", "meanTaskFlowTime",
+			"meanTaskWaitingTime", "meanTaskGQ_WaitingTime", "lateness",
+			"tardiness", "makespan" };
+
+	private void init() {
+		this.meanTaskCompletionTime = new GSSAccumulator();
+		this.meanTaskExecutionTime = new GSSAccumulator();
+		this.meanTaskStartTime = new GSSAccumulator();
+		this.meanTaskFlowTime = new GSSAccumulator();
+		this.meanTaskWaitingTime = new GSSAccumulator();
+		this.meanTaskGQ_WaitingTime = new GSSAccumulator();
+		this.lateness = new GSSAccumulator();
+		this.tardiness = new GSSAccumulator();
+		this.makespan = new GSSAccumulator();
+	}
+
+	public String getJobID() {
+		return jobID;
+	}
+
+	public GSSAccumulator getMeanTaskCompletionTime() {
+		return meanTaskCompletionTime;
+	}
+
+	public GSSAccumulator getMeanTaskExecutionTime() {
+		return meanTaskExecutionTime;
+	}
+
+	public GSSAccumulator getMeanTaskStartTime() {
+		return meanTaskStartTime;
+	}
+
+	public GSSAccumulator getMeanTaskFlowTime() {
+		return meanTaskFlowTime;
+	}
+
+	public GSSAccumulator getMeanTaskWaitingTime() {
+		return meanTaskWaitingTime;
+	}
+
+	public GSSAccumulator getMeanTaskGQ_WaitingTime() {
+		return meanTaskGQ_WaitingTime;
+	}
+
+	public GSSAccumulator getLateness() {
+		return lateness;
+	}
+
+	public GSSAccumulator getTardiness() {
+		return tardiness;
+	}
+
+	public GSSAccumulator getMakespan() {
+		return makespan;
+	}
+
+	public Object serialize(StatsSerializer serializer) {
+		return serializer.visit(this);
+	}
+
+	public String[] getHeaders() {
+		return headers;
+	}
+}
Index: DCWoRMS/trunk/src/simulator/stats/StatisticsInfo.java
===================================================================
--- DCWoRMS/trunk/src/simulator/stats/StatisticsInfo.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/stats/StatisticsInfo.java	(revision 477)
@@ -0,0 +1,54 @@
+package simulator.stats;
+
+
+/**
+ * Gathers the statistics values used internally
+ * @author Stanislaw Szczepanowski
+ */
+public class StatisticsInfo {
+
+	/** The mean value */
+	protected GSSAccumulator mean;
+	/** The standard deviation value */
+	protected GSSAccumulator stdev;
+	/** The minimal value */
+	protected GSSAccumulator max;
+	/** The maximal value */
+	protected GSSAccumulator min;
+	/**
+	 * @param mean
+	 * @param stdev
+	 * @param max
+	 * @param min
+	 */
+	public StatisticsInfo(GSSAccumulator mean, GSSAccumulator stdev, GSSAccumulator max, GSSAccumulator min) {
+		this.mean = mean;
+		this.stdev = stdev;
+		this.max = max;
+		this.min = min;
+	}
+	/**
+	 * @return the maximal value
+	 */
+	public GSSAccumulator getMax() {
+		return max;
+	}
+	/**
+	 * @return the mean value
+	 */
+	public GSSAccumulator getMean() {
+		return mean;
+	}
+	/**
+	 * @return the minimal value
+	 */
+	public GSSAccumulator getMin() {
+		return min;
+	}
+	/**
+	 * @return the standard deviation value
+	 */
+	public GSSAccumulator getStdev() {
+		return stdev;
+	}
+}
Index: DCWoRMS/trunk/src/simulator/stats/GSSAccumulator.java
===================================================================
--- DCWoRMS/trunk/src/simulator/stats/GSSAccumulator.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/stats/GSSAccumulator.java	(revision 477)
@@ -0,0 +1,138 @@
+/**
+ * 
+ */
+package simulator.stats;
+
+import java.io.PrintStream;
+
+import simulator.DataCenterWorkloadSimulator;
+import gridsim.Accumulator;
+
+/**
+ * This class temporarily adds new methods to {@link Accumulator} class.
+ * 
+ * @author Stanislaw Szczepanowski
+ * 
+ */
+public class GSSAccumulator extends Accumulator {
+
+	public GSSAccumulator() {
+		super();
+	}
+
+	public GSSAccumulator(Accumulator acc) {
+		n_ = acc.getCount();
+		mean_ = acc.getMean();
+		sqrMean_ = acc.getStandardDeviation() + (mean_ * mean_);
+		min_ = acc.getMin();
+		max_ = acc.getMax();
+		last_ = acc.getLast();
+	}
+
+	/**
+	 * This method must be overloaded, since it returns the wrong value.
+	 */
+	public double getStandardDeviation() {
+		return Math.sqrt(getVariance());
+	}
+
+	/**
+	 * Calculates the variance of accumulated items
+	 * 
+	 * @return the Standard Deviation of accumulated items
+	 * @pre $none
+	 * @post $none
+	 */
+	public double getVariance() {
+		return sqrMean_ - (mean_ * mean_);
+	}
+
+	public boolean equals(Object obj) {
+		if (!(obj instanceof GSSAccumulator))
+			return false;
+
+		GSSAccumulator otherAcc = (GSSAccumulator) obj;
+		if (Double.compare(this.last_, otherAcc.last_) != 0)
+			return false;
+		if (Double.compare(this.max_, otherAcc.max_) != 0)
+			return false;
+		if (Double.compare(this.mean_, otherAcc.mean_) != 0)
+			return false;
+		if (Double.compare(this.min_, otherAcc.min_) != 0)
+			return false;
+		if (Double.compare(this.n_, otherAcc.n_) != 0)
+			return false;
+		if (Double.compare(this.sqrMean_, otherAcc.sqrMean_) != 0)
+			return false;
+
+		return true;
+	}
+
+	public String toString() {
+		String accumulatorSeparator = ";";
+		StringBuffer buffer = new StringBuffer(50);
+
+		buffer.append(accumulatorSeparator);
+		buffer.append(DataCenterWorkloadSimulator.DFAULT_NUMBER_FORMAT.format(this
+				.getMean()));
+		buffer.append(accumulatorSeparator);
+		buffer.append(DataCenterWorkloadSimulator.DFAULT_NUMBER_FORMAT.format(this
+				.getStandardDeviation()));
+		buffer.append(accumulatorSeparator);
+		buffer.append(DataCenterWorkloadSimulator.DFAULT_NUMBER_FORMAT.format(this
+				.getVariance()));
+		buffer.append(accumulatorSeparator);
+		buffer.append(DataCenterWorkloadSimulator.DFAULT_NUMBER_FORMAT.format(this
+				.getMin()));
+		buffer.append(accumulatorSeparator);
+		buffer.append(DataCenterWorkloadSimulator.DFAULT_NUMBER_FORMAT.format(this
+				.getMax()));
+		buffer.append(accumulatorSeparator);
+		buffer.append(DataCenterWorkloadSimulator.DFAULT_NUMBER_FORMAT.format(this
+				.getSum()));
+		buffer.append(accumulatorSeparator);
+		buffer.append(DataCenterWorkloadSimulator.DFAULT_NUMBER_FORMAT.format(this
+				.getCount()));
+		buffer.append(accumulatorSeparator);
+
+		return buffer.toString();
+	}
+
+	public String toFormatedString() {
+
+		String accumulatorSeparator = "; ";
+		StringBuffer buffer = new StringBuffer(50);
+
+		buffer.append(accumulatorSeparator);
+		buffer.append(String.format("%16s",
+				DataCenterWorkloadSimulator.DFAULT_NUMBER_FORMAT.format(this
+						.getMean())));
+		buffer.append(accumulatorSeparator);
+		buffer.append(String.format("%16s",
+				DataCenterWorkloadSimulator.DFAULT_NUMBER_FORMAT.format(this
+						.getStandardDeviation())));
+		buffer.append(accumulatorSeparator);
+		buffer.append(String.format("%16s",
+				DataCenterWorkloadSimulator.DFAULT_NUMBER_FORMAT.format(this
+						.getVariance())));
+		buffer.append(accumulatorSeparator);
+		buffer.append(String.format("%16s",
+				DataCenterWorkloadSimulator.DFAULT_NUMBER_FORMAT.format(this
+						.getMin())));
+		buffer.append(accumulatorSeparator);
+		buffer.append(String.format("%16s",
+				DataCenterWorkloadSimulator.DFAULT_NUMBER_FORMAT.format(this
+						.getMax())));
+		buffer.append(accumulatorSeparator);
+		buffer.append(String.format("%16s",
+				DataCenterWorkloadSimulator.DFAULT_NUMBER_FORMAT.format(this
+						.getSum())));
+		buffer.append(accumulatorSeparator);
+		buffer.append(String.format("%16s",
+				DataCenterWorkloadSimulator.DFAULT_NUMBER_FORMAT.format(this
+						.getCount())));
+		buffer.append(accumulatorSeparator);
+
+		return buffer.toString();
+	}
+}
Index: DCWoRMS/trunk/src/simulator/GridSimWrapper.java
===================================================================
--- DCWoRMS/trunk/src/simulator/GridSimWrapper.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/GridSimWrapper.java	(revision 477)
@@ -0,0 +1,65 @@
+package simulator;
+
+import eduni.simjava.Sim_exception;
+import eduni.simjava.Sim_system;
+import gridsim.GridSim;
+import gridsim.GridSimRandom;
+import gridsim.GridSimShutdown;
+
+
+import java.util.Calendar;
+
+public class GridSimWrapper extends GridSim {
+
+	protected GridSimWrapper(String name) throws Exception {
+		super(name);
+
+	}
+
+	protected GridSimWrapper(String name, double baudRate) throws Exception {
+		super(name, baudRate);
+	}
+
+	protected static void initCommonVariable(Calendar cal, boolean traceFlag, int numUser, String reportWriterName)
+			throws Exception {
+		// NOTE: the order for the below 3 lines are important
+		Sim_system.initialise();
+		Sim_system.set_trc_level(1);
+		Sim_system.set_auto_trace(traceFlag);
+
+		// Set the current Wall clock time as the starting time of simulation
+		calendar_ = cal;
+		if (cal == null) {
+			calendar_ = Calendar.getInstance();
+		}
+
+		SimulationStartDate = calendar_.getTime();
+		rand = new GridSimRandom();
+
+		// creates a GridSimShutdown object
+		GridSimShutdown shutdown = new GridSimShutdown("GridSimShutdown", numUser, reportWriterName);
+		shutdownID_ = shutdown.get_id();
+	}
+
+    public static void startSimulation() throws NullPointerException
+    {
+        System.out.println("Starting GridSim version 4.0");
+        try {
+            Sim_system.run();
+        }
+        catch (Sim_exception e)
+        {
+            throw new NullPointerException("GridSim.startGridSimulation() :" +
+                    " Error - you haven't initialized GridSim.");
+        }
+    }
+    
+    public static void setSeed(long seed){
+    	Sim_system.set_seed(seed);
+    }
+    
+    public static void setTraceSettings() {
+		Sim_system.set_trace_detail(true, true, true);
+		Sim_system.set_trace_level(Integer.MAX_VALUE);
+    }
+}
Index: DCWoRMS/trunk/src/simulator/utils/workload/StartTimeCalcultor.java
===================================================================
--- DCWoRMS/trunk/src/simulator/utils/workload/StartTimeCalcultor.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/utils/workload/StartTimeCalcultor.java	(revision 477)
@@ -0,0 +1,21 @@
+package simulator.utils.workload;
+
+import simulator.workload.reader.archive.swf.SWFFields;
+
+public class StartTimeCalcultor implements TaskManagerInterface {
+
+	public String[] manageTask(String[] task) {
+		if(task == null)
+			return null;
+		
+		long submitTime = Long.valueOf(task[SWFFields.DATA_SUBMIT_TIME]);
+		long waitingTime = Long.valueOf(task[SWFFields.DATA_WAIT_TIME]);
+		
+		long sum = submitTime + waitingTime;
+		
+		task[SWFFields.DATA_THINK_TIME_FROM_PRECEDING_JOB] = String.valueOf(sum); 
+		
+		return task;
+	}
+
+}
Index: DCWoRMS/trunk/src/simulator/utils/workload/SubmitTimeNormalizer.java
===================================================================
--- DCWoRMS/trunk/src/simulator/utils/workload/SubmitTimeNormalizer.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/utils/workload/SubmitTimeNormalizer.java	(revision 477)
@@ -0,0 +1,23 @@
+package simulator.utils.workload;
+
+import simulator.workload.reader.archive.swf.SWFFields;
+
+public class SubmitTimeNormalizer implements TaskManagerInterface{
+
+	protected long submitTimeOffset = Long.MIN_VALUE;
+	
+	public String[] manageTask(String[] task) {
+		if(task == null)
+			return null;
+		
+		if(this.submitTimeOffset == Long.MIN_VALUE) {
+			this.submitTimeOffset = Long.valueOf(task[SWFFields.DATA_SUBMIT_TIME]);
+		}
+		
+		long submitTime = Long.valueOf(task[SWFFields.DATA_SUBMIT_TIME]) - this.submitTimeOffset;
+		task[SWFFields.DATA_SUBMIT_TIME] = String.valueOf(submitTime);
+		
+		return task;
+	}
+
+}
Index: DCWoRMS/trunk/src/simulator/utils/workload/SwfManageTool.java
===================================================================
--- DCWoRMS/trunk/src/simulator/utils/workload/SwfManageTool.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/utils/workload/SwfManageTool.java	(revision 477)
@@ -0,0 +1,103 @@
+package simulator.utils.workload;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import simulator.workload.reader.archive.swf.SWFParser;
+import simulator.workload.writer.swf.QcgSWFJobWriter;
+
+public class SwfManageTool {
+	
+	protected List<TaskManagerInterface> managersList;
+	protected QcgSWFJobWriter writer;
+	protected SWFParser parser;
+	protected File readFromFile;
+	
+	protected List<TaskManagerInterface> createTaskManageToolsList() throws IOException{
+		List<TaskManagerInterface> list = new ArrayList<TaskManagerInterface>();
+		
+		list.add(new IncorrectTaskRemover());
+		list.add(new SubmitTimeNormalizer());
+		list.add(new StartTimeCalcultor());
+		
+		return list;
+	}
+	
+	protected void prepareTools(String swfFileName) throws IOException{
+		File file = new File(swfFileName);
+		String dirName = file.getParent();
+		String fileName = file.getName();
+		
+		this.readFromFile = new File(dirName, Calendar.getInstance().getTimeInMillis()+"_"+fileName);
+		file.renameTo(this.readFromFile);
+		parser = new SWFParser(this.readFromFile.getAbsolutePath());
+		
+		
+		this.writer = new QcgSWFJobWriter(dirName, fileName);
+		this.writer.writeFieldDescriptionHeader();
+		
+		
+		// rewrite swf header
+		HashMap<String, String> header = parser.loadHeader();
+		Set<String> keys = header.keySet();
+		Iterator<String> itr = keys.iterator();
+		while(itr.hasNext()){
+			String key = itr.next();
+			this.writer.writeComment(key, header.get(key));
+		}
+		
+	}
+	
+	protected void close() throws IOException{
+		if(this.parser != null)
+			this.parser.close();
+		if(this.writer != null)
+			this.writer.close();
+		if(this.readFromFile != null)
+			this.readFromFile.delete();
+	}
+	
+	public void run(String swfFileName){
+		
+		try {
+			prepareTools(swfFileName);
+			this.managersList = createTaskManageToolsList();
+			
+			String task[] = null;
+			
+			while((task = parser.readTask()) != null){
+				for(int i = 0; i < managersList.size(); i++){
+					TaskManagerInterface taskManager = managersList.get(i);
+					task = taskManager.manageTask(task);
+				}
+				
+				if(task != null)
+					writer.writeLine(task);
+			}			
+			
+		} catch (IOException e) {
+			e.printStackTrace();
+		} finally {
+			try {
+				close();
+			} catch (IOException e) {
+				e.printStackTrace();
+			}
+		}
+		
+	}
+	
+	public static void main(String args[]){
+		SwfManageTool swfManager = new SwfManageTool();
+		//swfManager.run("src/simulator/utils/workload/DAS.swf");
+		swfManager.run("src/test/ariel/workload/SDSC/SDSC-SP2-1998-3.1-cln-1000_cp.swf");
+	}
+	
+
+}
Index: DCWoRMS/trunk/src/simulator/utils/workload/IncorrectTaskRemover.java
===================================================================
--- DCWoRMS/trunk/src/simulator/utils/workload/IncorrectTaskRemover.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/utils/workload/IncorrectTaskRemover.java	(revision 477)
@@ -0,0 +1,36 @@
+package simulator.utils.workload;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.impl.LogFactoryImpl;
+
+import simulator.workload.reader.archive.swf.SWFFields;
+
+public class IncorrectTaskRemover implements TaskManagerInterface{
+
+	public static Log log = LogFactoryImpl.getLog(IncorrectTaskRemover.class);
+	
+	public String[] manageTask(String[] task) {
+		if(task == null)
+			return null;
+		
+		if("-1".equals(task[SWFFields.DATA_RUN_TIME])) {
+			log.info("Removing task "+task[SWFFields.DATA_JOB_NUMBER] + ",  RUN_TIME = -1");
+			return null;	
+		}
+		if("-1".equals(task[SWFFields.DATA_REQUESTED_TIME])) {
+			log.info("Removing task "+task[SWFFields.DATA_JOB_NUMBER] + ",  REQUESTED_TIME = -1");
+			return null;
+		}
+		if("-1".equals(task[SWFFields.DATA_NUMBER_OF_ALLOCATED_PROCESSORS])){
+			log.info("Removing task "+task[SWFFields.DATA_JOB_NUMBER] + ",  NUMBER_OF_ALLOCATED_PROCESSORS = -1");
+			return null;
+		}
+		if("-1".equals(task[SWFFields.DATA_REQUESTED_NUMBER_OF_PROCESSORS])){
+			log.info("Removing task "+task[SWFFields.DATA_JOB_NUMBER] + ",  REQUESTED_NUMBER_OF_PROCESSORS = -1");
+			return null;
+		}
+		
+		return task;
+	}
+
+}
Index: DCWoRMS/trunk/src/simulator/utils/workload/TaskManagerInterface.java
===================================================================
--- DCWoRMS/trunk/src/simulator/utils/workload/TaskManagerInterface.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/utils/workload/TaskManagerInterface.java	(revision 477)
@@ -0,0 +1,7 @@
+package simulator.utils.workload;
+
+public interface TaskManagerInterface {
+
+	public String[] manageTask(String task[]);
+	
+}
Index: DCWoRMS/trunk/src/simulator/utils/GSSimXML.java
===================================================================
--- DCWoRMS/trunk/src/simulator/utils/GSSimXML.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/utils/GSSimXML.java	(revision 477)
@@ -0,0 +1,120 @@
+package simulator.utils;
+
+import java.io.IOException;
+import java.io.Reader;
+import java.io.StringReader;
+import java.io.StringWriter;
+import java.io.Writer;
+
+import org.castor.mapping.BindingType;
+import org.exolab.castor.xml.ClassDescriptorResolverFactory;
+import org.exolab.castor.xml.Introspector;
+import org.exolab.castor.xml.MarshalException;
+import org.exolab.castor.xml.Marshaller;
+import org.exolab.castor.xml.Unmarshaller;
+import org.exolab.castor.xml.ValidationException;
+import org.exolab.castor.xml.XMLClassDescriptorResolver;
+
+/**
+ * This class provides static methods for marshalling and unmarshalling xml documents.
+ * It uses static cache objects, making the marshalling and unmarshalling process far quicker. 
+ * 
+ * @author Stanislaw Szczepanowski
+ * @see <a href="http://www.castor.org/xml-best-practice.html#Performance-Considerations">Castor - Performance Considerations</a>
+ */
+public class GSSimXML {
+
+	/**
+	 * Hidden constructor
+	 */
+	protected GSSimXML() {
+	}
+	
+	/** The class descriptor resolver */
+	protected static XMLClassDescriptorResolver mcdr = (XMLClassDescriptorResolver) ClassDescriptorResolverFactory.createClassDescriptorResolver(BindingType.XML);
+	
+	/** The unmarshaller object */
+	protected static Unmarshaller unmarshaller = new Unmarshaller();
+	
+	/** The marshaller object */
+	protected static Marshaller marshaller = new Marshaller();
+	
+	//static initialization
+	static {
+		mcdr.setIntrospector(new Introspector());
+		unmarshaller.setResolver(mcdr);
+		marshaller.setResolver(mcdr);
+	}
+	
+	/**
+	 * A generic method for marshalling.
+	 * @param <T> the type of the object that is to be marshalled
+	 * @param object the object that is to be marshalled
+	 * @param writer the writer, where the result is to be written to
+	 * @return true, if the operation succeeded; false otherwise
+	 */
+	public static synchronized <T> boolean marshal(T object, Writer writer) {
+		try {
+			marshaller.setWriter(writer);
+			marshaller.marshal(object);
+		} catch (IOException e) {
+			e.printStackTrace();
+			return false;
+		} catch (MarshalException e) {
+			e.printStackTrace();
+			return false;
+		} catch (ValidationException e) {
+			e.printStackTrace();
+			return false;
+		}
+		return true;
+	}
+	
+	/**
+	 * A generic method for marshalling.
+	 * Performs a marshalling and return the result in form of a {@link String} object.
+	 * @param <T> the type of the object that is to be marshalled
+	 * @param object the object that is to be marshalled
+	 * @return a string containing the marshalled xml or <code>null</code> if any error occurred
+	 */
+	public static synchronized <T> String marshal(T object) {
+		StringWriter sw = new StringWriter();
+		if (marshal(object, sw))
+			return sw.toString();
+		else 
+			return null;
+	}
+
+	/**
+	 * A generic method for unmarshalling.
+	 * @param <T> the type of the object that is to be unmarshalled
+	 * @param clazz the class of the object that is to be marshalled
+	 * @param reader the reader, from which the result is to be read
+	 * @return the unmarshalled object; <code>null</code> if error occurs
+	 */
+	public static synchronized <T> T unmarshal(Class<T> clazz, Reader reader) {
+		unmarshaller.setClass(clazz);
+		T result = null;
+		try {
+			result = (T) unmarshaller.unmarshal(reader);
+		} catch (MarshalException e) {
+			e.printStackTrace();
+			return null;
+		} catch (ValidationException e) {
+			e.printStackTrace();
+			return null;
+		}
+		return result;
+	}
+	
+	/**
+	 * A generic method for unmarshalling.
+	 * @param <T> the type of the object that is to be unmarshalled
+	 * @param clazz the class of the object that is to be marshalled
+	 * @param xml the string, containing an xml document, from which the result is to be read
+	 * @return the unmarshalled object; <code>null</code> if error occurs
+	 */
+	public static synchronized <T> T unmarshal(Class<T> clazz, String xml) {
+		return unmarshal(clazz, new StringReader(xml));
+	}
+}
Index: DCWoRMS/trunk/src/simulator/utils/DoubleMath.java
===================================================================
--- DCWoRMS/trunk/src/simulator/utils/DoubleMath.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/utils/DoubleMath.java	(revision 477)
@@ -0,0 +1,62 @@
+/**
+ * Created on 2008-01-05
+ */
+package simulator.utils;
+
+import java.math.BigDecimal;
+import java.text.DecimalFormat;
+import java.util.Locale;
+
+/**
+ * This class provides basic mathematical operations for the <code>double</code> primitive type
+ * @author Stanislaw Szczepanowski
+ */
+public class DoubleMath {
+	
+	/**
+	 * The pattern used for converting a <code>double</code> value to a string
+	 */
+	public static String PATTERN = "###.###";
+	
+	/**
+	 * A protected constructor which will be invoked only 
+	 * one time in the lifetime of this class
+	 */
+	protected DoubleMath() {
+	}
+	
+	/**
+	 * Adds two <code>double</code> values and returns the result of addition
+	 * @param left the left argument
+	 * @param right the right argument
+	 * @return the result of addition of the two arguments
+	 */
+	public static double add(double left, double right) {
+		DecimalFormat df = (DecimalFormat) DecimalFormat.getInstance(Locale.ENGLISH);
+		df.applyPattern(PATTERN);
+		String leftStr = df.format(left);
+		String rightStr = df.format(right);
+		BigDecimal resultDec = new BigDecimal(leftStr);
+		BigDecimal rightDec = new BigDecimal(rightStr);
+		resultDec = resultDec.add(rightDec);
+		return resultDec.doubleValue();
+	}
+	
+	/**
+	 * Subtracts from the <code>left</code> argument the <code>right</code> argument and returns the result of subtraction
+	 * @param left the left argument
+	 * @param right the right argument
+	 * @return the result of subtraction of the two arguments
+	 */
+	public static double subtract(double left, double right) {
+		DecimalFormat df = (DecimalFormat) DecimalFormat.getInstance(Locale.ENGLISH);
+		df.applyPattern(PATTERN);
+		String leftStr = df.format(left);
+		String rightStr = df.format(right);
+		BigDecimal resultDec = new BigDecimal(leftStr);
+		BigDecimal rightDec = new BigDecimal(rightStr);
+		resultDec = resultDec.subtract(rightDec);
+		return resultDec.doubleValue();
+	}
+
+}
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 477)
@@ -0,0 +1,252 @@
+package simulator.utils;
+
+import gssim.schedframe.scheduling.utils.JobDescription;
+import gssim.schedframe.scheduling.utils.TaskDescription;
+
+import java.io.IOException;
+import java.io.Reader;
+import java.io.StringReader;
+import java.io.StringWriter;
+import java.io.Writer;
+import java.util.Properties;
+
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.Templates;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerConfigurationException;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.xpath.XPathExpressionException;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+public class XsltTransformations {
+	
+	public static String INSTALLDIR = null;
+	
+	static {
+		String key = "javax.xml.transform.TransformerFactory";
+		String value = 
+			//"org.apache.xalan.xsltc.trax.TransformerFactoryImpl";
+			"org.apache.xalan.processor.TransformerFactoryImpl";
+		Properties props = System.getProperties();
+		props.put(key, value);
+		System.setProperties(props);
+		
+		INSTALLDIR = System.getProperty("gssim.install.dir");
+		if(INSTALLDIR != null)
+			INSTALLDIR = INSTALLDIR+"/";
+		else 
+			INSTALLDIR = "";
+	}
+	
+	
+	public XsltTransformations() throws ParserConfigurationException, XPathExpressionException{
+	}
+	
+	protected enum Transformers {
+		EXTEND_JOB_DESC(INSTALLDIR+"simulator/xslt/ext_job_desc.xslt"),
+		TASK2RESOURCE_REQUIREMENTS(INSTALLDIR+"simulator/xslt/task2resreq.xslt"),
+		RESOURCE_REQUIREMENTS2RTG(INSTALLDIR+"simulator/xslt/resreq2rtg.xslt"),
+		RTG2HOST_PARAMETERS(INSTALLDIR+"simulator/xslt/rtg2host_params.xslt"),
+		HOST_PARAMETERS2RTG(INSTALLDIR+"simulator/xslt/host_params2rtg.xslt"),
+		RTG2SCHEDULIING_PLAN(INSTALLDIR+"simulator/xslt/schedulingPlan.xslt"),
+		EXTRACT_JOB_ID(INSTALLDIR+"simulator/xslt/extract_job_id.xslt"),
+		JOB_POSTPROCESSING(INSTALLDIR+"simulator/xslt/job_postprocessing.xslt");
+		
+		private String fileName;
+		private Transformer transformer;
+
+		private Transformers(String arg){
+			this.fileName = arg;
+			this.transformer = null;
+		}
+		
+		public Transformer geTransformer() throws TransformerConfigurationException{
+			if(this.transformer == null){
+				TransformerFactory tFactory = TransformerFactory.newInstance();
+				StreamSource ss = new StreamSource(this.fileName);
+				Templates translet = tFactory.newTemplates(ss);
+				this.transformer = translet.newTransformer();
+			}
+			
+			return this.transformer;
+		}
+	}
+	
+	public String extendJobDescription(String jobDesc){
+		Transformer t = null;
+		try {
+			t = Transformers.EXTEND_JOB_DESC.geTransformer();
+			return transform(t, jobDesc);
+		} catch (TransformerConfigurationException e) {
+			e.printStackTrace();
+		}
+		return null;
+	}
+	
+	public String taskToResourceRequirements(String task, String jobId, String userDN, org.joda.time.DateTime submitionTime){
+		Transformer t = null;
+		try {
+			t = Transformers.TASK2RESOURCE_REQUIREMENTS.geTransformer();
+			t.clearParameters();
+			t.setParameter("JOB_ID", jobId);
+			t.setParameter("USER_DN", userDN);
+			
+			org.exolab.castor.types.DateTime dt = new org.exolab.castor.types.DateTime(submitionTime.getMillis());
+			short milis = 0;
+			dt.setMilliSecond(milis);
+			t.setParameter("SUBMISSION_TIME", dt);
+			
+			return transform(t, task);
+			
+		} catch (TransformerConfigurationException e) {
+			e.printStackTrace();
+		}
+		return null;
+	}
+	
+	public String resourceRequirementsToRTG(String resReq){
+		Transformer t = null;
+		try {
+			t = Transformers.RESOURCE_REQUIREMENTS2RTG.geTransformer();
+			return transform(t, resReq);
+		} catch (TransformerConfigurationException e) {
+			e.printStackTrace();
+		}
+		return null;
+	}
+	
+	public String RTGToHostParameters(String rtg){
+		Transformer t = null;
+		try {
+			t = Transformers.RTG2HOST_PARAMETERS.geTransformer();
+			return transform(t, rtg);
+		} catch (TransformerConfigurationException e) {
+			e.printStackTrace();
+		}
+		return null;
+	}
+	
+	public String hostParametersToRTG(String hostParameters){
+		Transformer t = null;
+		try {
+			t = Transformers.HOST_PARAMETERS2RTG.geTransformer();
+			return transform(t, hostParameters);
+		} catch (TransformerConfigurationException e) {
+			e.printStackTrace();
+		}
+		return null;
+	}
+	
+	public String RTGToSchedulingPlan(String rtg){
+		Transformer t = null;
+		try {
+			t = Transformers.RTG2SCHEDULIING_PLAN.geTransformer();
+			return transform(t, rtg);
+		} catch (TransformerConfigurationException e) {
+			e.printStackTrace();
+		}
+		return null;
+	}
+	
+	public JobDescription splitJobToTasks(String xmlJob) throws Exception{
+
+		int begin = 0;
+		int end = 0;
+		
+		begin = xmlJob.indexOf("appId=") + 7;
+		end = xmlJob.indexOf("\"", begin);
+		String jobId = xmlJob.substring(begin, end);
+		
+		JobDescription jobDesc = new JobDescription(xmlJob);
+	    jobDesc.setJobId(jobId);
+		
+		begin = 0;
+		end = 0;
+		int tb = 0;
+		int te = 0;
+		String taskId;
+		while((begin = xmlJob.indexOf("<task", end)) != -1){
+			end = xmlJob.indexOf("</task>", begin);
+			end += 7;
+			String task = xmlJob.substring(begin, end);
+			tb = task.indexOf("taskId=") + 8;
+			te = task.indexOf("\"", tb);
+			taskId = task.substring(tb, te);
+			
+			
+			TaskDescription taskDescription = new TaskDescription(task);
+	    	taskDescription.setTaskId(taskId);
+	    	jobDesc.add(taskDescription);
+		}
+		
+		return jobDesc;
+	}
+	
+	public String extractJobId(String job){
+		Transformer t = null;
+		
+		try {
+		
+			t = Transformers.EXTRACT_JOB_ID.geTransformer();
+			return transform(t, job);
+			
+		} catch (TransformerConfigurationException e) {
+			e.printStackTrace();
+		} 
+		
+		return null;
+	}
+	
+	public String jobPostProcessing(String job, String taskId, String executionDuration){
+		Transformer t = null;
+		
+		try {
+		
+			t = Transformers.JOB_POSTPROCESSING.geTransformer();
+			t.setParameter("TASK_ID", taskId);
+			t.setParameter("EXEC_DURATION_VALUE", executionDuration);
+			
+			return transform(t, job);
+			
+		} catch (TransformerConfigurationException e) {
+			e.printStackTrace();
+		} 
+		
+		return null;
+	}
+	
+	protected String transform(Transformer t, String input){
+		Writer writer = new StringWriter();
+		Reader reader = new StringReader(input);
+		
+		try {
+			writer = new StringWriter();
+			reader = new StringReader(input);
+			
+			t.transform(new StreamSource(reader), new StreamResult(writer));
+			
+
+			return writer.toString();
+		} catch (TransformerConfigurationException e) {
+			e.printStackTrace();
+		} catch (TransformerException e) {
+			e.printStackTrace();
+		} finally {
+			try {
+				writer.close();
+				reader.close();
+			} catch (IOException e) {
+				e.printStackTrace();
+			}
+			
+		}
+		return null;
+	}
+}
Index: DCWoRMS/trunk/src/simulator/utils/LogErrStream.java
===================================================================
--- DCWoRMS/trunk/src/simulator/utils/LogErrStream.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/utils/LogErrStream.java	(revision 477)
@@ -0,0 +1,46 @@
+package simulator.utils;
+
+import java.io.IOException;
+import java.io.OutputStream;
+
+import org.apache.commons.logging.Log;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+
+public class LogErrStream extends OutputStream {
+	
+	private Log log;
+ 	
+	public LogErrStream(Log log) {
+ 		this.log = log;
+ 	}
+
+    public void close() {
+    }
+
+    public void flush() {
+        
+    }
+
+    public void write(final byte[] b) throws IOException {
+        String s = new String(b);
+    	log.error(s);
+    }
+
+    public void write(final byte[] b, final int off, final int len)
+        throws IOException {
+    	if(len == 1)
+    		return;
+    	
+    	String s = new String(b, off, len);
+        log.error(s);
+    }
+
+    public void write(final int b) throws IOException {
+        log.error(b);
+    }
+}
Index: DCWoRMS/trunk/src/simulator/utils/MergeSort.java
===================================================================
--- DCWoRMS/trunk/src/simulator/utils/MergeSort.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/utils/MergeSort.java	(revision 477)
@@ -0,0 +1,159 @@
+package simulator.utils;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Iterator;
+
+public class MergeSort<T>{
+
+	private Class<?> c;
+	private Method m;
+
+	public void initSort(T[] array, String methodName, boolean ascending) {
+		try {
+			c = Class.forName(array.getClass().getCanonicalName().substring(0,  array.getClass().getCanonicalName().length() -2));
+		} catch (ClassNotFoundException e) {
+			return;
+		}
+		try {
+			m = c.getMethod(methodName);
+		} catch (SecurityException e) {
+			return;
+		} catch (NoSuchMethodException e) {
+			return;
+		}
+		T[] tmpArray = array.clone();
+		mergeSort(array, tmpArray, 0, array.length-1, ascending);
+	}
+	
+	public void initCollectionSort(Collection<T> collection, String methodName, boolean ascending) {
+		
+		Iterator<T> iterator = collection.iterator();
+		try {
+			while (iterator.hasNext() && c == null) {
+				c = Class.forName(iterator.next().getClass().getCanonicalName());
+			}
+		} catch (ClassNotFoundException e) {
+			return;
+		}
+		if(c == null)
+			return;
+		try {
+			m = c.getMethod(methodName);
+		} catch (SecurityException e) {
+			return;
+		} catch (NoSuchMethodException e) {
+			return;
+		}
+		T[] array = (T[]) collection.toArray();
+		T[] tmpArray = array.clone();
+		mergeSort(array, tmpArray, 0, array.length-1, ascending);
+		collection.clear();
+		collection.addAll(new ArrayList(Arrays.asList(array)));
+
+	}
+
+	private void mergeSort(T[] array, T[] tmpArray, int left,
+			int right, boolean ascending) {
+		if (left < right) {
+			int center = (left + right) / 2;
+			mergeSort(array, tmpArray, left, center, ascending);
+			mergeSort(array, tmpArray, center + 1, right, ascending);
+			merge(array, tmpArray, left, center + 1, right, ascending);
+		}
+	}
+
+	private void merge(T[] array, T[] tmpArray, int leftPos,
+			int rightPos, int rightEnd, boolean ascending) {
+		int leftEnd = rightPos - 1;
+		int tmpPos = leftPos;
+		int numElements = rightEnd - leftPos + 1;
+		while (leftPos <= leftEnd && rightPos <= rightEnd)
+			try {
+				if(ascending)
+				{	
+					if (Integer.class.isInstance(m.invoke(array[leftPos])))
+					{
+						if ((Integer) m.invoke(array[leftPos]) < (Integer) m.invoke(array[rightPos]))
+							tmpArray[tmpPos++] = array[leftPos++];
+						else
+							tmpArray[tmpPos++] = array[rightPos++];
+					}
+					else if (Long.class.isInstance(m.invoke(array[leftPos])))
+					{
+						if ((Long) m.invoke(array[leftPos]) < (Long) m.invoke(array[rightPos]))
+							tmpArray[tmpPos++] = array[leftPos++];
+						else
+							tmpArray[tmpPos++] = array[rightPos++];
+					}
+					else if (Double.class.isInstance(m.invoke(array[leftPos])))
+					{
+						if ((Double) m.invoke(array[leftPos]) < (Double) m.invoke(array[rightPos]))
+							tmpArray[tmpPos++] = array[leftPos++];
+						else
+							tmpArray[tmpPos++] = array[rightPos++];
+					}
+					else if (String.class.isInstance(m.invoke(array[leftPos])))
+					{
+						if (((String) m.invoke(array[leftPos])).compareTo((String) m.invoke(array[rightPos])) < 0)
+							tmpArray[tmpPos++] = array[leftPos++];
+						else
+							tmpArray[tmpPos++] = array[rightPos++];
+					} else {
+						throw new IllegalAccessException();
+					}
+				}
+				
+				else {
+					if (Integer.class.isInstance(m.invoke(array[leftPos])))
+					{
+						if ((Integer) m.invoke(array[leftPos]) > (Integer) m.invoke(array[rightPos]))
+							tmpArray[tmpPos++] = array[leftPos++];
+						else
+							tmpArray[tmpPos++] = array[rightPos++];
+					}
+					else if (Long.class.isInstance(m.invoke(array[leftPos])))
+					{
+						if ((Long) m.invoke(array[leftPos]) > (Long) m.invoke(array[rightPos]))
+							tmpArray[tmpPos++] = array[leftPos++];
+						else
+							tmpArray[tmpPos++] = array[rightPos++];
+					}
+					else if (Double.class.isInstance(m.invoke(array[leftPos])))
+					{
+						if ((Double) m.invoke(array[leftPos]) > (Double) m.invoke(array[rightPos]))
+							tmpArray[tmpPos++] = array[leftPos++];
+						else
+							tmpArray[tmpPos++] = array[rightPos++];
+					}
+					else if (String.class.isInstance(m.invoke(array[leftPos])))
+					{
+						if (((String) m.invoke(array[leftPos])).compareTo((String) m.invoke(array[rightPos])) > 0)
+							tmpArray[tmpPos++] = array[leftPos++];
+						else
+							tmpArray[tmpPos++] = array[rightPos++];
+					} else {
+						throw new IllegalAccessException();
+					}
+				}
+			} catch (IllegalArgumentException e) {
+				break;
+			} catch (IllegalAccessException e) {
+				break;
+			} catch (InvocationTargetException e) {
+				break;
+			}
+
+		while (leftPos <= leftEnd)
+			tmpArray[tmpPos++] = array[leftPos++];
+
+		while (rightPos <= rightEnd)
+			tmpArray[tmpPos++] = array[rightPos++];
+
+		for (int i = 0; i < numElements; i++, rightEnd--)
+			array[rightEnd] = tmpArray[rightEnd];
+	}
+}
Index: DCWoRMS/trunk/src/simulator/utils/InstanceFactory.java
===================================================================
--- DCWoRMS/trunk/src/simulator/utils/InstanceFactory.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/utils/InstanceFactory.java	(revision 477)
@@ -0,0 +1,40 @@
+package simulator.utils;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+
+public class InstanceFactory {
+
+	private static Log log = LogFactory.getLog(InstanceFactory.class);
+	
+	public static final Object createInstance(String className, Class<?> z){
+		
+		if(className == null)
+			return null;
+		
+		Object obj = null;
+		
+		try {
+			
+			Class<?> c = Class.forName(className);
+			if(!z.isAssignableFrom(c)){
+				log.error(className + " does not implement desired interface " + z.getName());
+				return null;
+			}
+			
+			obj = c.newInstance();
+			
+		} catch (ClassNotFoundException e) {
+			log.error(e.getMessage() + " Class not found.");
+		} catch (InstantiationException e) {
+			log.error(e.getMessage() + " Can not create class instance.");
+		} catch (IllegalAccessException e) {
+			log.error(e.getMessage() + " Illegal Access.");
+		}
+		
+		return obj;
+		
+	}
+	
+}
Index: DCWoRMS/trunk/src/simulator/utils/WorkloadCalculator.java
===================================================================
--- DCWoRMS/trunk/src/simulator/utils/WorkloadCalculator.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/utils/WorkloadCalculator.java	(revision 477)
@@ -0,0 +1,154 @@
+package simulator.utils;
+
+import java.io.File;
+import java.util.Calendar;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Set;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import simulator.workload.reader.archive.swf.SWFFields;
+import simulator.workload.reader.archive.swf.SWFParser;
+import simulator.workload.writer.swf.QcgSWFJobWriter;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+public class WorkloadCalculator {
+
+	protected static Log log = LogFactory.getLog(WorkloadCalculator.class);
+	
+	public static void main(String args[]){
+	
+		WorkloadCalculator workloadCalculator = new WorkloadCalculator();
+		try {
+			throw new RuntimeException("Nieladnie tak uruchamiac w ciemno ;). " +
+					"Wybierz funkcje, ktora ma zostac wywolana");
+			
+			//workloadCalculator.normalizeSubmitTime(args[0]);
+			//workloadCalculator.removeIncorrectTasks(args[0]);
+			
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+	}
+	
+	/**
+	 * Rewrites swf file. Submit time of all tasks will be scaled down.
+	 * @param swfFileName
+	 */
+	public void normalizeSubmitTime(String swfFileName) throws Exception{
+		log.info("Start workload submit time normalization for "+swfFileName);
+		
+		File file = new File(swfFileName);
+		String dirName = file.getParent();
+		String fileName = file.getName();
+		
+		File newFile = new File(dirName, Calendar.getInstance().getTimeInMillis()+"_"+fileName);
+		file.renameTo(newFile);
+		
+		
+		QcgSWFJobWriter writer = new QcgSWFJobWriter(dirName, fileName);
+		// write swf filed description
+		writer.writeFieldDescriptionHeader();
+		
+		SWFParser parser = new SWFParser(newFile.getAbsolutePath());
+		
+		// rewrite swf header
+		HashMap<String, String> header = parser.loadHeader();
+		Set<String> keys = header.keySet();
+		Iterator<String> itr = keys.iterator();
+		while(itr.hasNext()){
+			String key = itr.next();
+			writer.writeComment(key, header.get(key));
+		}
+		
+		// rewrite tasks
+		String task[] = parser.readTask();
+		long submitTimeOffset = Long.valueOf(task[SWFFields.DATA_SUBMIT_TIME]);
+		task[SWFFields.DATA_SUBMIT_TIME] = "0";
+		writer.writeLine(task);
+		
+		while((task = parser.readTask()) != null){
+			long submitTime = Long.valueOf(task[SWFFields.DATA_SUBMIT_TIME]) - submitTimeOffset;
+			task[SWFFields.DATA_SUBMIT_TIME] = String.valueOf(submitTime);
+			writer.writeLine(task);
+		}
+		
+		parser.close();
+		writer.close();
+		
+		newFile.delete();
+		
+		log.info("End workload submit time normalization");
+	}
+	
+	/**
+	 * Rewrites swf file and deletes all tasks which parameter RUN_TIME or REQUESTED_TIME or 
+	 * number of ALLOCATED PRCESSORS or number of REQUESTED PROCESSORS equals -1.
+	 * @param swf file name 
+	 */
+	public void removeIncorrectTasks(String swfFileName) throws Exception{
+		log.info("Start removing incorrect tasks for "+swfFileName);
+		
+		File file = new File(swfFileName);
+		String dirName = file.getParent();
+		String fileName = file.getName();
+		
+		File newFile = new File(dirName, Calendar.getInstance().getTimeInMillis()+"_"+fileName);
+		file.renameTo(newFile);
+		
+		
+		QcgSWFJobWriter writer = new QcgSWFJobWriter(dirName, fileName);
+		// write swf filed description
+		writer.writeFieldDescriptionHeader();
+		
+		SWFParser parser = new SWFParser(newFile.getAbsolutePath());
+		
+		// rewrite swf header
+		HashMap<String, String> header = parser.loadHeader();
+		Set<String> keys = header.keySet();
+		Iterator<String> itr = keys.iterator();
+		while(itr.hasNext()){
+			String key = itr.next();
+			writer.writeComment(key, header.get(key));
+		}
+		
+		// rewrite tasks
+		String task[] = null;
+		
+		while((task = parser.readTask()) != null){
+			if("-1".equals(task[SWFFields.DATA_RUN_TIME])) {
+				log.info("Removing task "+task[SWFFields.DATA_JOB_NUMBER] + ",  RUN_TIME = -1");
+				continue;	
+			}
+				
+			if("-1".equals(task[SWFFields.DATA_REQUESTED_TIME])) {
+				log.info("Removing task "+task[SWFFields.DATA_JOB_NUMBER] + ",  REQUESTED_TIME = -1");
+				continue;
+			}
+			if("-1".equals(task[SWFFields.DATA_NUMBER_OF_ALLOCATED_PROCESSORS])){
+				log.info("Removing task "+task[SWFFields.DATA_JOB_NUMBER] + ",  NUMBER_OF_ALLOCATED_PROCESSORS = -1");
+				continue;
+			}
+			if("-1".equals(task[SWFFields.DATA_REQUESTED_NUMBER_OF_PROCESSORS])){
+				log.info("Removing task "+task[SWFFields.DATA_JOB_NUMBER] + ",  REQUESTED_NUMBER_OF_PROCESSORS = -1");
+				continue;
+			}
+
+			writer.writeLine(task);
+		}
+		
+		parser.close();
+		writer.close();
+		
+		newFile.delete();
+		
+		log.info("End removing incorrect tasks");
+	}
+	
+}
Index: DCWoRMS/trunk/src/simulator/reader/EnvironmentWrapper.java
===================================================================
--- DCWoRMS/trunk/src/simulator/reader/EnvironmentWrapper.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/reader/EnvironmentWrapper.java	(revision 477)
@@ -0,0 +1,127 @@
+package simulator.reader;
+
+import java.util.ArrayList;
+
+import org.qcg.broker.schemas.exception.UnknownParameter;
+
+import schedframe.Parameter;
+import schedframe.Parameters;
+import schedframe.Property;
+import schemas.ComputingResource;
+import schemas.ComputingResourceTemplate;
+import schemas.ComputingResourceTypeChoiceSequence;
+import schemas.Environment;
+import schemas.Resources;
+import schemas.Templates;
+import schemas.TimeEstimationPlugin;
+
+public class EnvironmentWrapper {
+
+	Environment environment;
+
+	public void wrap(Environment environment) {
+		this.environment = environment;
+	}
+
+	public Templates getTemplates() throws UnknownParameter{
+		if(environment == null)
+			throw new UnknownParameter("Environment parameters are not defined.");
+		return environment.getTemplates();
+	}
+	
+	public ComputingResourceTemplate getTemplate(String templateId) throws UnknownParameter{
+		Templates templates = getTemplates() ;
+	
+		if(templates == null) 
+			return null;
+		
+		for (int i = 0; i < templates.getComputingResourceTemplateCount(); i++){
+			schemas.ComputingResourceTemplate template = templates.getComputingResourceTemplate(i);
+			if(template.getName().equals(templateId)){
+				return template;
+			}
+		}
+		return null;
+	}
+	
+	public Resources getResources() throws UnknownParameter{
+		if(environment == null)
+			throw new UnknownParameter("Environment parameters are not defined.");
+		return environment.getResources();
+	}
+	
+	public ComputingResource[] getComputingResources() throws UnknownParameter{
+		
+		ArrayList<ComputingResource>tab = null;
+		
+		if(environment == null)
+			throw new UnknownParameter("Environment parameters are not defined.");
+		Resources resources = getResources();
+		if(resources == null)
+			return null;
+		
+		tab = new ArrayList<ComputingResource>();
+		 
+		for(int i = 0; i < resources.getComputingResourceCount(); i++){
+			ComputingResource compRes = resources.getComputingResource(i);
+			tab.add(compRes);
+		}
+		if(tab.size() == 0)
+			return null;
+		else
+			return tab.toArray(new ComputingResource[0]);
+	}
+	
+	public TimeEstimationPlugin getTimeEstimationPlugin() throws UnknownParameter{
+		if(environment == null)
+			throw new UnknownParameter("Environment parameters are not defined.");
+		return environment.getTimeEstimationPlugin();
+	}
+	
+	public boolean initWithCompResTemplate(ComputingResource compRes, ComputingResourceTemplate template){
+
+		compRes.setClazz(template.getClazz());
+
+		compRes.setComputingResourceTypeChoiceSequence(new ComputingResourceTypeChoiceSequence());
+		compRes.getComputingResourceTypeChoiceSequence().setComputingResource(template.getComputingResource());
+		compRes.getComputingResourceTypeChoiceSequence().setResourceUnit(template.getResourceUnit());
+		compRes.getComputingResourceTypeChoiceSequence().setProfile(template.getProfile());
+		compRes.getComputingResourceTypeChoiceSequence().setParameter(template.getParameter());
+		
+		return true;
+	}
+	
+	public static Parameters extractParameters(schemas.Parameter[] parameters){
+		
+		Parameters params = null;
+		
+		if(parameters.length != 0)
+			params = new Parameters();
+		
+		for(int i = 0; i < parameters.length; i++){
+			schemas.Parameter parameter = parameters[i];
+			Parameter param = new Parameter(parameter.getName());
+			if(parameter.getParameterTypeSequence() != null && parameter.getParameterTypeSequence().getProperty() != null)
+			{							
+				int propertyCount = parameter.getParameterTypeSequence().getPropertyCount();
+				for(int j = 0; j < propertyCount; j++){
+					schemas.Property property = parameter.getParameterTypeSequence().getProperty(j);
+					Property prop = new Property(property.getName());
+					int stringValueWithUnitCount = property.getStringValueWithUnitCount();
+					for(int k = 0; k < stringValueWithUnitCount; k++){
+						prop.add(property.getStringValueWithUnit(k));
+					}
+					param.addProperty(prop);
+				}
+			} else {
+				int stringValueWithUnitCount =  parameter.getStringValueWithUnitCount();
+				for(int j = 0; j < stringValueWithUnitCount; j++){
+					param.add(parameter.getStringValueWithUnit(j));
+				}
+			}
+			params.put(parameter.getName(), param);
+		}
+		return params;
+	}
+
+}
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 477)
@@ -0,0 +1,444 @@
+package simulator.reader;
+
+import gridsim.ResourceCalendar;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.IOException;
+import java.util.ArrayDeque;
+import java.util.ArrayList;
+import java.util.Deque;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
+import org.exolab.castor.types.AnyNode;
+import org.exolab.castor.xml.MarshalException;
+import org.exolab.castor.xml.ValidationException;
+import org.qcg.broker.schemas.exception.UnknownParameter;
+
+import schedframe.Initializable;
+import schedframe.Parameter;
+import schedframe.Parameters;
+import schedframe.ResourceController;
+import schedframe.exceptions.ResourceException;
+import schedframe.resources.StandardResourceType;
+import schedframe.resources.computing.ComputingResource;
+import schedframe.resources.computing.ResourceFactory;
+import schedframe.resources.computing.description.AbstractResourceDescription;
+import schedframe.resources.computing.description.ComputingResourceDescription;
+import schedframe.resources.units.ResourceUnit;
+import schedframe.resources.units.ResourceUnitName;
+import schedframe.scheduling.Scheduler;
+import schedframe.scheduling.manager.resources.ManagedResources;
+import schedframe.scheduling.plugin.SchedulingPlugin;
+import schedframe.scheduling.plugin.estimation.ExecutionTimeEstimationPlugin;
+import schedframe.scheduling.queue.TaskQueue;
+import schedframe.scheduling.queue.TaskQueueList;
+import schemas.Environment;
+import schemas.ManagedComputingResources;
+import schemas.StringValueWithUnit;
+import simulator.ConfigurationOptions;
+import simulator.utils.InstanceFactory;
+
+public class ResourceReader {
+	
+	protected String resDescFileName;
+
+	protected ResourceCalendar resourceCalendar;
+	protected Deque<Initializable> toInit = new ArrayDeque<Initializable>();
+	
+	private ExecutionTimeEstimationPlugin execTimeEstimationPlugin;
+	private String globalSchedulingPluginName;
+	
+	public ResourceReader(ConfigurationOptions options) throws IOException {
+
+		resDescFileName = options.resdescFileName;
+		globalSchedulingPluginName = "example.globalplugin.GridFCFSRoundRobinPlugin";
+		prepareCalendar();
+	}
+
+	public ResourceController read() throws MarshalException, ValidationException, FileNotFoundException, Exception,
+			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));
+		
+		System.out.println("started creating environment description");
+		List<ComputingResourceDescription> mainCompResDescList = createEnvironmentDescription(env);
+		System.out.println("finished creating environment description");
+
+		System.out.println("started creating resources");
+		List<ComputingResource> computingResources = createResources(mainCompResDescList);
+		System.out.println("finished creating resource");
+
+		System.out.println("started creating schedulers");
+		Scheduler mainScheduler = createSchedulers(env.getResources().getScheduler(), computingResources);
+		System.out.println("finished creating schedulers");
+
+		ResourceController rc = new ResourceController(mainScheduler, computingResources);
+		rc.setInitList(toInit);
+		return rc;
+	}
+
+	protected List<ComputingResourceDescription> createEnvironmentDescription(Environment environment) throws Exception {
+
+		List<ComputingResourceDescription> mainCompResDescList = new ArrayList<ComputingResourceDescription>();
+		
+		LinkedList<ComputingResourceDescription> resDescStructure = new LinkedList<ComputingResourceDescription>();
+		LinkedList<schemas.ComputingResource> toExamine = new LinkedList<schemas.ComputingResource>();
+		EnvironmentWrapper environmentWrapper = new EnvironmentWrapper();
+		environmentWrapper.wrap(environment);
+		
+		String execTimeEstimationPluginClassName = null;
+		if(environmentWrapper.getTimeEstimationPlugin() != null){
+			execTimeEstimationPluginClassName = environmentWrapper.getTimeEstimationPlugin().getName();
+		}
+		
+		try{
+			execTimeEstimationPlugin = (ExecutionTimeEstimationPlugin) InstanceFactory.createInstance(
+					execTimeEstimationPluginClassName, ExecutionTimeEstimationPlugin.class);
+			if(execTimeEstimationPlugin == null) {
+				execTimeEstimationPluginClassName = "example.timeestimation.DefaultTimeEstimationPlugin";
+				execTimeEstimationPlugin = (ExecutionTimeEstimationPlugin) InstanceFactory.createInstance(
+						execTimeEstimationPluginClassName, ExecutionTimeEstimationPlugin.class);
+			} else {
+				Parameters params = EnvironmentWrapper.extractParameters(environmentWrapper.getTimeEstimationPlugin().getParameter());
+				execTimeEstimationPlugin.init(params);
+			}
+		} catch (Exception e){
+			if (execTimeEstimationPlugin == null) {
+				throw new Exception("Can not create execution time estimation plugin instance.");
+			}
+		}
+
+		if(environmentWrapper.getComputingResources() != null) {
+			for(int i = 0; i < environmentWrapper.getComputingResources().length; i++){
+				schemas.ComputingResource compResDef = environmentWrapper.getComputingResources()[i];
+				toExamine.push(compResDef);
+				
+				ComputingResourceDescription compResDesc = new ComputingResourceDescription(compResDef);
+				resDescStructure.push(compResDesc);
+				mainCompResDescList.add(compResDesc);
+			}
+		}
+		while (!toExamine.isEmpty()) {
+			schemas.ComputingResource parentCompResDef = toExamine.pop();
+			ComputingResourceDescription parentExecResDesc = resDescStructure.pop();
+			if(parentCompResDef.getComputingResourceTypeChoiceSequence() != null)
+			{
+				int computingResourceCount = parentCompResDef.getComputingResourceTypeChoiceSequence().getComputingResourceCount();
+				for (int i = 0; i < computingResourceCount; i++) {
+
+					schemas.ComputingResource compResDef = parentCompResDef.getComputingResourceTypeChoiceSequence().getComputingResource(i);
+					if(compResDef == null)
+						continue;
+					long compResCount = compResDef.getCount() > 1 ? compResDef.getCount() : 1;
+					
+					for(int j = 0; j < compResCount; j++){
+						if(compResDef.getComputingResourceTypeChoiceSequence2() != null){
+							String templateId = ((AnyNode)compResDef.getComputingResourceTypeChoiceSequence2().getTemplateId()).getFirstChild().getStringValue();
+							schemas.ComputingResourceTemplate template = environmentWrapper.getTemplate(templateId);
+							environmentWrapper.initWithCompResTemplate(compResDef, template);
+						} 
+						//toExamine.insertElementAt(compResDef, 0);
+						toExamine.addLast(compResDef);
+						ComputingResourceDescription resDesc = new ComputingResourceDescription(compResDef);
+						parentExecResDesc.addChildren(resDesc);
+						//resDescStructure.insertElementAt(resDesc, 0);
+						resDescStructure.addLast(resDesc);
+					}
+				}
+			} else
+				continue;
+		}
+		return mainCompResDescList;
+	}
+
+	protected List<ComputingResource> createResources(List<ComputingResourceDescription> mainCompResDesList) {
+
+		List<ComputingResource> mainCompResourceList = new ArrayList<ComputingResource>();
+		
+		Deque<ComputingResourceDescription> toExamine = new ArrayDeque<ComputingResourceDescription>();
+		Deque<ComputingResource> resStructure = new ArrayDeque<ComputingResource>();
+		
+		for(ComputingResourceDescription mainExecResDes : mainCompResDesList){
+			ComputingResource mainResource = ResourceFactory.createResource(mainExecResDes);
+			toExamine.push(mainExecResDes);
+			resStructure.push(mainResource);
+			mainCompResourceList.add(mainResource);
+		}
+
+		while (!toExamine.isEmpty()) {
+			ComputingResourceDescription parentResDesc = toExamine.pop();
+			ComputingResource parentResource = resStructure.pop();
+			toInit.add(parentResource);
+			List<AbstractResourceDescription> childrenResDesc = parentResDesc.getChildren();
+			if (childrenResDesc == null){
+				continue;
+			}
+			int compResCount = childrenResDesc.size();
+			for (int i = 0; i < compResCount; i++) {
+				ComputingResourceDescription compResDesc = (ComputingResourceDescription) childrenResDesc.get(i);
+				toExamine.push(compResDesc);
+				ComputingResource resource = ResourceFactory.createResource(compResDesc);
+				parentResource.addChild(resource);
+				resStructure.push(resource);
+			}
+		}
+		return mainCompResourceList;
+	}
+
+	protected Scheduler createSchedulers(schemas.Scheduler[] schedulersDef, List<ComputingResource> mainCompResourceList) throws Exception{
+
+		List<Scheduler> mainSchedulers = new ArrayList<Scheduler>();
+			
+		Deque<schemas.Scheduler> toExamine = new ArrayDeque<schemas.Scheduler>();	
+		Deque<Scheduler> schedulersStructure = new ArrayDeque<Scheduler>();
+		for(int i = 0; i < schedulersDef.length; i++){
+			schemas.Scheduler schedulerDef = schedulersDef[i];
+			Scheduler mainScheduler = initScheduler(schedulerDef, mainCompResourceList);
+			toExamine.push(schedulerDef);
+			schedulersStructure.push(mainScheduler);
+			mainSchedulers.add(mainScheduler);
+		}	
+	
+		while (!toExamine.isEmpty()) {
+			schemas.Scheduler parentSchedulerDef = toExamine.pop();
+		
+			Scheduler parentScheduler = null;
+			if(!schedulersStructure.isEmpty())
+				parentScheduler = schedulersStructure.pop();
+			
+			if(parentSchedulerDef.getSchedulerTypeChoice() == null)
+				continue;
+			int schedulerChoiceItemCount = parentSchedulerDef.getSchedulerTypeChoice().getSchedulerTypeChoiceItemCount();
+			for (int i = 0; i < schedulerChoiceItemCount; i++) {
+				schemas.Scheduler schedulerDef = parentSchedulerDef.getSchedulerTypeChoice().getSchedulerTypeChoiceItem(i).getScheduler();
+				if(schedulerDef == null)
+					continue;
+				else
+				{
+					Scheduler scheduler = initScheduler(schedulerDef, mainCompResourceList);
+					schedulersStructure.push(scheduler);
+					parentScheduler.addChild(scheduler);
+					toExamine.push(schedulerDef);
+				}
+			}
+			//necessary if children list isn't initialized in Scheduler
+			//parentScheduler.init();
+		}
+
+		//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")){
+			mainScheduler = mainSchedulers.get(0);
+		}
+		else{
+			SchedulingPlugin schedulingPlugin = (SchedulingPlugin) InstanceFactory.createInstance(globalSchedulingPluginName,
+					SchedulingPlugin.class);
+			TaskQueueList queues = new TaskQueueList(1);
+			TaskQueue queue = new TaskQueue(false);
+			queues.add(queue);
+			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);
+			}
+			//necessary if children list isn't initialized in Scheduler
+			//mainScheduler.init();
+		}
+		return mainScheduler;
+	}
+
+	protected Scheduler initScheduler(schemas.Scheduler schedulerDef, List<ComputingResource> mainCompResourceList) throws Exception{
+		Scheduler scheduler = null;
+		
+		ManagedResources managedResources = null;
+		//List<ComputingResource> managedCompResources = new ArrayList<ComputingResource>();
+		TaskQueueList queues = new TaskQueueList(1);
+		
+		if(schedulerDef.getQueues()!= null){
+			int queueCount = schedulerDef.getQueues().getQueueCount();
+			for(int i = 0; i < queueCount; i++){
+				schemas.QueueType queueDef = schedulerDef.getQueues().getQueue(i);
+				TaskQueue queue = new TaskQueue(queueDef.getReservation());
+				queue.setName(queueDef.getName());
+				queue.setPriority(queueDef.getPriority());
+				queues.add(queue);
+			}
+		} else {
+			TaskQueue queue = new TaskQueue(false);
+			queues.add(queue);
+		}
+		
+		if(schedulerDef.getSchedulerTypeChoice() != null) {
+			int schedulerChoiceItemCount = schedulerDef.getSchedulerTypeChoice().getSchedulerTypeChoiceItemCount();
+			for (int i = 0; i < schedulerChoiceItemCount; i++) {
+				ManagedComputingResources mcr = schedulerDef.getSchedulerTypeChoice().getSchedulerTypeChoiceItem(i).getManagedComputingResources();
+				if(mcr == null)
+					continue;
+
+				List<String> managedCompResourcesIds = new ArrayList<String>();
+				int resourceNameCount = mcr.getResourceNameCount();
+				for(int j = 0; j < resourceNameCount; j++) { 
+					managedCompResourcesIds.add(mcr.getResourceName(j));
+				}
+				managedResources = matchResourcesForScheduler(mainCompResourceList, managedCompResourcesIds, mcr.getInclude());	
+				//managedResources = new ManagedResources(managedCompResources, new HashMap<ResourceUnitName, List<ResourceUnit>>());
+			}
+		}
+
+		SchedulingPlugin schedulingPlugin = null;
+		if(schedulerDef.getSchedulingPlugin() != null){
+			String schedulingPluginName = schedulerDef.getSchedulingPlugin().getName();
+			schedulingPlugin = (SchedulingPlugin) InstanceFactory.createInstance(schedulingPluginName,
+					SchedulingPlugin.class);
+			Parameters params = EnvironmentWrapper.extractParameters(schedulerDef.getSchedulingPlugin().getParameter());
+			if(schedulerDef.getSchedulingPlugin().getFrequency() != null)
+			{
+				Parameter param = new Parameter("frequency");
+				StringValueWithUnit sv = new StringValueWithUnit();
+				sv.setContent(String.valueOf(schedulerDef.getSchedulingPlugin().getFrequency().getContent()));
+				sv.setUnit(schedulerDef.getSchedulingPlugin().getFrequency().getUnit());
+				param.add(sv);
+				
+				if(params == null)
+					params = new Parameters();
+				params.put("frequency", param);
+			}
+			schedulingPlugin.init(params);
+		}	
+
+		//TODO - refactor (create scheduler in 1 line)
+		if(schedulerDef.getClazz().equals("GridBroker")){
+			scheduler = ResourceFactory.createScheduler(StandardResourceType.GS, "grid", schedulingPlugin, execTimeEstimationPlugin, queues, managedResources);
+		} else {
+			scheduler = ResourceFactory.createScheduler(StandardResourceType.LS, schedulerDef.getName(), schedulingPlugin, execTimeEstimationPlugin,  queues, managedResources);
+		}
+		return scheduler;
+	}
+	
+	/*private List<ComputingResource> matchCompResourcesForScheduler(List<ComputingResource> mainCompResourceList, List<String> resIdList, boolean include){
+		List<ComputingResource> compResources = new ArrayList<ComputingResource>();
+		for(ComputingResource mainCompRes: mainCompResourceList){
+			for(String resourceName : resIdList){
+				ComputingResource computingResource;
+				try {
+					if(resourceName.equals(mainCompRes.getName()))
+						computingResource = mainCompRes;
+					else
+						computingResource = mainCompRes.getDescendantByName(resourceName);
+				} catch (ResourceException e) {
+					computingResource = null;
+				}
+				if(computingResource != null)
+				{
+					if(include){
+						compResources.add(computingResource);
+					} else{
+						compResources.addAll(computingResource.getChildren());
+					}
+				}
+			}
+		}
+		return compResources;
+	}*/
+	
+	private ManagedResources matchResourcesForScheduler(List<ComputingResource> mainCompResourceList, List<String> resIdList, boolean include){
+		
+		List<ComputingResource> compResources = new ArrayList<ComputingResource>();
+		Map<ResourceUnitName, List<ResourceUnit>> resourceUnits = new HashMap<ResourceUnitName, List<ResourceUnit>>();
+		
+		for(ComputingResource mainCompRes: mainCompResourceList){
+			for(String resourceName : resIdList){
+				ComputingResource computingResource;
+				try {
+					if(resourceName.equals(mainCompRes.getName()))
+						computingResource = mainCompRes;
+					else
+						computingResource = mainCompRes.getDescendantByName(resourceName);
+				} catch (ResourceException e) {
+					continue;
+				}
+				if(computingResource != null)
+				{
+					if(include){
+						compResources.add(computingResource);
+					} else{
+						compResources.addAll(computingResource.getChildren());
+						resourceUnits = getSharedResourceUnits(computingResource);
+					}
+				}
+			}
+		}
+		return new ManagedResources(compResources, resourceUnits);
+	}
+	
+	
+	private Map<ResourceUnitName, List<ResourceUnit>> getSharedResourceUnits(ComputingResource compResources){
+		Map<ResourceUnitName, List<ResourceUnit>> resourceUnits = new HashMap<ResourceUnitName, List<ResourceUnit>>();
+		List<ResourceUnit> list;
+		boolean resourceNotVisited = true;
+		ComputingResource parent = compResources;
+		while(parent != null && resourceNotVisited){
+			Map<ResourceUnitName, List<ResourceUnit>> resUnits = parent.getResourceCharacteristic().getResourceUnits();
+			for(ResourceUnitName run : resUnits.keySet()){
+				for(ResourceUnit resUnit : resUnits.get(run)){
+					if((resourceUnits.get(run) == null)){
+						list = new ArrayList<ResourceUnit>(1);
+						resourceUnits.put(resUnit.getName(), list);
+						list.add(resUnit);
+					} else if(!resourceUnits.get(run).contains(resUnit)){
+						list = resourceUnits.get(resUnit.getName());
+						list.add(resUnit);
+					} else {
+						resourceNotVisited = false;
+					}
+				}
+			}
+			parent = parent.getParent();
+		}
+		return resourceUnits;
+	}
+	
+	private void prepareCalendar() {
+		long seed = 11L * 13L * 17L * 19L * 23L + 1L;
+		double timeZone = 0.0;
+		double peakLoad = 0.0; // the resource load during peak hour
+		double offPeakLoad = 0.0; // the resource load during off-peak hr
+		double holidayLoad = 0.0; // the resource load during holiday
+
+		// incorporates weekends so the grid resource is on 7 days a week
+		LinkedList<Integer> Weekends = new LinkedList<Integer>();
+		Weekends.add(java.util.Calendar.SATURDAY);
+		Weekends.add(java.util.Calendar.SUNDAY);
+
+		// incorporates holidays. However, no holidays are set in this example
+		LinkedList<Integer> Holidays = new LinkedList<Integer>();
+		resourceCalendar = new ResourceCalendar(timeZone, peakLoad, offPeakLoad, holidayLoad, Weekends, Holidays,
+				seed);
+	}
+	
+}
Index: DCWoRMS/trunk/src/simulator/reader/ComputingResourceWrapper.java
===================================================================
--- DCWoRMS/trunk/src/simulator/reader/ComputingResourceWrapper.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/reader/ComputingResourceWrapper.java	(revision 477)
@@ -0,0 +1,45 @@
+package simulator.reader;
+
+import org.qcg.broker.schemas.exception.UnknownParameter;
+
+import schemas.ComputingResource;
+import schemas.ComputingResourceTypeChoiceSequence;
+import schemas.ComputingResourceTypeChoiceSequence2;
+
+public class ComputingResourceWrapper {
+	
+	ComputingResource computingResource;
+	
+	public void wrap(ComputingResource computingResource) {
+		this.computingResource = computingResource;
+	}
+	
+	public long getChildCount(){
+		long compResCount = computingResource.getCount() > 1 ? computingResource.getCount() : 1;
+		return compResCount;
+	}
+
+	public ComputingResourceTypeChoiceSequence getCharacteristics() throws UnknownParameter {
+		if(computingResource.getComputingResourceTypeChoiceSequence() == null)
+			throw new UnknownParameter("Characeristics are not defined.");
+		return computingResource.getComputingResourceTypeChoiceSequence();
+	}
+	
+	public ComputingResourceTypeChoiceSequence2 getTemplate() throws UnknownParameter {
+		if(computingResource.getComputingResourceTypeChoiceSequence2() == null)
+			throw new UnknownParameter("Templates are not defined.");
+		return computingResource.getComputingResourceTypeChoiceSequence2();
+	}
+
+	public String getResourceClass(){
+		return this.computingResource.getClazz();
+	}
+	
+	public String getName(){
+		return this.computingResource.getName();
+	}
+	
+	public long getGroupId(){
+		return this.computingResource.getGroupId();
+	}
+}
Index: DCWoRMS/trunk/src/simulator/workload/writer/JobWriter.java
===================================================================
--- DCWoRMS/trunk/src/simulator/workload/writer/JobWriter.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/workload/writer/JobWriter.java	(revision 477)
@@ -0,0 +1,12 @@
+package simulator.workload.writer;
+
+import java.io.IOException;
+
+public interface JobWriter<Job> {
+
+	public boolean write(Job job) throws IOException;
+	
+	public void setOverwrite(boolean overwrite);
+	
+	public void close() throws IOException;
+}
Index: DCWoRMS/trunk/src/simulator/workload/writer/xmlJob/QcgXmlJobWriter.java
===================================================================
--- DCWoRMS/trunk/src/simulator/workload/writer/xmlJob/QcgXmlJobWriter.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/workload/writer/xmlJob/QcgXmlJobWriter.java	(revision 477)
@@ -0,0 +1,83 @@
+package simulator.workload.writer.xmlJob;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.exolab.castor.xml.MarshalException;
+import org.exolab.castor.xml.ValidationException;
+
+import simulator.workload.fileFilters.QcgJobFileNameFilter;
+
+import org.qcg.broker.schemas.jobdesc.QcgJob;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+
+public class QcgXmlJobWriter implements XMLJobWriter<QcgJob>{
+
+	private Log log = LogFactory.getLog(QcgXmlJobWriter.class);
+	public boolean overwrite;
+	public String fileNamePrefix;
+	public File directory;
+	
+	public QcgXmlJobWriter(String dirName, String fileNamePrefix){
+		this.overwrite = true;
+		this.fileNamePrefix = fileNamePrefix;
+		this.directory = new File(dirName);
+
+		if(!directory.exists())
+			directory.mkdirs();
+		
+	}
+	
+	public boolean write(QcgJob job) throws IOException{
+		String fileName = QcgJobFileNameFilter.FILE_NAME_PREFIX+"_"+job.getAppId()+".xml";
+		
+		File file = new File(directory, fileName);
+		if(file.exists()) {
+			if(this.overwrite){
+				if(!file.delete()){
+					if(log.isErrorEnabled())
+						log.error("File " + fileName + " can not be deleted.");
+					return false;
+				}
+				if(!file.createNewFile()){
+					if(log.isErrorEnabled())
+						log.error("File " + fileName + " can not be created.");
+					return false;
+				}
+			} else {
+				throw new IOException("File "+fileName + " exists and can not be removed. Set overwrite attribute value to true.");
+			}
+		}
+		
+		FileWriter writer = new FileWriter(file);
+		
+		try {
+		
+			job.marshal(writer);
+	
+		} catch (MarshalException e) {
+			throw new IOException(e.getMessage());
+		} catch (ValidationException e) {
+			throw new IOException(e.getMessage());
+		} finally {
+			writer.close();
+		}
+		
+		
+		return true;
+	}
+
+	public void setOverwrite(boolean overwrite) {
+		this.overwrite = overwrite;
+	}
+
+	public void close() throws IOException{};
+}
Index: DCWoRMS/trunk/src/simulator/workload/writer/xmlJob/XMLJobWriter.java
===================================================================
--- DCWoRMS/trunk/src/simulator/workload/writer/xmlJob/XMLJobWriter.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/workload/writer/xmlJob/XMLJobWriter.java	(revision 477)
@@ -0,0 +1,13 @@
+package simulator.workload.writer.xmlJob;
+
+import simulator.workload.writer.JobWriter;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ * @param <Job>
+ */
+public interface XMLJobWriter<Job> extends JobWriter<Job>{
+
+}
Index: DCWoRMS/trunk/src/simulator/workload/writer/swf/QcgSWFJobWriter.java
===================================================================
--- DCWoRMS/trunk/src/simulator/workload/writer/swf/QcgSWFJobWriter.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/workload/writer/swf/QcgSWFJobWriter.java	(revision 477)
@@ -0,0 +1,182 @@
+package simulator.workload.writer.swf;
+
+import java.io.IOException;
+import java.util.Random;
+
+import org.exolab.castor.types.Duration;
+
+import simulator.workload.reader.archive.swf.SWFFields;
+
+import org.qcg.broker.schemas.exception.NoSuchParamException;
+import org.qcg.broker.schemas.jobdesc.ExecutionTimeType;
+import org.qcg.broker.schemas.jobdesc.QcgJob;
+import org.qcg.broker.schemas.jobdesc.Task;
+import org.qcg.broker.schemas.jobdesc.wrapper.TaskRequirements;
+import org.qcg.broker.schemas.jobdesc.wrapper.impl.TaskRequirementsImpl;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+public class QcgSWFJobWriter extends AbstractSWFJobWriter<QcgJob>{
+
+	protected int intTaskId;
+	protected String workloadArray[];
+	protected Random random;
+	
+	public QcgSWFJobWriter(String dirName, String fileName) throws IOException{
+		super(dirName, fileName);
+		this.intTaskId = 0;
+		this.workloadArray = new String[18];
+		this.random = new Random(System.currentTimeMillis());
+	}
+	
+	public boolean write(QcgJob job) throws IOException {
+		long taskLength;
+		String idMapping;
+		String taskId;
+		TaskRequirements taskReqWrapper = new TaskRequirementsImpl();
+		
+		for(int i = 0; i < job.getTaskCount(); i++){
+			Task task = job.getTask(i);
+			taskReqWrapper.wrap(task);
+			
+			// prepare swf task id
+			if(this.useTaskMapping){
+				taskId = String.valueOf(intTaskId);
+				idMapping = taskId+":"+job.getAppId()+":"+task.getTaskId();
+				intTaskId++;
+				this.taskMapping.add(idMapping);
+			} else {
+				taskId = task.getTaskId();
+			}
+			
+			// prepare task length value
+			if(tasksLength.containsKey(task.getTaskId())){
+				taskLength = tasksLength.get(task.getTaskId());
+			} else {
+				taskLength = 0;
+			}
+			
+			double tab[] = null;
+			
+			// prepare requested number of processors
+			String reqCpuCnt = IRRELEVANT;
+			try {
+				double min = 0;
+				double max = Double.MAX_VALUE;
+				
+				if((tab = taskReqWrapper.getCpucount()).length != 0){ // try single value
+					reqCpuCnt = String.valueOf(Math.round(tab[0]));
+					
+				} else {
+					double d[][] = taskReqWrapper.getRangeCpucount(); 
+					if(d.length != 0 && (tab = d[0]).length != 0){ // try range value
+						min = tab[0];
+						max = tab[1];
+						double r = random.nextDouble();
+						reqCpuCnt = String.valueOf(Math.round(min + (max - min) * r));
+					
+					} else {										// try single min and max value
+						boolean change = false;
+						if((tab = taskReqWrapper.getMinCpucount()).length != 0) {
+							min = tab[0];
+							change = true;
+						}
+						if((tab = taskReqWrapper.getMaxCpucount()).length != 0){
+							max = tab[0];
+							change = true;
+						}
+						if(change) {
+							double r = random.nextDouble();
+							reqCpuCnt = String.valueOf(Math.round(min + (max - min) * r));
+						}
+					}
+				}
+				
+			} catch(NoSuchParamException e){
+
+			}
+			
+			// prepare requested memory
+			String reqMemCnt = IRRELEVANT;
+			try {
+				double min = 0;
+				double max = Double.MAX_VALUE;
+				
+				if((tab = taskReqWrapper.getMemory()).length != 0){ // try single value
+					reqMemCnt = String.valueOf(Math.round(tab[0]));
+					
+				} else {
+					double d[][] = taskReqWrapper.getRangeMemory(); 
+					if(d.length != 0 && (tab = d[0]).length != 0){ // try range value
+						min = tab[0];
+						max = tab[1];
+						double r = random.nextDouble();
+						reqMemCnt = String.valueOf(Math.round(min + (max - min) * r));
+						
+					} else {										// try single min and max value
+						boolean change = false;
+						if((tab = taskReqWrapper.getMinMemory()).length != 0) {
+							min = tab[0];
+							change = true;
+						}
+						if((tab = taskReqWrapper.getMaxMemory()).length != 0){
+							max = tab[0];
+							change = true;
+						}
+						if(change){
+							double r = random.nextDouble();
+							reqMemCnt = String.valueOf(Math.round(min + (max - min) * r));
+						}
+					}
+				} 
+				
+			} catch(NoSuchParamException e){
+
+			}
+			
+			// prepare requested time
+			long reqTaskLength = taskLength;
+			ExecutionTimeType ett = task.getExecutionTime();
+			if(ett != null){
+				Duration duration = ett.getExecutionDuration();
+				reqTaskLength = duration.toLong();
+			}
+			
+			
+			workloadArray[SWFFields.DATA_JOB_NUMBER] = taskId;
+			workloadArray[SWFFields.DATA_SUBMIT_TIME] = String.valueOf(this.submitTime);
+			workloadArray[SWFFields.DATA_WAIT_TIME] = IRRELEVANT;
+			workloadArray[SWFFields.DATA_RUN_TIME] = String.valueOf(taskLength);
+			workloadArray[SWFFields.DATA_NUMBER_OF_ALLOCATED_PROCESSORS] = reqCpuCnt;
+			workloadArray[SWFFields.DATA_AVERAGE_CPU_TIME_USED] = IRRELEVANT;
+			workloadArray[SWFFields.DATA_USED_MEMORY] = IRRELEVANT;
+			workloadArray[SWFFields.DATA_REQUESTED_NUMBER_OF_PROCESSORS] = reqCpuCnt;
+			workloadArray[SWFFields.DATA_REQUESTED_TIME] = String.valueOf(reqTaskLength);
+			workloadArray[SWFFields.DATA_REQUESTED_MEMORY] = reqMemCnt;
+			workloadArray[SWFFields.DATA_STATUS] = IRRELEVANT;
+			workloadArray[SWFFields.DATA_USER_ID] = IRRELEVANT;
+			workloadArray[SWFFields.DATA_GROUP_ID] = IRRELEVANT;
+			workloadArray[SWFFields.DATA_EXECUTABLE_NUMBER]  = IRRELEVANT;
+			workloadArray[SWFFields.DATA_QUEUE_NUMBER] = IRRELEVANT;
+			workloadArray[SWFFields.DATA_PARTITION_NUMBER] = IRRELEVANT;
+			workloadArray[SWFFields.DATA_PRECEDING_JOB_NUMBER] = IRRELEVANT;
+			workloadArray[SWFFields.DATA_THINK_TIME_FROM_PRECEDING_JOB] = IRRELEVANT;
+			
+			writeLine(workloadArray);
+			
+		}
+		
+		this.tasksLength.clear();
+		
+		return true;
+	}
+	
+	public void addTaskMapping(String swfJobId, String xmlJobId, String xmlTaskId){
+		if(!this.useTaskMapping)
+			return;
+		this.taskMapping.add(swfJobId+":"+xmlJobId+":"+xmlTaskId);
+	}
+}
Index: DCWoRMS/trunk/src/simulator/workload/writer/swf/SWFJobWriter.java
===================================================================
--- DCWoRMS/trunk/src/simulator/workload/writer/swf/SWFJobWriter.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/workload/writer/swf/SWFJobWriter.java	(revision 477)
@@ -0,0 +1,25 @@
+package simulator.workload.writer.swf;
+
+import java.io.IOException;
+
+import simulator.workload.writer.JobWriter;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ * @param <Job>
+ */
+public interface SWFJobWriter<Job> extends JobWriter<Job>{
+
+	public void writeFieldDescriptionHeader() throws IOException;
+	
+	public void writeComment(String key, String value) throws IOException;
+	
+	public void useTaskMapping(boolean use);
+	
+	public void setJobSubmitTime(long submitTime);
+	
+	public void addTaskLength(String taskId, long taskLength);
+	
+}
Index: DCWoRMS/trunk/src/simulator/workload/writer/swf/AbstractSWFJobWriter.java
===================================================================
--- DCWoRMS/trunk/src/simulator/workload/writer/swf/AbstractSWFJobWriter.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/workload/writer/swf/AbstractSWFJobWriter.java	(revision 477)
@@ -0,0 +1,108 @@
+package simulator.workload.writer.swf;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.Writer;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
+
+import simulator.DataCenterWorkloadSimulator;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ * @param <Job>
+ */
+public abstract class AbstractSWFJobWriter<Job> implements SWFJobWriter<Job>{
+
+	public static String COMMENT = ";";
+	public static String FIELD_SEPARATOR = "\t\t";
+	public static String IRRELEVANT = "-1";
+	
+	protected long submitTime;
+	protected boolean useTaskMapping;
+	protected Map<String, Long> tasksLength;
+	protected ArrayList<String> taskMapping;
+	protected Writer writer;
+	
+	protected AbstractSWFJobWriter(String dirName, String fileName) throws IOException{
+		submitTime = 0;
+		useTaskMapping = true;
+		tasksLength = new HashMap<String, Long>();
+		taskMapping = new ArrayList<String>();
+		
+		File dir = new File(dirName);
+		if(!dir.exists()) {
+			dir.mkdirs();
+		} else if(!dir.isDirectory()){
+			throw new IOException(dirName + " is not a directory.");
+		}
+		
+		File swfFile = new File(dir, fileName);
+		writer = new FileWriter(swfFile);
+	}
+	
+	
+	
+	public void writeFieldDescriptionHeader() throws IOException {
+		writer.write(COMMENT + "Automatically generated workload description by the " + DataCenterWorkloadSimulator.SIMULATOR_NAME + "\n");
+		writer.write(COMMENT + FIELD_SEPARATOR + "j|" + FIELD_SEPARATOR + "s|" + FIELD_SEPARATOR + "w|" + FIELD_SEPARATOR + "r|" + FIELD_SEPARATOR + "c|" + FIELD_SEPARATOR + "c|" + FIELD_SEPARATOR + "m|" + FIELD_SEPARATOR + "p|" + FIELD_SEPARATOR + "t|" + FIELD_SEPARATOR + "m|" + FIELD_SEPARATOR + "s|" + FIELD_SEPARATOR + "u|" + FIELD_SEPARATOR + "g|" + FIELD_SEPARATOR + "e|" + FIELD_SEPARATOR + "q|" + FIELD_SEPARATOR + "p|" + FIELD_SEPARATOR + "p|" + FIELD_SEPARATOR + "t|\n"+
+					 COMMENT + FIELD_SEPARATOR + "o|" + FIELD_SEPARATOR + "u|" + FIELD_SEPARATOR + "a|" + FIELD_SEPARATOR + "u|" + FIELD_SEPARATOR + "p|" + FIELD_SEPARATOR + "p|" + FIELD_SEPARATOR + "e|" + FIELD_SEPARATOR + "r|" + FIELD_SEPARATOR + "i|" + FIELD_SEPARATOR + "e|" + FIELD_SEPARATOR + "t|" + FIELD_SEPARATOR + "i|" + FIELD_SEPARATOR + "i|" + FIELD_SEPARATOR + "x|" + FIELD_SEPARATOR + "u|" + FIELD_SEPARATOR + "a|" + FIELD_SEPARATOR + "r|" + FIELD_SEPARATOR + "h|\n"+
+					 COMMENT + FIELD_SEPARATOR + "b|" + FIELD_SEPARATOR + "b|" + FIELD_SEPARATOR + "i|" + FIELD_SEPARATOR + "n|" + FIELD_SEPARATOR + "u|" + FIELD_SEPARATOR + "u|" + FIELD_SEPARATOR + "m|" + FIELD_SEPARATOR + "o|" + FIELD_SEPARATOR + "m|" + FIELD_SEPARATOR + "m|" + FIELD_SEPARATOR + "a|" + FIELD_SEPARATOR + "d|" + FIELD_SEPARATOR + "d|" + FIELD_SEPARATOR + "e|" + FIELD_SEPARATOR + "e|" + FIELD_SEPARATOR + "r|" + FIELD_SEPARATOR + "e|" + FIELD_SEPARATOR + "i|\n"+
+					 COMMENT + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + "m|" + FIELD_SEPARATOR + "t|" + FIELD_SEPARATOR + "t|" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + "c|" + FIELD_SEPARATOR + "e|" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + "t|" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + "c|" + FIELD_SEPARATOR + "u|" + FIELD_SEPARATOR + "t|" + FIELD_SEPARATOR + "c|" + FIELD_SEPARATOR + "n|\n"+
+					 COMMENT + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + "i|" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + "i|" + FIELD_SEPARATOR + "a|" + FIELD_SEPARATOR + "t|" + FIELD_SEPARATOR + "u|" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + "r|" + FIELD_SEPARATOR + "u|" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + "u|" + FIELD_SEPARATOR + "e|" + FIELD_SEPARATOR + "i|" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + "k|\n"+
+					 COMMENT + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + "t|" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + "m|" + FIELD_SEPARATOR + "l|" + FIELD_SEPARATOR + "i|" + FIELD_SEPARATOR + "s|" + FIELD_SEPARATOR + "r|" + FIELD_SEPARATOR + "r|" + FIELD_SEPARATOR + "e|" + FIELD_SEPARATOR + "s|" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + "t|" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + "t|" + FIELD_SEPARATOR + "j|" + FIELD_SEPARATOR + " |\n"+
+					 COMMENT + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + "e|" + FIELD_SEPARATOR + "l|" + FIELD_SEPARATOR + "m|" + FIELD_SEPARATOR + "e|" + FIELD_SEPARATOR + "e|" + FIELD_SEPARATOR + "e|" + FIELD_SEPARATOR + "q|" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + "a|" + FIELD_SEPARATOR + "n|" + FIELD_SEPARATOR + "i|" + FIELD_SEPARATOR + "o|" + FIELD_SEPARATOR + "t|\n"+
+					 COMMENT + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + "o|" + FIELD_SEPARATOR + "e|" + FIELD_SEPARATOR + "d|" + FIELD_SEPARATOR + "q|" + FIELD_SEPARATOR + "q|" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + "b|" + FIELD_SEPARATOR + "r|" + FIELD_SEPARATOR + "o|" + FIELD_SEPARATOR + "b|" + FIELD_SEPARATOR + "i|\n"+
+					 COMMENT + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + "c|" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + "l|" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + "n|" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + "m|\n"+
+					 COMMENT + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + "e|" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + "e|\n");
+	}
+	
+	public void writeComment(String key, String value) throws IOException {
+		writer.write(COMMENT+key+": "+value+"\n");
+	}
+	
+	public void setJobSubmitTime(long submitTime) {
+		this.submitTime = submitTime;
+	}
+
+	public void addTaskLength(String taskId, long taskLength) {
+		this.tasksLength.put(taskId, taskLength);
+	}
+
+	public void setOverwrite(boolean overwrite) {
+	}
+	
+	public void useTaskMapping(boolean use) {
+		this.useTaskMapping = use;
+	}	
+	
+	public void writeLine(String array[]) throws IOException{
+		for (int i = 0; i < array.length; i++) {
+			writer.write(FIELD_SEPARATOR + array[i]);
+		}
+		writer.write("\n");
+	}
+	
+	public void close() throws IOException {
+		if(useTaskMapping){
+			writer.write(COMMENT+"IDMapping: swfID:jobID:taskID\n"+COMMENT+" ");
+			for(int i = 1; i <= taskMapping.size(); i++){
+				writer.write(taskMapping.get(i-1) + ", ");
+				if(i %  10 == 0){
+					writer.write("\n"+COMMENT + " ");
+				}
+			}
+			writer.write("\n"+COMMENT+"IDMapping: end\n");
+		}
+		
+		this.taskMapping.clear();
+		this.tasksLength.clear();
+		
+		writer.close();
+	}
+
+}
Index: DCWoRMS/trunk/src/simulator/workload/reader/xmlJob/XMLJobReader.java
===================================================================
--- DCWoRMS/trunk/src/simulator/workload/reader/xmlJob/XMLJobReader.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/workload/reader/xmlJob/XMLJobReader.java	(revision 477)
@@ -0,0 +1,8 @@
+package simulator.workload.reader.xmlJob;
+
+
+import simulator.workload.reader.JobReader;
+
+public interface XMLJobReader<Job> extends JobReader<Job>{
+
+}
Index: DCWoRMS/trunk/src/simulator/workload/reader/xmlJob/DirReader.java
===================================================================
--- DCWoRMS/trunk/src/simulator/workload/reader/xmlJob/DirReader.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/workload/reader/xmlJob/DirReader.java	(revision 477)
@@ -0,0 +1,62 @@
+package simulator.workload.reader.xmlJob;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileReader;
+import java.io.FilenameFilter;
+import java.io.IOException;
+
+import simulator.workload.fileFilters.QcgJobFileNameFilter;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+public class DirReader implements WLFileAccess {
+
+	protected File files[];
+	protected int currentPosition;
+	
+	public DirReader(File dir){
+		FilenameFilter fileNameFilter = new QcgJobFileNameFilter();
+		this.files = dir.listFiles(fileNameFilter);
+		
+		this.currentPosition = -1;
+	}
+	
+	public String getFileName() {
+		if(currentPosition >= this.files.length || currentPosition < 0)
+			return null;
+		
+		return this.files[currentPosition].getAbsolutePath();
+	}
+
+	public String read() throws IOException {
+		currentPosition++;
+		
+		if(currentPosition >= files.length)
+			return null;
+		
+		BufferedReader reader = null;
+		StringBuffer buffer = new StringBuffer();
+
+		try {
+			reader = new BufferedReader(new FileReader(files[currentPosition]));
+			String line = null;
+			
+			while((line = reader.readLine()) != null){
+				buffer.append(line);
+			}
+			
+		} finally{
+			reader.close();
+		}
+		
+		return buffer.toString();
+	}
+
+	public void close() {
+		
+	}
+}
Index: DCWoRMS/trunk/src/simulator/workload/reader/xmlJob/WLFileAccess.java
===================================================================
--- DCWoRMS/trunk/src/simulator/workload/reader/xmlJob/WLFileAccess.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/workload/reader/xmlJob/WLFileAccess.java	(revision 477)
@@ -0,0 +1,27 @@
+package simulator.workload.reader.xmlJob;
+
+import java.io.IOException;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+public interface WLFileAccess {
+	
+	/**
+	 * 
+	 * @return Name of the file from which value returned
+	 * by read() method come from. 
+	 */
+	public String getFileName();
+	
+	/**
+	 * 
+	 * @return content of the next file
+	 * @throws IOException 
+	 */
+	public String read() throws IOException;
+	
+	public void close();
+}
Index: DCWoRMS/trunk/src/simulator/workload/reader/xmlJob/QcgXmlJobReader.java
===================================================================
--- DCWoRMS/trunk/src/simulator/workload/reader/xmlJob/QcgXmlJobReader.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/workload/reader/xmlJob/QcgXmlJobReader.java	(revision 477)
@@ -0,0 +1,90 @@
+package simulator.workload.reader.xmlJob;
+
+import java.io.File;
+import java.io.IOException;
+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.QcgJob;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+
+public class QcgXmlJobReader implements XMLJobReader<QcgJob> {
+
+	protected static Unmarshaller unmarshaller;
+	static {
+		XMLContext context = new XMLContext();
+		try {
+			context.addPackage("org.qcg.broker.schemas.jobdesc.QcgJob");
+			unmarshaller = context.createUnmarshaller();
+		} catch (ResolverException e) {
+			e.printStackTrace();
+			unmarshaller = null;
+		}
+	}
+	
+	protected WLFileAccess workload;
+	
+	
+	public QcgXmlJobReader(File dir) throws IOException{
+		if(dir == null)
+			throw new IOException("Set directory name with xml's and file name prefix.");
+		
+		String dirName = dir.getName();
+		
+		if(!dir.exists()) 
+			throw new IOException("Directory "+dirName + " doeas not exist.");
+		
+		if(dir.isDirectory()){
+			this.workload = new DirReader(dir);
+		} else {
+			throw new IOException(dirName + " is not a directory or tar archive.");
+		}
+	}
+
+	public void close() throws IOException {
+		this.workload.close();
+	}
+
+	public String getCurrentPosition() {
+		return this.workload.getFileName();
+	}
+	
+	public String readRaw() throws IOException{
+		return this.workload.read();
+	}
+
+	public QcgJob read() throws IOException {
+
+		String s = readRaw();
+		StringReader reader = new StringReader(s);
+		QcgJob job = null;
+		
+		try {
+		
+			job = (QcgJob) unmarshaller.unmarshal(reader);
+		
+		} catch (MarshalException e) {
+			new IOException(e.getMessage());
+		} catch (ValidationException e) {
+			new IOException(e.getMessage());
+		} finally {
+			reader.close();
+		}
+		
+		return job;
+	}
+
+	public void reset() throws IOException {
+	}
+}
Index: DCWoRMS/trunk/src/simulator/workload/reader/JobReader.java
===================================================================
--- DCWoRMS/trunk/src/simulator/workload/reader/JobReader.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/workload/reader/JobReader.java	(revision 477)
@@ -0,0 +1,16 @@
+package simulator.workload.reader;
+
+import java.io.IOException;
+
+public interface JobReader <Job> {
+	
+	public void close() throws IOException;
+	
+	public Job read() throws IOException;
+	
+	public String readRaw() throws IOException;
+	
+	public void reset() throws IOException;
+	
+	public String getCurrentPosition();
+}
Index: DCWoRMS/trunk/src/simulator/workload/reader/archive/AbstractWAParser.java
===================================================================
--- DCWoRMS/trunk/src/simulator/workload/reader/archive/AbstractWAParser.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/workload/reader/archive/AbstractWAParser.java	(revision 477)
@@ -0,0 +1,287 @@
+package simulator.workload.reader.archive;
+
+import java.io.IOException;
+import java.io.RandomAccessFile;
+import java.util.HashMap;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import simulator.workload.exceptons.NoSuchCommentException;
+import simulator.workload.reader.archive.gwf.GWFParser;
+import simulator.workload.reader.archive.swf.SWFParser;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+
+public abstract class AbstractWAParser extends RandomAccessFile implements WAParser {
+
+	private Log log = LogFactory.getLog(AbstractWAParser.class);
+	
+	private static final long serialVersionUID = 1L;
+	private String fileName;
+	
+	protected String COMMENT = ";";
+	protected String FIELD_SEPARATOR = "\\s"; //white spaces
+
+	protected HashMap<String, String> comments;
+	protected HashMap<String, String[]> idMapping; // key - swf job id, value - value[0] xml job id, value[1] xml task id
+	protected HashMap<String, String> reverseIdMapping; // key - xmlJobId_xmlTaskId, value - swf job id
+	protected HashMap<String, Long> jobIndex;
+	protected String fields[];
+	protected int fieldsNo;
+	protected boolean headerLoaded;
+	protected boolean buildIndex;
+	
+	public AbstractWAParser(String fileName) throws IOException, NullPointerException{
+		super(fileName, "r");
+		this.fileName = fileName;
+		this.comments = new HashMap<String, String>();
+		this.idMapping = new HashMap<String, String[]>();
+		this.reverseIdMapping = new HashMap<String, String>();
+		this.jobIndex = new HashMap<String, Long>();
+		this.headerLoaded = false;
+		this.buildIndex = true;
+		this.fieldsNo = 18;
+	}
+
+
+	/**
+	 * Reads one task description and returns all fields in table. 
+	 * Skips comments lines, so you can mix task description with comments.
+	 */
+	public String[] readTask() throws IOException {
+		String line = null;
+		fields = null;
+		
+		while((line = readLine()) != null){
+			line = line.trim();
+			if(line.length() == 0 || line.startsWith(COMMENT)){
+				continue;
+			} else{
+				fields = line.split(FIELD_SEPARATOR+"+");
+
+				if(fields == null || fields.length != fieldsNo)
+					throw new IOException("Some data fields are missing.");
+				else
+					break;
+			}
+				
+		}
+		return fields;
+	}
+	
+		
+	public String[] readTask(String jobID, String taskId) throws IOException{
+		String key = jobID+"_"+taskId;
+		String swfJobId;
+		
+		if(reverseIdMapping.containsKey(key)){
+			swfJobId = reverseIdMapping.get(key);
+		} else {
+			swfJobId = jobID;
+		}
+		
+		return readTask(swfJobId);
+	}
+
+	public String getCommentValue(String label) throws NoSuchCommentException {
+		if(!comments.containsKey(label))
+			throw new NoSuchCommentException("No comment value for "+label);
+		
+		return comments.get(label);
+	}
+
+	public String getDataField(int field) throws NoSuchFieldException {
+		if(field >= fields.length)
+			throw new NoSuchFieldException("No such field.");
+		
+		return fields[field];
+	}
+
+	/**
+	 * Reads all comments that have appropriate format and place them in HashMap.
+	 * Builds job index - decision depends on value of buildIndex variable. 
+	 */
+	public HashMap<String, String> loadHeader() throws IOException {
+		String line = null;
+		String label = null;
+		String value = null;
+		int idx = -1;
+		
+		
+		// default speed for processing unit in millions of instructions.
+		comments.put(WAFields.COMMENT_PUSPEED, "1");
+		
+		long position = 0;
+		while((position = super.getFilePointer()) != -1 && (line = readLine()) != null){
+			line = line.trim();
+			if(!line.startsWith(COMMENT)){
+				if(buildIndex){
+					buildIdx(line, position);
+				}	
+				continue;
+			}
+				
+			idx = line.indexOf(":");
+			if(idx == -1)
+				continue;
+
+			label = line.substring(1, idx);
+			label = label.trim();
+
+			if(idx + 1 > line.length())
+				throw new IOException("No value for comment: "+label);
+			
+			value = line.substring(idx + 1, line.length());
+			value = value.trim();
+			
+			if(label.equals(WAFields.COMMENT_NOTE) && comments.containsKey(label)){
+				value = comments.get(label)+"; "+value;
+			} else if(label.equals(WAFields.COMMENT_IDMAPPING)){
+				loadIDMapping();
+				continue;
+			}
+
+			comments.put(label, value);
+		}
+		reset();
+		headerLoaded = true;
+		return comments;
+	}
+
+	protected void loadIDMapping() throws IOException{
+		String line = null;
+		
+		while((line = readLine()) != null){
+			
+			line = line.trim();
+		
+			if(!line.startsWith(COMMENT))
+				continue;
+			
+			line = line.substring(1).trim(); // to cut beginning ';'
+			if(line.startsWith(WAFields.COMMENT_IDMAPPING+": end"))
+				break;
+			
+			String idsInLine[] = line.split(",");
+			String third = null;
+			String ids[] = null;
+			
+			for(int i = 0; i < idsInLine.length; i++){
+				third = idsInLine[i];
+				ids = third.split(":");
+				if(ids.length < 3){
+					if(ids.length != 1)
+						if(log.isWarnEnabled())
+							log.warn(third + " is not complete. Use swfJobId:xmlJobId:xmlTaskId");
+					continue;
+				}
+				String key = ids[0].trim();
+				String value[] = new String[2];
+				value[0] = ids[1].trim(); // job id
+				value[1] = ids[2].trim(); // task id
+				idMapping.put(key, value);
+				reverseIdMapping.put(value[0]+"_"+value[1], key);
+			}
+			
+		}
+	}
+	
+	/**
+	 * Sets comment sign. Default is ';'.
+	 */
+	public String setCommentSign(String comment) {
+		String oldComment = this.COMMENT;
+		this.COMMENT = comment;
+		return oldComment;
+	}
+
+	/**
+	 * Sets data fields separator. Default is tab (\t).
+	 */
+	public String setFieldSeparator(String fieldSeparator) {
+		String oldSeparator = this.FIELD_SEPARATOR;
+		this.FIELD_SEPARATOR = fieldSeparator;
+		return oldSeparator;
+	}
+	
+	/**
+	 * Decide if task position index should be build. It is very useful
+	 * and significantly speedup 
+	 * @return previous value
+	 */
+	public boolean buildIndex(boolean build){
+		boolean old = this.buildIndex;
+		this.buildIndex = build;
+		return old;
+	}
+
+	public void close() throws IOException {
+		super.close();
+		this.comments.clear();
+		this.comments = null;
+		this.idMapping.clear();
+		this.idMapping = null;
+		this.reverseIdMapping.clear();
+		this.reverseIdMapping = null;
+		this.jobIndex.clear();
+		this.jobIndex = null;
+	}
+
+	/**
+	 * Puts file pointer to the beginning of file.
+	 */
+	public void reset() throws IOException {
+		super.seek(0);
+	}
+	
+	public boolean isHeaderLoaded() {
+		return headerLoaded;
+	}
+	
+	public HashMap<String, String[]> getIDMapping(){
+		return this.idMapping;
+	}
+
+
+	public String[] getIDMapping(String waID) {
+		
+		if(idMapping.containsKey(waID)){
+			return this.idMapping.get(waID);
+		}
+		else {	// if mapping for job is not provided, then we assume that xmlJobId, xmlTaskId, swfJobId are equal.
+			String tab[] = {waID, waID};
+			return tab;
+		}
+	}
+	
+	
+	public String getFileName(){
+		return this.fileName;
+	}
+	
+	protected abstract void buildIdx(String line, long position);
+	
+	public static WAParser getInstance(String fileName){
+		String name = fileName.trim().toLowerCase();
+		
+		try {
+			
+			if(name.endsWith("swf")){
+				return new SWFParser(fileName);
+				
+			} else if(name.endsWith("gwf")){
+				return new GWFParser(fileName);
+			}
+			
+		} catch(Exception e){
+			e.printStackTrace();
+		}
+		
+		return null;
+	}
+}
Index: DCWoRMS/trunk/src/simulator/workload/reader/archive/WAReader.java
===================================================================
--- DCWoRMS/trunk/src/simulator/workload/reader/archive/WAReader.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/workload/reader/archive/WAReader.java	(revision 477)
@@ -0,0 +1,8 @@
+package simulator.workload.reader.archive;
+
+import simulator.workload.reader.JobReader;
+
+public interface WAReader<Job> extends JobReader<Job>{
+
+	public WAParser getParser();
+}
Index: DCWoRMS/trunk/src/simulator/workload/reader/archive/AbstractWAReader.java
===================================================================
--- DCWoRMS/trunk/src/simulator/workload/reader/archive/AbstractWAReader.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/workload/reader/archive/AbstractWAReader.java	(revision 477)
@@ -0,0 +1,92 @@
+package simulator.workload.reader.archive;
+
+import java.io.IOException;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.Locale;
+
+import simulator.workload.exceptons.NoSuchCommentException;
+import simulator.workload.reader.archive.gwf.QcgGWFJobReader;
+import simulator.workload.reader.archive.swf.QcgSWFJobReader;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ * @param <Task>
+ * @param <Job>
+ */
+
+public abstract class AbstractWAReader<Task, Job> implements WAReader<Job>{
+	
+	protected WAParser waParser = null;
+	protected String taskData[];
+	
+	
+	public AbstractWAReader(String fileName) throws NullPointerException, IOException{
+		this.waParser = AbstractWAParser.getInstance(fileName);
+		taskData = null;
+	}
+	
+	public AbstractWAReader(WAParser parser) {
+		this.waParser = parser;
+		taskData = null;
+	}
+	
+	protected abstract Task createTask(String[] data);
+	
+	public void close() throws IOException{
+		if(waParser != null)
+			waParser.close();
+	}
+	
+	public static synchronized Date getStartTime(String workloadFileName) throws IOException, NoSuchCommentException{
+		Date date = null;
+		WAParser parser = AbstractWAParser.getInstance(workloadFileName);
+		parser.loadHeader();
+		
+		String s = parser.getCommentValue(WAFields.COMMENT_STARTTIME);
+		
+		parser.close();
+		try {
+			SimpleDateFormat df = new SimpleDateFormat("EEE MMM dd HH:mm:ss ZZZZ yyyy", Locale.ENGLISH);
+			date = df.parse(s);
+		} catch (ParseException e) {
+			throw new IOException(e.getMessage());
+		}
+		
+		return date;
+	}
+	
+	public void reset() throws IOException{
+		if(waParser != null)
+			waParser.reset();
+	}
+	
+	public WAParser getParser(){
+		return this.waParser;
+	}
+	
+	public static AbstractWAReader
+			<org.qcg.broker.schemas.jobdesc.Task, 
+			org.qcg.broker.schemas.jobdesc.QcgJob> getInstace(String fileName){
+		
+		String name = fileName.trim().toLowerCase();
+		
+		try {
+			
+			if(name.endsWith("swf")){
+				return new QcgSWFJobReader(fileName);
+				
+			} else if(name.endsWith("gwf")){
+				return new QcgGWFJobReader(fileName);
+			}
+			
+		} catch(Exception e){
+			e.printStackTrace();
+		}
+		
+		return null;
+	}
+}
Index: DCWoRMS/trunk/src/simulator/workload/reader/archive/WAFields.java
===================================================================
--- DCWoRMS/trunk/src/simulator/workload/reader/archive/WAFields.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/workload/reader/archive/WAFields.java	(revision 477)
@@ -0,0 +1,16 @@
+package simulator.workload.reader.archive;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+
+public abstract class WAFields {
+	
+	public static final String COMMENT_STARTTIME = "StartTime";
+	public static final String COMMENT_NOTE = "Note";
+	public static final String COMMENT_PUSPEED = "PUSpeed";
+	public static final String COMMENT_IDMAPPING = "IDMapping";
+	
+}
Index: DCWoRMS/trunk/src/simulator/workload/reader/archive/swf/SWFParser.java
===================================================================
--- DCWoRMS/trunk/src/simulator/workload/reader/archive/swf/SWFParser.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/workload/reader/archive/swf/SWFParser.java	(revision 477)
@@ -0,0 +1,93 @@
+package simulator.workload.reader.archive.swf;
+
+import java.io.IOException;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import simulator.workload.reader.archive.AbstractWAParser;
+
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+
+public class SWFParser extends AbstractWAParser {
+
+	private Log log = LogFactory.getLog(SWFParser.class);
+ 
+	public SWFParser(String fileName) throws IOException, NullPointerException{
+		super(fileName);
+		this.fieldsNo = 18;
+		this.COMMENT = ";";
+	}
+
+	
+	public String[] readTask(String id) throws IOException{
+		String fields[] = null;
+		boolean found = false;
+		
+		
+		Long jobPosition = this.jobIndex.get(id);
+		
+		// if index for job id is calculated, then use it!
+		if(jobPosition != null){
+			super.seek(jobPosition);
+			fields = readTask();
+			if(!id.equals(fields[0])) {
+				log.error("Wrong index for task: " + id + ". Found task: " + fields[0]);
+				return null;
+			}
+		} else {
+			// do classic search, read file from current position to the end, move to the beginning
+			// and continue to current position
+			
+			long filePointer = getFilePointer();
+			// reads from current position to the end of file
+			while(!found && (fields = readTask()) != null){
+				if(fields[SWFFields.DATA_JOB_NUMBER].equals(id))
+					found = true;
+			}
+			
+			if(!found){
+				// back to the beginning
+				System.out.println("search from begin for " + id);
+				super.seek(0);
+				// reads from the beginning of file to current position
+				while(!found && filePointer != getFilePointer() && (fields = readTask()) != null){
+					if(fields[SWFFields.DATA_JOB_NUMBER].equals(id))
+						found = true;
+				}
+			}
+		
+			if(found == false) return null;
+		}
+		
+		return fields;
+	}
+	
+	protected void buildIdx(String line, long position){
+		if(line == null || line.length() == 0)
+			return;
+		
+		String fields[] = line.split(FIELD_SEPARATOR+"+");
+
+		if(fields == null || fields.length != fieldsNo) {
+			int i = (fields == null ?  -1 : fields.length);
+			log.error("Can not build job index for line: " + line +
+					"\nSome data fields are missing. Expected fields length is " + fieldsNo + ", in file is " + i );
+			fields = null;
+			return;
+		} 
+		
+		String jobId = fields[SWFFields.DATA_JOB_NUMBER];
+		this.jobIndex.put(jobId, position);
+	}
+	
+	public int getType(){
+		return 0;
+	}
+	
+}
Index: DCWoRMS/trunk/src/simulator/workload/reader/archive/swf/SWFFields.java
===================================================================
--- DCWoRMS/trunk/src/simulator/workload/reader/archive/swf/SWFFields.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/workload/reader/archive/swf/SWFFields.java	(revision 477)
@@ -0,0 +1,72 @@
+package simulator.workload.reader.archive.swf;
+
+
+import simulator.workload.reader.archive.WAFields;
+
+public abstract class SWFFields extends WAFields{
+	
+	public static final String COMMENT_VERSION = "Version";
+	public static final String COMMENT_COMPUTER = "Computer";
+	public static final String COMMENT_INSTALLATION = "Installation";
+	public static final String COMMENT_ACKNOWLEDGE = "Acknowledge";
+	public static final String COMMENT_INFORMATION = "Information";
+	public static final String COMMENT_CONVERSION = "Conversion";
+	public static final String COMMENT_MAXJOBS = "MaxJobs";
+	public static final String COMMENT_MAXRECORDS = "MaxRecords";
+	public static final String COMMENT_PREEMPTION = "Preemption";
+	public static final String COMMENT_UNIXSTARTTIME = "UnixStartTime";
+	public static final String COMMENT_TIMEZONE = "TimeZone";
+	public static final String COMMENT_TIMEZONESTRING = "TimeZoneString";
+	public static final String COMMENT_ENDTIME = "EndTime";
+	public static final String COMMENT_MAXNODES = "MaxNodes";
+	public static final String COMMENT_MAXPROCS = "MaxProcs";
+	public static final String COMMENT_MAXRUNTIME = "MaxRuntime";
+	public static final String COMMENT_MAXMEMORY = "MaxMemory";
+	public static final String COMMENT_ALLOWOVERUSE = "AllowOveruse";
+	public static final String COMMENT_MAXQUEUES = "MaxQueues";
+	public static final String COMMENT_QUEUES = "Queues";
+	public static final String COMMENT_QUEUE = "Queue";
+	public static final String COMMENT_MAXPARTITIONS = "MaxPartitions";
+	public static final String COMMENT_PARTITIONS = "Partitions";
+	public static final String COMMENT_PARTITION = "Partition";
+	
+	public static final String COMMENTS_LABELS[] = {SWFFields.COMMENT_VERSION,SWFFields.COMMENT_COMPUTER,
+		SWFFields.COMMENT_INSTALLATION,SWFFields.COMMENT_ACKNOWLEDGE,SWFFields.COMMENT_INFORMATION,
+		SWFFields.COMMENT_CONVERSION,SWFFields.COMMENT_MAXJOBS,SWFFields.COMMENT_MAXRECORDS,
+		SWFFields.COMMENT_PREEMPTION,SWFFields.COMMENT_UNIXSTARTTIME,SWFFields.COMMENT_TIMEZONE,
+		SWFFields.COMMENT_TIMEZONESTRING,SWFFields.COMMENT_STARTTIME,SWFFields.COMMENT_ENDTIME,
+		SWFFields.COMMENT_MAXNODES,SWFFields.COMMENT_MAXPROCS,SWFFields.COMMENT_MAXRUNTIME,
+		SWFFields.COMMENT_MAXMEMORY,SWFFields.COMMENT_ALLOWOVERUSE,SWFFields.COMMENT_MAXQUEUES,
+		SWFFields.COMMENT_QUEUES,SWFFields.COMMENT_QUEUE, SWFFields.COMMENT_MAXPARTITIONS,
+		SWFFields.COMMENT_PARTITIONS,SWFFields.COMMENT_PARTITION, SWFFields.COMMENT_NOTE, SWFFields.COMMENT_PUSPEED, 
+		SWFFields.COMMENT_IDMAPPING};
+
+	
+	public static final int DATA_JOB_NUMBER = 0;
+	public static final int DATA_SUBMIT_TIME = 1;
+	public static final int DATA_WAIT_TIME = 2;
+	public static final int DATA_RUN_TIME = 3;
+	public static final int DATA_NUMBER_OF_ALLOCATED_PROCESSORS = 4;
+	public static final int DATA_AVERAGE_CPU_TIME_USED = 5;
+	public static final int DATA_USED_MEMORY = 6;
+	public static final int DATA_REQUESTED_NUMBER_OF_PROCESSORS = 7;
+	public static final int DATA_REQUESTED_TIME = 8;
+	public static final int DATA_REQUESTED_MEMORY = 9;
+	public static final int DATA_STATUS = 10;
+	public static final int DATA_USER_ID = 11;
+	public static final int DATA_GROUP_ID = 12;
+	public static final int DATA_EXECUTABLE_NUMBER = 13;
+	public static final int DATA_QUEUE_NUMBER = 14;
+	public static final int DATA_PARTITION_NUMBER = 15;
+	public static final int DATA_PRECEDING_JOB_NUMBER = 16;
+	public static final int DATA_THINK_TIME_FROM_PRECEDING_JOB = 17;
+	public static final int DATA_FIELDS[] = {SWFFields.DATA_JOB_NUMBER,SWFFields.DATA_SUBMIT_TIME,
+		SWFFields.DATA_WAIT_TIME,SWFFields.DATA_RUN_TIME,SWFFields.DATA_NUMBER_OF_ALLOCATED_PROCESSORS,
+		SWFFields.DATA_AVERAGE_CPU_TIME_USED,SWFFields.DATA_USED_MEMORY,
+		SWFFields.DATA_REQUESTED_NUMBER_OF_PROCESSORS,SWFFields.DATA_REQUESTED_TIME,
+		SWFFields.DATA_REQUESTED_MEMORY,SWFFields.DATA_STATUS,SWFFields.DATA_USER_ID,
+		SWFFields.DATA_GROUP_ID,SWFFields.DATA_EXECUTABLE_NUMBER,SWFFields.DATA_QUEUE_NUMBER,
+		SWFFields.DATA_PARTITION_NUMBER, SWFFields.DATA_PRECEDING_JOB_NUMBER,
+		SWFFields.DATA_THINK_TIME_FROM_PRECEDING_JOB};
+
+}
Index: DCWoRMS/trunk/src/simulator/workload/reader/archive/swf/QcgSWFJobReader.java
===================================================================
--- DCWoRMS/trunk/src/simulator/workload/reader/archive/swf/QcgSWFJobReader.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/workload/reader/archive/swf/QcgSWFJobReader.java	(revision 477)
@@ -0,0 +1,228 @@
+package simulator.workload.reader.archive.swf;
+
+import org.qcg.broker.schemas.jobdesc.ComputingResourceBaseTypeChoice;
+import org.qcg.broker.schemas.jobdesc.ComputingResourceType;
+import org.qcg.broker.schemas.jobdesc.ComputingResourceBaseTypeChoiceItem;
+import org.qcg.broker.schemas.jobdesc.ComputingResourceParameterType;
+import org.qcg.broker.schemas.jobdesc.ExecutionTimeType;
+import org.qcg.broker.schemas.jobdesc.ParameterTypeChoice;
+import org.qcg.broker.schemas.jobdesc.ParameterTypeChoiceItem;
+import org.qcg.broker.schemas.jobdesc.ResourceRequirementsType;
+import org.qcg.broker.schemas.jobdesc.Value;
+import org.qcg.broker.schemas.jobdesc.RequirementsType;
+import org.qcg.broker.schemas.jobdesc.types.ComputingParameterName;
+import org.qcg.broker.schemas.jobdesc.Task;
+import java.io.IOException;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.exolab.castor.types.Duration;
+
+import simulator.workload.reader.archive.QcgWAJobReader;
+
+
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+public class QcgSWFJobReader extends QcgWAJobReader {
+
+	private Log log = LogFactory.getLog(QcgSWFJobReader.class);
+	
+	protected String currntJobID;
+	
+	public QcgSWFJobReader(String fileName) throws NullPointerException,
+			IOException {
+		super(fileName);
+		this.waParser.loadHeader();
+	}
+	
+	public QcgSWFJobReader(SWFParser parser) {
+		super(parser);
+	}
+
+	protected Task createTask(String[] data) {
+		RequirementsType requirements = null;
+		ResourceRequirementsType taskReq = null;
+		ComputingResourceType compResource = null;
+		ComputingResourceBaseTypeChoice choice = null;
+		ComputingResourceBaseTypeChoiceItem crItem = null;		
+		ComputingResourceParameterType param = null;
+		
+		Task task = null;
+		long value = -1;
+		
+		task = new Task();
+		requirements = new RequirementsType();
+		taskReq = new ResourceRequirementsType();
+		compResource = new ComputingResourceType();
+		choice = new ComputingResourceBaseTypeChoice();
+		
+		compResource.setComputingResourceBaseTypeChoice(choice);
+		taskReq.addComputingResource(compResource);
+		requirements.setResourceRequirements(taskReq);
+		task.setRequirements(requirements);
+		
+		for(int i = 0; i < SWFFields.DATA_FIELDS.length; i++){
+			try {
+				
+				value = Long.parseLong(data[SWFFields.DATA_FIELDS[i]]);
+				
+				switch(SWFFields.DATA_FIELDS[i]){
+					case SWFFields.DATA_NUMBER_OF_ALLOCATED_PROCESSORS:
+						if(value <= 0){
+							if(log.isWarnEnabled())
+								log.warn("Task "+data[0] + " is omited. Number of allocated processors should be grather then 0.");
+							return null;
+						}
+						break;
+					case SWFFields.DATA_REQUESTED_NUMBER_OF_PROCESSORS:
+						if(value <= 0){
+							if(log.isWarnEnabled())
+								log.warn("Task "+data[0] + " is omited. Number of requested processors should be grather then 0.");
+							return null;
+						}
+						break;
+					case SWFFields.DATA_RUN_TIME:
+						if(value <= 0){
+							if(log.isWarnEnabled())
+								log.warn("Task "+data[0] + " is omited. Task runtime should be grather then 0.");
+							return null;
+						}
+						break;
+				}
+				
+				if (value == -1) continue;
+				
+			} catch (NumberFormatException e) {
+				if(SWFFields.DATA_FIELDS[i] != SWFFields.DATA_JOB_NUMBER &&
+					SWFFields.DATA_FIELDS[i] != SWFFields.DATA_PRECEDING_JOB_NUMBER)
+					continue;
+			}
+
+			switch(SWFFields.DATA_FIELDS[i]){
+				case SWFFields.DATA_JOB_NUMBER:
+					currntJobID = data[SWFFields.DATA_FIELDS[i]];
+					String tab[] = this.waParser.getIDMapping(currntJobID);
+					task.setTaskId(tab[1]);
+					break;
+					
+				case SWFFields.DATA_SUBMIT_TIME:
+					/*  
+					 * This is information for simulator not for task description.
+					 * See WorkloadLoader for details.
+					 */ 
+					break;
+					
+				case SWFFields.DATA_WAIT_TIME:
+					break;
+					
+				case SWFFields.DATA_RUN_TIME:
+					/*  
+					 * This is information for simulator not for task description.
+					 * See WorkloadLoader for details.
+					 */
+					break;
+					
+				case SWFFields.DATA_NUMBER_OF_ALLOCATED_PROCESSORS:
+					/*  
+					 * This is information for simulator not for task description.
+					 * See WorkloadLoader for details.
+					 */
+					break;
+					
+				case SWFFields.DATA_AVERAGE_CPU_TIME_USED:
+					break;
+					
+				case SWFFields.DATA_USED_MEMORY:
+					/*  
+					 * This is information for simulator not for task description.
+					 * See WorkloadLoader for details.
+					 */
+					break;
+					
+				case SWFFields.DATA_REQUESTED_NUMBER_OF_PROCESSORS:
+					
+					crItem = new ComputingResourceBaseTypeChoiceItem();
+					param = new ComputingResourceParameterType();
+					
+					param.setName(ComputingParameterName.CPUCOUNT);
+					{
+						ParameterTypeChoice tpChoice = new ParameterTypeChoice();
+						ParameterTypeChoiceItem item = new ParameterTypeChoiceItem();
+						Value paramValue = new Value();
+						
+						paramValue.setContent(Long.valueOf(value).doubleValue());
+						item.setValue(paramValue);
+						tpChoice.addParameterTypeChoiceItem(item);
+						param.setParameterTypeChoice(tpChoice);
+					}
+					crItem.setHostParameter(param);
+					choice.addComputingResourceBaseTypeChoiceItem(crItem);
+					
+					break;
+					
+				case SWFFields.DATA_REQUESTED_TIME:
+					ExecutionTimeType executionTime = new ExecutionTimeType();
+
+					// requested time is expressed in swf file in seconds
+					// multiply value * 1000 to get milliseconds
+					Duration d = new Duration(value * 1000);
+					
+					executionTime.setExecutionDuration(d);
+					task.setExecutionTime(executionTime);
+					break;
+					
+				case SWFFields.DATA_REQUESTED_MEMORY:
+					crItem = new ComputingResourceBaseTypeChoiceItem();
+					param = new ComputingResourceParameterType();
+					
+					param.setName(ComputingParameterName.MEMORY);
+					{
+						ParameterTypeChoice tpChoice = new ParameterTypeChoice();
+						ParameterTypeChoiceItem item = new ParameterTypeChoiceItem();
+						Value paramValue = new Value();
+						
+						paramValue.setContent(Long.valueOf(value).doubleValue());
+						item.setValue(paramValue);
+						tpChoice.addParameterTypeChoiceItem(item);
+						param.setParameterTypeChoice(tpChoice);
+					}
+					
+					crItem.setHostParameter(param);
+					choice.addComputingResourceBaseTypeChoiceItem(crItem);
+					
+					break;
+					
+				case SWFFields.DATA_STATUS:
+					break;
+					
+				case SWFFields.DATA_USER_ID:
+					break;
+					
+				case SWFFields.DATA_GROUP_ID:
+					break;
+					
+				case SWFFields.DATA_EXECUTABLE_NUMBER:
+					break;
+					
+				case SWFFields.DATA_QUEUE_NUMBER:
+					break;
+					
+				case SWFFields.DATA_PARTITION_NUMBER:
+					break;
+					
+				case SWFFields.DATA_PRECEDING_JOB_NUMBER:
+					break;
+					
+				case SWFFields.DATA_THINK_TIME_FROM_PRECEDING_JOB:
+					break;
+			}
+		}
+		
+		return task;
+	}
+	
+}
Index: DCWoRMS/trunk/src/simulator/workload/reader/archive/QcgWAJobReader.java
===================================================================
--- DCWoRMS/trunk/src/simulator/workload/reader/archive/QcgWAJobReader.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/workload/reader/archive/QcgWAJobReader.java	(revision 477)
@@ -0,0 +1,102 @@
+package simulator.workload.reader.archive;
+
+import java.io.IOException;
+import java.io.StringWriter;
+import java.io.Writer;
+
+import org.exolab.castor.xml.MarshalException;
+import org.exolab.castor.xml.Marshaller;
+import org.exolab.castor.xml.ResolverException;
+import org.exolab.castor.xml.ValidationException;
+import org.exolab.castor.xml.XMLContext;
+
+import simulator.workload.reader.archive.swf.SWFFields;
+import org.qcg.broker.schemas.jobdesc.QcgJob;
+import org.qcg.broker.schemas.jobdesc.Task;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+
+public abstract class QcgWAJobReader extends AbstractWAReader<Task, QcgJob> {
+
+	protected String currntJobID;
+	protected Marshaller marshaller;
+	
+	public QcgWAJobReader(String fileName) throws NullPointerException,
+			IOException {
+		super(fileName);
+		init();
+	}
+	
+	public QcgWAJobReader(WAParser parser){
+		super(parser);
+		init();
+	}
+
+	protected void init(){
+		XMLContext context = new XMLContext();
+		try {
+			context.addPackage("org.qcg.broker.schemas.jobdesc.QcgJob");
+			this.marshaller = context.createMarshaller();
+		} catch (ResolverException e) {
+			e.printStackTrace();
+			this.marshaller = null;
+		}
+	}
+	
+	public QcgJob read() throws IOException {
+		Task task = null;
+		
+		if(taskData == null) {
+			taskData = waParser.readTask();
+			if(taskData == null) return null;
+			
+			currntJobID = taskData[SWFFields.DATA_JOB_NUMBER];
+		}
+		
+		
+		QcgJob job = new QcgJob();
+		String appID = this.waParser.getIDMapping(currntJobID)[0];
+		job.setAppId(appID);
+		
+		
+		while(taskData != null && this.waParser.getIDMapping(currntJobID)[0].equals(appID)){
+			
+			task = createTask(taskData);
+			if(task != null)
+				job.addTask(task);
+			taskData = waParser.readTask();
+			if(taskData != null)
+				currntJobID = taskData[SWFFields.DATA_JOB_NUMBER];
+		}
+		
+		return job;
+	}
+	
+	public String readRaw() throws IOException{
+		QcgJob job = null;
+		
+		if((job = read()) == null)
+			return null;
+		
+		Writer w = new StringWriter();
+		try {
+			this.marshaller.setWriter(w);
+			this.marshaller.marshal(job);
+		} catch (MarshalException e) {
+			new IOException(e.getMessage());
+		} catch (ValidationException e) {
+			new IOException(e.getMessage());
+		}
+		
+		return w.toString();
+	}
+	
+	public String getCurrentPosition() {
+		return currntJobID;
+	}
+
+}
Index: DCWoRMS/trunk/src/simulator/workload/reader/archive/gwf/QcgGWFJobReader.java
===================================================================
--- DCWoRMS/trunk/src/simulator/workload/reader/archive/gwf/QcgGWFJobReader.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/workload/reader/archive/gwf/QcgGWFJobReader.java	(revision 477)
@@ -0,0 +1,195 @@
+package simulator.workload.reader.archive.gwf;
+
+import java.io.IOException;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.exolab.castor.types.Duration;
+
+import org.qcg.broker.schemas.jobdesc.ComputingResourceBaseTypeChoice;
+import org.qcg.broker.schemas.jobdesc.ComputingResourceBaseTypeChoiceItem;
+import org.qcg.broker.schemas.jobdesc.ComputingResourceParameterType;
+import org.qcg.broker.schemas.jobdesc.ComputingResourceType;
+import org.qcg.broker.schemas.jobdesc.ExecutionTimeType;
+import org.qcg.broker.schemas.jobdesc.ParameterTypeChoice;
+import org.qcg.broker.schemas.jobdesc.ParameterTypeChoiceItem;
+import org.qcg.broker.schemas.jobdesc.RequirementsType;
+import org.qcg.broker.schemas.jobdesc.ResourceRequirementsType;
+import org.qcg.broker.schemas.jobdesc.Task;
+import org.qcg.broker.schemas.jobdesc.Value;
+import org.qcg.broker.schemas.jobdesc.types.ComputingParameterName;
+import simulator.workload.reader.archive.QcgWAJobReader;
+import simulator.workload.reader.archive.WAParser;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+
+public class QcgGWFJobReader extends QcgWAJobReader{
+
+	private Log log = LogFactory.getLog(QcgGWFJobReader.class);
+	
+	public QcgGWFJobReader(String fileName) throws NullPointerException,
+			IOException {
+		super(fileName);
+		this.waParser.loadHeader();
+	}
+	
+	public QcgGWFJobReader(WAParser parser) {
+		super(parser);
+	}
+
+	protected Task createTask(String[] data) {
+		RequirementsType requirements = null;
+		ResourceRequirementsType taskReq = null;
+		ComputingResourceType compResource = null;
+		ComputingResourceBaseTypeChoice choice = null;
+		ComputingResourceBaseTypeChoiceItem crItem = null;		
+		ComputingResourceParameterType param = null;
+		
+		Task task = null;
+		long value = -1;
+		
+		task = new Task();
+		requirements = new RequirementsType();
+		taskReq = new ResourceRequirementsType();
+		compResource = new ComputingResourceType();
+		choice = new ComputingResourceBaseTypeChoice();
+		
+		compResource.setComputingResourceBaseTypeChoice(choice);
+		taskReq.addComputingResource(compResource);
+		requirements.setResourceRequirements(taskReq);
+		task.setRequirements(requirements);
+		
+		for(int i = 0; i < GWFFields.DATA_FIELDS.length; i++){
+			try {
+				
+				value = Long.parseLong(data[GWFFields.DATA_FIELDS[i]]);
+				
+				switch(GWFFields.DATA_FIELDS[i]){
+					case GWFFields.DATA_NPROCS:
+						if(value <= 0){
+							if(log.isWarnEnabled())
+								log.warn("Task "+data[0] + " is omited. Number of allocated processors should be grather then 0.");
+							return null;
+						}
+						break;
+					case GWFFields.DATA_REQ_NPROCS:
+						if(value <= 0){
+							if(log.isWarnEnabled())
+								log.warn("Task "+data[0] + " is omited. Number of requested processors should be grather then 0.");
+							return null;
+						}
+						break;
+					case GWFFields.DATA_RUN_TIME:
+						if(value <= 0){
+							if(log.isWarnEnabled())
+								log.warn("Task "+data[0] + " is omited. Task runtime should be grather then 0.");
+							return null;
+						}
+						break;
+				}
+				
+				if (value == -1) continue;
+				
+			} catch (NumberFormatException e) {
+				if(GWFFields.DATA_FIELDS[i] != GWFFields.DATA_JOB_ID)
+					continue;
+			}
+
+			switch(GWFFields.DATA_FIELDS[i]){
+				case GWFFields.DATA_JOB_ID:
+					currntJobID = data[GWFFields.DATA_FIELDS[i]];
+					String tab[] = this.waParser.getIDMapping(currntJobID);
+					task.setTaskId(tab[1]);
+					break;
+					
+				case GWFFields.DATA_SUBMIT_TIME:
+					/*  
+					 * This is information for simulator not for task description.
+					 * See WorkloadLoader for details.
+					 */ 
+					break;
+					
+				case GWFFields.DATA_RUN_TIME:
+					/*  
+					 * This is information for simulator not for task description.
+					 * See WorkloadLoader for details.
+					 */
+					break;
+					
+				case GWFFields.DATA_NPROCS:
+					/*  
+					 * This is information for simulator not for task description.
+					 * See WorkloadLoader for details.
+					 */
+					break;
+					
+				case GWFFields.DATA_USED_MEMORY:
+					/*  
+					 * This is information for simulator not for task description.
+					 * See WorkloadLoader for details.
+					 */
+					break;
+					
+				case GWFFields.DATA_REQ_NPROCS:
+					
+					crItem = new ComputingResourceBaseTypeChoiceItem();
+					param = new ComputingResourceParameterType();
+					
+					param.setName(ComputingParameterName.CPUCOUNT);
+					{
+						ParameterTypeChoice tpChoice = new ParameterTypeChoice();
+						ParameterTypeChoiceItem item = new ParameterTypeChoiceItem();
+						Value paramValue = new Value();
+						
+						paramValue.setContent(Long.valueOf(value).doubleValue());
+						item.setValue(paramValue);
+						tpChoice.addParameterTypeChoiceItem(item);
+						param.setParameterTypeChoice(tpChoice);
+					}
+					crItem.setHostParameter(param);
+					choice.addComputingResourceBaseTypeChoiceItem(crItem);
+					
+					break;
+					
+				case GWFFields.DATA_REQ_TIME:
+					ExecutionTimeType executionTime = new ExecutionTimeType();
+
+					// requested time is expressed in swf file in seconds
+					// multiply value * 1000 to get milliseconds
+					Duration d = new Duration(value * 1000);
+					
+					executionTime.setExecutionDuration(d);
+					task.setExecutionTime(executionTime);
+					break;
+					
+				case GWFFields.DATA_REQ_MEMORY:
+					crItem = new ComputingResourceBaseTypeChoiceItem();
+					param = new ComputingResourceParameterType();
+					
+					param.setName(ComputingParameterName.MEMORY);
+					{
+						ParameterTypeChoice tpChoice = new ParameterTypeChoice();
+						ParameterTypeChoiceItem item = new ParameterTypeChoiceItem();
+						Value paramValue = new Value();
+						
+						paramValue.setContent(Long.valueOf(value).doubleValue());
+						item.setValue(paramValue);
+						tpChoice.addParameterTypeChoiceItem(item);
+						param.setParameterTypeChoice(tpChoice);
+					}
+					
+					crItem.setHostParameter(param);
+					choice.addComputingResourceBaseTypeChoiceItem(crItem);
+					
+					break;
+					
+			}
+		}
+		
+		return task;
+	}
+}
Index: DCWoRMS/trunk/src/simulator/workload/reader/archive/gwf/GWFParser.java
===================================================================
--- DCWoRMS/trunk/src/simulator/workload/reader/archive/gwf/GWFParser.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/workload/reader/archive/gwf/GWFParser.java	(revision 477)
@@ -0,0 +1,72 @@
+package simulator.workload.reader.archive.gwf;
+
+import java.io.IOException;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import simulator.workload.reader.archive.AbstractWAParser;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+
+public class GWFParser extends AbstractWAParser {
+
+	private Log log = LogFactory.getLog(GWFParser.class);
+	
+	public GWFParser(String fileName) throws IOException, NullPointerException {
+		super(fileName);
+		this.fieldsNo = 29;
+		this.COMMENT = "#";
+	}
+
+	public String[] readTask(String id) throws IOException {
+		long filePointer = getFilePointer();
+		String fields[] = null;
+		boolean found = false;
+		
+		// reads from current position to the end of file
+		while(!found && (fields = readTask()) != null){
+			if(fields[GWFFields.DATA_JOB_ID].equals(id))
+				found = true;
+		}
+		
+		if(!found){
+			// back to the beginning
+			super.seek(0);
+			// reads from the beginning of file to current position
+			while(!found && filePointer != getFilePointer() && (fields = readTask()) != null){
+				if(fields[GWFFields.DATA_JOB_ID].equals(id))
+					found = true;
+			}
+		}
+
+		if(found == false) return null;
+		
+		return fields;
+	}
+	
+	protected void buildIdx(String line, long position){
+		if(line == null || line.length() == 0)
+			return;
+		
+		String fields[] = line.split(FIELD_SEPARATOR+"+");
+
+		if(fields == null || fields.length != fieldsNo) {
+			log.error("Can not build job index for line: " + line +
+					"\nSome data fields are missing.");
+			return;
+		} 
+		
+		String jobId = fields[GWFFields.DATA_JOB_ID];
+		this.jobIndex.put(jobId, position);
+		
+	}
+	
+	public int getType(){
+		return 1;
+	}
+}
Index: DCWoRMS/trunk/src/simulator/workload/reader/archive/gwf/GWFFields.java
===================================================================
--- DCWoRMS/trunk/src/simulator/workload/reader/archive/gwf/GWFFields.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/workload/reader/archive/gwf/GWFFields.java	(revision 477)
@@ -0,0 +1,54 @@
+package simulator.workload.reader.archive.gwf;
+
+import simulator.workload.reader.archive.WAFields;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+public abstract class GWFFields extends WAFields {
+	
+	public static final int DATA_JOB_ID = 0;
+	public static final int DATA_SUBMIT_TIME = 1;
+	public static final int DATA_WAIT_TIME = 2;
+	public static final int DATA_RUN_TIME = 3;
+	public static final int DATA_NPROCS = 4;
+	public static final int DATA_AVERAGE_CPU_TIME_USED = 5;
+	public static final int DATA_USED_MEMORY = 6;
+	public static final int DATA_REQ_NPROCS = 7;
+	public static final int DATA_REQ_TIME = 8;
+	public static final int DATA_REQ_MEMORY = 9;
+	public static final int DATA_STATUS = 10;
+	public static final int DATA_USER_ID = 11;
+	public static final int DATA_GROUP_ID = 12;
+	public static final int DATA_EXECUTABLE_ID = 13;
+	public static final int DATA_QUEUE_ID = 14;
+	public static final int DATA_PARTITION_ID = 15;
+	public static final int DATA_ORIG_SITE_ID = 16;
+	public static final int DATA_LAST_RUN_SITE_ID = 17;
+	public static final int DATA_JOB_STRUCTURE = 18;
+	public static final int DATA_JOB_STRUCTURE_PARAMS = 19;
+	public static final int DATA_USED_NETWORK = 20;
+	public static final int DATA_USED_LOCALDISKSPACE = 21;
+	public static final int DATA_USED_RESOURCES = 22;
+	public static final int DATA_REQ_PLATFORM = 23;
+	public static final int DATA_REQ_NETWORK = 24;
+	public static final int DATA_REQ_LOCAL_DISK_SPACE = 25;
+	public static final int DATA_REQ_RESOURCES = 26;
+	public static final int DATA_VO_ID = 27;
+	public static final int DATA_PROJECT_ID = 28;
+	
+	public static int DATA_FIELDS[] = {
+			GWFFields.DATA_JOB_ID, GWFFields.DATA_SUBMIT_TIME, GWFFields.DATA_WAIT_TIME,
+			GWFFields.DATA_RUN_TIME, GWFFields.DATA_NPROCS, GWFFields.DATA_AVERAGE_CPU_TIME_USED,
+			GWFFields.DATA_USED_MEMORY, GWFFields.DATA_REQ_NPROCS, GWFFields.DATA_REQ_TIME,
+			GWFFields.DATA_REQ_MEMORY, GWFFields.DATA_STATUS, GWFFields.DATA_USER_ID,
+			GWFFields.DATA_GROUP_ID, GWFFields.DATA_EXECUTABLE_ID, GWFFields.DATA_QUEUE_ID,
+			GWFFields.DATA_PARTITION_ID, GWFFields.DATA_ORIG_SITE_ID, GWFFields.DATA_LAST_RUN_SITE_ID,
+			GWFFields.DATA_JOB_STRUCTURE, GWFFields.DATA_JOB_STRUCTURE_PARAMS, GWFFields.DATA_USED_NETWORK,
+			GWFFields.DATA_USED_LOCALDISKSPACE, GWFFields.DATA_USED_RESOURCES, GWFFields.DATA_REQ_PLATFORM,
+			GWFFields.DATA_REQ_NETWORK, GWFFields.DATA_REQ_LOCAL_DISK_SPACE, GWFFields.DATA_REQ_RESOURCES,
+			GWFFields.DATA_VO_ID, GWFFields.DATA_PROJECT_ID };
+
+}
Index: DCWoRMS/trunk/src/simulator/workload/reader/archive/WAParser.java
===================================================================
--- DCWoRMS/trunk/src/simulator/workload/reader/archive/WAParser.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/workload/reader/archive/WAParser.java	(revision 477)
@@ -0,0 +1,45 @@
+package simulator.workload.reader.archive;
+
+import java.io.IOException;
+import java.util.HashMap;
+
+import simulator.workload.exceptons.NoSuchCommentException;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+
+public interface WAParser {
+	
+	public HashMap<String, String> loadHeader() throws IOException;
+	
+	public HashMap<String, String[]> getIDMapping();
+	
+	public String[] getIDMapping(String waID);
+	
+	public boolean isHeaderLoaded() throws IOException;
+	
+	public String[] readTask() throws IOException;
+	
+	public String[] readTask(String taskId) throws IOException;
+	
+	public String[] readTask(String jobID, String taskId) throws IOException;
+	
+	public String getCommentValue(String label) throws NoSuchCommentException;
+	
+	public String getDataField(int field) throws NoSuchFieldException;
+	
+	public String setCommentSign(String comment) ;
+	
+	public String setFieldSeparator(String fieldSeparator) ;
+
+	public void reset() throws IOException;
+	
+	public void close() throws IOException;
+	
+	public String getFileName();
+	
+	public int getType();
+}
Index: DCWoRMS/trunk/src/simulator/workload/reader/resource/ResourceReader.java
===================================================================
--- DCWoRMS/trunk/src/simulator/workload/reader/resource/ResourceReader.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/workload/reader/resource/ResourceReader.java	(revision 477)
@@ -0,0 +1,18 @@
+package simulator.workload.reader.resource;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+public interface ResourceReader <Resource, Calendar> {
+
+	public void close();
+	
+	public void setCalendar(Calendar calendar);
+	
+	public Resource read() throws Exception;
+	
+	public void loadPlugins(String fileName);
+	
+}
Index: DCWoRMS/trunk/src/simulator/workload/generator/WorkloadGenerator.java
===================================================================
--- DCWoRMS/trunk/src/simulator/workload/generator/WorkloadGenerator.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/workload/generator/WorkloadGenerator.java	(revision 477)
@@ -0,0 +1,55 @@
+package simulator.workload.generator;
+
+import java.io.FileNotFoundException;
+import java.io.IOException;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import simulator.ConfigurationOptions;
+import simulator.workload.generator.impl.QcgJobGenerator;
+
+public class WorkloadGenerator {
+	
+	private Log log = LogFactory.getLog(WorkloadGenerator.class);
+	
+	public static void main(String args[]){
+		WorkloadGenerator generator = new WorkloadGenerator();
+		generator.run(args);
+	}
+	
+	public void run(String args[]){
+		log.info("Start workload generator.");
+		
+		if(args == null || args.length == 0){
+			log.error("Path to properties file is not provided. Can not configure workload generator.");
+			return;
+		}
+		
+		String propertiesFileName = args[0];
+		ConfigurationOptions co = ConfigurationOptions.getConfiguration(propertiesFileName);
+		if(co == null){
+			log.error("Configuration options are not defined. Check file: "+propertiesFileName);
+			return;
+		}
+		
+		JobGenerator jobGenerator = new QcgJobGenerator();
+		
+		try {
+			
+			log.info("Generating workload.");
+			jobGenerator.generateWorkload(co.workloadDescFileName, co.outputFolder, co.overwriteFiles, co.outputWorkloadFileName);
+			
+			log.info("Performing postprocessing.");
+			jobGenerator.performPostprocessing(co.resdescFileName, co.outputFolder, co.outputWorkloadFileName);
+			
+		} catch (FileNotFoundException e) {
+			e.printStackTrace();
+		} catch (IOException e) {
+			e.printStackTrace();
+		}
+		
+		
+		log.info("End workload generator.");
+	}
+}
Index: DCWoRMS/trunk/src/simulator/workload/generator/RandomNumbersWrapper.java
===================================================================
--- DCWoRMS/trunk/src/simulator/workload/generator/RandomNumbersWrapper.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/workload/generator/RandomNumbersWrapper.java	(revision 477)
@@ -0,0 +1,476 @@
+package simulator.workload.generator;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.xpath.XPath;
+import javax.xml.xpath.XPathConstants;
+import javax.xml.xpath.XPathExpression;
+import javax.xml.xpath.XPathExpressionException;
+import javax.xml.xpath.XPathFactory;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+import org.xml.sax.SAXException;
+
+import simulator.RandomNumbers;
+import simulator.workload.reader.archive.AbstractWAParser;
+import simulator.workload.reader.archive.WAParser;
+import simulator.workload.reader.archive.swf.SWFFields;
+
+import bsh.EvalError;
+import bsh.Interpreter;
+
+import com.sun.org.apache.xml.internal.dtm.ref.DTMNodeList;
+
+public class RandomNumbersWrapper {
+	
+	protected Log log = LogFactory.getLog(RandomNumbersWrapper.class);
+	
+	protected WAParser swfParser;
+	protected String jobId;
+	protected String taskId;
+	
+	protected RandomNumbers randomNumbers[];
+	
+	/**
+	 * List of all dependency paths detected in workload.
+	 */
+	protected ArrayList<ArrayList<String>> idDep;
+	
+	/**
+	 * Map, where key is workload node id and value is arithmetic expression.
+	 */
+	protected HashMap <String, String> idExpMap;
+	protected Interpreter interpreter;
+	
+	public RandomNumbersWrapper(){
+		swfParser = null;
+		idExpMap = new HashMap<String, String>();
+		interpreter = new Interpreter();
+		randomNumbers = new RandomNumbers[5];
+		/*
+		 * 0 - parameterRandomNumbers; 
+		 * 1 - hardConstraintsRandomNumbers;
+		 * 2 - softConstraintsRandomNumbers;
+		 * 3 - timeConstraintsRandomNumbers;
+		 * 4 - precedingConstraintsRandomNumbers;
+		 */
+	}
+	
+	public void setExternalFileDpendencies(String fileName){
+		try {
+			
+			this.swfParser = AbstractWAParser.getInstance(fileName);
+			
+		} catch (NullPointerException e) {
+			e.printStackTrace();
+		}
+	}
+	
+	public void setCurrentJobId(String id){
+		this.jobId = id;
+	}
+	
+	public void setCurrentTaskId(String id){
+		this.taskId = id;
+	}
+	
+	public void setParameterRandomNumbers(RandomNumbers parameterRandomNumbers) {
+		randomNumbers[0] = parameterRandomNumbers;
+	}
+	public void setHardConstraintsRandomNumbers(
+			RandomNumbers hardConstraintsRandomNumbers) {
+		randomNumbers[1] = hardConstraintsRandomNumbers;
+	}
+	public void setSoftConstraintsRandomNumbers(
+			RandomNumbers softConstraintsRandomNumbers) {
+		randomNumbers[2] = softConstraintsRandomNumbers;
+	}
+	public void setTimeConstraintsRandomNumbers(
+			RandomNumbers timeConstraintsRandomNumbers) {
+		randomNumbers[3] = timeConstraintsRandomNumbers;
+	}
+	public void setPrecedingConstraintsRandomNumbers(
+			RandomNumbers precedingConstraintsRandomNumbers) {
+		randomNumbers[4] = precedingConstraintsRandomNumbers;
+	}
+	
+	
+	public double evalValueFor(String id, String refElementId){
+		ArrayList<String> path = null;
+		String idName;
+		boolean found = false;
+		int idx = 0;
+		
+		// find path which contains node.id . 
+		for(int i = 0; i < idDep.size(); i++){
+			path = idDep.get(i);
+			// find position of id in path
+			for(idx = 0; idx < path.size(); idx++){
+				idName = path.get(idx);
+				if(idName.equals(id)) {
+					found = true;
+					break;
+				}
+			}
+			if(found) break;
+		}
+		
+		if(!found)
+			throw new RuntimeException("No value for "+id);
+
+		RandomNumbers randomNumber;
+		String genName;
+		String expr;
+		double value = 0;
+		Number nValue;
+		
+		
+		try {
+			// this is the id of the first node in the path. All others nodes depends on this node. 
+			idName = path.get(0);
+				
+			if(isExternalFileDependent(refElementId)){	// evaluate external file dependency
+				value = evalExternalFileDependency(refElementId);
+				if(idExpMap.containsKey(idName)){
+					expr = idExpMap.get(idName);
+					interpreter.set("x", value);
+					nValue = (Number) interpreter.eval(expr);
+					value = nValue.doubleValue();
+				}
+			} else {								// if there is no external file dependency, try to use random generator
+				for(int i = 0; i < randomNumbers.length; i++){
+					randomNumber = randomNumbers[i];
+					if(randomNumber.containsElement(idName)){
+						genName = randomNumber.getGeneratorName(idName);
+				//		value = randomNumber.getRandomValue(genName);
+						value = randomNumber.getLastGeneratedRandomValue(genName);
+						break;
+					}
+				}
+			}
+			
+			// execute all arithmetic dependency expressions between first node and current one.
+			for(int i = 1; i <= idx; i++){
+				idName = path.get(i);
+				expr = idExpMap.get(idName);
+				interpreter.set("x", value);
+				nValue = (Number)interpreter.eval(expr);
+				value = nValue.doubleValue();
+				if(i < idx) {
+					// random factor which was generated last time should be added to current value.
+					for(int j = 0; j < randomNumbers.length; j++){
+						randomNumber = randomNumbers[j];
+						if(randomNumber.containsElement(idName)){
+							genName = randomNumber.getGeneratorName(idName);
+							value = value + randomNumber.getLastGeneratedRandomValue(genName);
+							break;
+						}
+					}
+				}
+			}
+			
+			// if for current node is defined any random generator, it means that to the value 
+			// accounted by arithmetic expressions some random factor must be added.
+			for(int i = 0; i < randomNumbers.length; i++){
+				randomNumber = randomNumbers[i];
+				if(randomNumber.containsElement(idName)){
+					genName = randomNumber.getGeneratorName(idName);
+					value = value + randomNumber.getRandomValue(genName);
+					break;
+				}
+			}
+			
+		} catch (IllegalAccessException e){
+			e.printStackTrace();
+		} catch (EvalError e) {
+			e.printStackTrace();
+		}
+
+		return value;
+	}
+	
+	
+	/**
+	 * 
+	 * @param fileLocation - workload configuration file location
+	 * @return list of lists of xml elements id's, organized in dependency order (top-down hierarchy)
+	 * or null if no dependencies in workload configuration file were detected.
+	 * @throws Exception if cycle in dependency graph was detected
+	 */
+	public ArrayList<ArrayList<String>> findDependencies(String fileLocation) throws Exception{
+		ArrayList <ArrayList<String>> genOrderList = new ArrayList<ArrayList<String>>();
+		
+		try {
+			DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
+			DocumentBuilder builder = docFactory.newDocumentBuilder();
+			Document doc = builder.parse(fileLocation);
+			
+			
+			XPathFactory factory = XPathFactory.newInstance();
+			XPath xpath = factory.newXPath();
+			XPathExpression expr = xpath.compile("//*[@id]");
+			
+			Object wynik = expr.evaluate(doc, XPathConstants.NODESET);
+			DTMNodeList list = (DTMNodeList) wynik;
+			Node node = null;
+			Node refAttr = null;
+			Node idAttr = null;
+			
+			HashMap<String, Integer> nodeMap = new HashMap<String, Integer>();
+			HashMap<Integer, String> nodeMapInv = new HashMap<Integer, String>();
+			String key;
+			for(int i = 0; i < list.getLength(); i++){
+				node = list.item(i);
+				key = node.getAttributes().getNamedItem("id").getNodeValue();
+				nodeMap.put(key, i);
+				nodeMapInv.put(i, key);
+				node = node.getAttributes().getNamedItem("expr");
+				if(node != null && node.getNodeValue() != null)
+					idExpMap.put(key, node.getNodeValue());
+				else
+					idExpMap.put(key, "x");
+			}
+			
+			int size = nodeMap.size();
+			if(size == 0)
+				return null;
+			
+			int refGraph[] = new int[size];
+			for(int i = 0; i < refGraph.length; i++)
+				refGraph[i] = -1;
+			
+			expr = xpath.compile("//*[@refElementId]");
+			wynik = expr.evaluate(doc, XPathConstants.NODESET);
+			int x = 0;
+			int y = 0;
+			String idValue = null;
+			for(int i = 0; i < list.getLength(); i++){
+				node = list.item(i);
+				refAttr = node.getAttributes().getNamedItem("refElementId");
+				idAttr = node.getAttributes().getNamedItem("id");
+				if(refAttr != null){
+					try {
+						idValue = idAttr.getNodeValue();
+						y = nodeMap.get(idValue);
+						x = nodeMap.get(refAttr.getNodeValue());
+						refGraph[y] = nodeMap.get(nodeMapInv.get(x));
+						
+					} catch (NullPointerException e){
+						log.warn("Element referenced by " + idValue + " doeas not exist in configuration file.");
+					}
+				}
+			}
+
+			// find start points
+			/*
+			 * ostatni w grafie jest ten, ktory nie poprzedza innego wierzcholka (nie ma nastepnikow).
+			 * W celu lokalizacji:
+			 * jezeli wierzcholek 'i' posiada poprzednika 'p', to poprzednik 'p' oznaczany jest jako uzyty
+			 * (posiadajacy nastepnika) - pod indeksem reprezentujacym 'p' w helpTab wpisywne jest -1
+			 */
+			
+			int helpTab[] = new int[refGraph.length];
+			for(int i = 0; i < refGraph.length; i++){
+				if(refGraph[i] != -1)			// bo -1 nie moze byc indeksem tablicy
+					helpTab[refGraph[i]] = -1;
+			}
+			
+			// path end detection
+			/*
+			 * jezeli wierzcholek 'i' posiada w tabeli helpTab wartosc 0, to oznacza, ze nie posiada
+			 * nastepnikow - jest ostatnim wierzcholkiem na sciezce
+			 */
+			ArrayList <Integer> pathEnd = new ArrayList<Integer>();
+			for(int i = 0; i < helpTab.length; i++){
+				if(helpTab[i] == 0) {
+					pathEnd.add(i);
+				}
+			}
+			
+			int loopDetector[] = new int[refGraph.length];
+			/*
+			 * jezeli jakis wierzcholek nigdy nie zostal uzyty w trakcie przejscia wszystkimi sciezkami
+			 * to albo jest wolnym strzelcem albo nalezy do cyklu, z ktorego zaden wierzcholek nie nalezy
+			 * do listy pathEnd
+			 */
+			int usedNodes[] = new int[refGraph.length]; // 1 - used, 0 - not used
+			boolean process = true;
+			boolean loopNotFound = true;
+			int idx = 0;
+			int pathId = 0;
+			int val = 0;
+			String path = new String();
+			ArrayList <String> genOrder = new ArrayList<String>();
+			
+			if(pathEnd.size() == 0)
+				throw new Exception("ERROR: Loop detected in attributes dependency.");
+			
+			// for each path (path end)
+			for(int i = 0; i < pathEnd.size(); i++){
+				System.arraycopy(refGraph, 0, loopDetector, 0, refGraph.length);
+				idx = pathEnd.get(i);
+				usedNodes[idx] = 1;
+				pathId = refGraph.length + idx;
+				path = nodeMapInv.get(idx);
+				genOrder.clear();
+				genOrder.add(0, path);
+				process = true;
+				loopNotFound = true;
+				
+				// found ancestor of current nod
+				// path is build from the end to the beginning
+				while(process && loopNotFound){
+					val = loopDetector[idx];
+					
+					if(val == -1)
+						process = false;
+					else if(val == -pathId)
+ 						loopNotFound = false;
+ 					else {
+ 						loopDetector[idx] = -pathId;
+ 						path = nodeMapInv.get(val) + " -> " + path;
+ 						usedNodes[val] = 1;
+ 						genOrder.add(0, nodeMapInv.get(val));
+ 					}
+					idx = val;
+				}
+				if(!loopNotFound) {
+					throw new Exception("ERROR: Loop detected in atributes dependency, path: "+path);
+				}
+				
+				if(genOrder.size() > 0){
+					genOrderList.add((ArrayList<String>)genOrder.clone());
+				}
+				
+			}
+			
+			// the same as above loop, but for all unused nodes.
+			for(int i = 0; i < usedNodes.length; i++){
+				if(usedNodes[i] == 0){
+					System.arraycopy(refGraph, 0, loopDetector, 0, refGraph.length);
+					idx = i;
+					pathId = refGraph.length + idx;
+					path = nodeMapInv.get(idx);
+					genOrder.clear();
+					genOrder.add(0, path);
+					process = true;
+					loopNotFound = true;
+					
+					while(process && loopNotFound){
+						val = loopDetector[idx];
+						
+						if(val == -1)
+							process = false;
+						else if(val == -pathId)
+	 						loopNotFound = false;
+	 					else {
+	 						loopDetector[idx] = -pathId;
+	 						path = nodeMapInv.get(val) + " -> " + path;
+	 						genOrder.add(0, nodeMapInv.get(val));
+	 					}
+						idx = val;
+					}
+					if(!loopNotFound){
+						throw new Exception("ERROR: Loop detected in atributes dependency, path: "+path);
+					}
+					
+					if(genOrder.size() > 0){
+						genOrderList.add((ArrayList<String>)genOrder.clone());
+					}
+				}
+			}
+			
+		} catch (XPathExpressionException e) {
+			e.printStackTrace();
+		} catch (ParserConfigurationException e) {
+			e.printStackTrace();
+		} catch (SAXException e) {
+			e.printStackTrace();
+		} catch (IOException e) {
+			e.printStackTrace();
+		}
+		
+		idDep = genOrderList;
+		return genOrderList;
+	}
+	
+	protected boolean isExternalFileDependent(String idName){
+		if(idName.startsWith("swf."))
+			return true;
+		
+		return false;
+	}
+	
+	protected double evalExternalFileDependency(String refElementId){
+		String filedName = refElementId.substring(4).toUpperCase();
+		
+		try {
+			String value = null;
+			
+			if("JOB_NUMBER".equals(filedName)){
+				value = swfParser.readTask(jobId, taskId)[SWFFields.DATA_JOB_NUMBER];
+			} else if("SUBMIT_TIME".equals(filedName)){
+				value = swfParser.readTask(jobId, taskId)[SWFFields.DATA_SUBMIT_TIME];
+			} else if("WAIT_TIME".equals(filedName)){
+				value = swfParser.readTask(jobId, taskId)[SWFFields.DATA_WAIT_TIME];
+			} else if("RUN_TIME".equals(filedName)){
+				value = swfParser.readTask(jobId, taskId)[SWFFields.DATA_RUN_TIME];
+			} else if("NUMBER_OF_ALLOCATED_PROCESSORS".equals(filedName)){
+				value = swfParser.readTask(jobId, taskId)[SWFFields.DATA_NUMBER_OF_ALLOCATED_PROCESSORS];
+			} else if("AVERAGE_CPU_TIME_USED".equals(filedName)){
+				value = swfParser.readTask(jobId, taskId)[SWFFields.DATA_AVERAGE_CPU_TIME_USED];
+			} else if("USED_MEMORY".equals(filedName)){
+				value = swfParser.readTask(jobId, taskId)[SWFFields.DATA_USED_MEMORY];
+			} else if("REQUESTED_NUMBER_OF_PROCESSORS".equals(filedName)){
+				value = swfParser.readTask(jobId, taskId)[SWFFields.DATA_REQUESTED_NUMBER_OF_PROCESSORS];
+			} else if("REQUESTED_TIME".equals(filedName)){
+				value = swfParser.readTask(jobId, taskId)[SWFFields.DATA_REQUESTED_TIME];
+			} else if("REQUESTED_MEMORY".equals(filedName)){
+				value = swfParser.readTask(jobId, taskId)[SWFFields.DATA_REQUESTED_MEMORY];
+			} else if("STATUS".equals(filedName)){
+				value = swfParser.readTask(jobId, taskId)[SWFFields.DATA_STATUS];
+			} else if("USER_ID".equals(filedName)){
+				value = swfParser.readTask(jobId, taskId)[SWFFields.DATA_USER_ID];
+			} else if("GROUP_ID".equals(filedName)){
+				value = swfParser.readTask(jobId, taskId)[SWFFields.DATA_GROUP_ID];
+			} else if("EXECUTABLE_NUMBER".equals(filedName)){
+				value = swfParser.readTask(jobId, taskId)[SWFFields.DATA_EXECUTABLE_NUMBER];
+			} else if("QUEUE_NUMBER".equals(filedName)){
+				value = swfParser.readTask(jobId, taskId)[SWFFields.DATA_QUEUE_NUMBER];
+			} else if("PARTITION_NUMBER".equals(filedName)){
+				value = swfParser.readTask(jobId, taskId)[SWFFields.DATA_PARTITION_NUMBER];
+			} else if("PRECEDING_JOB_NUMBER".equals(filedName)){
+				value = swfParser.readTask(jobId, taskId)[SWFFields.DATA_PRECEDING_JOB_NUMBER];
+			} else if("THINK_TIME_FROM_PRECEDING_JOB".equals(filedName)){
+				value = swfParser.readTask(jobId, taskId)[SWFFields.DATA_THINK_TIME_FROM_PRECEDING_JOB];
+			} else {
+				log.error("No external value for element reference "+refElementId + ". Assign default value 0.");
+				return 0;
+			}
+			
+			return Double.valueOf(value);
+			
+		} catch (IOException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+		
+		return 0;
+	}
+	
+	public void close(){
+		try {
+			swfParser.close();
+		} catch (IOException e) {
+			e.printStackTrace();
+		}
+	}
+}
Index: DCWoRMS/trunk/src/simulator/workload/generator/ResourceGeneratorInterface.java
===================================================================
--- DCWoRMS/trunk/src/simulator/workload/generator/ResourceGeneratorInterface.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/workload/generator/ResourceGeneratorInterface.java	(revision 477)
@@ -0,0 +1,63 @@
+package simulator.workload.generator;
+
+import gridsim.ResourceCalendar;
+
+import java.io.FileNotFoundException;
+import java.io.IOException;
+
+import milus.MiloGridResource;
+
+import simulator.workload.exceptons.XMLLogicException;
+
+/**
+ * Interface of a resource configuration reader.
+ * @author Stanislaw Szczepanowski
+ *
+ */
+public interface ResourceGeneratorInterface {
+
+	/**
+	 * This method creates resources on the basis of xml resources descriptions schema (ResourceDescSchema.xsd).
+	 * It is used when new resources are to be created with a given statistical values (e.g. all resources should have 
+	 * total memory variable size with distribution N(0, 1) ).
+	 * 
+	 * @param fileName the pathname of the xml file (proper with ResourceDescSchema.xsd)
+	 * @throws FileNotFoundException
+	 * @throws XMLLogicException 
+	 * @throws IllegalAccessException 
+	 */
+	public void readConfigurationXMLFile(String fileName) throws FileNotFoundException, XMLLogicException, IllegalAccessException;
+	
+	/**
+	 * Reads the description of resources according to HostParamSchema.xsd
+	 * 
+	 * @param fileName the pathname of the xml file 
+	 * @throws FileNotFoundException
+	 */
+	public void readConfigurationHostsDescriptionXMLFile(String fileName) throws FileNotFoundException;
+	
+	/**
+	 * Reads plugins configuration from text file.
+	 * @param fileName
+	 * @return
+	 * @throws IOException
+	 */
+	public boolean loadPlugins(String fileName) throws IOException;
+	/**
+	 * Invoking this metohod will create resources. Important: this method must be invoked after the initialisation of the GridSim ({@link gridsim.GridSim} init methods). 
+	 * @throws Exception 
+	 */
+	public void createResources(ResourceCalendar calendar) throws Exception;
+	
+	/**
+	 * Prints out the statistical data into the out printer
+	 * @param out the {@link PrintWriter} object to write data into
+	 */
+	//public void printResourcesStatistics(PrintWriter out); //FIXME
+	
+	/**
+	 * Retrieves the created resources.
+	 * @return array with the created resources
+	 */
+	public MiloGridResource[] getCreatedResources();
+}
Index: DCWoRMS/trunk/src/simulator/workload/generator/JobGenerator.java
===================================================================
--- DCWoRMS/trunk/src/simulator/workload/generator/JobGenerator.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/workload/generator/JobGenerator.java	(revision 477)
@@ -0,0 +1,20 @@
+package simulator.workload.generator;
+
+import java.io.FileNotFoundException;
+import java.io.IOException;
+
+/**
+ * @author Marcin Krystek
+ *
+ */
+public interface JobGenerator {
+	
+	public void generateWorkload(String workloadConfigFileName, String outputDirectoryName, 
+								boolean overwriteExistingFiles, String outputWorkloadFileName) throws FileNotFoundException, IOException;
+	
+	public void generateXMLSupplement(String configurationFileName, String swfFileName, 
+								String outputDirectoryName, boolean ignoreNonEmptyOutputDir) throws FileNotFoundException, IOException;
+	
+	public void performPostprocessing(String resDescriptionFileName, String outputDirectoryName, String outputWorkloadFileName);
+	
+}
Index: DCWoRMS/trunk/src/simulator/workload/generator/impl/QcgJobGenerator.java
===================================================================
--- DCWoRMS/trunk/src/simulator/workload/generator/impl/QcgJobGenerator.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/workload/generator/impl/QcgJobGenerator.java	(revision 477)
@@ -0,0 +1,923 @@
+package simulator.workload.generator.impl;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.Writer;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Locale;
+import java.util.Set;
+
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.xpath.XPath;
+import javax.xml.xpath.XPathConstants;
+import javax.xml.xpath.XPathExpression;
+import javax.xml.xpath.XPathExpressionException;
+import javax.xml.xpath.XPathFactory;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.exolab.castor.types.Duration;
+import org.exolab.castor.xml.MarshalException;
+import org.exolab.castor.xml.ValidationException;
+import org.qcg.broker.schemas.jobdesc.Application;
+import org.qcg.broker.schemas.jobdesc.ComputingResourceBaseTypeChoice;
+import org.qcg.broker.schemas.jobdesc.ComputingResourceBaseTypeChoiceItem;
+import org.qcg.broker.schemas.jobdesc.ComputingResourceParameterType;
+import org.qcg.broker.schemas.jobdesc.ComputingResourceType;
+import org.qcg.broker.schemas.jobdesc.Executable;
+import org.qcg.broker.schemas.jobdesc.ExecutionTimeType;
+import org.qcg.broker.schemas.jobdesc.ExecutionType;
+import org.qcg.broker.schemas.jobdesc.ParameterBoundaryType;
+import org.qcg.broker.schemas.jobdesc.ParameterChoice;
+import org.qcg.broker.schemas.jobdesc.ParameterTypeChoice;
+import org.qcg.broker.schemas.jobdesc.ParameterTypeChoiceItem;
+import org.qcg.broker.schemas.jobdesc.ParameterValueType;
+import org.qcg.broker.schemas.jobdesc.PreferencesType;
+import org.qcg.broker.schemas.jobdesc.QcgJob;
+import org.qcg.broker.schemas.jobdesc.RangeType;
+import org.qcg.broker.schemas.jobdesc.RequirementsType;
+import org.qcg.broker.schemas.jobdesc.ResourceRequirementsType;
+import org.qcg.broker.schemas.jobdesc.StringValue;
+import org.qcg.broker.schemas.jobdesc.Task;
+import org.qcg.broker.schemas.jobdesc.TimePeriod;
+import org.qcg.broker.schemas.jobdesc.TimePeriodChoice;
+import org.qcg.broker.schemas.jobdesc.types.ComputingParameterName;
+import org.qcg.broker.schemas.jobdesc.types.ExecutionTypeTypeType;
+import org.qcg.broker.schemas.jobdesc.types.ParameterOptimizationTypeType;
+import org.qcg.broker.schemas.jobdesc.types.PreferencesTypePreferenceTypeType;
+import org.w3c.dom.DOMException;
+import org.w3c.dom.Node;
+import org.xml.sax.InputSource;
+
+import simulator.WormsConstants;
+import simulator.utils.GSSimXML;
+import simulator.utils.XsltTransformations;
+import simulator.workload.exceptons.NoSuchCommentException;
+import simulator.workload.fileFilters.QcgJobFileNameFilter;
+import simulator.workload.generator.JobGenerator;
+import simulator.workload.generator.configuration.ComputingResourceHostParameter;
+import simulator.workload.generator.configuration.ExecDuration;
+import simulator.workload.generator.configuration.ExecutionTime;
+import simulator.workload.generator.configuration.ExecutionTimeChoice;
+import simulator.workload.generator.configuration.Importance;
+import simulator.workload.generator.configuration.Max;
+import simulator.workload.generator.configuration.Min;
+import simulator.workload.generator.configuration.Parameter;
+import simulator.workload.generator.configuration.PeriodDuration;
+import simulator.workload.generator.configuration.PeriodEnd;
+import simulator.workload.generator.configuration.PeriodStart;
+import simulator.workload.generator.configuration.Preferences;
+import simulator.workload.generator.configuration.Range;
+import simulator.workload.generator.configuration.TaskLength;
+import simulator.workload.generator.configuration.Value;
+import simulator.workload.generator.configuration.WorkloadConfiguration;
+import simulator.workload.generator.configuration.types.OptimizationTypeType;
+import simulator.workload.generator.configuration.types.PreferencesPreferenceTypeType;
+import simulator.workload.reader.archive.AbstractWAParser;
+import simulator.workload.reader.archive.AbstractWAReader;
+import simulator.workload.reader.archive.WAParser;
+import simulator.workload.reader.archive.WAReader;
+import simulator.workload.reader.archive.swf.SWFFields;
+import simulator.workload.writer.swf.QcgSWFJobWriter;
+import simulator.workload.writer.swf.SWFJobWriter;
+
+import com.sun.org.apache.xml.internal.dtm.ref.DTMNodeList;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+public class QcgJobGenerator extends AbstractJobGenerator implements JobGenerator {
+
+	private static Log log = LogFactory.getLog(QcgJobGenerator.class);
+	protected static int TIME_OUT = 10;
+	private File lastUpdatedFile = null;
+	private String lastUpdatedJob = null;
+	
+	public void generateXMLSupplement(String configurationFileName, String waFileName, 
+							String outputDirectoryName, boolean ignoreNonEmptyOutputDir) 
+												throws FileNotFoundException, IOException{
+		if(log.isInfoEnabled())
+			log.info("Generate xml suplement - start");
+		
+		WAReader<QcgJob> swfReader = AbstractWAReader.getInstace(waFileName);
+		WAParser swfParser = AbstractWAParser.getInstance(waFileName);
+		QcgJob QcgJob = null;
+		Task task = null;
+		Writer writer = null;
+		long startTime = 0;
+		
+		File outputDirectory = prepareWorkloadDirectory(outputDirectoryName, ignoreNonEmptyOutputDir);
+		
+		try {
+			randomNumbersWrapper.findDependencies(configurationFileName);
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+
+		workload = (WorkloadConfiguration) GSSimXML.unmarshal(WorkloadConfiguration.class, new FileReader(configurationFileName));
+		init(workload);
+		this.randomNumbersWrapper.setExternalFileDpendencies(waFileName);
+		
+		swfParser.loadHeader();
+		try {
+			SimpleDateFormat df = new SimpleDateFormat("EEE MMM dd HH:mm:ss ZZZZ yyyy", Locale.ENGLISH);
+			startTime = df.parse(swfParser.getCommentValue(SWFFields.COMMENT_STARTTIME)).getTime();
+		} catch (NoSuchCommentException e) {
+			if(log.isErrorEnabled())
+				log.error("No start time filed in swf header. Start time = 0");
+			startTime = 0;
+		} catch (ParseException e) {
+			if(log.isErrorEnabled())
+				log.error("Start time parse exception. Start time = 0");
+			startTime = 0;
+		}
+		
+		try {
+			
+			while((QcgJob = swfReader.read()) != null){
+				
+				for(int i = 0; i < QcgJob.getTaskCount(); i++){
+					task = QcgJob.getTask(i);
+					this.randomNumbersWrapper.setCurrentJobId(QcgJob.getAppId());
+					this.randomNumbersWrapper.setCurrentTaskId(task.getTaskId());
+					RequirementsType hardConstraints = createResourceRequirements(workload, task.getRequirements());
+					if(hardConstraints != null) {
+						task.setRequirements(hardConstraints);
+					}
+					
+					
+					long submitTime = 0;
+					String sTab[] = swfParser.readTask(QcgJob.getAppId(), task.getTaskId());
+					if(sTab != null)
+						submitTime = startTime + Long.parseLong(sTab[SWFFields.DATA_SUBMIT_TIME]) * 1000;
+
+					ExecutionTimeType execTime = createTimeRequirements(workload, submitTime, task.getExecutionTime());
+					if(execTime != null) {
+						task.setExecutionTime(execTime);
+					}
+					
+				}
+				
+				if(QcgJob.getTaskCount() > 0){
+					writer = new FileWriter(outputDirectory.getPath() + 
+											File.separator + 
+											QcgJobFileNameFilter.FILE_NAME_PREFIX + 
+											QcgJob.getAppId() + 
+											".xml");
+					
+					GSSimXML.marshal(QcgJob, writer);
+					writer.close();
+				}
+			}
+			
+			swfReader.close();
+			
+		} catch (IOException e) {
+			throw e;
+		} finally {
+			swfReader.close();
+			swfParser.close();
+			this.randomNumbersWrapper.close();
+		}
+		
+		if(log.isInfoEnabled())
+			log.info("Generate xml suplement - done");
+	}
+
+	
+	public void generateWorkload(String workloadConfigFileName,
+			String outputDirectoryName, boolean overwriteExistingFiles,
+			String outputWorkloadFileName) throws FileNotFoundException, IOException {
+		
+		if(log.isInfoEnabled())
+			log.info("Generate workload - start");
+		
+		boolean creationResult = false;
+		File outputDirectory = prepareWorkloadDirectory(outputDirectoryName, overwriteExistingFiles);
+
+		SWFJobWriter<QcgJob> swfJobWriter = new QcgSWFJobWriter(outputDirectoryName, outputWorkloadFileName);
+		swfJobWriter.writeFieldDescriptionHeader();
+		
+		try {
+			randomNumbersWrapper.findDependencies(workloadConfigFileName);
+		} catch (Exception e2) {
+			e2.printStackTrace();
+		}
+
+		// load workload configuration from xml file
+		try {
+			workload = WorkloadConfiguration.unmarshal(new FileReader(workloadConfigFileName));
+		} catch (MarshalException e2) {
+			e2.printStackTrace();
+		} catch (ValidationException e2) {
+			e2.printStackTrace();
+		}
+
+		// beginning of time FIXME the SIMULATION VIRTUAL TIME has not yet been tested
+		simulationVirtualTime = workload.getSimulationStartTime().getTime();
+		long simulationStartTime = simulationVirtualTime;
+		
+		swfJobWriter.writeComment("StartTime", String.valueOf(workload.getSimulationStartTime()));
+		
+		jobCount = workload.getWorkloadConfigurationChoice().getJobCount();
+		simulationDuration = workload.getWorkloadConfigurationChoice().getSimulationTime();
+		if (simulationDuration != null)
+			simulationEndTime = new Date(simulationVirtualTime+simulationDuration.toLong());
+		
+		init(workload);
+
+		if (jobCount != null) {
+			try {
+				jobCountToBeGenerated = (int) getRandomValueFor(jobCount, parameterRandomNumbers);
+				jobCountToBeGenerated--; // because we count jobs from 0
+			} catch (IllegalAccessException e) {
+				e.printStackTrace();
+			}
+		}
+		
+		// the random length of the task group to be submitted at one moment
+		long jobPackageLength = 0L;
+		TaskLength taskLength;
+		// we start with first job
+		generatedJobCount = 0;
+		
+		while (proceedConditionsAreFulfilled()) {
+			QcgJob QcgJob = new QcgJob();
+			
+			String jobID = Integer.toString(generatedJobCount);
+			QcgJob.setAppId(jobID);
+			
+			//initially - a standard value
+			taskCountToBeGenerated = WormsConstants.DEFAULT_TASK_COUNT_IN_SINGLE_JOB; 
+			
+			try {
+				taskCountToBeGenerated = (int) getRandomValueFor(workload.getTaskCount(), parameterRandomNumbers);
+			} catch (IllegalAccessException e1) {
+				e1.printStackTrace();
+			}
+
+			// the end of current package of tasks, need to generate new package length
+			if (jobPackageLength == 0) {
+				try {
+					// it is always a whole number
+					jobPackageLength = (long) getRandomValueFor(workload.getJobPackageLength(), parameterRandomNumbers);
+					// it is always a whole number
+					long jobInterval = (long) getRandomValueFor(workload.getJobInterval(), parameterRandomNumbers);
+					// all jobs (tasks) in a package have the same submit time 
+					simulationVirtualTime = simulationVirtualTime + (jobInterval * 1000);
+					if (simulationDuration != null) {
+						simulationVirtualTime = Math.min(simulationVirtualTime, simulationEndTime.getTime());
+					}
+				} catch (IllegalAccessException e) {
+					e.printStackTrace();
+				}
+			}
+			
+			for (int taskNum = 0; taskNum < taskCountToBeGenerated; taskNum++) {
+				Task task = new Task();
+				QcgJob.addTask(task);
+				
+				task.setTaskId(String.valueOf(taskNum));
+				
+				// create section execution
+				//ExecutionType execution = createExecution(workload, null);
+				//task.setExecution(execution);
+				
+				// create requirements section
+				RequirementsType requirements = createResourceRequirements(workload, null);
+				if(requirements != null) {
+					task.setRequirements(requirements);
+				}
+				
+				taskLength = workload.getTaskLength();
+				if(taskLength != null) {
+					try {
+						long l_taskLength = (long) getRandomValueFor(taskLength, parameterRandomNumbers);
+						swfJobWriter.addTaskLength(task.getTaskId(), l_taskLength);
+					} catch (IllegalAccessException e) {
+						e.printStackTrace();
+					}
+				}
+				
+				// create execution time section
+				//long submitTime = workload.getSimulationStartTime().getTime() + simulationVirtualTime*1000;
+				long submitTime = simulationVirtualTime;
+				ExecutionTimeType execTime = createTimeRequirements(workload, submitTime, null);
+				if(execTime != null) {
+					task.setExecutionTime(execTime);
+				}
+				
+			} // end of task generation
+
+
+			// one job less from the package
+			jobPackageLength--;
+			
+			// create workflow from generated tasks
+			// createWorkflow(workload, QcgJob.getTask());
+			
+			File taskFile = null;
+			if(generatedJobCount < 10)
+				taskFile = new File(outputDirectory, QcgJobFileNameFilter.FILE_NAME_PREFIX + "_0" + jobID + ".xml");
+			else
+				taskFile = new File(outputDirectory, QcgJobFileNameFilter.FILE_NAME_PREFIX + "_" + jobID + ".xml");
+			
+			try {
+				creationResult = taskFile.createNewFile();
+			} catch (IOException e) {
+				e.printStackTrace();
+			}
+			
+			// the file was not created
+			if (! creationResult) { 
+				throw new IOException("Cannot create the task file for taskid: "+jobID);
+			}
+
+			FileWriter taskWriter = new FileWriter(taskFile);
+			GSSimXML.marshal(QcgJob, taskWriter);
+			taskWriter.flush();
+			taskWriter.close();
+			
+			//swfJobWriter.setJobSubmitTime(simulationVirtualTime);
+			swfJobWriter.setJobSubmitTime((simulationVirtualTime - simulationStartTime)/1000);
+			swfJobWriter.write(QcgJob);
+			
+			generatedJobCount++;
+		
+		} // end of job generation
+
+		swfJobWriter.close();
+		
+		if(log.isInfoEnabled())
+			log.info("Generate workload - done");
+	}
+
+	protected ExecutionType createExecution(WorkloadConfiguration workload, ExecutionType exec){
+		ExecutionType execution = new ExecutionType();
+		Executable executable = new Executable();
+				Application application = new Application();
+				application.setName("app");
+			executable.setApplication(application);
+		execution.setExecutable(executable);
+		execution.setType(ExecutionTypeTypeType.SINGLE);
+		return execution;
+	}
+
+
+	protected RequirementsType createResourceRequirements(WorkloadConfiguration workload, RequirementsType hCons) {
+		ResourceRequirementsType resRequirements = null;
+		RequirementsType requirements = hCons;
+		ComputingResourceHostParameter compResParameters[] = workload.getComputingResourceHostParameter();
+		
+		if (compResParameters != null && compResParameters.length > 0) {
+			
+			if(requirements == null) {
+				requirements = new RequirementsType();
+				
+			}
+			
+			resRequirements = requirements.getResourceRequirements();
+			if(resRequirements == null){
+				resRequirements = new ResourceRequirementsType();
+				requirements.setResourceRequirements(resRequirements);
+			}
+			
+			ComputingResourceType computingResource = null;
+			if(resRequirements.getComputingResourceCount() == 0){
+				computingResource = new ComputingResourceType();
+				resRequirements.addComputingResource(computingResource);
+			} else {
+				computingResource = resRequirements.getComputingResource(0);
+			}
+			
+			ComputingResourceBaseTypeChoice choice = computingResource.getComputingResourceBaseTypeChoice();
+			if(choice == null){
+				choice = new ComputingResourceBaseTypeChoice();
+				computingResource.setComputingResourceBaseTypeChoice(choice);
+			}
+					
+			
+			
+			for (int i = 0; i < compResParameters.length; i++) {
+				ComputingResourceHostParameter compResParameter = compResParameters[i];
+
+				ComputingResourceBaseTypeChoiceItem item = new ComputingResourceBaseTypeChoiceItem();
+				choice.addComputingResourceBaseTypeChoiceItem(item);
+				
+				ComputingResourceParameterType hostParameter = new ComputingResourceParameterType();
+				item.setHostParameter(hostParameter);
+				
+				String name = compResParameter.getMetric();
+				ComputingParameterName parameterName = ComputingParameterName.fromValue(name);
+				hostParameter.setName(parameterName);
+				
+				Range[] ranges = compResParameter.getRange();
+				ParameterTypeChoice ptc = new ParameterTypeChoice();
+				hostParameter.setParameterTypeChoice(ptc);
+				
+				for (int r = 0; r < ranges.length; ++r) {
+					ParameterTypeChoiceItem ptci = new ParameterTypeChoiceItem();
+						org.qcg.broker.schemas.jobdesc.Range range = new org.qcg.broker.schemas.jobdesc.Range();
+					ptci.setRange(range);
+					ptc.addParameterTypeChoiceItem(ptci);
+					
+					Range workloadRange = ranges[r];
+					if (workloadRange.getMax() != null) {
+						
+						try {
+							Max maxRange = workloadRange.getMax();
+							Double rangeMax = getRandomValueFor(maxRange, hardConstraintsRandomNumbers);
+							
+							ParameterBoundaryType max = new ParameterBoundaryType();
+							max.setContent(Math.round(rangeMax));
+							range.setMax(max);
+							
+						} catch (IllegalAccessException e) {
+							e.printStackTrace();
+						}
+						
+					}
+					if (workloadRange.getMin() != null) {
+						try {
+							Min minRange = workloadRange.getMin();
+							Double rangeMin = getRandomValueFor(minRange, hardConstraintsRandomNumbers);
+							
+							ParameterBoundaryType min = new ParameterBoundaryType();
+							min.setContent(Math.round(rangeMin));
+							range.setMin(min);
+						} catch (IllegalAccessException e) {
+							e.printStackTrace();
+						}
+
+					}
+				}
+
+				boolean useStringValue = useStringValue(parameterName);
+				Value[] values = compResParameter.getValue();
+				for (int v = 0; v < values.length; ++v) {
+					
+					try {
+						
+						
+						Double dValue = getRandomValueFor(values[v], hardConstraintsRandomNumbers);
+						
+						
+						if(useStringValue) {
+							StringValue stringValue = new StringValue();
+							stringValue.setValue(String.valueOf(Math.round(dValue)));
+							hostParameter.addStringValue(stringValue);
+						} else {
+							ParameterTypeChoiceItem ptci = new ParameterTypeChoiceItem();
+							org.qcg.broker.schemas.jobdesc.Value value = new org.qcg.broker.schemas.jobdesc.Value();
+								value.setContent(Math.round(dValue));
+							ptci.setValue(value);
+							ptc.addParameterTypeChoiceItem(ptci);
+						}
+
+					} catch (IllegalAccessException e) {
+						e.printStackTrace();
+					}
+					
+				}
+			}
+		}
+
+		// create section preferences
+		if(resRequirements != null){
+			PreferencesType preferences = createPreferences(workload, resRequirements.getPreferences());
+			if(preferences != null) {
+				resRequirements.setPreferences(preferences);
+			}
+		}
+		
+		return requirements;
+	}
+	
+
+	protected PreferencesType createPreferences(WorkloadConfiguration workload, PreferencesType sCons) {
+		PreferencesType preferences = sCons;
+		Preferences workloadPreferences = workload.getPreferences();
+		
+		if (workloadPreferences == null) 
+			return preferences;
+		
+		if(preferences == null)
+			preferences = new PreferencesType();
+			
+		PreferencesTypePreferenceTypeType softConstraintsPreferenceTypeType = null;
+		
+		switch (workloadPreferences.getPreferenceType().getType()) {
+			case PreferencesPreferenceTypeType.PRIORITY_TYPE:
+				softConstraintsPreferenceTypeType = PreferencesTypePreferenceTypeType.PRIORITY;
+				break;
+			case PreferencesPreferenceTypeType.RANKING_TYPE:
+				softConstraintsPreferenceTypeType = PreferencesTypePreferenceTypeType.RANKING;
+				break;
+		}
+
+		preferences.setPreferenceType(softConstraintsPreferenceTypeType);
+
+		
+		Parameter[] parameters = workloadPreferences.getParameter();
+		for (int i = 0; i < parameters.length; ++i) {
+			Parameter constraint = parameters[i];
+			org.qcg.broker.schemas.jobdesc.Parameter parameter = new org.qcg.broker.schemas.jobdesc.Parameter();
+			
+			switch (constraint.getOptimizationType().getType()) {
+				case OptimizationTypeType.COST_TYPE:
+					parameter.setOptimizationType(ParameterOptimizationTypeType.COST);
+					break;
+				case OptimizationTypeType.GAIN_TYPE:
+					parameter.setOptimizationType(ParameterOptimizationTypeType.GAIN);						
+					break;
+			}
+
+			String parameterName = constraint.getName();
+			parameter.setName(parameterName);
+
+			String endpoint = constraint.getEndpoint();
+			parameter.setEndpoint(endpoint);
+
+			Importance importance = constraint.getImportance();
+			try {
+				Double impValue;
+				impValue = getRandomValueFor(importance, softConstraintsRandomNumbers);
+				
+				if (impValue.equals(new Double(0)) && 
+						softConstraintsPreferenceTypeType == PreferencesTypePreferenceTypeType.PRIORITY) {
+					
+					if(log.isWarnEnabled())
+						log.warn("\nWARNING: the constraint "+ parameterName + 
+										" has importance set to zero."+
+										" Non deterministic simulation may occur!\n");
+				}
+				parameter.setImportance(impValue.intValue());
+				
+				ParameterChoice choice = new ParameterChoice();
+				parameter.setParameterChoice(choice);
+				
+				Range rangeTab[] = constraint.getRange();
+				if(rangeTab != null && rangeTab.length > 0){
+					Range range = rangeTab[0];
+					Min rangeMin = range.getMin();
+					Max rangeMax = range.getMax();
+					Double minValue = getRandomValueFor(rangeMin, softConstraintsRandomNumbers);
+					Double maxValue = getRandomValueFor(rangeMax, softConstraintsRandomNumbers);
+					
+					RangeType jobDescRange = new RangeType();
+					
+					ParameterBoundaryType min = new ParameterBoundaryType();
+					min.setContent(minValue);
+					jobDescRange.setMin(min);
+					
+					ParameterBoundaryType max = new ParameterBoundaryType();
+					max.setContent(maxValue);
+					jobDescRange.setMax(max);
+					
+					choice.setRange(jobDescRange);
+				}
+				
+				Value value = constraint.getValue();
+				if(value != null){
+					double v = getRandomValueFor(value, softConstraintsRandomNumbers);
+					ParameterValueType vt = new ParameterValueType();
+					vt.setContent(v);
+					choice.setValue(vt);
+				}
+				
+			} catch (IllegalAccessException e) {
+				e.printStackTrace();
+			}
+
+			preferences.addParameter(parameter);
+		}
+		
+		return preferences;
+	}
+
+	
+	protected ExecutionTimeType createTimeRequirements(WorkloadConfiguration workload, long submitTime, ExecutionTimeType exeTime) {
+		ExecutionTimeType execTime = exeTime;
+		Double value = null;
+		long l_execDuration = 0l;
+		ExecutionTime timeConstraints = workload.getExecutionTime();
+		
+		try {
+			if(timeConstraints != null) {
+				if(execTime == null)
+					execTime = new ExecutionTimeType();
+				
+				ExecDuration execDuration = timeConstraints.getExecDuration();
+				if(execDuration != null) {
+					value = getRandomValueFor(execDuration, timeConstraintsRandomNumbers);
+					l_execDuration = value.longValue();
+					execTime.setExecutionDuration(new Duration(l_execDuration));
+				}
+				
+				PeriodStart periodStart = timeConstraints.getPeriodStart();
+				ExecutionTimeChoice choice = timeConstraints.getExecutionTimeChoice();
+				if(periodStart != null || choice != null){
+					TimePeriod timePeriod = new TimePeriod();
+						value = 0.0;
+						if(periodStart != null){
+							value = getRandomValueFor(periodStart, timeConstraintsRandomNumbers);
+							timePeriod.setPeriodStart(new Date(submitTime + value.longValue()*1000));
+						}
+					
+						if(choice != null){
+							TimePeriodChoice timePeriodChoice = new TimePeriodChoice();
+								
+								PeriodDuration duration = choice.getPeriodDuration();
+								if(duration != null){
+									value = getRandomValueFor(duration, timeConstraintsRandomNumbers);
+									timePeriodChoice.setPeriodDuration(new Duration(value.longValue()));
+								}
+								
+								PeriodEnd periodEnd = choice.getPeriodEnd();
+								if(periodEnd != null){
+									value = getRandomValueFor(periodEnd, timeConstraintsRandomNumbers);
+									
+									timePeriodChoice.setPeriodEnd(
+											new Date(submitTime + value.longValue()*1000));
+								}
+							
+							timePeriod.setTimePeriodChoice(timePeriodChoice);
+						}
+					
+					execTime.setTimePeriod(timePeriod);
+				}
+			}
+		} catch (IllegalAccessException e) {
+			e.printStackTrace();
+		}
+		
+		return execTime;
+	}
+	
+	public void performPostprocessing(String resDescriptionFileName,
+			String outputDirectoryName, String outputWorkloadFileName) {
+		int PCT_STEP = 10;
+		Long cpuSpeed = Long.MAX_VALUE;
+		XPathFactory factory = XPathFactory.newInstance();
+		XPath xpath = factory.newXPath();
+		XPathExpression expression = null;
+		Object obj = null;
+		DTMNodeList nodeList = null;
+		Node node = null;
+		XsltTransformations transformer = null;
+		
+		log.info("Workload postprocessing - start");
+		
+		try {
+			
+			transformer = new XsltTransformations();
+			
+			expression = xpath.compile("//hostParameter[@name='cpuspeed']");
+			InputSource s = new InputSource(new FileReader(resDescriptionFileName));
+			obj = expression.evaluate(s, XPathConstants.NODESET);
+			nodeList = (DTMNodeList) obj;
+			long current = 0;
+			for(int i = 0; i < nodeList.getLength(); i++){
+				node = nodeList.item(i);
+				current = Long.parseLong(node.getChildNodes().item(1).getTextContent());
+				if(current < cpuSpeed)
+					cpuSpeed = current;
+			}
+
+		
+			if(cpuSpeed == Long.MAX_VALUE){
+					log.error("minimum CpuSpeed not found.");
+				return;
+			}
+			
+			
+			File dir = new File(outputDirectoryName);
+			File files[] = dir.listFiles(new QcgJobFileNameFilter());
+			
+			HashMap<String, File> fileMap = new HashMap<String, File>();
+			int base = files.length / PCT_STEP;
+			int nextBase = base;
+			
+			log.info("Loading job ids...");
+			log.info("0%");
+			for(int i = 0; i < files.length; i++){
+				File file = files[i];
+				String job = readJob(file);
+				String jobId = transformer.extractJobId(job);
+				fileMap.put(jobId, file);
+				if(i + 1 >= nextBase){
+					log.info((nextBase / base) * PCT_STEP + "%");
+					nextBase = nextBase + base;
+				}
+			}
+			log.info("Loading job ids - DONE");
+			
+			File wafFile = new File(outputWorkloadFileName);
+			if(!wafFile.exists()){
+				wafFile = new File(outputDirectoryName, outputWorkloadFileName);
+				if(!wafFile.exists())
+					throw new IOException("No swf file in specified location.");
+			}
+			
+			
+			File originalWAFile = new File(wafFile.getAbsolutePath()+"_original.swf");
+			if (originalWAFile.exists())
+				if (! originalWAFile.delete())
+						log.error("Cannot delete file " + originalWAFile.getAbsolutePath());
+			if (! wafFile.renameTo(originalWAFile))
+					log.error("Cannot remove file " + originalWAFile.getAbsolutePath());
+			
+			QcgSWFJobWriter swfWriter = new QcgSWFJobWriter(wafFile.getParent(), wafFile.getName());
+			swfWriter.writeFieldDescriptionHeader();
+			
+			log.info("Updating swf header...");
+			WAParser waParser = AbstractWAParser.getInstance(originalWAFile.getAbsolutePath());
+			HashMap<String, String> swfHeader = waParser.loadHeader();
+			swfHeader.put(SWFFields.COMMENT_PUSPEED, String.valueOf(cpuSpeed));
+			
+			Set<String> keys = swfHeader.keySet();
+			Iterator<String> itr = keys.iterator();
+			String key;
+			while(itr.hasNext()){
+				key = itr.next();
+				swfWriter.writeComment(key, swfHeader.get(key));
+			}
+			log.info("Updating swf header - DONE");
+			
+			String task[] = null;
+			
+			long taskLength;
+			long value;
+			Duration duration;
+			HashMap<String, String[]> idMapping = waParser.getIDMapping();
+			base = idMapping.size() / PCT_STEP;
+			nextBase = base;
+			int taskCnt = 0;
+			log.info("Processing jobs...");
+			log.info("0%");
+			while((task = waParser.readTask()) != null){
+				taskCnt++;
+				
+				String ids[] = idMapping.get(task[SWFFields.DATA_JOB_NUMBER]);
+				String jobId = ids[0];
+				String taskId = ids[1];
+				
+				taskLength = Long.parseLong(task[SWFFields.DATA_RUN_TIME]);
+				
+				// value = how many seconds this task was executed on processing unit with speed = cpuSpeed
+				value = taskLength / cpuSpeed;
+				task[SWFFields.DATA_RUN_TIME] = String.valueOf(value);
+				
+				taskLength = Long.parseLong(task[SWFFields.DATA_REQUESTED_TIME]);
+				value = taskLength / cpuSpeed;
+				task[SWFFields.DATA_REQUESTED_TIME] = String.valueOf(value); 
+				
+				value = value * 1000;			// taskLenght in milliseconds
+				duration = new Duration(value);
+				
+				File file = fileMap.get(jobId);
+				String job = readJob(file);
+				String updatedJob = transformer.jobPostProcessing(job, taskId, duration.toString());
+				writeJob(file, updatedJob);
+				
+				swfWriter.addTaskMapping(task[SWFFields.DATA_JOB_NUMBER], jobId, taskId);
+				swfWriter.writeLine(task);
+				if(taskCnt >= nextBase){
+					log.info((nextBase / base) * PCT_STEP + "%");
+					nextBase = nextBase + base;
+				}
+			}
+			
+			flushCache();
+			
+			waParser.close();
+			swfWriter.close();
+			log.info("Processing jobs - DONE");
+			
+		} catch (FileNotFoundException e) {
+			e.printStackTrace();
+		} catch (NullPointerException e) {
+			e.printStackTrace();
+		} catch (IOException e) {
+			e.printStackTrace();
+		} catch (XPathExpressionException e) {
+			e.printStackTrace();
+		} catch (ParserConfigurationException e) {
+			e.printStackTrace();
+		} catch (DOMException e) {
+			e.printStackTrace();
+		}
+		
+		log.info("Workload postprocessing - done");
+	}
+	
+	/**
+	 * Reads job description from specified file. If the argument file 
+	 * was updated by previous writeJob() method, then readJob returns updated 
+	 * value without physical disk access.
+	 * 
+	 * @param file
+	 * @return
+	 */
+	protected String readJob(File file){
+		if(file.equals(lastUpdatedFile)){
+			return lastUpdatedJob;
+		}
+		
+		flushCache();
+		this.lastUpdatedJob = null;
+		
+		String doc = "";
+		String line = null;
+		try {
+			BufferedReader reader = new BufferedReader(new FileReader(file));
+			while((line = reader.readLine()) != null){
+				doc += line;
+			}
+			reader.close();
+			
+		} catch (FileNotFoundException e) {
+			e.printStackTrace();
+		} catch (IOException e) {
+			e.printStackTrace();
+		}
+		
+		return doc;
+	}
+	
+	/**
+	 * This implementation does not really writes file to disk, instead job is saved
+	 * in buffer and file is marked as last update file. To force writing task do disk
+	 * call flushCache() method.
+	 * @param file
+	 * @param job
+	 */
+	protected void writeJob(File file, String job){
+		this.lastUpdatedFile = file;
+		this.lastUpdatedJob = job;
+	}
+	
+	/**
+	 * Force writing job description to file specified in last/previous call of
+	 * writeJob method.
+	 */
+	protected void flushCache(){
+		if(lastUpdatedFile == null || lastUpdatedJob == null)
+			return;
+		
+		if(lastUpdatedFile.exists()){
+			lastUpdatedFile.delete();
+		}
+		
+		Writer writer = null;
+		try {
+			
+			writer = new FileWriter(lastUpdatedFile);
+			writer.write(lastUpdatedJob);
+			
+		} catch (IOException e) {
+			e.printStackTrace();
+		} finally {
+			if(writer != null)
+				try {
+					writer.close();
+				} catch (IOException e) {
+					e.printStackTrace();
+				}
+		}
+	}
+
+	protected void createWorkflow(WorkloadConfiguration workload, Task tasks[]){
+		throw new RuntimeException("Not implemented.");
+	}
+	
+	protected boolean useStringValue(ComputingParameterName parameterName){
+		// odblokowac te metode, jak tylko skoncza sie testy Kikasa i Ariela
+		if(1 == 1)
+			return false;
+		
+		switch (parameterName){
+			case OSNAME:
+			case OSTYPE:
+			case OSVERSION:
+			case CPUARCH:
+			case OSRELEASE:
+			case APPLICATION:
+			case HOSTNAME:
+			case REMOTESUBMISSIONINTERFACE:
+			case LOCALRESOURCEMANAGER: return true;
+			
+			default : return false;
+		}
+	}	
+}
Index: DCWoRMS/trunk/src/simulator/workload/generator/impl/ResourceGenerator.java
===================================================================
--- DCWoRMS/trunk/src/simulator/workload/generator/impl/ResourceGenerator.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/workload/generator/impl/ResourceGenerator.java	(revision 477)
@@ -0,0 +1,627 @@
+ package simulator.workload.generator.impl;
+
+import gridsim.ResourceCalendar;
+import schedframe.ResourceContainer;
+import schedframe.implementation.ResourceContainerImpl;
+import org.qcg.broker.schemas.exception.NoSuchParamException;
+import org.qcg.broker.schemas.exception.UnknownParameter;
+import org.qcg.broker.schemas.hostparams.ComputingResource;
+import org.qcg.broker.schemas.hostparams.HostParameters;
+import org.qcg.broker.schemas.hostparams.wrapper.ComputingResourceParameters;
+import org.qcg.broker.schemas.hostparams.wrapper.HostParametersWrapper;
+import org.qcg.broker.schemas.hostparams.wrapper.QueueResourceParamExplorer;
+import org.qcg.broker.schemas.hostparams.wrapper.QueuingSystem;
+import org.qcg.broker.schemas.hostparams.wrapper.impl.ComputingResourceParamExplorerImpl;
+import org.qcg.broker.schemas.hostparams.wrapper.impl.HostParametersWrapperImpl;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.Reader;
+import java.io.Writer;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import milus.Constants;
+import milus.MiloARPolicy;
+import milus.MiloAllocPolicy;
+import milus.MiloGridResource;
+import milus.MiloPE;
+import milus.MiloResourceCharacteristics;
+import milus.implementation.MiloARResReqManagerImpl;
+
+import simulator.GssARResource;
+import simulator.GssConstants;
+import simulator.GssResource;
+import simulator.RandomNumbers;
+//import simulator.factory.QueueingSystemFactory;
+//import simulator.factory.ResourcesRandomNumbersFactory;
+//import simulator.factory.SingleResourceFactory;
+import simulator.plugin.localallocationpolicies.implementation.LocalAllocARPolicyWraper;
+import simulator.plugin.localallocationpolicies.implementation.LocalAllocPolicyWraper;
+import simulator.stats.GSSAccumulator;
+import simulator.utils.GSSimXML;
+import simulator.workload.exceptons.XMLLogicException;
+import simulator.workload.generator.ResourceGeneratorInterface;
+
+/**
+ * 
+ * @author Stanislaw Szczepanowski
+ * @author Marcin Krystek
+ *
+ */
+
+public class ResourceGenerator implements ResourceGeneratorInterface {
+
+	/**
+	 * The descriptions of the resources 
+	 */
+	protected ResourceContainer<ComputingResource, QueuingSystem>[] resourcesDescriptions;
+	
+	/**
+	 * All the generated resources
+	 */
+	protected MiloGridResource[] miloGridResources;
+	
+	/**
+	 * All the local allocation policies for generated resources
+	 */
+	protected MiloAllocPolicy[] miloAllocPolicies;
+	
+	/**
+	 * All the resource characteristics for generated resources
+	 */
+	protected MiloResourceCharacteristics[] miloResourceCharacteristics;
+	
+	/**
+	 * The path of the forecast finish time plugin
+	 */
+	protected Map <String, String>forecastFinishTimePlugin; 
+	protected String defaultForecastFinishTimePlugin;
+	
+	/**
+	 * The path of the local allocation policy plugin
+	 */
+	protected Map <String, String>localAllocationPolicyPlugin;
+	protected String defaultLocalAllocationPolicyPlugin;
+	
+	/**
+	 * Stores the xml description of all resources
+	 */
+	protected String xmlResourcesDescription;
+	
+	/**
+	 * Stores the mean total load of all resources
+	 */
+	protected GSSAccumulator meanTotalLoad;
+	
+	/**
+	 * Stores the mean length of queues of all resources
+	 */
+	protected GSSAccumulator meanQueueLength;
+
+	/**
+	 * Internal random number generator
+	 */
+	protected RandomNumbers randNumbers;
+	
+	protected File outputDir;
+	
+	
+	/**
+	 * Temporary constructor. 
+	 * For test purpose only.
+	 * @param forecastFinishTimePlugin  Path of the forecast finish time plugin
+	 * @param localAllocationPolicyPlugin  Path of the local allocation policy plugin
+	 */
+	public ResourceGenerator(String forecastFinishTimePlugin, String localAllocationPolicyPlugin){
+		this.defaultForecastFinishTimePlugin = forecastFinishTimePlugin;
+		this.defaultLocalAllocationPolicyPlugin = localAllocationPolicyPlugin;
+		this.forecastFinishTimePlugin = new HashMap<String, String>();
+		this.localAllocationPolicyPlugin = new HashMap<String, String>();
+		this.outputDir = null;
+	}
+	
+	public ResourceGenerator(){
+		this.defaultForecastFinishTimePlugin = "no_defaultForecastPlugin";
+		this.defaultLocalAllocationPolicyPlugin = "no_defaultAllocationPlugin";
+		this.forecastFinishTimePlugin = new HashMap<String, String>();
+		this.localAllocationPolicyPlugin = new HashMap<String, String>();
+		this.outputDir = null;
+	}
+
+	
+	public void readConfigurationHostsDescriptionXMLFile(String fileName) throws FileNotFoundException {
+		FileReader reader = new FileReader(fileName);
+		HostParameters hostParameters = GSSimXML.unmarshal(HostParameters.class, reader);
+		xmlResourcesDescription = hostParameters.toString();
+		setUpFields(hostParameters);
+	}
+	
+	public void readConfigurationXMLFile(String fileName) throws FileNotFoundException, XMLLogicException, IllegalAccessException {
+		throw new RuntimeException("Not implemented.");
+	/*	
+		FileReader reader = new FileReader(fileName);
+		ResourcesConfiguration resConfig = GSSimXML.unmarshal(ResourcesConfiguration.class, reader);
+		ResourceConfigValidator resConfigvalidator = new ResourceConfigValidator(resConfig);
+		
+		if(!resConfigvalidator.validate())
+			return;
+		
+		ResourcesRandomNumbersFactory randNumFactory = new ResourcesRandomNumbersFactory();
+		randNumbers = randNumFactory.initRandomNumbers(resConfig);
+		
+		simulator.hostspec.SingleResource singleRes = resConfig.getSingleResource();
+		simulator.hostspec.QueueingSystem queueSystem = resConfig.getQueueingSystem();
+		
+		HostParameters hostParameters = new HostParameters();
+		
+		if(singleRes != null){
+			SingleResourceFactory resFactory = new SingleResourceFactory(singleRes, randNumbers);
+			hostParameters = resFactory.createResources(hostParameters);
+			forecastFinishTimePlugin.putAll(resFactory.getForecastFinishTimePlugin());
+			localAllocationPolicyPlugin.putAll(resFactory.getLocalAllocationPolicyPlugin());
+		}
+		
+		if(queueSystem != null) {
+			QueueingSystemFactory queueSysFactory = new QueueingSystemFactory(queueSystem, randNumbers);
+			hostParameters = queueSysFactory.createQueueingSystem(hostParameters);
+			forecastFinishTimePlugin.putAll(queueSysFactory.getForecastFinishTimePlugin());
+			localAllocationPolicyPlugin.putAll(queueSysFactory.getLocalAllocationPolicyPlugin());
+		}
+			
+		xmlResourcesDescription = hostParameters.toString();
+		setUpFields(hostParameters);
+		
+		if(outputDir != null)
+			writeConfiguration(hostParameters);
+			*/
+	}
+	
+	public MiloGridResource[] getCreatedResources() {
+		return miloGridResources;
+	}
+	
+	/**
+	 * Sets all the necessary data after reading the configuration
+	 * @param hostParam
+	 */
+	protected void setUpFields(HostParameters hostParam) {
+		int count = 0;
+		HostParametersWrapper hpWrapper = new HostParametersWrapperImpl();
+		hpWrapper.wrap(hostParam);
+		ResourceContainer<ComputingResource, QueuingSystem> hpItem = null;
+		
+		ComputingResource compRes[] = null;
+		try {
+			compRes = hpWrapper.getComputingResources();
+		} catch (UnknownParameter e) {
+			e.printStackTrace();
+		}
+		count = compRes.length;
+		resourcesDescriptions = new ResourceContainerImpl[count];
+		for(int i = 0; i < compRes.length; i++){
+			resourcesDescriptions[i] = new ResourceContainerImpl(compRes[i]);
+		}
+		
+		try {
+			if(hpWrapper.getQueueResources() != null){
+				if(log.isWarnEnabled())
+					log.warn("Queues are currently not supported.");
+			}
+		} catch (UnknownParameter e) {
+			e.printStackTrace();
+		}
+		miloGridResources = new MiloGridResource[count];
+		miloAllocPolicies = new MiloAllocPolicy[count];
+		miloResourceCharacteristics = new MiloResourceCharacteristics[count];
+	}
+	
+	public void createResources(ResourceCalendar resCalendar) throws Exception {
+		boolean reservationAvailable = false;
+		String forecastPlugin = "";
+		String allocationPlugin = "";
+		String name;
+		
+		ComputingResourceParameters crp = new ComputingResourceParamExplorerImpl();
+		
+		for (int i = 0; i < resourcesDescriptions.length; ++i) {
+			QueuingSystem queueingSystem = resourcesDescriptions[i].getQueueingSystem();
+			ComputingResource singleResource = resourcesDescriptions[i].getSingleResource();
+			
+			
+			Map<String, Object> resDesc = null;
+			String resManContact = null;
+			if ( queueingSystem != null) {
+				
+		/*		name = queueingSystem.getFrontendId();
+				if(forecastFinishTimePlugin.containsKey(name))
+					forecastPlugin = forecastFinishTimePlugin.get(name);
+				else
+					forecastPlugin = defaultForecastFinishTimePlugin;
+				if(localAllocationPolicyPlugin.containsKey(name))
+					allocationPlugin = localAllocationPolicyPlugin.get(name);
+				else
+					allocationPlugin = defaultLocalAllocationPolicyPlugin;
+				
+				reservationAvailable = true;
+				resManContact = queueingSystem.getFrontendId();
+				
+				
+				QueuesGroup[] queuesGroups = queueingSystem.getQueuesGroup();
+				for (int k = 0; k < queuesGroups.length; ++k) {
+					//assumption queuesGroups.length == 1
+					
+					QueuesGroup queuesGroup = queuesGroups[k];
+					for (int q = 0; q < queuesGroup.getQueueCount(); ++q) {
+						QueueResourcesCollective qrc = queuesGroup.getQueuesGroupChoice().getQueueResourcesCollective();
+						if (qrc != null) {
+							ClusterMachines clusterMachines = qrc.getClusterMachines();
+							resDesc = getClusterMachinesCharacteristics(clusterMachines);
+						} else {
+							QueueResource[] queueResource = queuesGroup.getQueuesGroupChoice().getQueueResource();
+
+							for (int qr = 0; qr < queueResource.length; ++i) {
+								QueueResource qRes = queueResource[qr];
+								Machine machine = qRes.getMachine();
+								resDesc = getMachineCharacteristics(machine);
+								break;
+							}
+						}
+						
+						if (resDesc != null) {
+							break;
+						}
+					}
+					if (resDesc != null) {
+						break;
+					}
+				}
+				*/
+			} else if (singleResource != null) {
+				
+				name = singleResource.getResourceId();
+				if(forecastFinishTimePlugin.containsKey(name))
+					forecastPlugin = forecastFinishTimePlugin.get(name);
+				else
+					forecastPlugin = defaultForecastFinishTimePlugin;
+				if(localAllocationPolicyPlugin.containsKey(name))
+					allocationPlugin = localAllocationPolicyPlugin.get(name);
+				else
+					allocationPlugin = defaultLocalAllocationPolicyPlugin;
+				
+				reservationAvailable = true;
+				resManContact = singleResource.getResourceId();
+				crp.explore(singleResource);
+				resDesc = getMachineCharacteristics(crp);
+			}	
+			
+			double timeZone = 0.0; // time zone this resource located
+
+			MiloResourceCharacteristics resConfig = new MiloResourceCharacteristics(resDesc, timeZone, new MiloARResReqManagerImpl(resDesc));
+
+			// NOTE: allocation policy in here is set to
+			// ResourceCharacteristics.ADVANCE_RESERVATION not SPACE_SHARED nor TIME_SHARED.
+			/*ResourceCharacteristics resConfig = new ResourceCharacteristics(arch,
+				 os, mList, ResourceCharacteristics.TIME_SHARED, time_zone, cost);*/
+
+			// 7. Finally, we need to create a GridResource object.
+	
+			MiloGridResource gridRes = null;
+
+			// use this AR scheduling algorithm. The name of this entity
+			// will be name_scheduler, e.g. Resource0_scheduler.
+			
+			MiloAllocPolicy policy;
+			//ARSimpleSpaceShared policy = new ARSimpleSpaceShared(name,scheduler);
+			
+			if(reservationAvailable){
+				// NOTE: You need to use a grid resource entity that supports
+				// advanced reservation functionalities.
+				policy = new LocalAllocARPolicyWraper(resManContact, GssConstants.DEFAULT_RESOURCE_MANAGER_NAME, allocationPlugin, forecastPlugin, resourcesDescriptions[i]);
+				gridRes = new GssARResource(resManContact, resConfig, resCalendar, (MiloARPolicy) policy, resourcesDescriptions[i]);
+				
+			} else {
+				policy = new LocalAllocPolicyWraper(resManContact, GssConstants.DEFAULT_RESOURCE_MANAGER_NAME, allocationPlugin, forecastPlugin, resourcesDescriptions[i]);
+				gridRes = new GssResource(resManContact, resConfig, resCalendar, policy, resourcesDescriptions[i]);
+			}
+
+			miloGridResources[i] = gridRes;
+			miloAllocPolicies[i] = policy;
+			miloResourceCharacteristics[i] = resConfig;
+		}
+	}
+	
+	/**
+	 * Creates a resource description map on the basis of given machine
+	 * @param machine the machine that is to be read
+	 * @return map of resource characteristics
+	 */
+	protected Map<String, Object> getMachineCharacteristics(ComputingResourceParameters machine) {
+		//Here are the steps needed to create a Grid resource:
+		// 1. We need to create an object of MachineList to store one or more
+		// Machines
+		//MachineList mList = new MachineList();
+		
+		//cpucount
+		double values[] = null;
+		try {
+			values = machine.getCpucount();
+		} catch (NoSuchParamException e) {
+			e.printStackTrace();
+		}
+		int cpucount = Double.valueOf(values[0]).intValue();
+		
+		// 2. A Machine contains one or more PEs or CPUs. Therefore, should
+		// create an object of PEList to store these PEs before creating
+		// a Machine.
+		List<MiloPE> peList = new ArrayList<MiloPE>(cpucount);
+		
+		//cpuspeed
+		int cpuspeed = 1;
+		try {
+			values = machine.getCpuspeed();
+			cpuspeed = Double.valueOf(values[0]).intValue();
+		} catch (NoSuchParamException e) {
+			if(log.isWarnEnabled())
+				log.warn("Resource cpu speed parameter is not defined, assuming that cpuspeed = 1");
+		}
+		
+		
+		// 3. Create PEs and add these into an object of PEList.
+		for (int cpuNumber = 0; cpuNumber < cpucount; ++cpuNumber) {				
+			peList.add(new MiloPE(cpuNumber, cpuspeed)); // need to store PE id and MIPS Rating
+		}	
+		
+		// 4. Create one Machine with its id and list of PEs or CPUs
+		//mList.add(new Machine(0, peList)); // First Machine
+		
+		// 5. Repeat the process from 2 if we want to create more Machines
+		// NOTE: if you only want to create one Machine for one Grid resource,
+		// then you could skip this step.
+		
+		//...
+		
+		// 6. Create a ResourceCharacteristics object that stores the
+		// properties of a Grid resource: architecture, OS, list of
+		// Machines, allocation policy: time- or space-shared, time zone
+		// and its price (G$/PE time unit).
+		
+		/* Data from the xml file **/
+		//osname
+		//String osName = machine.getOsName();
+		
+		//ostype
+		//String osType = machine.getOsType();
+		
+		//osversion
+		//String osVersion = machine.getOsVersion();
+		
+		//osrelease
+		//String osRelease = machine.getOsRelease();
+		
+		//memory
+		int totalMemory = 0;
+		try {
+			values = machine.getMemory();
+			totalMemory = Double.valueOf(values[0]).intValue();
+		} catch (NoSuchParamException e) {
+			if(log.isWarnEnabled())
+				log.warn("Resource memory parameter is not defined, assuming that totalMemory = 0");
+		}
+		
+		
+		//bandwidth
+		//Bandwidth bandwidth = resource.getBandwidth();			
+		//hostname
+		
+		//latency
+		//Latency latency = resource.getLatency();
+		//hostname
+		
+		//capacity
+		//Capacity capacity = resource.getCapacity();
+		//hostname
+		
+		//applications
+		//Applications applications = resource.getApplications();
+		
+		//freememory
+		//MemoryFree freeMemory = machine.getMemoryFree();
+		
+		//diskspace
+		//int totalDiskSpace = machine.getDiskTotal();
+		
+		//freediskspace
+		//DiskFree freeDiskSpace = machine.getDiskFree();
+		
+		//queue
+		//String queue = resource.getQueue();
+		
+		//freecpus
+		//int freecpus = resource.getFreecpus();
+		
+		double cost = GssConstants.DEFAULT_RESOURCE_PROCESSING_COST;//FIXME // the cost of using this resource
+		
+		Map<String, Object> resDesc = new HashMap<String, Object>();
+		resDesc.put(Constants.MEMORY, new Integer(totalMemory));
+		resDesc.put(Constants.PE, peList);
+		resDesc.put(Constants.COST_PER_SEC, new Double(cost));
+		return resDesc;
+	}
+
+	/**
+	 * Creates a resource description map on the basis of given cluster machines
+	 * @param clusterMachines the cluster machines that are to be read
+	 * @return map of resource characteristics
+	 */
+	protected Map<String, Object> getClusterMachinesCharacteristics(QueueResourceParamExplorer clusterMachines) {
+		//Here are the steps needed to create a Grid resource:
+		// 1. We need to create an object of MachineList to store one or more
+		// Machines
+		//MachineList mList = new MachineList();
+/*
+		//cpucount
+		double values[] = null;
+		
+		int cpucount = clusterMachines.getTotalCpus();
+		clusterMachines.get
+		// 2. A Machine contains one or more PEs or CPUs. Therefore, should
+		// create an object of PEList to store these PEs before creating
+		// a Machine.
+		List<MiloPE> peList = new ArrayList<MiloPE>(cpucount);
+		
+		//cpuspeed
+		int cpuspeed = clusterMachines.getNodeCpuSpeed();
+		
+		// 3. Create PEs and add these into an object of PEList.
+		for (int cpuNumber = 0; cpuNumber < cpucount; ++cpuNumber) {				
+			peList.add(new MiloPE(cpuNumber, cpuspeed)); // need to store PE id and MIPS Rating
+		}	
+		
+		//memory
+		int totalMemory = clusterMachines.getMaxFreeMemory();
+		
+		double cost = GssConstants.DEFAULT_RESOURCE_PROCESSING_COST;//FIXME // the cost of using this resource
+		
+		Map<String, Object> resDesc = new HashMap<String, Object>();
+		resDesc.put(Constants.MEMORY, new Integer(totalMemory));
+		resDesc.put(Constants.PE, peList);
+		resDesc.put(Constants.COST_PER_SEC, new Double(cost));
+		return resDesc;
+		*/
+		return null;
+	}
+	
+
+	
+	/**
+	 * Reads plugins configuration from text file.
+	 * File format is:
+	 * 
+	 * ForecastFinishTimePluginName 
+	 * resource_name_1=ForecastFinishTimePluginName_ClassName_1
+	 * resource_name_2=ForecastFinishTimePluginName_ClassName_2
+	 * 
+	 * LocalAllocationPolicyPluginName 
+	 * resource_name_1=LocalAllocationPolicyPluginName_ClassName_1
+	 * resource_name_2=LocalAllocationPolicyPluginName_ClassName_2
+	 */
+	public boolean loadPlugins(String fileName) throws IOException{
+		File file = new File(fileName);
+		if(!file.exists())
+			throw new FileNotFoundException("No such file: "+fileName);
+		
+		Reader r = new FileReader(file);
+		BufferedReader reader = new BufferedReader(r);
+		String line = null;
+		String tab[] = null;
+		int s = 0;
+		
+		while((line = reader.readLine()) != null) {
+			line = line.trim();
+			
+			if(line.startsWith("#")) {
+				continue;
+			} else if("ForecastFinishTimePluginName".equals(line)){
+				s = 1;
+			} else if("LocalAllocationPolicyPluginName".equals(line)){
+				s = 2;
+			} else {
+				tab = line.split("=");
+				if(tab == null || tab.length != 2) continue;
+				
+				switch(s) {
+					case 1: forecastFinishTimePlugin.put(tab[0], tab[1]); 
+						break;
+					case 2: localAllocationPolicyPlugin.put(tab[0], tab[1]);
+						break;
+				}
+			}
+		}
+		
+		return true;
+	}
+	
+	public void setOutputDirectory(String directoryName, boolean overwrite) throws FileNotFoundException{
+		File file = new File(directoryName);
+
+		if(file.exists()) {
+			if(overwrite){
+				file.delete();
+				file.mkdirs();
+			} else {
+				throw new FileNotFoundException("Directory "+directoryName+" already exists.");
+			}
+		} else {
+			file.mkdirs();
+		}
+		
+		outputDir = file;
+
+	}
+	
+	protected void writeConfiguration(HostParameters hostParameters){
+		File file = null;
+		Writer writer = null;
+		try {
+			
+			
+			file = new File(outputDir, "ResourceDescription.xml");
+			writer = new FileWriter(file);
+			if (! GSSimXML.marshal(hostParameters, writer))
+				if(log.isErrorEnabled())
+					log.error("Error in marshalling");
+			
+			writer.close();
+			
+			file = new File(outputDir, "plugins.txt");
+			writer = new FileWriter(file);
+			
+			writer.write("# file with plugins configuration\n");
+			writer.write("# file format:\n");
+			writer.write("# two sections - ForecastFinishTimePluginName and LocalAllocationPolicyPluginName\n"); 
+			writer.write("# each esction consists of resource name and plugin name for this particular resource\n");
+			writer.write("# eg. example_resource_1=pl.psnc.simulator.forecastTimePlugin\n");
+			
+			writer.write("\n");
+			writer.write("LocalAllocationPolicyPluginName\n");
+			Set<String> set = localAllocationPolicyPlugin.keySet();
+			Iterator<String> it = set.iterator();
+			String key;
+			while(it.hasNext()){
+				key = it.next();
+				writer.write(key + "=" +localAllocationPolicyPlugin.get(key)+"\n");
+			}
+			
+			writer.write("\n");
+			writer.write("ForecastFinishTimePluginName\n");
+			set = forecastFinishTimePlugin.keySet();
+			it =  set.iterator();
+			while(it.hasNext()){
+				key = it.next();
+				writer.write(key + "=" +forecastFinishTimePlugin.get(key)+"\n");
+			}
+			writer.close();
+			
+		} catch (IOException e) {
+			e.printStackTrace();
+		} finally {
+			if(writer != null)
+				try {
+					writer.close();
+				} catch (IOException e) {
+					e.printStackTrace();
+				}
+		}
+
+	}
+	
+}
Index: DCWoRMS/trunk/src/simulator/workload/generator/impl/AbstractJobGenerator.java
===================================================================
--- DCWoRMS/trunk/src/simulator/workload/generator/impl/AbstractJobGenerator.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/workload/generator/impl/AbstractJobGenerator.java	(revision 477)
@@ -0,0 +1,229 @@
+package simulator.workload.generator.impl;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.util.Date;
+import java.util.Random;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.exolab.castor.types.Duration;
+import simulator.RandomNumbers;
+import simulator.factory.JobRandomNubersFactory;
+import simulator.workload.fileFilters.QcgJobFileNameFilter;
+import simulator.workload.fileFilters.SWFFileNameFilter;
+import simulator.workload.generator.RandomNumbersWrapper;
+import simulator.workload.generator.configuration.JobCount;
+import simulator.workload.generator.configuration.MultiDistribution;
+import simulator.workload.generator.configuration.RandParams;
+import simulator.workload.generator.configuration.RandParamsSequence;
+import simulator.workload.generator.configuration.WorkloadConfiguration;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+
+public abstract class AbstractJobGenerator {
+
+	private Log log = LogFactory.getLog(AbstractJobGenerator.class);
+
+	/**the description of the tasks that are to be generated*/
+	protected WorkloadConfiguration workload;
+	
+	/**the number of tasks generated - one of the proceed conditions*/
+	protected int generatedJobCount;
+	protected int generatedTaskCount;
+	protected int taskCountToBeGenerated;
+	
+	/**number of jobs to be generated*/
+	protected int jobCountToBeGenerated;
+	
+	/**the virtual (logical) time of the simulation - one of the proceed conditions*/ 
+	protected long simulationVirtualTime;
+	
+	protected JobCount jobCount;
+	protected Duration simulationDuration;
+	protected Date simulationEndTime;
+
+	/**a random number generator objects*/
+	//the values set in this "random numbers" are not copied to the TaskGridlet object
+	protected RandomNumbers parameterRandomNumbers; 
+	protected RandomNumbers hardConstraintsRandomNumbers;
+	protected RandomNumbers softConstraintsRandomNumbers;
+	protected RandomNumbers timeConstraintsRandomNumbers;
+	protected RandomNumbers precedingConstraintsRandomNumbers;
+	protected RandomNumbersWrapper randomNumbersWrapper;
+	
+	protected Random detailDistIntervalChooser;
+	
+	protected JobRandomNubersFactory randomNumbersFactory;
+	
+
+	/**
+	 * 
+	 */
+	public AbstractJobGenerator(){
+		generatedJobCount = 0;
+		generatedTaskCount = 0;
+		taskCountToBeGenerated = 0;
+		randomNumbersWrapper = new RandomNumbersWrapper();
+		detailDistIntervalChooser = new Random(System.currentTimeMillis());
+	}
+	
+	/**
+	 * 
+	 * @param outputDirectoryName
+	 * @param overwriteExistingFiles
+	 * @return
+	 * @throws FileNotFoundException
+	 * @throws IOException
+	 */
+	protected File prepareWorkloadDirectory(String outputDirectoryName, boolean overwriteExistingFiles) 
+	throws FileNotFoundException, IOException{
+		File outputDirectory = new File (outputDirectoryName);
+		
+		if (!outputDirectory.exists()) {
+			if(!outputDirectory.mkdir()){
+				throw new FileNotFoundException("Output directory "+outputDirectoryName+" does not exist and can not be created.");
+			}
+		}
+		
+		if (!outputDirectory.isDirectory()) {
+			throw new IOException("Output directory "+outputDirectoryName+" is not a directory");
+		}
+		
+		if (outputDirectory.list().length > 0) {//the directory is not empty
+			if (!overwriteExistingFiles)
+				throw new IOException("The outputdirectory "+ outputDirectoryName +" is not empty.");
+			
+			File[] files = null;
+			
+			files = outputDirectory.listFiles(new QcgJobFileNameFilter());
+			for (int i = 0; i < files.length; i++) {
+				File file = files[i];					
+				if(!file.delete()){
+					if(log.isErrorEnabled())
+						log.error("File "+file.getPath() + " can not be deleted.");
+				}
+			}
+			
+			files = outputDirectory.listFiles(new SWFFileNameFilter());
+			for (int i = 0; i < files.length; i++) {
+				File file = files[i];					
+				if(!file.delete()){
+					if(log.isErrorEnabled())
+						log.error("File "+file.getPath() + " can not be deleted.");
+				}
+			}
+			
+		}
+		
+		return outputDirectory;
+	}
+	
+
+	/**
+	 * Initializes the randomNumbers field with appropriate random number generators. 
+	 * @param workload 
+	 */
+	protected void init(WorkloadConfiguration workload) {
+		
+		randomNumbersFactory = new JobRandomNubersFactory();
+		
+		
+		parameterRandomNumbers = 
+					randomNumbersFactory.initParameterRandomNumbers(workload);
+		randomNumbersWrapper.setParameterRandomNumbers(parameterRandomNumbers);
+
+		/*
+		 * Setting the hard constraints values
+		 */		
+
+		hardConstraintsRandomNumbers = 
+					randomNumbersFactory.initHardConstraintsRandomNumbers(workload);
+		randomNumbersWrapper.setHardConstraintsRandomNumbers(hardConstraintsRandomNumbers);
+		/*
+		 * Setting the soft constraints values
+		 */
+		softConstraintsRandomNumbers = 
+					randomNumbersFactory.initSoftConstraintsRandomNumbers(workload);
+		randomNumbersWrapper.setSoftConstraintsRandomNumbers(softConstraintsRandomNumbers);
+		/*
+		 * Setting time constraints values
+		 */
+		timeConstraintsRandomNumbers = 
+					randomNumbersFactory.initTimeConstraintsRandomNumbers(workload);
+		randomNumbersWrapper.setTimeConstraintsRandomNumbers(timeConstraintsRandomNumbers);
+		/*
+		 * Setting preceding constraints values
+		 */
+		precedingConstraintsRandomNumbers = 
+					randomNumbersFactory.initPrecedingConstraintsRandomNumbers(workload);
+		randomNumbersWrapper.setPrecedingConstraintsRandomNumbers(precedingConstraintsRandomNumbers);
+	}
+	
+	
+	/**
+	 * 
+	 * @return true if this entity should continue execution, false, if 
+	 * this entity should stop
+	 */
+	protected boolean proceedConditionsAreFulfilled() {
+		if (jobCount != null) {
+			if (jobCountToBeGenerated < generatedJobCount) {
+				return false; //cannot continue
+			} 
+				
+			return true; //can continue
+
+		} else if (simulationDuration != null) {
+			if (simulationVirtualTime >= simulationEndTime.getTime() /* simulationDuration.toLong()*/) {
+				return false; //cannot continue
+			} 
+			return true; //can continue
+			
+		} else { //if specification changes, one may add new conditions here
+			return false; 
+		}
+	}
+	
+	protected double getRandomValueFor(RandParams randParams, RandomNumbers randNumbers) throws IllegalAccessException{
+		return getRandomValueFor(randParams, JobRandomNubersFactory.getGeneratorName(randParams), randNumbers);
+	}
+	
+	private double getRandomValueFor(RandParams randParams, String name, RandomNumbers randNumbers) throws IllegalAccessException{
+		MultiDistribution md = null;
+		RandParamsSequence rps = null;
+		
+		if(randParams == null)
+			throw new IllegalAccessException("Specify RandParams object.");
+		if(randNumbers == null)
+			throw new IllegalAccessException("Specify random numbers map.");
+		
+		if(randParams.getRefElementId() != null){
+			return randomNumbersWrapper.evalValueFor(randParams.getId(), randParams.getRefElementId());
+		}
+		
+		md = randParams.getMultiDistribution();
+		rps = randParams.getRandParamsSequence();
+		if(md == null && rps == null){
+			return randNumbers.getRandomValue(name);
+		}
+		
+		if(md != null && rps == null){
+			return randNumbers.getRandomValue(name, detailDistIntervalChooser.nextDouble());
+		}
+		
+		if(md == null && rps != null){
+			//return randNumbers.getRandomValue(name, workload.getSimulationStartTime().getTime() + (simulationVirtualTime*1000));
+			return randNumbers.getRandomValue(name, simulationVirtualTime);
+		}
+		
+		throw new IllegalAccessException("Use direct generator description, " +
+				"reference to another element, multidistribution or periodic valid values for element "+name);
+	}
+	
+}
Index: DCWoRMS/trunk/src/simulator/workload/generator/validators/XMLValidator.java
===================================================================
--- DCWoRMS/trunk/src/simulator/workload/generator/validators/XMLValidator.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/workload/generator/validators/XMLValidator.java	(revision 477)
@@ -0,0 +1,12 @@
+package simulator.readers.validators;
+
+import simulator.workload.exceptons.XMLLogicException;
+
+public abstract class XMLValidator {
+
+	protected XMLValidator(){
+		
+	}
+	
+	public abstract boolean validate() throws XMLLogicException;
+}
Index: DCWoRMS/trunk/src/simulator/workload/generator/validators/ResourceConfigValidator.java
===================================================================
--- DCWoRMS/trunk/src/simulator/workload/generator/validators/ResourceConfigValidator.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/workload/generator/validators/ResourceConfigValidator.java	(revision 477)
@@ -0,0 +1,97 @@
+package simulator.readers.validators;
+
+import simulator.hostspec.ForecastFinishTimePluginName;
+import simulator.hostspec.LocalAllocationPolicyPluginName;
+import simulator.hostspec.Plugins;
+import simulator.hostspec.QueueingSystem;
+import simulator.hostspec.ResourcesConfiguration;
+import simulator.hostspec.SingleResource;
+import simulator.workload.exceptons.XMLLogicException;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+
+public class ResourceConfigValidator extends XMLValidator{
+
+	private ResourcesConfiguration resConfig;
+	
+	public ResourceConfigValidator(ResourcesConfiguration resConfig){
+		this.resConfig = resConfig;
+	}
+	
+	public boolean validate() throws XMLLogicException {
+		SingleResource singleRes = resConfig.getSingleResource();
+		QueueingSystem queueSys = resConfig.getQueueingSystem();
+		
+		boolean ret1 = false;
+		boolean ret2 = false;
+		
+		ret1 = validateSingleResource(singleRes);
+		ret2 = validateQueueingSystem(queueSys);
+		
+		return ret1 && ret2;
+		
+	}
+	
+	protected boolean validateQueueingSystem(QueueingSystem queueSys) throws XMLLogicException{
+		if(queueSys == null)
+			return true;
+		
+		int resCount = queueSys.getTotalResourceCount();
+		int arResCount = queueSys.getARResourceCount();
+		
+		if(arResCount > resCount)
+			throw new XMLLogicException("ARResourceCount should be less or equal to TotalResourceCount.");
+		
+		Plugins plugins = queueSys.getPlugins();
+		checkPlugins(plugins, resCount);
+		
+		return true;
+	}
+	
+	protected boolean validateSingleResource(SingleResource singleRes) throws XMLLogicException{
+		if(singleRes == null)
+			return true;
+			
+		int resCount = singleRes.getTotalResourceCount();
+		int arResCount = singleRes.getARResourceCount();
+		
+		if(arResCount > resCount)
+			throw new XMLLogicException("ARResourceCount should be less or equal to TotalResourceCount.");
+		
+		Plugins plugins = singleRes.getPlugins();
+		checkPlugins(plugins, resCount);
+		
+		return true;
+	}
+	
+	protected boolean checkPlugins(Plugins plugins, int resCount) throws XMLLogicException{
+		
+		ForecastFinishTimePluginName timePluginName[]  = plugins.getForecastFinishTimePluginName();
+		LocalAllocationPolicyPluginName allocationPluginName[] = plugins.getLocalAllocationPolicyPluginName();
+		if(timePluginName == null)
+			throw new XMLLogicException("ForecastFinishTimePluginName element is compulsory.");
+		if(allocationPluginName == null)
+			throw new XMLLogicException("LocalAllocationPolicyPluginName element is compulsory.");
+		
+		int pluginResCount = 0;
+		for(int i = 0; i < timePluginName.length; i++){
+			pluginResCount += timePluginName[i].getResourcesCountWithThisPlugin();
+		}
+		if(pluginResCount != resCount)
+			throw new XMLLogicException("Define ForecastFinishTimePluginName for all resources.");
+
+		pluginResCount = 0;
+		for(int i = 0; i < allocationPluginName.length; i++){
+			pluginResCount += allocationPluginName[i].getResourcesCountWithThisPlugin();
+		}
+		if(pluginResCount != resCount)
+			throw new XMLLogicException("Define LocalAllocationPolicyPluginName for all resources.");
+
+		return true;
+	}
+
+}
Index: DCWoRMS/trunk/src/simulator/workload/exceptons/NoSuchCommentException.java
===================================================================
--- DCWoRMS/trunk/src/simulator/workload/exceptons/NoSuchCommentException.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/workload/exceptons/NoSuchCommentException.java	(revision 477)
@@ -0,0 +1,14 @@
+package simulator.workload.exceptons;
+
+public class NoSuchCommentException extends Exception{
+	
+	private static final long serialVersionUID = -1257647143189079034L;
+
+	public NoSuchCommentException(){
+		super();
+	}
+
+	public NoSuchCommentException(String message) {
+		super(message);
+	}
+}
Index: DCWoRMS/trunk/src/simulator/workload/exceptons/NoSuchFieldException.java
===================================================================
--- DCWoRMS/trunk/src/simulator/workload/exceptons/NoSuchFieldException.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/workload/exceptons/NoSuchFieldException.java	(revision 477)
@@ -0,0 +1,5 @@
+package simulator.workload.exceptons;
+
+public class NoSuchFieldException {
+
+}
Index: DCWoRMS/trunk/src/simulator/workload/exceptons/XMLLogicException.java
===================================================================
--- DCWoRMS/trunk/src/simulator/workload/exceptons/XMLLogicException.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/workload/exceptons/XMLLogicException.java	(revision 477)
@@ -0,0 +1,14 @@
+package simulator.workload.exceptons;
+
+public class XMLLogicException extends Exception {
+	
+	private static final long serialVersionUID = 1238471681577925949L;
+
+	public XMLLogicException(){
+		super();
+	}
+
+	public XMLLogicException(String arg){
+		super(arg);
+	}
+}
Index: DCWoRMS/trunk/src/simulator/workload/fileFilters/QcgJobFileNameFilter.java
===================================================================
--- DCWoRMS/trunk/src/simulator/workload/fileFilters/QcgJobFileNameFilter.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/workload/fileFilters/QcgJobFileNameFilter.java	(revision 477)
@@ -0,0 +1,24 @@
+package simulator.workload.fileFilters;
+
+import java.io.File;
+import java.io.FilenameFilter;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+
+public class QcgJobFileNameFilter implements FilenameFilter{
+
+	public static final String FILE_NAME_PREFIX = "QcgJob";
+	
+	public QcgJobFileNameFilter(){};
+	
+	public boolean accept(File dir, String name) {
+			if(name.startsWith(FILE_NAME_PREFIX) && name.endsWith("xml"))
+				return true;
+			else
+				return false;
+	}
+}
Index: DCWoRMS/trunk/src/simulator/workload/fileFilters/SWFFileNameFilter.java
===================================================================
--- DCWoRMS/trunk/src/simulator/workload/fileFilters/SWFFileNameFilter.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/workload/fileFilters/SWFFileNameFilter.java	(revision 477)
@@ -0,0 +1,20 @@
+package simulator.workload.fileFilters;
+
+import java.io.File;
+import java.io.FilenameFilter;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+public class SWFFileNameFilter implements FilenameFilter{
+	
+	public boolean accept(File dir, String name) {
+		if(name.endsWith("swf"))
+			return true;
+		else
+			return false;
+	}
+
+}
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 477)
@@ -0,0 +1,244 @@
+package simulator.workload;
+
+import org.qcg.broker.schemas.jobdesc.QcgJob;
+import gssim.schedframe.scheduling.utils.JobDescription;
+import gssim.schedframe.scheduling.utils.TaskDescription;
+
+import java.io.IOException;
+import java.text.DateFormat;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.TreeMap;
+
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.xpath.XPathExpressionException;
+
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.exolab.castor.xml.MarshalException;
+import org.exolab.castor.xml.ValidationException;
+
+
+import simulator.utils.XsltTransformations;
+import simulator.workload.exceptons.NoSuchCommentException;
+import simulator.workload.reader.archive.AbstractWAParser;
+import simulator.workload.reader.archive.WAFields;
+import simulator.workload.reader.archive.WAReader;
+import simulator.workload.reader.archive.WAParser;
+import simulator.workload.reader.archive.gwf.GWFFields;
+import simulator.workload.reader.archive.swf.SWFFields;
+import simulator.workload.reader.xmlJob.XMLJobReader;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+public class WorkloadLoader {
+	
+	private static Log log = LogFactory.getLog(WorkloadLoader.class);
+	
+	protected XMLJobReader<QcgJob> xmlJobReader;
+	protected WAReader<QcgJob> waReader;
+	protected WAParser localWAParser;
+	protected int generatedJobsCnt;
+	protected int generatedTasksCnt;
+	
+	protected Date simulationStartTime;
+	
+	protected XsltTransformations xsltTransformation = null;
+	
+	protected Map<String, JobDescription> jobGridletsMap;
+	
+	public WorkloadLoader(XMLJobReader<QcgJob> xmlReader, WAReader<QcgJob> swfReader){
+		if(swfReader == null){
+			throw new RuntimeException("Swf reader is required to build proper gridlerts.");
+		}
+		this.xmlJobReader = xmlReader;
+		this.waReader = swfReader;
+		this.generatedJobsCnt = 0;
+		this.generatedTasksCnt = 0;
+		this.jobGridletsMap = new TreeMap<String, JobDescription>();
+		try {
+			this.xsltTransformation = new XsltTransformations();
+		} catch (XPathExpressionException e) {
+			e.printStackTrace();
+		} catch (ParserConfigurationException e) {
+			e.printStackTrace();
+		}
+	}
+	
+	protected JobDescription createJobDescription(String jobDesc, long puSpeed) throws IOException{
+		
+		JobDescription jobDescription = null;
+		try {
+			jobDescription = this.xsltTransformation.splitJobToTasks(jobDesc);
+		} catch (Exception e) {
+			throw new IOException(e.getMessage());
+		}
+		
+		// look for any 
+		
+		if(jobDescription.size() == 0){
+			if(log.isWarnEnabled())
+				log.warn("Omiting job gridlet creation for job "+jobDescription.getDescription().getAppId()+". This job contains no tasks.");
+			return null;
+		}
+		
+		// needed for Gridlet class
+		
+		String jobId = jobDescription.getJobId();
+		int parserType = localWAParser.getType();
+		
+		for(int i = 0; i < jobDescription.size(); i++){
+			TaskDescription taskDesc = jobDescription.get(i);
+			
+			String waTaskDesc[] = localWAParser.readTask(jobId, taskDesc.getTaskId());
+			if(waTaskDesc != null) {
+				
+				if(parserType == 0){
+				
+					taskDesc.setUserDn(waTaskDesc[SWFFields.DATA_USER_ID]);
+					
+					long timeValue = Long.parseLong(waTaskDesc[SWFFields.DATA_SUBMIT_TIME]);
+					taskDesc.setSubmissionTime(timeValue);
+					
+					long waitTime = Long.parseLong(waTaskDesc[GWFFields.DATA_WAIT_TIME]);
+					taskDesc.setWorkloadLogWaitTime(waitTime);
+					
+					timeValue = Long.parseLong(waTaskDesc[SWFFields.DATA_RUN_TIME]);
+					if(timeValue <= 0)
+						return null;
+					
+					long allocProcesors = Long.parseLong(waTaskDesc[SWFFields.DATA_NUMBER_OF_ALLOCATED_PROCESSORS]);
+					if(allocProcesors <= 0)
+						return null;
+					
+					timeValue = timeValue * puSpeed * allocProcesors;
+					taskDesc.setTaskLength(timeValue);
+
+				} else if(parserType == 1){
+				
+					taskDesc.setUserDn(waTaskDesc[GWFFields.DATA_USER_ID]);
+					
+					long timeValue = Long.parseLong(waTaskDesc[GWFFields.DATA_SUBMIT_TIME]);
+					taskDesc.setSubmissionTime(timeValue);
+					
+					long waitTime = Long.parseLong(waTaskDesc[GWFFields.DATA_WAIT_TIME]);
+					taskDesc.setWorkloadLogWaitTime(waitTime);
+					
+					timeValue = Long.parseLong(waTaskDesc[GWFFields.DATA_RUN_TIME]);
+					if(timeValue <= 0)
+						return null;
+					
+					long allocProcesors = Long.parseLong(waTaskDesc[GWFFields.DATA_NPROCS]);
+					if(allocProcesors <= 0)
+						return null;
+					
+					timeValue = timeValue * puSpeed * allocProcesors;
+					taskDesc.setTaskLength(timeValue);
+				}
+			}
+			
+			this.generatedTasksCnt++;
+		}
+		
+		this.generatedJobsCnt++;
+		
+		return jobDescription;
+	}
+	
+	
+	public boolean load() throws IOException, MarshalException, ValidationException{
+		
+		// prepare local swf parser
+		this.localWAParser = AbstractWAParser.getInstance(this.waReader.getParser().getFileName());
+		this.localWAParser.loadHeader();
+
+		long puSpeed = getPUSpeed();
+		this.simulationStartTime = getSimulationStartTimeValue();
+		
+		this.localWAParser.reset();
+
+
+		// determine which reader should be used
+		String jobDesc = null;
+		JobDescription job = null;
+			
+		if(this.xmlJobReader != null){ // use xml job reader. Xml job require xslt transformation
+			while((jobDesc = this.xmlJobReader.readRaw()) != null){
+				jobDesc = this.xsltTransformation.extendJobDescription(jobDesc);
+				job = createJobDescription(jobDesc, puSpeed);
+				if(job != null)
+					this.jobGridletsMap.put(job.getJobId(), job);
+			}
+		} else {						// use swf job reader. Job created by this reader does not require xslt transformation
+			while((jobDesc = this.waReader.readRaw()) != null){
+				job = createJobDescription(jobDesc, puSpeed);
+				if(job != null)
+					this.jobGridletsMap.put(job.getJobId(), job);
+			}
+		}
+
+		this.localWAParser.close();
+		if(this.xmlJobReader != null)
+			this.xmlJobReader.close();
+		
+		return true;
+	}
+	
+	protected long getPUSpeed(){
+		long puSpeed = 1;
+		try {
+			puSpeed = Long.parseLong(this.localWAParser.getCommentValue(WAFields.COMMENT_PUSPEED));
+		} catch (NoSuchCommentException e1) {
+			if(log.isWarnEnabled())
+				log.warn("Assuming default processing unit speed = 1");
+		}
+		return puSpeed;
+	}
+	
+	
+	protected Date getSimulationStartTimeValue(){
+		Date simulationStartTime = null;
+		try {
+			
+			DateFormat df = new SimpleDateFormat("EEE MMM dd HH:mm:ss ZZZZ yyyy", Locale.ENGLISH);
+			simulationStartTime = df.parse(this.localWAParser.getCommentValue(WAFields.COMMENT_STARTTIME));
+		} catch (NoSuchCommentException e){
+			simulationStartTime = new Date(0);
+			if(log.isWarnEnabled())
+				log.warn("Assuming default simulation start time - "+simulationStartTime);
+		} catch (ParseException e) {
+			simulationStartTime = new Date(0);
+			if(log.isWarnEnabled())
+				log.warn("Wrong format of simulation start time comment.\nAssuming default simulation start time - "+simulationStartTime);
+		}
+		return simulationStartTime;
+	}
+	
+	public int getJobCount(){
+		return generatedJobsCnt;
+	}
+	
+	public int getTaskCount(){
+		return generatedTasksCnt;
+	}
+	
+	public Date getSimulationStartTime(){
+		return this.simulationStartTime;
+	}
+	
+	public List<JobDescription> getJobs(){
+		ArrayList<JobDescription> list = 
+			new ArrayList<JobDescription>(this.jobGridletsMap.values());
+		return list;
+	}
+	
+}
Index: DCWoRMS/trunk/src/simulator/ConfigurationOptions.java
===================================================================
--- DCWoRMS/trunk/src/simulator/ConfigurationOptions.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/ConfigurationOptions.java	(revision 477)
@@ -0,0 +1,509 @@
+package simulator;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.util.MissingResourceException;
+import java.util.PropertyResourceBundle;
+import java.util.ResourceBundle;
+import java.util.logging.FileHandler;
+
+/**
+ * This aim of this class is to store all the configuration options passed to
+ * the program to steer its functionality. <br>
+ * As a general contract of this class, all fields, that store a path name to a
+ * folder will always be terminated with {@link File#separator} string.
+ * 
+ * @author Stanislaw Szczepanowski
+ * 
+ */
+public class ConfigurationOptions {
+
+	/*
+	 * =============================================================================================
+	 * Constants describing the contents of the resource bundle file
+	 * =============================================================================================
+	 */
+
+	/** The path to the resource description file */
+	public static final String RESOURCE_DESC_MODIFIER = "resdesc";
+
+	/** The create scenario mode of the simulation */
+	public static final String CREATE_SCENARIO_MODIFIER = "createscenario";
+	/** The path to the file with the tasks description */
+	public static final String CREATE_SCENARIO_TASK_DESC = CREATE_SCENARIO_MODIFIER
+			+ ".tasksdesc";
+	/** The path to the output folder for generated tasks */
+	public static final String CREATE_SCENARIO_OUTPUT_FOLDER = CREATE_SCENARIO_MODIFIER
+			+ ".outputfolder";
+	/** The name of the workload file */
+	public static final String CREATE_SCENARIO_WORKLOAD_FILE = CREATE_SCENARIO_MODIFIER
+			+ ".workloadfilename";
+	/**
+	 * Shall the files in the output directory be overwritten, if the folder is
+	 * not empty
+	 */
+	public static final String CREATE_SCENARIO_OVERWRITE_FILES_MODIFIER = CREATE_SCENARIO_MODIFIER
+			+ ".overwrite_files";
+
+	/** The read scenario mode of the simulation */
+	public static final String READ_SCENARIO_MODIFIER = "readscenario";
+	/** The input folder with generated tasks */
+	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 */
+	public static final String READ_SCENARIO_WORKLOAD_FILE = READ_SCENARIO_MODIFIER
+			+ ".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_GANTT = CREATEDIAGRAMS +".gantt";
+	public static final String CREATEDIAGRAMS_UTILIZATION = CREATEDIAGRAMS + ".utilization";
+	public static final String CREATEDIAGRAMS_ENERGYUSAGE = CREATEDIAGRAMS + ".energyusage";
+	public static final String CREATEDIAGRAMS_RESOURCES_SCALE = CREATEDIAGRAMS_UTILIZATION + ".scale";
+	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";
+	public static final String FORMAT_STATISTICS_OUTPUT = CREATESTATISTICS + ".formatoutput";
+	
+	/**
+	 * The main output folders base name
+	 */
+	public static final String STATS_OUTPUT_SUBFOLDER_NAME = "stats.outputfolder";
+	
+	public static final String USER_DN = "user.dn";
+	public static final String EXPERIMENT_ID = "experiment.id";
+	
+	public static final String NUMBER_OF_SIMULATIONS = "numberofsimulations";
+	
+	/**
+	 * Suffix for create scenario output folder
+	 */
+	public String statsOutputSubfolderNameCreate = null;
+	
+	/**
+	 * Suffix for read scenario output folder
+	 */
+	public String statsOutputSubfolderNameRerad = null;
+	
+	/* =============================================================================================== */
+	
+	public String providerListFile = null;
+
+
+	/**
+	 * the xml file name with resource description (according to the
+	 * HostParamSchema.xsd), e.g. simulator/schemas/ResourceDescription.xml
+	 */
+	public String resdescFileName = null;
+
+	/**
+	 * a xml file name (according to the simulator.schemas.WorkloadSchema.xsd)
+	 * with the description of jobs and tasks to be generated
+	 */
+	public String workloadDescFileName = null;
+
+	/**
+	 * the path to the folder, to which the generated xml job descriptions are
+	 * to be stored
+	 */
+	public String outputFolder = null;
+
+	/**
+	 * the name of the .swf simulator.workload file into which the
+	 * simulator.workload is to be written (it will be stored in the
+	 * outputFolder folder)
+	 */
+	public String outputWorkloadFileName = DEFAULT_WORKLOAD_FILE_NAME;
+
+	/**
+	 * the path to the folder where previously generated xml jobs descriptions
+	 * are stored
+	 */
+	public String inputFolder = null;
+	
+	public String inputTar = null;
+
+	/**
+	 * the name of the .swf simulator.workload file in the inputFolder folder
+	 */
+	public String inputWorkloadFileName = DEFAULT_WORKLOAD_FILE_NAME;
+
+	/**
+	 * a txt file name with topology description
+	 */
+	public String networkTopologyFileName = null;
+	
+	/**
+	 * Shows the mode of the simulator: true if it is the create scenario, false
+	 * if it is the read scenario mode
+	 */
+	public boolean createScenario = false;
+	
+	public boolean createXMLSupplement = false;
+
+	/**
+	 * true if the outputFolder is not empty and shall be overwritten, false
+	 * otherwise
+	 */
+	public boolean overwriteFiles = false;
+
+	/**
+	 * true if the history files are to be generated (makes the simulation
+	 * slower)
+	 */
+	public boolean printHistory = false;
+	
+	/**
+	 * The number of simulation runs that is to be performed. Default value is <code>1</code>.
+	 */
+	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 createjobsstatistics = true;
+	public boolean createsimulationstatistics = true;
+	public boolean formatstatisticsoutput = false;
+	
+	public static final String ENV_DESC_MODIFIER = "envdesc";
+	public String envDescFileName = null;
+	/**
+	 * An empty constructor.
+	 */
+	protected ConfigurationOptions() {
+	}
+
+	/**
+	 * A static method used to read a resource bundle file and set all the
+	 * fields in this class according to the contents of the file
+	 * 
+	 * @param resBundleFileName
+	 *            the path to the resource bundle file that stores the
+	 *            configuration
+	 * @return a ConfigurationOptions object with information set according to
+	 *         the properties file, <code>null</code> if any exception occurs
+	 */
+	public static ConfigurationOptions getConfiguration(String resBundleFileName) {
+
+		ConfigurationOptions co = new ConfigurationOptions();
+		File resBundleFile = new File(resBundleFileName);
+		ResourceBundle bundle = null;
+		try {
+			bundle = new PropertyResourceBundle(new FileInputStream(resBundleFile));
+		} catch (FileNotFoundException e) {
+			e.printStackTrace();
+			return null;
+		} catch (IOException e) {
+			e.printStackTrace();
+			return null;
+		}
+		
+		co.resdescFileName = bundle.getString(RESOURCE_DESC_MODIFIER);
+		
+		try {
+			co.envDescFileName = bundle.getString(ENV_DESC_MODIFIER);
+		} catch(MissingResourceException e){
+			co.envDescFileName = null;
+		}
+		
+		try {
+			co.workloadDescFileName = bundle.getString(CREATE_SCENARIO_TASK_DESC);
+			co.outputFolder = getSeparatorTerminatedPath(bundle
+					.getString(CREATE_SCENARIO_OUTPUT_FOLDER));
+			File f = new File(co.outputFolder);
+			String parent = f.getParent();
+			// output folder will have the same parent as the task description
+			// file
+			if (parent == null) {
+				f = new File(co.workloadDescFileName);
+				parent = f.getParent();
+				co.outputFolder = new File(parent, co.outputFolder)
+						.getAbsolutePath();
+				co.outputFolder = getSeparatorTerminatedPath(co.outputFolder);
+			}
+			co.outputWorkloadFileName = bundle
+					.getString(CREATE_SCENARIO_WORKLOAD_FILE);
+			co.overwriteFiles = Boolean.valueOf(
+					bundle.getString(CREATE_SCENARIO_OVERWRITE_FILES_MODIFIER))
+					.booleanValue();
+			co.createScenario = true; // success
+
+		} catch (MissingResourceException e) {
+			co.createScenario = false; // do not create scenario
+		}
+
+
+		try {
+			co.networkTopologyFileName = bundle
+					.getString(NETWORK_TOPOLOGY_FILE_MODIFIER);
+		} catch(MissingResourceException e){
+			co.networkTopologyFileName = null;
+		}
+		
+		if (co.createScenario == false) {
+			// read scenario
+			try {
+				co.inputFolder = getSeparatorTerminatedPath(bundle
+					.getString(READ_SCENARIO_INPUT_FOLDER));
+			} catch (MissingResourceException e) {
+				co.inputFolder = null;
+			}
+			
+			try {
+				co.inputTar = getSeparatorTerminatedPath(bundle
+					.getString(READ_SCENARIO_INPUT_TAR));
+			} catch (MissingResourceException e) {
+				co.inputTar = null;
+			}
+			
+			try {
+				co.inputWorkloadFileName = bundle
+						.getString(READ_SCENARIO_WORKLOAD_FILE);
+			} catch (MissingResourceException e){
+				co.inputWorkloadFileName = null;
+			}
+		}
+
+		try {
+			
+			if(Boolean.parseBoolean(
+					bundle.getString(CREATE_XML_SUPPLEMENT_FILES)))
+				co.createXMLSupplement = true;
+			else
+				co.createXMLSupplement = false;
+			
+		} catch (MissingResourceException e){
+			co.createXMLSupplement = false;
+		}
+		
+		try {
+			co.printHistory = Boolean.valueOf(
+					bundle.getString(PRINT_HISTORY_MODIFIER)).booleanValue();
+		} catch(MissingResourceException e){
+			co.printHistory = false;
+		}
+		
+		// create diagrams
+		
+		boolean createDiagrams = true;
+		try {
+			createDiagrams = Boolean.valueOf(
+					bundle.getString(CREATEDIAGRAMS)).booleanValue();
+		} catch(MissingResourceException e){
+			createDiagrams = true;
+		}
+		try {
+			co.creatediagrams_processors = Boolean.valueOf(
+					bundle.getString(CREATEDIAGRAMS_GANTT)).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_UTILIZATION)).booleanValue() && createDiagrams;
+		} catch(MissingResourceException e){
+			co.creatediagrams_resources = createDiagrams;
+		}
+		try {
+			co.creatediagrams_resources_scale = Double.valueOf(
+					bundle.getString(CREATEDIAGRAMS_RESOURCES_SCALE)).doubleValue();
+		} catch(MissingResourceException e){
+			co.creatediagrams_resources_scale = -1;
+		}
+		try {
+			co.creatediagrams_energyusage = Boolean.valueOf(
+					bundle.getString(CREATEDIAGRAMS_ENERGYUSAGE)).booleanValue() && createDiagrams;
+		} catch(MissingResourceException e){
+			co.creatediagrams_energyusage = createDiagrams;
+		}
+		try {
+			co.creatediagrams_tasks = Boolean.valueOf(
+					bundle.getString(CREATEDIAGRAMS_TASKS)).booleanValue() && createDiagrams;
+		} catch(MissingResourceException e){
+			co.creatediagrams_tasks = createDiagrams;
+		}
+		try {
+			co.creatediagrams_taskswaitingtime = Boolean.valueOf(
+					bundle.getString(CREATEDIAGRAMS_TASKSWAITINGTIME)).booleanValue() && createDiagrams;
+		} catch(MissingResourceException e){
+			co.creatediagrams_taskswaitingtime = createDiagrams;
+		}
+		
+		
+		try {
+			co.statsOutputSubfolderNameCreate = bundle.getString(STATS_OUTPUT_SUBFOLDER_NAME);
+			co.statsOutputSubfolderNameRerad = co.statsOutputSubfolderNameCreate;
+		} catch(MissingResourceException e){
+			co.statsOutputSubfolderNameCreate = "stats_create";
+			co.statsOutputSubfolderNameRerad = "stats_read";
+		}
+
+		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();
+		} catch(MissingResourceException e){
+			co.createjobsstatistics = true;
+		}
+		try {
+			co.createsimulationstatistics = Boolean.valueOf(
+					bundle.getString(SIMULATION_STATISTICS)).booleanValue();
+		} catch(MissingResourceException e){
+			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();
+		} catch(MissingResourceException e){
+			co.numberOfSimulations = 1;
+		}
+		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;
+	}
+
+	public static String getSeparatorTerminatedPath(String path) {
+		if (path.endsWith(File.separator))
+			return new String(path);
+		else {
+			StringBuilder result = new StringBuilder(path.length()
+					+ File.separator.length());
+			result.append(path);
+			result.append(File.separator);
+			return result.toString();
+		}
+	}
+	
+	public void setNumberOfSimulations(int numberOfSimulations) {
+		this.numberOfSimulations = numberOfSimulations;
+	}
+	
+	public int getNumberOfSimulations() {
+		return numberOfSimulations;
+	}
+	
+	public void setWorkloadDescFileName(String workloadDescFileName) {
+		this.workloadDescFileName = workloadDescFileName;
+	}
+	
+	public String getWorkloadDescFileName() {
+		return workloadDescFileName;
+	}
+}
Index: DCWoRMS/trunk/src/simulator/WormsConstants.java
===================================================================
--- DCWoRMS/trunk/src/simulator/WormsConstants.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/WormsConstants.java	(revision 477)
@@ -0,0 +1,102 @@
+package simulator;
+
+import eduni.simjava.Sim_stat;
+
+public class WormsConstants {
+
+	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/src/simulator/factory/JobRandomNubersFactory.java
===================================================================
--- DCWoRMS/trunk/src/simulator/factory/JobRandomNubersFactory.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/factory/JobRandomNubersFactory.java	(revision 477)
@@ -0,0 +1,466 @@
+package simulator.factory;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.impl.LogFactoryImpl;
+
+import cern.jet.random.AbstractDistribution;
+import eduni.simjava.distributions.PeriodicGenerator;
+
+import simulator.RandomNumbers;
+import simulator.workload.generator.configuration.ComputingResourceHostParameter;
+import simulator.workload.generator.configuration.Dist;
+import simulator.workload.generator.configuration.ExecDuration;
+import simulator.workload.generator.configuration.ExecutionTime;
+import simulator.workload.generator.configuration.ExecutionTimeChoice;
+import simulator.workload.generator.configuration.Importance;
+import simulator.workload.generator.configuration.JobCount;
+import simulator.workload.generator.configuration.JobInterval;
+import simulator.workload.generator.configuration.JobPackageLength;
+import simulator.workload.generator.configuration.Max;
+import simulator.workload.generator.configuration.Min;
+import simulator.workload.generator.configuration.MultiDistribution;
+import simulator.workload.generator.configuration.OutputFileSize;
+import simulator.workload.generator.configuration.Parameter;
+import simulator.workload.generator.configuration.ParentCard;
+import simulator.workload.generator.configuration.ParentStates_OR;
+import simulator.workload.generator.configuration.PeriodDuration;
+import simulator.workload.generator.configuration.PeriodEnd;
+import simulator.workload.generator.configuration.PeriodStart;
+import simulator.workload.generator.configuration.PeriodicValidValues;
+import simulator.workload.generator.configuration.PrecedingConstraints;
+import simulator.workload.generator.configuration.Preferences;
+import simulator.workload.generator.configuration.RandParams;
+import simulator.workload.generator.configuration.RandParamsSequence;
+import simulator.workload.generator.configuration.Range;
+import simulator.workload.generator.configuration.RunSameHost;
+import simulator.workload.generator.configuration.TaskCount;
+import simulator.workload.generator.configuration.TaskLength;
+import simulator.workload.generator.configuration.Trigger;
+import simulator.workload.generator.configuration.Triggers;
+import simulator.workload.generator.configuration.Value;
+import simulator.workload.generator.configuration.WorkflowLevel;
+import simulator.workload.generator.configuration.WorkloadConfiguration;
+
+
+public class JobRandomNubersFactory {
+
+	protected String triggerNames[];
+	
+	private static Log log = LogFactoryImpl.getLog(JobRandomNubersFactory.class);
+	
+	/**
+	 * 
+	 * @param workload
+	 * @param jobCountDescriptor
+	 * @param taskCountDescriptor
+	 * @param taskLengthDescriptor
+	 * @param tasksDistanceDescriptor
+	 * @param tasksPackageLengthDescriptor
+	 * @param taskWaitTimeDescriptor
+	 * @return
+	 */
+	public RandomNumbers initParameterRandomNumbers(
+							WorkloadConfiguration workload){
+		
+		RandomNumbers parameterRandomNumbers = new RandomNumbers();
+		String name = null;
+
+		if (workload.getWorkloadConfigurationChoice().getJobCount() != null) {
+			JobCount jobCount = workload.getWorkloadConfigurationChoice().getJobCount();
+			name = getGeneratorName(jobCount);
+			if(log.isDebugEnabled()){
+				log.debug("Creating genrator for JobCount. Generator id: " + name);
+			}
+			addRandomNumbers(parameterRandomNumbers, jobCount, name);
+		}
+
+		TaskCount taskCount = workload.getTaskCount();
+		name = getGeneratorName(taskCount);
+		if(log.isDebugEnabled()){
+			log.debug("Creating genrator for TaskCount range.min. Generator id: " + name);
+		}
+		addRandomNumbers(parameterRandomNumbers, taskCount, name);
+		
+		TaskLength taskLength = workload.getTaskLength();
+		name  = getGeneratorName(taskLength);
+		if(log.isDebugEnabled()){
+			log.debug("Creating genrator for TaskLength range.min. Generator id: " + name);
+		}
+		addRandomNumbers(parameterRandomNumbers, taskLength, name);
+
+		JobInterval jobInterval = workload.getJobInterval();
+		name = getGeneratorName(jobInterval);
+		if(log.isDebugEnabled()){
+			log.debug("Creating genrator for JobInterval range.min. Generator id: " + name);
+		}
+		addRandomNumbers(parameterRandomNumbers, jobInterval, name);
+
+		JobPackageLength jobPackageLength = workload.getJobPackageLength();
+		name = getGeneratorName(jobPackageLength);
+		if(log.isDebugEnabled()){
+			log.debug("Creating genrator for JobPackageLength range.min. Generator id: " + name);
+		}
+		addRandomNumbers(parameterRandomNumbers, jobPackageLength, name);
+
+		return parameterRandomNumbers; 
+	}
+	
+	/**
+	 * 
+	 * @param workload
+	 * @param maxDescriptor
+	 * @param minDescriptor
+	 * @param valueDescriptor
+	 * @return
+	 */
+	public RandomNumbers initHardConstraintsRandomNumbers(WorkloadConfiguration workload){
+		
+		RandomNumbers hardConstraintsRandomNumbers = new RandomNumbers();
+		
+		ComputingResourceHostParameter[] hardConstraints = workload.getComputingResourceHostParameter();
+		if (hardConstraints != null && hardConstraints.length > 0) {
+			for (int i = 0; i < hardConstraints.length; ++i) {
+				ComputingResourceHostParameter hardConstraint = hardConstraints[i];
+				String name = hardConstraint.getMetric();
+
+				Range[] ranges = hardConstraint.getRange();
+				for (int r = 0; r < ranges.length; ++r) {
+					Range range = ranges[r];
+					Max max = range.getMax();
+					if (max != null) {
+						String maxName = getGeneratorName(max);
+						if(log.isDebugEnabled()){
+							log.debug("Creating genrator for " + name + " " + r + " range.min. Generator id: " + maxName);
+						}
+						addRandomNumbers(hardConstraintsRandomNumbers, max, maxName);
+					}
+					Min min = range.getMin();
+					if (min != null) {
+						String minName = getGeneratorName(min);
+						if(log.isDebugEnabled()){
+							log.debug("Creating genrator for " + name + " " + r + " range.min. Generator id: " + minName);
+						}
+						addRandomNumbers(hardConstraintsRandomNumbers, min, minName);
+					}
+				}
+
+				Value[] values = hardConstraint.getValue();
+				for (int v = 0; v < values.length; ++v) {
+					Value value = values[v];
+					String valueName = getGeneratorName(value);
+					if(log.isDebugEnabled()){
+						log.debug("Creating genrator for " + name + " " + v + " value. Generator id: "+valueName);
+					}
+					addRandomNumbers(hardConstraintsRandomNumbers, value, valueName);
+				}			
+			}
+		}
+		
+		return hardConstraintsRandomNumbers;
+	}
+	
+	/**
+	 * 
+	 * @param workload
+	 * @param indiffThresholdDescriptor
+	 * @param importanceDescriptor
+	 * @return
+	 */
+	public RandomNumbers initSoftConstraintsRandomNumbers(WorkloadConfiguration workload){
+		
+		RandomNumbers softConstraintsRandomNumbers = new RandomNumbers();
+		String name;
+		String detailName;
+		Preferences softConstraints = workload.getPreferences();
+		if (softConstraints != null) {
+			Parameter[] constraints = softConstraints.getParameter();
+			for (int i = 0; i < constraints.length; ++i) {
+				Parameter constraint = constraints[i];
+				//the name is a big concatenation
+				name = constraint.getName();
+				
+				Importance importance = constraint.getImportance();
+				detailName = getGeneratorName(importance);
+				
+				if(log.isDebugEnabled()){
+					log.debug("Creating genrator for parameter " + name + " importance. Generator id: " + detailName);
+				}
+				addRandomNumbers(softConstraintsRandomNumbers, importance, detailName);
+				
+				Range rangeTab[] = constraint.getRange();
+				if(rangeTab != null && rangeTab.length > 0){
+					Range range = rangeTab[0];
+					Min min = range.getMin();
+					detailName = getGeneratorName(min);
+					if(log.isDebugEnabled()){
+						log.debug("Creating genrator for parameter " + name + " range.min. Generator id: " + detailName);
+					}
+					addRandomNumbers(softConstraintsRandomNumbers, min, detailName);
+					
+					Max max = range.getMax();
+					detailName = getGeneratorName(max);
+					if(log.isDebugEnabled()){
+						log.debug("Creating genrator for parameter " + name + " range.max. Generator id: " + detailName);
+					}
+					
+					addRandomNumbers(softConstraintsRandomNumbers, max, detailName);
+				}
+				
+				Value value = constraint.getValue();
+				if(value != null){
+					detailName = getGeneratorName(value);
+					if(log.isDebugEnabled()){
+						log.debug("Creating genrator for parameter " + name + " value. Generator id: " + detailName);
+					}
+					
+					addRandomNumbers(softConstraintsRandomNumbers, value, detailName);
+				}
+			}
+		}
+
+		return softConstraintsRandomNumbers;
+	}
+	
+	
+	/**
+	 * 
+	 * @param workload
+	 * @return
+	 */
+	public RandomNumbers initTimeConstraintsRandomNumbers(WorkloadConfiguration workload){
+		RandomNumbers timeConstraintsRandomNumbers = new RandomNumbers();
+		ExecutionTime timeConstraints = workload.getExecutionTime();
+		
+		if(timeConstraints != null) {
+			String name = null;
+			PeriodStart periodStart = timeConstraints.getPeriodStart();
+			if(periodStart != null){
+				name = getGeneratorName(periodStart);
+				if(log.isDebugEnabled()){
+					log.debug("Creating genrator for parameter ExecutionTime.PeriodStart Generator id: " + name);
+				}
+				addRandomNumbers(timeConstraintsRandomNumbers, periodStart, name);
+			}
+			
+			ExecDuration execDuration = timeConstraints.getExecDuration();
+			if(execDuration != null){
+				name = getGeneratorName(execDuration);
+				if(log.isDebugEnabled()){
+					log.debug("Creating genrator for parameter ExecutionTime.ExecutionDuration Generator id: " + name);
+				}
+				addRandomNumbers(timeConstraintsRandomNumbers, execDuration, name);
+			}
+			
+			ExecutionTimeChoice choice = timeConstraints.getExecutionTimeChoice();
+			if(choice != null) {
+		
+				PeriodDuration periodDuration = choice.getPeriodDuration();
+				if(periodDuration != null){
+					name = getGeneratorName(periodDuration);
+					if(log.isDebugEnabled()){
+						log.debug("Creating genrator for parameter ExecutionTime.PeriodDuration Generator id: " + name);
+					}
+					addRandomNumbers(timeConstraintsRandomNumbers, periodDuration, name);
+				}
+				
+				PeriodEnd periodEnd = choice.getPeriodEnd();
+				if(periodEnd != null) {
+					name = getGeneratorName(periodEnd);
+					if(log.isDebugEnabled()){
+						log.debug("Creating genrator for parameter ExecutionTime.PeriodEnd Generator id: " + name);
+					}
+					addRandomNumbers(timeConstraintsRandomNumbers, periodEnd, name);
+				}
+			}
+		}
+		return timeConstraintsRandomNumbers;
+	}
+	
+	
+	/**
+	 * 
+	 * @param workload
+	 * @return
+	 */
+	public RandomNumbers initPrecedingConstraintsRandomNumbers(WorkloadConfiguration workload){
+		RandomNumbers precedingConstraintsRandomNumbers = new RandomNumbers();
+		PrecedingConstraints constraints = workload.getPrecedingConstraints();
+		
+		if(constraints == null) 
+			return precedingConstraintsRandomNumbers;
+		
+		ParentCard parentCard = constraints.getParentCard();
+		String name = null;
+		
+		if(parentCard != null){
+			name = getGeneratorName(parentCard);
+			if(log.isDebugEnabled()){
+				log.debug("Creating genrator for PrecedingConstraints.ParentCard Generator id: " + name);
+			}
+			addRandomNumbers(precedingConstraintsRandomNumbers, parentCard, name);
+		}
+		
+		WorkflowLevel workflowLevel = constraints.getWorkflowLevel();
+		if(workflowLevel != null){
+			name = getGeneratorName(workflowLevel);
+			if(log.isDebugEnabled()){
+				log.debug("Creating genrator for PrecedingConstraints.WorkflowLevel Generator id: " + name);
+			}
+			addRandomNumbers(precedingConstraintsRandomNumbers, workflowLevel, name);
+		}
+		
+		OutputFileSize outputFileSize = constraints.getOutputFileSize();
+		if(outputFileSize != null){
+			name = getGeneratorName(outputFileSize);
+			if(log.isDebugEnabled()){
+				log.debug("Creating genrator for PrecedingConstraints.OutputFileSize Generator id: " + name);
+			}
+			addRandomNumbers(precedingConstraintsRandomNumbers, outputFileSize, name);
+		}
+		
+		ParentStates_OR parentStates = constraints.getParentStates_OR();
+		if(parentStates != null){
+			name = getGeneratorName(parentStates);
+			if(log.isDebugEnabled()){
+				log.debug("Creating genrator for PrecedingConstraints.ParentStates_OR Generator id: " + name);
+			}
+			addRandomNumbers(precedingConstraintsRandomNumbers, parentStates, name);
+		}
+		
+		RunSameHost runSameHost = constraints.getRunSameHost();
+		if(runSameHost != null){
+			name = getGeneratorName(runSameHost);
+			if(log.isDebugEnabled()){
+				log.debug("Creating genrator for PrecedingConstraints.RunSameHost Generator id: " + name);
+			}
+			addRandomNumbers(precedingConstraintsRandomNumbers, runSameHost, name);
+		}
+		
+		Trigger trigger;
+		Triggers triggers = constraints.getTriggers();
+		String tname;
+		if(triggers != null){
+			triggerNames = new String[triggers.getTriggerCount()];
+			
+			for(int i = 0; i < triggers.getTriggerCount(); i++){
+				trigger = triggers.getTrigger(i);
+				triggerNames[i] = (String)trigger.getName();
+				tname = getGeneratorName(trigger);
+				if(log.isDebugEnabled()){
+					log.debug("Creating genrator for PrecedingConstraints.Trigger " + triggerNames[i] + " Generator id: " + tname);
+				}
+				addRandomNumbers(precedingConstraintsRandomNumbers, trigger, tname);
+			}
+		}
+		
+		return precedingConstraintsRandomNumbers;
+	}
+	
+	protected RandomNumbers addPeriodicValidValues(RandomNumbers randomNumbers, RandParams params, String name){
+		PeriodicValidValues values[];
+		int len = 0;
+		
+		if(params.getRandParamsSequence() == null)
+			return randomNumbers;
+		
+		len = params.getRandParamsSequence().getPeriodicValidValuesCount();
+		if(len == 0)
+			return randomNumbers;
+		
+		values = params.getRandParamsSequence().getPeriodicValidValues();
+		for(int i = 0; i < values.length; i++){
+			if(randomNumbers.addRandomGenerator(name, values[i])){
+				if(values[i].getId() != null){
+					randomNumbers.addIdGeneratorNameMapping(values[i].getId(), name);
+				}
+			}
+		}
+		return randomNumbers;
+	}
+	
+	protected RandomNumbers addDetailDistributions(RandomNumbers randomNumbers, RandParams params, String name){
+		MultiDistribution md = null;
+		Dist distTable[] = null;
+		
+		md = params.getMultiDistribution();
+		if(md == null)
+			return randomNumbers;
+		
+		distTable = md.getDist();
+		for(int i = 0; i < distTable.length; i++){
+			if(randomNumbers.addRandomGenerator(name, distTable[i])){
+				if(distTable[i].getId() != null)
+					randomNumbers.addIdGeneratorNameMapping(distTable[i].getId(), name);
+			}
+		}
+		return randomNumbers;
+	}
+	
+	public boolean addRandomNumbers(RandomNumbers rn, RandParams rp, String name) {
+		MultiDistribution md = null;
+		RandParamsSequence randParamSeq = null;
+		AbstractDistribution generator;
+		
+		md = rp.getMultiDistribution();
+		randParamSeq = rp.getRandParamsSequence();
+		
+		// if simple generator definition is used
+		if(md == null && randParamSeq == null){
+		
+			if(rn.addRandomGenerator(rp.getDistribution().getType(), rp.hasAvg(), rp.getAvg(), rp.getStdev(), 
+								rp.hasMin(), rp.getMin(), rp.hasMax(), rp.getMax(), rp.hasSeed(), rp.getSeed(), name)) {
+				if(rp.getId() != null)
+					rn.addIdGeneratorNameMapping(rp.getId(), name);
+				return true;
+			} else {
+				return false;
+			}
+				
+		
+		} else if(md != null && randParamSeq == null){ // if multidistribution is used
+			/*
+			 * TODO Marcin: dopelnienie do 1 (do 100%) moze zostac zdefiniowane w glownym elemencie
+			 * Sprawdzic czy faktycznie potrzeba uzupelnienia do 100%, a nastepnie
+			 * trzeba by dodac tak opisany generator za pomoca rn.addRandomGenerator(parameterName, detailDist)
+			 */ 
+			addDetailDistributions(rn, rp, name);
+			if(rp.getId() != null)
+				rn.addIdGeneratorNameMapping(rp.getId(), name);
+			
+		} else if(md == null && randParamSeq != null){ // if periodic valid values are used
+			
+			generator = rn.createRandomGenerator(rp.getDistribution().getType(), rp.hasAvg(), rp.getAvg(), 
+								rp.getStdev(), rp.hasMin(), rp.getMin(), rp.hasMax(), rp.getMax(), rp.hasSeed(), rp.getSeed(), name);
+			if(generator == null)
+				throw new RuntimeException("Define default generator (which will be valid for whole simulation time) for "+name);
+			
+			PeriodicGenerator pg = new PeriodicGenerator(generator);
+			rn.addRandomGenerator(name, pg);
+			
+			addPeriodicValidValues(rn, rp, name);
+			if(rp.getId() != null)
+				rn.addIdGeneratorNameMapping(rp.getId(), name);
+			
+		} else {
+			throw new RuntimeException("Use Multidistribution _OR_ Periodic valid values. This two things can not be used togeter.");
+		}
+		
+		return true; 
+	}
+	
+	
+	
+	/**
+	 * 
+	 * @return
+	 */
+	public String[] getTriggerNames(){
+		return triggerNames;
+	}
+	
+	public static String getGeneratorName(Object object){
+		return String.valueOf(object.hashCode());
+	}
+	
+}
+
Index: DCWoRMS/trunk/src/simulator/WormsUsers.java
===================================================================
--- DCWoRMS/trunk/src/simulator/WormsUsers.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/WormsUsers.java	(revision 477)
@@ -0,0 +1,328 @@
+package simulator;
+
+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.net.InfoPacket;
+import gssim.schedframe.scheduling.utils.JobDescription;
+import gssim.schedframe.scheduling.utils.TaskDescription;
+
+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 WormsUsers 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(WormsUsers.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 WormsUsers(String name, String destinationName, WorkloadLoader workload) throws Exception {
+		super(name, WormsConstants.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() == Gridlet.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/src/simulator/GenericUser.java
===================================================================
--- DCWoRMS/trunk/src/simulator/GenericUser.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/GenericUser.java	(revision 477)
@@ -0,0 +1,51 @@
+package simulator;
+
+
+import gssim.schedframe.scheduling.utils.JobDescription;
+import gssim.schedframe.scheduling.utils.TaskDescription;
+
+import java.util.List;
+
+import schedframe.scheduling.tasks.Job;
+import schedframe.scheduling.tasks.JobInterface;
+
+
+/**
+ * This interface introduces a generic user entity, which is intended to send jobs and tasks
+ * to a broker entity.
+ * 
+ * @author Stanislaw Szczepanowski
+ * @param <SubJob> a job type, which implements the {@link Job} interface
+ */
+public interface GenericUser {
+
+	/**
+	 * @return a list of all jobs, that have been sent by the user entity
+	 */
+	public List<JobDescription> getAllSentJobs();
+	
+	/**
+	 * @return a list of all tasks, that have been sent by the user entity
+	 */
+	public List<TaskDescription> getAllSentTasks();
+	
+	/**
+	 * @return a list of all jobs, that have returned from execution to the user entity
+	 */
+	public List<JobInterface<?>> getAllReceivedJobs();
+	
+	/**
+	 * @return the name of the user entity (unique in the entire simulation run)
+	 */
+	public String getUserName();
+	
+	public int getFinishedTasksCount() ;
+	
+	
+	/**
+	 * This method is intended for debug purposes.
+	 * @return <code>true</code> if during the simulation, any error occurred 
+	 * (e.g. the same job has been returned twice).
+	 */
+	public boolean isError();
+}
Index: DCWoRMS/trunk/src/simulator/RandomNumbers.java
===================================================================
--- DCWoRMS/trunk/src/simulator/RandomNumbers.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/RandomNumbers.java	(revision 477)
@@ -0,0 +1,445 @@
+package simulator;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import simulator.stats.random.MinMaxDistribution;
+import simulator.workload.generator.configuration.Dist;
+import simulator.workload.generator.configuration.PeriodicValidValues;
+import simulator.workload.generator.configuration.types.ParameterAttributesDistributionType;
+import cern.jet.random.AbstractDistribution;
+import cern.jet.random.Exponential;
+import cern.jet.random.Gamma;
+import cern.jet.random.Normal;
+import cern.jet.random.Poisson;
+import cern.jet.random.Uniform;
+import cern.jet.random.engine.MersenneTwister64;
+import cern.jet.random.engine.RandomEngine;
+import eduni.simjava.distributions.AbstractSpecificGenerator;
+import eduni.simjava.distributions.DetailDistGenerator;
+import eduni.simjava.distributions.GeneralGenerator;
+import eduni.simjava.distributions.PeriodicGenerator;
+
+/**
+ * A class that stores random number generator for given metrics. Its functionality is basically similar to a hash table
+ * where a key is a metric name and a value stored at that key is a previously set random number generator with proper distribution
+ * @author Stanislaw Szczepanowski
+ *
+ */
+public class RandomNumbers {
+
+	/**
+	 * a hash table that stores the random number generators on the basis of the given key
+	 * the key is the name of the parameter (metric name, String object), for which a random generator should be retrieved
+	 */
+	protected Map<String, List<AbstractSpecificGenerator>> rndGenerators;  
+
+	/**
+	 * holds mapping between node id and internal random numbers generator name.
+	 */
+	protected HashMap<String, String> idMap;
+	
+	/**
+	 * A field indicating, that if no seed is given to a value, this global seed is to be used. 
+	 * If this value is <code>null</code>, then a random number is to be picked (e.g. System.nanoTime()).
+	 * Such functionality is used for example for test purposes.
+	 */
+	protected static Long baseSeed;
+	
+	/**
+	 * Default constructor
+	 */
+	public RandomNumbers() {
+		rndGenerators = new HashMap<String, List<AbstractSpecificGenerator>>();	
+		idMap = new HashMap<String, String>();
+		init();
+	}
+	
+	/**
+	 * Constructor with initial capacity
+	 * @param initialCapacity the initial capacity of this hash map
+	 */
+	public RandomNumbers(int initialCapacity) {
+		rndGenerators = new HashMap<String, List<AbstractSpecificGenerator>>(initialCapacity);
+		idMap = new HashMap<String, String>(initialCapacity);
+		init();
+	}
+	
+	/** A common initialization method used in constructors */
+	protected void init() {
+	}
+	
+	/**
+	 * Adds a random number generator at given key (name) 
+	 * @param parameterName the name of the generator
+	 * @param generator the generator to be stored
+	 */
+	public void addRandomGenerator(String parameterName, PeriodicGenerator generator) {
+		List<AbstractSpecificGenerator> list;
+		
+		if(rndGenerators.containsKey(parameterName)){
+			list = rndGenerators.get(parameterName);
+			list.add(generator);
+		} else {
+			list = new ArrayList<AbstractSpecificGenerator>(1);
+			list.add(generator);
+			rndGenerators.put(parameterName, list);
+		}
+	}
+	
+	public void addRandomGenerator(String parameterName, DetailDistGenerator generator){
+		ArrayList <AbstractSpecificGenerator>list;
+		int idx = -1;
+		if(rndGenerators.containsKey(parameterName)){
+			list = (ArrayList<AbstractSpecificGenerator>) rndGenerators.get(parameterName);
+			list.ensureCapacity(list.size() + 1);
+
+			// this should guarantee, that elements on the list are ordered.
+			while(++idx < list.size() && generator.compareTo(list.get(idx)) > 0);
+			list.add(idx, generator);
+			
+		} else {
+			list = new ArrayList<AbstractSpecificGenerator>(1);
+			list.add(generator);
+			rndGenerators.put(parameterName, list);
+		}
+	}
+	
+	public boolean addRandomGenerator(String parameterName, Dist detailDist){
+		Double percnt = Double.valueOf(detailDist.getContent());
+		
+		AbstractDistribution generator = createRandomGenerator(
+				detailDist.getDistribution().getType(), detailDist.hasAvg(), detailDist.getAvg(),
+				detailDist.getStdev(), detailDist.hasMin(), detailDist.getMin(),
+				detailDist.hasMax(), detailDist.getMax(), detailDist.hasSeed(), detailDist.getSeed(), parameterName);
+		
+		if(generator == null)
+			return false;
+		
+		DetailDistGenerator ddg = new DetailDistGenerator(generator, percnt);
+		addRandomGenerator(parameterName, ddg);
+		
+		return true;
+	}
+	
+	public boolean addRandomGenerator(String parameterName,  PeriodicValidValues values){
+		AbstractDistribution generator = createRandomGenerator(
+					values.getDistribution().getType(), values.hasAvg(), values.getAvg(),
+					values.getStdev(), values.hasMin(), values.getMin(), 
+					values.hasMax(), values.getMax(), values.hasSeed(), values.getSeed(), parameterName);
+		
+		if(generator == null)
+			return false;
+		
+		PeriodicGenerator pg = new PeriodicGenerator(generator, values.getBeginValidTime(), values.getEndValidTime());
+		addRandomGenerator(parameterName, pg);
+		
+		return true;
+	}
+
+	
+	/**
+	 * Creates and stores a random numbers generator
+	 * @param distribution the distribution of this generator descried as in {@link ParameterAttributesDistributionType}
+	 * @param avg the average value
+	 * @param stdev the standard deviation value 
+	 * @param min minimal value
+	 * @param max maximal value
+	 * @param useSeed true, if the given seed is to be used
+	 * @param seed the seed for random number generator
+	 * @param name the name of the random numbers generator
+	 */
+	public boolean addRandomGenerator(int distribution, boolean useAvg, double avg, double stdev, boolean useMin, double min, boolean useMax, double max, boolean useSeed, long seed, String name) {
+		AbstractDistribution generator = createRandomGenerator(distribution, useAvg, avg, stdev, useMin, min, useMax, max, useSeed, seed, name);
+		if(generator == null)
+			return false;
+		
+		GeneralGenerator gg = new GeneralGenerator(generator);
+		List<AbstractSpecificGenerator> list;
+		
+		if(rndGenerators.containsKey(name)){
+			list = rndGenerators.get(name);
+			list.add(gg);
+		} else {
+			list = new ArrayList<AbstractSpecificGenerator>(1);
+			list.add(gg);
+			rndGenerators.put(name, list);
+		}
+		
+		return true;
+	}
+	
+	
+	
+	/**
+	 * Retrieves the next random value from the given random numbers generator.
+	 * Generator is valid for whole simulation time.
+	 * @param parameterName the random numbers generator name
+	 * @return the next random value (according to the setting of the random numbers generator)
+	 * @throws IllegalAccessException
+	 */
+	public double getRandomValue(String parameterName) throws IllegalAccessException{
+		List<AbstractSpecificGenerator> list = rndGenerators.get(parameterName);
+		AbstractSpecificGenerator asg;
+		AbstractDistribution generator = null;
+		double ret;
+		
+		if(list == null || list.size() == 0){
+			throw new IllegalAccessException("No random generator for given metric " + parameterName);
+		}
+		
+		// generator on index 0 should be valid for whole simulation period, if PeriodicGenerator is used or
+		// should cover 100% of tasks if DetailDistGenerator is used
+		asg = list.get(0);
+		
+		generator = asg.getGenerator();
+		
+		ret = generator.nextDouble();
+		asg.setLastGeneratedValue(ret);
+		
+		return ret;
+	}
+	
+	public double getLastGeneratedRandomValue(String parameterName) throws IllegalAccessException{
+		List<AbstractSpecificGenerator> list = rndGenerators.get(parameterName);
+		AbstractSpecificGenerator asg = list.get(0);
+		return asg.getLastGeneratedValue();
+	}
+	
+	
+	/**
+	 * Retrieves the next random value from the given random numbers generator.
+	 * Generator is valid only for some period of simulation time.
+	 * @param parameterName the random numbers generator name
+	 * @param time current simulation time
+	 * @return the next random value (according to the setting of the random numbers generator)
+	 * @throws IllegalAccessException
+	 */
+	public double getRandomValue(String parameterName, long time) throws IllegalAccessException {
+		List<AbstractSpecificGenerator> list = rndGenerators.get(parameterName);
+		AbstractSpecificGenerator asg = null;
+		PeriodicGenerator pGen = null;
+		AbstractDistribution generator = null;
+		double ret;
+		
+		if(list == null || list.size() == 0) {
+			throw new IllegalAccessException("No random generator for given metric " + parameterName);
+		}
+		
+		for(int i = 1; i < list.size(); i++){
+			asg = list.get(i);
+			if(asg instanceof PeriodicGenerator)
+				pGen = (PeriodicGenerator) asg;
+			else
+				throw new RuntimeException("Wrong specific generator type. PeriodicGenerator was expected.");
+			
+			if(pGen.isValid(time)){
+				generator = pGen.getGenerator();
+				break;
+			}
+		}
+		
+		// generator on index = 0 should be valid for whole simulation period
+		if(generator == null) {
+			pGen = (PeriodicGenerator)list.get(0);
+			if(pGen.isValid(time)){
+				generator = pGen.getGenerator();
+			}
+		}
+		
+		if(generator == null)
+			throw new IllegalAccessException("No valid "+parameterName+" generator for given time " + time);
+		ret = generator.nextDouble();
+		
+		return ret;
+	}
+	
+	/**
+	 * Retrieves the next random value from the given random numbers generator.
+	 * Generator is valid for specified percent of generated tasks.
+	 * @param parameterName
+	 * @param prcnt
+	 * @return
+	 * @throws IllegalAccessError
+	 */
+	public double getRandomValue(String parameterName, double prcnt) throws IllegalAccessError {
+		int idx = 0;
+		double prcntSum = 0.0;
+		DetailDistGenerator ddg = null;
+		
+		if(!rndGenerators.containsKey(parameterName))
+			throw new IllegalAccessError("No generators for "+parameterName+" available.");
+		
+		List <AbstractSpecificGenerator> list = rndGenerators.get(parameterName);
+
+		if(list.size() == 0)
+			throw new IllegalAccessError("No generator for "+parameterName + " available.");
+		
+		if(list.get(0) instanceof DetailDistGenerator){
+			/* 
+			 * Looking for appropriate generator.
+			 * List of elements is ordered from min to max. For loop is checking to which interval requested 
+			 * percent belongs to.
+			 */
+			for(idx = 0; idx < list.size(); idx++){
+				ddg = (DetailDistGenerator)list.get(idx);
+				prcntSum = prcntSum + ddg.getPrcnt();
+				// this is to handle double numbers representation precision
+				if((prcntSum - prcnt) > 0.000000001)
+					break;
+			}
+			
+			if(idx >= list.size())
+				throw new IllegalAccessError("Value "+prcnt +" doeas not belong to any interval defined by DetailDistGenerators");
+
+			return ddg.getGenerator().nextDouble();
+
+		} else {
+			throw new IllegalAccessError(list.get(0).getClass().getName() +
+					" generator can not be used for evaluating values for multidistribution element definition.\n" +
+					"Use " + DetailDistGenerator.class.getName() + " instead.");
+		}
+	}
+	
+	/**
+	 * Retrieves a snapshot of all random numbers generators next random values
+	 * @return a result hash map has structure of pairs as: &lt;String random_numbers_generator_name, Double random_value&gt;
+	 */
+	public Map<String, Double> getMappedRandomValues() {
+		Map<String, Double> resultHashMap = new HashMap<String, Double>(rndGenerators.size());
+		
+		Set<String> keys = rndGenerators.keySet();
+		for (Iterator<String> i = keys.iterator(); i.hasNext(); ) {
+			String name = i.next();
+			Double value = null;
+			try {
+				value = new Double(getRandomValue(name));
+			} catch (IllegalAccessException e) {
+				e.printStackTrace();
+			}
+			resultHashMap.put(name, value);
+		}
+		
+		return resultHashMap;
+	}
+
+	/**
+	 * Constructs a new random numbers generator.
+	 * 
+	 * @param distribution the distribution of this generator descried as in {@link ParameterAttributesDistributionType}
+	 * @param useAvg <code>true</code>, if the given average value is to be used; <code>false</code> otherwise
+	 * @param avg the average value
+	 * @param stdev the standard deviation value 
+	 * @param useMin <code>true</code>, if the given minimal value is to be used; <code>false</code> otherwise
+	 * @param min minimal value
+	 * @param useMax <code>true</code>, if the given maximal value is to be used; <code>false</code> otherwise
+	 * @param max maximal value
+	 * @param useSeed <code>true</code>, if the given seed is to be used; <code>false</code> otherwise
+	 * @param seed the seed for random number generator
+	 * @param name the name of the random numbers generator
+	 * @return the constructed random numbers generator
+	 */
+	public AbstractDistribution createRandomGenerator(int distribution, boolean useAvg, double avg, double stdev, boolean useMin, double min, boolean useMax, double max, boolean useSeed, long seed, String name) {
+		AbstractDistribution resultGenerator = null;
+		
+		if(useAvg == false && useMax == false && useMin == false)
+			return null;
+		
+		int validSeed = -1;
+		if (isBaseSeedSet()) { //use the base seed (has the highest priority)
+			validSeed = baseSeed.intValue();
+		} else if (useSeed) {
+			validSeed = (int) seed;
+		} else { //don't use seed
+			validSeed = (int) System.nanoTime();
+		}
+		
+		RandomEngine randomEngine = new MersenneTwister64(validSeed);
+		
+		switch (distribution) {
+		case ParameterAttributesDistributionType.CONSTANT_TYPE:
+			//this will result in a generator of constant values equal to avg
+			resultGenerator = new Normal(avg, 0.0, randomEngine); 
+			break;
+
+		case ParameterAttributesDistributionType.NORMAL_TYPE:
+			resultGenerator = new Normal(avg, stdev, randomEngine);
+			break;
+
+		case ParameterAttributesDistributionType.POISSON_TYPE:
+			resultGenerator = new Poisson(avg, randomEngine);
+			break;
+
+		case ParameterAttributesDistributionType.UNIFORM_TYPE:
+			resultGenerator = new Uniform(min, max, randomEngine);
+			break;
+			
+		case ParameterAttributesDistributionType.EXPONENTIAL_TYPE:
+			resultGenerator = new Exponential(avg, randomEngine);
+			break;
+			
+		case ParameterAttributesDistributionType.GAMMA_TYPE:
+			resultGenerator = new Gamma(avg, stdev, randomEngine);
+			break;
+
+		case ParameterAttributesDistributionType.HARMONIC_TYPE:
+			resultGenerator = null; //TODO finish implementation
+			break;
+		}
+		Double minValue = null;
+		Double maxValue = null;
+		boolean wrap = false; //indicates, whether the wrapper should be used
+		if (useMin) {
+			minValue = min;
+			wrap = true;
+		}
+		if (useMax) {
+			maxValue = max;
+			wrap = true;
+		}
+		if (wrap) //wrap the generator, only if necessary
+			resultGenerator = new MinMaxDistribution(resultGenerator, minValue, maxValue);
+		return resultGenerator;
+	}
+	
+	public void addIdGeneratorNameMapping(String id, String generatorName){
+		idMap.put(id, generatorName);
+	}
+	
+	public boolean containsElement(String id){
+		return idMap.containsKey(id);
+	}
+	
+	public String getGeneratorName(String id){
+		return idMap.get(id);
+	}
+	
+	public List<AbstractSpecificGenerator> getGenList(String arg){
+		return rndGenerators.get(arg);
+	}
+	
+	/**
+	 * Sets a new value of the base seed for this class. If a <code>null</code> value
+	 * is given, then the base seed is disabled.
+	 * @param baseSeed the new value of the base seed, or <code>null</code> if the base seed is to be disabled
+	 */
+	public static void setBaseSeed(Long baseSeed) {
+		RandomNumbers.baseSeed = baseSeed;
+	}
+	
+	public static boolean isBaseSeedSet() {
+		return (baseSeed != null);
+	}
+	
+	public static long getBaseSeed() {
+		return baseSeed;
+	}
+	
+	public static void clearBaseSeed() {
+		baseSeed = null;
+	}
+}
Index: DCWoRMS/trunk/src/simulator/DataCenterWorkloadSimulator.java
===================================================================
--- DCWoRMS/trunk/src/simulator/DataCenterWorkloadSimulator.java	(revision 477)
+++ DCWoRMS/trunk/src/simulator/DataCenterWorkloadSimulator.java	(revision 477)
@@ -0,0 +1,479 @@
+package simulator;
+
+//import eduni.cloudsim.GSSIM;
+import java.io.File;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.PrintStream;
+import java.security.InvalidParameterException;
+import java.text.NumberFormat;
+import java.util.Calendar;
+import java.util.Date;
+
+import javax.swing.JFileChooser;
+import javax.swing.filechooser.FileFilter;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.exolab.castor.xml.MarshalException;
+import org.exolab.castor.xml.ValidationException;
+import org.joda.time.DateTimeUtilsExt;
+import org.qcg.broker.schemas.jobdesc.QcgJob;
+
+import schedframe.Initializable;
+import schedframe.ResourceController;
+import simulator.reader.ResourceReader;
+import simulator.stats.AccumulatedStatistics;
+import simulator.stats.implementation.WormsStatistics;
+import simulator.utils.LogErrStream;
+import simulator.workload.WorkloadLoader;
+import simulator.workload.reader.archive.AbstractWAReader;
+import simulator.workload.reader.archive.WAReader;
+import simulator.workload.reader.xmlJob.QcgXmlJobReader;
+import simulator.workload.reader.xmlJob.XMLJobReader;
+import cern.jet.random.Uniform;
+import cern.jet.random.engine.MersenneTwister64;
+
+/**
+ * The main class of the Data Center Workload Scheduling Simulator. It has the
+ * {@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, WormsStatistics)} 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
+ * {@link #getAccumulatedStatistics()} method.
+ * 
+ * @author Stanislaw Szczepanowski & Wojciech Piatek
+ */
+public class DataCenterWorkloadSimulator {
+
+	/**
+	 * The name of the simulator application
+	 */
+	public static final String SIMULATOR_NAME = "Data Center Workload Simulator";
+
+	/**
+	 * Stores the statistical data of last run of the simulator (it may consist
+	 * of several runs of simulations)
+	 */
+	protected static AccumulatedStatistics accumulatedStatistics;
+
+	protected static int simulationRunNumber = 0;
+
+	/**
+	 * Determines the maximum fraction digits when printing floating point
+	 * values
+	 */
+	public static int MAXIMUM_FRACTION_DIGITS = 3;
+
+	/**
+	 * The format of the numbers that will be printed
+	 */
+	public static NumberFormat DFAULT_NUMBER_FORMAT = NumberFormat
+			.getInstance();
+	static {
+		DFAULT_NUMBER_FORMAT.setMaximumFractionDigits(MAXIMUM_FRACTION_DIGITS); // 0,001
+	}
+
+	private Log log = LogFactory.getLog(DataCenterWorkloadSimulator.class);
+
+	protected String statsOutputPath;
+
+
+	/**
+	 * Default empty constructor
+	 */
+	public DataCenterWorkloadSimulator() {
+	}
+
+	/**
+	 * The main method to start the simulation the accepted arguments are:
+	 * args[0] - the name of the resource bundle file with the configuration
+	 * args[1] (optional) - the number of simulations that are to be performed
+	 * (the default value is 1)
+	 * 
+	 * @param args
+	 *            the arguments passed to the application
+	 */
+	public static void main(String[] args) {
+		DataCenterWorkloadSimulator gssim = new DataCenterWorkloadSimulator();
+		gssim.run(args);
+	}
+
+	public void run(String args[]) {
+		System.setErr(new PrintStream(new LogErrStream(log)));
+
+		String propertiesFileName = null;
+		if (args.length == 0) {
+			JFileChooser ch = new JFileChooser(".");
+			FileFilter filter = new FileFilter() {
+				@Override
+				public boolean accept(File f) {
+					return f.getName().endsWith(".properties")
+							|| f.isDirectory();
+				}
+
+				@Override
+				public String getDescription() {
+					return "WoRMS experiment file";
+				}
+			};
+			ch.setFileFilter(filter);
+			ch.setDialogTitle("Choose the WoRMS simulation experiment file");
+			int result = ch.showOpenDialog(ch);
+			if (result == JFileChooser.APPROVE_OPTION) {
+				propertiesFileName = ch.getSelectedFile().getAbsolutePath();
+			} else {
+				if (log.isFatalEnabled())
+					log.fatal("Resource bundle file name was not provided.");
+				return;
+			}
+		} else if (args.length == 2 && "-multiuser".equals(args[0])) {
+			runMultiuser(args[1], this);
+			return;
+		} else {
+			propertiesFileName = args[0];
+		}
+
+		ConfigurationOptions configurationOptions = ConfigurationOptions
+				.getConfiguration(propertiesFileName);
+		int noOfSimulations = 1; // default value is one
+
+		if(configurationOptions.getNumberOfSimulations() > 1)
+			noOfSimulations = configurationOptions.getNumberOfSimulations();
+		else if (args.length == 2) {// second parameter is given
+			noOfSimulations = Integer.parseInt(args[1]);
+			if (noOfSimulations < 1) {
+				throw new InvalidParameterException(
+						"Number of simulations cannot be less than 1");
+			}
+		}
+
+		if (log.isInfoEnabled())
+			log.info(":: Starting " + SIMULATOR_NAME + ". " + noOfSimulations
+					+ " simulation runs will be performed. ::");
+
+		File outputDir = null;
+
+		try {
+			outputDir = prepareDirecotry(configurationOptions);
+		} catch (Exception e) {
+			if (log.isErrorEnabled())
+				log.error("FAILED to create the output path", e);
+			return;
+		}
+
+		File outputPropertiesFile = new File(outputDir, "experiment.properties");
+
+		accumulatedStatistics = new AccumulatedStatistics(noOfSimulations);
+		
+		for (int i = 0; i < noOfSimulations; ++i) {
+			simulationRunNumber++;
+			String simulationIdentifier = "Simulation " + (i + 1);
+			try {
+				performSimulation(simulationIdentifier,
+						configurationOptions); // run the simulation
+
+			} catch (Exception e) {
+				if (log.isErrorEnabled())
+					log.error("ERROR in simulation run \""
+							+ simulationIdentifier + "\":", e);
+				break;
+			}
+		}
+
+		if (log.isInfoEnabled())
+			log.info("Done :: " + SIMULATOR_NAME + " has finished "
+					+ noOfSimulations + " simulation runs ::");
+
+		System.out.flush();
+		System.err.flush();
+
+		try {
+			copyFile(new File(propertiesFileName), outputPropertiesFile);
+		} catch (IOException e) {
+			log.error("IO exception occured during copying properties file to output path");
+		}
+	}
+
+	private void runMultiuser(String rootDirPath, DataCenterWorkloadSimulator gssim) {
+		throw new RuntimeException("not supported yet");
+	}
+
+
+	/**
+	 * Starts a single simulation run.
+	 * 
+	 * @param options
+	 *            the configuration options according to which the simulation is
+	 *            to be performed
+	 * @param simulationStatistics
+	 *            the statistics object that is to be filled after the
+	 *            simulation run
+	 * @throws Exception
+	 *             any exception that may occur
+	 */
+	private void performSimulation(String simulationIdentifier,
+			ConfigurationOptions options) throws Exception {
+		// Startup of the random number generators must be set up with a random
+		// seed that is greater than zero
+		// if seed is not given then all consecutive simulations are the same
+		// if seed < 0 then the random numbers are equal to zero
+		Uniform uniform = new Uniform(new MersenneTwister64(new Date()));
+		// seed should be > 0 and fits to int size (which is also important)
+		long seed = uniform.nextLongFromTo(1, Integer.MAX_VALUE);
+		if (log.isDebugEnabled())
+			log.debug("Shuffled initial seed: " + seed);
+
+		assert seed > 0 && seed <= Integer.MAX_VALUE : "Initial seed is <= 0, what is improper";
+		
+		GridSimWrapper.setSeed(seed);
+		GridSimWrapper.setTraceSettings();
+		
+		long startSimulation = System.currentTimeMillis();
+		if (log.isInfoEnabled()) {
+			log.info(":: Starting simulation run: \"" + simulationIdentifier
+					+ "\" ::");
+			log.info(":: In the the mode of ");
+		}
+
+		WorkloadLoader workload = loadWorkload(options);
+	
+		// BEGIN: Initializing the GridSim:
+		int numUser = 1; // the number of users in the experiment simulation
+		// (default 1)
+		
+		Date date = workload.getSimulationStartTime();
+		Calendar calendar = Calendar.getInstance();
+		if (date == null)
+			calendar.setTimeInMillis(0L);
+		else
+			calendar.setTime(date);
+
+		boolean traceFlag = true; // means: trace GridSim events/activities
+		String[] excludeFromFile = { "" }, excludeFromProcessing = { "" };
+		
+		GridSimWrapper.init(numUser, calendar, traceFlag, excludeFromFile,
+				excludeFromProcessing, null);
+		DateTimeUtilsExt.initVirtualTimeAccess(calendar);
+
+		ResourceReader resourceReader = new ResourceReader(
+				options);
+		ResourceController rc = resourceReader.read();
+
+		while(!rc.getToInit().isEmpty()){
+			Initializable initObj = rc.getToInit().pop();
+			initObj.initiate();
+		}
+		rc.setInitList(null);
+		
+		WormsUsers wl = new WormsUsers("Users",
+				rc.getScheduler().get_name(), workload);
+		
+		GridSimWrapper.startSimulation();
+		long stopSimulation = System.currentTimeMillis();
+
+		WormsStatistics stats = new WormsStatistics(simulationIdentifier,
+				options, wl, statsOutputPath, rc);
+		accumulatedStatistics.add(stats);
+		if (log.isInfoEnabled())
+			log.info("Generating statistics...");
+		stats.generateStatistics();
+
+		long duration = (stopSimulation - startSimulation) / 1000;
+		if (log.isInfoEnabled())
+			log.info("The simulation run took " + duration + " seconds");
+
+		// if necessary generate gifs from sjvg - need to rewrite the SJVG
+		// classes for public methods
+		if (log.isInfoEnabled())
+			log.info(":: Finished simulation run: \"" + simulationIdentifier
+					+ "\" ::");
+
+		System.out.flush();
+		System.err.flush();
+	}
+
+	private WorkloadLoader loadWorkload(ConfigurationOptions options) throws IOException, MarshalException, ValidationException{
+		XMLJobReader<QcgJob> xmlJobReader = null;
+		WAReader<QcgJob> swfReader = null;
+
+		String wlFileName = options.inputWorkloadFileName;
+
+		if (options.inputFolder != null) {
+			File f = null;
+			if (options.inputTar != null) {
+				f = new File(options.inputFolder + File.separator
+						+ options.inputTar);
+			} else {
+				f = new File(options.inputFolder);
+			}
+
+			xmlJobReader = new QcgXmlJobReader(f);
+
+			wlFileName = options.inputFolder + File.separator
+					+ options.inputWorkloadFileName;
+		}
+
+		swfReader = AbstractWAReader.getInstace(wlFileName);
+
+		WorkloadLoader workload = new WorkloadLoader(xmlJobReader, swfReader);
+		workload.load();
+
+		return workload;
+	}
+	
+
+	private File prepareDirecotry(ConfigurationOptions options) throws Exception {
+		// String statsOutputPath = null;
+		if (options.createScenario) {
+			File outputFolderFile = new File(options.outputFolder);
+			if (!outputFolderFile.exists()) {
+				if (!outputFolderFile.mkdirs())
+					throw new IOException("Cannot create the output path: "
+							+ statsOutputPath + ". Cause: ");
+			}
+
+			if (log.isInfoEnabled())
+				log.info("CREATING SCENARIO ::");
+			statsOutputPath = options.outputFolder
+					+ options.statsOutputSubfolderNameCreate;
+		} else {
+			if (log.isInfoEnabled())
+				log.info("READING SCENARIO ::");
+			String prefix = null;
+			if (options.inputFolder != null) {
+				prefix = options.inputFolder;
+			} else if (options.inputWorkloadFileName != null) {
+				prefix = new File(options.inputWorkloadFileName).getParent();
+			} else {
+				prefix = System.getProperty("user.dir");
+			}
+			statsOutputPath = prefix + File.separator
+					+ options.statsOutputSubfolderNameRerad;
+		}
+		statsOutputPath += File.separator;
+
+		// create the output folder
+		File statsOutputPathFile = new File(statsOutputPath);
+		if (!statsOutputPathFile.exists()) {
+			if (!statsOutputPathFile.mkdirs())
+				throw new IOException("Cannot create the output (stats) path: "
+						+ statsOutputPath + ". Cause: ");
+		}
+
+		File folder = new File(statsOutputPath);
+		File fileList[] = folder.listFiles();
+		for (int i = 0; i < fileList.length; i++) {
+			File tmpFile = fileList[i];
+			String name = tmpFile.getName();
+			if (name.length() > 4) {
+				String subName = name.substring(0, 5);
+				if (subName.compareTo("Chart") == 0
+						|| subName.compareTo("Stats") == 0) {
+					tmpFile.delete();
+				}
+			}
+		}
+		return statsOutputPathFile;
+	}
+
+	/**
+	 * Removes the given directory no matter if it is empty or non empty. If the
+	 * given parameter represents a file, it is not deleted. See the description
+	 * of the return statement.
+	 * 
+	 * @param dirPath
+	 *            the file representing the directory to be deleted.
+	 * @return true, if the given directory with all its contents have been
+	 *         remove; false if deletion of any of files ended with error (all
+	 *         other files are possibly also deleted)
+	 */
+	private static boolean deleteDirectory(File dirPath) {
+		if (dirPath.exists() && dirPath.isDirectory()) {
+			boolean result = true;
+			File[] files = dirPath.listFiles();
+			for (File file : files) {
+				if (file.isFile())
+					result |= file.delete();
+				else
+					result |= deleteDirectory(file);
+			}
+			result |= dirPath.delete();
+			return result;
+		}
+		return false; // it is not a directory
+	}
+	
+	/**
+	 * Static method to move a file from given "from" location to "to" location
+	 * 
+	 * @param from
+	 *            from location
+	 * @param to
+	 *            to location
+	 * @return true if the operation succeeded, false otherwise
+	 */
+	private static boolean moveFile(String from, String to) {
+		File fromFile = new File(from);
+		File toFile = new File(to);
+		if (toFile.exists()) {
+			if (!toFile.delete())
+				return false;
+		}
+		if (!fromFile.renameTo(toFile)) {
+			return false;
+		}
+		return true;
+	}
+	
+	private void copyFile(File inputFile, File outputFile) throws IOException {
+
+		FileReader in = new FileReader(inputFile);
+		FileWriter out = new FileWriter(outputFile);
+		int c;
+
+		while ((c = in.read()) != -1)
+			out.write(c);
+
+		in.close();
+		out.close();
+	}
+
+	/**
+	 * Returns the accumulated simulation statistics from the last run of the
+	 * simulator
+	 * 
+	 * @return the accumulated simulation statistics from the last run of the
+	 *         simulator
+	 */
+	public static AccumulatedStatistics getAccumulatedStatistics() {
+		return accumulatedStatistics;
+	}
+
+	public static int getSimulationRunNumber(){
+		return simulationRunNumber;
+	}
+	
+	protected class WorkloadDirectoryFilter implements java.io.FileFilter {
+
+		public boolean accept(File file) {
+			if (file.isDirectory() && file.getName().startsWith("workload"))
+				return true;
+			else
+				return false;
+		}
+	}
+
+	protected class PropertiesFileFilter implements java.io.FileFilter {
+
+		public boolean accept(File file) {
+			if (file.isFile() && file.getName().endsWith(".properties"))
+				return true;
+			else
+				return false;
+		}
+	}
+
+}
Index: DCWoRMS/trunk/src/test/stress/MemoryAndTimeAnalyzer.java
===================================================================
--- DCWoRMS/trunk/src/test/stress/MemoryAndTimeAnalyzer.java	(revision 477)
+++ DCWoRMS/trunk/src/test/stress/MemoryAndTimeAnalyzer.java	(revision 477)
@@ -0,0 +1,490 @@
+package test.stress;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.lang.management.MemoryMXBean;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Properties;
+import java.awt.Toolkit;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import simulator.DataCenterWorkloadSimulator;
+
+/**
+ * Class responsible for performin memory and time analysis of experiments
+ * execution.
+ * 
+ * @author Jarek Szymczak
+ * @version $Id$
+ */
+public class MemoryAndTimeAnalyzer {
+
+	/** The class logger. */
+	private static final Log LOGGER =
+			LogFactory.getLog(MemoryAndTimeAnalyzer.class);
+
+	/** The properties. */
+	private static Properties properties = new Properties();
+
+	/**
+	 * Variables determinig what type of memories should be meassured and should
+	 * it be performed in detailed or simple way.
+	 */
+	private static boolean heap, nonHeap, jvm, heapDet, nonHeapDet, jvmDet;
+
+	/**
+	 * Determines if the time is meassured precisly (it's not disturb with
+	 * memory meassuring).
+	 */
+	private static boolean timePrec;
+
+	/** Memory details output stream. */
+	private static FileOutputStream outDetails;
+
+	/** The current number of iterations - used for progress calculation. */
+	private static int currentNumberOfIterations;
+
+	/** The total number of iterations - used for progress calculation. */
+	private static int totalNumberOfIterations;
+
+	/** Number of repeats of each experiments. */
+	private static int repeats;
+
+	/**
+	 * It stores information about amount of system memory in a certain machine
+	 * (in megabytes).
+	 */
+	private static int memoryInMB;
+
+	/** The interval between memory checks (in miliseconds). */
+	private static int interval;
+
+	/**
+	 * The object used for gathering the information about heap and non-heap
+	 * memory.
+	 */
+	private static MemoryMXBean memoryMXBean =
+			java.lang.management.ManagementFactory.getMemoryMXBean();
+
+	/**
+	 * The GSSIM object which is analyzed with certain experiment (for each
+	 * experiment new object is created, and the old one is dereferenced and
+	 * deleted (probably).
+	 */
+	private static DataCenterWorkloadSimulator gssim =
+			new DataCenterWorkloadSimulator();
+
+	/**
+	 * Variables helpful during time and memory consumption analysis (they're
+	 * not local to simplify working with the thread responsible for memory
+	 * analysis and to write the details to outDetails output stream.
+	 */
+	private static long timestart, hmemstart, hmemmax, nmemmax, jvmmemmax,
+			timend;
+
+	/**
+	 * Performs memory and time analysis of a single file.
+	 * 
+	 * @param filename
+	 *            experiment file path
+	 * @param iteration
+	 *            iteration number
+	 * @return array with results: time, heap memory, non-heap memory and JVM
+	 *         memory
+	 * @throws InterruptedException
+	 *             the interrupted exception when thread was interrupted during
+	 *             sleep
+	 */
+	private static double[] singleTask(String filename, int iteration)
+			throws InterruptedException {
+		double[] result = new double[4];
+
+		Thread t = new Thread() {
+			public void run() {
+				long htemp, ntemp, jvmtemp;
+				hmemmax = hmemstart;
+				nmemmax = 0;
+				jvmmemmax = 0;
+				try {
+					while (!interrupted()) {
+
+						sleep(interval);
+
+						htemp =
+								heap ? memoryMXBean.getHeapMemoryUsage()
+										.getUsed() : 0;
+						ntemp =
+								nonHeap ? memoryMXBean.getNonHeapMemoryUsage()
+										.getUsed() : 0;
+						jvmtemp = jvm ? getJVMMemory() : 0;
+
+						if (htemp > hmemmax)
+							hmemmax = htemp;
+						if (ntemp > nmemmax)
+							nmemmax = ntemp;
+						if (htemp > jvmmemmax)
+							jvmmemmax = jvmtemp;
+
+						if (heapDet)
+							outDetails.write(String.format("%.3f\t",
+									(hmemmax - hmemstart) / (1024.0 * 1024.0))
+									.getBytes("UTF-8"));
+
+						if (nonHeapDet)
+							outDetails.write(String.format("%.3f\t",
+									nmemmax / (1024.0 * 1024.0)).getBytes(
+									"UTF-8"));
+
+						if (jvmDet)
+							outDetails.write(String.format("%.3f\t",
+									jvmmemmax / (1024.0 * 1024.0)).getBytes(
+									"UTF-8"));
+
+						if (heapDet || nonHeapDet || jvmDet)
+							outDetails.write("\n".getBytes("UTF-8"));
+					}
+				} catch (InterruptedException e) {
+					return;
+				} catch (IOException e) {
+					// if this happens it's very bad,,, but it's totally
+					// unexpected - only if there's a problem with closing
+					// stream from ps process
+					throw new RuntimeException(e);
+				}
+			}
+		};
+
+		try {
+			if (heapDet || nonHeapDet || jvmDet)
+				outDetails.write(("\n\n" + filename + " (iteration: "
+						+ Integer.toString(iteration) + ") \n\n")
+						.getBytes("UTF-8"));
+			if (heapDet)
+				outDetails.write("Hmem\t".getBytes("UTF-8"));
+			if (nonHeapDet)
+				outDetails.write("Nmem\t".getBytes("UTF-8"));
+			if (jvmDet)
+				outDetails.write("JVMmem\t".getBytes("UTF-8"));
+			if (heapDet || nonHeapDet || jvmDet)
+				outDetails.write("\n".getBytes("UTF-8"));
+		} catch (IOException e) {
+			// if this happens it's very bad,,, but it's totally unexpected
+			throw new RuntimeException(e);
+		}
+
+		LOGGER.info("Current progress in number of experiments performed: "
+				+ Integer.toString(currentNumberOfIterations)
+				+ " / "
+				+ Integer.toString(totalNumberOfIterations)
+				+ " ("
+				+ Integer.toString((currentNumberOfIterations) * 100
+						/ totalNumberOfIterations) + "%)");
+
+		currentNumberOfIterations++;
+
+		gssim = null;
+
+		for (int i = 0; i < 5; i++) {
+			Thread.sleep(600);
+			System.gc();
+		}
+
+		hmemstart = memoryMXBean.getHeapMemoryUsage().getUsed();
+		gssim = new DataCenterWorkloadSimulator();
+
+		if (heap || nonHeap || jvm)
+			t.start();
+
+		timestart = System.currentTimeMillis();
+		gssim.run(new String[] { filename });
+		timend = System.currentTimeMillis();
+
+		if (heap || nonHeap || jvm) {
+			t.interrupt();
+			t.join();
+
+			if (timePrec) {
+				gssim = null;
+				for (int i = 0; i < 5; i++)
+					System.gc();
+				gssim = new DataCenterWorkloadSimulator();
+
+				timestart = System.currentTimeMillis();
+				gssim.run(new String[] { filename });
+				timend = System.currentTimeMillis();
+			}
+		}
+
+		result[0] = (timend - timestart) / 1000.0;
+		result[1] = (hmemmax - hmemstart) / (1024.0 * 1024.0);
+		result[2] = nmemmax / (1024.0 * 1024.0);
+		result[3] = jvmmemmax / (1024.0 * 1024.0);
+
+		return result;
+	}
+
+	/**
+	 * Repeats task number specified in variable "repeats" times
+	 * 
+	 * @param filename
+	 *            experiment filename
+	 * @return the formatted line with results (content depends on
+	 *         configuration)
+	 * @throws InterruptedException
+	 *             thrown when thread is interrupted during sleep
+	 */
+	private static String repeatTask(String filename)
+			throws InterruptedException {
+
+		double[] temp;
+
+		double tavg = 0;
+		double tstdev = 0;
+		double hmavg = 0;
+		double hmstdev = 0;
+		double nmstdev = 0;
+		double nmavg = 0;
+		double jvmmavg = 0;
+		double jvmmstdev = 0;
+
+		for (int i = 0; i < repeats; i++) {
+			temp = singleTask(filename, i);
+			tavg += temp[0];
+			tstdev += temp[0] * temp[0];
+			hmavg += temp[1];
+			hmstdev += temp[1] * temp[1];
+			nmavg += temp[2];
+			nmstdev += temp[2] * temp[2];
+			jvmmavg += temp[3];
+			jvmmstdev += temp[3] * temp[3];
+		}
+
+		tavg /= repeats;
+		tstdev /= repeats;
+		hmavg /= repeats;
+		hmstdev /= repeats;
+		nmavg /= repeats;
+		nmstdev /= repeats;
+		jvmmavg /= repeats;
+		jvmmstdev /= repeats;
+
+		tstdev = Math.sqrt(tstdev - tavg * tavg);
+		hmstdev = Math.sqrt(hmstdev - hmavg * hmavg);
+		nmstdev = Math.sqrt(nmstdev - nmavg * nmavg);
+		jvmmstdev = Math.sqrt(jvmmstdev - jvmmavg * jvmmavg);
+
+		StringBuilder result =
+				new StringBuilder(String.format("%.3f\t%.3f\t", tavg, tstdev));
+
+		if (heap)
+			result.append(String.format("%.3f\t%.3f\t", hmavg, hmstdev));
+		if (nonHeap)
+			result.append(String.format("%.3f\t%.3f\t", nmavg, nmstdev));
+		if (jvm)
+			result.append(String.format("%.3f\t%.3f\t", jvmmavg, jvmmstdev));
+
+		return result.toString();
+	}
+
+	/**
+	 * Gets the JVM memory. It works only under linux and only if the process
+	 * name begins with "java" (so, for instance, it doesn't work when the
+	 * application is run under Eclipse SDK). It depends on {@link #memoryInMB}
+	 * variable
+	 * 
+	 * @return amount of memory used by JVM process (in bytes)
+	 * @throws IOException
+	 *             Signals that an I/O exception has occurred.
+	 */
+	public static Long getJVMMemory() throws IOException {
+		BufferedReader reader = null;
+		try {
+			Process proc =
+					Runtime
+							.getRuntime()
+							.exec(
+									new String[] { "bash", "-c",
+											"ps u --width=5 | grep java | tr -s ' ' | cut -d ' ' -f 4" });
+			reader =
+					new BufferedReader(new InputStreamReader(proc
+							.getInputStream()));
+
+			String line;
+			if (null != (line = reader.readLine())) {
+				return Math.round(Double.parseDouble(line) / 100.0 * memoryInMB
+						* 1024.0 * 1024.0);
+			}
+			return null;
+		} catch (IOException e) {
+			System.out.println(e.getMessage());
+			return null;
+		} finally {
+			if (reader != null)
+				reader.close();
+		}
+
+	}
+
+	/**
+	 * The main method. It reads the properties of analysis from file
+	 * "properties/performance.properties" - this path is relative so it's
+	 * important from which folder the application is run. Meaning of each
+	 * property is described in the .properties file, please do not change it's
+	 * content other than parameters' values
+	 * 
+	 * @param args
+	 *            the arguments of main methods are relative paths to
+	 *            .properties files with experiments or directories containing
+	 *            these files (it's not recursive)
+	 * @throws IOException
+	 *             Signals that an I/O exception has occurred.
+	 * @throws InterruptedException
+	 *             fall-through exception which is not possible to occur
+	 */
+	public static void main(String[] args) throws IOException,
+			InterruptedException {
+
+		LOGGER.info("Reading the properties");
+
+		properties.load(new FileInputStream(new File(
+				"properties/performance.properties")));
+
+		int noOfBeeps =
+				Integer.parseInt(properties.getProperty("NO_OF_BEEPS", "0"));
+
+		interval = Integer.parseInt(properties.getProperty("INTERVAL"));
+		repeats = Integer.parseInt(properties.getProperty("REPEATS"));
+		memoryInMB = Integer.parseInt(properties.getProperty("MEMORY_IN_MB"));
+
+		heap =
+				"simple".equals(properties.getProperty("HEAP_MEMORY"))
+						|| "details".equals(properties
+								.getProperty("HEAP_MEMORY"));
+		heapDet = "details".equals(properties.getProperty("HEAP_MEMORY"));
+		nonHeap =
+				"simple".equals(properties.getProperty("NON_HEAP_MEMORY"))
+						|| "details".equals(properties
+								.getProperty("NON_HEAP_MEMORY"));
+		nonHeapDet =
+				"details".equals(properties.getProperty("NON_HEAP_MEMORY"));
+		jvm =
+				"simple".equals(properties.getProperty("JVM_MEMORY"))
+						|| "details".equals(properties
+								.getProperty("JVM_MEMORY"));
+		jvmDet = "details".equals(properties.getProperty("JVM_MEMORY"));
+
+		timePrec = (!jvm && !heap && !nonHeap);
+
+		if ("precisly".equals(properties.getProperty("TIME_MEASURING")))
+			timePrec = true;
+
+		LOGGER.info("Preparing file list to perform experiment");
+
+		List<String> records = new ArrayList<String>();
+
+		File temp;
+
+		if (args.length < 1)
+			return;
+
+		for (int i = 0; i < args.length; i++) {
+			if ((new File(args[i])).exists())
+				if (args[i].endsWith(".properties"))
+					records.add(args[i]);
+				else {
+					temp = new File(args[i]);
+					String[] files = temp.list();
+					if (files != null) {
+						for (String file : files) {
+							if ((new File(args[i] + "/" + file).exists() && file
+									.endsWith(".properties")))
+								records.add(args[i] + "/" + file);
+						}
+					}
+				}
+		}
+
+		totalNumberOfIterations = repeats * records.size();
+
+		if (records.size() == 0)
+			return;
+
+		int counter = 0;
+		File file = null;
+		File fileDetails = null;
+
+		do {
+			counter++;
+			file =
+					new File("performance_result_" + Integer.toString(counter)
+							+ ".txt");
+			fileDetails =
+					new File("performance_result_" + Integer.toString(counter)
+							+ "_details.txt");
+		} while (file.exists() || fileDetails.exists());
+
+		FileOutputStream out = new FileOutputStream(file);
+
+		if (heapDet || nonHeapDet || jvmDet)
+			outDetails = new FileOutputStream(fileDetails);
+
+		StringBuilder header = new StringBuilder("Measuring time precisly: ");
+
+		if (timePrec)
+			header.append("yes\n");
+		else
+			header.append("no\n");
+
+		header.append(String.format("Number of repets: %d\n", repeats));
+		header.append(String.format(
+				"Interval between memory checking: %d ms\n", interval));
+		header.append(String.format("System memory: %d MB\n\n", memoryInMB));
+
+		header.append("Name\tTavg\tTstdev\t");
+
+		if (heap)
+			header.append("HMavg\tHMstdev\t");
+		if (nonHeap)
+			header.append("NMavg\tNMstdev\t");
+		if (jvm)
+			header.append("JVMMavg\tJVMMstdev\t");
+		header.append('\n');
+
+		LOGGER.info("Measuring of performance begun");
+
+		try {
+
+			out.write(header.toString().getBytes("UTF-8"));
+			if (heapDet || nonHeapDet || jvmDet)
+				outDetails
+						.write(("Detailed analysis of memory usage with interval: "
+								+ interval + "ms\n\n").getBytes("UTF-8"));
+			Collections.sort(records);
+			for (String record : records) {
+				out.write((record + "\t" + repeatTask(record) + "\n")
+						.getBytes("UTF-8"));
+			}
+		} finally {
+			if (out != null)
+				out.close();
+			if (outDetails != null)
+				outDetails.close();
+		}
+
+		LOGGER.info("Measuring of performance ended succesfully");
+
+		for (int i = 0; i < noOfBeeps; i++) {
+			Toolkit.getDefaultToolkit().beep();
+			Thread.sleep(1000);
+		}
+	}
+
+}
Index: DCWoRMS/trunk/src/test/stress/TasksExperimentsGenerator.java
===================================================================
--- DCWoRMS/trunk/src/test/stress/TasksExperimentsGenerator.java	(revision 477)
+++ DCWoRMS/trunk/src/test/stress/TasksExperimentsGenerator.java	(revision 477)
@@ -0,0 +1,235 @@
+package test.stress;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+import java.util.Map.Entry;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import simulator.workload.generator.WorkloadGenerator;
+import simulator.workload.reader.archive.swf.SWFParser;
+import simulator.workload.writer.swf.QcgSWFJobWriter;
+
+/**
+ * Class responsible for generating experiments based on amount and range of
+ * tasks.
+ * 
+ * @author Jarek Szymczak
+ * @version $Id$
+ */
+public class TasksExperimentsGenerator extends AbstractExperimentsGenerator {
+
+	/** Class logger. */
+	private static final Log LOGGER =
+			LogFactory.getLog(TasksExperimentsGenerator.class);
+
+	/**
+	 * It runs the resource range / values based generation
+	 * 
+	 * @param args
+	 *            the following arguments (other are not allowed - arguments
+	 *            predecessed by "#" are integers):
+	 *            <ul>
+	 *            <li><b>-g #start #step #end</b> - experiments with tasks
+	 *            range from #start to #end with step #step will be generated
+	 *            <li><b>-v #tasks_1 ... #tasks_n</b> - experiments with
+	 *            #tasks_1, ..., #tasks_n number of tasks will be generated
+	 *            </ul>
+	 * @return path to directory containing generated experiments
+	 * @throws FileNotFoundException
+	 *             one of necessary files was not found
+	 * @throws IOException
+	 *             signals that an I/O exception has occurred
+	 */
+	public String run(String args[]) throws FileNotFoundException, IOException {
+
+		long max = 0;
+		long[] values = null;
+
+		if (args[0].equals("-g")) {
+
+			long start = Long.parseLong(args[1]);
+			long step = Long.parseLong(args[2]);
+			max = Long.parseLong(args[3]);
+
+			values =
+					new long[(int) Math.ceil((double) (max - start)
+							/ (double) step)];
+			int i = 0;
+			for (long j = start; j < max; j += step) {
+				values[i++] = j;
+			}
+		} else if (args[0].equals("-v")) {
+			values = new long[args.length - 2];
+			for (int i = 1; i < args.length - 1; i++)
+				values[i - 1] = Long.parseLong(args[i]);
+			max = Long.parseLong(args[args.length - 1]);
+		} else {
+			throw new RuntimeException("Class must be launched with -v or -g");
+		}
+
+		LOGGER.info("Generating workload from range: "
+				+ Long.toString(values[0]) + "-" + Long.toString(max));
+
+		Properties variables = new Properties();
+		FileInputStream fis = null;
+		try {
+			fis =
+					new FileInputStream(new File(
+							"properties/variables.properties"));
+			variables.load(fis);
+		} catch (FileNotFoundException e) {
+			LOGGER
+					.error("Could not find variables.properties file, application will terminate!");
+			throw new RuntimeException(e);
+		} catch (IOException e) {
+			LOGGER
+					.error("Problems with I/O operations while trying to load variables.properties file, application will terminate!");
+			throw new RuntimeException(e);
+		} finally {
+			try {
+				if (fis != null)
+					fis.close();
+			} catch (IOException e) {
+				LOGGER
+						.error("An error occured while closing the stream with variables");
+			}
+		}
+
+		variables.setProperty("MAX_TASKS_NO", Long.toString(max));
+
+		createFileFromTemplate("properties/generator_template.properties",
+				"properties/generator.properties", variables);
+		createFileFromTemplate("properties/generator_template.xml",
+				"properties/generator.xml", variables);
+
+		deleteDirectory(new File(variables.getProperty("EXP_PATH")));
+
+		File dir =
+				new File(variables.getProperty("EXP_PATH") + "/"
+						+ variables.getProperty("MAX_TASKS_NO"));
+
+		if (!dir.exists()) {
+			try {
+				dir.mkdirs();
+			} catch (SecurityException e) {
+				LOGGER
+						.error("Security violation while trying to create directories: "
+								+ dir.getAbsolutePath() + "!");
+			}
+		}
+
+		String parameters[] = { "properties/generator.properties" };
+		WorkloadGenerator.main(parameters); // deleteDirectory(new File("raz"));
+		LOGGER.info("Dividing max number of tasks among other values");
+		for (long i : values) {
+
+			LOGGER.debug("Workload with " + Long.toString(i)
+					+ " tasks is about to be truncated");
+			variables.setProperty("TASKS_NO", Long.toString(i));
+
+			copyFiles(i, variables.getProperty("EXP_PATH") + "/"
+					+ variables.getProperty("MAX_TASKS_NO"), variables
+					.getProperty("EXP_PATH")
+					+ "/" + variables.getProperty("TASKS_NO"), variables);
+
+			truncWorkloadFile(i, variables.getProperty("EXP_PATH") + "/"
+					+ variables.getProperty("MAX_TASKS_NO") + "/"
+					+ variables.getProperty("WORKLOAD_FILENAME"), variables
+					.getProperty("EXP_PATH")
+					+ "/"
+					+ variables.getProperty("TASKS_NO")
+					+ "/"
+					+ variables.getProperty("WORKLOAD_FILENAME"));
+
+			int zeroes =
+					variables.getProperty("MAX_TASKS_NO").length()
+							- variables.getProperty("TASKS_NO").length();
+			StringBuilder expPropertiesNo = new StringBuilder();
+			for (int j = 0; j < zeroes; j++)
+				expPropertiesNo.append('0');
+			expPropertiesNo.append(variables.getProperty("TASKS_NO"));
+			expPropertiesNo.append(".properties");
+
+			createFileFromTemplate(
+					"properties/reservation_template.properties", variables
+							.getProperty("EXP_PATH")
+							+ "/" + expPropertiesNo.toString(), variables);
+			LOGGER.debug("Workload with " + Long.toString(i)
+					+ " tasks truncating finished");
+		}
+
+		variables
+				.setProperty("TASKS_NO", variables.getProperty("MAX_TASKS_NO"));
+
+		createFileFromTemplate("properties/reservation_template.properties",
+				variables.getProperty("EXP_PATH") + "/"
+						+ variables.getProperty("TASKS_NO") + ".properties",
+				variables);
+
+		LOGGER.info("Division of tasks finished");
+
+		return variables.getProperty("EXP_PATH");
+	}
+
+	/**
+	 * It truncates workload file.
+	 * 
+	 * @param numberOfExperiments
+	 *            the number of experiments contained in originalWorkloadPath to
+	 *            save in truncWorkloadPath
+	 * @param originalWorkloadPath
+	 *            the original workload path
+	 * @param truncWorkloadPath
+	 *            the truncated workload path
+	 * @throws IOException
+	 *             Signals that an I/O exception has occurred.
+	 */
+	private void truncWorkloadFile(long numberOfExperiments,
+			String originalWorkloadPath, String truncWorkloadPath)
+			throws IOException {
+
+		SWFParser swfParser = null;
+		QcgSWFJobWriter jobWriter = null;
+
+		try {
+			swfParser = new SWFParser(originalWorkloadPath);
+			File temp = new File(truncWorkloadPath);
+			jobWriter = new QcgSWFJobWriter(temp.getParent(), temp.getName());
+
+			Map<String, String> header = swfParser.loadHeader();
+			Set<Entry<String, String>> commentsEntrySet = header.entrySet();
+			header.entrySet();
+
+			for (Entry<String, String> entry : commentsEntrySet) {
+				jobWriter.writeComment(entry.getKey(), entry.getValue());
+			}
+
+			Map<String, String[]> mapping = swfParser.getIDMapping();
+			String[] singleJob = null;
+			String[] singleJobMapping = null;
+
+			for (long i = 0; i < numberOfExperiments; i++) {
+				singleJob = swfParser.readTask();
+				singleJobMapping = mapping.get(Long.toString(i));
+
+				jobWriter.writeLine(singleJob);
+				jobWriter.addTaskMapping(Long.toString(i), singleJobMapping[0],
+						singleJobMapping[1]);
+			}
+
+		} finally {
+			if (swfParser != null)
+				swfParser.close();
+			if (jobWriter != null)
+				jobWriter.close();
+		}
+
+	}
+}
Index: DCWoRMS/trunk/src/test/stress/ResourcesExperimentsGenerator.java
===================================================================
--- DCWoRMS/trunk/src/test/stress/ResourcesExperimentsGenerator.java	(revision 477)
+++ DCWoRMS/trunk/src/test/stress/ResourcesExperimentsGenerator.java	(revision 477)
@@ -0,0 +1,233 @@
+package test.stress;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.IOException;
+import java.util.Properties;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import simulator.workload.generator.WorkloadGenerator;
+
+/**
+ * Class responsible for generating experiments based on amount and range of
+ * resources and a certain amount of tasks.
+ * 
+ * @author Jarek Szymczak
+ * @version $Id$
+ */
+public class ResourcesExperimentsGenerator extends AbstractExperimentsGenerator {
+
+	/** Class logger. */
+	private static final Log LOGGER =
+			LogFactory.getLog(ResourcesExperimentsGenerator.class);
+
+	/**
+	 * It runs the resource range / values based generation.
+	 * 
+	 * @param args
+	 *            the following arguments (other are not allowed - arguments
+	 *            predecessed by "#" are integers):
+	 *            <ul>
+	 *            <li><b>-g #tasks #start #step #end</b> - experiments with
+	 *            #tasks number of tasks will be generated for range of
+	 *            resources from #start to #end with step #step
+	 *            <li><b>-v #tasks #resources_1 ... #resources_n</b> -
+	 *            experiments with #tasks number of tasks will be generated for
+	 *            #resources_1, ..., #resources_n number of resources
+	 *            </ul>
+	 * @return path to directory containing generated experiments
+	 */
+	public String run(String args[]) {
+
+		long max = 0;
+		long tasks = 0;
+		long[] values = null;
+
+		if (args[0].equals("-g")) {
+
+			tasks = Long.parseLong(args[1]);
+			long start = Long.parseLong(args[2]);
+			long step = Long.parseLong(args[3]);
+			max = Long.parseLong(args[4]);
+
+			values =
+					new long[(int) Math.ceil((double) (max - start)
+							/ (double) step) + 1];
+			for (long j = start; j <= max; j += step) {
+				values[(int) ((j - start) / step)] = j;
+			}
+		} else if (args[0].equals("-v")) {
+			tasks = Long.parseLong(args[1]);
+			values = new long[args.length - 2];
+			max = Long.parseLong(args[args.length - 1]);
+			for (int i = 2; i < args.length; i++) {
+				values[i - 2] = Long.parseLong(args[i]);
+			}
+		} else {
+			throw new RuntimeException("Class must be launched with -v or -g");
+		}
+
+		LOGGER
+				.info("Generating workload from range (for resource experiments): "
+						+ Long.toString(values[0]) + "-" + Long.toString(max));
+
+		Properties variables = new Properties();
+		FileInputStream fis = null;
+		try {
+			fis =
+					new FileInputStream(new File(
+							"properties/variables.properties"));
+			variables.load(fis);
+		} catch (FileNotFoundException e) {
+			LOGGER
+					.error("Could not find variables.properties file, application will terminate!");
+			throw new RuntimeException(e);
+		} catch (IOException e) {
+			LOGGER
+					.error("Problems with I/O operations while trying to load variables.properties file, application will terminate!");
+			throw new RuntimeException(e);
+		} finally {
+			try {
+				if (fis != null)
+					fis.close();
+			} catch (IOException e) {
+				LOGGER
+						.error("An error occured while closing the stream with variables");
+			}
+		}
+
+		variables
+				.setProperty("EXP_PATH", variables.getProperty("RES_EXP_PATH"));
+
+		variables.setProperty("MAX_RES_NO", Long.toString(max));
+
+		variables.setProperty("MAX_TASKS_NO", Long.toString(tasks));
+
+		try {
+			createFileFromTemplate("properties/generator_template.properties",
+					"properties/generator.properties", variables);
+			createFileFromTemplate("properties/generator_template.xml",
+					"properties/generator.xml", variables);
+		} catch (IOException e) {
+			LOGGER
+					.error("Error while trying to generate files needed for generation of tasks, applcation will terminate!");
+			throw new RuntimeException(e);
+		}
+
+		deleteDirectory(new File(variables.getProperty("EXP_PATH")));
+
+		File dir =
+				new File(variables.getProperty("EXP_PATH") + "/"
+						+ variables.getProperty("MAX_TASKS_NO"));
+
+		if (!dir.exists()) {
+			try {
+				dir.mkdirs();
+			} catch (SecurityException e) {
+				LOGGER
+						.error("Security violation while trying to create directories: "
+								+ dir.getAbsolutePath() + "!");
+			}
+		}
+
+		String parameters[] = { "properties/generator.properties" };
+		WorkloadGenerator.main(parameters);
+
+		LOGGER.info("Dividing max number of tasks among other values");
+
+		variables
+				.setProperty("TASKS_NO", variables.getProperty("MAX_TASKS_NO"));
+
+		for (long i : values) {
+
+			variables.setProperty("RES_NO", Long.toString(i));
+
+			variables.setProperty("RESOURCES_PATH", variables
+					.getProperty("EXP_PATH")
+					+ "/AResources128_" + Long.toString(i) + ".xml");
+
+			int zeroes =
+					variables.getProperty("MAX_RES_NO").length()
+							- variables.getProperty("RES_NO").length();
+			StringBuilder expPropertiesNo =
+					new StringBuilder(variables.getProperty("TASKS_NO"));
+			expPropertiesNo.append("R");
+			for (int j = 0; j < zeroes; j++)
+				expPropertiesNo.append('0');
+			expPropertiesNo.append(variables.getProperty("RES_NO"));
+			expPropertiesNo.append(".properties");
+
+			try {
+
+				createResourcesFromSingleTemplate(i,
+						"properties/resource_template.part",
+						"properties/resources_template.xml", variables);
+
+				createFileFromTemplate(
+						"properties/reservation_template.properties", variables
+								.getProperty("EXP_PATH")
+								+ "/" + expPropertiesNo.toString(), variables);
+			} catch (IOException e) {
+				LOGGER.error("An exception occured while trying to ");
+			}
+		}
+
+		return variables.getProperty("EXP_PATH");
+	}
+
+	/**
+	 * Generates the resource file (it's directory is specified in variables and
+	 * file name depends on amount of resources it contains) from general and
+	 * single templates. It's based on variables replacement mechanism in method
+	 * 
+	 * @param numberOfResources
+	 *            the number of resources the
+	 * @param templatePath
+	 *            the template path
+	 * @param generalTemplatePath
+	 *            the general template path
+	 * @param variables
+	 *            the variables for resources generation
+	 * @throws IOException
+	 *             Signals that an I/O exception has occurred.
+	 *             {@link #substituteVariables(String, Properties)}. After
+	 *             preparation of variables it calls method:
+	 *             {@link #createFileFromTemplate(String, String, Properties)}
+	 */
+	private void createResourcesFromSingleTemplate(long numberOfResources,
+			String templatePath, String generalTemplatePath,
+			Properties variables) throws IOException {
+
+		File template = new File(templatePath);
+
+		BufferedReader reader = new BufferedReader(new FileReader(template));
+		String line = "";
+		StringBuilder oldtext = new StringBuilder();
+		try {
+			while ((line = reader.readLine()) != null) {
+				oldtext.append(line);
+				oldtext.append('\n');
+			}
+		} finally {
+			if (reader != null)
+				reader.close();
+		}
+
+		StringBuilder newtext = new StringBuilder();
+
+		for (long i = 0; i < numberOfResources; i++) {
+			variables.setProperty("RESOURCE_ID", "compRes" + Long.toString(i));
+			newtext.append(substituteVariables(oldtext.toString(), variables));
+		}
+
+		variables.setProperty("RESOURCES_DETAILS", newtext.toString());
+
+		createFileFromTemplate(generalTemplatePath, variables
+				.getProperty("RESOURCES_PATH"), variables);
+	}
+}
Index: DCWoRMS/trunk/src/test/stress/AbstractExperimentsGenerator.java
===================================================================
--- DCWoRMS/trunk/src/test/stress/AbstractExperimentsGenerator.java	(revision 477)
+++ DCWoRMS/trunk/src/test/stress/AbstractExperimentsGenerator.java	(revision 477)
@@ -0,0 +1,195 @@
+package test.stress;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.nio.channels.FileChannel;
+import java.util.Enumeration;
+import java.util.Properties;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * Abstract class with methods useful for generating range of experiments.
+ * 
+ * @author Jarek Szymczak
+ * @version $Id$
+ */
+public abstract class AbstractExperimentsGenerator {
+
+	/** Class logger. */
+	private static final Log LOGGER =
+			LogFactory.getLog(AbstractExperimentsGenerator.class);
+
+	/**
+	 * Copy files with tasks limitations (at least it's written to do it, it can
+	 * copy other things - depending on variables).
+	 * 
+	 * @param n
+	 *            number of files to copy
+	 * @param sourceFolderPath
+	 *            the source folder path
+	 * @param destinationFolderPath
+	 *            the destination folder path
+	 * @param variables
+	 *            variables from file "properties/variables.properties", this
+	 *            variable contains i.e. templates with file names, etc.
+	 */
+	protected void copyFiles(long n, String sourceFolderPath,
+			String destinationFolderPath, Properties variables) {
+		File dir = new File(destinationFolderPath);
+		if (dir.exists())
+			deleteDirectory(dir);
+		try {
+			dir.mkdirs();
+		} catch (SecurityException e) {
+			LOGGER
+					.error("Security violation while trying to create directories: "
+							+ dir.getAbsolutePath() + "!");
+		}
+		try {
+			for (long i = 0; i < n; i++) {
+				String fileName =
+						"/"
+								+ (i < 10 ? variables
+										.getProperty("DIGIT_JOB_TEMPLATE")
+										: variables
+												.getProperty("NUMBER_JOB_TEMPLATE"))
+								+ Long.toString(i)
+								+ variables.getProperty("JOB_EXTENSION");
+				copyFile(sourceFolderPath + fileName, destinationFolderPath
+						+ fileName);
+			}
+		} catch (Exception e) {
+			LOGGER.error("Error while copying experimnets files!");
+		}
+
+	}
+
+	/**
+	 * Copies file from source path to destination path - if destination file
+	 * exists it will be overwritten.
+	 * 
+	 * @param sourceFilePath
+	 *            the source file path
+	 * @param destFilePath
+	 *            the dest file path
+	 * @throws IOException
+	 *             Signals that an I/O exception has occurred.
+	 */
+	protected static void copyFile(String sourceFilePath, String destFilePath)
+			throws IOException {
+
+		File sourceFile = new File(sourceFilePath);
+		File destFile = new File(destFilePath);
+
+		if (!destFile.exists()) {
+			try {
+				destFile.createNewFile();
+			} catch (SecurityException e) {
+				LOGGER.error("Security violation while trying to create file: "
+						+ destFile.getAbsolutePath() + "!");
+			}
+		}
+
+		FileChannel source = null;
+		FileChannel destination = null;
+		try {
+			source = new FileInputStream(sourceFile).getChannel();
+			destination = new FileOutputStream(destFile).getChannel();
+			destination.transferFrom(source, 0, source.size());
+		} finally {
+			if (source != null)
+				source.close();
+			if (destination != null)
+				destination.close();
+		}
+	}
+
+	/**
+	 * Deletes directory.
+	 * 
+	 * @param path
+	 *            the path
+	 * @return true, if successful
+	 */
+	protected boolean deleteDirectory(File path) {
+		if (path.exists()) {
+			File[] files = path.listFiles();
+			for (int i = 0; i < files.length; i++) {
+				if (files[i].isDirectory()) {
+					deleteDirectory(files[i]);
+				} else {
+					try {
+						files[i].delete();
+					} catch (SecurityException e) {
+						LOGGER
+								.error("Security violation while trying to delete file: "
+										+ files[i].getAbsolutePath() + "!");
+					}
+				}
+			}
+		}
+		return (path.delete());
+	}
+
+	/**
+	 * Substitutes variables in input and returns output.
+	 * 
+	 * @param input
+	 *            the input with variables
+	 * @param variables
+	 *            the variables
+	 * @return the output with replaced variables
+	 */
+	protected String substituteVariables(String input, Properties variables) {
+		String output = input;
+		String key;
+		Enumeration<Object> keys = variables.keys();
+		while (keys.hasMoreElements()) {
+			key = (String) keys.nextElement();
+			output = output.replaceAll(key, variables.getProperty(key));
+		}
+		return output;
+	}
+
+	/**
+	 * Creates the file from template by substituting all the variables in
+	 * template.
+	 * 
+	 * @param templatePath
+	 *            the template path
+	 * @param outputPath
+	 *            the output path
+	 * @param variables
+	 *            the variables
+	 * @throws IOException
+	 *             Signals that an I/O exception has occurred.
+	 */
+	protected void createFileFromTemplate(String templatePath,
+			String outputPath, Properties variables) throws IOException {
+		File template = new File(templatePath);
+		File output = new File(outputPath);
+
+		BufferedReader reader = new BufferedReader(new FileReader(template));
+		String line = "";
+		StringBuilder oldtext = new StringBuilder();
+		while ((line = reader.readLine()) != null) {
+			oldtext.append(line);
+			oldtext.append('\n');
+		}
+
+		reader.close();
+
+		String newtext = substituteVariables(oldtext.toString(), variables);
+
+		FileWriter writer = new FileWriter(output);
+		writer.write(newtext);
+		writer.close();
+	}
+}
Index: DCWoRMS/trunk/src/test/stress/GeneratingAndTestingManager.java
===================================================================
--- DCWoRMS/trunk/src/test/stress/GeneratingAndTestingManager.java	(revision 477)
+++ DCWoRMS/trunk/src/test/stress/GeneratingAndTestingManager.java	(revision 477)
@@ -0,0 +1,242 @@
+package test.stress;
+
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * The class responsible for generate tasks or resource range experiments and
+ * running memory and time analysis on them.
+ * 
+ * @author Jarek Szymczak
+ * @version $Id$
+ */
+public class GeneratingAndTestingManager {
+
+	/** Class logger. */
+	private static final Log LOGGER =
+			LogFactory.getLog(GeneratingAndTestingManager.class);
+
+	/**
+	 * The file paths of generated experiments passed to memory and time
+	 * analysis.
+	 */
+	private static List<String> parameters = new ArrayList<String>();
+
+	/** List of paramters (after they're parsed from main method arguments). */
+	private static Map<String, String[]> methodParameters =
+			new HashMap<String, String[]>();
+
+	/**
+	 * It determines whether memory and time analysis should be performed after
+	 * experiments generation.
+	 */
+	private static boolean run;
+
+	/**
+	 * The main method. Apart arguments the program is run with, generation of
+	 * experiments depends on file "properties/variables.properties" and
+	 * "*properties/template*.*" files
+	 * 
+	 * @param args
+	 *            the following arguments (other are not allowed - arguments
+	 *            predecessed by "#" are integers):
+	 *            <ul>
+	 *            <li><b>-r</b> - memory and time analysis will be performed
+	 *            after generation (if specified)
+	 *            <li><b>--rg #tasks #start #step #end</b> - experiments with
+	 *            #tasks number of tasks will be generated for range of
+	 *            resources from #start to #end with step #step
+	 *            <li><b>--rv #tasks #resources_1 ... #resources_n</b> -
+	 *            experiments with #tasks number of tasks will be generated for
+	 *            #resources_1, ..., #resources_n number of resources
+	 *            <li><b>--tg #start #step #end</b> - experiments with tasks
+	 *            range from #start to #end with step #step will be generated
+	 *            <li><b>--tv #tasks_1 ... #tasks_n</b> - experiments with
+	 *            #tasks_1, ..., #tasks_n number of tasks will be generated
+	 *            </ul>
+	 * 
+	 * @throws FileNotFoundException
+	 *             if one of necessary files was not found
+	 * @throws IOException
+	 *             Signals that an I/O exception has occurred.
+	 * @throws InterruptedException
+	 *             should not occur
+	 */
+	public static void main(String args[]) throws FileNotFoundException,
+			IOException, InterruptedException {
+
+		String argsProcessed[] = args;
+
+		while (argsProcessed.length != 0) {
+			argsProcessed = processArguments(argsProcessed);
+		}
+
+		if (methodParameters.containsKey("tg")
+				&& methodParameters.containsKey("tv")) {
+			System.out
+					.println("Argumets --tg and --tv cannot be used together");
+			return;
+		}
+
+		if (methodParameters.containsKey("rg")
+				&& methodParameters.containsKey("rv")) {
+			System.out
+					.println("Argumets --rg and --rv cannot be used together");
+			return;
+		}
+
+		if (methodParameters.containsKey("tg")
+				&& (methodParameters.get("tg").length != 4)) {
+			System.out.println("Wrong usage of --tg argument");
+			return;
+		}
+
+		if (methodParameters.containsKey("rg")
+				&& (methodParameters.get("rg").length != 5)) {
+			System.out.println("Wrong usage of --rg argument");
+			return;
+		}
+
+		if (methodParameters.containsKey("tv")
+				&& (methodParameters.get("tv").length < 2)) {
+			System.out.println("Wrong usage of --tg argument");
+			return;
+		}
+
+		if (methodParameters.containsKey("rv")
+				&& (methodParameters.get("rv").length < 3)) {
+			System.out.println("Wrong usage of --rg argument");
+			return;
+		}
+
+		if (methodParameters.containsKey("tg")
+				&& methodParameters.containsKey("tv")) {
+			System.out
+					.println("Argumets --tg and --tv cannot be used together");
+			return;
+		}
+
+		if (methodParameters.containsKey("tg")) {
+			TasksExperimentsGenerator teg = new TasksExperimentsGenerator();
+			parameters.add(teg.run(methodParameters.get("tg")));
+		}
+
+		if (methodParameters.containsKey("tv")) {
+			TasksExperimentsGenerator teg = new TasksExperimentsGenerator();
+			parameters.add(teg.run(methodParameters.get("tv")));
+		}
+
+		if (methodParameters.containsKey("rg")) {
+			ResourcesExperimentsGenerator reg =
+					new ResourcesExperimentsGenerator();
+			parameters.add(reg.run(methodParameters.get("rg")));
+		}
+
+		if (methodParameters.containsKey("rv")) {
+			ResourcesExperimentsGenerator reg =
+					new ResourcesExperimentsGenerator();
+			parameters.add(reg.run(methodParameters.get("rv")));
+		}
+
+		if (run) {
+			LOGGER
+					.info("Memory and time consumption analysis will begin in 3 seconds, please wait...");
+
+			for (int i = 0; i < 5; i++) {
+				System.gc();
+				Thread.sleep(600);
+			}
+
+			MemoryAndTimeAnalyzer.main(parameters.toArray(new String[parameters
+					.size()]));
+		}
+
+	}
+
+	/**
+	 * It processes the arguments. It moves arguments with it's parameters from
+	 * an args array (they're removed) to methodParameters map.
+	 * 
+	 * @param args
+	 *            array with (possibly) many groups of parameters (arguments)
+	 * @return separated group of parameters
+	 */
+	private static String[] processArguments(String args[]) {
+		int offset = 0;
+
+		if ("-r".equals(args[0])) {
+			run = true;
+			offset = 1;
+
+		} else {
+
+			do {
+				offset++;
+			} while ((offset < args.length) && !args[offset].startsWith("-"));
+
+			if ("--rv".equals(args[0])) {
+
+				String[] rvArgs = arrayCopyOfRange(args, 0, offset);
+				rvArgs[0] = "-v";
+				methodParameters.put("rv", rvArgs);
+
+			} else if ("--rg".equals(args[0])) {
+				String[] rvArgs = arrayCopyOfRange(args, 0, offset);
+				rvArgs[0] = "-g";
+				methodParameters.put("rg", rvArgs);
+
+			} else if ("--tv".equals(args[0])) {
+				String[] rvArgs = arrayCopyOfRange(args, 0, offset);
+				rvArgs[0] = "-v";
+				methodParameters.put("tv", rvArgs);
+
+			} else if ("--tg".equals(args[0])) {
+				String[] rvArgs = arrayCopyOfRange(args, 0, offset);
+				rvArgs[0] = "-g";
+				methodParameters.put("tg", rvArgs);
+
+			} else {
+				System.out.println("Incorrect switch (" + args[0]
+						+ "). Supported are:");
+				System.out
+						.println("-r\t\tif specified after generation tests will be performed");
+				System.out
+						.println("--rv\t\tif resources experiment generation from certain values");
+				System.out
+						.println("--rg\t\tif resources experiment generation");
+				System.out
+						.println("--tv\t\tif tasks experiment generation from certain values");
+				System.out.println("--tg\t\tif tasks experiment generation");
+
+				System.exit(-1);
+			}
+		}
+
+		return arrayCopyOfRange(args, offset, args.length);
+	}
+
+	/**
+	 * Copy of array's range. Method written as a wrapper to System method
+	 * arraycopy().
+	 * 
+	 * @param original
+	 *            the original array
+	 * @param from
+	 *            from index
+	 * @param to
+	 *            to index
+	 * @return truncated array
+	 */
+	private static String[] arrayCopyOfRange(String[] original, int from, int to) {
+		String[] result = new String[to - from];
+		System.arraycopy(original, from, result, 0, to - from);
+		return result;
+	}
+}
Index: DCWoRMS/trunk/src/test/.castor.cdr
===================================================================
--- DCWoRMS/trunk/src/test/.castor.cdr	(revision 477)
+++ DCWoRMS/trunk/src/test/.castor.cdr	(revision 477)
@@ -0,0 +1,61 @@
+-- listing properties --
+test.Templates=test.TemplatesDescriptor
+test.TimeEstimationPluginType=test.TimeEstimationPluginTypeDescriptor
+test.ComputingResourceInterfaceChoice3=test.ComputingResourceInterfaceChoice...
+test.Environment=test.EnvironmentDescriptor
+test.EnergyEstimationPlugin=test.EnergyEstimationPluginDescriptor
+test.Scheduler=test.SchedulerDescriptor
+test.ComputingResourceInterfaceChoice2=test.ComputingResourceInterfaceChoice...
+test.ResourceParameter=test.ResourceParameterDescriptor
+test.ComputingResourceTemplateType=test.ComputingResourceTemplateTypeDes...
+test.ParameterType=test.ParameterTypeDescriptor
+test.Resources=test.ResourcesDescriptor
+test.EnergyEstimationPluginType=test.EnergyEstimationPluginTypeDescri...
+test.ComputingResourceTypeChoice2=test.ComputingResourceTypeChoice2Desc...
+test.SchedulerType=test.SchedulerTypeDescriptor
+test.EnergyEstimationPluginTypeChoiceItem=test.EnergyEstimationPluginTypeChoice...
+test.ComputingResourceParameterType=test.ComputingResourceParameterTypeDe...
+test.PStateType=test.PStateTypeDescriptor
+test.PStatesType=test.PStatesTypeDescriptor
+test.ListOfManagedResources=test.ListOfManagedResourcesDescriptor
+test.EnergyParameter=test.EnergyParameterDescriptor
+test.ComputingResourceTemplate=test.ComputingResourceTemplateDescriptor
+test.PowerStateType=test.PowerStateTypeDescriptor
+test.OtherParameter=test.OtherParameterDescriptor
+test.EnergyStatesTransitionType=test.EnergyStatesTransitionTypeDescri...
+test.EnergyPowerProfileTypeChoice=test.EnergyPowerProfileTypeChoiceDesc...
+test.EnergyEstimationPluginTypeChoice=test.EnergyEstimationPluginTypeChoice...
+test.ResourceList=test.ResourceListDescriptor
+test.EnergyPowerProfile=test.EnergyPowerProfileDescriptor
+test.ComputingResourceInterfaceChoice=test.ComputingResourceInterfaceChoice...
+test.Transition=test.TransitionDescriptor
+test.LocationType=test.LocationTypeDescriptor
+test.PowerStates=test.PowerStatesDescriptor
+test.SchedulingPlugin=test.SchedulingPluginDescriptor
+test.ComputingResource=test.ComputingResourceDescriptor
+test.ManagedComputingResource=test.ManagedComputingResourceDescriptor
+test.ComputingResourceTypeChoice=test.ComputingResourceTypeChoiceDescr...
+test.Location=test.LocationDescriptor
+test.SchedulingPluginType=test.SchedulingPluginTypeDescriptor
+test.SchedulingParameter=test.SchedulingParameterDescriptor
+test.PowerStatesTypeItem=test.PowerStatesTypeItemDescriptor
+test.PStatesTypeItem=test.PStatesTypeItemDescriptor
+test.ComputingResourceInterfaceChoiceItem=test.ComputingResourceInterfaceChoice...
+test.SizeType=test.SizeTypeDescriptor
+test.ComputingResourceInterface=test.ComputingResourceInterfaceDescri...
+test.EnergyPowerProfileTypeChoiceItem=test.EnergyPowerProfileTypeChoiceItem...
+test.ComputingResourceType=test.ComputingResourceTypeDescriptor
+test.ManagedComputingResourceType=test.ManagedComputingResourceTypeDesc...
+test.Resource=test.ResourceDescriptor
+test.SchedulerTypeChoice=test.SchedulerTypeChoiceDescriptor
+test.SchedulerTypeChoiceItem=test.SchedulerTypeChoiceItemDescriptor
+test.EnergyPowerProfileType=test.EnergyPowerProfileTypeDescriptor
+test.PowerState=test.PowerStateDescriptor
+test.PState=test.PStateDescriptor
+test.TimeEstimationPlugin=test.TimeEstimationPluginDescriptor
+test.Size=test.SizeDescriptor
+test.PowerStatesType=test.PowerStatesTypeDescriptor
+test.Property=test.PropertyDescriptor
+test.ResourceListItem=test.ResourceListItemDescriptor
+test.OtherParameterType=test.OtherParameterTypeDescriptor
+test.PStates=test.PStatesDescriptor
Index: DCWoRMS/trunk/src/schedframe/Parameters.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/Parameters.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/Parameters.java	(revision 477)
@@ -0,0 +1,12 @@
+package schedframe;
+
+import java.util.HashMap;
+
+public class Parameters extends HashMap<String, Parameter>{
+
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 1L;
+	
+}
Index: DCWoRMS/trunk/src/schedframe/Property.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/Property.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/Property.java	(revision 477)
@@ -0,0 +1,24 @@
+package schedframe;
+
+import java.util.ArrayList;
+
+import schemas.StringValueWithUnitType;
+
+public class Property extends ArrayList<StringValueWithUnitType>{
+
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 1L;
+	protected String name;
+
+	public Property(String name) {
+		super();
+		this.name = name;
+	}
+
+	public String getName() {
+		return name;
+	}
+	
+}
Index: DCWoRMS/trunk/src/schedframe/events/ResourceEventCommand.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/events/ResourceEventCommand.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/events/ResourceEventCommand.java	(revision 477)
@@ -0,0 +1,22 @@
+package schedframe.events;
+
+import schedframe.resources.computing.ComputingResource;
+
+public class ResourceEventCommand implements EventCommand {
+
+	private ComputingResource compResource;
+	
+	public ResourceEventCommand(ComputingResource compResource) {
+		this.compResource = compResource;
+	}
+	
+	public void execute(EventType evType) {
+		//TODO - add event factory
+		throw new RuntimeException("not implemented");
+	}
+
+	public void execute(Event event) {
+		compResource.getEventHandler().handleResourceEvent(event);
+	}
+
+}
Index: DCWoRMS/trunk/src/schedframe/events/EventHandler.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/events/EventHandler.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/events/EventHandler.java	(revision 477)
@@ -0,0 +1,11 @@
+package schedframe.events;
+
+import schedframe.events.scheduling.SchedulingEvent;
+
+public interface EventHandler {
+	
+	public void handleResourceEvent(Event event);
+	
+	public void handleSchedulingEvent(SchedulingEvent event);
+	
+}
Index: DCWoRMS/trunk/src/schedframe/events/EventCommand.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/events/EventCommand.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/events/EventCommand.java	(revision 477)
@@ -0,0 +1,10 @@
+package schedframe.events;
+
+
+
+public interface EventCommand {
+
+	public void execute(EventType evType);
+	
+	public void execute(Event event);
+}
Index: DCWoRMS/trunk/src/schedframe/events/Event.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/events/Event.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/events/Event.java	(revision 477)
@@ -0,0 +1,16 @@
+package schedframe.events;
+
+import schedframe.events.scheduling.EventReason;
+
+public interface Event {
+	
+	public EventType getType();
+	
+	public String getSource();
+	
+	public int getTag();
+	
+	public Object getData();
+	
+	public EventReason getReason();
+}
Index: DCWoRMS/trunk/src/schedframe/events/EventType.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/events/EventType.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/events/EventType.java	(revision 477)
@@ -0,0 +1,9 @@
+package schedframe.events;
+
+public interface EventType {
+
+	public String getName();
+	
+	public int getTag();
+	
+}
Index: DCWoRMS/trunk/src/schedframe/events/TaskEvent.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/events/TaskEvent.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/events/TaskEvent.java	(revision 477)
@@ -0,0 +1,27 @@
+package schedframe.events;
+
+import schedframe.scheduling.tasks.WorkloadUnit;
+
+
+
+public class TaskEvent {
+
+	protected WorkloadUnit<?> task;
+	protected String resourceName;
+	
+	public TaskEvent(WorkloadUnit<?> task,
+			 String resourceName) {
+		super();
+		this.task = task;
+		this.resourceName = resourceName;
+	}
+	
+	public WorkloadUnit<?> getTask() {
+		return task;
+	}
+
+	public String getResourceName() {
+		return resourceName;
+	}
+	
+}
Index: DCWoRMS/trunk/src/schedframe/events/scheduling/TaskFinishedEvent.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/events/scheduling/TaskFinishedEvent.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/events/scheduling/TaskFinishedEvent.java	(revision 477)
@@ -0,0 +1,30 @@
+package schedframe.events.scheduling;
+
+
+public class TaskFinishedEvent extends SchedulingEvent {
+	
+	//protected List<String> epr;
+
+	protected String jobId;
+	protected String taskId;
+	
+	public TaskFinishedEvent(/*List<String> list*/ String jobId, String taskId){
+		super(SchedulingEventType.TASK_FINISHED);
+		//this.epr = list;
+		this.jobId = jobId;
+		this.taskId = taskId;
+	}
+	
+	/*public List<String> getReservations(){
+		return this.epr;
+	}*/
+	
+	public String getJobId() {
+		return jobId;
+	}
+
+	public String getTaskId() {
+		return taskId;
+	}
+
+}
Index: DCWoRMS/trunk/src/schedframe/events/scheduling/TaskArrivedEvent.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/events/scheduling/TaskArrivedEvent.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/events/scheduling/TaskArrivedEvent.java	(revision 477)
@@ -0,0 +1,9 @@
+package schedframe.events.scheduling;
+
+
+public class TaskArrivedEvent extends SchedulingEvent {
+
+	public TaskArrivedEvent(){
+		super(SchedulingEventType.TASK_ARRIVED);
+	}
+}
Index: DCWoRMS/trunk/src/schedframe/events/scheduling/TimerEvent.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/events/scheduling/TimerEvent.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/events/scheduling/TimerEvent.java	(revision 477)
@@ -0,0 +1,10 @@
+package schedframe.events.scheduling;
+
+
+public class TimerEvent extends SchedulingEvent {
+
+	public TimerEvent() {
+		super(SchedulingEventType.TIMER);
+	}
+
+}
Index: DCWoRMS/trunk/src/schedframe/events/scheduling/TaskCanceledEvent.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/events/scheduling/TaskCanceledEvent.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/events/scheduling/TaskCanceledEvent.java	(revision 477)
@@ -0,0 +1,41 @@
+package schedframe.events.scheduling;
+
+import java.util.List;
+
+
+public class TaskCanceledEvent extends SchedulingEvent {
+
+	protected String jobId;
+	protected String taskId;
+	protected List<String> epr;
+	
+	public TaskCanceledEvent(List<String> list){
+		super(SchedulingEventType.TASK_CANCELED);
+		this.epr = list;
+		this.jobId = null;
+		this.taskId = null;
+	}
+	
+	public TaskCanceledEvent(String jobId, String taskId) {
+		super(SchedulingEventType.TASK_CANCELED);
+		this.jobId = jobId;
+		this.taskId = taskId;
+	}
+	
+	public void setReason(EventReason reason){
+		this.reason = reason;
+	}
+
+	public String getJobId() {
+		return jobId;
+	}
+
+	public String getTaskId() {
+		return taskId;
+	}
+	
+	public List<String> getReservations(){
+		return this.epr;
+	}
+
+}
Index: DCWoRMS/trunk/src/schedframe/events/scheduling/SchedulingEventCommand.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/events/scheduling/SchedulingEventCommand.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/events/scheduling/SchedulingEventCommand.java	(revision 477)
@@ -0,0 +1,28 @@
+package schedframe.events.scheduling;
+
+import schedframe.events.Event;
+import schedframe.events.EventCommand;
+import schedframe.events.EventType;
+import schedframe.resources.computing.ComputingResource;
+
+public class SchedulingEventCommand implements EventCommand {
+
+	private ComputingResource compResource;
+	
+	public SchedulingEventCommand (ComputingResource compResource) {
+		this.compResource = compResource;
+	}
+	
+	public void execute(EventType evType) {
+		SchedulingEvent ev = new SchedulingEvent(evType);
+		ev.setSource(compResource.getName());
+		compResource.getEventHandler().handleSchedulingEvent(ev);
+	}
+	
+	public void execute(Event event) {
+		SchedulingEvent ev = new SchedulingEvent(event.getType());
+		ev.setSource(compResource.getName());
+		compResource.getEventHandler().handleSchedulingEvent(ev);
+	}
+
+}
Index: DCWoRMS/trunk/src/schedframe/events/scheduling/SchedulingResponseType.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/events/scheduling/SchedulingResponseType.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/events/scheduling/SchedulingResponseType.java	(revision 477)
@@ -0,0 +1,20 @@
+package schedframe.events.scheduling;
+
+public enum SchedulingResponseType {
+
+	TERMINATE_TASK(0),
+	KILL_TASK(0),
+	STOP_AND_RESUME_FROM_CHECKPOINT(0),
+	EXECUTE_ANYWAY(0),
+	ONE_HOUR_GRACE_PERIOD(3600);
+	
+	protected int timer;
+	
+	private SchedulingResponseType(int timer){
+		this.timer = timer;
+	}
+	
+	public int getTimer(){
+		return this.timer;
+	}
+}
Index: DCWoRMS/trunk/src/schedframe/events/scheduling/StartTaskExecutionEvent.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/events/scheduling/StartTaskExecutionEvent.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/events/scheduling/StartTaskExecutionEvent.java	(revision 477)
@@ -0,0 +1,28 @@
+package schedframe.events.scheduling;
+
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+public class StartTaskExecutionEvent extends SchedulingEvent {
+
+	protected String jobId;
+	protected String taskId;
+	
+	public StartTaskExecutionEvent(String jobId, String taskId) {
+		super(SchedulingEventType.START_TASK_EXECUTION);
+		this.jobId = jobId;
+		this.taskId = taskId;
+	}
+
+	public String getJobId() {
+		return jobId;
+	}
+
+	public String getTaskId() {
+		return taskId;
+	}
+	
+}
Index: DCWoRMS/trunk/src/schedframe/events/scheduling/TaskRequestedTimeExpiredEvent.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/events/scheduling/TaskRequestedTimeExpiredEvent.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/events/scheduling/TaskRequestedTimeExpiredEvent.java	(revision 477)
@@ -0,0 +1,20 @@
+package schedframe.events.scheduling;
+
+public class TaskRequestedTimeExpiredEvent extends SchedulingEvent{
+	protected String jobId;
+	protected String taskId;
+	
+	public TaskRequestedTimeExpiredEvent(String jobId, String taskId) {
+		super(SchedulingEventType.TASK_REQUESTED_TIME_EXPIRED);
+		this.jobId = jobId;
+		this.taskId = taskId;
+	}
+
+	public String getJobId() {
+		return jobId;
+	}
+
+	public String getTaskId() {
+		return taskId;
+	}
+}
Index: DCWoRMS/trunk/src/schedframe/events/scheduling/SchedulingEvent.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/events/scheduling/SchedulingEvent.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/events/scheduling/SchedulingEvent.java	(revision 477)
@@ -0,0 +1,53 @@
+package schedframe.events.scheduling;
+
+import schedframe.events.Event;
+import schedframe.events.EventType;
+
+public class SchedulingEvent implements Event{
+	
+	protected EventType type;
+	protected EventReason reason;
+	
+	protected String source;
+	
+	public SchedulingEvent(EventType eventType){
+		this(eventType, EventReason.UNKNOWN);
+	}
+	
+	public SchedulingEvent(EventType eventType, EventReason eventReason){
+		type = eventType;
+		reason = eventReason;
+	}
+	
+	public SchedulingEventType getType(){
+		SchedulingEventType schedEventType; 
+		try{
+			schedEventType = (SchedulingEventType)type;
+		} catch(Exception e){
+			schedEventType = SchedulingEventType.RESOURCE_STATE_CHANGED;
+		}
+		return schedEventType;
+	}
+	
+	public EventReason getReason(){
+		return reason;
+	}
+	
+	public void setSource(String value){
+		this.source = value;
+	}
+	
+	public String getSource(){
+		return this.source;
+	}
+
+	public int getTag() {
+		return type.getTag();
+	}
+
+	@Override
+	public Object getData() {
+		return null;
+	}
+	
+}
Index: DCWoRMS/trunk/src/schedframe/events/scheduling/EventReason.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/events/scheduling/EventReason.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/events/scheduling/EventReason.java	(revision 477)
@@ -0,0 +1,24 @@
+package schedframe.events.scheduling;
+
+public enum EventReason {
+	//Reasons that caused given events
+	UNKNOWN,
+
+	//task-related
+	//TASK_FAILED
+	APP_FAILURE,
+	SYSTEM_FAILURE,
+	RESOURCE_FAILURE,
+	
+	//TASK_CANCELED
+	RESERVATION_EXCEEDED,
+	RESOURCES_EXCEEDED,
+	
+	//resource/provider-related
+	TEMPORARY_FAILURE,
+	PERMAMENT_FAILURE,
+	
+	
+	SIM_INIT
+	;
+}
Index: DCWoRMS/trunk/src/schedframe/events/scheduling/SchedulingEventType.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/events/scheduling/SchedulingEventType.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/events/scheduling/SchedulingEventType.java	(revision 477)
@@ -0,0 +1,51 @@
+package schedframe.events.scheduling;
+
+import schedframe.events.EventType;
+
+public enum SchedulingEventType implements EventType {
+
+	// task related
+	TASK_FINISHED(1),
+	TASK_FAILED(2),
+	TASK_CANCELED(4),
+	TASK_ARRIVED(8),
+	START_TASK_EXECUTION(16384),
+	TASK_REQUESTED_TIME_EXPIRED(32768),
+
+	//job related
+	JOB_ARRIVED(16),
+	JOB_FINISHED(32),
+	JOB_FAILED(64),
+	JOB_CANCELED(128),
+
+	//time related
+	TIMER(254),
+	
+	//resource related
+	RESOURCE_FAILED(512),
+	//provider related (relevant to grid scheduling)
+	PROVIDER_FAILED(1024),
+	
+	//reservation related
+	RESERVATION_ACTIVE(2048),
+	RESERVATION_FINISHED(4096),
+	RESERVATION_FAILED(8192),
+	RESERVATION_EXPIRED(16384),
+	
+	RESOURCE_STATE_CHANGED(32668)
+	;
+	
+	protected int tag;
+	
+	private SchedulingEventType(int tag){
+		this.tag = tag;
+	}
+	
+	public int getTag(){
+		return this.tag;
+	}
+	
+	public String getName(){
+		return toString();
+	}
+}
Index: DCWoRMS/trunk/src/schedframe/events/scheduling/TaskFailedEvent.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/events/scheduling/TaskFailedEvent.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/events/scheduling/TaskFailedEvent.java	(revision 477)
@@ -0,0 +1,17 @@
+package schedframe.events.scheduling;
+
+import java.util.List;
+
+public class TaskFailedEvent extends SchedulingEvent{
+	
+	protected List<String> epr;
+	
+	public TaskFailedEvent(List<String> list){
+		super(SchedulingEventType.TASK_FAILED);
+		this.epr = list;
+	}
+	
+	public List<String> getReservations(){
+		return this.epr;
+	}
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/TaskSecurityContext.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/TaskSecurityContext.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/TaskSecurityContext.java	(revision 477)
@@ -0,0 +1,56 @@
+package schedframe.scheduling;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+public class TaskSecurityContext implements SecurityContext {
+
+	protected String jobId;
+	protected String taskId;
+	protected String processesSetId;
+	protected Object certificate;
+	protected String currentUserDN;
+	
+	public String getUserIdentity() {
+		return this.currentUserDN;
+	}
+	
+	public void setCurrentUserIdentity(String dn){
+		this.currentUserDN = dn;
+	}
+	
+	public String getJobId() {
+		return jobId;
+	}
+	
+	public void setJobId(String jobId) {
+		this.jobId = jobId;
+	}
+	
+	public String getTaskId() {
+		return taskId;
+	}
+	
+	public void setTaskId(String taskId) {
+		this.taskId = taskId;
+	}
+	
+	public String getProcessesSetId() {
+		return processesSetId;
+	}
+	
+	public void setProcessesSetId(String processesSetId) {
+		this.processesSetId = processesSetId;
+	}
+	
+	public Object getCertificate(){
+		return this.certificate;
+	}
+	
+	public void setCertificate(Object cert){
+		this.certificate = cert;
+	}
+
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/WorkloadUnitListImpl.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/WorkloadUnitListImpl.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/WorkloadUnitListImpl.java	(revision 477)
@@ -0,0 +1,19 @@
+package schedframe.scheduling;
+
+import java.util.ArrayList;
+
+import schedframe.scheduling.tasks.WorkloadUnit;
+
+
+public class WorkloadUnitListImpl extends ArrayList<WorkloadUnit<?>> implements WorkloadUnitList {
+
+	private static final long serialVersionUID = -3824600938144742457L;
+
+	public WorkloadUnitListImpl(){
+		super();
+	}
+	
+	public WorkloadUnitListImpl(int initialSize){
+		super(initialSize);
+	}	
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/UsedResourceList.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/UsedResourceList.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/UsedResourceList.java	(revision 477)
@@ -0,0 +1,12 @@
+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/scheduling/queue/Queue.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/queue/Queue.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/queue/Queue.java	(revision 477)
@@ -0,0 +1,44 @@
+package schedframe.scheduling.queue;
+
+import java.util.List;
+
+import org.joda.time.DateTime;
+
+public interface Queue <K> extends List<K> {
+
+	/**
+	 * Gets a queue name
+	 * @return name
+	 */
+	public String getName();
+
+	/**
+	 * Sets a queue name
+	 * @param name the name to set
+	 */
+	public void setName(String name);
+	
+	/**
+	 * Gets a queue priority
+	 * @return priority
+	 */
+	public int getPriority();
+	
+	
+	public boolean supportReservations();
+	
+	/**
+	 * Sets a queue priority
+	 * @param priority the priority to set
+	 */
+	public void setPriority(int priority);
+		
+	/**
+	 * Gets arrival time of the object at position pos in a queue.
+	 * @param pos the position of the object
+	 * @return time when the object at position pos in queue was added to the queue; 
+	 * @throws IndexOutOfBoundsException if pos id out of the queue range
+	 */
+	public DateTime getArrivalTime(int pos) throws IndexOutOfBoundsException;
+
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/queue/TaskQueue.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/queue/TaskQueue.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/queue/TaskQueue.java	(revision 477)
@@ -0,0 +1,103 @@
+package schedframe.scheduling.queue;
+
+import gridsim.Gridlet;
+import gssim.schedframe.scheduling.queues.AbstractStatsSupportingQueue;
+
+import org.joda.time.DateTime;
+
+import schedframe.scheduling.tasks.WorkloadUnit;
+
+public class TaskQueue extends AbstractStatsSupportingQueue<WorkloadUnit<?>> implements Queue<WorkloadUnit<?>>{
+
+
+	private static final long serialVersionUID = 6576299222910508209L;
+
+	protected String name;
+	protected int priority;
+	protected boolean supportReservation;
+	
+	
+	public TaskQueue (boolean supportReservation){
+		name = "Queue";
+		priority = 0;
+		this.supportReservation = supportReservation;
+
+	}
+	
+	public boolean add(WorkloadUnit<?> wu){
+		try {
+			wu.setStatus(Gridlet.QUEUED);
+		} catch(Exception e){
+			throw new RuntimeException(e);
+		}
+		//updateStats();
+		return super.add(wu);
+	}
+	
+	public void add(int pos, WorkloadUnit<?> wu){
+		try {
+			wu.setStatus(Gridlet.QUEUED);
+		} catch(Exception e){
+			throw new RuntimeException(e);
+		}
+		//updateStats();
+		 super.add(pos, wu);
+	}
+	
+	public DateTime getArrivalTime(int pos) throws IndexOutOfBoundsException {
+		//return get(pos).getSubmissionTimeToBroker();
+		return null;
+	}
+
+	public String getName() {
+		return name;
+	}
+
+	public int getPriority() {
+		return priority;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	public void setPriority(int priority) {
+		this.priority = priority;
+	}
+
+	public boolean supportReservations() {
+		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/src/schedframe/scheduling/queue/QueueDescription.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/queue/QueueDescription.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/queue/QueueDescription.java	(revision 477)
@@ -0,0 +1,32 @@
+package schedframe.scheduling.queue;
+
+public class QueueDescription {
+	
+	protected String name;
+	protected int priority;
+	protected boolean reservation;
+	protected long load;
+	
+	public QueueDescription(String name, int priority, boolean reservation, long load) {
+		this.name = name;
+		this.priority = priority;
+		this.reservation = reservation;
+		this.load = load;
+	}
+	
+	public String getName() {
+		return name;
+	}
+	
+	public int getPriority() {
+		return priority;
+	}
+	
+	public boolean supportReservation() {
+		return reservation;
+	}
+	
+	public long getLoad() {
+		return load;
+	}
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/queue/QueueList.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/queue/QueueList.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/queue/QueueList.java	(revision 477)
@@ -0,0 +1,9 @@
+package schedframe.scheduling.queue;
+
+import java.util.List;
+
+public interface QueueList<T> extends List<T>{
+
+
+
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/queue/TaskQueueList.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/queue/TaskQueueList.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/queue/TaskQueueList.java	(revision 477)
@@ -0,0 +1,17 @@
+package schedframe.scheduling.queue;
+
+import java.util.ArrayList;
+
+public class TaskQueueList extends ArrayList<TaskQueue> implements QueueList<TaskQueue> {
+
+	private static final long serialVersionUID = -3824600938144742457L;
+
+	public TaskQueueList(){
+		super();
+	}
+	
+	public TaskQueueList(int initialSize){
+		super(initialSize);
+	}
+	
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/tasks/Task.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/tasks/Task.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/tasks/Task.java	(revision 477)
@@ -0,0 +1,490 @@
+package schedframe.scheduling.tasks;
+
+import org.qcg.broker.schemas.resreqs.ComputingResource;
+import org.qcg.broker.schemas.resreqs.ComputingResourceBaseTypeItem;
+import org.qcg.broker.schemas.resreqs.ComputingResourceExtType;
+import org.qcg.broker.schemas.resreqs.ComputingResourceParameterType;
+import org.qcg.broker.schemas.resreqs.ExecutionTimeType;
+import org.qcg.broker.schemas.resreqs.ProcessesResourceRequirements;
+import org.qcg.broker.schemas.resreqs.Requirements;
+import org.qcg.broker.schemas.resreqs.TaskResourceRequirements;
+import org.qcg.broker.schemas.resreqs.TimePeriod;
+import org.qcg.broker.schemas.resreqs.TimePeriodChoice;
+import org.qcg.broker.schemas.resreqs.Topology;
+import org.qcg.broker.schemas.resreqs.types.ComputingResourceParameterTypeNameType;
+
+import java.io.StringReader;
+import java.io.StringWriter;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.exolab.castor.xml.Marshaller;
+import org.exolab.castor.xml.ResolverException;
+import org.exolab.castor.xml.Unmarshaller;
+import org.exolab.castor.xml.XMLContext;
+import org.joda.time.DateTime;
+import org.joda.time.Duration;
+import org.joda.time.MutableDateTime;
+import org.joda.time.ReadableDuration;
+
+import schedframe.scheduling.WorkloadUnitHandler;
+import schedframe.scheduling.manager.tasks.JobRegistryImpl;
+import schedframe.scheduling.tasks.requirements.ResourceParameterName;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+public class Task /*extends AbstractTask*/ implements TaskInterface<org.qcg.broker.schemas.resreqs.Task> {
+	
+	protected static Unmarshaller unmarshaller;
+	protected static Marshaller marshaller;
+	protected boolean isRegistered;
+	
+	static {
+		XMLContext context = new XMLContext();
+		try {
+			context.addClass(org.qcg.broker.schemas.resreqs.Task.class);
+			unmarshaller = context.createUnmarshaller();
+			marshaller = context.createMarshaller();
+		} catch (ResolverException e) {
+			e.printStackTrace();
+			unmarshaller = null;
+			marshaller = null;
+		}
+	}
+	
+	protected org.qcg.broker.schemas.resreqs.Task task;
+	/*
+	 * The values for following variables are obtained from native Task
+	 * object. This should significantly speed up access to task details.
+	 */
+	private DateTime startTime;
+	private DateTime endTime;
+	private DateTime brokerSubmitTime;
+	private ReadableDuration duration;
+	private List<AbstractProcessesGroup> groups;
+	private List<AbstractProcesses> processes;
+	private long length;
+	private int status;
+	private int senderId;
+	private long workloadLogWaitTime;
+	//String resPathHistory;
+	
+	public Task(org.qcg.broker.schemas.resreqs.Task task){
+		this.task = task;
+		this.startTime = null;
+		this.endTime = null;
+		this.brokerSubmitTime = null;
+		this.duration = null;
+	//	this.gridletID_ = (getJobId() + "_" + getId()).hashCode();
+		prepareTopology();
+	}
+	
+	public Task(String task) throws Exception{
+		StringReader reader = new StringReader(task);
+		this.task = (org.qcg.broker.schemas.resreqs.Task) unmarshaller.unmarshal(reader);
+		this.startTime = null;
+		this.endTime = null;
+		this.brokerSubmitTime = null;
+		this.duration = null;
+	//	this.gridletID_ = (getJobId() + getId()).hashCode();
+		prepareTopology();
+	}
+
+	public DateTime getExecutionStartTime() throws NoSuchFieldException {
+		if(this.startTime != null)
+			return this.startTime;
+		
+		ExecutionTimeType execTime = this.task.getExecutionTime();
+		if(execTime == null)
+			throw new NoSuchFieldException("Execution Time for job " + getJobId() 
+										+ " task "+ getId() + " is not defined.");
+		
+		TimePeriod timePeriod = execTime.getTimePeriod();
+		if(timePeriod == null)
+			throw new NoSuchFieldException("Time Period for job " + getJobId() 
+					+ " task "+ getId() + " is not defined.");
+		
+		this.startTime = new DateTime(timePeriod.getPeriodStart());
+		return this.startTime;
+	}
+
+	public DateTime getExecutionEndTime() throws NoSuchFieldException {
+		if(this.endTime != null)
+			return this.endTime;
+		
+		ExecutionTimeType execTime = this.task.getExecutionTime();
+		if(execTime == null)
+			throw new NoSuchFieldException("Execution Time for job " + getJobId() 
+										+ " task "+ getId() + " is not defined.");
+		
+		TimePeriod timePeriod = execTime.getTimePeriod();
+		if(timePeriod == null)
+			throw new NoSuchFieldException("Time Period for job " + getJobId() 
+					+ " task "+ getId() + " is not defined.");
+		
+		TimePeriodChoice periodChoice = timePeriod.getTimePeriodChoice();
+		if(periodChoice == null)
+			throw new NoSuchFieldException("Period End and Period Duration for job " + getJobId() 
+					+ " task "+ getId() + " are not defined.");
+		
+		java.util.Date periodEnd = periodChoice.getPeriodEnd();
+		if(periodEnd != null) {
+			this.endTime = new DateTime(periodEnd);
+			return this.endTime;
+		}
+		
+		org.exolab.castor.types.Duration duration = periodChoice.getPeriodDuration();
+		if(duration == null)
+			throw new NoSuchFieldException("Period Duration for job " + getJobId() 
+					+ " task "+ getId() + " is not defined.");
+		
+		DateTime periodStart = getExecutionStartTime();
+		MutableDateTime m_periodEnd = periodStart.toMutableDateTime();
+		m_periodEnd.add(duration.toLong());
+
+		this.endTime = m_periodEnd.toDateTime();
+		periodChoice.setPeriodDuration(null);
+		periodChoice.setPeriodEnd(this.endTime.toDate());
+		
+		return this.endTime;
+	}
+
+	public ReadableDuration getExpectedDuration() throws NoSuchFieldException {
+		if(this.duration != null)
+			return this.duration;
+		
+		ExecutionTimeType execTime = this.task.getExecutionTime();
+		if(execTime == null)
+			throw new NoSuchFieldException("Execution Time for job " + getJobId() 
+										+ " task "+ getId() + " is not defined.");
+		
+		org.exolab.castor.types.Duration d = execTime.getExecutionDuration();
+		if(d == null)
+			throw new NoSuchFieldException("Execution Duration for job " + getJobId() 
+					+ " task "+ getId() + " is not defined.");
+
+		this.duration = new Duration(d.toLong());
+		return this.duration;
+	}
+
+	public String getJobId() {
+		return this.task.getJobId();
+	}
+
+	public double getParameterDoubleValue(ResourceParameterName parameterName)
+			throws NoSuchFieldException, IllegalArgumentException {
+		
+		ComputingResourceParameterTypeNameType name = ComputingResourceParameterTypeNameType.valueOf(parameterName.value().toUpperCase());
+		
+		switch (name) {
+			case APPLICATION:
+			case CPUARCH:
+			case HOSTNAME:
+			case LOCALRESOURCEMANAGER:
+			case OSNAME:
+			case OSRELEASE:
+			case OSTYPE:
+			case OSVERSION:
+			case REMOTESUBMISSIONINTERFACE:
+				throw new IllegalArgumentException("For " + parameterName + " use getParameterStringValue() method.");
+		}
+
+		ComputingResourceBaseTypeItem item[] = getComputingResourceRequirements();
+		
+		double returnValue = 0;
+		boolean notFound = true;
+		
+		for(int i = 0; i < item.length && notFound; i++){
+			ComputingResourceParameterType hostParameter = item[i].getHostParameter();
+			if(hostParameter == null)
+				continue;
+			
+			if(name == hostParameter.getName()) {
+				returnValue = hostParameter.getParameterTypeChoice().getParameterTypeChoiceItem(0).getParameterValue().getContent();
+				notFound = false;
+			}
+		}
+		
+		if(notFound)
+			throw new NoSuchFieldException(parameterName + " for job " + getJobId() 
+					+ " task "+ getId() + " is not defined.");
+		
+		return returnValue;
+	}
+
+	public String getParameterStringValue(ResourceParameterName parameterName)
+			throws NoSuchFieldException, IllegalArgumentException {
+		ComputingResourceParameterTypeNameType name = ComputingResourceParameterTypeNameType.valueOf(parameterName.value().toUpperCase());
+		
+		switch (name) {
+			case CPUCOUNT:
+			case GPUCOUNT:
+			case CPUSPEED:
+			case DISKSPACE:
+			case FREECPUS:
+			case FREEDISKSPACE:
+			case FREEMEMORY:
+			case MEMORY:
+				throw new IllegalArgumentException("For " + parameterName + " use getParameterDoubleValue() method.");
+		}
+		
+		ComputingResourceBaseTypeItem item[] = getComputingResourceRequirements();
+		
+		String returnValue = null;
+		boolean notFound = true;
+		
+		for(int i = 0; i < item.length && notFound; i++){
+			ComputingResourceParameterType hostParameter = item[i].getHostParameter();
+			if(hostParameter == null)
+				continue;
+			
+			if(name == hostParameter.getName()) {
+				returnValue = hostParameter.getStringValue(0).getValue();
+				notFound = false;
+			}
+		}
+		
+		if(notFound)
+			throw new NoSuchFieldException(parameterName + " for job " + getJobId() 
+					+ " task "+ getId() + " is not defined.");
+		
+		return returnValue;
+	}
+
+	public DateTime getSubmissionTimeToBroker() {
+		if(this.brokerSubmitTime != null)
+			return this.brokerSubmitTime;
+		
+		this.brokerSubmitTime = new DateTime(this.task.getSubmissionTime());
+		
+		return this.brokerSubmitTime;
+	}
+
+	public String getId() {
+		return this.task.getTaskId();
+	}
+
+	public String getUserDn() {
+		return this.task.getUserDN();
+	}
+
+	public org.qcg.broker.schemas.resreqs.Task getDescription() {
+		return this.task;
+	}
+
+	public String getDocument() throws Exception {
+		StringWriter writer = new StringWriter();
+		
+		marshaller.marshal(this.task, writer);
+		
+		return writer.toString();
+	}
+	
+	protected ComputingResourceBaseTypeItem[] getComputingResourceRequirements() throws NoSuchFieldException{
+		
+		Requirements req = this.task.getRequirements();
+		if(req == null)
+			throw new NoSuchFieldException("Requierements section for job " + getJobId() 
+										+ " task "+ getId() + " is not defined.");
+		
+		TaskResourceRequirements taskReq = req.getTaskResourceRequirements();
+		if(taskReq == null)
+			throw new NoSuchFieldException("Task resource requirements section for job " + getJobId() 
+					+ " task "+ getId() + " is not defined.");
+		
+		ComputingResource computingResource = taskReq.getComputingResource(0);
+		if(computingResource == null)
+			throw new NoSuchFieldException("Computing resource requirement for job " + getJobId() 
+					+ " task "+ getId() + " is not defined.");
+		
+		ComputingResourceBaseTypeItem item[] = computingResource.getComputingResourceBaseTypeItem();
+		if(item == null || item.length == 0)
+			throw new NoSuchFieldException("Computing resource requirement is empty for job " + getJobId() 
+					+ " task "+ getId());
+	
+		return item;
+	}
+	
+	public void setValue(ResourceParameterName parameterName, Object newValue) throws NoSuchFieldException{
+		boolean notFound = true;
+		
+		ComputingResourceParameterTypeNameType name = ComputingResourceParameterTypeNameType.valueOf(parameterName.value().toUpperCase());
+		
+		ComputingResourceBaseTypeItem item[] = getComputingResourceRequirements();
+		
+		for(int i = 0; i < item.length && notFound; i++){
+			ComputingResourceParameterType hostParameter = item[i].getHostParameter();
+			if(hostParameter == null)
+				continue;
+			
+			if(name == hostParameter.getName()) {
+				hostParameter.
+						getParameterTypeChoice().
+						getParameterTypeChoiceItem(0).
+						getParameterValue().
+						setContent(((Integer)newValue).doubleValue());
+				notFound = false;
+			}
+		}
+		
+		if(notFound)
+			throw new NoSuchFieldException(parameterName + " for job " + getJobId() 
+					+ " task "+ getId() + " is not defined.");
+	}
+
+	public List<AbstractProcessesGroup> getProcessesGroups() {
+		return this.groups;
+	}
+	
+	public List<AbstractProcesses> getProcesses(){
+		return this.processes;
+	}
+	
+	public List<AbstractProcesses> getProcesses(AbstractProcessesGroup processGroup){
+		if(this.processes == null)
+			return null;
+		
+		List<AbstractProcesses> ret = new ArrayList<AbstractProcesses>();
+		
+		for(int i = 0; i < processes.size(); i++){
+			AbstractProcesses p = processes.get(i);
+			if(p.belongsTo(processGroup))
+				ret.add(p);
+		}
+		
+		return ret;
+	}
+	
+	protected void prepareTopology(){
+		if(this.task.getRequirements() == null)
+			return;
+		
+		if(this.task.getRequirements().getTopologyCount() < 1)
+			return;
+		
+		Topology topology = this.task.getRequirements().getTopology(0);
+		
+		if(topology.getGroupCount() > 0){
+			this.groups = new ArrayList<AbstractProcessesGroup>(topology.getGroupCount());
+		}
+		
+		for(int i = 0; i < topology.getGroupCount(); i++){
+			this.groups.add(new ProcessesGroup(topology.getGroup(i)));
+		}
+
+		if(topology.getProcessesCount() > 0){
+			this.processes = new ArrayList<AbstractProcesses>(topology.getProcessesCount());
+		}
+
+		for(int i = 0; i < topology.getProcessesCount(); i++){
+			org.qcg.broker.schemas.resreqs.Processes p = topology.getProcesses(i);
+			if(p.getProcessesResourceRequirements() == null){
+				TaskResourceRequirements trr = this.task.getRequirements().getTaskResourceRequirements();
+				if(trr != null) {
+					ProcessesResourceRequirements prr = new ProcessesResourceRequirements();
+					
+					for(int cridx = 0; cridx < trr.getComputingResourceCount(); cridx++){
+						ComputingResourceExtType cre = new ComputingResourceExtType();
+						ComputingResource cr = trr.getComputingResource(cridx);
+						
+						for(int j = 0; j < cr.getComputingResourceBaseTypeItemCount(); j++){
+							cre.addComputingResourceBaseTypeItem(cr.getComputingResourceBaseTypeItem(j));
+						}
+						
+						prr.addComputingResource(cre);
+					}
+					
+					p.setProcessesResourceRequirements(prr);
+				}
+			}
+			
+			this.processes.add(new Processes(p));
+		}
+	}
+
+	public double getCpuCntRequest() throws NoSuchFieldException {
+		return getParameterDoubleValue(ResourceParameterName.CPUCOUNT);
+	}
+
+	public double getMemoryRequest() throws NoSuchFieldException {
+		return getParameterDoubleValue(ResourceParameterName.MEMORY);
+	}
+	
+	public long getLength() {
+		return this.length;
+	}
+
+	public int getStatus() {
+		return this.status;
+	}
+
+	public void setLength(long length) {
+		this.length = length;
+	}
+
+	public void setStatus(int status){
+		this.status = status;
+	}
+	
+	public void setSenderId(int id){
+		this.senderId = id;
+	}
+	
+	public int getSenderId(){
+		return this.senderId;
+	}
+	
+	public boolean isFinished(){
+		if(processes == null)
+			return (status > 3 && status <= 6);
+		
+		for(int i = 0; i < processes.size(); i++){
+			if(!processes.get(i).isFinished())
+				return false;
+		}
+		
+		return true;
+	}
+	
+	public long getWorkloadLogWaitTime() {
+		return workloadLogWaitTime;
+	}
+
+	public void setWorkloadLogWaitTime(long waitTime) {
+		this.workloadLogWaitTime = waitTime;
+	}
+	
+	/*public void addToResPath(String resName){
+		if(resPathHistory == null)
+			resPathHistory = new String();
+		resPathHistory = new StringBuffer(resPathHistory).append(resName).append("_").toString();
+
+	}
+	
+	public String getResPath(){
+		return this.resPathHistory;
+
+	}*/
+
+
+	@Override
+	public int getUserID() {
+		// TODO Auto-generated method stub
+		return 0;
+	}
+
+	public boolean isRegistered() {
+		return isRegistered;
+	}
+
+	public void register(JobRegistryImpl jobRegistry) {
+		isRegistered = true;
+	}
+
+	public void accept(WorkloadUnitHandler wuh) {
+		wuh.handleTask(this);
+	}
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/tasks/WorkloadUnit.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/tasks/WorkloadUnit.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/tasks/WorkloadUnit.java	(revision 477)
@@ -0,0 +1,25 @@
+package schedframe.scheduling.tasks;
+
+import schedframe.DescriptionContainer;
+import schedframe.scheduling.WorkloadUnitHandler;
+import schedframe.scheduling.manager.tasks.JobRegistryImpl;
+
+public interface WorkloadUnit<T> extends DescriptionContainer<T> {
+
+	public String getId();
+	
+	public int getUserID();
+	
+	public int getStatus();
+	
+	public void setStatus(int status) throws Exception;
+
+	public boolean isFinished();
+
+	public boolean isRegistered();
+
+	public void register(JobRegistryImpl jobRegistry);
+	
+	public void accept(WorkloadUnitHandler wuh);
+
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/tasks/ProcessesGroup.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/tasks/ProcessesGroup.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/tasks/ProcessesGroup.java	(revision 477)
@@ -0,0 +1,16 @@
+package schedframe.scheduling.tasks;
+
+import org.qcg.broker.schemas.resreqs.Group;
+
+
+/**
+ * @author Marcin Krystek
+ */
+
+public class ProcessesGroup extends AbstractProcessesGroup {
+
+	public ProcessesGroup(Group group){
+		super(group.getGroupId());
+	}
+	
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/tasks/SubmittedTask.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/tasks/SubmittedTask.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/tasks/SubmittedTask.java	(revision 477)
@@ -0,0 +1,269 @@
+package schedframe.scheduling.tasks;
+
+import gridsim.GridSim;
+import gridsim.Gridlet;
+import gridsim.ResGridlet;
+import gssim.schedframe.scheduling.ExecTask;
+import gssim.schedframe.scheduling.Executable;
+
+import java.util.List;
+
+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.UsedResourceList;
+import schedframe.scheduling.WorkloadUnitHandler;
+import schedframe.scheduling.manager.tasks.JobRegistryImpl;
+import schedframe.scheduling.tasks.requirements.ResourceParameterName;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+public class SubmittedTask extends ResGridlet implements ExecTask{
+
+	protected Executable task;
+	protected int estimatedDuration;
+	protected UsedResourceList<ResourceHistoryItem> usedResources;
+	//protected List<String> visitedResources;
+	
+	public SubmittedTask(Executable exec) {
+		super(exec);
+		task = exec;
+		this.usedResources = new UsedResourceList<ResourceHistoryItem>();
+		if(exec.requireReservation())
+			this.reservID_ = Integer.valueOf(exec.getReservationId());
+		//this.visitedResources = new ArrayList<String>();
+	}
+
+	public double getCpuCntRequest() throws NoSuchFieldException {
+		return task.getCpuCntRequest();
+	}
+
+	public DateTime getExecutionEndTime() throws NoSuchFieldException {
+		return task.getExecutionEndTime();
+	}
+
+	public DateTime getExecutionStartTime() throws NoSuchFieldException {
+		return task.getExecutionStartTime();
+	}
+
+	public ReadableDuration getExpectedDuration() throws NoSuchFieldException {
+		return task.getExpectedDuration();
+	}
+
+	public int getEstimatedDuration(){
+		return this.estimatedDuration;
+	}
+	
+	public void setEstimatedDuration(int value){
+		this.estimatedDuration = value;
+	}
+	
+	public String getId() {
+		return task.getId();
+	}
+
+	public String getJobId() {
+		return task.getJobId();
+	}
+
+	public long getLength() {
+		return task.getLength();
+	}
+
+	public double getMemoryRequest() throws NoSuchFieldException {
+		return task.getMemoryRequest();
+	}
+
+	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 List<AbstractProcessesGroup> getProcessesGroups() {
+		throw new RuntimeException("Not implemented");
+	}
+	
+	public List<AbstractProcesses> getProcesses(){
+		throw new RuntimeException("Not implemented");
+	}
+	
+	public List<AbstractProcesses> getProcesses(AbstractProcessesGroup processGroup){
+		throw new RuntimeException("Not implemented");
+	}
+
+	public int getStatus() {
+		return task.getStatus();
+	}
+
+	public DateTime getSubmissionTimeToBroker() {
+		return task.getSubmissionTimeToBroker();
+	}
+
+	public String getUserDn() {
+		return task.getUserDn();
+	}
+
+	public void setLength(long length) {
+		throw new RuntimeException("Task length should not be changed here.");
+	}
+
+	public void setStatus(int status) throws Exception {
+		task.setStatus(status);
+	}
+
+	public org.qcg.broker.schemas.resreqs.Task getDescription() {
+		return (org.qcg.broker.schemas.resreqs.Task) task.getDescription();
+	}
+
+	public String getDocument() throws Exception {
+		return task.getDocument();
+	}
+	
+	public boolean expectSpecificResource(ResourceParameterName resourceName){
+		return task.expectSpecificResource(resourceName);
+	}
+	
+	public Object getExpectedSpecificResource(ResourceParameterName resourceName){
+		return task.getExpectedSpecificResource(resourceName);
+	}
+
+	public long getWorkloadLogWaitTime() {
+		return task.getWorkloadLogWaitTime();
+	}
+	
+	public void addUsedResources(ResourceHistoryItem usedResources){
+		this.usedResources.add(usedResources);
+	}
+	
+	//public List<Map<ResourceParameterName, ResourceUnit>> getUsedResources(){
+	public UsedResourceList<ResourceHistoryItem> getUsedResources(){
+		return this.usedResources;
+	}
+	
+	public boolean setGridletStatus(int status)
+    {
+        // gets Gridlet's previous status
+        int prevStatus = gridlet_.getGridletStatus();
+
+        // if the status of a Gridlet is the same as last time, then ignore
+        if (prevStatus == status) {
+            return false;
+        }
+
+        boolean success = true;
+        try
+        {
+            double clock = GridSim.clock();   // gets the current clock
+            long sec = DateTimeUtilsExt.currentTimeMillis() / 1000; // time in seconds 
+            clock = Long.valueOf(sec).doubleValue();
+            
+            // sets Gridlet's current status
+            gridlet_.setGridletStatus(status);
+
+            // if a previous Gridlet status is INEXEC
+            if (prevStatus == Gridlet.INEXEC)
+            {
+                // and current status is either CANCELED, PAUSED or SUCCESS
+                if (status == Gridlet.CANCELED || status == Gridlet.PAUSED ||
+                    status == Gridlet.SUCCESS)
+                {
+                    // then update the Gridlet completion time
+                    totalCompletionTime_ += (clock - startExecTime_);
+                    index_ = 0;
+                    return true;
+                }
+            }
+
+            if (prevStatus == Gridlet.RESUMED && status == Gridlet.SUCCESS)
+            {
+                // then update the Gridlet completion time
+                totalCompletionTime_ += (clock - startExecTime_);
+                return true;
+            }
+
+            // if a Gridlet is now in execution
+            if (status == Gridlet.INEXEC ||
+                (prevStatus == Gridlet.PAUSED && status == Gridlet.RESUMED) )
+            {
+            	
+                startExecTime_ = clock;
+                gridlet_.setExecStartTime(startExecTime_);
+        		ProcessingElements pes = (ProcessingElements) getUsedResources().getLast().getResourceUnits().get(StandardResourceUnitName.PE);
+        		for (ComputingResource resource : pes) {
+
+        			visitResource(resource.getName());
+        			ComputingResource parent = resource.getParent();
+
+					List<String> visitedResource = getVisitedResources();
+        			while (parent != null && !ArrayUtils.contains(visitedResource.toArray(new String[visitedResource.size()]), parent.getName())) {
+        				visitResource(parent.getName());
+        				parent = parent.getParent();
+        			}
+        		}
+            }
+        }
+        catch(Exception e) {
+            success = false;
+        }
+
+        return success;
+    }
+	
+	
+	protected void init() {
+		super.init();
+		double time =  DateTimeUtilsExt.getDateTimeAt(arrivalTime_).getMillis() / 1000;
+		this.gridlet_.setSubmissionTime(time);
+	 }
+
+
+	@Override
+	public boolean isFinished() {
+		// TODO Auto-generated method stub
+		return false;
+	}
+	
+	/*public void addToResPath(String resName){
+		task.addToResPath(resName);
+	}
+	
+	public String getResPath(){
+		return task.getResPath();
+	}*/
+	
+	public void visitResource(String resName){
+		task.visitResource(resName);
+	}
+	
+	public List<String> getVisitedResources(){
+		return task.getVisitedResources();
+	}
+	
+	public boolean isRegistered() {
+		return task.isRegistered();
+	}
+
+	public void register(JobRegistryImpl jobRegistry) {
+		task.register(jobRegistry);
+		//jobRegistry.addTask(this);
+	}
+	
+	@Override
+	public void accept(WorkloadUnitHandler wuh) {
+		wuh.handleSubmittedTask(this);
+	}
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/tasks/TaskInterface.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/tasks/TaskInterface.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/tasks/TaskInterface.java	(revision 477)
@@ -0,0 +1,121 @@
+package schedframe.scheduling.tasks;
+
+import java.util.List;
+
+import org.joda.time.DateTime;
+import org.joda.time.ReadableDuration;
+
+import schedframe.scheduling.tasks.requirements.ResourceParameterName;
+
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+public interface TaskInterface<T> extends WorkloadUnit<T> {
+	
+	/**
+	 * 
+	 * @return task identifier
+	 */
+	//public abstract String getId();
+	
+	/**
+	 * 
+	 * @return job identifier. This is the id of the job which contains this task
+	 */
+	public abstract String getJobId();
+	
+	/**
+	 * 
+	 * @return user identifier. This is id (distinguish name) of the user who has
+	 * submitted this task. 
+	 */
+	public abstract String getUserDn();
+	
+	/**
+	 * 
+	 * @return time when this task was submitted
+	 */
+	public abstract DateTime getSubmissionTimeToBroker();
+	
+	/**
+	 * 
+	 * @return the earliest time when the execution of this task can be started
+	 * @throws NoSuchFieldException if value is not specified
+	 */
+	public abstract DateTime getExecutionStartTime() throws NoSuchFieldException;
+	
+	/**
+	 * 
+	 * @return the latest time when the execution of this task must be ended
+	 * @throws NoSuchFieldException if value is not specified
+	 */
+	public abstract DateTime getExecutionEndTime() throws NoSuchFieldException;
+	
+	/**
+	 * 
+	 * @return user expectation about how long it will take to execute this task
+	 * @throws NoSuchFieldException if value is not specified
+	 */
+	public abstract ReadableDuration getExpectedDuration() throws NoSuchFieldException;
+	
+	/**
+	 * 
+	 * @param parameterName name of the task resource requirement
+	 * @return value of the numeral parameter which describes task resource requirement
+	 * @throws NoSuchFieldException if such parameter is not defined
+	 * @throws IllegalArgumentException if requested parameter is String value
+	 */
+	public abstract double getParameterDoubleValue(ResourceParameterName parameterName)
+		throws NoSuchFieldException, IllegalArgumentException;
+	
+	/**
+	 * 
+	 * @param parameterName name of the task resource requirement
+	 * @return value of the String parameter which describes task resource requirement
+	 * @throws NoSuchFieldException if such parameter is not defined
+	 * @throws IllegalArgumentException if requested parameter is Double value
+	 */
+	public abstract String getParameterStringValue(ResourceParameterName parameterName)
+		throws NoSuchFieldException, IllegalArgumentException;
+	
+	/**
+	 * 
+	 * @return length measured in instructions.
+	 */
+	public long getLength();
+	
+	/**
+	 * 
+	 * @param length measured in instructions.
+	 */
+	public void setLength(long length);
+	
+	/**
+	 * 
+	 * @return constant which represent current task status
+	 */
+	//public int getStatus();
+	
+	
+	public List<AbstractProcessesGroup> getProcessesGroups();
+	
+	public List<AbstractProcesses> getProcesses();
+	
+	public List<AbstractProcesses> getProcesses(AbstractProcessesGroup processGroup);
+	
+	public void setStatus(int status) throws Exception;
+	
+	public double getCpuCntRequest() throws NoSuchFieldException;
+	
+	public double getMemoryRequest() throws NoSuchFieldException;
+	
+	public long getWorkloadLogWaitTime();
+	
+	//public void addToResPath(String resName);
+	
+	//public String getResPath();
+		
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/tasks/requirements/AbstractResourceRequirements.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/tasks/requirements/AbstractResourceRequirements.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/tasks/requirements/AbstractResourceRequirements.java	(revision 477)
@@ -0,0 +1,62 @@
+package schedframe.scheduling.tasks.requirements;
+
+import schedframe.DescriptionContainer;
+
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ * @param <T>
+ */
+public abstract class AbstractResourceRequirements<T> implements DescriptionContainer<T> {
+
+	protected T resourceRequirements;
+	protected boolean isBestEffort;
+	
+	
+	protected AbstractResourceRequirements(){
+		this.isBestEffort = true;
+	}
+	/**
+	 * 
+	 * @param parameterName name of the task resource requirement
+	 * @return value of the numeral parameter which describes task resource requirement
+	 * @throws NoSuchFieldException if such parameter is not defined
+	 * @throws IllegalArgumentException if requested parameter is String value
+	 */
+	public abstract double getParameterDoubleValue(ResourceParameterName parameterName)
+		throws NoSuchFieldException, IllegalArgumentException;
+	
+	/**
+	 * 
+	 * @param parameterName name of the task resource requirement
+	 * @return value of the String parameter which describes task resource requirement
+	 * @throws NoSuchFieldException if such parameter is not defined
+	 * @throws IllegalArgumentException if requested parameter is Double value
+	 */
+	public abstract String getParameterStringValue(ResourceParameterName parameterName)
+		throws NoSuchFieldException, IllegalArgumentException;
+	
+	
+	public double getCpuCntRequest() throws NoSuchFieldException{
+		return getParameterDoubleValue(ResourceParameterName.CPUCOUNT);
+	}
+	
+	public double getMemoryRequest() throws NoSuchFieldException{
+		return getParameterDoubleValue(ResourceParameterName.MEMORY);
+	}
+	
+	public int getProcessesCount(){
+		return 1;
+	}
+	
+	public boolean isBestEffort(){
+		return this.isBestEffort;
+	}
+	
+	public void setBestEffort(boolean value){
+		this.isBestEffort = value;
+	}
+	
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/tasks/requirements/ProcessesResourceRequirements.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/tasks/requirements/ProcessesResourceRequirements.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/tasks/requirements/ProcessesResourceRequirements.java	(revision 477)
@@ -0,0 +1,51 @@
+package schedframe.scheduling.tasks.requirements;
+
+import java.io.StringWriter;
+import java.io.Writer;
+
+import org.qcg.broker.schemas.resreqs.Processes;
+
+import schedframe.scheduling.tasks.AbstractProcesses;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+public class ProcessesResourceRequirements extends AbstractResourceRequirements<org.qcg.broker.schemas.resreqs.Processes> {
+
+	protected AbstractProcesses processes;
+	
+	public ProcessesResourceRequirements(AbstractProcesses processes){
+		this.processes = processes;
+	}
+	
+	public ProcessesResourceRequirements(org.qcg.broker.schemas.resreqs.Processes processes){
+		this.processes = new schedframe.scheduling.tasks.Processes(processes);
+	}
+	
+	public double getParameterDoubleValue(ResourceParameterName parameterName)
+			throws NoSuchFieldException, IllegalArgumentException {
+		return this.processes.getParameterDoubleValue(parameterName);
+	}
+
+	public String getParameterStringValue(ResourceParameterName parameterName)
+			throws NoSuchFieldException, IllegalArgumentException {
+		return this.processes.getParameterStringValue(parameterName);
+	}
+
+	public int getProcessesCount(){
+		return this.processes.getProcessesCount();
+	}
+	
+	public Processes getDescription() {
+		return this.resourceRequirements;
+	}
+
+	public String getDocument() throws Exception {
+		Writer w = new StringWriter();
+		this.resourceRequirements.marshal(w);
+		return w.toString();
+	}
+
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/tasks/requirements/TimeRequirements.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/tasks/requirements/TimeRequirements.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/tasks/requirements/TimeRequirements.java	(revision 477)
@@ -0,0 +1,215 @@
+package schedframe.scheduling.tasks.requirements;
+
+import java.io.StringWriter;
+import java.io.Writer;
+import java.util.Iterator;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.joda.time.DateTime;
+import org.joda.time.Duration;
+import org.joda.time.ReadableDuration;
+
+
+import org.qcg.broker.schemas.resreqs.ExecutionTimeType;
+import org.qcg.broker.schemas.resreqs.Task;
+
+import schedframe.scheduling.tasks.TaskInterface;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+public class TimeRequirements extends AbstractTimeRequirements<ExecutionTimeType>{
+	
+	protected static Log log = LogFactory.getLog(TimeRequirements.class);
+
+	private static final long serialVersionUID = -4011141375443906415L;
+
+	protected TimeRequirements(){
+	}
+	
+	public TimeRequirements(ExecutionTimeType execTimeType) throws NoSuchFieldException{
+		this.timeRequirements = execTimeType;
+		DateTime startTime = null;
+		DateTime endTime = null;
+
+		org.exolab.castor.types.Duration cd = execTimeType.getExecutionDuration();
+		this.expectedDuration = new Duration(cd.toLong());
+
+		
+		try {
+			startTime = new DateTime(execTimeType.getTimePeriod().getPeriodStart().getTime());
+		} catch (Exception e){
+			startTime = new DateTime();
+			log.warn("Period start is not defined.\n" + e.getMessage() + " Using current time: " + startTime);
+		}
+		
+		try {
+			endTime = new DateTime(execTimeType.getTimePeriod().getTimePeriodChoice().getPeriodEnd().getTime());
+		} catch (Exception e){
+			log.warn("Period end is not defined. Trying period duration...\n" + e.getMessage());
+			try {
+				org.exolab.castor.types.Duration duration = execTimeType.getTimePeriod().
+														getTimePeriodChoice().getPeriodDuration();
+				endTime = new DateTime(startTime.getMillis() + duration.toLong());
+			} catch(Exception e1){
+				endTime = new DateTime(Long.MAX_VALUE);
+				log.warn("Period duration is not defined.\n" + e1.getMessage() + " Using infinity: " + endTime);
+			}
+		}
+		
+		setEnd(endTime);
+		setStart(startTime);
+		
+	}
+	
+	public TimeRequirements(TaskInterface<?> task) throws NoSuchFieldException{
+
+		this.expectedDuration = task.getExpectedDuration();
+		
+		DateTime startTime = null;
+		DateTime endTime = null;
+		
+		try {
+			startTime = task.getExecutionStartTime();
+		} catch (NoSuchFieldException e) {
+			startTime = new DateTime();
+			log.warn(e.getMessage() + " Using current time as Start Time " + startTime);
+		}
+		
+		try {
+			endTime = task.getExecutionEndTime();
+		} catch(NoSuchFieldException e){
+			endTime = new DateTime(Long.MAX_VALUE);
+			log.warn(e.getMessage() + " Using infinity as End Time " + endTime);
+		}
+		
+		setEnd(endTime);
+		setStart(startTime);
+		
+		this.timeRequirements = ((Task)task.getDescription()).getExecutionTime();
+		
+	}
+	
+	public TimeRequirements(TaskInterface<?> task, long startInterval, long endInterval) throws NoSuchFieldException{
+		long taskLength = task.getLength();
+		long reqCpu = (long)task.getCpuCntRequest();
+		long taskDuration = taskLength/reqCpu;
+		long workloadLogWaitTime = task.getWorkloadLogWaitTime();
+		long workloadLogStartTime = task.getSubmissionTimeToBroker().getMillis()/1000 + workloadLogWaitTime;
+		long possibleStartTime = workloadLogStartTime - Math.min(workloadLogWaitTime, startInterval);
+
+		DateTime startTime = null;
+		DateTime endTime = null;
+				
+		try {
+			startTime = task.getExecutionStartTime();
+		} catch (NoSuchFieldException e) {
+			startTime = new DateTime(possibleStartTime * 1000);
+			log.warn(e.getMessage() + " Using current time as Start Time " + startTime);
+		}
+
+		try {
+			endTime = task.getExecutionEndTime();
+		} catch(NoSuchFieldException e){
+			endTime = new DateTime(startTime.getMillis() + (int)taskDuration * 1000 + endInterval * 1000);
+			log.warn(e.getMessage() + " Using " + endTime + " as End Time");
+		}
+		
+		setEnd(endTime);
+		setStart(startTime);
+		
+		this.timeRequirements = ((Task)task.getDescription()).getExecutionTime();
+		
+	}
+
+	public void setExpectedDuration(ReadableDuration duration){
+		this.expectedDuration = duration;
+	}
+	
+	public ExecutionTimeType getDescription() {
+		return this.timeRequirements;
+	}
+	
+	public String getDocument() throws Exception {
+		Writer w = new StringWriter();
+		this.timeRequirements.marshal(w);
+		return w.toString();
+	}
+	
+	public Iterator<AbstractTimeRequirements<?>> iterator(long interval){
+		return new TimeIntervalItr(this, interval);
+	}
+	
+	
+	protected class LocalTimeRequirements extends AbstractTimeRequirements<Object> {
+
+		private static final long serialVersionUID = 5132710437273933809L;
+
+		public LocalTimeRequirements(DateTime startTime, DateTime endTime, ReadableDuration duration){
+			setEnd(endTime);
+			setStart(startTime);
+			this.expectedDuration = duration;
+		}
+		
+		public Object getDescription() {
+			throw new RuntimeException("Not implementd.");
+		}
+
+		public String getDocument() throws Exception {
+			throw new RuntimeException("Not implemented.");
+		}
+		
+	}
+	
+	protected class TimeIntervalItr implements Iterator<AbstractTimeRequirements<?>> {
+
+		protected long interval;
+		protected ReadableDuration duration;
+		protected long endTime;
+		protected AbstractTimeRequirements<?> next;
+		
+		public TimeIntervalItr(AbstractTimeRequirements<?> timeReq, long interval){
+			this.interval = interval;
+			this.endTime = timeReq.getEndMillis();
+			this.duration = timeReq.getExpectedDuration();
+			
+			DateTime start = timeReq.getStart();
+			DateTime end = start.plus(timeReq.getExpectedDuration());
+			
+			this.next = new LocalTimeRequirements(start, end, this.duration);
+		}
+		
+		public boolean hasNext() {
+			
+			long intervalEnd = this.next.getEndMillis();
+			
+			return (intervalEnd <= endTime); 
+			
+		}
+
+		public AbstractTimeRequirements<?> next() {
+			AbstractTimeRequirements<?> ret = this.next;
+			
+			if(interval == 0) {
+				endTime = 0;
+			} else {
+				DateTime start = this.next.getStart().plus(interval);
+				DateTime end = this.next.getEnd().plus(interval);
+				
+				this.next = new LocalTimeRequirements(start, end, this.duration);
+			}
+			
+			return ret;
+			
+		}
+
+		public void remove() {
+			throw new RuntimeException("Not implemented.");
+		}
+		
+	}
+
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/tasks/requirements/AbstractTimeRequirements.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/tasks/requirements/AbstractTimeRequirements.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/tasks/requirements/AbstractTimeRequirements.java	(revision 477)
@@ -0,0 +1,28 @@
+package schedframe.scheduling.tasks.requirements;
+
+import org.joda.time.MutableInterval;
+import org.joda.time.ReadableDuration;
+
+import schedframe.DescriptionContainer;
+
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ * @param <T>
+ */
+public abstract class AbstractTimeRequirements<T> extends MutableInterval implements DescriptionContainer<T> {
+
+
+	private static final long serialVersionUID = 414381664327908536L;
+
+	protected T timeRequirements;
+	
+	protected ReadableDuration expectedDuration;
+	
+	public ReadableDuration getExpectedDuration(){
+		return this.expectedDuration;
+	}
+
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/tasks/requirements/ResourceParameterName.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/tasks/requirements/ResourceParameterName.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/tasks/requirements/ResourceParameterName.java	(revision 477)
@@ -0,0 +1,144 @@
+package schedframe.scheduling.tasks.requirements;
+
+
+public enum ResourceParameterName {
+
+	/**
+     * Constant OSNAME
+     */
+    OSNAME("osname"),
+    /**
+     * Constant OSTYPE
+     */
+    OSTYPE("ostype"),
+    /**
+     * Constant CPUARCH
+     */
+    CPUARCH("cpuarch"),
+    /**
+     * Constant OSVERSION
+     */
+    OSVERSION("osversion"),
+    /**
+     * Constant OSRELEASE
+     */
+    OSRELEASE("osrelease"),
+    /**
+     * Constant MEMORY
+     */
+    MEMORY("Memory"),
+    /**
+     * Constant FREEMEMORY
+     */
+    FREEMEMORY("freememory"),
+    /**
+     * Constant CPUCOUNT
+     */
+    CPUCOUNT("cpucount"),
+    
+    /**
+     * Constant CPUCOUNT
+     */
+    GPUCOUNT("gpucount"),
+    
+    /**
+     * Constant FREECPUS
+     */
+    FREECPUS("freecpus"),
+    /**
+     * Constant CPUSPEED
+     */
+    CPUSPEED("cpuspeed"),
+    /**
+     * Constant APPLICATION
+     */
+    APPLICATION("application"),
+    /**
+     * Constant DISKSPACE
+     */
+    DISKSPACE("Storage"),
+    /**
+     * Constant FREEDISKSPACE
+     */
+    FREEDISKSPACE("freediskspace"),
+    /**
+     * Constant REMOTESUBMISSIONINTERFACE
+     */
+    REMOTESUBMISSIONINTERFACE("remoteSubmissionInterface"),
+    /**
+     * Constant LOCALRESOURCEMANAGER
+     */
+    LOCALRESOURCEMANAGER("localResourceManager"),
+    /**
+     * Constant HOSTNAME
+     */
+    HOSTNAME("hostname"),
+    
+    COST("cost");
+    
+ //   PROCESSINGELEMENTS("processingElements");
+
+      //--------------------------/
+     //- Class/Member Variables -/
+    //--------------------------/
+
+    /**
+     * Field value.
+     */
+    private final java.lang.String value;
+
+
+      //----------------/
+     //- Constructors -/
+    //----------------/
+
+    private ResourceParameterName(final java.lang.String value) {
+        this.value = value;
+    }
+
+
+      //-----------/
+     //- Methods -/
+    //-----------/
+
+    /**
+     * Method fromValue.
+     * 
+     * @param value
+     * @return the constant for this value
+     */
+    public static ResourceParameterName fromValue(final java.lang.String value) {
+        for (ResourceParameterName c: ResourceParameterName.values()) {
+            if (c.value.equals(value)) {
+                return c;
+            }
+        }
+        throw new IllegalArgumentException(value);
+    }
+
+    /**
+     * 
+     * 
+     * @param value
+     */
+    public void setValue(final java.lang.String value) {
+    }
+
+    /**
+     * Method toString.
+     * 
+     * @return the value of this constant
+     */
+    public java.lang.String toString() {
+        return this.value;
+    }
+
+    /**
+     * Method value.
+     * 
+     * @return the value of this constant
+     */
+    public java.lang.String value() {
+        return this.value;
+    }
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/tasks/requirements/ResourceRequirements.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/tasks/requirements/ResourceRequirements.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/tasks/requirements/ResourceRequirements.java	(revision 477)
@@ -0,0 +1,67 @@
+package schedframe.scheduling.tasks.requirements;
+
+import java.io.StringWriter;
+import java.io.Writer;
+
+import org.exolab.castor.xml.Marshaller;
+import org.exolab.castor.xml.ResolverException;
+import org.exolab.castor.xml.XMLContext;
+
+
+import schedframe.scheduling.tasks.TaskInterface;
+import org.qcg.broker.schemas.resreqs.Task;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+public class ResourceRequirements extends AbstractResourceRequirements<Task>{
+
+	protected static Marshaller marshaller;
+	static {
+		XMLContext context = new XMLContext();
+		try {
+			context.addClass(org.qcg.broker.schemas.resreqs.Task.class);
+			marshaller = context.createMarshaller();
+		} catch (ResolverException e) {
+			e.printStackTrace();
+			marshaller = null;
+		}
+	}
+	
+	protected TaskInterface<?> task;
+	
+	public ResourceRequirements(Task task){
+		this.task = new schedframe.scheduling.tasks.Task(task);
+		this.resourceRequirements = task;
+	}
+	
+	public ResourceRequirements(TaskInterface<?> task){
+		this.task = task;
+		this.resourceRequirements = (Task) task.getDescription();
+	}
+	
+	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 Task getDescription() {
+		return this.resourceRequirements;
+	}
+
+	public String getDocument() throws Exception {
+		Writer w = new StringWriter();
+		
+		marshaller.marshal(this.resourceRequirements, w);
+
+		return w.toString();
+	}
+
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/tasks/Processes.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/tasks/Processes.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/tasks/Processes.java	(revision 477)
@@ -0,0 +1,237 @@
+package schedframe.scheduling.tasks;
+
+import java.util.List;
+
+import org.qcg.broker.schemas.resreqs.ComputingResourceBaseTypeItem;
+import org.qcg.broker.schemas.resreqs.ComputingResourceExtType;
+import org.qcg.broker.schemas.resreqs.ComputingResourceParameterType;
+import org.qcg.broker.schemas.resreqs.CountType;
+import org.qcg.broker.schemas.resreqs.ProcessesChoice;
+import org.qcg.broker.schemas.resreqs.ProcessesMapType;
+import org.qcg.broker.schemas.resreqs.ProcessesResourceRequirements;
+import org.qcg.broker.schemas.resreqs.types.ComputingResourceParameterTypeNameType;
+
+import schedframe.scheduling.WorkloadUnitHandler;
+import schedframe.scheduling.manager.tasks.JobRegistryImpl;
+import schedframe.scheduling.tasks.requirements.ResourceParameterName;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+public class Processes extends AbstractProcesses{
+
+	protected org.qcg.broker.schemas.resreqs.Processes pr;
+	protected int status;
+	
+	protected Processes(){
+		this.pr = null;
+	}
+	
+	public Processes(org.qcg.broker.schemas.resreqs.Processes qcgProcesses){
+		this.pr = qcgProcesses;
+	}
+
+	public String getId() {
+		return this.pr.getProcessesId();
+	}
+
+	public int getProcessesCount() {
+		ProcessesChoice choice = this.pr.getProcessesChoice();
+		
+		CountType countType = choice.getProcessesCount();
+		if(countType != null) {
+			return countType.getValue().getContent().intValue();
+		} 
+		
+		ProcessesMapType mapType = choice.getProcessesMap();
+		if(mapType != null) {
+			int slots = mapType.getSlotsPerNode();
+			int processesPerNode = mapType.getProcessesPerNodeCount();
+			return slots * processesPerNode;
+		}
+		
+		return 0;
+	}
+	
+	public int[] getProcessesMap(){
+		if(this.pr.getProcessesChoice().getProcessesMap() == null)
+			return null;
+		
+		return this.pr.getProcessesChoice().getProcessesMap().getProcessesPerNode();
+	}
+	
+	public int getSlotsPerNode(){
+		if(this.pr.getProcessesChoice().getProcessesMap() == null)
+			return 0;
+		
+		return this.pr.getProcessesChoice().getProcessesMap().getSlotsPerNode();
+		
+	}
+	
+	public double getParameterDoubleValue(ResourceParameterName parameterName)
+			throws NoSuchFieldException, IllegalArgumentException {
+		ComputingResourceParameterTypeNameType name = ComputingResourceParameterTypeNameType.valueOf(parameterName.value().toUpperCase());
+		
+		switch (name) {
+			case APPLICATION:
+			case CPUARCH:
+			case HOSTNAME:
+			case LOCALRESOURCEMANAGER:
+			case OSNAME:
+			case OSRELEASE:
+			case OSTYPE:
+			case OSVERSION:
+			case REMOTESUBMISSIONINTERFACE:
+				throw new IllegalArgumentException("For " + parameterName + " use getParameterStringValue() method.");
+		}
+
+		ComputingResourceBaseTypeItem item[] = getComputingResourceRequirements();
+		
+		double returnValue = 0;
+		boolean notFound = true;
+		
+		for(int i = 0; i < item.length && notFound; i++){
+			ComputingResourceParameterType hostParameter = item[i].getHostParameter();
+			if(hostParameter == null)
+				continue;
+			
+			if(name == hostParameter.getName()) {
+				returnValue = hostParameter.getParameterTypeChoice().getParameterTypeChoiceItem(0).getParameterValue().getContent();
+				notFound = false;
+			}
+		}
+		
+		if(notFound)
+			throw new NoSuchFieldException(parameterName + " for processes " + getId() 
+					+ " is not defined.");
+		
+		return returnValue;
+	}
+
+	public String getParameterStringValue(ResourceParameterName parameterName)
+			throws NoSuchFieldException, IllegalArgumentException {
+		ComputingResourceParameterTypeNameType name = ComputingResourceParameterTypeNameType.valueOf(parameterName.value().toUpperCase());
+		
+		switch (name) {
+			case CPUCOUNT:
+			case GPUCOUNT:
+			case CPUSPEED:
+			case DISKSPACE:
+			case FREECPUS:
+			case FREEDISKSPACE:
+			case FREEMEMORY:
+			case MEMORY:
+				throw new IllegalArgumentException("For " + parameterName + " use getParameterDoubleValue() method.");
+		}
+		
+		ComputingResourceBaseTypeItem item[] = getComputingResourceRequirements();
+		
+		String returnValue = null;
+		boolean notFound = true;
+		
+		for(int i = 0; i < item.length && notFound; i++){
+			ComputingResourceParameterType hostParameter = item[i].getHostParameter();
+			if(hostParameter == null)
+				continue;
+			
+			if(name == hostParameter.getName()) {
+				returnValue = hostParameter.getStringValue(0).getValue();
+				notFound = false;
+			}
+		}
+		
+		if(notFound)
+			throw new NoSuchFieldException(parameterName + " for processes " + getId() + " is not defined.");
+		
+		
+		return returnValue;
+	}
+	
+	public boolean belongsTo(AbstractProcessesGroup group) {
+		for(int i = 0; i < this.pr.getGroupIdReferenceCount(); i++){
+			String idRef = this.pr.getGroupIdReference(i);
+			if(idRef.equals(group.getId())){
+				return true;
+			}
+		}
+		
+		return false;
+	}
+
+	protected ComputingResourceBaseTypeItem[] getComputingResourceRequirements() throws NoSuchFieldException{
+		
+		ProcessesResourceRequirements req = this.pr.getProcessesResourceRequirements();
+		if(req == null)
+			throw new NoSuchFieldException("Requierements section for processes " + getId() 
+										+ " is not defined.");
+		
+		ComputingResourceExtType computingResource = req.getComputingResource(0);
+		if(computingResource == null)
+			throw new NoSuchFieldException("Computing resource requirement for processes " + getId() 
+										+ " is not defined.");
+		
+		ComputingResourceBaseTypeItem item[] = computingResource.getComputingResourceBaseTypeItem();
+		if(item == null || item.length == 0)
+			throw new NoSuchFieldException("Computing resource requirement is empty for processes " + getId());
+	
+		return item;
+	}
+	
+	public void setStatus(int status){
+		this.status = status;
+	}
+	
+	public boolean isFinished(){
+		return (this.status > 3 && this.status <= 6);
+	}
+	
+	public boolean isDivisible(){
+		return this.pr.getDivisible();
+	}
+	
+	public void setDivisible(boolean value){
+		this.pr.setDivisible(value);
+	}
+
+	public org.qcg.broker.schemas.resreqs.Processes getDescription(){
+		return this.pr;
+	}
+
+	@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
+	public boolean isRegistered() {
+		// TODO Auto-generated method stub
+		return false;
+	}
+
+	@Override
+	public void register(JobRegistryImpl jobRegistry) {
+		// TODO Auto-generated method stub
+		
+	}
+
+	@Override
+	public void accept(WorkloadUnitHandler wuh) {
+		// TODO Auto-generated method stub
+		
+	}
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/tasks/AbstractProcessesGroup.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/tasks/AbstractProcessesGroup.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/tasks/AbstractProcessesGroup.java	(revision 477)
@@ -0,0 +1,22 @@
+package schedframe.scheduling.tasks;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+public abstract class AbstractProcessesGroup {
+
+	protected String groupId;
+	
+	protected AbstractProcessesGroup(){
+	}
+	
+	protected AbstractProcessesGroup(String groupId){
+		this.groupId = groupId;
+	}
+	
+	public String getId(){
+		return this.groupId;
+	}
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/tasks/AbstractProcesses.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/tasks/AbstractProcesses.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/tasks/AbstractProcesses.java	(revision 477)
@@ -0,0 +1,29 @@
+package schedframe.scheduling.tasks;
+
+import schedframe.scheduling.tasks.requirements.ResourceParameterName;
+
+public abstract class AbstractProcesses<T> implements WorkloadUnit<T>{
+	
+	
+	public abstract String getId();
+	
+	public abstract int getProcessesCount();
+	
+	public abstract int[] getProcessesMap();
+	
+	public abstract int getSlotsPerNode();
+	
+	public abstract boolean belongsTo(AbstractProcessesGroup group);
+	
+	public abstract double getParameterDoubleValue(ResourceParameterName parameterName)
+		throws NoSuchFieldException, IllegalArgumentException;
+
+	public abstract String getParameterStringValue(ResourceParameterName parameterName)
+		throws NoSuchFieldException, IllegalArgumentException;
+	
+	public abstract boolean isFinished();
+	
+	public abstract void setStatus(int status);
+	
+	public abstract boolean isDivisible();
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/tasks/Job.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/tasks/Job.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/tasks/Job.java	(revision 477)
@@ -0,0 +1,250 @@
+package schedframe.scheduling.tasks;
+
+
+import org.qcg.broker.schemas.resreqs.ParentType;
+import org.qcg.broker.schemas.resreqs.ResourceRequirements;
+import org.qcg.broker.schemas.resreqs.types.TaskStatesName;
+
+import java.io.StringWriter;
+import java.io.Writer;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.joda.time.DateTime;
+
+import qcg.shared.constants.BrokerConstants;
+
+import schedframe.scheduling.WorkloadUnitHandler;
+import schedframe.scheduling.manager.tasks.JobRegistryImpl;
+import schedframe.scheduling.policy.AbstractManagementSystem;
+
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+public class Job implements JobInterface<ResourceRequirements> {
+
+	protected List<Task> tasks;
+	protected int senderId;
+	protected boolean isRegistered;
+	
+	public Job(String id){
+		tasks = new ArrayList<Task>();
+	}
+	
+	public Job(ResourceRequirements resourceRequirements) throws Exception{
+		org.qcg.broker.schemas.resreqs.Task task[] = resourceRequirements.getTask();
+		if(task == null || task.length == 0)
+			throw new NoSuchFieldException("No tasks are defined for job.");
+		
+		this.tasks = new ArrayList<Task>();
+		
+		for(int i = 0; i < task.length; i++){
+			this.tasks.add(new Task(task[i]));
+		}
+		
+		isRegistered = true;
+	}
+
+	public void add(Task task) {
+		this.tasks.add(task);
+	}
+	
+	public String getId() {
+		if(this.tasks.size() == 0)
+			throw new RuntimeException("No tasks are defined for job, so it is not possible to obtain job id.");
+		
+		return this.tasks.get(0).getJobId();
+	}
+	
+	public List<Task> getTask() {
+		return this.tasks;
+	}
+	
+	public Task getTask(String taskId) throws NoSuchFieldException {
+		if(taskId == null)
+			throw new IllegalArgumentException("TaskId can not be null. Specify appropriate taskId.");
+		
+		if(this.tasks == null || this.tasks.size() == 0)
+			throw new NoSuchFieldException("No tasks are defined for job.");
+		
+		Task retTask = null;
+		
+		Iterator<Task> itr = this.tasks.iterator();
+		while(itr.hasNext() && retTask == null){
+			Task task = itr.next();
+			if(taskId.equals(task.getId())){
+				retTask = task;
+			}
+		}
+
+		if(retTask == null)
+			throw new NoSuchFieldException("Task "+taskId + " is not available in job " + getId());
+		
+		return retTask;
+	}
+	
+	public int getTaskCount() {
+		return this.tasks.size();
+	}
+
+	
+	public ResourceRequirements getDescription() {
+		
+		ResourceRequirements resReq = new ResourceRequirements();
+		if(this.tasks == null)
+			return resReq;
+		
+		Iterator<Task> itr = this.tasks.iterator();
+		
+		while(itr.hasNext()){
+			Task task = (Task) itr.next();
+			resReq.addTask(task.getDescription());
+		}
+		
+		return resReq;
+	}
+
+	public String getDocument() throws Exception {
+		ResourceRequirements resReq = getDescription();
+		Writer writer = new StringWriter();
+		
+		resReq.marshal(writer);
+		
+		return writer.toString();
+	}
+
+	public boolean isFinished(){
+		
+		for(int i = 0; i < tasks.size(); i++){
+			//if(tasks.get(i).getStatus() != BrokerConstants.TASK_STATUS_FINISHED)
+			//	return false;
+			if(!tasks.get(i).isFinished())
+				return false;
+		}
+		return true;
+	}
+	
+	public DateTime getSubmissionTimeToBroker(){
+		return tasks.get(0).getSubmissionTimeToBroker();
+	}
+	
+	public int getStatus(){
+		boolean isForAll = true;
+		int baseStatus = tasks.get(0).getStatus();
+		
+		for(int i = 1; i < tasks.size() && isForAll; i++){
+			Task t = tasks.get(i);
+			isForAll = (t.getStatus() == baseStatus);
+			switch(t.getStatus()){
+				case (int)BrokerConstants.TASK_STATUS_QUEUED: 
+					return (int)BrokerConstants.TASK_STATUS_QUEUED;
+				case (int)BrokerConstants.TASK_STATUS_UNSUBMITTED:
+					return (int)BrokerConstants.TASK_STATUS_UNSUBMITTED;
+			}
+		}
+		
+		if(isForAll && baseStatus == BrokerConstants.TASK_STATUS_FINISHED)
+			return (int)BrokerConstants.JOB_STATUS_FINISHED;
+		
+		return -1;
+	}
+	
+	public boolean setStatus(String taskId, int status){
+		boolean found = false;
+		for(int i = 0; i < tasks.size() && !found; i++){
+			Task t = tasks.get(i);
+			if(taskId.equals(t.getId())){
+				try {
+					t.setStatus(status);
+				} catch (Exception e) {
+					// TODO Auto-generated catch block
+					e.printStackTrace();
+				}
+				found = true;
+			}
+		}
+		return found;
+	}
+	
+	public void setSenderId(int id){
+		this.senderId = id;
+	}
+	
+	public int getSenderId(){
+		return this.senderId;
+	}
+	
+	public int getUserID(){
+		return this.senderId;
+	}
+
+	public void setStatus(int status) throws Exception{
+
+	}
+
+	public boolean isRegistered() {
+		return isRegistered;
+	}
+
+	public void register(JobRegistryImpl jobRegistry) {
+		isRegistered = jobRegistry.addJob(this);
+		
+	}
+	
+	@Override
+	public void accept(WorkloadUnitHandler wuh) {
+		wuh.handleJob(this);
+	}
+	
+	private List<Task> getReadyTasks(){
+		
+		List<Task> readyTasks = new ArrayList<Task>();
+
+		int size = tasks.size();
+		for(int i = 0; i < size; i++){
+			int parCnt;
+			int previousTaskReadyCnt = 0;
+			Task task = tasks.get(i);
+			if(task.getStatus() != (int)BrokerConstants.TASK_STATUS_UNSUBMITTED)
+				continue;
+			try{		
+				parCnt = task.getDescription().getWorkflow().getParentCount();
+			} catch(Exception e){
+				parCnt = 0;
+				//e.printStackTrace();
+			}
+			if(parCnt == 0)
+			{
+				readyTasks.add(task);
+			}
+			else
+			{
+				for(int j = 0; j < parCnt; j++){
+					ParentType par = task.getDescription().getWorkflow().getParent(j);
+					if(par.getTriggerState().compareTo(TaskStatesName.FINISHED) == 0){
+						try {
+							if(!getTask(par.getContent()).isFinished()){
+								break;
+							}
+						} catch (NoSuchFieldException e) {
+							// TODO Auto-generated catch block
+							e.printStackTrace();
+						}
+					}
+					previousTaskReadyCnt++;
+				}
+				
+				if(previousTaskReadyCnt == parCnt && task.getDescription().getWorkflow().getAnd() != null)
+						readyTasks.add(task);
+				else if(previousTaskReadyCnt > 0 && task.getDescription().getWorkflow().getOr() != null)
+					readyTasks.add(task);
+			}
+		}		
+		return readyTasks;
+	}
+	
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/tasks/JobInterface.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/tasks/JobInterface.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/tasks/JobInterface.java	(revision 477)
@@ -0,0 +1,47 @@
+package schedframe.scheduling.tasks;
+
+import java.util.List;
+
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+public interface JobInterface<T> extends WorkloadUnit<T> {
+
+	/**
+	 * 
+	 * @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;
+	
+	/**
+	 * 
+	 * @return list of tasks which belongs to this job
+	 */
+	public abstract List<? extends TaskInterface<?>> getTask();
+	
+	/**
+	 * 
+	 * @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 int getUserID();
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/plan/HostInterface.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/plan/HostInterface.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/plan/HostInterface.java	(revision 477)
@@ -0,0 +1,54 @@
+package schedframe.scheduling.plan;
+
+import schedframe.DescriptionContainer;
+
+
+public interface HostInterface<T> extends DescriptionContainer<T> {
+
+	/**
+	 * Returns the value of field 'frontendMachineParameters'.
+	 * 
+	 * @return the value of field 'FrontendMachineParameters'.
+	 */
+	public <ComputingResourcType> ComputingResourceTypeInterface<ComputingResourcType> getMachineParameters();
+
+	/**
+	 * Returns the value of field 'hostname'.
+	 * 
+	 * @return the value of field 'Hostname'.
+	 */
+	public java.lang.String getHostname();
+
+
+	/**
+	 * Returns the value of field 'queue'.
+	 * 
+	 * @return the value of field 'Queue'.
+	 */
+	public java.lang.String getQueue();
+
+	/**
+	 * Sets the value of field 'frontendMachineParameters'.
+	 * 
+	 * @param frontendMachineParameters the value of field
+	 * 'frontendMachineParameters'.
+	 */
+	public <ComputingResourceType> void setMachineParameters(
+			final ComputingResourceTypeInterface<ComputingResourceType> machineParameters);
+
+	/**
+	 * Sets the value of field 'hostname'.
+	 * 
+	 * @param hostname the value of field 'hostname'.
+	 */
+	public void setHostname(final java.lang.String hostname);
+
+
+	/**
+	 * Sets the value of field 'queue'.
+	 * 
+	 * @param queue the value of field 'queue'.
+	 */
+	public void setQueue(final java.lang.String queue);
+
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/plan/ComputingResourceTypeInterface.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/plan/ComputingResourceTypeInterface.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/plan/ComputingResourceTypeInterface.java	(revision 477)
@@ -0,0 +1,109 @@
+package schedframe.scheduling.plan;
+
+import schedframe.DescriptionContainer;
+
+
+
+public interface ComputingResourceTypeInterface <T> extends DescriptionContainer<T> {
+
+	/**
+	 * 
+	 * 
+	 * @param vComputingResourceTypeItem
+	 * @throws java.lang.IndexOutOfBoundsException if the index
+	 * given is outside the bounds of the collection
+	 */
+	public <ComputingResourceTypeItem> void addComputingResourceTypeItem(
+			final ComputingResourceTypeItemInterface<ComputingResourceTypeItem> vComputingResourceTypeItem)
+			throws java.lang.IndexOutOfBoundsException;
+
+	/**
+	 * 
+	 * 
+	 * @param index
+	 * @param vComputingResourceTypeItem
+	 * @throws java.lang.IndexOutOfBoundsException if the index
+	 * given is outside the bounds of the collection
+	 */
+	public <ComputingResourceTypeItem> void addComputingResourceTypeItem(
+			final int index,
+			final ComputingResourceTypeItemInterface<ComputingResourceTypeItem> vComputingResourceTypeItem)
+			throws java.lang.IndexOutOfBoundsException;
+
+	/**
+	 * Method getComputingResourceTypeItem.
+	 * 
+	 * @param index
+	 * @throws java.lang.IndexOutOfBoundsException if the index
+	 * given is outside the bounds of the collection
+	 * @return the value of the
+	 * schedframe.schedulingplan.impl.ComputingResourceTypeItem at
+	 * the given index
+	 */
+	public <ComputingResourceTypeItem> ComputingResourceTypeItemInterface<ComputingResourceTypeItem> 
+			getComputingResourceTypeItem(
+			final int index) throws java.lang.IndexOutOfBoundsException;
+
+	/**
+	 * Method getComputingResourceTypeItem.Returns the contents of
+	 * the collection in an Array.  <p>Note:  Just in case the
+	 * collection contents are changing in another thread, we pass
+	 * a 0-length Array of the correct type into the API call. 
+	 * This way we <i>know</i> that the Array returned is of
+	 * exactly the correct length.
+	 * 
+	 * @return this collection as an Array
+	 */
+	public <ComputingResourceTypeItem> ComputingResourceTypeItemInterface<ComputingResourceTypeItem>[] getComputingResourceTypeItem();
+
+	/**
+	 * Method getComputingResourceTypeItemCount.
+	 * 
+	 * @return the size of this collection
+	 */
+	public int getComputingResourceTypeItemCount();
+
+	/**
+	 */
+	public void removeAllComputingResourceTypeItem();
+
+	/**
+	 * Method removeComputingResourceTypeItem.
+	 * 
+	 * @param vComputingResourceTypeItem
+	 * @return true if the object was removed from the collection.
+	 */
+	public <ComputingResourceTypeItem> boolean removeComputingResourceTypeItem(
+			final ComputingResourceTypeItemInterface<ComputingResourceTypeItem> vComputingResourceTypeItem);
+
+	/**
+	 * Method removeComputingResourceTypeItemAt.
+	 * 
+	 * @param index
+	 * @return the element removed from the collection
+	 */
+	public <ComputingResourceTypeItem> ComputingResourceTypeItemInterface<ComputingResourceTypeItem> removeComputingResourceTypeItemAt(
+			final int index);
+
+	/**
+	 * 
+	 * 
+	 * @param index
+	 * @param vComputingResourceTypeItem
+	 * @throws java.lang.IndexOutOfBoundsException if the index
+	 * given is outside the bounds of the collection
+	 */
+	public <ComputingResourceTypeItem> void setComputingResourceTypeItem(
+			final int index,
+			final ComputingResourceTypeItemInterface<ComputingResourceTypeItem> vComputingResourceTypeItem)
+			throws java.lang.IndexOutOfBoundsException;
+
+	/**
+	 * 
+	 * 
+	 * @param vComputingResourceTypeItemArray
+	 */
+	public <ComputingResourceTypeItem> void setComputingResourceTypeItem(
+			final ComputingResourceTypeItemInterface<ComputingResourceTypeItem>[] vComputingResourceTypeItemArray);
+
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/plan/ScheduledTimeInterface.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/plan/ScheduledTimeInterface.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/plan/ScheduledTimeInterface.java	(revision 477)
@@ -0,0 +1,35 @@
+package schedframe.scheduling.plan;
+
+import schedframe.DescriptionContainer;
+
+public interface ScheduledTimeInterface<T> extends DescriptionContainer<T> {
+
+	/**
+	 * Returns the value of field 'end'.
+	 * 
+	 * @return the value of field 'End'.
+	 */
+	public java.util.Date getEnd();
+
+	/**
+	 * Returns the value of field 'start'.
+	 * 
+	 * @return the value of field 'Start'.
+	 */
+	public java.util.Date getStart();
+
+	/**
+	 * Sets the value of field 'end'.
+	 * 
+	 * @param end the value of field 'end'.
+	 */
+	public void setEnd(final java.util.Date end);
+
+	/**
+	 * Sets the value of field 'start'.
+	 * 
+	 * @param start the value of field 'start'.
+	 */
+	public void setStart(final java.util.Date start);
+
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/plan/ComputingResourceParameterTypeInterface.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/plan/ComputingResourceParameterTypeInterface.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/plan/ComputingResourceParameterTypeInterface.java	(revision 477)
@@ -0,0 +1,21 @@
+package schedframe.scheduling.plan;
+
+import org.qcg.broker.schemas.schedulingplan.types.ComputingParameterName;
+
+public interface ComputingResourceParameterTypeInterface<T> extends ParameterTypeInterface<T> {
+
+	/**
+	 * Returns the value of field 'name'.
+	 * 
+	 * @return the value of field 'Name'.
+	 */
+	public ComputingParameterName getName();
+
+	/**
+	 * Sets the value of field 'name'.
+	 * 
+	 * @param name the value of field 'name'.
+	 */
+	public void setName(final ComputingParameterName name);
+
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/plan/ParameterTypeInterface.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/plan/ParameterTypeInterface.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/plan/ParameterTypeInterface.java	(revision 477)
@@ -0,0 +1,197 @@
+package schedframe.scheduling.plan;
+
+import schedframe.DescriptionContainer;
+
+
+public interface ParameterTypeInterface<T> extends DescriptionContainer<T> {
+
+	/**
+	 * 
+	 * 
+	 * @param vParamValue
+	 * @throws java.lang.IndexOutOfBoundsException if the index
+	 * given is outside the bounds of the collection
+	 */
+	public void addParamValue(final java.lang.String vParamValue)
+			throws java.lang.IndexOutOfBoundsException;
+
+	/**
+	 * 
+	 * 
+	 * @param index
+	 * @param vParamValue
+	 * @throws java.lang.IndexOutOfBoundsException if the index
+	 * given is outside the bounds of the collection
+	 */
+	public void addParamValue(final int index,
+			final java.lang.String vParamValue)
+			throws java.lang.IndexOutOfBoundsException;
+
+	/**
+	 * 
+	 * 
+	 * @param vProperty
+	 * @throws java.lang.IndexOutOfBoundsException if the index
+	 * given is outside the bounds of the collection
+	 */
+	public <Property> void addProperty(
+			final ParameterPropertyInterface<Property> vProperty)
+			throws java.lang.IndexOutOfBoundsException;
+
+	/**
+	 * 
+	 * 
+	 * @param index
+	 * @param vProperty
+	 * @throws java.lang.IndexOutOfBoundsException if the index
+	 * given is outside the bounds of the collection
+	 */
+	public <Property> void addProperty(final int index,
+			final ParameterPropertyInterface<Property> vProperty)
+			throws java.lang.IndexOutOfBoundsException;
+
+
+	/**
+	 * Method getParamValue.
+	 * 
+	 * @param index
+	 * @throws java.lang.IndexOutOfBoundsException if the index
+	 * given is outside the bounds of the collection
+	 * @return the value of the java.lang.String at the given index
+	 */
+	public java.lang.String getParamValue(final int index)
+			throws java.lang.IndexOutOfBoundsException;
+
+	/**
+	 * Method getParamValue.Returns the contents of the collection
+	 * in an Array.  <p>Note:  Just in case the collection contents
+	 * are changing in another thread, we pass a 0-length Array of
+	 * the correct type into the API call.  This way we <i>know</i>
+	 * that the Array returned is of exactly the correct length.
+	 * 
+	 * @return this collection as an Array
+	 */
+	public java.lang.String[] getParamValue();
+
+	/**
+	 * Method getParamValueCount.
+	 * 
+	 * @return the size of this collection
+	 */
+	public int getParamValueCount();
+
+	/**
+	 * Method getProperty.
+	 * 
+	 * @param index
+	 * @throws java.lang.IndexOutOfBoundsException if the index
+	 * given is outside the bounds of the collection
+	 * @return the value of the
+	 * schedframe.schedulingplan.impl.Property at the given index
+	 */
+	public <Property> ParameterPropertyInterface<Property> getProperty(final int index)
+			throws java.lang.IndexOutOfBoundsException;
+
+	/**
+	 * Method getProperty.Returns the contents of the collection in
+	 * an Array.  <p>Note:  Just in case the collection contents
+	 * are changing in another thread, we pass a 0-length Array of
+	 * the correct type into the API call.  This way we <i>know</i>
+	 * that the Array returned is of exactly the correct length.
+	 * 
+	 * @return this collection as an Array
+	 */
+	public <Property> ParameterPropertyInterface<Property>[] getProperty();
+
+	/**
+	 * Method getPropertyCount.
+	 * 
+	 * @return the size of this collection
+	 */
+	public int getPropertyCount();
+
+
+	/**
+	 */
+	public void removeAllParamValue();
+
+	/**
+	 */
+	public void removeAllProperty();
+
+
+	/**
+	 * Method removeParamValue.
+	 * 
+	 * @param vParamValue
+	 * @return true if the object was removed from the collection.
+	 */
+	public boolean removeParamValue(final java.lang.String vParamValue);
+
+	/**
+	 * Method removeParamValueAt.
+	 * 
+	 * @param index
+	 * @return the element removed from the collection
+	 */
+	public java.lang.String removeParamValueAt(final int index);
+
+	/**
+	 * Method removeProperty.
+	 * 
+	 * @param vProperty
+	 * @return true if the object was removed from the collection.
+	 */
+	public <Property> boolean removeProperty(
+			final ParameterPropertyInterface<Property> vProperty);
+
+	/**
+	 * Method removePropertyAt.
+	 * 
+	 * @param index
+	 * @return the element removed from the collection
+	 */
+	public <Property> ParameterPropertyInterface<Property> removePropertyAt(
+			final int index);
+
+	/**
+	 * 
+	 * 
+	 * @param index
+	 * @param vParamValue
+	 * @throws java.lang.IndexOutOfBoundsException if the index
+	 * given is outside the bounds of the collection
+	 */
+	public void setParamValue(final int index,
+			final java.lang.String vParamValue)
+			throws java.lang.IndexOutOfBoundsException;
+
+	/**
+	 * 
+	 * 
+	 * @param vParamValueArray
+	 */
+	public void setParamValue(final java.lang.String[] vParamValueArray);
+
+	/**
+	 * 
+	 * 
+	 * @param index
+	 * @param vProperty
+	 * @throws java.lang.IndexOutOfBoundsException if the index
+	 * given is outside the bounds of the collection
+	 */
+	public <Property> void setProperty(final int index,
+			final ParameterPropertyInterface<Property> vProperty)
+			throws java.lang.IndexOutOfBoundsException;
+
+	/**
+	 * 
+	 * 
+	 * @param vPropertyArray
+	 */
+	public <Property> void setProperty(
+			final ParameterPropertyInterface<Property>[] vPropertyArray);
+
+
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/plan/ScheduledTaskInterface.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/plan/ScheduledTaskInterface.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/plan/ScheduledTaskInterface.java	(revision 477)
@@ -0,0 +1,196 @@
+package schedframe.scheduling.plan;
+
+import java.util.ArrayList;
+
+import schedframe.DescriptionContainer;
+import schedframe.scheduling.tasks.WorkloadUnit;
+
+public interface ScheduledTaskInterface<T> extends DescriptionContainer<T> {
+
+	/**
+	 * 
+	 * 
+	 * @param vAllocation
+	 * @throws java.lang.IndexOutOfBoundsException if the index
+	 * given is outside the bounds of the collection
+	 */
+	public <Allocation> void addAllocation(
+			final AllocationInterface<Allocation> vAllocation)
+			throws java.lang.IndexOutOfBoundsException;
+
+	/**
+	 * 
+	 * 
+	 * @param index
+	 * @param vAllocation
+	 * @throws java.lang.IndexOutOfBoundsException if the index
+	 * given is outside the bounds of the collection
+	 */
+	public <Allocation> void addAllocation(final int index,
+			final AllocationInterface<Allocation> vAllocation)
+			throws java.lang.IndexOutOfBoundsException;
+
+	/**
+	 */
+	public void deleteTopology();
+
+	/**
+	 * Method getAllocation.
+	 * 
+	 * @param index
+	 * @throws java.lang.IndexOutOfBoundsException if the index
+	 * given is outside the bounds of the collection
+	 * @return the value of the
+	 * schedframe.schedulingplan.impl.Allocation at the given index
+	 */
+	public <Allocation>AllocationInterface<Allocation> getAllocation(
+			final int index) throws java.lang.IndexOutOfBoundsException;
+
+	/**
+	 * Method getAllocation.Returns the contents of the collection
+	 * in an Array.  <p>Note:  Just in case the collection contents
+	 * are changing in another thread, we pass a 0-length Array of
+	 * the correct type into the API call.  This way we <i>know</i>
+	 * that the Array returned is of exactly the correct length.
+	 * 
+	 * @return this collection as an Array
+	 */
+	public <Allocation>AllocationInterface<Allocation>[] getAllocation();
+
+	/**
+	 * Method getAllocationCount.
+	 * 
+	 * @return the size of this collection
+	 */
+	public int getAllocationCount();
+
+	/**
+	 * Returns the value of field 'jobId'.
+	 * 
+	 * @return the value of field 'JobId'.
+	 */
+	public java.lang.String getJobId();
+
+	/**
+	 * Returns the value of field 'scheduledTime'.
+	 * 
+	 * @return the value of field 'ScheduledTime'.
+	 */
+	public <ScheduledTime>ScheduledTimeInterface<ScheduledTime> getScheduledTime();
+
+	/**
+	 * Returns the value of field 'status'.
+	 * 
+	 * @return the value of field 'Status'.
+	 */
+	public org.qcg.broker.schemas.schedulingplan.types.AllocationStatus getStatus();
+	
+	public String getStatusDescription();
+
+	/**
+	 * Returns the value of field 'taskId'.
+	 * 
+	 * @return the value of field 'TaskId'.
+	 */
+	public java.lang.String getTaskId();
+
+	/**
+	 * Returns the value of field 'topology'.
+	 * 
+	 * @return the value of field 'Topology'.
+	 */
+	public int getTopology();
+
+	/**
+	 * Method hasTopology.
+	 * 
+	 * @return true if at least one Topology has been added
+	 */
+	public boolean hasTopology();
+
+	/**
+	 */
+	public void removeAllAllocation();
+
+	/**
+	 * Method removeAllocation.
+	 * 
+	 * @param vAllocation
+	 * @return true if the object was removed from the collection.
+	 */
+	public <Allocation> boolean removeAllocation(
+			final AllocationInterface<Allocation> vAllocation);
+
+	/**
+	 * Method removeAllocationAt.
+	 * 
+	 * @param index
+	 * @return the element removed from the collection
+	 */
+	public <Allocation>AllocationInterface<Allocation> removeAllocationAt(final int index);
+
+	/**
+	 * 
+	 * 
+	 * @param index
+	 * @param vAllocation
+	 * @throws java.lang.IndexOutOfBoundsException if the index
+	 * given is outside the bounds of the collection
+	 */
+	public <Allocation> void setAllocation(final int index,
+			final AllocationInterface<Allocation> vAllocation)
+			throws java.lang.IndexOutOfBoundsException;
+
+	/**
+	 * 
+	 * 
+	 * @param vAllocationArray
+	 */
+	public <Allocation> void setAllocation(
+			final AllocationInterface<Allocation>[] vAllocationArray);
+
+	/**
+	 * Sets the value of field 'jobId'.
+	 * 
+	 * @param jobId the value of field 'jobId'.
+	 */
+	public void setJobId(final java.lang.String jobId);
+
+	/**
+	 * Sets the value of field 'scheduledTime'.
+	 * 
+	 * @param scheduledTime the value of field 'scheduledTime'.
+	 */
+	public <ScheduledTime> void setScheduledTime(
+			final ScheduledTimeInterface<ScheduledTime> scheduledTime);
+
+	/**
+	 * Sets the value of field 'status'.
+	 * 
+	 * @param status the value of field 'status'.
+	 */
+	public void setStatus(
+			final org.qcg.broker.schemas.schedulingplan.types.AllocationStatus status);
+	
+	public void setStatusDescription(String statusDescription);
+
+	/**
+	 * Sets the value of field 'taskID'.
+	 * 
+	 * @param taskId the value of field 'taskId'.
+	 */
+	public void setTaskId(final java.lang.String taskId);
+
+	/**
+	 * Sets the value of field 'topology'.
+	 * 
+	 * @param topology the value of field 'topology'.
+	 */
+	public void setTopology(final int topology);
+	
+
+	public ArrayList<AllocationInterface> getAllocations();
+	
+	public WorkloadUnit<?> getTask();
+
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/plan/OtherParameterTypeInterface.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/plan/OtherParameterTypeInterface.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/plan/OtherParameterTypeInterface.java	(revision 477)
@@ -0,0 +1,34 @@
+package schedframe.scheduling.plan;
+
+
+public interface OtherParameterTypeInterface<T> extends	ParameterTypeInterface<T> {
+
+	/**
+	 * Returns the value of field 'endpoint'.
+	 * 
+	 * @return the value of field 'Endpoint'.
+	 */
+	public java.lang.String getEndpoint();
+
+	/**
+	 * Returns the value of field 'name'.
+	 * 
+	 * @return the value of field 'Name'.
+	 */
+	public java.lang.String getName();
+
+	/**
+	 * Sets the value of field 'endpoint'.
+	 * 
+	 * @param endpoint the value of field 'endpoint'.
+	 */
+	public void setEndpoint(final java.lang.String endpoint);
+
+	/**
+	 * Sets the value of field 'name'.
+	 * 
+	 * @param name the value of field 'name'.
+	 */
+	public void setName(final java.lang.String name);
+
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/plan/PropertyInterface.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/plan/PropertyInterface.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/plan/PropertyInterface.java	(revision 477)
@@ -0,0 +1,17 @@
+package schedframe.scheduling.plan;
+
+
+import schedframe.DescriptionContainer;
+
+public interface PropertyInterface<T> extends DescriptionContainer<T> {
+
+		public java.lang.String getName();
+		
+		public java.lang.String getContent();
+
+	    public void setContent(
+	            final java.lang.String content);
+
+	    public void setName(final java.lang.String name);
+
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/plan/AllocationInterface.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/plan/AllocationInterface.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/plan/AllocationInterface.java	(revision 477)
@@ -0,0 +1,122 @@
+package schedframe.scheduling.plan;
+
+import java.util.Map;
+
+import schedframe.DescriptionContainer;
+import schedframe.resources.units.ResourceUnit;
+import schedframe.resources.units.ResourceUnitName;
+
+
+public interface AllocationInterface<T> extends DescriptionContainer<T> {
+
+	/**
+	 */
+	public void deleteProcessQuantity();
+
+	/**
+	 * Returns the value of field 'additionalProperties'.
+	 * 
+	 * @return the value of field 'AdditionalProperties'.
+	 */
+	public <Properties> PropertiesTypeInterface<Properties> getAdditionalProperties();
+
+	/**
+	 * Returns the value of field 'host'. The field 'host' has the
+	 * following description: Submission host
+	 * 
+	 * @return the value of field 'Host'.
+	 */
+	public  HostInterface getHost();
+
+	/**
+	 * Returns the value of field 'processGroupId'.
+	 * 
+	 * @return the value of field 'ProcessGroupId'.
+	 */
+	public java.lang.String getProcessGroupId();
+
+	/**
+	 * Returns the value of field 'processQuantity'.
+	 * 
+	 * @return the value of field 'ProcessQuantity'.
+	 */
+	public int getProcessesCount();
+	
+	public <ProcessesMap_>ProcessesMapInterface<ProcessesMap_> getProcessesMap();
+
+	/**
+	 * Returns the value of field 'providerInfo'.
+	 * 
+	 * @return the value of field 'ProviderInfo'.
+	 */
+	public <ProviderInfo>ProviderInfoInterface<ProviderInfo> getProviderInfo();
+	
+	/**
+	 * Returns the value of field 'reservationId'. The field
+	 * 'reservationId' has the following description: Reservation
+	 * identifier in local system 
+	 * 
+	 * @return the value of field 'ReservationId'.
+	 */
+	public java.lang.String getReservationId();
+
+	/**
+	 * Method hasProcessQuantity.
+	 * 
+	 * @return true if at least one ProcessQuantity has been added
+	 */
+	public boolean hasProcessesCount();
+	
+	public boolean hasProcessesMap();
+
+	/**
+	 * Sets the value of field 'additionalProperties'.
+	 * 
+	 * @param additionalProperties the value of field
+	 * 'additionalProperties'.
+	 */
+	public <Properties> void setAdditionalProperties(
+			final PropertiesTypeInterface<Properties> additionalProperties);
+
+	/**
+	 * Sets the value of field 'host'. The field 'host' has the
+	 * following description: Submission host
+	 * 
+	 * @param host the value of field 'host'.
+	 */
+	public <Host> void setHost(final HostInterface<Host> host);
+
+	/**
+	 * Sets the value of field 'processGroupID'.
+	 * 
+	 * @param processGroupId the value of field 'processGroupId'.
+	 */
+	public void setProcessGroupId(final java.lang.String processGroupId);
+
+	/**
+	 * Sets the value of field 'processQuantity'.
+	 * 
+	 * @param processQuantity the value of field 'processQuantity'.
+	 */
+	public void setProcessesCount(final int processesCount);
+	
+	
+	public <ProcessesMap_> void setProcessesMap(ProcessesMapInterface<ProcessesMap_> processesMap);
+
+	/**
+	 * Sets the value of field 'providerInfo'.
+	 * 
+	 * @param providerInfo the value of field 'providerInfo'.
+	 */
+	public <ProviderInfo> void setProviderInfo(ProviderInfoInterface<ProviderInfo> providerInfo);
+	
+	public void setSpecificResources(Map<ResourceUnitName, ResourceUnit> choosenResources);
+	
+	public Map<ResourceUnitName, ResourceUnit> getRequestedResources();
+	
+	public void setProviderName(String providerName);
+	
+	public String getProviderName();
+	
+	public boolean isProcessing();
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/plan/ParameterPropertyInterface.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/plan/ParameterPropertyInterface.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/plan/ParameterPropertyInterface.java	(revision 477)
@@ -0,0 +1,149 @@
+package schedframe.scheduling.plan;
+
+import schedframe.DescriptionContainer;
+
+
+public interface ParameterPropertyInterface<T> extends DescriptionContainer<T> {
+
+	/**
+	 * 
+	 * 
+	 * @param vValue
+	 * @throws java.lang.IndexOutOfBoundsException if the index
+	 * given is outside the bounds of the collection
+	 */
+	public void addValue(final java.lang.String vValue)
+			throws java.lang.IndexOutOfBoundsException;
+
+	/**
+	 * 
+	 * 
+	 * @param index
+	 * @param vValue
+	 * @throws java.lang.IndexOutOfBoundsException if the index
+	 * given is outside the bounds of the collection
+	 */
+	public void addValue(final int index, final java.lang.String vValue)
+			throws java.lang.IndexOutOfBoundsException;
+
+	/**
+	 */
+	public void deleteExclude();
+
+	/**
+	 * Returns the value of field 'exclude'.
+	 * 
+	 * @return the value of field 'Exclude'.
+	 */
+	public boolean getExclude();
+
+	/**
+	 * Returns the value of field 'name'.
+	 * 
+	 * @return the value of field 'Name'.
+	 */
+	public java.lang.String getName();
+
+	/**
+	 * Method getValue.
+	 * 
+	 * @param index
+	 * @throws java.lang.IndexOutOfBoundsException if the index
+	 * given is outside the bounds of the collection
+	 * @return the value of the java.lang.String at the given index
+	 */
+	public java.lang.String getValue(final int index)
+			throws java.lang.IndexOutOfBoundsException;
+
+	/**
+	 * Method getValue.Returns the contents of the collection in an
+	 * Array.  <p>Note:  Just in case the collection contents are
+	 * changing in another thread, we pass a 0-length Array of the
+	 * correct type into the API call.  This way we <i>know</i>
+	 * that the Array returned is of exactly the correct length.
+	 * 
+	 * @return this collection as an Array
+	 */
+	public java.lang.String[] getValue();
+
+	/**
+	 * Method getValueCount.
+	 * 
+	 * @return the size of this collection
+	 */
+	public int getValueCount();
+
+	/**
+	 * Method hasExclude.
+	 * 
+	 * @return true if at least one Exclude has been added
+	 */
+	public boolean hasExclude();
+
+	/**
+	 * Returns the value of field 'exclude'.
+	 * 
+	 * @return the value of field 'Exclude'.
+	 */
+	public boolean isExclude();
+
+	/**
+	 * Method isValid.
+	 * 
+	 * @return true if this object is valid according to the schema
+	 */
+	public boolean isValid();
+
+	/**
+	 */
+	public void removeAllValue();
+
+	/**
+	 * Method removeValue.
+	 * 
+	 * @param vValue
+	 * @return true if the object was removed from the collection.
+	 */
+	public boolean removeValue(final java.lang.String vValue);
+
+	/**
+	 * Method removeValueAt.
+	 * 
+	 * @param index
+	 * @return the element removed from the collection
+	 */
+	public java.lang.String removeValueAt(final int index);
+
+	/**
+	 * Sets the value of field 'exclude'.
+	 * 
+	 * @param exclude the value of field 'exclude'.
+	 */
+	public void setExclude(final boolean exclude);
+
+	/**
+	 * Sets the value of field 'name'.
+	 * 
+	 * @param name the value of field 'name'.
+	 */
+	public void setName(final java.lang.String name);
+
+	/**
+	 * 
+	 * 
+	 * @param index
+	 * @param vValue
+	 * @throws java.lang.IndexOutOfBoundsException if the index
+	 * given is outside the bounds of the collection
+	 */
+	public void setValue(final int index, final java.lang.String vValue)
+			throws java.lang.IndexOutOfBoundsException;
+
+	/**
+	 * 
+	 * 
+	 * @param vValueArray
+	 */
+	public void setValue(final java.lang.String[] vValueArray);
+
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/plan/ComputingResourceTypeItemInterface.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/plan/ComputingResourceTypeItemInterface.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/plan/ComputingResourceTypeItemInterface.java	(revision 477)
@@ -0,0 +1,48 @@
+package schedframe.scheduling.plan;
+
+import schedframe.DescriptionContainer;
+
+
+public interface ComputingResourceTypeItemInterface<T> extends DescriptionContainer<T> {
+
+	/**
+	 * Returns the value of field 'choiceValue'. The field
+	 * 'choiceValue' has the following description: Internal choice
+	 * value storage
+	 * 
+	 * @return the value of field 'ChoiceValue'.
+	 */
+	public java.lang.Object getChoiceValue();
+
+	/**
+	 * Returns the value of field 'hostParameter'.
+	 * 
+	 * @return the value of field 'HostParameter'.
+	 */
+	public <ComputingResourceParameterType> ComputingResourceParameterTypeInterface<ComputingResourceParameterType> getHostParameter();
+
+
+	/**
+	 * Returns the value of field 'otherParameter'.
+	 * 
+	 * @return the value of field 'OtherParameter'.
+	 */
+	public <OtherParameterType> OtherParameterTypeInterface<OtherParameterType> getOtherParameter();
+
+	/**
+	 * Sets the value of field 'hostParameter'.
+	 * 
+	 * @param hostParameter the value of field 'hostParameter'.
+	 */
+	public <ComputingResourceParameterType> void setHostParameter(
+			final ComputingResourceParameterTypeInterface<ComputingResourceParameterType> hostParameter);
+
+	/**
+	 * Sets the value of field 'otherParameter'.
+	 * 
+	 * @param otherParameter the value of field 'otherParameter'.
+	 */
+	public <OtherParameterType> void setOtherParameter(
+			final OtherParameterTypeInterface<OtherParameterType> otherParameter);
+
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/plan/PropertiesTypeInterface.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/plan/PropertiesTypeInterface.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/plan/PropertiesTypeInterface.java	(revision 477)
@@ -0,0 +1,122 @@
+package schedframe.scheduling.plan;
+
+
+import schedframe.DescriptionContainer;
+
+public interface PropertiesTypeInterface<T> extends DescriptionContainer<T> {
+
+
+   /**
+    * 
+    * 
+    * @param vProperty
+    * @throws java.lang.IndexOutOfBoundsException if the index
+    * given is outside the bounds of the collection
+    */
+   public <Property> void addProperty(
+           final PropertyInterface<Property> vProperty);
+
+   /**
+    * 
+    * 
+    * @param index
+    * @param vProperty
+    * @throws java.lang.IndexOutOfBoundsException if the index
+    * given is outside the bounds of the collection
+    */
+   public <Property> void addProperty(
+           final int index,
+           final PropertyInterface<Property> vProperty);
+
+   /**
+    * Method enumerateProperty.
+    * 
+    * @return an Enumeration over all possible elements of this
+    * collection
+    */
+   public <Property> java.util.Enumeration<PropertyInterface<Property>> enumerateProperty();
+
+   /**
+    * Method getProperty.
+    * 
+    * @param index
+    * @throws java.lang.IndexOutOfBoundsException if the index
+    * given is outside the bounds of the collection
+    * @return the value of the
+    * org.qcg.broker.schemas.schedulingplan.Property at the given index
+    */
+   public <Property> PropertyInterface<Property> getProperty(final int index)
+   throws java.lang.IndexOutOfBoundsException;
+   
+   /**
+    * Method getProperty.Returns the contents of the collection in
+    * an Array.  <p>Note:  Just in case the collection contents
+    * are changing in another thread, we pass a 0-length Array of
+    * the correct type into the API call.  This way we <i>know</i>
+    * that the Array returned is of exactly the correct length.
+    * 
+    * @return this collection as an Array
+    */
+   public <Property> PropertyInterface<Property>[] getProperty();
+
+   /**
+    * Method getPropertyCount.
+    * 
+    * @return the size of this collection
+    */
+   public int getPropertyCount();
+
+   /**
+    * Method iterateProperty.
+    * 
+    * @return an Iterator over all possible elements in this
+    * collection
+    */
+   public <Property> java.util.Iterator<PropertyInterface<Property>> iterateProperty();
+
+   /**
+    */
+   public void removeAllProperty();
+   
+   /**
+    * Method removeProperty.
+    * 
+    * @param vProperty
+    * @return true if the object was removed from the collection.
+    */
+   public <Property> boolean removeProperty(
+           final PropertyInterface<Property> vProperty);
+
+   /**
+    * Method removePropertyAt.
+    * 
+    * @param index
+    * @return the element removed from the collection
+    */
+   public <Property> PropertyInterface<Property> removePropertyAt(
+           final int index);
+
+   /**
+    * 
+    * 
+    * @param index
+    * @param vProperty
+    * @throws java.lang.IndexOutOfBoundsException if the index
+    * given is outside the bounds of the collection
+    */
+   public <Property> void setProperty(
+           final int index,
+           final PropertyInterface<Property> vProperty)
+   throws java.lang.IndexOutOfBoundsException;
+   
+   /**
+    * 
+    * 
+    * @param vPropertyArray
+    */
+   public <Property> void setProperty(
+           final PropertyInterface<Property>[] vPropertyArray);
+   
+
+
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/plan/SchedulingPlanInterface.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/plan/SchedulingPlanInterface.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/plan/SchedulingPlanInterface.java	(revision 477)
@@ -0,0 +1,102 @@
+package schedframe.scheduling.plan;
+
+import java.util.ArrayList;
+
+import schedframe.DescriptionContainer;
+
+public interface SchedulingPlanInterface<T> extends DescriptionContainer<T> {
+
+	/**
+	 * 
+	 * 
+	 * @param vTask
+	 * @throws java.lang.IndexOutOfBoundsException if the index
+	 * given is outside the bounds of the collection
+	 */
+	public <Task> void addTask(final ScheduledTaskInterface<Task> vTask)
+			throws java.lang.IndexOutOfBoundsException;
+
+	/**
+	 * 
+	 * 
+	 * @param index
+	 * @param vTask
+	 * @throws java.lang.IndexOutOfBoundsException if the index
+	 * given is outside the bounds of the collection
+	 */
+	public <Task> void addTask(final int index,
+			final ScheduledTaskInterface<Task> vTask)
+			throws java.lang.IndexOutOfBoundsException;
+
+	/**
+	 * Method getTask.
+	 * 
+	 * @param index
+	 * @throws java.lang.IndexOutOfBoundsException if the index
+	 * given is outside the bounds of the collection
+	 * @return the value of the schedframe.schedulingplan.impl.Task
+	 * at the given index
+	 */
+	public <Task>ScheduledTaskInterface<Task> getTask(final int index)
+			throws java.lang.IndexOutOfBoundsException;
+
+	/**
+	 * Method getTask.Returns the contents of the collection in an
+	 * Array.  <p>Note:  Just in case the collection contents are
+	 * changing in another thread, we pass a 0-length Array of the
+	 * correct type into the API call.  This way we <i>know</i>
+	 * that the Array returned is of exactly the correct length.
+	 * 
+	 * @return this collection as an Array
+	 */
+	public <Task>ScheduledTaskInterface<Task>[] getTask();
+
+	/**
+	 * Method getTaskCount.
+	 * 
+	 * @return the size of this collection
+	 */
+	public int getTaskCount();
+
+	/**
+	 */
+	public void removeAllTask();
+
+	/**
+	 * Method removeTask.
+	 * 
+	 * @param vTask
+	 * @return true if the object was removed from the collection.
+	 */
+	public <Task> boolean removeTask(final ScheduledTaskInterface<Task> vTask);
+
+	/**
+	 * Method removeTaskAt.
+	 * 
+	 * @param index
+	 * @return the element removed from the collection
+	 */
+	public <Task>ScheduledTaskInterface<Task> removeTaskAt(final int index);
+
+	/**
+	 * 
+	 * 
+	 * @param index
+	 * @param vTask
+	 * @throws java.lang.IndexOutOfBoundsException if the index
+	 * given is outside the bounds of the collection
+	 */
+	public <Task> void setTask(final int index,
+			final ScheduledTaskInterface<Task> vTask)
+			throws java.lang.IndexOutOfBoundsException;
+
+	/**
+	 * 
+	 * 
+	 * @param vTaskArray
+	 */
+	public <Task> void setTask(final ScheduledTaskInterface<Task>[] vTaskArray);
+
+
+	public ArrayList<ScheduledTaskInterface> getTasks();
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/plan/impl/Host.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/plan/impl/Host.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/plan/impl/Host.java	(revision 477)
@@ -0,0 +1,71 @@
+package schedframe.scheduling.plan.impl;
+
+import java.io.StringWriter;
+
+import org.exolab.castor.xml.MarshalException;
+import org.exolab.castor.xml.ValidationException;
+
+import schedframe.scheduling.plan.ComputingResourceTypeInterface;
+import schedframe.scheduling.plan.HostInterface;
+
+public class Host implements HostInterface<org.qcg.broker.schemas.schedulingplan.Host> {
+
+	private static final long serialVersionUID = -5534266040248107980L;
+	protected org.qcg.broker.schemas.schedulingplan.Host host;
+	
+	public Host(){
+		host = new org.qcg.broker.schemas.schedulingplan.Host();
+	}
+	
+	public Host(org.qcg.broker.schemas.schedulingplan.Host value){
+		host = value;
+	}
+	
+	public org.qcg.broker.schemas.schedulingplan.Host getDescription() {
+		return host;
+	}
+
+	public String getDocument() {
+		StringWriter writer = new StringWriter();
+		try {
+			host.marshal(writer);
+		} catch (MarshalException e) {
+			e.printStackTrace();
+		} catch (ValidationException e) {
+			e.printStackTrace();
+		}
+		return writer.toString();
+	}
+
+	@SuppressWarnings("unchecked")
+	public ComputingResourceTypeInterface<org.qcg.broker.schemas.schedulingplan.ComputingResourceType> getMachineParameters() {
+		org.qcg.broker.schemas.schedulingplan.ComputingResourceType crt = host.getMachineParameters();
+		if(crt == null)
+			return null;
+		else
+			return new ComputingResourceType(crt);
+	}
+
+	public String getHostname() {
+		return host.getHostname();
+	}
+
+
+	public String getQueue() {
+		return host.getQueue();
+	}
+
+	public <ComputingResourceType_> void setMachineParameters(
+			ComputingResourceTypeInterface<ComputingResourceType_> machineParameters) {
+		host.setMachineParameters((org.qcg.broker.schemas.schedulingplan.ComputingResourceType) machineParameters.getDescription());
+	}
+
+	public void setHostname(String hostname) {
+		host.setHostname(hostname);
+	}
+
+	public void setQueue(String queue) {
+		host.setQueue(queue);
+	}
+
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/plan/impl/ComputingResourceTypeItem.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/plan/impl/ComputingResourceTypeItem.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/plan/impl/ComputingResourceTypeItem.java	(revision 477)
@@ -0,0 +1,53 @@
+package schedframe.scheduling.plan.impl;
+
+import schedframe.scheduling.plan.ComputingResourceParameterTypeInterface;
+import schedframe.scheduling.plan.ComputingResourceTypeItemInterface;
+import schedframe.scheduling.plan.OtherParameterTypeInterface;
+
+public class ComputingResourceTypeItem 
+			implements ComputingResourceTypeItemInterface <org.qcg.broker.schemas.schedulingplan.ComputingResourceTypeItem> {
+
+	private static final long serialVersionUID = -8559307821866515716L;
+	protected org.qcg.broker.schemas.schedulingplan.ComputingResourceTypeItem ti;
+	
+	public ComputingResourceTypeItem(){
+		ti = new org.qcg.broker.schemas.schedulingplan.ComputingResourceTypeItem();
+	}
+	
+	public ComputingResourceTypeItem(org.qcg.broker.schemas.schedulingplan.ComputingResourceTypeItem value){
+		ti = value;
+	}
+	
+	public org.qcg.broker.schemas.schedulingplan.ComputingResourceTypeItem getDescription() {
+		return ti;
+	}
+
+	public String getDocument() {
+		return ""; 
+	}
+
+	public Object getChoiceValue() {
+		return ti.getChoiceValue();
+	}
+
+	@SuppressWarnings("unchecked")
+	public ComputingResourceParameterTypeInterface<org.qcg.broker.schemas.schedulingplan.ComputingResourceParameterType> getHostParameter() {
+		return new schedframe.scheduling.plan.impl.ComputingResourceParameterType(ti.getHostParameter());
+	}
+
+	@SuppressWarnings("unchecked")
+	public OtherParameterTypeInterface<org.qcg.broker.schemas.schedulingplan.OtherParameterType> getOtherParameter() {
+		return new schedframe.scheduling.plan.impl.OtherParameterType(ti.getOtherParameter());
+	}
+
+	public <ComputingResourceParameterType_> void setHostParameter(
+			ComputingResourceParameterTypeInterface<ComputingResourceParameterType_> hostParameter) {
+		ti.setHostParameter((org.qcg.broker.schemas.schedulingplan.ComputingResourceParameterType) hostParameter.getDescription());
+	}
+
+	public <OtherParameterType_> void setOtherParameter(
+			OtherParameterTypeInterface<OtherParameterType_> otherParameter) {
+		ti.setOtherParameter((org.qcg.broker.schemas.schedulingplan.OtherParameterType) otherParameter.getDescription());
+	}
+
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/plan/impl/PropertiesType.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/plan/impl/PropertiesType.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/plan/impl/PropertiesType.java	(revision 477)
@@ -0,0 +1,116 @@
+package schedframe.scheduling.plan.impl;
+
+import java.io.StringWriter;
+import java.util.Enumeration;
+import java.util.Iterator;
+
+import org.exolab.castor.xml.MarshalException;
+import org.exolab.castor.xml.ValidationException;
+
+import schedframe.scheduling.plan.PropertiesTypeInterface;
+import schedframe.scheduling.plan.PropertyInterface;
+
+public class PropertiesType implements PropertiesTypeInterface<org.qcg.broker.schemas.schedulingplan.PropertiesType> {
+
+	protected org.qcg.broker.schemas.schedulingplan.PropertiesType pt;
+	
+	public PropertiesType(){
+		this.pt = new org.qcg.broker.schemas.schedulingplan.PropertiesType();
+	}
+	
+	public PropertiesType(org.qcg.broker.schemas.schedulingplan.PropertiesType value){
+		this.pt = value;
+	}
+	
+	public <Property_> void addProperty(PropertyInterface<Property_> property) {
+		this.pt.addProperty((org.qcg.broker.schemas.schedulingplan.Property)property.getDescription());
+	}
+
+	public <Property_> void addProperty(int index,
+			PropertyInterface<Property_> property) {
+		this.pt.addProperty(index, (org.qcg.broker.schemas.schedulingplan.Property) property.getDescription());
+	}
+
+	public <Property_> Enumeration<PropertyInterface<Property_>> enumerateProperty() {
+		throw new RuntimeException("Not implemented.");
+	}
+
+	@SuppressWarnings("unchecked")
+	public PropertyInterface<org.qcg.broker.schemas.schedulingplan.Property> getProperty(int index)
+			throws IndexOutOfBoundsException {
+		return new Property(this.pt.getProperty(index));
+	}
+
+	
+	@SuppressWarnings("unchecked")
+	public PropertyInterface<org.qcg.broker.schemas.schedulingplan.Property>[] getProperty() {
+		org.qcg.broker.schemas.schedulingplan.Property property[] = this.pt.getProperty();
+		if(property == null)
+			return null;
+		
+		Property ret[] = new Property[property.length];
+		for(int i = 0; i < property.length; i++){
+			ret[i] = new Property(property[i]);
+		}
+		
+		return ret;
+	}
+
+	public int getPropertyCount() {
+		return this.pt.getPropertyCount();
+	}
+
+	public <Property_> Iterator<PropertyInterface<Property_>> iterateProperty() {
+		throw new RuntimeException("Not implemented.");
+	}
+
+	public void removeAllProperty() {
+		this.pt.removeAllProperty();
+	}
+
+	public <Property_> boolean removeProperty(
+			PropertyInterface<Property_> property) {
+		return this.pt.removeProperty((org.qcg.broker.schemas.schedulingplan.Property)property.getDescription());
+	}
+
+	@SuppressWarnings("unchecked")
+	public PropertyInterface<org.qcg.broker.schemas.schedulingplan.Property> removePropertyAt(int index) {
+		return new Property(this.pt.removePropertyAt(index));
+	}
+
+	public <Property_> void setProperty(int index,
+			PropertyInterface<Property_> property)
+			throws IndexOutOfBoundsException {
+		this.pt.setProperty(index, (org.qcg.broker.schemas.schedulingplan.Property) property.getDescription());
+	}
+
+	public <Property_> void setProperty(
+			PropertyInterface<Property_>[] propertyArray) {
+		
+		org.qcg.broker.schemas.schedulingplan.Property tab[] = 
+				new org.qcg.broker.schemas.schedulingplan.Property[propertyArray.length];
+		
+		for(int i = 0; i < tab.length; i++){
+			tab[i] = (org.qcg.broker.schemas.schedulingplan.Property) propertyArray[i].getDescription();
+		}
+		
+		this.pt.setProperty(tab);
+	}
+
+	public org.qcg.broker.schemas.schedulingplan.PropertiesType getDescription() {
+		return this.pt;
+	}
+
+	public String getDocument() throws Exception {
+		StringWriter writer = new StringWriter();
+		try {
+			pt.marshal(writer);
+		} catch (MarshalException e) {
+			e.printStackTrace();
+		} catch (ValidationException e) {
+			e.printStackTrace();
+		}
+		return writer.toString();
+	}
+
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/plan/impl/ComputingResourceType.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/plan/impl/ComputingResourceType.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/plan/impl/ComputingResourceType.java	(revision 477)
@@ -0,0 +1,113 @@
+package schedframe.scheduling.plan.impl;
+
+import java.io.StringWriter;
+
+import org.exolab.castor.xml.MarshalException;
+import org.exolab.castor.xml.ValidationException;
+
+import schedframe.scheduling.plan.ComputingResourceTypeInterface;
+import schedframe.scheduling.plan.ComputingResourceTypeItemInterface;
+
+public class ComputingResourceType implements ComputingResourceTypeInterface <
+									        org.qcg.broker.schemas.schedulingplan.ComputingResourceType> {
+
+	private static final long serialVersionUID = 5254980770479844861L;
+	protected org.qcg.broker.schemas.schedulingplan.ComputingResourceType rt;
+	
+	public ComputingResourceType(){
+		rt = new org.qcg.broker.schemas.schedulingplan.ComputingResourceType();
+	}
+	
+	public ComputingResourceType(org.qcg.broker.schemas.schedulingplan.ComputingResourceType value){
+		rt = value;
+	}
+	
+	public org.qcg.broker.schemas.schedulingplan.ComputingResourceType getDescription() {
+		return rt;
+	}
+
+	public String getDocument() {
+		StringWriter writer = new StringWriter();
+		try {
+			rt.marshal(writer);
+		} catch (MarshalException e) {
+			e.printStackTrace();
+		} catch (ValidationException e) {
+			e.printStackTrace();
+		}
+		return writer.toString();
+	}
+
+	public <ComputingResourceTypeItem_> void addComputingResourceTypeItem(
+			ComputingResourceTypeItemInterface<ComputingResourceTypeItem_> computingResourceTypeItem)
+			throws IndexOutOfBoundsException {
+		rt.addComputingResourceTypeItem((org.qcg.broker.schemas.schedulingplan.ComputingResourceTypeItem)computingResourceTypeItem.getDescription());
+	}
+
+	public <ComputingResourceTypeItem_> void addComputingResourceTypeItem(
+			int index,
+			ComputingResourceTypeItemInterface<ComputingResourceTypeItem_> computingResourceTypeItem)
+			throws IndexOutOfBoundsException {
+		rt.addComputingResourceTypeItem(index, (org.qcg.broker.schemas.schedulingplan.ComputingResourceTypeItem)computingResourceTypeItem.getDescription());
+	}
+
+	@SuppressWarnings("unchecked")
+	public ComputingResourceTypeItemInterface<org.qcg.broker.schemas.schedulingplan.ComputingResourceTypeItem> getComputingResourceTypeItem(
+			int index) throws IndexOutOfBoundsException {
+		return new ComputingResourceTypeItem(rt.getComputingResourceTypeItem(index));
+	}
+
+	@SuppressWarnings("unchecked")
+	public ComputingResourceTypeItemInterface<org.qcg.broker.schemas.schedulingplan.ComputingResourceTypeItem>[] getComputingResourceTypeItem() {
+		org.qcg.broker.schemas.schedulingplan.ComputingResourceTypeItem items[] = rt.getComputingResourceTypeItem();
+		if(items == null) return null;
+		
+		ComputingResourceTypeItem ret[] = new ComputingResourceTypeItem[items.length];
+		for(int i = 0; i < items.length; i++){
+			ret[i] = new ComputingResourceTypeItem(items[i]);
+		}
+		
+		return ret;
+	}
+
+	public int getComputingResourceTypeItemCount() {
+		return rt.getComputingResourceTypeItemCount();
+	}
+
+	public void removeAllComputingResourceTypeItem() {
+		rt.removeAllComputingResourceTypeItem();
+	}
+
+	public <ComputingResourceTypeItem_> boolean removeComputingResourceTypeItem(
+			ComputingResourceTypeItemInterface<ComputingResourceTypeItem_> computingResourceTypeItem) {
+		return rt.removeComputingResourceTypeItem((org.qcg.broker.schemas.schedulingplan.ComputingResourceTypeItem)computingResourceTypeItem.getDescription());
+	}
+
+	@SuppressWarnings("unchecked")
+	public ComputingResourceTypeItemInterface<org.qcg.broker.schemas.schedulingplan.ComputingResourceTypeItem> removeComputingResourceTypeItemAt(
+			int index) {
+		return new ComputingResourceTypeItem(rt.removeComputingResourceTypeItemAt(index));
+	}
+
+	public <ComputingResourceTypeItem_> void setComputingResourceTypeItem(
+			int index,
+			ComputingResourceTypeItemInterface<ComputingResourceTypeItem_> computingResourceTypeItem)
+			throws IndexOutOfBoundsException {
+		rt.setComputingResourceTypeItem(index, (org.qcg.broker.schemas.schedulingplan.ComputingResourceTypeItem) computingResourceTypeItem.getDescription());
+	}
+
+	public <ComputingResourceTypeItem_> void setComputingResourceTypeItem(
+			ComputingResourceTypeItemInterface<ComputingResourceTypeItem_>[] computingResourceTypeItemArray) {
+		if(computingResourceTypeItemArray == null) return;
+		
+		org.qcg.broker.schemas.schedulingplan.ComputingResourceTypeItem tab[] = 
+			new org.qcg.broker.schemas.schedulingplan.ComputingResourceTypeItem[computingResourceTypeItemArray.length];
+		
+		for(int i = 0; i < computingResourceTypeItemArray.length; i++){
+			tab[i] = (org.qcg.broker.schemas.schedulingplan.ComputingResourceTypeItem) computingResourceTypeItemArray[i].getDescription();
+		}
+		
+		rt.setComputingResourceTypeItem(tab);
+	}
+
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/plan/impl/ScheduledTime.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/plan/impl/ScheduledTime.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/plan/impl/ScheduledTime.java	(revision 477)
@@ -0,0 +1,57 @@
+package schedframe.scheduling.plan.impl;
+
+import java.io.StringWriter;
+import java.util.Date;
+
+import org.exolab.castor.xml.MarshalException;
+import org.exolab.castor.xml.ValidationException;
+
+import schedframe.scheduling.plan.ScheduledTimeInterface;
+
+
+public class ScheduledTime implements ScheduledTimeInterface<org.qcg.broker.schemas.schedulingplan.ScheduledTime>{
+
+	private static final long serialVersionUID = 8546333273529232717L;
+	private org.qcg.broker.schemas.schedulingplan.ScheduledTime st;
+	
+	public ScheduledTime(){
+		st = new org.qcg.broker.schemas.schedulingplan.ScheduledTime();
+	}
+	
+	public ScheduledTime(org.qcg.broker.schemas.schedulingplan.ScheduledTime st){
+		this.st = st;
+	}
+	
+	public org.qcg.broker.schemas.schedulingplan.ScheduledTime getDescription() {
+		return st;
+	}
+
+	public String getDocument() {
+		StringWriter writer = new StringWriter();
+		try {
+			st.marshal(writer);
+		} catch (MarshalException e) {
+			e.printStackTrace();
+		} catch (ValidationException e) {
+			e.printStackTrace();
+		}
+		return writer.toString();
+	}
+
+	public Date getEnd() {
+		return st.getEnd();
+	}
+
+	public Date getStart() {
+		return st.getStart();
+	}
+
+	public void setEnd(Date end) {
+		st.setEnd(end);
+	}
+
+	public void setStart(Date start) {
+		st.setStart(start);
+	}
+
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/plan/impl/ComputingResourceParameterType.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/plan/impl/ComputingResourceParameterType.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/plan/impl/ComputingResourceParameterType.java	(revision 477)
@@ -0,0 +1,162 @@
+package schedframe.scheduling.plan.impl;
+
+import java.io.StringWriter;
+
+import org.exolab.castor.xml.MarshalException;
+import org.exolab.castor.xml.ValidationException;
+
+import schedframe.scheduling.plan.ComputingResourceParameterTypeInterface;
+import schedframe.scheduling.plan.ParameterPropertyInterface;
+import org.qcg.broker.schemas.schedulingplan.types.ComputingParameterName;
+
+public class ComputingResourceParameterType implements ComputingResourceParameterTypeInterface<
+							org.qcg.broker.schemas.schedulingplan.ComputingResourceParameterType> {
+
+	private static final long serialVersionUID = 7369276462976219345L;
+	protected org.qcg.broker.schemas.schedulingplan.ComputingResourceParameterType pt;
+	
+	public ComputingResourceParameterType(){
+		pt = new org.qcg.broker.schemas.schedulingplan.ComputingResourceParameterType();
+	}
+	
+	public ComputingResourceParameterType(org.qcg.broker.schemas.schedulingplan.ComputingResourceParameterType value){
+		pt = value;
+	}
+	
+	
+	public  org.qcg.broker.schemas.schedulingplan.ComputingResourceParameterType getDescription() {
+		return pt;
+	}
+
+	public String getDocument() {
+		StringWriter writer = new StringWriter();
+		try {
+			pt.marshal(writer);
+		} catch (MarshalException e) {
+			e.printStackTrace();
+		} catch (ValidationException e) {
+			e.printStackTrace();
+		}
+		return writer.toString();
+	}
+
+	public ComputingParameterName getName() {
+		return pt.getName();
+	}
+
+	public void setName(ComputingParameterName name) {
+		pt.setName(name);
+	}
+
+	public void addParamValue(String paramValue)
+			throws IndexOutOfBoundsException {
+		pt.addParamValue(paramValue);
+	}
+
+	public void addParamValue(int index, String paramValue)
+			throws IndexOutOfBoundsException {
+		pt.addParamValue(index, paramValue);
+	}
+
+	public <Property_> void addProperty(ParameterPropertyInterface<Property_> property)
+			throws IndexOutOfBoundsException {
+		pt.addParameterProperty((org.qcg.broker.schemas.schedulingplan.ParameterProperty)property.getDescription());
+	}
+
+	public <Property_> void addProperty(int index, ParameterPropertyInterface<Property_> property)
+			throws IndexOutOfBoundsException {
+		pt.addParameterProperty(index, (org.qcg.broker.schemas.schedulingplan.ParameterProperty) property.getDescription());
+	}
+
+
+	public String getParamValue(int index) throws IndexOutOfBoundsException {
+		return pt.getParamValue(index);
+	}
+
+	public String[] getParamValue() {
+		return pt.getParamValue();
+	}
+
+	public int getParamValueCount() {
+		return pt.getParamValueCount();
+	}
+
+	@SuppressWarnings("unchecked")
+	public ParameterPropertyInterface<org.qcg.broker.schemas.schedulingplan.ParameterProperty> getProperty(int index)
+			throws IndexOutOfBoundsException {
+		return new schedframe.scheduling.plan.impl.ParameterProperty(pt
+				.getParameterProperty(index));
+	}
+
+	@SuppressWarnings("unchecked")
+	public ParameterPropertyInterface<org.qcg.broker.schemas.schedulingplan.ParameterProperty>[] getProperty() {
+		org.qcg.broker.schemas.schedulingplan.ParameterProperty tab[] = pt.getParameterProperty();
+		if (tab == null)
+			return null;
+
+		schedframe.scheduling.plan.impl.ParameterProperty ret[] = new schedframe.scheduling.plan.impl.ParameterProperty[tab.length];
+		for (int i = 0; i < tab.length; i++) {
+			ret[i] = new schedframe.scheduling.plan.impl.ParameterProperty(tab[i]);
+		}
+
+		return ret;
+	}
+
+	public int getPropertyCount() {
+		return pt.getParameterPropertyCount();
+	}
+
+
+	public void removeAllParamValue() {
+		pt.removeAllParamValue();
+	}
+
+	public void removeAllProperty() {
+		pt.removeAllParameterProperty();
+	}
+
+
+	public boolean removeParamValue(String paramValue) {
+		return pt.removeParamValue(paramValue);
+	}
+
+	public String removeParamValueAt(int index) {
+		return pt.removeParamValueAt(index);
+	}
+
+	public <Property_> boolean removeProperty(ParameterPropertyInterface<Property_> property) {
+		return pt.removeParameterProperty((org.qcg.broker.schemas.schedulingplan.ParameterProperty) property.getDescription());
+	}
+
+	@SuppressWarnings("unchecked")
+	public ParameterPropertyInterface<org.qcg.broker.schemas.schedulingplan.ParameterProperty> removePropertyAt(int index) {
+		return new schedframe.scheduling.plan.impl.ParameterProperty(pt
+				.removeParameterPropertyAt(index));
+	}
+
+
+	public void setParamValue(int index, String paramValue)
+			throws IndexOutOfBoundsException {
+		pt.setParamValue(index, paramValue);
+	}
+
+	public void setParamValue(String[] paramValueArray) {
+		pt.setParamValue(paramValueArray);
+	}
+
+	public <Property_> void setProperty(int index, ParameterPropertyInterface<Property_> property)
+			throws IndexOutOfBoundsException {
+		pt.setParameterProperty(index, (org.qcg.broker.schemas.schedulingplan.ParameterProperty)property.getDescription());
+	}
+
+	public <Property_> void setProperty(ParameterPropertyInterface<Property_>[] propertyArray) {
+		if (propertyArray == null)
+			return;
+		org.qcg.broker.schemas.schedulingplan.ParameterProperty tab[] = new org.qcg.broker.schemas.schedulingplan.ParameterProperty[propertyArray.length];
+		for (int i = 0; i < propertyArray.length; i++) {
+			tab[i] = (org.qcg.broker.schemas.schedulingplan.ParameterProperty)propertyArray[i].getDescription();
+		}
+		pt.setParameterProperty(tab);
+	}
+
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/plan/impl/SchedulingPlan.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/plan/impl/SchedulingPlan.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/plan/impl/SchedulingPlan.java	(revision 477)
@@ -0,0 +1,116 @@
+package schedframe.scheduling.plan.impl;
+
+import java.io.StringWriter;
+import java.util.ArrayList;
+
+import org.exolab.castor.xml.MarshalException;
+import org.exolab.castor.xml.ValidationException;
+
+import schedframe.scheduling.plan.ScheduledTaskInterface;
+import schedframe.scheduling.plan.SchedulingPlanInterface;
+
+
+public class SchedulingPlan implements SchedulingPlanInterface<org.qcg.broker.schemas.schedulingplan.SchedulingPlan> {
+
+	private static final long serialVersionUID = 2557774150841711876L;
+	protected org.qcg.broker.schemas.schedulingplan.SchedulingPlan sp;
+	
+	public SchedulingPlan(){
+		sp = new org.qcg.broker.schemas.schedulingplan.SchedulingPlan();
+		taskList = new ArrayList<ScheduledTaskInterface>();
+	}
+	
+	public SchedulingPlan(org.qcg.broker.schemas.schedulingplan.SchedulingPlan value){
+		sp = value;
+		taskList = new ArrayList<ScheduledTaskInterface>();
+	}
+	
+	public org.qcg.broker.schemas.schedulingplan.SchedulingPlan getDescription() {
+		return sp;
+	}
+
+	public String getDocument() {
+		StringWriter writer = new StringWriter();
+		try {
+			sp.marshal(writer);
+		} catch (MarshalException e) {
+			e.printStackTrace();
+		} catch (ValidationException e) {
+			e.printStackTrace();
+		}
+		return writer.toString();
+	}
+
+	public <Task_> void addTask(ScheduledTaskInterface<Task_> task)
+			throws IndexOutOfBoundsException {
+		sp.addTask((org.qcg.broker.schemas.schedulingplan.Task) task.getDescription());
+		taskList.add(task);
+	}
+
+	public <Task_> void addTask(int index, ScheduledTaskInterface<Task_> task)
+			throws IndexOutOfBoundsException {
+		sp.addTask(index, (org.qcg.broker.schemas.schedulingplan.Task) task.getDescription());
+		taskList.add(index, task);
+	}
+
+	@SuppressWarnings("unchecked")
+	public ScheduledTaskInterface<org.qcg.broker.schemas.schedulingplan.Task> getTask(int index)
+			throws IndexOutOfBoundsException {
+		return new ScheduledTask(sp.getTask(index));
+	}
+
+	@SuppressWarnings("unchecked")
+	public ScheduledTaskInterface<org.qcg.broker.schemas.schedulingplan.Task>[] getTask() {
+		org.qcg.broker.schemas.schedulingplan.Task tab[] = sp.getTask();
+		if(tab == null) return null;
+		
+		ScheduledTask ret[] = new ScheduledTask[tab.length];
+		for(int i = 0; i < tab.length; i++){
+			ret[i] = new ScheduledTask(tab[i]);
+		}
+		
+		return ret;
+	}
+
+	public int getTaskCount() {
+		return sp.getTaskCount();
+	}
+
+	public void removeAllTask() {
+		sp.removeAllTask();
+	}
+
+	public <Task_> boolean removeTask(ScheduledTaskInterface<Task_> task) {
+		return sp.removeTask((org.qcg.broker.schemas.schedulingplan.Task) task.getDescription());
+	}
+
+	@SuppressWarnings("unchecked")
+	public ScheduledTaskInterface<org.qcg.broker.schemas.schedulingplan.Task> removeTaskAt(int index) {
+		return new ScheduledTask(sp.removeTaskAt(index));
+	}
+
+	public <Task_> void setTask(int index, ScheduledTaskInterface<Task_> task)
+			throws IndexOutOfBoundsException {
+		sp.setTask(index, (org.qcg.broker.schemas.schedulingplan.Task) task.getDescription());
+	}
+
+	public <Task_> void setTask(ScheduledTaskInterface<Task_>[] taskArray) {
+		if(taskArray == null) return;
+		
+		org.qcg.broker.schemas.schedulingplan.Task tab[] = new org.qcg.broker.schemas.schedulingplan.Task[taskArray.length];
+		for(int i = 0; i < taskArray.length; i++){
+			tab[i] = (org.qcg.broker.schemas.schedulingplan.Task)taskArray[i].getDescription();
+		}
+		sp.setTask(tab);
+	}
+
+	
+	protected ArrayList<ScheduledTaskInterface> taskList;
+
+	public ArrayList<ScheduledTaskInterface> getTasks() {
+
+		return this.taskList;
+	}
+
+
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/plan/impl/ParameterType.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/plan/impl/ParameterType.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/plan/impl/ParameterType.java	(revision 477)
@@ -0,0 +1,145 @@
+package schedframe.scheduling.plan.impl;
+
+import java.io.StringWriter;
+
+import org.exolab.castor.xml.MarshalException;
+import org.exolab.castor.xml.ValidationException;
+
+import schedframe.scheduling.plan.ParameterTypeInterface;
+import schedframe.scheduling.plan.ParameterPropertyInterface;
+
+public class ParameterType implements ParameterTypeInterface<
+								org.qcg.broker.schemas.schedulingplan.ParameterType>{
+
+	private static final long serialVersionUID = 3808756887675318177L;
+	protected org.qcg.broker.schemas.schedulingplan.ParameterType pt;
+	
+	public ParameterType(){
+		pt = new org.qcg.broker.schemas.schedulingplan.ParameterType();
+	}
+
+	public ParameterType(org.qcg.broker.schemas.schedulingplan.ParameterType value){
+		pt = value;
+	}
+	
+	public org.qcg.broker.schemas.schedulingplan.ParameterType getDescription() {
+		return pt;
+	}
+
+	public String getDocument() {
+		StringWriter writer = new StringWriter();
+		try {
+			pt.marshal(writer);
+		} catch (MarshalException e) {
+			e.printStackTrace();
+		} catch (ValidationException e) {
+			e.printStackTrace();
+		}
+		return writer.toString();
+	}
+
+	public void addParamValue(String paramValue)
+			throws IndexOutOfBoundsException {
+		pt.addParamValue(paramValue);
+	}
+
+	public void addParamValue(int index, String paramValue)
+			throws IndexOutOfBoundsException {
+		pt.addParamValue(index, paramValue);
+	}
+
+	public <Property_> void addProperty(ParameterPropertyInterface<Property_> property)
+			throws IndexOutOfBoundsException {
+		pt.addParameterProperty((org.qcg.broker.schemas.schedulingplan.ParameterProperty)property.getDescription());
+	}
+
+	public <Property_> void addProperty(int index, ParameterPropertyInterface<Property_> property)
+			throws IndexOutOfBoundsException {
+		pt.addParameterProperty(index,(org.qcg.broker.schemas.schedulingplan.ParameterProperty) property.getDescription());
+	}
+
+	public String getParamValue(int index) throws IndexOutOfBoundsException {
+		return pt.getParamValue(index);
+	}
+
+	public String[] getParamValue() {
+		return pt.getParamValue();
+	}
+
+	public int getParamValueCount() {
+		return pt.getParamValueCount();
+	}
+
+	@SuppressWarnings("unchecked")
+	public ParameterPropertyInterface<org.qcg.broker.schemas.schedulingplan.ParameterProperty> getProperty(int index)
+			throws IndexOutOfBoundsException {
+		return new schedframe.scheduling.plan.impl.ParameterProperty(pt.getParameterProperty(index));
+	}
+
+	@SuppressWarnings("unchecked")
+	public ParameterPropertyInterface<org.qcg.broker.schemas.schedulingplan.ParameterProperty>[] getProperty() {
+		org.qcg.broker.schemas.schedulingplan.ParameterProperty tab[] = pt.getParameterProperty();
+		if(tab == null) return null;
+		
+		schedframe.scheduling.plan.impl.ParameterProperty ret[] = new schedframe.scheduling.plan.impl.ParameterProperty[tab.length];
+		for(int i = 0; i < tab.length; i++){
+			ret[i] = new schedframe.scheduling.plan.impl.ParameterProperty(tab[i]);
+		}
+		
+		return ret;
+	}
+
+	public int getPropertyCount() {
+		return pt.getParameterPropertyCount();
+	}
+
+	public void removeAllParamValue() {
+		pt.removeAllParamValue();
+	}
+
+	public void removeAllProperty() {
+		pt.removeAllParameterProperty();
+	}
+
+	public boolean removeParamValue(String paramValue) {
+		return pt.removeParamValue(paramValue);
+	}
+
+	public String removeParamValueAt(int index) {
+		return pt.removeParamValueAt(index);
+	}
+
+	public <Property_> boolean removeProperty(ParameterPropertyInterface<Property_> property) {
+		return pt.removeParameterProperty((org.qcg.broker.schemas.schedulingplan.ParameterProperty)property.getDescription());
+	}
+
+	@SuppressWarnings("unchecked")
+	public ParameterPropertyInterface<org.qcg.broker.schemas.schedulingplan.ParameterProperty> removePropertyAt(int index) {
+		return new schedframe.scheduling.plan.impl.ParameterProperty(pt.removeParameterPropertyAt(index));
+	}
+
+	public void setParamValue(int index, String paramValue)
+			throws IndexOutOfBoundsException {
+		pt.setParamValue(index, paramValue);
+	}
+
+	public void setParamValue(String[] paramValueArray) {
+		pt.setParamValue(paramValueArray);
+	}
+
+	public <Property_> void setProperty(int index, ParameterPropertyInterface<Property_> property)
+			throws IndexOutOfBoundsException {
+		pt.setParameterProperty(index, (org.qcg.broker.schemas.schedulingplan.ParameterProperty)property.getDescription());
+	}
+
+	public <Property_> void setProperty(ParameterPropertyInterface<Property_>[] propertyArray) {
+		if(propertyArray == null)
+			return;
+		org.qcg.broker.schemas.schedulingplan.ParameterProperty tab[] = new org.qcg.broker.schemas.schedulingplan.ParameterProperty[propertyArray.length];
+		for(int i = 0; i < propertyArray.length; i++){
+			tab[i] = (org.qcg.broker.schemas.schedulingplan.ParameterProperty)propertyArray[i].getDescription();
+		}
+		pt.setParameterProperty(tab);
+	}
+
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/plan/impl/ScheduledTask.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/plan/impl/ScheduledTask.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/plan/impl/ScheduledTask.java	(revision 477)
@@ -0,0 +1,195 @@
+package schedframe.scheduling.plan.impl;
+
+import java.io.StringWriter;
+import java.util.ArrayList;
+
+import org.exolab.castor.xml.MarshalException;
+import org.exolab.castor.xml.ValidationException;
+
+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;
+
+public class ScheduledTask implements ScheduledTaskInterface<org.qcg.broker.schemas.schedulingplan.Task> {
+
+	private static final long serialVersionUID = -9006532413203045991L;
+	protected org.qcg.broker.schemas.schedulingplan.Task t;
+
+	public ScheduledTask(){
+		t = new org.qcg.broker.schemas.schedulingplan.Task();
+		allocationList = new ArrayList<AllocationInterface>();
+	}
+	
+	public ScheduledTask(org.qcg.broker.schemas.schedulingplan.Task value){
+		t = value;
+		allocationList = new ArrayList<AllocationInterface>();
+	}
+	
+	
+	public org.qcg.broker.schemas.schedulingplan.Task getDescription() {
+		return t;
+	}
+
+	public String getDocument() {
+		StringWriter writer = new StringWriter();
+		try {
+			t.marshal(writer);
+		} catch (MarshalException e) {
+			e.printStackTrace();
+		} catch (ValidationException e) {
+			e.printStackTrace();
+		}
+		return writer.toString();
+	}
+
+	public <Allocation_> void addAllocation(
+			AllocationInterface<Allocation_> allocation)
+			throws IndexOutOfBoundsException {
+		t.addAllocation((org.qcg.broker.schemas.schedulingplan.Allocation) allocation.getDescription());
+		allocationList.add(allocation);
+	}
+
+	public <Allocation_> void addAllocation(int index, AllocationInterface<Allocation_> allocation)
+			throws IndexOutOfBoundsException {
+		t.addAllocation(index, (org.qcg.broker.schemas.schedulingplan.Allocation) allocation.getDescription());
+		allocationList.add(index, allocation);
+	}
+
+	public void deleteTopology() {
+		t.deleteTopology();
+	}
+
+	@SuppressWarnings("unchecked")
+	public AllocationInterface<org.qcg.broker.schemas.schedulingplan.Allocation> getAllocation(int index)
+			throws IndexOutOfBoundsException {
+		return new schedframe.scheduling.plan.impl.Allocation(t.getAllocation(index));
+	}
+
+	@SuppressWarnings("unchecked")
+	public AllocationInterface<org.qcg.broker.schemas.schedulingplan.Allocation>[] getAllocation() {
+		org.qcg.broker.schemas.schedulingplan.Allocation tab[] = t.getAllocation();
+		if(tab == null) return null;
+		
+		schedframe.scheduling.plan.impl.Allocation ret[] = new schedframe.scheduling.plan.impl.Allocation[tab.length];
+		for(int i = 0; i < tab.length; i++){
+			ret[i] = new schedframe.scheduling.plan.impl.Allocation(tab[i]);
+		}
+		return ret;
+	}
+
+	public int getAllocationCount() {
+		return t.getAllocationCount();
+	}
+
+	public String getJobId() {
+		return t.getJobId();
+	}
+
+	public AllocationStatus getStatus() {
+		return t.getStatus();
+	}
+	
+	public String getStatusDescription(){
+		return t.getStatusDescription();
+	}
+
+	public String getTaskId() {
+		return t.getTaskId();
+	}
+
+	public int getTopology() {
+		return t.getTopology();
+	}
+
+	public boolean hasTopology() {
+		return t.hasTopology();
+	}
+
+	public void removeAllAllocation() {
+		t.removeAllAllocation();
+	}
+
+	public <Allocation_> boolean removeAllocation(
+			AllocationInterface<Allocation_> allocation) {
+		return t.removeAllocation((org.qcg.broker.schemas.schedulingplan.Allocation) allocation.getDescription());
+	}
+
+	@SuppressWarnings("unchecked")
+	public AllocationInterface<org.qcg.broker.schemas.schedulingplan.Allocation> removeAllocationAt(int index) {
+		return new schedframe.scheduling.plan.impl.Allocation(t.removeAllocationAt(index));
+	}
+
+	public <Allocation_> void setAllocation(int index,
+			AllocationInterface<Allocation_> allocation)
+			throws IndexOutOfBoundsException {
+		t.setAllocation(index, (org.qcg.broker.schemas.schedulingplan.Allocation)allocation.getDescription());
+		allocationList.set(index, allocation);
+	}
+
+	public <Allocation_> void setAllocation(
+			AllocationInterface<Allocation_>[] allocationArray) {
+		if(allocationArray == null) return;
+		
+		org.qcg.broker.schemas.schedulingplan.Allocation tab[] = new org.qcg.broker.schemas.schedulingplan.Allocation[allocationArray.length];
+		for(int i = 0; i < allocationArray.length; i++){
+			tab[i] = (org.qcg.broker.schemas.schedulingplan.Allocation)allocationArray[i].getDescription();
+		}
+		t.setAllocation(tab);
+	}
+
+	public void setJobId(String jobId) {
+		t.setJobId(jobId);
+	}
+
+	public void setStatus(AllocationStatus status) {
+		t.setStatus(status);
+	}
+
+	public void setStatusDescription(String statusDescription){
+		t.setStatusDescription(statusDescription);
+	}
+	
+	public void setTaskId(String taskId) {
+		t.setTaskId(taskId);
+	}
+
+	public void setTopology(int topology) {
+		t.setTopology(topology);
+	}
+
+	@SuppressWarnings("unchecked")
+	public ScheduledTimeInterface<org.qcg.broker.schemas.schedulingplan.ScheduledTime> getScheduledTime() {
+		org.qcg.broker.schemas.schedulingplan.ScheduledTime time = t.getScheduledTime();
+		if(time == null)
+			return null;
+		
+		ScheduledTime st = new ScheduledTime(time);
+		return st;
+	}
+
+	public <ScheduledTime_> void setScheduledTime(
+			ScheduledTimeInterface<ScheduledTime_> scheduledTime) {
+		t.setScheduledTime((org.qcg.broker.schemas.schedulingplan.ScheduledTime) scheduledTime.getDescription());
+	}
+	
+
+	protected WorkloadUnit<?> task;
+	protected ArrayList<AllocationInterface> allocationList;
+
+	public ScheduledTask(WorkloadUnit<?> task){
+		this();
+		this.task = task;
+	}
+
+	public ArrayList<AllocationInterface> getAllocations() {
+		return this.allocationList;
+	}
+	
+	public WorkloadUnit<?> getTask(){
+		return this.task;
+	}
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/plan/impl/OtherParameterType.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/plan/impl/OtherParameterType.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/plan/impl/OtherParameterType.java	(revision 477)
@@ -0,0 +1,161 @@
+package schedframe.scheduling.plan.impl;
+
+import java.io.StringWriter;
+
+import org.exolab.castor.xml.MarshalException;
+import org.exolab.castor.xml.ValidationException;
+
+import schedframe.scheduling.plan.OtherParameterTypeInterface;
+import schedframe.scheduling.plan.ParameterPropertyInterface;
+
+
+public class OtherParameterType	implements OtherParameterTypeInterface <org.qcg.broker.schemas.schedulingplan.OtherParameterType>{
+
+	private static final long serialVersionUID = 6601332996207982911L;
+	protected org.qcg.broker.schemas.schedulingplan.OtherParameterType pt;
+	
+	public OtherParameterType(){
+		pt = new org.qcg.broker.schemas.schedulingplan.OtherParameterType();
+	}
+	
+	public OtherParameterType(org.qcg.broker.schemas.schedulingplan.OtherParameterType value){
+		pt = value; 
+	}
+	
+	public org.qcg.broker.schemas.schedulingplan.OtherParameterType getDescription() {
+		return pt;
+	}
+
+	public String getDocument() {
+		StringWriter writer = new StringWriter();
+		try {
+			pt.marshal(writer);
+		} catch (MarshalException e) {
+			e.printStackTrace();
+		} catch (ValidationException e) {
+			e.printStackTrace();
+		}
+		return writer.toString();
+	}
+
+	public String getEndpoint() {
+		return pt.getEndpoint();
+	}
+
+	public String getName() {
+		return pt.getName();
+	}
+
+	public void setEndpoint(String endpoint) {
+		pt.setEndpoint(endpoint);
+	}
+
+	public void setName(String name) {
+		pt.setName(name);
+	}
+
+	public void addParamValue(String paramValue)
+	throws IndexOutOfBoundsException {
+		pt.addParamValue(paramValue);
+	}
+	
+	public void addParamValue(int index, String paramValue)
+		throws IndexOutOfBoundsException {
+		pt.addParamValue(index, paramValue);
+	}
+	
+	public <Property_> void addProperty(ParameterPropertyInterface<Property_> property)
+		throws IndexOutOfBoundsException {
+		pt.addParameterProperty((org.qcg.broker.schemas.schedulingplan.ParameterProperty)property.getDescription());
+	}
+	
+	public <Property_> void addProperty(int index, ParameterPropertyInterface<Property_> property)
+		throws IndexOutOfBoundsException {
+		pt.addParameterProperty(index, (org.qcg.broker.schemas.schedulingplan.ParameterProperty) property.getDescription());
+	}
+	
+	public String getParamValue(int index) throws IndexOutOfBoundsException {
+		return pt.getParamValue(index);
+	}
+	
+	public String[] getParamValue() {
+		return pt.getParamValue();
+	}
+	
+	public int getParamValueCount() {
+		return pt.getParamValueCount();
+	}
+	
+	@SuppressWarnings("unchecked")
+	public ParameterPropertyInterface<org.qcg.broker.schemas.schedulingplan.ParameterProperty> getProperty(int index)
+		throws IndexOutOfBoundsException {
+		return new schedframe.scheduling.plan.impl.ParameterProperty(pt.getParameterProperty(index));
+	}
+	
+	@SuppressWarnings("unchecked")
+	public ParameterPropertyInterface<org.qcg.broker.schemas.schedulingplan.ParameterProperty>[] getProperty() {
+		org.qcg.broker.schemas.schedulingplan.ParameterProperty tab[] = pt.getParameterProperty();
+		if(tab == null) return null;
+		
+		schedframe.scheduling.plan.impl.ParameterProperty ret[] = new schedframe.scheduling.plan.impl.ParameterProperty[tab.length];
+		for(int i = 0; i < tab.length; i++){
+			ret[i] = new schedframe.scheduling.plan.impl.ParameterProperty(tab[i]);
+		}
+		
+		return ret;
+	}
+	
+	public int getPropertyCount() {
+		return pt.getParameterPropertyCount();
+	}
+	
+	public void removeAllParamValue() {
+		pt.removeAllParamValue();
+	}
+	
+	public void removeAllProperty() {
+		pt.removeAllParameterProperty();
+	}
+	
+	public boolean removeParamValue(String paramValue) {
+		return pt.removeParamValue(paramValue);
+	}
+	
+	public String removeParamValueAt(int index) {
+		return pt.removeParamValueAt(index);
+	}
+	
+	public <Property_> boolean removeProperty(ParameterPropertyInterface<Property_> property) {
+		return pt.removeParameterProperty((org.qcg.broker.schemas.schedulingplan.ParameterProperty)property.getDescription());
+	}
+	
+	@SuppressWarnings("unchecked")
+	public ParameterPropertyInterface<org.qcg.broker.schemas.schedulingplan.ParameterProperty> removePropertyAt(int index) {
+		return new schedframe.scheduling.plan.impl.ParameterProperty(pt.removeParameterPropertyAt(index));
+	}
+	
+	public void setParamValue(int index, String paramValue)
+		throws IndexOutOfBoundsException {
+		pt.setParamValue(index, paramValue);
+	}
+	
+	public void setParamValue(String[] paramValueArray) {
+		pt.setParamValue(paramValueArray);
+	}
+	
+	public <Property_> void setProperty(int index, ParameterPropertyInterface<Property_> property)
+		throws IndexOutOfBoundsException {
+		pt.setParameterProperty(index, (org.qcg.broker.schemas.schedulingplan.ParameterProperty)property.getDescription());
+	}
+	
+	public <Property_> void setProperty(ParameterPropertyInterface<Property_>[] propertyArray) {
+		if(propertyArray == null)
+			return;
+		org.qcg.broker.schemas.schedulingplan.ParameterProperty tab[] = new org.qcg.broker.schemas.schedulingplan.ParameterProperty[propertyArray.length];
+		for(int i = 0; i < propertyArray.length; i++){
+			tab[i] = (org.qcg.broker.schemas.schedulingplan.ParameterProperty) propertyArray[i].getDescription();
+		}
+		pt.setParameterProperty(tab);
+	}
+	
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/plan/impl/ProcessesMap.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/plan/impl/ProcessesMap.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/plan/impl/ProcessesMap.java	(revision 477)
@@ -0,0 +1,60 @@
+package schedframe.scheduling.plan.impl;
+
+import java.io.StringWriter;
+
+import org.exolab.castor.xml.MarshalException;
+import org.exolab.castor.xml.ValidationException;
+
+import schedframe.scheduling.plan.ProcessesMapInterface;
+
+public class ProcessesMap implements ProcessesMapInterface<org.qcg.broker.schemas.schedulingplan.ProcessesMap> {
+
+	private org.qcg.broker.schemas.schedulingplan.ProcessesMap pm;
+	
+	public ProcessesMap(){
+		this.pm = new org.qcg.broker.schemas.schedulingplan.ProcessesMap();
+	}
+	
+	public ProcessesMap(org.qcg.broker.schemas.schedulingplan.ProcessesMap map){
+		this.pm = map;
+	}
+	
+	@Override
+	public int[] getProcessesPerNode() {
+		return pm.getProcessesPerNode();
+	}
+
+	@Override
+	public int getSlotsPerNode() {
+		return pm.getSlotsPerNode();
+	}
+
+	@Override
+	public void setProcessesPerNode(int[] arg) {
+		this.pm.setProcessesPerNode(arg);
+	}
+
+	@Override
+	public void setSlotsPerNode(int arg) {
+		this.pm.setSlotsPerNode(arg);
+	}
+
+	@Override
+	public org.qcg.broker.schemas.schedulingplan.ProcessesMap getDescription() {
+		return this.pm;
+	}
+
+	@Override
+	public String getDocument() throws Exception {
+		StringWriter sw = new StringWriter();
+		try {
+			pm.marshal(sw);
+		} catch (MarshalException e) {
+			e.printStackTrace();
+		} catch (ValidationException e) {
+			e.printStackTrace();
+		}
+		return sw.toString();
+	}
+
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/plan/impl/Property.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/plan/impl/Property.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/plan/impl/Property.java	(revision 477)
@@ -0,0 +1,54 @@
+package schedframe.scheduling.plan.impl;
+
+import java.io.StringWriter;
+
+import org.exolab.castor.xml.MarshalException;
+import org.exolab.castor.xml.ValidationException;
+
+import schedframe.scheduling.plan.PropertyInterface;
+
+public class Property implements PropertyInterface<org.qcg.broker.schemas.schedulingplan.Property> {
+
+	protected org.qcg.broker.schemas.schedulingplan.Property p;
+	
+	public Property(){
+		this.p = new org.qcg.broker.schemas.schedulingplan.Property();
+	}
+	
+	public Property(org.qcg.broker.schemas.schedulingplan.Property value){
+		this.p = value;
+	}
+	
+	public String getContent() {
+		return this.p.getContent();
+	}
+
+	public String getName() {
+		return this.p.getName();
+	}
+
+	public void setContent(String content) {
+		this.p.setContent(content);
+	}
+
+	public void setName(String name) {
+		this.p.setName(name);
+	}
+
+	public org.qcg.broker.schemas.schedulingplan.Property getDescription() {
+		return this.p;
+	}
+
+	public String getDocument() throws Exception {
+		StringWriter writer = new StringWriter();
+		try {
+			p.marshal(writer);
+		} catch (MarshalException e) {
+			e.printStackTrace();
+		} catch (ValidationException e) {
+			e.printStackTrace();
+		}
+		return writer.toString();
+	}
+
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/plan/impl/Allocation.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/plan/impl/Allocation.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/plan/impl/Allocation.java	(revision 477)
@@ -0,0 +1,177 @@
+package schedframe.scheduling.plan.impl;
+
+import org.qcg.broker.schemas.schedulingplan.AllocationChoice;
+import org.qcg.broker.schemas.schedulingplan.Node;
+
+import java.io.StringWriter;
+import java.util.List;
+import java.util.Map;
+
+import org.exolab.castor.xml.MarshalException;
+import org.exolab.castor.xml.ValidationException;
+
+import schedframe.resources.units.ProcessingElements;
+import schedframe.resources.units.ResourceUnit;
+import schedframe.resources.units.ResourceUnitName;
+import schedframe.resources.units.StandardResourceUnitName;
+import schedframe.scheduling.manager.resources.utils.ResourceManagerUtils;
+import schedframe.scheduling.plan.AllocationInterface;
+import schedframe.scheduling.plan.HostInterface;
+import schedframe.scheduling.plan.ProcessesMapInterface;
+import schedframe.scheduling.plan.PropertiesTypeInterface;
+import schedframe.scheduling.plan.ProviderInfoInterface;
+
+public class Allocation implements AllocationInterface<org.qcg.broker.schemas.schedulingplan.Allocation> {
+
+	private static final long serialVersionUID = 5194463015598737779L;
+	protected org.qcg.broker.schemas.schedulingplan.Allocation allocation;
+	
+	public Allocation(){
+		allocation = new org.qcg.broker.schemas.schedulingplan.Allocation();
+	}
+	
+	public Allocation(org.qcg.broker.schemas.schedulingplan.Allocation value){
+		allocation = value;
+	}
+	
+	public org.qcg.broker.schemas.schedulingplan.Allocation getDescription() {
+		return allocation;
+	}
+
+	public String getDocument() {
+		StringWriter sw = new StringWriter();
+		try {
+			allocation.marshal(sw);
+		} catch (MarshalException e) {
+			e.printStackTrace();
+		} catch (ValidationException e) {
+			e.printStackTrace();
+		}
+		return sw.toString();
+	}
+
+	public void deleteProcessQuantity() {
+		allocation.getAllocationChoice().deleteProcessesCount();
+	}
+
+	@SuppressWarnings("unchecked")
+	public PropertiesTypeInterface<org.qcg.broker.schemas.schedulingplan.PropertiesType> getAdditionalProperties() {
+		PropertiesType api = 
+			new PropertiesType(allocation.getAdditionalProperties());
+		return api;
+	}
+
+	@SuppressWarnings("unchecked")
+	public HostInterface<org.qcg.broker.schemas.schedulingplan.Host> getHost() {
+		HostInterface<org.qcg.broker.schemas.schedulingplan.Host> host = new schedframe.scheduling.plan.impl.Host(allocation.getHost());
+		return host;
+	}
+
+	public String getProcessGroupId() {
+		return allocation.getProcessGroupId();
+	}
+
+	public int getProcessesCount() {
+		return allocation.getAllocationChoice().getProcessesCount();
+	}
+	
+	@SuppressWarnings("unchecked")
+	public ProcessesMapInterface<org.qcg.broker.schemas.schedulingplan.ProcessesMap> getProcessesMap(){
+		ProcessesMapInterface<org.qcg.broker.schemas.schedulingplan.ProcessesMap> map = 
+			new schedframe.scheduling.plan.impl.ProcessesMap(allocation.getAllocationChoice().getProcessesMap());
+		return map;
+	}
+
+	public boolean hasProcessesCount() {
+		return allocation.getAllocationChoice().hasProcessesCount();
+	}
+	
+	public boolean hasProcessesMap(){
+		return (allocation.getAllocationChoice().getProcessesMap() != null);
+	}
+
+	public <Properties_> void setAdditionalProperties(
+				PropertiesTypeInterface<Properties_> additionalProperties) {
+		allocation.setAdditionalProperties((org.qcg.broker.schemas.schedulingplan.PropertiesType)additionalProperties.getDescription());
+	}
+
+	public <Host_> void setHost(HostInterface<Host_> host) {
+		allocation.setHost((org.qcg.broker.schemas.schedulingplan.Host)host.getDescription());
+	}
+
+	public void setProcessGroupId(String processGroupId) {
+		allocation.setProcessGroupId(processGroupId);
+	}
+
+	public void setProcessesCount(int processCount) {
+		AllocationChoice choice = new AllocationChoice();
+		choice.setProcessesCount(processCount);
+		allocation.setAllocationChoice(choice);
+	}
+
+	public <ProcessesMap_> void setProcessesMap(ProcessesMapInterface<ProcessesMap_> processesMap){
+		AllocationChoice choice = new AllocationChoice();
+		choice.setProcessesMap(
+				(org.qcg.broker.schemas.schedulingplan.ProcessesMap) processesMap.getDescription());
+		allocation.setAllocationChoice(choice);
+		
+	}
+
+	@SuppressWarnings("unchecked")
+	public ProviderInfoInterface<org.qcg.broker.schemas.schedulingplan.ProviderInfo> getProviderInfo() {
+		org.qcg.broker.schemas.schedulingplan.ProviderInfo info = allocation.getProviderInfo();
+		if(info == null)
+			return null;
+		
+		ProviderInfoInterface providerInfo = new ProviderInfo(info);
+		return providerInfo;
+	}
+	
+	
+	public String getReservationId() {
+		org.qcg.broker.schemas.schedulingplan.Reservation r = allocation.getReservation();
+		return (r == null ? null : r.getId());
+	}
+
+	public <ProviderInfo_> void setProviderInfo(
+			ProviderInfoInterface<ProviderInfo_> providerInfo) {
+		allocation.setProviderInfo((org.qcg.broker.schemas.schedulingplan.ProviderInfo)providerInfo.getDescription());
+	}
+	
+
+	protected Map<ResourceUnitName, ResourceUnit> requestedResources;
+	protected boolean isProcessing = false;
+	protected String providerName;
+
+	@Override
+	public void setSpecificResources(
+			Map<ResourceUnitName, ResourceUnit> choosenResources) {
+		requestedResources = choosenResources;
+		ResourceManagerUtils.setPendingResources(choosenResources);
+		ProcessingElements processingElements = (ProcessingElements)requestedResources.get(StandardResourceUnitName.PE);
+		if(processingElements != null){
+			isProcessing = true;
+		}	
+	}
+
+	@Override
+	public Map<ResourceUnitName, ResourceUnit> getRequestedResources() {
+		return this.requestedResources;
+	}
+
+	public boolean isProcessing(){
+		return isProcessing;
+	}
+
+	@Override
+	public void setProviderName(String providerName) {
+		this.providerName = providerName;	
+	}
+
+	@Override
+	public String getProviderName() {
+		return providerName;
+	}
+
+
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/plan/impl/ParameterProperty.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/plan/impl/ParameterProperty.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/plan/impl/ParameterProperty.java	(revision 477)
@@ -0,0 +1,114 @@
+package schedframe.scheduling.plan.impl;
+
+import java.io.StringWriter;
+
+import org.exolab.castor.xml.MarshalException;
+import org.exolab.castor.xml.ValidationException;
+
+import schedframe.scheduling.plan.ParameterPropertyInterface;
+
+
+public class ParameterProperty implements ParameterPropertyInterface<org.qcg.broker.schemas.schedulingplan.ParameterProperty> {
+
+	private static final long serialVersionUID = -1452887249087909576L;
+	private org.qcg.broker.schemas.schedulingplan.ParameterProperty p;
+	
+	public ParameterProperty(){
+		p = new org.qcg.broker.schemas.schedulingplan.ParameterProperty();
+	}
+	
+	public ParameterProperty(org.qcg.broker.schemas.schedulingplan.ParameterProperty value){
+		this.p = value;
+	}
+	
+	public org.qcg.broker.schemas.schedulingplan.ParameterProperty getDescription() {
+		return p;
+	}
+
+	public String getDocument() {
+		StringWriter writer = new StringWriter();
+		try {
+			p.marshal(writer);
+		} catch (MarshalException e) {
+			e.printStackTrace();
+		} catch (ValidationException e) {
+			e.printStackTrace();
+		}
+		return writer.toString();
+	}
+
+	public void addValue(String value) throws IndexOutOfBoundsException {
+		p.addValue(value);
+	}
+
+	public void addValue(int index, String value)
+			throws IndexOutOfBoundsException {
+		p.addValue(index, value);
+	}
+
+	public void deleteExclude() {
+		p.deleteExclude();
+	}
+
+	public boolean getExclude() {
+		return p.getExclude();
+	}
+
+	public String getName() {
+		return p.getName();
+	}
+
+	public String getValue(int index) throws IndexOutOfBoundsException {
+		return p.getValue(index);
+	}
+
+	public String[] getValue() {
+		return p.getValue();
+	}
+
+	public int getValueCount() {
+		return p.getValueCount();
+	}
+
+	public boolean hasExclude() {
+		return p.hasExclude();
+	}
+
+	public boolean isExclude() {
+		return p.isExclude();
+	}
+
+	public boolean isValid() {
+		return p.isValid();
+	}
+
+	public void removeAllValue() {
+		p.removeAllValue();
+	}
+
+	public boolean removeValue(String value) {
+		return p.removeValue(value);
+	}
+
+	public String removeValueAt(int index) {
+		return p.removeValueAt(index);
+	}
+
+	public void setExclude(boolean exclude) {
+		p.setExclude(exclude);
+	}
+
+	public void setName(String name) {
+		p.setName(name);
+	}
+
+	public void setValue(int index, String value)
+			throws IndexOutOfBoundsException {
+		p.setValue(index, value);
+	}
+
+	public void setValue(String[] valueArray) {
+		p.setValue(valueArray);
+	}
+
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/plan/impl/ProviderInfo.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/plan/impl/ProviderInfo.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/plan/impl/ProviderInfo.java	(revision 477)
@@ -0,0 +1,81 @@
+package schedframe.scheduling.plan.impl;
+
+import org.qcg.broker.schemas.schedulingplan.types.InterfaceType;
+
+import java.io.StringWriter;
+
+import org.exolab.castor.xml.MarshalException;
+import org.exolab.castor.xml.ValidationException;
+
+import schedframe.scheduling.plan.PropertiesTypeInterface;
+import schedframe.scheduling.plan.ProviderInfoInterface;
+
+
+public class ProviderInfo implements ProviderInfoInterface<org.qcg.broker.schemas.schedulingplan.ProviderInfo> {
+
+	private static final long serialVersionUID = -1629036434099074699L;
+	private org.qcg.broker.schemas.schedulingplan.ProviderInfo pi;
+	
+	public ProviderInfo(){
+		pi = new org.qcg.broker.schemas.schedulingplan.ProviderInfo();
+	}
+	
+	public ProviderInfo(org.qcg.broker.schemas.schedulingplan.ProviderInfo info){
+		this.pi = info;
+	}
+
+	public org.qcg.broker.schemas.schedulingplan.ProviderInfo getDescription() {
+		pi.getAdditionalProperties();
+		return pi;
+	}
+	
+	public String getDocument() {
+		StringWriter writer = new StringWriter();
+		try {
+			pi.marshal(writer);
+		} catch (MarshalException e) {
+			e.printStackTrace();
+		} catch (ValidationException e) {
+			e.printStackTrace();
+		}
+		return writer.toString();
+	}
+
+	public String getLocation() {
+		return pi.getLocation();
+	}
+
+	public String getProxyName() {
+		return pi.getProxyName();
+	}
+
+	public InterfaceType getType() {
+		return pi.getType();
+	}
+
+	public void setLocation(String location) {
+		pi.setLocation(location);
+	}
+
+	public void setProxyName(String proxyName) {
+		pi.setProxyName(proxyName);
+	}
+
+	public void setType(InterfaceType type) {
+		pi.setType(type);
+	}
+
+	@SuppressWarnings("unchecked")
+	public PropertiesTypeInterface<org.qcg.broker.schemas.schedulingplan.PropertiesType> getAdditionalProperties() {
+		org.qcg.broker.schemas.schedulingplan.PropertiesType properties = this.pi.getAdditionalProperties();
+		PropertiesType ret = new PropertiesType(properties);
+		return ret;
+	}
+
+	public <Properties_> void setAdditionalProperties(
+			PropertiesTypeInterface<Properties_> additionalProperties) {
+		this.pi.setAdditionalProperties(
+					(org.qcg.broker.schemas.schedulingplan.PropertiesType) additionalProperties.getDescription());
+	}
+
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/plan/ProcessesMapInterface.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/plan/ProcessesMapInterface.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/plan/ProcessesMapInterface.java	(revision 477)
@@ -0,0 +1,15 @@
+package schedframe.scheduling.plan;
+
+
+import schedframe.DescriptionContainer;
+
+public interface ProcessesMapInterface<T> extends DescriptionContainer<T> {
+
+	public void setSlotsPerNode(int arg);
+	
+	public int getSlotsPerNode();
+	
+	public void setProcessesPerNode(int[] arg);
+	
+	public int[] getProcessesPerNode();
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/plan/ProviderInfoInterface.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/plan/ProviderInfoInterface.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/plan/ProviderInfoInterface.java	(revision 477)
@@ -0,0 +1,56 @@
+package schedframe.scheduling.plan;
+
+import schedframe.DescriptionContainer;
+
+import org.qcg.broker.schemas.schedulingplan.types.InterfaceType;
+
+public interface ProviderInfoInterface<T> extends DescriptionContainer<T> {
+
+	/**
+	 * Returns the value of field 'location'.
+	 * 
+	 * @return the value of field 'Location'.
+	 */
+	public java.lang.String getLocation();
+
+	/**
+	 * Returns the value of field 'proxyName'.
+	 * 
+	 * @return the value of field 'ProxyName'.
+	 */
+	public java.lang.String getProxyName();
+
+	/**
+	 * Returns the value of field 'type'.
+	 * 
+	 * @return the value of field 'Type'.
+	 */
+	public InterfaceType getType();
+	
+	/**
+	 * Sets the value of field 'location'.
+	 * 
+	 * @param location the value of field 'location'.
+	 */
+	public void setLocation(final java.lang.String location);
+
+	/**
+	 * Sets the value of field 'proxyName'.
+	 * 
+	 * @param proxyName the value of field 'proxyName'.
+	 */
+	public void setProxyName(final java.lang.String proxyName);
+
+	/**
+	 * Sets the value of field 'type'.
+	 * 
+	 * @param type the value of field 'type'.
+	 */
+	public void setType(final InterfaceType type);
+	
+	public <Properties> void setAdditionalProperties(
+            final PropertiesTypeInterface<Properties> additionalProperties);
+	
+	public <Properties> PropertiesTypeInterface<Properties> getAdditionalProperties();
+
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/SecurityContext.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/SecurityContext.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/SecurityContext.java	(revision 477)
@@ -0,0 +1,20 @@
+package schedframe.scheduling;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+public interface SecurityContext {
+
+	public String getUserIdentity();
+	
+	public Object getCertificate();
+	
+	public String getJobId();
+	
+	public String getTaskId();
+	
+	public String getProcessesSetId();
+
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/Scheduler.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/Scheduler.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/Scheduler.java	(revision 477)
@@ -0,0 +1,319 @@
+package schedframe.scheduling;
+
+import eduni.simjava.Sim_event;
+import eduni.simjava.Sim_port;
+import eduni.simjava.Sim_system;
+import gridsim.GridSim;
+import gridsim.GridSimCore;
+import gridsim.GridSimTags;
+import gridsim.IO_data;
+import gridsim.gssim.WormsTags;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+
+import schedframe.Initializable;
+import schedframe.PluginConfiguration;
+import schedframe.events.scheduling.SchedulingEventType;
+import schedframe.resources.Resource;
+import schedframe.resources.ResourceStatus;
+import schedframe.resources.ResourceType;
+import schedframe.resources.computing.ComputingResource;
+import schedframe.resources.providers.LocalSystem;
+import schedframe.resources.units.ResourceUnit;
+import schedframe.resources.units.ResourceUnitName;
+import schedframe.scheduling.manager.resources.ManagedComputingResources;
+import schedframe.scheduling.manager.resources.ManagedResources;
+import schedframe.scheduling.policy.AbstractManagementSystem;
+import schedframe.scheduling.queue.TaskQueue;
+import schedframe.scheduling.queue.QueueDescription;
+import schedframe.scheduling.tasks.WorkloadUnit;
+
+public class Scheduler extends GridSimCore implements Resource, Initializable{
+	
+	protected ResourceStatus status;
+	protected ResourceType type;
+	
+	protected Scheduler parent;
+	protected List<Scheduler> children;
+	
+	protected AbstractManagementSystem managementSystem;
+	
+	protected ManagedComputingResources compResources;	
+
+	public Scheduler(AbstractManagementSystem manSys, ResourceType schedType, ManagedResources managedResources) throws Exception {
+		super(manSys.getName(), 1);
+		this.managementSystem = manSys;
+		this.compResources = new ManagedComputingResources();
+		this.status = ResourceStatus.AVAILABLE;
+		this.children = new ArrayList<Scheduler>(1);
+		this.type = schedType;
+		init(managedResources);
+	}
+
+	public void init(ManagedResources managedResources){
+		addResources(managedResources.getComputingResources());
+		managementSystem.init(this, managedResources);
+		
+		//required to terminate all scheduling entities after the end of simulation
+		Integer schedulerIdObj = new Integer(get_id());
+		List<Integer> schedRes = GridSim.getGridResourceList();
+		schedRes.add(schedulerIdObj);
+
+		/*if (supportsAR) {
+			res = GridSim.getAdvancedReservationList();
+			res.add(resIdObj);
+		} */
+
+	}
+	
+	public void addChild(Scheduler child) {
+		child.setParent(this);
+		if (children == null) {
+			children = new ArrayList<Scheduler>(1);
+		}
+		children.add(child);
+	}
+
+	public List<Scheduler> getChildren() {
+		return children;
+	}
+
+	public void setParent(Scheduler newParent) {
+		this.parent = newParent;
+	}
+
+	public Scheduler getParent() {
+		return parent;
+	}
+
+	/*public void addResource(ComputingResource resource) {
+		compResources.add(resource);
+	}*/
+
+	public void addResources(List<ComputingResource> res) {
+		for(ComputingResource resource:res){
+			compResources.add(resource);
+			resource.setScheduler(this);
+			for(ComputingResource child: resource.filterDescendants(new Properties())){
+				child.setScheduler(this);
+			}
+		}
+	}
+
+	public ManagedComputingResources getCompResources() {
+		return compResources;
+	}
+
+	public void body() {
+
+		PluginConfiguration pluginConfig = managementSystem.getSchedulingPluginConfiguration();
+		if (pluginConfig != null) {
+			Map<SchedulingEventType, Object> events = pluginConfig.getServedEvents();
+			if (events != null) {
+				Object obj = events.get(SchedulingEventType.TIMER);
+				if (obj != null) {
+					int delay = (Integer) obj;
+					send(this.get_id(), delay, WormsTags.TIMER);
+				}
+			}
+		}
+
+		// Process events until END_OF_SIMULATION is received from the
+		// GridSimShutdown Entity
+		Sim_event ev = new Sim_event();
+		sim_get_next(ev);
+		boolean run = true;
+		while (Sim_system.running()  && run) {
+			// sim_get_next(ev);
+			// if the simulation finishes then exit the loop
+			if (ev.get_tag() == GridSimTags.END_OF_SIMULATION) {
+				// 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;
+			}
+			
+			// process the received event
+			processRequest(ev);
+			sim_get_next(ev);
+		}
+	}
+	
+	protected void processRequest(Sim_event ev) {
+		switch (ev.get_tag()) {
+
+		case GridSimTags.GRIDLET_SUBMIT:
+			processGSSIMJobSubmit(ev, false);
+			break;
+
+		case GridSimTags.GRIDLET_SUBMIT_ACK:
+			processGSSIMJobSubmit(ev, true);
+			break;
+
+		case GridSimTags.GRIDLET_RETURN:
+			processGSSIMJobReturn(ev);
+			break;
+
+		default:
+			processOtherRequest(ev);
+			break;
+		}
+	}
+
+	protected void processOtherRequest(Sim_event ev) {
+		switch (ev.get_tag()) {
+		case WormsTags.QUERY_RESOURCE_DESC:
+			SchedulerDescription desc = new SchedulerDescription(new LocalSystem(get_name(), null, null));
+			Map<ResourceUnitName, List<ResourceUnit>> units = managementSystem.getResourceManager().getSharedResourceUnits();
+			desc.addResourceUnitList(units);
+			desc.addQueuesDescription(getQueuesDescription());
+
+			IO_data data = new IO_data(desc, 0, ev.get_src());
+			send(ev.get_src(), GridSimTags.SCHEDULE_NOW, WormsTags.QUERY_RESOURCE_DESC_RESULT, data);
+			break;
+
+		default:
+			managementSystem.processEvent(ev);
+			break;
+		}
+	}
+	
+	/*public boolean processOtherEvent(Sim_event ev) {
+		return false;
+	}*/
+	
+	protected void processGSSIMJobReturn(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();
+		managementSystem.notifySubmittedWorkloadUnit(job, ack);
+	}
+	
+	public void send(String entityName, double delay, int tag, Object data){
+		super.send(entityName, delay, tag, data);
+	}
+	
+	public void send(int destId, double delay, int tag){
+		super.send(destId, delay, tag);
+	}
+	
+	public void send(int destId, double delay, int tag, Object data){
+		super.send(destId, delay, tag, data);
+	}
+	
+	public void send(Sim_port destPort, double delay, int tag, Object data) {
+		super.send(destPort, delay, tag, data);
+	}
+
+	public void sendInternal(double delay, int tag, Object data) {
+		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() {
+		return output;
+	}
+
+	/*public Scheduler getScheduler(String resourceName){
+		ComputingResource resourceWithName = null;
+		for(int i = 0 ; i < compResources.size() && resourceWithName == null; i++){
+			ComputingResource resource = compResources.get(i);
+			if(resource.getName().equals(resourceName))
+				resourceWithName = resource;
+			else
+				try {
+					resourceWithName = resource.getDescendantByName(resourceName);
+				} catch (ResourceException e) {
+					return null;
+				}
+		}
+		if(resourceWithName == null)
+			return null;
+		List<ComputingResource> children = resourceWithName.getChildren();
+		Set<Scheduler> childrenSchedulers = new HashSet<Scheduler>();
+		for(ComputingResource child:children) {
+			childrenSchedulers.add(child.getScheduler());
+		}
+		Set<Scheduler> tempChildrenSchedulers = new HashSet<Scheduler>(childrenSchedulers);
+		while(childrenSchedulers.size() != 1){
+			childrenSchedulers = new HashSet<Scheduler>();
+			for(Scheduler s: tempChildrenSchedulers){
+				childrenSchedulers.add(s.getParent());
+			}
+			tempChildrenSchedulers = new HashSet<Scheduler>(childrenSchedulers);
+		}
+		Iterator<Scheduler> it = childrenSchedulers.iterator();
+		Scheduler potentialScheduler = it.next();
+		if(potentialScheduler.getResources().containsAll(children))
+			return potentialScheduler;
+		return null;
+
+	}*/
+	
+	public List<QueueDescription> getQueuesDescription(){
+		List<QueueDescription> queues = new ArrayList<QueueDescription>();
+		for(TaskQueue queue: managementSystem.getAccessQueues()){
+			QueueDescription qd;
+			try {
+				qd = new QueueDescription(queue.getName(), queue.getPriority(), queue.supportReservations(), getQueueLoad(queue.getName()));
+				queues.add(qd);
+			} catch (NoSuchFieldException e) {;
+			}
+		}
+		return queues;
+
+	}
+	private long getQueueLoad(String queueName) throws NoSuchFieldException{
+		Map<String, Integer> queue_size = managementSystem.getQueuesSize();
+		long load = 0;
+		if(queueName == null){
+			for(String queue: queue_size.keySet()){
+				load += queue_size.get(queue);
+			}
+			return load;
+		}
+		else if(queue_size.containsKey(queueName))
+			return queue_size.get(queueName);
+		else
+			throw new NoSuchFieldException("Queue " + queueName + 
+							" is not available in resource " + get_name());
+	}
+
+	public ResourceType getType() {
+		return this.type;
+	}
+
+	public ResourceStatus getStatus() {
+		return status;
+	}
+	
+	public void setStatus(ResourceStatus newStatus) {
+		status = newStatus;
+	}
+	
+	public void getResourceDescription(){
+		
+	}
+
+	public void initiate() {
+
+	}
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/WorkloadUnitList.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/WorkloadUnitList.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/WorkloadUnitList.java	(revision 477)
@@ -0,0 +1,10 @@
+package schedframe.scheduling;
+
+import java.util.List;
+
+import schedframe.scheduling.tasks.WorkloadUnit;
+
+
+public interface WorkloadUnitList extends List<WorkloadUnit<?>>{
+
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/plugin/SchedulingPluginConfiguration.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/plugin/SchedulingPluginConfiguration.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/plugin/SchedulingPluginConfiguration.java	(revision 477)
@@ -0,0 +1,24 @@
+package schedframe.scheduling.plugin;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import schedframe.PluginConfiguration;
+import schedframe.events.scheduling.SchedulingEventType;
+
+public class SchedulingPluginConfiguration implements PluginConfiguration {
+	
+	private Map<SchedulingEventType, Object> events;
+
+	public SchedulingPluginConfiguration(){
+		this.events = new HashMap<SchedulingEventType, Object>();
+	}
+	
+	public void addServedEvent(SchedulingEventType eventType, Object argument){
+		events.put(eventType, argument);
+	}
+	
+	public Map<SchedulingEventType, Object> getServedEvents() {
+		return events;
+	}
+}
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 477)
@@ -0,0 +1,37 @@
+package schedframe.scheduling.plugin.estimation;
+
+import gssim.schedframe.scheduling.ExecTask;
+
+import java.util.Map;
+
+import schedframe.Plugin;
+import schedframe.events.scheduling.SchedulingEvent;
+import schedframe.resources.units.ResourceUnit;
+import schedframe.resources.units.ResourceUnitName;
+
+/**
+ * This interface is responsible for estimation of task execution time. It
+ * provides all necessary information to compute execution time. In general, the
+ * major method allow to develop different approaches and strategies of
+ * execution time computation. Ratings of processors, available memory, length
+ * of task (number of CPU instructions) and task requirements are used to
+ * specify duration of the task. The interface method returns an estimated
+ * execution time of the task, which is then applied to simulation.
+ * 
+ * @author Marcin Krystek
+ * 
+ */
+public interface ExecutionTimeEstimationPlugin extends Plugin {
+
+	/**
+	 * 
+	 * @param allocatedResources resource units allocated for task execution
+	 * @param task which will be executed
+	 * @param remainingLength 
+	 * @return estimated execution time of a task of specified length
+	 */
+	public double execTimeEstimation(SchedulingEvent event, ExecTask task, Map<ResourceUnitName, ResourceUnit> allocatedResources, 
+									double completionPercentage);
+	
+
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/plugin/SchedulingPlugin.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/plugin/SchedulingPlugin.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/plugin/SchedulingPlugin.java	(revision 477)
@@ -0,0 +1,24 @@
+package schedframe.scheduling.plugin;
+
+import schedframe.Plugin;
+import schedframe.events.scheduling.SchedulingEvent;
+import schedframe.scheduling.WorkloadUnitListImpl;
+import schedframe.scheduling.manager.resources.ResourceManager;
+import schedframe.scheduling.manager.tasks.JobRegistry;
+import schedframe.scheduling.plan.SchedulingPlanInterface;
+import schedframe.scheduling.plugin.grid.ModuleList;
+import schedframe.scheduling.queue.TaskQueueList;
+
+public interface SchedulingPlugin extends Plugin{
+
+	public int placeJobsInQueues(WorkloadUnitListImpl newJobs,
+			TaskQueueList queues, 
+			ResourceManager resourceManager, ModuleList modules);
+	
+	public SchedulingPlanInterface<?> schedule(SchedulingEvent event, 
+			TaskQueueList queues, 
+			JobRegistry jobRegistry, 
+			ResourceManager resourceManager, ModuleList modules);
+	
+}
+
Index: DCWoRMS/trunk/src/schedframe/scheduling/plugin/grid/Prediction.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/plugin/grid/Prediction.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/plugin/grid/Prediction.java	(revision 477)
@@ -0,0 +1,52 @@
+package schedframe.scheduling.plugin.grid;
+
+
+/**
+ * This interface provides performance estimations that can be used in scheduling
+ *  
+ * @author Ariel
+ *
+ */
+public interface Prediction {
+
+	/**
+	 * Predicts runtime of a given task at specific resource
+	 * @param td Description of a task
+	 * @param rd Description of resources
+	 * @param resourceId id of resource
+	 * @return prediction of a task runtime for a given task and resource description
+	 */
+//	public PredictionValue getRunTime(TaskDescription td, ResourceDescription rd, String resourceId);
+
+	/**
+	 * Predicts runtime of a given task
+	 * @param td Description of a task
+	 * @return prediction of a task runtime for a given task
+	 */
+//	public PredictionValue getRunTime(TaskDescription td);
+	
+	/**
+	 * Predicts queue wait time of a given task at specific resource
+	 * @param td Description of a task
+	 * @param rd Description of resources
+	 * @param resourceId id of resource
+	 * @return prediction of a task waiting time for a given task and resource description
+	 */
+//	public PredictionValue getWaitTime(TaskDescription td, ResourceDescription rd, String resourceId);
+	
+	/**
+	 * Predicts a given parameter of a given task
+	 * @return prediction for a given parameter and task description 
+	 */
+//	public PredictionValue getPrediction(String paramName, TaskDescription td);
+
+	/**
+	 * Predicts runtimes of given tasks at specific resources
+	 * @param td Description of a task
+	 * @param rd Description of resources
+	 * @param resourceIds identifiers of resources
+	 * @return predictions for a given task; returned array contains predictions for requested resources 
+	 */
+//	public PredictionValue[] getRunTime(TaskDescription td, ResourceDescription rd, String[] resourceIds);
+
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/plugin/grid/ModuleList.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/plugin/grid/ModuleList.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/plugin/grid/ModuleList.java	(revision 477)
@@ -0,0 +1,12 @@
+package schedframe.scheduling.plugin.grid;
+
+import java.util.List;
+
+public interface ModuleList extends List<Module>{
+	
+	public <T extends Module> List<T> get(ModuleType type);
+	
+	public Module getModule(ModuleType type);
+	
+	public boolean isModuleAvailable(ModuleType type);
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/plugin/grid/JobRegistry.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/plugin/grid/JobRegistry.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/plugin/grid/JobRegistry.java	(revision 477)
@@ -0,0 +1,53 @@
+package schedframe.scheduling.plugin.grid;
+
+import java.util.List;
+
+import schedframe.scheduling.tasks.JobInterface;
+import schedframe.scheduling.tasks.TaskInterface;
+
+
+/**
+ * The JobRegistry interface provides information about jobs and tasks 
+ * @author Ariel
+ *
+ */
+public interface JobRegistry extends Module{
+
+	/**
+	 * Provide information about submitted jobs which are active (not finished) 
+	 * @return array of Job objects 
+	 */
+	public List<JobInterface<?>> getActiveJobs();
+
+	/**
+	 * Provide information about submitted tasks which are active (not finished) 
+	 * @return array of Task objects 
+	 */
+	public List<TaskInterface<?>> getActiveTasks();
+	
+	/**
+	 * Gets information about a given job
+	 * @param jobID the identifier of the job
+	 * @return object implementing Job interface
+	 */
+	public JobInterface<?> getJobInfo(String jobID);
+
+	/**
+	 * Gets information about a given task
+	 * @param jobID the identifier of the job the task belongs to
+	 * @param taskId the identifier of the task
+	 * @return object implementing {@link TaskInterface} interface
+	 */
+	public TaskInterface<?> getTaskInfo(String jobID, String taskId);
+
+	/**
+	 * @param jobID the identifier of the job
+	 * @param job
+	 * @return
+	 */
+	public boolean addJob(JobInterface<?> job);
+	
+	
+	public boolean addTask(TaskInterface<?> task);
+	
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/plugin/grid/ModuleListImpl.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/plugin/grid/ModuleListImpl.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/plugin/grid/ModuleListImpl.java	(revision 477)
@@ -0,0 +1,58 @@
+package schedframe.scheduling.plugin.grid;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+public class ModuleListImpl extends ArrayList<Module> implements ModuleList {
+
+	private static final long serialVersionUID = -3824600938144742457L;
+
+	public ModuleListImpl(){
+		super();
+	}
+	
+	public ModuleListImpl(int initialSize){
+		super(initialSize);
+	}
+	
+	public List<Module> get(ModuleType type){
+		List<Module> list = null;
+		
+		for(int i = 0; i < size(); i++){
+			Module m = get(i);
+			if(m.getType() == type){
+				list = (list == null ? new ArrayList<Module>(1) : list);
+				list.add(m);
+			}
+		}
+		return list;
+	}
+	
+	public Module getModule(ModuleType type){
+		
+		for(int i = 0; i < size(); i++){
+			Module m = get(i);
+			if(m.getType() == type){
+				return m;
+			}
+		}
+		return null;
+	}
+	
+	public boolean isModuleAvailable(ModuleType type){
+		for(int i = 0; i < size(); i++){
+			Module m = get(i);
+			if(m.getType() == type){
+				return true;
+			}
+		}
+		return false;
+	}
+	
+	
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/plugin/grid/GlobalSchedulingPlugin.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/plugin/grid/GlobalSchedulingPlugin.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/plugin/grid/GlobalSchedulingPlugin.java	(revision 477)
@@ -0,0 +1,14 @@
+package schedframe.scheduling.plugin.grid;
+
+import schedframe.scheduling.plugin.SchedulingPlugin;
+
+/**
+ * Interface of a Grid Scheduler 
+ * 
+ * @author Ariel
+ *  
+ */
+public interface GlobalSchedulingPlugin extends SchedulingPlugin {
+
+
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/plugin/grid/Module.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/plugin/grid/Module.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/plugin/grid/Module.java	(revision 477)
@@ -0,0 +1,22 @@
+package schedframe.scheduling.plugin.grid;
+
+import java.util.Properties;
+
+import eduni.simjava.Sim_event;
+
+import schedframe.exceptions.ModuleException;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+public interface Module {
+
+	public void init(Properties properties) throws ModuleException;
+	
+	public void dispose() throws ModuleException;
+	
+	public ModuleType getType();
+	
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/plugin/grid/ModuleType.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/plugin/grid/ModuleType.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/plugin/grid/ModuleType.java	(revision 477)
@@ -0,0 +1,35 @@
+package schedframe.scheduling.plugin.grid;
+
+import schedframe.StaticResourceLoadCalendar;
+
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+public enum ModuleType {
+
+	RESOURCE_DISCOVERY("Resource_discovery", ResourceDiscovery.class),
+	JOB_REGISTRY("Job registry", JobRegistry.class),
+	RESOURCE_CALENDAR("Resource Calendar", StaticResourceLoadCalendar.class);
+	//DATA_MANAGER("Data Manager", DataManager.class),
+	//AR_EXTENSION("ARExtension", ARExtension.class);
+
+	
+	private String name;
+	private Class<?> _interface;
+	
+	private ModuleType(String name, Class<?> _class){
+		this.name = name;
+		this._interface = _class;
+	}
+	
+	public String toString(){
+		return this.name;
+	}
+	
+	public boolean isValidFor(Module m){
+		return (m == null ? false : _interface.isAssignableFrom(m.getClass()));
+	}
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/plugin/grid/ResourceDiscovery.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/plugin/grid/ResourceDiscovery.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/plugin/grid/ResourceDiscovery.java	(revision 477)
@@ -0,0 +1,55 @@
+package schedframe.scheduling.plugin.grid;
+
+import java.util.List;
+
+import schedframe.resources.providers.ResourceProvider;
+import schedframe.scheduling.SchedulerDescription;
+import schedframe.scheduling.SecurityContext;
+import schedframe.scheduling.tasks.requirements.AbstractResourceRequirements;
+
+
+/**
+ * This interface provides access to information about resources
+ *
+ */
+public interface ResourceDiscovery extends Module {
+
+	/**
+	 * 
+	 * @return List of all administration domains in the system
+	 */
+	public List<String> getAdministrationDomains(SecurityContext secContext);
+	
+	/**
+	 * 
+	 * @return List of resource providers available in the system
+	 */
+	public List<ResourceProvider> getProviders(SecurityContext secContext);
+	
+	/**
+	 * 
+	 * @param admDomain
+	 * @return List of resource providers available in particular administration
+	 * domain.
+	 */
+	public List<ResourceProvider> getProviders(String admDomain, SecurityContext secContext);
+	
+
+	
+	public List<ResourceProvider> getProviders(AbstractResourceRequirements<?> reqDesc,
+												SecurityContext secContext);
+	
+	/**
+	 * @return description of all resources. Order of the resources is not determined.
+	 */
+	public List<SchedulerDescription> getResources(SecurityContext secContext);
+
+	/**
+	 * @param reqDesc resource requirements
+	 * @return description of all resources that meet resource requirements
+	 */
+	public List<SchedulerDescription> getResources(AbstractResourceRequirements<?> reqDesc, SecurityContext secContext);
+
+	public List<SchedulerDescription> getResources();
+	
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/plugin/local/TimeOperations.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/plugin/local/TimeOperations.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/plugin/local/TimeOperations.java	(revision 477)
@@ -0,0 +1,573 @@
+package schedframe.scheduling.plugin.local;
+
+import java.util.ArrayList;
+
+import org.joda.time.DateTime;
+
+/**
+ * @author Ariel Oleksiak
+ * 
+ */
+public class TimeOperations {
+
+		long timeDelta;
+
+		public static final long TWENTY_FOUR_HOURS = 24*60*60*1000; //24h in millis
+
+		/**
+		 * Constructor of DateOperations class
+		 * @param timeDelta - parameter used to express potential time overheads, e.g.
+		 * while checking if certain period fits into another
+		 */
+		public TimeOperations(long timeDelta) {
+			this.timeDelta = timeDelta;
+		}
+
+		//Getters/setters
+		
+		public long getTimeDelta() {
+			return timeDelta;
+		}
+
+		public void setTimeDelta(long timeDelta) {
+			this.timeDelta = timeDelta;
+		}
+		
+		//end of getters/setters
+		
+		
+		//Comparisons
+		
+		/**
+		 * Compares two Calendar objects taking into account date only, i.e.
+		 * year, month, and day (without hour, minute, second, milis)
+		 * @param date1
+		 * @param date2
+		 * @return true if date1 is before date2; false otherwise
+		 */
+		public boolean beforeDate(DateTime date1, DateTime date2) {
+
+			if (date1 == null || date2 == null)
+				return false;
+			
+			if (date1.getYear() < date2.getYear())
+				return true;
+			if (date1.getYear() > date2.getYear())
+				return false;
+					
+			if (date1.getMonthOfYear() < date2.getMonthOfYear())
+				return true;
+			if (date1.getMonthOfYear() > date2.getMonthOfYear())
+				return false;
+			
+			if (date1.getDayOfMonth() < date2.getDayOfMonth())
+				return true;
+			if (date1.getDayOfMonth() > date2.getDayOfMonth())
+				return false;
+
+			return false;
+		}
+
+		
+		/**
+		 * Compares two Calendar objects taking into account date only, i.e.
+		 * year, month, and day (without hour, minute, second, milis)
+		 * @param date1
+		 * @param date2
+		 * @return true if dates are equal; false otherwise
+		 */
+		public boolean sameDate(DateTime date1, DateTime date2) {
+			
+			if (date1 == null || date2 == null)
+				return false;
+			
+			if (date1.getYear() != date2.getYear())
+				return false;
+			
+			if (date1.getMonthOfYear() != date2.getMonthOfYear())
+				return false;
+			
+			if (date1.getDayOfMonth() != date2.getDayOfMonth())
+				return false;
+
+			return true;
+		}
+
+		/**
+		 * Check whether one date is before another date. Only time is taken into account, i.e.
+		 * hour, minute, second, milis (without year, month, and day)
+		 * @param date1
+		 * @param date2
+		 * @return true if date1 is before date2
+		 */
+		public boolean beforeDayTime(DateTime date1, DateTime date2) {
+
+			if (date1 == null || date2 == null)
+				  return false;
+
+			if(date1.getHourOfDay() < date2.getHourOfDay())
+				return true;
+			if(date1.getHourOfDay() > date2.getHourOfDay())
+				return false;
+			
+			if(date1.getMinuteOfHour() < date2.getMinuteOfHour())
+				return true;
+			if(date1.getMinuteOfHour() > date2.getMinuteOfHour())
+				return false;
+			
+			if(date1.getSecondOfMinute() < date2.getSecondOfMinute())
+				return true;
+			if(date1.getSecondOfMinute() > date2.getSecondOfMinute())
+				return false;
+			
+			if(date1.getMillisOfSecond() < date2.getMillisOfSecond())
+				return true;
+			if(date1.getMillisOfSecond() > date2.getMillisOfSecond())
+				return false;
+			
+			return false;
+		}
+
+		/**
+		 * Check whether a period, whose length is equal duration, is before specific date. Only time is taken into account, i.e.
+		 * hour, minute, second, milis (without year, month, and day)
+		 * @param date1
+		 * @param duration - duration of a period to be checked
+		 * @param date2
+		 * @return true if date1 + duration is before date2
+		 */
+		public boolean beforeDayTime(DateTime date1, long duration, DateTime date2) {
+			if (date1 == null || date2 == null)
+				  return false;
+
+			date1 = date1.plus(duration + timeDelta);
+			
+			return beforeDate(date1, date2);
+		}
+
+		/**
+		 * Check whether dates are equal. Only time is taken into account, i.e.
+		 * hour, minute, second, milis (without year, month, and day)
+		 * @param date1
+		 * @param date2
+		 * @return true if dates are equal
+		 */
+		public boolean sameDayTime(DateTime date1, DateTime date2) {
+
+			if (date1 == null || date2 == null)
+				  return false;
+
+			if (date1.getMillisOfDay() != date2.getMillisOfDay())
+				return false;
+			
+			return true;
+		}
+		
+		/**
+		 * Check whether a period, whose length is equal duration, is after specific date. Only time is taken into account, i.e.
+		 * hour, minute, second, milis (without year, month, and day)
+		 * @param date1
+		 * @param date2
+		 * @return true if date1 is after date2
+		 */
+		public boolean afterDayTime(DateTime date1, DateTime date2) {
+			return beforeDayTime(date2, date1);
+		}
+
+		/**
+		 * Check whether a period, whose length is equal duration, is after specific date. Only time is taken into account, i.e.
+		 * hour, minute, second, milis (without year, month, and day)
+		 * @param date1
+		 * @param duration - duration of a period to be checked
+		 * @param date2
+		 * @return true if date1 + duration is after date2
+		 */
+		public boolean afterDayTime(DateTime date1, long duration, DateTime date2) {
+
+			if (date1 == null || date2 == null)
+				  return false;
+
+			date1 = date1.plus(duration + timeDelta);
+			
+			return afterDayTime(date1, date2);
+		}
+		
+		//end of comparisons
+		
+		//Operations on date and time
+
+		/**
+		 * Copy date from newDate DateTime object into date DateTime object.
+		 * Time (hour, minutes, seconds, milis) is not copied.
+		 * @return DateTime object representing new date
+		 */
+		public DateTime setDate(DateTime date, DateTime newDate) {
+			
+			if (date == null || newDate == null)
+				return date;
+			
+			return new DateTime(newDate.getYear(), 
+								newDate.getMonthOfYear(), 
+								newDate.getDayOfMonth(), 
+								date.getHourOfDay(), 
+								date.getMinuteOfHour(), 
+								date.getSecondOfMinute(), 
+								date.getMillisOfSecond());
+			
+		}
+		
+		
+		/**
+		 * Set time within a day from newTime Calendar object into date Calendar object.
+		 * Date (year, month, day) is not set.
+		 * @return Calendar object representing new time
+		 */
+		public DateTime setDayTime(DateTime date, DateTime newTime) {
+			
+			if (date == null || newTime == null)
+				return date;
+			
+			return new DateTime(date.getYear(),
+								date.getMonthOfYear(),
+								date.getDayOfMonth(),
+								newTime.getHourOfDay(),
+								newTime.getMinuteOfHour(),
+								newTime.getSecondOfMinute(),
+								newTime.getMillisOfSecond());
+			
+		}
+
+		//end of operations on date and time
+		
+		
+		//Operations on periods
+
+		/**
+		 * Calculate period duration in milis
+		 * @param start
+		 * @param end
+		 * @return period duration in milis
+		 */
+		public long periodDuration(DateTime start, DateTime end) {
+			
+			if (start == null || end == null)
+				  return 0;
+			
+			return end.getMillis() - start.getMillis();
+		}
+
+		/**
+		 * Calculate period duration in milis taking into account time only, i.e.
+		 * hour, minute, second, milis (without year, month, and day)
+		 * @param start
+		 * @param end
+		 * @return period duration in milis
+		 */
+		public long periodDayTimeDuration(DateTime start, DateTime end) {
+
+			if (start == null && end == null)
+				  return TWENTY_FOUR_HOURS;
+
+			if (start == null) {
+				start = new DateTime(end.getYear(),
+									end.getMonthOfYear(),
+									end.getDayOfMonth(),
+									0, 0, 0, 0);
+			}
+			
+			if (end == null) {
+				end = new DateTime(start.getYear(),
+									start.getMonthOfYear(),
+									start.getDayOfMonth(),
+									23, 59, 59, 999);
+			}	
+			
+			//setting the same date
+			DateTime newEnd = new DateTime(start.getYear(),
+											start.getMonthOfYear(),
+											start.getDayOfMonth(),
+											end.getHourOfDay(),
+											end.getMinuteOfHour(),
+											end.getSecondOfMinute(),
+											end.getMillisOfSecond()
+										);
+
+			if (beforeDayTime(start, newEnd))
+				return newEnd.getMillis() - start.getMillis();
+			else
+				return TWENTY_FOUR_HOURS - (start.getMillis() - newEnd.getMillis()); 
+		}
+		
+		/**
+		 * Check whether date is before given period. Only time is taken into account, i.e.
+		 * hour, minute, second, milis (without year, month, and day)
+		 * @param date - date to be checked
+		 * @param start - begin of period
+		 * @param end - end of period
+		 * @return true if date is before a period; false otherwise
+		 */
+		public boolean beforePeriodDayTime(DateTime date, DateTime start, DateTime end) {
+
+		  	if (date == null)
+		  		return false;
+
+		  	if (start == null)
+		  		return false;
+		  	
+		  	if (end == null)
+		  		return beforeDayTime(date, start);
+		  	
+		  	//date is not before start
+		  	if(!beforeDayTime(date, start))
+		  		return false;
+		  	
+		  	//end of period is next day
+		  	if(afterDayTime(start, end))
+		  		if(!afterDayTime(date, end))
+		  			return false;
+		  	
+		  	return true;
+		}
+		
+		/**
+		 * Check whether a period, whose length is given by duration, is within a period
+		 * defined by start and end. 
+		 * @param date - date to be checked
+		 * @param duration - duration of a period to be checked
+		 * @param start - begin of period
+		 * @param end - end of period
+		 * @return true if a period is within the period <start, end>; false otherwise
+		 */
+		public boolean withinPeriod(DateTime date, long duration, DateTime start, DateTime end) {
+
+			if (date == null)
+		  		return false;
+
+		  	if (start == null || end == null)
+		  		return true;
+		  
+		  	if (date.isBefore(start) || (date.getMillis() + duration + timeDelta > end.getMillis()))
+		  		  	return false;
+			
+		    return true;
+		}
+
+		/**
+		 * Check whether a period, whose length is given by duration, is within a period
+		 * defined by start and end. 
+		 * @param duration - duration of a period to be checked
+		 * @param start - begin of period
+		 * @param end - end of period
+		 * @return true if a period is within the period <start, end>; false otherwise
+		 */
+		public boolean withinPeriod(long duration, DateTime start, DateTime end) {
+
+		  	if (start == null || end == null)
+		  		return true;
+		  
+		  	if (start.getMillis() + duration + timeDelta > end.getMillis())
+		  		  	return false;
+			
+		    return true;
+		}
+		
+		/**
+		 * Check whether date is within a period
+		 * defined by start and end. Only time is taken into account, i.e.
+		 * hour, minute, second, milis (without year, month, and day)
+		 * @param date - date to be checked
+		 * @param start - begin of period
+		 * @param end - end of period
+		 * @return true if date is within the period <start, end>; false otherwise
+		 */
+		public boolean withinPeriodDayTime(DateTime date, DateTime start, DateTime end) {
+
+			if (date == null)
+		  		return false;
+
+		  	if (start == null && end == null)
+		  		return false;
+		  	
+		  	if (start == null)
+		  		return !afterDayTime(date, end);
+		  	
+		  	if (end == null)
+		  		return !beforeDayTime(date, start);
+
+		  	if (afterDayTime(start, end)){
+		  		if (beforeDayTime(date, start) && afterDayTime(date, end))
+		  		  	return false;
+		  	} 
+		  	else {
+		  		if (beforeDayTime(date, start) || afterDayTime(date, end))
+		  			return false;
+		  	}
+			
+		    return true;
+		}
+
+		/**
+		 * Check whether a period, whose length is given by duration, is within a period
+		 * defined by start and end. Only time is taken into account, i.e.
+		 * hour, minute, second, milis (without year, month, and day)
+		 * @param date - date to be checked
+		 * @param duration - duration of a period to be checked
+		 * @param start - begin of period
+		 * @param end - end of period
+		 * @return true if a period is within the period <start, end>; false otherwise
+		 */
+		public boolean withinPeriodDayTime(DateTime date, long duration, DateTime start, DateTime end) {
+
+			if (date == null)
+		  		return false;
+
+			if (start == null && end == null)
+				return true;
+			
+		  	if (start == null)
+		  		return !afterDayTime(date, duration, end);
+		  	
+		  	if (end == null)
+		  		return !beforeDayTime(date, duration, start);
+		  	
+		  	if (afterDayTime(start, end)){
+		  		if (beforeDate(date, start) && afterDayTime(date, duration, end))
+		  		  	return false;
+		  	}
+		  	else {
+		  		if (beforeDate(date, start) || afterDayTime(date, duration, end))
+		  			return false;
+		  	}
+			
+		    return true;
+		}
+
+		/**
+		 * Check whether a period, whose length is given by duration, overlaps a period
+		 * defined by start and end. Only time is taken into account, i.e.
+		 * hour, minute, second, milis (without year, month, and day)
+		 * @param date - date to be checked
+		 * @param duration - duration of a period to be checked
+		 * @param start - begin of period
+		 * @param end - end of period
+		 * @return true if a period overlaps with the period <start, end>; false otherwise
+		 */
+		public boolean overlapPeriodDayTime(DateTime date, long duration, DateTime start, DateTime end) {
+
+			if (date == null)
+		  		return false;
+
+			if (start == null && end == null)
+				return true;
+			
+			if (start == null)
+				return beforeDayTime(date, end);
+		  	
+		  	if (end == null)
+		  		return !beforeDayTime(date, duration, start);
+		  	
+		  	if (afterDayTime(start, end)){
+		  		if (!beforeDate(date, end) && !afterDayTime(date, duration, start))
+		  		  	return false;
+		  	} 
+		  	else {
+		  		if (!beforeDate(date, end) || !afterDayTime(date, duration, start))
+		  			return false;
+		  	}
+			
+		    return true;
+		}
+		
+		/**
+		 * Check whether date is after given period. Only time is taken into account, i.e.
+		 * hour, minute, second, milis (without year, month, and day)
+		 * @param date - date to be checked
+		 * @param start - begin of period
+		 * @param end - end of period
+		 * @return true if date is after a period; false otherwise
+		 */
+		public boolean afterPeriodDayTime(DateTime date, DateTime start, DateTime end) {
+
+			if (date == null)
+		  		return false;
+
+		  	if (end == null)
+		  		return false;
+		  	
+		  	if (start == null)
+		  		return afterDayTime(date, end);
+		  	
+		  	//date is not after end
+		  	if (!afterDayTime(date, end))
+		  		return false;
+		  	
+		  	//end of period is next day
+		  	if (afterDayTime(start, end))
+		  		if (!beforeDate(date, start))
+		  		  	return false;
+
+		  	return true;
+		}
+
+		//end of operations on periods
+		
+		
+		//Operations on lists of dates
+
+		/**
+		 * Find date in list of dates
+		 * @param date - date to be found
+		 * @param days - Vector containing Calendar objects
+		 * @return true if data is found; false otherwise
+		 */
+		public boolean findDate(DateTime date, ArrayList<DateTime> days) {
+		    
+		    if (days == null)
+		      return false;
+			  
+		    for (int i=0; i < days.size(); i++) {
+		      DateTime vDate = days.get(i);
+			      
+		      if (!sameDate(date, vDate))
+		    	  continue;
+			    	  
+		      return true;
+		    }
+			    
+		    return false;
+		  }
+
+		  /**
+		   * Find the latest date in inclDates that is not found in exclDates
+		   * @param inclDates
+		   * @param exclDates
+		   * @return the latest date
+		   */
+		  public DateTime findLatestDate(ArrayList <DateTime>inclDates, ArrayList<DateTime> exclDates) {
+			  	
+			  if (inclDates == null)
+				  return null;
+			  
+			  DateTime latest = new DateTime(); //Calendar.getInstance();
+			  
+			  for (int i=0; i < inclDates.size(); i++)
+				if (beforeDate(latest, inclDates.get(i)))
+					if (!findDate(inclDates.get(i), exclDates))
+						latest = inclDates.get(i);
+					
+			  return latest;
+		  }
+		  
+		//end of operations on lists of dates
+		  
+		/**
+		 * Get DateTime object representing current time
+		 * This method can be overloaded to return logic time, e.g. in simulations
+		 * @return current time
+		 */
+		public DateTime getTime() {
+			return new DateTime();
+		}
+
+}
+
Index: DCWoRMS/trunk/src/schedframe/scheduling/plugin/local/ResourceAllocationInterface.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/plugin/local/ResourceAllocationInterface.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/plugin/local/ResourceAllocationInterface.java	(revision 477)
@@ -0,0 +1,33 @@
+package schedframe.scheduling.plugin.local;
+
+import java.util.Map;
+
+import schedframe.resources.units.ResourceUnit;
+import schedframe.resources.units.ResourceUnitName;
+
+public interface ResourceAllocationInterface {
+	
+	/**
+	 * Allocates resource units( marks as used) on the basis of given resource
+	 * units.
+	 * 
+	 * @param freeRes
+	 *            resource units to be consumed
+	 */
+	public boolean allocateResources(Map<ResourceUnitName, ResourceUnit> freeRes);
+
+	/**
+	 * Frees given resource units.
+	 * 
+	 * @param lastUsedResources
+	 *            resource units to be free
+	 */
+	public void freeResources(Map<ResourceUnitName, ResourceUnit> lastUsedResources);
+	
+	//public void allocateProcessors(Map<ResourceParameterName, ResourceUnit> freeRes);
+	
+
+	//public void clearPendingProcessors(List<Resource> choosenResources);
+	
+
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/plugin/local/LocalSchedulingPlugin.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/plugin/local/LocalSchedulingPlugin.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/plugin/local/LocalSchedulingPlugin.java	(revision 477)
@@ -0,0 +1,19 @@
+package schedframe.scheduling.plugin.local;
+
+import schedframe.events.scheduling.SchedulingEvent;
+import schedframe.events.scheduling.SchedulingResponseType;
+import schedframe.scheduling.manager.resources.ResourceManager;
+import schedframe.scheduling.manager.tasks.JobRegistryImpl;
+import schedframe.scheduling.plugin.SchedulingPlugin;
+import schedframe.scheduling.plugin.grid.ModuleList;
+import schedframe.scheduling.queue.TaskQueueList;
+
+
+public interface LocalSchedulingPlugin extends SchedulingPlugin {
+
+	public SchedulingResponseType handleResourceAllocationViolation(SchedulingEvent event,
+					TaskQueueList queues, 
+					JobRegistryImpl jobRegistry, 
+					ResourceManager resourceManager, ModuleList modules);
+
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/policy/global/GlobalManagementSystem.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/policy/global/GlobalManagementSystem.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/policy/global/GlobalManagementSystem.java	(revision 477)
@@ -0,0 +1,302 @@
+package schedframe.scheduling.policy.global;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.exolab.castor.types.Duration;
+import org.joda.time.DateTime;
+import org.joda.time.DateTimeUtilsExt;
+import org.qcg.broker.schemas.schedulingplan.types.AllocationStatus;
+
+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.WorkloadUnitHandler;
+import schedframe.scheduling.WorkloadUnitListImpl;
+import schedframe.scheduling.plan.AllocationInterface;
+import schedframe.scheduling.plan.ScheduledTaskInterface;
+import schedframe.scheduling.plan.SchedulingPlanInterface;
+import schedframe.scheduling.plugin.SchedulingPlugin;
+import schedframe.scheduling.plugin.estimation.ExecutionTimeEstimationPlugin;
+import schedframe.scheduling.policy.AbstractManagementSystem;
+import schedframe.scheduling.queue.TaskQueueList;
+import schedframe.scheduling.tasks.AbstractProcesses;
+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;
+
+public class GlobalManagementSystem extends AbstractManagementSystem {
+
+	private static Log log = LogFactory.getLog(GlobalManagementSystem.class);
+
+	public GlobalManagementSystem(String providerId, String entityName, SchedulingPlugin schedPlugin,
+			ExecutionTimeEstimationPlugin execTimeEstimationPlugin, TaskQueueList queues)
+			throws Exception {
+		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");
+		}
+		
+		this.schedulingPlugin =  schedPlugin;
+	}
+
+	public void processEvent(Sim_event ev) {
+
+		int tag = ev.get_tag();
+		switch (tag) {
+
+		case WormsTags.TIMER:
+			if (pluginSupportsEvent(WormsTags.TIMER)) {
+				TimerEvent event = new  TimerEvent();
+				SchedulingPlanInterface decision =  schedulingPlugin.schedule(event, 
+						queues,  getJobRegistry(), getResourceManager(), moduleList);
+				executeSchedulingPlan(decision);
+			}
+			sendTimerEvent();
+			break;
+		}
+	}
+	
+	public void notifySubmittedWorkloadUnit(WorkloadUnit<?> wu, boolean ack) {
+		if (!pluginSupportsEvent(GridSimTags.GRIDLET_SUBMIT)) {
+			log.error("Plugin " + schedulingPlugin.getClass()
+					+ " does not provide support for TASK_ARRIVED event.\n"
+					+ "Check plugin configuration or use default one.");
+			return;
+		}
+		
+		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());*/
+
+	}
+	
+	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;
+
+			executeSchedulingPlan(decision);
+
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+	}
+	
+	public void notifyReturnedWorkloadUnit(WorkloadUnit<?> wu) {
+		Executable exec = (Executable) wu;
+
+		long duration = Double.valueOf(exec.getFinishTime() - exec.getExecStartTime()).longValue();
+		log.debug("Executable " + exec.getJobId() + "_" + exec.getId() + "\nstart time:  " + 
+				new java.util.Date(Double.valueOf(exec.getExecStartTime()).longValue() * 1000) 
+		+ "\nfinish time: " + new java.util.Date(Double.valueOf(exec.getFinishTime()).longValue() * 1000)
+		+ "\nduration: " + new Duration(duration * 1000));
+		
+		try {
+			Job job = jobRegistry.get(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 {
+				List<AbstractProcesses> processesList = task.getProcesses();
+				for(int i = 0; i < processesList.size(); i++){
+					AbstractProcesses processes = processesList.get(i);
+					if(processes.getId().equals(exec.getProcessesId())){
+						processes.setStatus(exec.getStatus());
+						break;
+					}
+				}
+			}*/
+			
+			if(job.isFinished()){
+				scheduler.send(job.getSenderId(), GridSimTags.SCHEDULE_NOW, GridSimTags.GRIDLET_RETURN, job);
+			}
+			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());*/
+			}
+			
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+
+	}
+
+	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();
+		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) {
+
+		String providerName = allocation.getProviderName();
+		if (providerName == null) {
+			return;
+		}
+		TaskInterface<?> task = (TaskInterface<?>) job;
+		removeFromQueue(task);
+		
+		int resID = GridSim.getEntityId(providerName);
+		IO_data data = new IO_data(job, 0, resID);
+		scheduler.send(scheduler.getOutputPort(), GridSimTags.SCHEDULE_NOW, GridSimTags.GRIDLET_SUBMIT, data);	
+		
+		//scheduler.send(providerName, GridSimTags.SCHEDULE_NOW, GridSimTags.GRIDLET_SUBMIT, job);			
+		if(log.isDebugEnabled())
+			log.debug("Submitted job " + job.getId() + " to " + providerName);
+
+	}
+
+	class GlobalWorkloadUnitHandler implements  WorkloadUnitHandler{
+
+		public void handleJob(Job job){
+
+			jobRegistry.addJob(job);
+			if (log.isInfoEnabled())
+				log.info("Received job " + job.getId() + " at " + new DateTime(DateTimeUtilsExt.currentTimeMillis()));
+
+			scheduleReadyTasks(job);
+		}
+		
+		public void handleTask(TaskInterface<?> task) {
+			throw new RuntimeException("Not implemented since it isn't expected that tasks are send directly to the global scheduler.");
+		}
+
+		public void handleExecutable(ExecTask task) {
+			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.");
+		}
+	}
+
+	public WorkloadUnitHandler getWorkloadUnitHandler() {
+		return new GlobalWorkloadUnitHandler();
+	}
+	
+
+
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/policy/global/GridBroker.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/policy/global/GridBroker.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/policy/global/GridBroker.java	(revision 477)
@@ -0,0 +1,67 @@
+package schedframe.scheduling.policy.global;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import schedframe.scheduling.GridResourceDiscovery;
+import schedframe.scheduling.Scheduler;
+import schedframe.scheduling.manager.resources.ManagedResources;
+import schedframe.scheduling.plugin.SchedulingPlugin;
+import schedframe.scheduling.plugin.estimation.ExecutionTimeEstimationPlugin;
+import schedframe.scheduling.plugin.grid.ModuleListImpl;
+import schedframe.scheduling.queue.TaskQueueList;
+
+public class GridBroker extends GlobalManagementSystem { 
+
+	
+	private static Log log = LogFactory.getLog(GridBroker.class);
+
+	protected Set<Integer> otherGridSchedulersIds;
+
+
+	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);
+	}
+
+	public List<Integer> getMyGridResources() {
+		List<Integer> providerIds = new ArrayList<Integer>();
+		for(Scheduler sched: scheduler.getChildren()){
+			providerIds.add(sched.get_id());
+		}
+		return providerIds;
+		//return GridSim.getGridResourceList();
+	}
+
+	public void addOtherGridSchedulerId(int id){
+		otherGridSchedulersIds.add(id);
+	}
+	
+
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/policy/ManagementSystem.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/policy/ManagementSystem.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/policy/ManagementSystem.java	(revision 477)
@@ -0,0 +1,15 @@
+package schedframe.scheduling.policy;
+
+import schedframe.Plugin;
+
+public interface ManagementSystem {
+
+	public Plugin getPlugin();
+	
+	public void notifySubmittedTask();
+	
+	public void notifyCanceledTask();
+	
+	public void notifyReturnedTask();
+
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/policy/AbstractManagementSystem.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/policy/AbstractManagementSystem.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/policy/AbstractManagementSystem.java	(revision 477)
@@ -0,0 +1,265 @@
+package schedframe.scheduling.policy;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.joda.time.DateTimeUtilsExt;
+
+import schedframe.PluginConfiguration;
+import schedframe.events.scheduling.SchedulingEventType;
+import schedframe.resources.units.StandardResourceUnitName;
+import schedframe.scheduling.Scheduler;
+import schedframe.scheduling.WorkloadUnitHandler;
+import schedframe.scheduling.manager.resources.ManagedResources;
+import schedframe.scheduling.manager.resources.ResourceManager;
+import schedframe.scheduling.manager.resources.ResourceManagerFactory;
+import schedframe.scheduling.manager.tasks.JobRegistryImpl;
+import schedframe.scheduling.manager.tasks.JobRegistry;
+import schedframe.scheduling.plan.AllocationInterface;
+import schedframe.scheduling.plan.SchedulingPlanInterface;
+import schedframe.scheduling.plugin.SchedulingPlugin;
+import schedframe.scheduling.plugin.estimation.ExecutionTimeEstimationPlugin;
+import schedframe.scheduling.plugin.grid.ModuleList;
+import schedframe.scheduling.plugin.local.ResourceAllocationInterface;
+import schedframe.scheduling.queue.TaskQueue;
+import schedframe.scheduling.queue.TaskQueueList;
+import schedframe.scheduling.tasks.Job;
+import schedframe.scheduling.tasks.WorkloadUnit;
+import simulator.WormsConstants;
+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;
+
+public abstract class AbstractManagementSystem {
+
+	private Log log = LogFactory.getLog(AbstractManagementSystem.class);
+	
+	protected String name;
+
+	protected ResourceManager resourceManager;
+
+	protected TaskQueueList queues;
+
+	protected SchedulingPlugin schedulingPlugin;
+
+	protected ExecutionTimeEstimationPlugin execTimeEstimationPlugin;
+
+	protected ModuleList moduleList;
+	
+	protected JobRegistryImpl jobRegistry;
+	
+
+	public AbstractManagementSystem(String providerId, String entityName,
+			ExecutionTimeEstimationPlugin execTimeEstPlugin, TaskQueueList queues) {
+		
+		this.name = entityName + "@" + providerId;
+		this.queues = queues;
+		this.jobRegistry = new JobRegistryImpl(name);
+		this.execTimeEstimationPlugin = execTimeEstPlugin;
+	}
+	
+	public void processEvent(Sim_event ev) {
+		processOtherEvent(ev);
+	}
+
+	protected void processOtherEvent(Sim_event ev) {
+		if (ev == null) {
+			System.out.println(name + ".processOtherEvent(): " + "Error - an event is null.");
+			return;
+		}
+
+		log.error(name + ".processOtherEvent(): Unable to "
+				+ "handle request from an event with a tag number " + ev.get_tag());
+	}
+	
+	public String getName() {
+		return name;
+	}
+
+	public PluginConfiguration getSchedulingPluginConfiguration() {
+		return schedulingPlugin.getConfiguration();
+	}
+	
+	public ResourceManager getResourceManager() {
+		if (resourceManager instanceof ResourceManager)
+			return (ResourceManager) resourceManager;
+		else
+			return null;
+	}
+
+	public ResourceAllocationInterface getAllocationManager() {
+		if (resourceManager instanceof ResourceAllocationInterface)
+			return (ResourceAllocationInterface) resourceManager;
+		else
+			return null;
+	}
+
+	protected JobRegistry getJobRegistry(){
+		return jobRegistry;
+	}
+
+	public boolean pluginSupportsEvent(int eventType){
+		return true;
+	}
+
+	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);
+
+
+
+	//POPRAWIC  (ale co? bo teraz chyba jest ok)
+	protected void submitWorkloadUnit(WorkloadUnit<?> wu, 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) {
+		
+		Executable exec = (Executable) wu;
+		if(scheduler.getParent() == null)
+		{
+			Job job = jobRegistry.get(exec.getJobId());
+
+			if(job.isFinished()){
+				scheduler.send(job.getSenderId(), GridSimTags.SCHEDULE_NOW, GridSimTags.GRIDLET_RETURN, job);
+				return true;
+			}
+			else return true;
+		}
+	
+        IO_data obj = new IO_data(exec, 0, /*task.getGridletOutputSize(),*/ GridSim.getEntityId(scheduler.getParent().get_name()));
+        scheduler.send(scheduler.getOutputPort(), 0.0, GridSimTags.GRIDLET_RETURN, obj);
+		return true;
+	}
+
+	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;
+		try {
+			long expectedStartTime = exec.getExecutionStartTime().getMillis() / 1000;
+			long currentTime = DateTimeUtilsExt.currentTimeMillis() / 1000;
+			delay = expectedStartTime - currentTime;
+			if (delay < 0)
+				delay = 0;
+		} catch (NoSuchFieldException e) {
+			delay = 0;
+		}
+
+		scheduler.sendInternal(Long.valueOf(delay).doubleValue(), WormsTags.TASK_READY_FOR_EXECUTION,
+				exec);
+	}
+	
+	protected void sendTimerEvent() {
+		PluginConfiguration pluginConfig = schedulingPlugin.getConfiguration();
+		if (pluginConfig != null) {
+			Map<SchedulingEventType, Object> events = pluginConfig.getServedEvents();
+			if (events != null) {
+				Object obj = events.get(SchedulingEventType.TIMER);
+				if (obj != null) {
+					int delay = (Integer) obj;
+					scheduler.sendInternal(delay, WormsTags.TIMER, null);
+				}
+			}
+		}
+	}
+	
+	protected boolean removeFromQueue(WorkloadUnit<?> wu) {
+		for(TaskQueue queue : queues){
+			if(queue.contains(wu)){
+				queue.remove(wu);
+				return true;
+			}
+		}
+		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();
+
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/policy/local/LocalManagementSystem.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/policy/local/LocalManagementSystem.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/policy/local/LocalManagementSystem.java	(revision 477)
@@ -0,0 +1,749 @@
+package schedframe.scheduling.policy.local;
+
+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 java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+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.joda.time.DateTimeUtilsExt;
+import org.qcg.broker.schemas.schedulingplan.types.AllocationStatus;
+
+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;
+import schedframe.exceptions.ResourceException;
+import schedframe.resources.computing.ComputingResource;
+import schedframe.resources.computing.profiles.energy.EnergyEvent;
+import schedframe.resources.computing.profiles.energy.EnergyEventType;
+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.UsedResourceList;
+import schedframe.scheduling.WorkloadUnitHandler;
+import schedframe.scheduling.WorkloadUnitListImpl;
+import schedframe.scheduling.manager.resources.LocalResourceManager;
+import schedframe.scheduling.manager.resources.ManagedResources;
+import schedframe.scheduling.manager.resources.ResourceManager;
+import schedframe.scheduling.plan.AllocationInterface;
+import schedframe.scheduling.plan.ScheduledTaskInterface;
+import schedframe.scheduling.plan.SchedulingPlanInterface;
+import schedframe.scheduling.plugin.SchedulingPlugin;
+import schedframe.scheduling.plugin.estimation.ExecutionTimeEstimationPlugin;
+import schedframe.scheduling.plugin.grid.ModuleListImpl;
+import schedframe.scheduling.plugin.grid.ModuleType;
+import schedframe.scheduling.policy.AbstractManagementSystem;
+import schedframe.scheduling.queue.TaskQueueList;
+import schedframe.scheduling.tasks.AbstractProcesses;
+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.utils.DoubleMath;
+
+public class LocalManagementSystem extends AbstractManagementSystem {
+
+	private Log log = LogFactory.getLog(LocalManagementSystem.class);
+
+	protected double lastUpdateTime;
+
+	protected Accumulator accTotalLoad;
+
+	public LocalManagementSystem(String providerId, String entityName, SchedulingPlugin schedPlugin,
+			ExecutionTimeEstimationPlugin execTimeEstimationPlugin, TaskQueueList queues)
+			throws Exception {
+
+		super(providerId, entityName, execTimeEstimationPlugin, queues);
+
+		//schedulingPlugin = (LocalSchedulingPlugin) InstanceFactory.createInstance(schedulingPluginClassName, LocalSchedulingPlugin.class);
+		
+		if (schedPlugin == null) {
+			throw new Exception("Can not create local scheduling plugin instance.");
+		}
+		this.schedulingPlugin =  schedPlugin;
+		accTotalLoad = new Accumulator();
+		moduleList = new ModuleListImpl(1);
+
+	}
+
+	public void init(Scheduler sched, ManagedResources managedResources) {
+		super.init(sched, managedResources);
+		//scheduler = sched;
+		//resourceManager = ResourceManagerFactory.createResourceManager(scheduler);
+		double load = 0;
+		accTotalLoad.add(load);
+	}
+
+	public void processEvent(Sim_event ev) {
+
+		updateProcessingProgress();
+
+		int tag = ev.get_tag();
+		Object obj;
+
+		switch (tag) {
+
+		case WormsTags.TIMER:
+			if (pluginSupportsEvent(tag)) {
+				SchedulingEvent event = new SchedulingEvent(SchedulingEventType.TIMER);
+				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);
+				if (pluginSupportsEvent(tag)) {
+					SchedulingEvent event = new StartTaskExecutionEvent(data.getJobId(), data.getId());
+					SchedulingPlanInterface decision =  schedulingPlugin.schedule(event,
+							queues,  getJobRegistry(), getResourceManager(), moduleList);
+					executeSchedulingPlan(decision);
+				}
+			} catch (Exception e) {
+				e.printStackTrace();
+			}
+			break;
+
+		case WormsTags.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));
+				}
+				SubTaskFilter filter = new SubTaskFilter(task.getGridletID(), GssimTags.TASK_REQUESTED_TIME_EXPIRED);
+				scheduler.sim_cancel(filter, null);
+				super.sendFinishJob((Executable) task.getGridlet());*/
+			}
+			if (pluginSupportsEvent(tag)) {
+				SchedulingEvent event = new TaskFinishedEvent(task.getJobId(), task.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:
+			updateProcessingTimes(ev);
+			break;
+		}
+	}
+	
+
+	public void notifyReturnedWorkloadUnit(WorkloadUnit<?> wu) {
+		if (pluginSupportsEvent(WormsTags.TASK_EXECUTION_FINISHED)) {
+			SchedulingEvent event = new SchedulingEvent(SchedulingEventType.TASK_FINISHED);
+			SchedulingPlanInterface decision =  schedulingPlugin.schedule(event,
+					queues, getJobRegistry(), getResourceManager(), moduleList);
+			executeSchedulingPlan(decision);
+		}
+		//if(scheduler.getParent() != null){
+			sendFinishedWorkloadUnit(wu);
+		//}
+	}
+
+	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();
+		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;
+				}
+
+				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;
+		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, task, choosenResources, completionPercentage)).intValue();
+		log.debug(task.getJobId() + "_" + task.getId() + " starts executing on " + new DateTime()
+				+ " will finish after " + time);
+
+		if (time < 0.0)
+			return;
+
+		submittedTask.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);
+
+		try {
+			long expectedDuration = submittedTask.getExpectedDuration().getMillis() / 1000;
+			scheduler.sendInternal(expectedDuration, WormsTags.TASK_REQUESTED_TIME_EXPIRED, submittedTask);
+		} 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()));
+		
+		PEUnit peUnit = (PEUnit)choosenResources.get(StandardResourceUnitName.PE);
+		if(peUnit instanceof ProcessingElements){
+			ProcessingElements pes = (ProcessingElements) peUnit;
+			for (ComputingResource resource : pes) {
+				resource.handleEvent(new EnergyEvent(EnergyEventType.TASK_FINISHED, submittedTask));
+			}
+		} else {
+			ComputingResource resource = null;
+			try {
+				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));
+		}*/
+
+		/*for(ExecTaskInterface etask : jobRegistry.getRunningTasks()){
+			System.out.println(etask.getJobId());
+			for(String taskId: etask.getVisitedResources())
+				System.out.println("====="+taskId);
+		}*/
+	}
+	
+	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);
+		scheduler.sim_cancel(filter, null);
+		
+		Executable executable = (Executable) subTask.getGridlet();
+		Job job = jobRegistry.get(executable.getJobId());
+
+		Task task = null;
+		try {
+			task = job.getTask(executable.getTaskId());
+		} catch (NoSuchFieldException e) {
+			e.printStackTrace();
+		}
+		if(executable.getProcessesId() == null){
+			try {
+				task.setStatus(executable.getStatus());
+			} catch (Exception e) {
+				e.printStackTrace();
+			}
+		} else {
+			List<AbstractProcesses> processesList = task.getProcesses();
+			for(int i = 0; i < processesList.size(); i++){
+				AbstractProcesses processes = processesList.get(i);
+				if(processes.getId().equals(executable.getProcessesId())){
+					processes.setStatus(executable.getStatus());
+					break;
+				}
+			}
+		}
+		//sendFinishedWorkloadUnit(executable);
+	}
+	
+	protected void updateProcessingProgress() {
+		double timeSpan = DoubleMath.subtract(Sim_system.clock(), lastUpdateTime);
+		if (timeSpan <= 0.0) {
+			// don't update when nothing changed
+			return;
+		}
+		lastUpdateTime = Sim_system.clock();
+		Iterator<ExecTask> iter = jobRegistry.getRunningTasks().iterator();
+		while (iter.hasNext()) {
+			ExecTask task = iter.next();
+			SubmittedTask subTask = (SubmittedTask)task;
+			UsedResourceList<ResourceHistoryItem> usedResourcesList = subTask.getUsedResources();
+			ResourceUnit unit = usedResourcesList.getLast().getResourceUnits()
+					.get(StandardResourceUnitName.PE);
+
+			double load = getMIShare(timeSpan, (PEUnit) unit);
+			subTask.updateGridletFinishedSoFar(load);
+			addTotalLoad(load);
+		}
+	}
+
+	private double getMIShare(double timeSpan, PEUnit pes) {
+		double localLoad;
+		ResourceCalendar resCalendar = (ResourceCalendar) moduleList.getModule(ModuleType.RESOURCE_CALENDAR);
+		if (resCalendar == null)
+			localLoad = 0;
+		else
+			// 1 - localLoad_ = available MI share percentage
+			localLoad = resCalendar.getCurrentLoad();
+
+		int speed = pes.getSpeed();
+		int cnt = pes.getAmount();
+
+		double totalMI = speed * cnt * timeSpan * (1 - localLoad);
+		return totalMI;
+	}
+
+	protected void updateProcessingTimes(Sim_event ev) {
+		updateProcessingProgress();
+		for (ExecTask task : jobRegistry.getRunningTasks()) {
+			SubmittedTask subTask = (SubmittedTask)task;
+			List<String> visitedResource = subTask.getVisitedResources();
+			String originResource = ev.get_data().toString();
+			if(!ArrayUtils.contains(visitedResource.toArray(new String[visitedResource.size()]), originResource)){
+				continue;
+			}
+			
+			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), 
+					task, choosenResources, completionPercentage);
+
+			/*if(!subTask.getVisitedResources().contains(ev.get_data().toString())) {
+				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);
+			scheduler.sim_cancel(filter, null);
+			scheduler.sendInternal(time, WormsTags.TASK_EXECUTION_FINISHED, task);
+
+		}
+	}	
+
+	public double calculateTotalLoad(int size) {
+		// background load, defined during initialization
+		double load;
+		ResourceCalendar resCalendar = (ResourceCalendar) moduleList.getModule(ModuleType.RESOURCE_CALENDAR);
+		if (resCalendar == null)
+			load = 0;
+		else
+			load = resCalendar.getCurrentLoad();
+
+		int numberOfPE = 0;
+		try {
+			for(ResourceUnit resUnit : getResourceManager().getPE()){
+				numberOfPE = numberOfPE + resUnit.getAmount();
+			}
+			//numberOfPE = getResourceManager().getPE().size();
+		} catch (Exception e) {
+			numberOfPE = 1;
+		}
+		double tasksPerPE = (double) size / numberOfPE;
+		load += Math.min(1.0 - load, tasksPerPE);
+
+		return load;
+	}
+
+	public Accumulator getTotalLoad() {
+		return accTotalLoad;
+	}
+
+	protected void addTotalLoad(double load) {
+		accTotalLoad.add(load);
+	}
+	
+	private Map<ResourceUnitName, ResourceUnit> chooseResourcesForExecution(String resourceName,
+			ExecTask task) {
+
+		ResourceManager resourceManager = this.resourceManager;
+		if(resourceName != null){
+			ComputingResource resource = null;
+			try {
+				resource = resourceManager.getResourceByName(resourceName);
+			} catch (ResourceException e) {
+				return null;
+			}
+
+			resourceManager = new LocalResourceManager(resource);
+		}
+		Map<ResourceUnitName, ResourceUnit> map = new HashMap<ResourceUnitName, ResourceUnit>();
+
+
+		int cpuRequest;
+		try {
+			cpuRequest = Double.valueOf(task.getCpuCntRequest()).intValue();
+		} catch (NoSuchFieldException e) {
+			cpuRequest = 1;
+		}
+
+		//PEUnit processingUnits = null;
+		if (cpuRequest != 0) {
+			
+			List<ResourceUnit> availableUnits = null;
+			try {
+				availableUnits = getResourceManager().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);
+				if(peUnit.getFreeAmount() > 0){
+					int  allocPE = Math.min(peUnit.getFreeAmount(), cpuRequest);
+					cpuRequest = cpuRequest - allocPE;
+					choosenPEUnits.add(peUnit.replicate(allocPE));	
+				}	
+			}
+			
+			if(cpuRequest > 0){
+				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) {
+		updateProcessingProgress();
+		registerWorkloadUnit(job);
+	}
+
+	private void registerWorkloadUnit(WorkloadUnit<?> wu){
+		if(!wu.isRegistered()){
+			wu.register(jobRegistry);
+		}
+		wu.accept(getWorkloadUnitHandler());
+	}
+	
+	class LocalWorkloadUnitHandler implements WorkloadUnitHandler{
+		
+		public void handleJob(Job job){
+
+			if (log.isInfoEnabled())
+				log.info("Received job " + job.getId() + " at " + new DateTime(DateTimeUtilsExt.currentTimeMillis()));
+
+			List<JobInterface<?>> jobsList = new ArrayList<JobInterface<?>>();
+			jobsList.add(job);
+			WorkloadUnitListImpl readyTasks = new WorkloadUnitListImpl();
+			for(Task task: jobRegistry.getReadyTasks(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){
+				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());
+					registerWorkloadUnit(exec);
+				}
+			}
+		}
+		
+		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());
+			Scheduler parentScheduler = scheduler.getParent();
+			while (parentScheduler != null && !exec.getVisitedResources().contains(parentScheduler.get_name())) {
+				exec.visitResource(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) {
+				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);
+			}
+		}
+	}
+
+	public WorkloadUnitHandler getWorkloadUnitHandler() {
+		return new LocalWorkloadUnitHandler();
+	}
+	
+	
+	public LocalResourceManager getResourceManager() {
+		if (resourceManager instanceof ResourceManager)
+			return (LocalResourceManager) resourceManager;
+		else
+			return null;
+	}
+	
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/WorkloadUnitHandler.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/WorkloadUnitHandler.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/WorkloadUnitHandler.java	(revision 477)
@@ -0,0 +1,17 @@
+package schedframe.scheduling;
+
+import schedframe.scheduling.tasks.Job;
+import schedframe.scheduling.tasks.SubmittedTask;
+import schedframe.scheduling.tasks.TaskInterface;
+import gssim.schedframe.scheduling.ExecTask;
+
+public 	interface WorkloadUnitHandler{
+	
+	public void handleJob(Job job);
+	
+	public void handleTask(TaskInterface<?> task);
+	
+	public void handleExecutable(ExecTask task);
+	
+	public void handleSubmittedTask(SubmittedTask task);
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/Cluster.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/Cluster.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/Cluster.java	(revision 477)
@@ -0,0 +1,41 @@
+package schedframe.scheduling;
+
+import java.util.List;
+import java.util.Map;
+
+import schedframe.resources.ResourceType;
+import schedframe.resources.providers.LocalSystem;
+import schedframe.resources.units.ResourceUnit;
+import schedframe.resources.units.ResourceUnitName;
+import schedframe.scheduling.manager.resources.ManagedResources;
+import schedframe.scheduling.policy.AbstractManagementSystem;
+import eduni.simjava.Sim_event;
+import gridsim.GridSimTags;
+import gridsim.IO_data;
+import gridsim.gssim.WormsTags;
+
+public class Cluster extends Scheduler{
+	
+	public Cluster(AbstractManagementSystem manSys, ResourceType schedType, ManagedResources managedResources) throws Exception {
+		super(manSys, schedType, managedResources);
+	}
+
+	protected void processOtherRequest(Sim_event ev) {
+		switch (ev.get_tag()) {
+		case WormsTags.QUERY_RESOURCE_DESC:
+			SchedulerDescription desc = new SchedulerDescription(new LocalSystem(get_name(), null, null));
+			Map<ResourceUnitName, List<ResourceUnit>> units = managementSystem.getResourceManager().getSharedResourceUnits();
+			desc.addResourceUnitList(units);
+			desc.addQueuesDescription(getQueuesDescription());
+
+			IO_data data = new IO_data(desc, 0, ev.get_src());
+			send(ev.get_src(), GridSimTags.SCHEDULE_NOW, WormsTags.QUERY_RESOURCE_DESC_RESULT, data);
+			break;
+
+		default:
+			managementSystem.processEvent(ev);
+			break;
+		}
+	}
+	
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/SchedulerDescription.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/SchedulerDescription.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/SchedulerDescription.java	(revision 477)
@@ -0,0 +1,64 @@
+package schedframe.scheduling;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import schedframe.resources.StandardResourceType;
+import schedframe.resources.computing.description.ExecutingResourceDescription;
+import schedframe.resources.providers.ResourceProvider;
+import schedframe.resources.units.AbstractResourceUnit;
+import schedframe.resources.units.ResourceUnit;
+import schedframe.resources.units.ResourceUnitName;
+import schedframe.scheduling.queue.QueueDescription;
+
+public class SchedulerDescription extends ExecutingResourceDescription{
+
+	protected ResourceProvider provider;
+	protected List<QueueDescription> accesQueues;
+
+	public SchedulerDescription(ResourceProvider provider){
+		super(StandardResourceType.ResourceProvider);
+		this.id = provider.getProviderId();
+		this.provider = provider;
+		this.resUnits = new HashMap<ResourceUnitName, List<ResourceUnit>>();
+		this.accesQueues = new ArrayList<QueueDescription>(1);
+	}
+	
+	public SchedulerDescription(String id){
+		super(StandardResourceType.ResourceProvider);
+		this.id = id;
+		this.provider = new ResourceProvider(id, null, null, null);
+		this.resUnits = new HashMap<ResourceUnitName, List<ResourceUnit>>();
+		this.accesQueues = new ArrayList<QueueDescription>(1);
+	}
+	
+	public void addQueueDescription(QueueDescription queue){
+		accesQueues.add(queue);
+	}
+	
+	public void addQueuesDescription(List<QueueDescription> queue){
+		accesQueues.addAll(queue);
+	}
+	
+	public List<QueueDescription> getAvailableQueues(){
+		return this.accesQueues;
+	}
+	
+	public void addResourceUnit(Map<ResourceUnitName, ResourceUnit> allUnits){
+		Iterator<ResourceUnit> itr = allUnits.values().iterator();
+		while(itr.hasNext()){
+			addResourceUnit(itr.next());
+		}
+	}
+	
+	public void addResourceUnitList(Map<ResourceUnitName, List<ResourceUnit>> allUnits){
+		this.resUnits.putAll(allUnits);
+	}
+
+	public ResourceProvider getProvider() {
+		return provider;
+	}
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/GridResourceDiscovery.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/GridResourceDiscovery.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/GridResourceDiscovery.java	(revision 477)
@@ -0,0 +1,162 @@
+package schedframe.scheduling;
+
+import eduni.simjava.Sim_event;
+import eduni.simjava.Sim_type_p;
+import gridsim.GridSimTags;
+import gridsim.IO_data;
+import gridsim.gssim.WormsTags;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+
+import schedframe.exceptions.ResourceException;
+import schedframe.resources.ResourceStatus;
+import schedframe.resources.ResourceType;
+import schedframe.resources.computing.ComputingResource;
+import schedframe.resources.providers.ResourceProvider;
+import schedframe.resources.units.ResourceUnit;
+import schedframe.resources.units.ResourceUnitName;
+import schedframe.scheduling.manager.resources.ResourceManager;
+import schedframe.scheduling.plugin.grid.ModuleType;
+import schedframe.scheduling.plugin.grid.ResourceDiscovery;
+import schedframe.scheduling.tasks.requirements.AbstractResourceRequirements;
+
+public class  GridResourceDiscovery implements ResourceManager, ResourceDiscovery {
+
+	protected Scheduler gridBroker;
+	
+	public GridResourceDiscovery(Scheduler broker){
+		this.gridBroker = broker;
+	}
+	
+	public List<String> getAdministrationDomains(SecurityContext secContext) {
+		throw new RuntimeException("Not implemented.");
+	}
+
+	public List<ResourceProvider> getProviders(SecurityContext secContext) {
+		throw new RuntimeException("Not implemented.");
+	}
+
+	public List<ResourceProvider> getProviders(String admDomain, SecurityContext secContext) {
+		throw new RuntimeException("Not implemented.");
+	}
+
+	public List<ResourceProvider> getProviders(
+			AbstractResourceRequirements<?> reqDesc, SecurityContext secContext) {
+		throw new RuntimeException("Not implemented.");
+	}
+	
+	public List<SchedulerDescription> getResources(
+			AbstractResourceRequirements<?> reqDesc, SecurityContext secContext) {
+		throw new RuntimeException("Not implemented.");
+	}
+
+	public List<SchedulerDescription> getResources(SecurityContext secContext) {
+		List <Scheduler> resourceList = gridBroker.getChildren();
+		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);
+		}
+		
+		//filter only the query response messages
+		Sim_type_p pred = new Sim_type_p(WormsTags.QUERY_RESOURCE_DESC_RESULT);
+		Sim_event ev = new Sim_event();
+		
+		List<SchedulerDescription> result = new ArrayList<SchedulerDescription>(resourceList.size());
+		for (int i = 0; i < resourceList.size(); ++i) {
+			gridBroker.sim_get_next(pred , ev);
+			IO_data ioData  = (IO_data) ev.get_data();
+			SchedulerDescription resDesc = (SchedulerDescription) ioData.getData();
+			result.add(resDesc);
+		} 
+		
+		return result;
+	}
+	
+	public List<SchedulerDescription> getResources() {
+
+		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);
+		}
+		
+		//filter only the query response messages
+		Sim_type_p pred = new Sim_type_p(WormsTags.QUERY_RESOURCE_DESC_RESULT);
+		Sim_event ev = new Sim_event();
+		
+		List<SchedulerDescription> result = new ArrayList<SchedulerDescription>(gridBroker.getChildren().size());
+		for (int i = 0; i < gridBroker.getChildren().size(); ++i) {
+			gridBroker.sim_get_next(pred , ev);
+			IO_data ioData  = (IO_data) ev.get_data();
+			SchedulerDescription resDesc = (SchedulerDescription) ioData.getData();
+			result.add(resDesc);
+		} 
+		
+		return result;
+	}
+
+	public List<Scheduler> getSchedulers() {
+		return gridBroker.getChildren();
+	}
+
+	@Override
+	public boolean areResourcesAchievable(ResourceType type) {
+		throw new UnsupportedOperationException("Not available at Grid level. Please use getResources() method instead to explore available resource providers");
+	}
+
+	@Override
+	public List<? extends ComputingResource> getResourcesOfType(ResourceType type) throws ResourceException {
+		throw new UnsupportedOperationException("Not available at Grid level. Please use getResources() method instead to explore available resource providers");
+	}
+
+	@Override
+	public ComputingResource getResourceByName(String resourceName) {
+		throw new UnsupportedOperationException("Not available at Grid level. Please use getResources() method instead to explore available resource providers");
+	}
+
+	@Override
+	public List<? extends ComputingResource> getResourcesByTypeWithStatus(ResourceType type, ResourceStatus status)
+			throws ResourceException {
+		throw new UnsupportedOperationException("Not available at Grid level. Please use getResources() method instead to explore available resource providers");
+	}
+
+	/*@Override
+	public ResourceCharacteristics getResourceCharacteristic() {
+		throw new UnsupportedOperationException("Not available at Grid level. Please use getResources() method instead to explore available resource providers");
+	}*/
+
+	@Override
+	public Map<ResourceUnitName, List<ResourceUnit>> getSharedResourceUnits() {
+		throw new UnsupportedOperationException("Not available at Grid level. Please use getResources() method instead to explore available resource providers");
+	}
+	
+	@Override
+	public List<ResourceUnit> getDistributedResourceUnits(ResourceUnitName unitName) {
+		throw new UnsupportedOperationException("Not available at Grid level. Please use getResources() method instead to explore available resource providers");
+	}
+	
+	@Override
+	public List<ComputingResource> filterResources(Properties properties) {
+		throw new UnsupportedOperationException("Not available at Grid level. Please use getResources() method instead to explore available resource providers");
+	}
+
+	@Override
+	public String getSchedulerName(String resourceName) {
+		throw new UnsupportedOperationException("Not available at Grid level. Please use getResources() method instead to explore available resource providers");
+	}
+
+	
+	public void dispose() {
+	}
+
+	public ModuleType getType() {
+		return ModuleType.RESOURCE_DISCOVERY;
+	}
+
+	public void init(Properties properties) {
+	}
+
+
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/ResourceHistoryItem.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/ResourceHistoryItem.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/ResourceHistoryItem.java	(revision 477)
@@ -0,0 +1,33 @@
+package schedframe.scheduling;
+
+import java.util.Map;
+
+import org.joda.time.DateTime;
+
+import schedframe.resources.units.ResourceUnit;
+import schedframe.resources.units.ResourceUnitName;
+
+public class ResourceHistoryItem {
+
+	protected Map<ResourceUnitName, ResourceUnit> usedResources;
+	protected DateTime timeStamp;
+	
+	/**
+	 * 
+	 * @param map hash map of resource units, which should be remembered
+	 * @param time the moment in time when this resource configuration was created  
+	 */
+	public ResourceHistoryItem(Map<ResourceUnitName, ResourceUnit> map, DateTime time){
+		this.usedResources = map;
+		this.timeStamp = time;
+	}
+	
+	public Map<ResourceUnitName, ResourceUnit> getResourceUnits(){
+		return usedResources;
+	}
+	
+	public DateTime getTimeStamp(){
+		return timeStamp;
+	}
+	
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/manager/tasks/JobRegistry.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/manager/tasks/JobRegistry.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/manager/tasks/JobRegistry.java	(revision 477)
@@ -0,0 +1,40 @@
+package schedframe.scheduling.manager.tasks;
+
+import gssim.schedframe.scheduling.ExecTask;
+
+import java.util.List;
+
+import schedframe.scheduling.tasks.JobInterface;
+import schedframe.scheduling.tasks.TaskInterface;
+
+
+public interface JobRegistry {
+
+	//public List<JobInterface<?>> getActiveJobs();
+
+	//public List<TaskInterface<?>> getActiveTasks();
+	
+	public JobInterface<?> getJobInfo(String jobId);
+
+	public TaskInterface<?> getTaskInfo(String jobId, String taskId);
+
+	
+	public List<ExecTask> getTasks(int status) ;
+
+	public List<ExecTask> getQueuedTasks() ;
+	
+	public List<ExecTask> getRunningTasks() ;
+	
+	public List<ExecTask> getReadyTasks() ;
+	
+	public List<ExecTask> getFinishedTasks();
+
+
+	//public List<SubmittedTask> getSubmittedTasks();
+	
+	public ExecTask getSubmittedTask(String jobId, String taskId);
+
+	
+	public List<? extends TaskInterface<?>> getReadyTasks(List<JobInterface<?>> jobsList);
+
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/manager/tasks/JobRegistryImpl.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/manager/tasks/JobRegistryImpl.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/manager/tasks/JobRegistryImpl.java	(revision 477)
@@ -0,0 +1,382 @@
+package schedframe.scheduling.manager.tasks;
+
+import gridsim.Gridlet;
+import gssim.schedframe.scheduling.ExecTask;
+import gssim.schedframe.scheduling.Executable;
+
+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 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.scheduling.tasks.JobInterface;
+import schedframe.scheduling.tasks.SubmittedTask;
+import schedframe.scheduling.tasks.Task;
+import simulator.WormsConstants;
+
+public class JobRegistryImpl extends AbstractJobRegistry {
+	
+	private static final long serialVersionUID = 8030555906990767342L;
+
+	private static Log log = LogFactory.getLog(JobRegistryImpl.class);
+
+	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>();
+
+	public JobRegistryImpl(String context_) {
+		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);
+			}
+			return true;
+		}
+		return false;
+	}
+
+	public List<ExecTask> getTasks(int status) {
+		List<ExecTask> taskList = new ArrayList<ExecTask>();
+		synchronized (submittedTasks)  {
+			for (ExecTask task: submittedTasks) {
+				if (task.getStatus() == status) {
+					//SubmittedTask subTask = (SubmittedTask) task;
+					List<String> visitedResource = task.getVisitedResources();
+					if(ArrayUtils.contains(visitedResource.toArray(new String[visitedResource.size()]), context)){
+						taskList.add(task);
+					}
+					/*if(subTask.getVisitedResources().contains(context)){
+						taskList.add(subTask);
+					}*/
+				}
+			}
+		}
+		return taskList;
+	}
+
+	public List<ExecTask> getQueuedTasks() {
+		return getTasks(Gridlet.QUEUED);
+	}
+	
+	public List<ExecTask> getRunningTasks() {
+		return getTasks(Gridlet.INEXEC);
+	}
+	
+	public List<ExecTask> getReadyTasks() {
+		return getTasks(Gridlet.READY);
+	}
+	
+	public List<ExecTask> getFinishedTasks() {
+		return getTasks(Gridlet.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) {
+					return task;
+				}
+			}
+		}
+		return null;
+	}
+	
+
+	@SuppressWarnings("unchecked")
+	public List<Task> getReadyTasks(List<JobInterface<?>> wuList) {
+		List<Task> readyTasks = new ArrayList<Task>();
+		List<Task> waitingTasks = new ArrayList<Task>();
+		
+		for(int i = 0; i < wuList.size(); i++){
+			JobInterface<?> wu  = (JobInterface<?>)wuList.get(i);
+			waitingTasks.addAll((List<Task>)wu.getTask());
+		}
+
+		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;
+	}
+
+
+	/**************************************/
+	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){
+		
+		/*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> readyTasks = new ArrayList<Task>();
+
+		int size = tasks.size();
+		for(int i = 0; i < size; i++){
+			int parCnt;
+			int previousTaskReadyCnt = 0;
+			Task task = tasks.get(i);
+			if(task.getStatus() != (int)BrokerConstants.TASK_STATUS_UNSUBMITTED)
+				continue;
+			try{		
+				parCnt = task.getDescription().getWorkflow().getParentCount();
+			} catch(Exception e){
+				parCnt = 0;
+				//e.printStackTrace();
+			}
+			if(parCnt == 0)
+			{
+				readyTasks.add(task);
+			}
+			else
+			{
+				for(int j = 0; j < parCnt; j++){
+					ParentType par = task.getDescription().getWorkflow().getParent(j);
+					if(par.getTriggerState().compareTo(TaskStatesName.FINISHED) == 0){
+						if(!checkTaskCompletion(task.getJobId(), par.getContent())){
+							break;
+						}
+					}
+					previousTaskReadyCnt++;
+				}
+				
+				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);
+			}
+		}		
+		return readyTasks;
+	}
+	
+	private boolean checkTaskCompletion(String jobID, String taskID){
+		JobInterface<?> job = getJobInfo(jobID);
+		try {
+			if(job.getTask(taskID).isFinished())
+				return true;
+		} catch (NoSuchFieldException e) {
+			//e.printStackTrace();
+		}
+		return false;
+	}
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/manager/tasks/AbstractJobRegistry.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/manager/tasks/AbstractJobRegistry.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/manager/tasks/AbstractJobRegistry.java	(revision 477)
@@ -0,0 +1,74 @@
+package schedframe.scheduling.manager.tasks;
+
+
+import java.util.concurrent.ConcurrentHashMap;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import schedframe.scheduling.tasks.Job;
+import schedframe.scheduling.tasks.JobInterface;
+import schedframe.scheduling.tasks.Task;
+import schedframe.scheduling.tasks.TaskInterface;
+
+
+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 AbstractJobRegistry(){
+		//log.warn("Methods from JobRegistry interface are not implemented.");
+	}
+	
+	public boolean addJob(JobInterface<?> job) {
+		jobs.put(job.getId(), (Job) job);
+		return true;
+	}
+
+	public boolean addTask(TaskInterface<?> task) {
+		if(jobs.containsKey(task.getJobId())){
+			jobs.get(task.getJobId()).add((Task)task);
+			return true;
+		} else {
+			return false;
+		}
+	}
+
+	public Job get(String jobId){
+		return jobs.get(jobId);
+	}
+	
+	public JobInterface<?> getJobInfo(String jobID) {
+		return jobs.get(jobID);
+	}
+
+	public TaskInterface<?> getTaskInfo(String jobID, String taskId) {
+		Task task = null;
+		Job job = jobs.get(jobID);
+		
+		if(job == null)
+			return null;
+		
+		try {
+			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 List<TaskInterface<?>> getActiveTasks() {
+		log.error("getActiveTasks() not implemented.");
+		return null;
+	}*/
+
+}
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 477)
@@ -0,0 +1,369 @@
+package schedframe.scheduling.manager.resources;
+
+import gridsim.GridSim;
+
+import java.util.ArrayDeque;
+import java.util.ArrayList;
+import java.util.Deque;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+import java.util.Stack;
+
+import schedframe.exceptions.ResourceException;
+import schedframe.resources.ResourceStatus;
+import schedframe.resources.ResourceType;
+import schedframe.resources.StandardResourceType;
+import schedframe.resources.computing.ComputingResource;
+import schedframe.resources.computing.ResourceCharacteristics;
+import schedframe.resources.computing.validator.ResourcePropertiesValidator;
+import schedframe.resources.computing.validator.ResourceValidator;
+import schedframe.resources.units.PEUnit;
+import schedframe.resources.units.ProcessingElements;
+import schedframe.resources.units.ResourceUnit;
+import schedframe.resources.units.ResourceUnitName;
+import schedframe.resources.units.ResourceUnitState;
+import schedframe.resources.units.StandardResourceUnitName;
+import schedframe.scheduling.Scheduler;
+import schedframe.scheduling.plugin.local.ResourceAllocationInterface;
+
+
+public class LocalResourceManager implements ResourceAllocationInterface, ResourceManager {
+
+	//private Log log = LogFactory.getLog(ResourceManager.class);
+
+	protected List<ComputingResource> computingResources;
+	protected List<Scheduler> schedulers;
+	//protected ResourceCharacteristics resourceCharacteristic;
+	protected Map<ResourceUnitName, List<ResourceUnit>> resourceUnits;
+
+	public LocalResourceManager(List<ComputingResource> resources, List<Scheduler> schedulers, Map<ResourceUnitName, List<ResourceUnit>> resourceUnits) {
+		this.computingResources = resources;
+		this.schedulers = schedulers;
+		this.resourceUnits = resourceUnits;
+
+		//initSharedResourceUnits(computingResources);
+	}
+
+	public LocalResourceManager(ComputingResource compResource) {
+		this.computingResources = compResource.getChildren();
+
+		initSharedResourceUnits(compResource);
+	}
+
+	public void initSharedResourceUnits(ComputingResource compResource){
+		this.resourceUnits = new HashMap<ResourceUnitName, List<ResourceUnit>>();
+		List<ResourceUnit> list;
+
+		ComputingResource parent = compResource.getParent();
+		while(parent != null){
+			Map<ResourceUnitName, List<ResourceUnit>> resUnits = parent.getResourceCharacteristic().getResourceUnits();
+			for(ResourceUnitName run : resUnits.keySet()){
+				for(ResourceUnit resUnit : resUnits.get(run)){
+					if((resourceUnits.get(run) == null)){
+						list = new ArrayList<ResourceUnit>(1);
+						resourceUnits.put(resUnit.getName(), list);
+						list.add(resUnit);
+					} else if(!resourceUnits.get(run).contains(resUnit)){
+						list = resourceUnits.get(resUnit.getName());
+						list.add(resUnit);
+					} 
+				}
+			}
+			parent = parent.getParent();
+		}
+	}
+	
+	public List<ComputingResource> getResources() {
+		return computingResources;
+	}
+
+	public boolean areResourcesAchievable(ResourceType type) {
+		if (computingResources != null) {
+			Deque<ComputingResource> toExamine = new ArrayDeque<ComputingResource>();
+			for (ComputingResource resource : computingResources){
+				toExamine.push(resource);	
+			}
+			
+			while (!toExamine.isEmpty()) {
+				ComputingResource resource = toExamine.pop();
+				if(resource.getType() == type)
+					return true;
+				List<ComputingResource> resources = resource.getChildren();
+				/*if (resources == null)
+					continue;*/
+				int numberOfResComp = resources.size();
+				for (int i = 0; i < numberOfResComp; i++) {
+					ComputingResource resourceChild = resources.get(i);
+					if (resourceChild.getType() == type) {
+						return true;
+					} else
+						toExamine.push(resourceChild);
+				}
+			}
+		}
+		return false;
+	}
+
+	public List<? extends ComputingResource> getResourcesOfType(ResourceType type) throws ResourceException {
+		List<ComputingResource> resourcesOfType = new ArrayList<ComputingResource>();
+		for (ComputingResource resource : computingResources) {
+			if (resource.getType() == type) {
+				resourcesOfType.add(resource);
+			} else
+				resourcesOfType.addAll(resource.getDescendantsByType(type));
+		}
+		return resourcesOfType;
+	}
+
+	public List<? extends ComputingResource> getResourcesByTypeWithStatus(ResourceType type, ResourceStatus status)
+			throws ResourceException {
+
+		List<ComputingResource> resourcesOfType = new ArrayList<ComputingResource>();
+		for (ComputingResource resource : computingResources) {
+			if (resource.getType() == type) {
+				if (resource.getStatus() == status) {
+					resourcesOfType.add(resource);
+				}
+			} else
+				resourcesOfType.addAll(resource.getDescendantsByTypeAndStatus(type, status));
+		}
+		return resourcesOfType;
+	}
+
+	public ComputingResource getResourceByName(String resourceName) throws ResourceException {
+		ComputingResource resourceWithName = null;
+		for (int i = 0; i < computingResources.size() && resourceWithName == null; i++) {
+			ComputingResource resource = computingResources.get(i);
+			if (resource.getName().equals(resourceName))
+				resourceWithName = resource;
+			else
+				resourceWithName = resource.getDescendantByName(resourceName);
+		}
+		return resourceWithName;
+	}
+
+	public List<ResourceUnit> getDistributedResourceUnits(ResourceUnitName unitName)  {
+		List<ResourceUnit> resourceUnit = new ArrayList<ResourceUnit>();
+		if (computingResources != null) {
+			Deque<ComputingResource> toExamine = new ArrayDeque<ComputingResource>();
+			for (ComputingResource resource : computingResources)
+				toExamine.push(resource);
+			while (!toExamine.isEmpty()) {
+				ComputingResource resource = toExamine.pop();
+				ResourceCharacteristics resourceCharacteristic = resource.getResourceCharacteristic();
+				List<ResourceUnit> units = null;
+				units = resourceCharacteristic.getResourceUnits().get(unitName);
+				if (units != null)
+					resourceUnit.addAll(units);
+				// else {
+				List<ComputingResource> resources = resource.getChildren();
+				/*if (resources == null)
+					continue;*/
+				int numberOfResComp = resources.size();
+				for (int i = 0; i < numberOfResComp; i++) {
+					ComputingResource resourceChild = resources.get(i);
+					toExamine.push(resourceChild);
+				}
+				// }
+			}
+		}
+		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) {
+		List<ComputingResource> descendants = new ArrayList<ComputingResource>();
+		for (ComputingResource resource : computingResources) {
+			ResourceValidator resourceValidator =  new ResourcePropertiesValidator(properties);
+			if (resourceValidator.validate(resource))
+				descendants.add(resource);
+			else
+				descendants.addAll(resource.filterDescendants(properties));
+		}
+		return descendants;
+	}
+
+	public Map<ResourceUnitName, List<ResourceUnit>> getSharedResourceUnits() {
+		
+		/*Map<ResourceUnitName, List<ResourceUnit>> sharedResourceUnits = new HashMap<ResourceUnitName, List<ResourceUnit>>();
+		List<ResourceUnit> list;
+		for(ComputingResource resource : compResources){
+			boolean resourceNotVisited = true;
+			ComputingResource parent = resource.getParent();
+			while(parent != null && resourceNotVisited){
+				Map<ResourceUnitName, List<ResourceUnit>> resUnits = parent.getResourceCharacteristic().getResourceUnits();
+				for(ResourceUnitName run : resUnits.keySet()){
+					for(ResourceUnit resUnit : resUnits.get(run)){
+						if((sharedResourceUnits.get(run) == null)){
+							list = new ArrayList<ResourceUnit>(1);
+							sharedResourceUnits.put(resUnit.getName(), list);
+							list.add(resUnit);
+						} else if(!sharedResourceUnits.get(run).contains(resUnit)){
+							list = sharedResourceUnits.get(resUnit.getName());
+							list.add(resUnit);
+						} else {
+							resourceNotVisited = false;
+						}
+					}
+				}
+				parent = parent.getParent();
+			}
+		}
+		return sharedResourceUnits;*/
+		return resourceUnits;
+	}
+		
+	public List<Scheduler> getSchedulers() {
+		return schedulers;
+	}
+	
+	@SuppressWarnings("unchecked")
+	public List<ResourceUnit> getPE() throws ResourceException{
+		
+		List<ResourceUnit> peUnits = null;
+		List<ComputingResource> computingResources = null;
+		if(areResourcesAchievable(StandardResourceType.Core)){
+			try {
+				computingResources = (List<ComputingResource>) getResourcesOfType(StandardResourceType.Core);
+			} catch (ResourceException e) {
+				throw new RuntimeException("GSSIM internal error");
+			}
+			PEUnit peUnit = new ProcessingElements(computingResources);
+			peUnits = new ArrayList<ResourceUnit>();
+			peUnits.add(peUnit);			
+		}
+
+		else if(areResourcesAchievable(StandardResourceType.Processor)){
+			try {
+				computingResources = (List<ComputingResource>) getResourcesOfType(StandardResourceType.Processor);
+			} catch (ResourceException e) {
+				throw new RuntimeException("GSSIM internal error");
+			}
+			PEUnit peUnit = new ProcessingElements(computingResources);
+			peUnits = new ArrayList<ResourceUnit>();
+			peUnits.add(peUnit);			
+		}
+
+		else if (getDistributedResourceUnits(StandardResourceUnitName.PE).size() > 0){
+			peUnits = getDistributedResourceUnits(StandardResourceUnitName.PE);
+		} 
+		
+		else if(getSharedResourceUnits().get(StandardResourceUnitName.PE) != null){
+				peUnits = getSharedResourceUnits().get(StandardResourceUnitName.PE);
+		}
+		if(peUnits == null)
+			throw new ResourceException("Processing Elements are not defined");
+		return peUnits;
+	}
+	
+	public String getSchedulerName(String resName){
+		if(GridSim.getEntityId(resName) != -1){
+			return resName;
+		}
+		ComputingResource resourceWithName = null;
+		for(int i = 0 ; i < computingResources.size() && resourceWithName == null; i++){
+			ComputingResource resource = computingResources.get(i);
+			if(resource.getName().equals(resName))
+				resourceWithName = resource;
+			else
+				try {
+					resourceWithName = resource.getDescendantByName(resName);
+				} catch (ResourceException e) {
+					return null;
+				}
+		}
+		if(resourceWithName == null)
+			return null;
+		List<ComputingResource> children = resourceWithName.getChildren();
+		Set<Scheduler> childrenSchedulers = new HashSet<Scheduler>();
+		if(children.isEmpty())
+			return null;
+		for(ComputingResource child: children) {
+			childrenSchedulers.add(child.getScheduler());
+		}	
+
+		Set<Scheduler> tempChildrenSchedulers = new HashSet<Scheduler>(childrenSchedulers);
+		while(childrenSchedulers.size() > 1){
+			childrenSchedulers = new HashSet<Scheduler>();
+			for(Scheduler s: tempChildrenSchedulers){
+				childrenSchedulers.add(s.getParent());
+			}
+			tempChildrenSchedulers = new HashSet<Scheduler>(childrenSchedulers);
+		}
+		Iterator<Scheduler> it = childrenSchedulers.iterator();
+		Scheduler potentialScheduler = it.next();
+		if(potentialScheduler.getCompResources().containsAll(children))
+			return potentialScheduler.get_name();
+		return null;
+	}
+	
+	public boolean allocateResources(Map<ResourceUnitName, ResourceUnit> resources) {
+		
+		if (resources == null) {
+			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()){
+			ResourceUnit resUnit = resources.get(resUnitName);
+			resUnit.getProvisioner().setState(ResourceUnitState.BUSY);
+		}
+		return true;
+	}
+
+
+	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);
+			resUnit.getProvisioner().setState(ResourceUnitState.FREE);
+		}
+	}
+
+
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/manager/resources/ManagedComputingResources.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/manager/resources/ManagedComputingResources.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/manager/resources/ManagedComputingResources.java	(revision 477)
@@ -0,0 +1,30 @@
+package schedframe.scheduling.manager.resources;
+
+import java.util.ArrayList;
+
+import schedframe.resources.ResourceType;
+import schedframe.resources.StandardResourceType;
+import schedframe.resources.computing.ComputingResource;
+
+public class ManagedComputingResources extends ArrayList<ComputingResource>{
+	
+	private static final long serialVersionUID = 1L;
+
+	private ResourceType type;
+	
+	public boolean add(ComputingResource compRes){
+		if(type == null){
+			type = compRes.getType();
+		}
+		if(type.getName().equals(compRes.getType().getName()))
+			return super.add(compRes);
+		return false;
+	}
+
+	public ResourceType getType() {
+		if (type == null)
+			return StandardResourceType.Undefined;
+		return type;
+	}
+
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/manager/resources/ResourceAllocation.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/manager/resources/ResourceAllocation.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/manager/resources/ResourceAllocation.java	(revision 477)
@@ -0,0 +1,13 @@
+package schedframe.scheduling.manager.resources;
+
+import java.util.List;
+
+import schedframe.resources.computing.ComputingResource;
+
+public interface ResourceAllocation {
+	public void allocateResources(List<ComputingResource> resources);
+
+
+	public void freeResources(List<ComputingResource> resources);
+	
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/manager/resources/utils/ResourceManagerUtils.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/manager/resources/utils/ResourceManagerUtils.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/manager/resources/utils/ResourceManagerUtils.java	(revision 477)
@@ -0,0 +1,108 @@
+package schedframe.scheduling.manager.resources.utils;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import schedframe.resources.ResourceStatus;
+import schedframe.resources.computing.ComputingResource;
+import schedframe.resources.units.Memory;
+import schedframe.resources.units.PEUnit;
+import schedframe.resources.units.ProcessingElements;
+import schedframe.resources.units.ResourceUnit;
+import schedframe.resources.units.ResourceUnitName;
+import schedframe.resources.units.ResourceUnitState;
+import schedframe.resources.units.StandardResourceUnitName;
+
+public class ResourceManagerUtils {
+	
+	public static void clearPendingResources(Map<ResourceUnitName, ResourceUnit> choosenResources){
+
+		ProcessingElements processingElements = (ProcessingElements)choosenResources.get(StandardResourceUnitName.PE);
+		if(processingElements != null) {
+			for (int i = 0; i < processingElements.size(); i++) {
+				ComputingResource pe = processingElements.get(i);
+				if (pe.getStatus() == ResourceStatus.PENDING) {
+					pe.setStatus(ResourceStatus.FREE);
+				}
+			}
+		}
+		Memory memory = (Memory)choosenResources.get(StandardResourceUnitName.MEMORY);
+		if(memory != null){
+			if(memory.getProvisioner().getState()==ResourceUnitState.PENDING)
+				memory.getProvisioner().setState(ResourceUnitState.FREE);
+		}
+	}
+	
+	public static void setPendingResources(Map<ResourceUnitName, ResourceUnit> choosenResources){
+
+		/*ProcessingElements processingElements = (ProcessingElements)choosenResources.get(StandardResourceUnitName.PE);
+		if(processingElements != null) {
+			for (int i = 0; i < processingElements.size(); i++) {
+				ComputingResource pe = processingElements.get(i);
+				if (pe.getStatus() == ResourceStatus.FREE) {
+					pe.setStatus(ResourceStatus.PENDING);
+				}
+			}
+		}*/
+		
+		PEUnit processingElements = (PEUnit)choosenResources.get(StandardResourceUnitName.PE);
+		if(processingElements != null) {
+			if(processingElements.getProvisioner().getState()==ResourceUnitState.FREE)
+				processingElements.getProvisioner().setState(ResourceUnitState.PENDING);
+		}
+		
+		Memory memory = (Memory)choosenResources.get(StandardResourceUnitName.MEMORY);
+		if(memory != null){
+			if(memory.getProvisioner().getState()==ResourceUnitState.FREE)
+				memory.getProvisioner().setState(ResourceUnitState.PENDING);
+		}
+	}
+	
+	public static ComputingResource getCommonParent(List<ComputingResource> resources){
+
+		Set<ComputingResource> parents = new HashSet<ComputingResource>(resources);
+		while(parents.size() != 1){
+			parents = new HashSet<ComputingResource>();
+			for(ComputingResource resource: resources){
+				parents.add(resource.getParent());
+			}
+			resources = new ArrayList<ComputingResource>(parents);
+		}
+		return resources.get(0);
+	}
+
+	public static Map<ResourceUnitName, List<ResourceUnit>> getSharedResourceUnits(List<ComputingResource> compResources) {
+		
+		Map<ResourceUnitName, List<ResourceUnit>> sharedResourceUnits = new HashMap<ResourceUnitName, List<ResourceUnit>>();
+		List<ResourceUnit> list;
+		for(ComputingResource resource : compResources){
+			boolean resourceNotVisited = true;
+			ComputingResource parent = resource.getParent();
+			while(parent != null && resourceNotVisited){
+				Map<ResourceUnitName, List<ResourceUnit>> resUnits = parent.getResourceCharacteristic().getResourceUnits();
+				for(ResourceUnitName run : resUnits.keySet()){
+					for(ResourceUnit resUnit : resUnits.get(run)){
+						if((sharedResourceUnits.get(run) == null)){
+							list = new ArrayList<ResourceUnit>(1);
+							sharedResourceUnits.put(resUnit.getName(), list);
+							list.add(resUnit);
+						} else if(!sharedResourceUnits.get(run).contains(resUnit)){
+							list = sharedResourceUnits.get(resUnit.getName());
+							list.add(resUnit);
+						} else {
+							resourceNotVisited = false;
+						}
+					}
+				}
+				parent = parent.getParent();
+			}
+		}
+		return sharedResourceUnits;
+		//return resourceUnits;
+	}
+
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/manager/resources/ResourceManager.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/manager/resources/ResourceManager.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/manager/resources/ResourceManager.java	(revision 477)
@@ -0,0 +1,36 @@
+package schedframe.scheduling.manager.resources;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+
+import schedframe.exceptions.ResourceException;
+import schedframe.resources.ResourceStatus;
+import schedframe.resources.ResourceType;
+import schedframe.resources.computing.ComputingResource;
+import schedframe.resources.units.ResourceUnit;
+import schedframe.resources.units.ResourceUnitName;
+import schedframe.scheduling.Scheduler;
+
+public interface ResourceManager {
+
+	public boolean areResourcesAchievable(ResourceType type);
+	
+	public List<? extends ComputingResource> getResourcesOfType(ResourceType type) throws ResourceException;
+
+	public ComputingResource getResourceByName(String resourceName) throws ResourceException;
+
+	public List<? extends ComputingResource> getResourcesByTypeWithStatus(ResourceType type, ResourceStatus status) throws ResourceException;
+
+	//public ResourceCharacteristics getResourceCharacteristic();
+	
+	public Map<ResourceUnitName, List<ResourceUnit>> getSharedResourceUnits();
+	
+	public List<ResourceUnit> getDistributedResourceUnits(ResourceUnitName unitName);
+	
+	public List<? extends ComputingResource> filterResources(Properties properties);
+	
+	public List<Scheduler> getSchedulers();
+
+	public String getSchedulerName(String resourceName);
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/manager/resources/ClusterResourceManager.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/manager/resources/ClusterResourceManager.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/manager/resources/ClusterResourceManager.java	(revision 477)
@@ -0,0 +1,47 @@
+package schedframe.scheduling.manager.resources;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+
+import schedframe.exceptions.ResourceException;
+import schedframe.resources.StandardResourceType;
+import schedframe.resources.computing.ComputingNode;
+import schedframe.resources.computing.ComputingResource;
+import schedframe.resources.computing.Processor;
+import schedframe.scheduling.Scheduler;
+
+
+public class ClusterResourceManager extends LocalResourceManager {
+
+	public ClusterResourceManager(List<ComputingResource> resources, List<Scheduler> schedulers, ManagedResources managedResources) {
+		super(resources, schedulers, managedResources.getResourceUnits());
+		// TODO Auto-generated constructor stub
+	}
+
+	@SuppressWarnings("unchecked")
+	public List<ComputingNode> getComputingNodes(){
+		try {
+			return (List<ComputingNode>) getResourcesOfType(StandardResourceType.ComputingNode);
+		} catch (ResourceException e) {
+			return new ArrayList<ComputingNode>();
+		}
+	}
+	
+	@SuppressWarnings("unchecked")
+	public List<Processor> getProcessors(){
+		try {
+			return (List<Processor>) getResourcesOfType(StandardResourceType.Processor);
+		} catch (Exception e) {
+			return new ArrayList<Processor>();
+		}
+	}
+
+	@SuppressWarnings("unchecked")
+	public List<ComputingNode> getComputingNodes(Properties properties){
+		properties.setProperty("type", StandardResourceType.ComputingNode.toString());
+		return (List<ComputingNode>) filterResources(properties);
+
+	}
+
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/manager/resources/ManagedResources.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/manager/resources/ManagedResources.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/manager/resources/ManagedResources.java	(revision 477)
@@ -0,0 +1,28 @@
+package schedframe.scheduling.manager.resources;
+
+import java.util.List;
+import java.util.Map;
+
+import schedframe.resources.computing.ComputingResource;
+import schedframe.resources.units.ResourceUnit;
+import schedframe.resources.units.ResourceUnitName;
+
+public class ManagedResources {
+	
+	protected List<ComputingResource> computingResources;
+	protected Map<ResourceUnitName, List<ResourceUnit>> resourceUnits;
+	
+	public ManagedResources(List<ComputingResource> computingResources,
+			Map<ResourceUnitName, List<ResourceUnit>> resourceUnits) {
+		this.computingResources = computingResources;
+		this.resourceUnits = resourceUnits;
+	}
+	
+	public List<ComputingResource> getComputingResources() {
+		return computingResources;
+	}
+	
+	public Map<ResourceUnitName, List<ResourceUnit>> getResourceUnits() {
+		return resourceUnits;
+	}
+}
Index: DCWoRMS/trunk/src/schedframe/scheduling/manager/resources/ResourceManagerFactory.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/scheduling/manager/resources/ResourceManagerFactory.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/scheduling/manager/resources/ResourceManagerFactory.java	(revision 477)
@@ -0,0 +1,32 @@
+package schedframe.scheduling.manager.resources;
+
+import schedframe.scheduling.GridResourceDiscovery;
+import schedframe.scheduling.Scheduler;
+
+public class ResourceManagerFactory {
+
+	public static ResourceManager createResourceManager(Scheduler scheduler, ManagedResources managedResources){
+
+		ManagedComputingResources managedResource = scheduler.getCompResources();
+		
+		if(managedResource.getType().getName().equals("DataCenter"))
+			return new GridResourceDiscovery(scheduler);
+		else if (managedResource.getType().getName().equals("Rack"))
+			return new ClusterResourceManager(scheduler.getCompResources(), scheduler.getChildren(), managedResources);
+		else if (managedResource.getType().getName().equals("ComputingNode"))
+			return new ClusterResourceManager(scheduler.getCompResources(), scheduler.getChildren(), managedResources);
+		else if (managedResource.getType().getName().equals("Processor"))
+			return new ClusterResourceManager(scheduler.getCompResources(), scheduler.getChildren(), managedResources);
+		else return new ClusterResourceManager(scheduler.getCompResources(), scheduler.getChildren(), managedResources);
+		//throw new IllegalArgumentException("ResourceType " + managedResource.getType() + " is not supported.");
+		
+		/*switch(managedResource.getType()){
+			case DataCenter: return new GridResourceDiscovery(scheduler);
+			case Rack: return new ClusterResourceManager(scheduler.getResources(), scheduler.getChildren());
+			case ComputingNode: return new ClusterResourceManager(scheduler.getResources(), scheduler.getChildren());
+			case Processor: return new ClusterResourceManager(scheduler.getResources(), scheduler.getChildren());
+		default:
+			throw new IllegalArgumentException("ResourceType " + managedResource.getType() + " is not supported.");
+		}*/
+	}
+}
Index: DCWoRMS/trunk/src/schedframe/DescriptionContainer.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/DescriptionContainer.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/DescriptionContainer.java	(revision 477)
@@ -0,0 +1,28 @@
+package schedframe;
+
+/**
+ * Interface of a container for descriptions included in external document, e.g. XML document
+ * 
+ * @author Ariel
+ *
+ */
+
+public interface DescriptionContainer<T> {
+
+	/**
+	 * @return an object of a class that represents the description 
+	 */
+	public T getDescription();
+
+	/**
+	 * Provides the description as an original document
+	 * @return string representation of the description
+	 */
+	public String getDocument() throws Exception;
+	
+	/**
+	 * Calls {@link #getDocument} method
+	 * @return string representation of the description
+	 */
+	public String toString();
+}
Index: DCWoRMS/trunk/src/schedframe/PluginConfiguration.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/PluginConfiguration.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/PluginConfiguration.java	(revision 477)
@@ -0,0 +1,16 @@
+package schedframe;
+
+import java.util.Map;
+
+import schedframe.events.scheduling.SchedulingEventType;
+
+public interface PluginConfiguration {
+	
+	/**
+	 * SchedulingEventType - type of the event served by the plugin.
+	 * Object - parameter of the event, if particular event requires one.
+	 * @return
+	 */
+	public Map<SchedulingEventType, Object> getServedEvents();
+
+}
Index: DCWoRMS/trunk/src/schedframe/StaticResourceLoadCalendar.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/StaticResourceLoadCalendar.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/StaticResourceLoadCalendar.java	(revision 477)
@@ -0,0 +1,70 @@
+package schedframe;
+import gridsim.ResourceCalendar;
+
+import java.util.LinkedList;
+import java.util.Properties;
+
+import schedframe.exceptions.ModuleException;
+import schedframe.scheduling.plugin.grid.Module;
+import schedframe.scheduling.plugin.grid.ModuleType;
+
+public class StaticResourceLoadCalendar extends ResourceCalendar implements Module{
+	
+	private static long seed_; 
+	private static double timeZone_;
+	private static double peakLoad_;
+	private static double offPeakLoad_;
+	private static double holidayLoad_;
+	private static LinkedList<Integer> Weekends_;
+	private static LinkedList<Integer> Holidays_;
+	
+	static{
+		seed_ = 11L * 13L * 17L * 19L * 23L + 1L; 
+		timeZone_ = 0.0;
+		peakLoad_ = 0.0; // the resource load during peak hour
+		offPeakLoad_ = 0.0; // the resource load during off-peak hr
+		holidayLoad_ = 0.0; // the resource load during holiday
+		
+		// incorporates weekends so the grid resource is on 7 days a week
+		Weekends_ = new LinkedList<Integer>();
+		Weekends_.add(java.util.Calendar.SATURDAY);
+		Weekends_.add(java.util.Calendar.SUNDAY);
+
+		// incorporates holidays. However, no holidays are set in this example
+		Holidays_ = new LinkedList<Integer>();
+	}
+
+
+	public StaticResourceLoadCalendar(double timeZone, double peakLoad,
+			double offPeakLoad, double relativeHolidayLoad,
+			LinkedList weekendList, LinkedList holidayList, long seed) {
+		super(timeZone, peakLoad, offPeakLoad, relativeHolidayLoad, weekendList,
+				holidayList, seed);
+		// TODO Auto-generated constructor stub
+	}
+
+	public StaticResourceLoadCalendar(){
+		super(timeZone_, peakLoad_, offPeakLoad_, 
+				holidayLoad_, Weekends_, Holidays_, seed_);
+	}
+
+	@Override
+	public void init(Properties properties) throws ModuleException {
+		// TODO Auto-generated method stub
+		
+	}
+
+	@Override
+	public void dispose() throws ModuleException {
+		// TODO Auto-generated method stub
+		
+	}
+
+	@Override
+	public ModuleType getType() {
+		return ModuleType.RESOURCE_CALENDAR;
+	}
+
+
+
+}
Index: DCWoRMS/trunk/src/schedframe/resources/providers/LocalSystem.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/providers/LocalSystem.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/providers/LocalSystem.java	(revision 477)
@@ -0,0 +1,35 @@
+package schedframe.resources.providers;
+
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+public class LocalSystem extends ResourceProvider {
+
+	public LocalSystem(String id, String administrationDomain, String location) {
+		super(id, administrationDomain, location, "LocalSystem");
+	}
+	
+	public LocalSystem(){
+		super();
+	}
+
+	public void setProviderId(String id) {
+		this.id = id;
+	}
+
+	public void setProviderLocation(String location) {
+		this.location = location;
+	}
+
+	public void setAdministrationDomain(String administrationDoamain){
+		this.administrationDomain = administrationDoamain;
+	}
+	
+	public void setDescription(Object description){
+		this.description = description;
+	}
+
+}
Index: DCWoRMS/trunk/src/schedframe/resources/providers/ResourceProvider.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/providers/ResourceProvider.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/providers/ResourceProvider.java	(revision 477)
@@ -0,0 +1,142 @@
+package schedframe.resources.providers;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+public class ResourceProvider {
+
+	protected String administrationDomain;
+	protected String id;
+	protected String location;
+	protected String type;
+	protected Object description;
+	protected String commonName;
+	
+	protected Map<String, String> properties;
+	
+	public ResourceProvider(String id, 
+							String administrationDomain, 
+							String location, 
+							String type) {
+		this.id = id;
+		this.administrationDomain = administrationDomain;
+	    this.location = location;
+	    this.type = type;
+	    this.description = null;
+	    this.properties = null;
+	}
+	
+	public ResourceProvider(){
+		this.id = null;
+		this.administrationDomain = null;
+		this.location = null;
+		this.description = null;
+		this.type = null;
+		this.properties = null;
+	}
+	
+	public String getAdministrationDomain() {
+		return this.administrationDomain;
+	}
+
+	public String getProviderId() {
+		return this.id;
+	}
+
+	public String getProviderLocation() {
+		return this.location;
+	}
+	
+	public Object getDescription(){
+		return this.description;
+	}
+	
+	public String getType(){
+		return this.type;
+	}
+	
+	public String getCommonName(){
+		return this.commonName;
+	}
+	
+	public void setCommonName(String name){
+		this.commonName = name;
+	}
+	
+	public void addProperty(String key, String value){
+		if(this.properties == null){
+			this.properties = new HashMap<String, String>();
+		}
+		
+		this.properties.put(key, value);
+	}
+	
+	public String getProperty(String key){
+		if(this.properties == null)
+			return null;
+		String value = this.properties.get(key);
+		return value;
+	}
+	
+	public Set<String> getPropertyKeys(){
+		if(this.properties == null)
+			return null;
+		
+		Set<String> keys = this.properties.keySet();
+		
+		return keys;
+	}
+	
+	public boolean equals(Object r){
+		if (r instanceof ResourceProvider == false) 
+			return false;
+		
+		ResourceProvider resProvider = (ResourceProvider) r;
+		
+		if(type != null && !type.equals(resProvider.getType()))
+			return false;
+		
+		if(administrationDomain != null && !administrationDomain.equals(resProvider.getAdministrationDomain()))
+			return false;
+		
+		if(location != null && !location.equals(resProvider.getProviderLocation()))
+			return false;
+		
+		if(id != null && !id.equals(resProvider.getProviderId()))
+			return false;
+		
+		return true;
+		
+	}
+	
+	public int hashCode() {
+		// 4 is for 4 letters in word null.
+		int cnt = (this.id == null ? 4 : this.id.length());
+		cnt += (this.administrationDomain == null ? 4 : this.administrationDomain.length());
+		cnt += (this.location == null ? 4 : this.location.length());
+		cnt += (this.type == null ? 4 : this.type.length());
+		cnt += (this.commonName == null ? 4 : this.commonName.length());
+		
+		StringBuffer buffer = new StringBuffer(cnt);
+		buffer.append(this.id);
+		buffer.append(this.administrationDomain);
+		buffer.append(this.location);
+		buffer.append(this.type);
+		buffer.append(this.commonName);
+		String s = buffer.toString();
+		return s.hashCode();
+	}
+
+	public String toString(){
+		return id + " " + administrationDomain + " " + location + " " + commonName;
+	}
+
+	
+}
Index: DCWoRMS/trunk/src/schedframe/resources/utils/ResourceIdGenerator.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/utils/ResourceIdGenerator.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/utils/ResourceIdGenerator.java	(revision 477)
@@ -0,0 +1,21 @@
+package schedframe.resources.utils;
+
+import java.util.HashMap;
+
+import schedframe.resources.ResourceType;
+
+public class ResourceIdGenerator {
+	
+	private static HashMap<ResourceType, Integer> resourceCounter = new HashMap<ResourceType, Integer>();
+	
+	public static int getId(ResourceType type){
+
+		int value = 0;
+		if(resourceCounter.containsKey(type)){
+			value = resourceCounter.get(type);
+			value++;
+		}
+		resourceCounter.put(type, value);
+		return value;
+	}
+}
Index: DCWoRMS/trunk/src/schedframe/resources/ResourceTypeFactory.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/ResourceTypeFactory.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/ResourceTypeFactory.java	(revision 477)
@@ -0,0 +1,40 @@
+package schedframe.resources;
+
+
+public class ResourceTypeFactory {
+	
+	public static ResourceType createResourceType(String typeName){
+		
+		if(typeName.equals(StandardResourceType.Grid.getName()))
+			return StandardResourceType.Grid;
+		
+		else if (typeName.equals(StandardResourceType.DataCenter.getName()))
+			return StandardResourceType.DataCenter;
+		
+		else if (typeName.equals(StandardResourceType.Rack.getName()))
+			return StandardResourceType.Rack;
+		
+		else if (typeName.equals(StandardResourceType.RECS.getName()))
+			return StandardResourceType.RECS;
+		
+		else if (typeName.equals(StandardResourceType.ComputingNode.getName()))
+			return StandardResourceType.ComputingNode;
+		
+		else if (typeName.equals(StandardResourceType.Processor.getName()))
+			return StandardResourceType.Processor;
+		
+		else if (typeName.equals(StandardResourceType.Core.getName()))
+			return StandardResourceType.Core;
+		
+		else if (typeName.equals(StandardResourceType.ResourceProvider.getName()))
+			return StandardResourceType.ResourceProvider;
+		
+		else if (typeName.equals(StandardResourceType.GS.getName()))
+			return StandardResourceType.GS;
+		
+		else if (typeName.equals(StandardResourceType.LS.getName()))
+			return StandardResourceType.LS;
+		
+		else return new UserResourceType(typeName);
+	}
+}
Index: DCWoRMS/trunk/src/schedframe/resources/units/SimpleResourceUnit.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/units/SimpleResourceUnit.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/units/SimpleResourceUnit.java	(revision 477)
@@ -0,0 +1,60 @@
+package schedframe.resources.units;
+
+
+
+public class SimpleResourceUnit extends AbstractResourceUnit {
+
+	protected int total;
+	protected int used;
+	
+	public SimpleResourceUnit(SimpleResourceUnit sru, int total, int used) {
+		super(sru);
+		this.total = total;
+		this.used = used;
+	}
+	
+	public SimpleResourceUnit(SimpleResourceUnit sru) {
+		super(sru);
+		this.total = sru.total;
+		this.used = sru.used;
+	}
+	
+	public SimpleResourceUnit(ResourceUnitName name, int total, int used) {
+		super(name);
+		this.total = total;
+		this.used = used;
+	}
+	
+	public SimpleResourceUnit(ResourceUnitName name, String resId, int total, int used) {
+		super(name, resId);
+		this.total = total;
+		this.used = used;
+	}
+	
+	public int getFreeAmount() {
+		return this.total - this.used;
+	}
+
+	public int getUsedAmount(){
+		return this.used;
+	}
+	
+	public void setUsedAmount(int amount){
+		if(amount > this.total){
+			throw new IllegalArgumentException(
+					"Used amount can not be grather then total amount.");
+		}
+		this.used = amount;
+	}
+	
+	public int getAmount(){
+		return this.total;
+	}
+
+	public ResourceUnit toDiscrete() throws ClassNotFoundException {
+		throw new ClassNotFoundException("There is no distinguish class version for " 
+										+ getClass().getName());
+	}
+
+
+}
Index: DCWoRMS/trunk/src/schedframe/resources/units/Storage.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/units/Storage.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/units/Storage.java	(revision 477)
@@ -0,0 +1,82 @@
+package schedframe.resources.units;
+
+
+public class Storage extends AbstractResourceUnit {
+
+	protected int total;
+	protected int used;
+
+	public Storage(Storage s, int total, int used) {
+		super(s);
+		this.total = total;
+		this.used = used;
+	}
+	
+	public Storage (Storage s) {
+		super(s);
+		this.total = s.total;
+		this.used = s.used;
+	}
+	
+	public Storage(int total, int used) {
+		super(StandardResourceUnitName.STORAGE);
+		this.total = total;
+		this.used = used;
+	}
+	
+	public Storage (String resId, int total, int used) {
+		super(StandardResourceUnitName.STORAGE, resId);
+		this.total = total;
+		this.used = used;
+	}
+
+	public int getFreeAmount() {
+		return this.total - this.used;
+	}
+
+	public int getUsedAmount(){
+		return this.used;
+	}
+	
+	public void setUsedAmount(int amount){
+		if(amount > this.total){
+			throw new IllegalArgumentException(
+					"Used amount can not be grather then total amount.");
+		}
+		this.used = amount;
+	}
+	
+	public int getAmount(){
+		return this.total;
+	}
+
+	public ResourceUnit toDiscrete() throws ClassNotFoundException {
+		throw new ClassNotFoundException("There is no distinguish class version for " 
+										+ getClass().getName());
+	}
+
+	/**
+	 * Comparing two Memory objects is equivalent to
+	 * comparing the free amount of the resource. See {@link #getAmount()}
+	 */
+	public int compareTo(ResourceUnit o) {
+		if(o instanceof Memory){
+			int free = total - used;
+			if(free < o.getFreeAmount()) return -1;
+			if(free > o.getFreeAmount()) return 1;
+			return 0;
+		} else {
+			throw new IllegalArgumentException(o + " is not an instance of " +
+											"memory resource unit.");
+		}
+	}
+
+	public boolean equals(Object o){
+		if(o instanceof Memory){
+			return super.equals(o);
+		} else {
+			return false;
+		}
+	}
+	
+}
Index: DCWoRMS/trunk/src/schedframe/resources/units/PEUnit.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/units/PEUnit.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/units/PEUnit.java	(revision 477)
@@ -0,0 +1,107 @@
+package schedframe.resources.units;
+
+
+
+
+public class PEUnit extends AbstractResourceUnit {
+	
+	protected int total;
+	protected int used;
+	protected int peSpeed;
+	
+	public PEUnit(PEUnit pe, int total, int used) {
+		super(pe);
+		this.total = total;
+		this.used = used;
+		this.peSpeed = 1;
+	}
+	
+	protected PEUnit(){
+		super(StandardResourceUnitName.PE);
+		this.peSpeed = 1;
+	}
+	
+	public PEUnit(int total, int used, int avgSpeed){
+		this();
+		this.total = total;
+		this.used = used;
+		this.peSpeed = avgSpeed;
+	}
+	
+	public PEUnit(String resId, int total, int used) {
+		super(StandardResourceUnitName.PE, resId);
+		this.total = total;
+		this.used = used;
+		this.peSpeed = 1;
+	}
+	
+	public void setSpeed(int speed) {
+		this.peSpeed = speed;
+	}
+	
+	public int getSpeed(){
+		return this.peSpeed;
+	}
+	
+	public int getFreeAmount() {
+		return this.total - this.used;
+	}
+	
+	public int getUsedAmount(){
+		return this.used;
+	}
+
+	public int getAmount(){
+		return this.total;
+	}
+	
+	public void setUsedAmount(int amount) {
+		this.used = amount;
+	}
+	
+	public void reset(){
+		this.used = 0;
+	}
+	
+	public ResourceUnit toDiscrete(){
+		throw new UnsupportedOperationException();
+	}
+	
+	
+	/**
+	 * Compares processing power of the free processors, which is calculated as product
+	 * of {@link #getAmount()} * {@link #getProcessorSpeed()}
+	 * Returns a negative integer, zero, or a positive integer as this object is less
+     * than, equal to, or greater than the specified object
+	 */
+	public int compareTo(ResourceUnit o) {
+		if(o instanceof PEUnit){
+			PEUnit pe = (PEUnit) o;
+			int p_power = pe.getAmount() * pe.getSpeed();
+			int power = this.getAmount() * this.getSpeed();
+			if(power < p_power) return -1;
+			if(power > p_power) return 1;
+			return 0;
+		} else {
+			throw new ClassCastException();
+		}
+	}
+	
+	public boolean equals(Object o){
+		if(o instanceof PEUnit){
+			if(!super.equals(o))
+				return false;
+			PEUnit pe = (PEUnit) o;
+			if(pe.getSpeed() != this.getSpeed()) return false;
+			return true;
+		} else {
+			return false;
+		}
+	}
+
+	public PEUnit replicate (int amount){
+		amount = Math.min(getAmount(), amount);
+		PEUnit peUnit = new PEUnit(this, amount, amount);
+		return peUnit;
+	}
+}
Index: DCWoRMS/trunk/src/schedframe/resources/units/Cost.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/units/Cost.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/units/Cost.java	(revision 477)
@@ -0,0 +1,66 @@
+package schedframe.resources.units;
+
+
+
+public class Cost extends AbstractResourceUnit {
+	
+	protected int value;
+
+	public Cost(Cost c) {
+		super(c);
+		this.value = c.value;
+	}
+	
+	public Cost(int value) {
+		super(StandardResourceUnitName.COST);
+		this.value = value;
+	}
+	
+	public Cost(String resId, int value) {
+		super(StandardResourceUnitName.COST, resId);
+		this.value = value;
+	}
+
+	public int getFreeAmount() {
+		return 0;
+	}
+
+	public int getUsedAmount(){
+		return 0;
+	}
+	
+	public void setUsedAmount(int amount){
+	}
+	
+	public int getAmount(){
+		return this.value;
+	}
+
+	public ResourceUnit toDiscrete() throws ClassNotFoundException {
+		throw new ClassNotFoundException("There is no distinguish class version for " 
+										+ getClass().getName());
+	}
+
+	/**
+	 * Comparing two Memory objects is equivalent to
+	 * comparing the free amount of the resource. See {@link #getAmount()}
+	 */
+	public int compareTo(ResourceUnit o) {
+		if(o instanceof Cost){
+			if(this.value < o.getAmount()) return -1;
+			if(this.value > o.getAmount()) return 1;
+			return 0;
+		} else {
+			throw new IllegalArgumentException(o + " is not an instance of " +
+											"memory resource unit.");
+		}
+	}
+
+	public boolean equals(Object o){
+		if(o instanceof Cost){
+			return super.equals(o);
+		} else {
+			return false;
+		}
+	}
+}
Index: DCWoRMS/trunk/src/schedframe/resources/units/CpuSpeed.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/units/CpuSpeed.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/units/CpuSpeed.java	(revision 477)
@@ -0,0 +1,83 @@
+package schedframe.resources.units;
+
+
+
+public class CpuSpeed extends AbstractResourceUnit{
+
+	protected int total;
+	protected int used;
+	
+	public CpuSpeed(CpuSpeed cs, int total, int used) {
+		super(cs);
+		this.total = total;
+		this.used = used;
+	}
+	
+	public CpuSpeed(CpuSpeed cs) {
+		super(cs);
+		this.total = cs.total;
+		this.used = cs.used;
+	}
+	
+	public CpuSpeed(int total, int used) {
+		super(StandardResourceUnitName.CPUSPEED);
+		this.total = total;
+		this.used = used;
+	}
+	
+	public CpuSpeed(String resId, int total, int used) {
+		super(StandardResourceUnitName.CPUSPEED, resId);
+		this.total = total;
+		this.used = used;
+	}
+	
+	public int getFreeAmount() {
+		return this.total - this.used;
+	}
+
+	public int getUsedAmount(){
+		return this.used;
+	}
+	
+	public void setUsedAmount(int amount){
+		this.used = amount;
+	}
+	
+	public void setAmount(int amount){
+		this.total = amount;
+	}
+
+	public int getAmount(){
+		return this.total;
+	}
+
+	public ResourceUnit toDiscrete() throws ClassNotFoundException {
+		throw new ClassNotFoundException("There is no distinguish class version for " 
+										+ getClass().getName());
+	}
+
+	/**
+	 * Comparing two Memory objects is equivalent to
+	 * comparing the free amount of the resource. See {@link #getAmount()}
+	 */
+	public int compareTo(ResourceUnit o) {
+		if(o instanceof CpuSpeed){
+			int free = total - used;
+			if(free < o.getFreeAmount()) return -1;
+			if(free > o.getFreeAmount()) return 1;
+			return 0;
+		} else {
+			throw new IllegalArgumentException(o + " is not an instance of " +
+											"memory resource unit.");
+		}
+	}
+
+	public boolean equals(Object o){
+		if(o instanceof CpuSpeed){
+			return super.equals(o);
+		} else {
+			return false;
+		}
+	}
+
+}
Index: DCWoRMS/trunk/src/schedframe/resources/units/Memory.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/units/Memory.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/units/Memory.java	(revision 477)
@@ -0,0 +1,86 @@
+package schedframe.resources.units;
+
+
+
+public class Memory extends AbstractResourceUnit {
+
+	protected int total;
+	protected int used;
+
+	public Memory(Memory m, int total, int used) {
+		super(m);
+		this.total = total;
+		this.used = used;
+	}
+	
+	public Memory(Memory m) {
+		super(m);
+		this.total = m.total;
+		this.used = m.used;
+	}
+	
+	public Memory(int total, int used) {
+		super(StandardResourceUnitName.MEMORY);
+		this.total = total;
+		this.used = used;
+	}
+	
+	public Memory(String resId, int total, int used) {
+		super(StandardResourceUnitName.MEMORY, resId);
+		this.total = total;
+		this.used = used;
+	}
+
+	public int getFreeAmount() {
+		return this.total - this.used - this.getProvisioner().getPending();
+	}
+
+	public int getUsedAmount(){
+		return this.used;
+	}
+	
+	public void setUsedAmount(int amount){
+		if(amount > this.total){
+			throw new IllegalArgumentException(
+					"Used amount can not be grather then total amount.");
+		}
+		this.used = amount;
+	}
+	
+	public int getAmount(){
+		return this.total;
+	}
+
+	public ResourceUnit toDiscrete() throws ClassNotFoundException {
+		throw new ClassNotFoundException("There is no distinguish class version for " 
+										+ getClass().getName());
+	}
+
+	/**
+	 * Comparing two Memory objects is equivalent to
+	 * comparing the free amount of the resource. See {@link #getAmount()}
+	 */
+	public int compareTo(ResourceUnit o) {
+		if(o instanceof Memory){
+			int free = total - used;
+			if(free < o.getFreeAmount()) return -1;
+			if(free > o.getFreeAmount()) return 1;
+			return 0;
+		} else {
+			throw new IllegalArgumentException(o + " is not an instance of " +
+											"memory resource unit.");
+		}
+	}
+
+	public boolean equals(Object o){
+		if(o instanceof Memory){
+			return super.equals(o);
+		} else {
+			return false;
+		}
+	}
+
+
+}
+
+
Index: DCWoRMS/trunk/src/schedframe/resources/units/StandardResourceUnitName.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/units/StandardResourceUnitName.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/units/StandardResourceUnitName.java	(revision 477)
@@ -0,0 +1,52 @@
+package schedframe.resources.units;
+
+
+public enum StandardResourceUnitName implements ResourceUnitName{
+
+
+    /**
+     * Constant MEMORY
+     */
+    MEMORY("memory"),
+
+    /**
+     * Constant CPU
+     */
+    CPU("cpu"),
+    
+    /**
+     * Constant GPU
+     */
+    GPU("gpu"),
+    
+    /**
+     * Constant CPUSPEED
+     */
+    CPUSPEED("cpuspeed"),
+    
+    /**
+     * Constant APPLICATION
+     */
+    APPLICATION("application"),
+    
+    /**
+     * Constant STORAGE
+     */
+    STORAGE("storage"),
+    
+    COST("cost"),
+    
+    PE("processingElement");
+
+    
+    private final String name;
+
+    private StandardResourceUnitName(String value) {
+        this.name = value;
+    }
+
+    public String getName(){
+    	return this.name;
+    }
+
+}
Index: DCWoRMS/trunk/src/schedframe/resources/units/ProcessingElements.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/units/ProcessingElements.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/units/ProcessingElements.java	(revision 477)
@@ -0,0 +1,305 @@
+package schedframe.resources.units;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+import java.util.ListIterator;
+
+import schedframe.resources.ResourceStatus;
+import schedframe.resources.ResourceType;
+import schedframe.resources.computing.ComputingResource;
+
+public class ProcessingElements extends PEUnit implements List<ComputingResource> {
+
+	protected List<ComputingResource> resources;
+
+	public ProcessingElements(){
+		super();
+		resources =  new ArrayList<ComputingResource>(1);
+		provisioner = new ProcessingElementsResourceUnitProvisioner(ResourceUnitState.FREE, 0);
+	}
+	
+	public ProcessingElements(String resName){
+		this();
+		resourceId = resName;
+	}
+	
+	public ProcessingElements(List<ComputingResource> resources){
+		this();
+		this.resources = resources;
+	}
+	
+	public ProcessingElements(String resName, List<ComputingResource> resources){
+		this(resName);
+		this.resources = resources;
+	}
+
+	public ResourceType getResourceType(){
+		if(resources != null && resources.size() > 0)
+			return resources.get(0).getType();
+		else return null;
+	}
+	
+	public int getAmount(){
+		return this.resources.size();
+	}
+	
+	public int getSpeed(){
+		int peCnt = getAmount();
+		
+		double avgSpeed = 0;
+		for(int i = 0; i < peCnt; i++){
+			try {
+				avgSpeed += resources.get(i).getResourceCharacteristic().getResourceUnit(StandardResourceUnitName.CPUSPEED).getAmount();
+			} catch (NoSuchFieldException e) {
+				// TODO Auto-generated catch block
+				e.printStackTrace();
+			}
+		}
+		avgSpeed = avgSpeed / peCnt;
+		int speed = (int) Math.round(avgSpeed);
+		return speed;
+	}
+
+	@Override
+	public boolean add(ComputingResource e) {
+		if(resources == null)
+			resources = new ArrayList<ComputingResource>(1);
+		return resources.add(e);
+
+	}
+
+	@Override
+	public void add(int index, ComputingResource element) {
+		if(resources == null)
+			resources = new ArrayList<ComputingResource>(1);
+		resources.add(index, element);
+	}
+
+	@Override
+	public boolean addAll(Collection<? extends ComputingResource> c) {
+		if(resources == null)
+			resources = new ArrayList<ComputingResource>(c.size());
+		return resources.addAll(c);
+	}
+
+	@Override
+	public boolean addAll(int index, Collection<? extends ComputingResource> c) {
+		return resources.addAll(index, c);
+	}
+
+	@Override
+	public void clear() {
+		// TODO Auto-generated method stub
+
+	}
+
+	@Override
+	public boolean contains(Object o) {
+		return resources.contains(o);
+	}
+
+	@Override
+	public boolean containsAll(Collection<?> c) {
+		return resources.containsAll(c);
+	}
+
+	@Override
+	public ComputingResource get(int index) {
+		return resources.get(index);
+	}
+
+	@Override
+	public int indexOf(Object o) {
+		return resources.indexOf(o);
+	}
+
+	@Override
+	public boolean isEmpty() {
+		return resources.isEmpty();
+	}
+
+	@Override
+	public Iterator<ComputingResource> iterator() {
+		return resources.iterator();
+	}
+
+	@Override
+	public int lastIndexOf(Object o) {
+		return resources.lastIndexOf(o);
+	}
+
+	@Override
+	public ListIterator<ComputingResource> listIterator() {
+		return resources.listIterator();
+	}
+
+	@Override
+	public ListIterator<ComputingResource> listIterator(int index) {
+		return resources.listIterator(index);
+	}
+
+	@Override
+	public boolean remove(Object o) {
+		// TODO Auto-generated method stub
+		return false;
+	}
+
+	@Override
+	public ComputingResource remove(int index) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public boolean removeAll(Collection<?> c) {
+		// TODO Auto-generated method stub
+		return false;
+	}
+
+	@Override
+	public boolean retainAll(Collection<?> c) {
+		// TODO Auto-generated method stub
+		return false;
+	}
+
+	@Override
+	public ComputingResource set(int index, ComputingResource element) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public int size() {
+		return resources.size();
+	}
+
+	@Override
+	public List<ComputingResource> subList(int fromIndex, int toIndex) {
+		return resources.subList(fromIndex, toIndex);
+	}
+
+	@Override
+	public Object[] toArray() {
+		return resources.toArray();
+	}
+
+	@Override
+	public <T> T[] toArray(T[] a) {
+		return resources.toArray(a);
+	}
+
+	
+	protected int getAmount(ResourceStatus status){
+		int sum = 0;
+		for(int i = 0; i < this.resources.size(); i++){
+			if(resources.get(i).getStatus() == status){
+				sum++;
+			}
+		}
+		return sum;
+	}
+	
+	public int getFreeAmount(){
+		return getAmount(ResourceStatus.FREE);
+	}
+
+	public int getUsedAmount(){
+		return getAmount(ResourceStatus.BUSY);
+	}
+	
+	public void setUsedAmount(int amount) {
+		int cnt = getAmount(ResourceStatus.BUSY);
+		int delta = amount - cnt;
+
+		//allocate resources
+		if(delta > 0){
+				for(int i = 0; i < this.resources.size() && delta > 0; i++){
+					ComputingResource r = this.resources.get(i);
+					if(r.getStatus() == ResourceStatus.FREE || r.getStatus() == ResourceStatus.PENDING){
+						r.setStatus(ResourceStatus.BUSY);
+						delta--;
+					}
+				}
+		}
+		//free resources
+		else if(delta < 0) {
+			for(int i = this.resources.size() - 1; i >= 0 && delta < 0; i--){
+				ComputingResource r = this.resources.get(i);
+				if(r.getStatus() == ResourceStatus.BUSY){
+					r.setStatus(ResourceStatus.FREE);
+					delta++;
+				}
+			}
+		}
+	}
+	
+	public ProcessingElements replicate(int amount){
+		List<ComputingResource> compResources =  new ArrayList<ComputingResource>(amount);
+		Iterator<ComputingResource> it = resources.iterator();
+		amount = Math.min(resources.size(), amount);
+		while(it.hasNext() && amount > 0){
+			ComputingResource compRes = it.next();
+			if(compRes.getStatus() == ResourceStatus.FREE){
+				compResources.add(compRes);
+				amount--;
+			}
+		}
+		return new ProcessingElements(compResources);
+	}
+
+	public ResourceUnitProvisioner getProvisioner() {
+		if(provisioner == null){
+			provisioner = new ProcessingElementsResourceUnitProvisioner(ResourceUnitState.FREE, 0);
+		}
+        return provisioner;
+	}
+	
+	class ProcessingElementsResourceUnitProvisioner implements ResourceUnitProvisioner{
+
+		protected ResourceUnitState state;
+		protected int pending;
+
+		public ProcessingElementsResourceUnitProvisioner (ResourceUnitState state, int pending) {
+			this.state = state;
+			this.pending = pending;
+		}
+
+		public ResourceUnitState getState() {
+			return state;
+		}
+
+		public void setState(ResourceUnitState newState) {
+
+			if(newState == ResourceUnitState.FREE){
+				setUsedAmount(getUsedAmount() - getAmount());
+			} else if(newState == ResourceUnitState.PENDING){
+				for (int i = 0; i < resources.size(); i++) {
+					ComputingResource pe = resources.get(i);
+					if (pe.getStatus() == ResourceStatus.FREE) {
+						pe.setStatus(ResourceStatus.PENDING);
+					}
+				}
+				setPending(getPending() + getAmount());
+			} else if(state == ResourceUnitState.PENDING && newState == ResourceUnitState.BUSY){
+				setPending(getProvisioner().getPending() - getAmount());
+				setUsedAmount(getUsedAmount() + getAmount());
+			} else if(state == ResourceUnitState.FREE && newState == ResourceUnitState.BUSY){
+				setUsedAmount(getUsedAmount() + getAmount());
+			}
+			state = newState;
+		}
+		
+		public int getPending() {
+			return pending;
+		}
+
+		public void setPending(int pending) {
+			this.pending = pending;
+		}
+		
+	}
+	
+
+}
Index: DCWoRMS/trunk/src/schedframe/resources/units/AbstractResourceUnit.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/units/AbstractResourceUnit.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/units/AbstractResourceUnit.java	(revision 477)
@@ -0,0 +1,126 @@
+package schedframe.resources.units;
+
+import schedframe.Parameters;
+
+public abstract class AbstractResourceUnit implements ResourceUnit, Cloneable {
+	
+	protected ResourceUnitName name;
+	
+	protected ResourceUnitType resourceType;;
+
+	protected String resourceId;
+	
+	protected ResourceUnitProvisioner provisioner;
+	
+	
+	public AbstractResourceUnit(AbstractResourceUnit unit){
+		this.name = unit.name;
+		this.resourceType = unit.resourceType;
+		this.resourceId = unit.resourceId;
+		this.provisioner = new SimpleResourceUnitProvisioner(unit, ResourceUnitState.FREE, 0);
+	}
+	
+	public AbstractResourceUnit(ResourceUnitName name) {
+		this.name = name;
+		resourceId = "";
+		resourceType = ResourceUnitType.CONTINUOUS_RESOURCE;
+		this.provisioner = new SimpleResourceUnitProvisioner(this, ResourceUnitState.FREE, 0);
+	}
+
+	public AbstractResourceUnit(ResourceUnitName name, String resId) {
+		this(name);
+		resourceId = resId;
+		resourceType = ResourceUnitType.CONTINUOUS_RESOURCE;
+		this.provisioner = new SimpleResourceUnitProvisioner(this, ResourceUnitState.FREE, 0);
+	}
+	
+	public ResourceUnitName getName() {
+		return name;
+	}
+
+	public String getResourceId() {
+		return resourceId;
+	}
+	
+	public ResourceUnitType getResourceUnitType() {
+		return this.resourceType;
+	}
+	
+	public boolean equals(Object o){
+		if(o instanceof AbstractResourceUnit){
+			AbstractResourceUnit unit = (AbstractResourceUnit) o;
+			if(this.name != unit.getName()) return false;
+			if(!this.resourceId.equals(unit.getResourceId())) return false;
+			if(this.getFreeAmount() != unit.getFreeAmount()) return false;
+			if(this.getUsedAmount() != unit.getUsedAmount()) return false;
+			return true;
+		} else {
+			return false;
+		}
+	}
+	
+	public Object clone(){
+		Object obj = null;
+		try {
+			obj = super.clone();
+		} catch (CloneNotSupportedException e) {
+			e.printStackTrace();
+		}
+		return obj;
+	}
+	
+	public void reset(){};
+	
+	public void init(Parameters parameters){
+		
+	}
+	
+	public ResourceUnitProvisioner getProvisioner() {
+        return provisioner;
+	}
+	
+	public Parameters getParameters(){
+		return null;
+	}
+
+	class SimpleResourceUnitProvisioner implements ResourceUnitProvisioner{
+
+		protected ResourceUnit primaryUnit;
+		protected ResourceUnitState state;
+		protected int pending;
+		
+		public SimpleResourceUnitProvisioner (ResourceUnit primaryUnit, ResourceUnitState state, int pending) {
+			this.primaryUnit = primaryUnit;
+			this.state = state;
+			this.pending = pending;
+		}
+
+		public ResourceUnitState getState() {
+			return state;
+		}
+
+		public void setState(ResourceUnitState newState) {
+
+			if(newState == ResourceUnitState.FREE){
+				primaryUnit.setUsedAmount(primaryUnit.getUsedAmount() - getAmount());
+			} else if(newState == ResourceUnitState.PENDING){
+				primaryUnit.getProvisioner().setPending(primaryUnit.getProvisioner().getPending() + getAmount());
+			} else if(state == ResourceUnitState.PENDING && newState == ResourceUnitState.BUSY){
+				primaryUnit.getProvisioner().setPending(primaryUnit.getProvisioner().getPending() - getAmount());
+				primaryUnit.setUsedAmount(primaryUnit.getUsedAmount() + getAmount());
+			} else if(state == ResourceUnitState.FREE && newState == ResourceUnitState.BUSY){
+				primaryUnit.setUsedAmount(primaryUnit.getUsedAmount() + getAmount());
+			}
+			state = newState;
+		}
+		
+		public int getPending() {
+			return pending;
+		}
+
+		public void setPending(int pending) {
+			this.pending = pending;
+		}
+		
+	}
+}
Index: DCWoRMS/trunk/src/schedframe/resources/units/ResourceUnitFactory.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/units/ResourceUnitFactory.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/units/ResourceUnitFactory.java	(revision 477)
@@ -0,0 +1,76 @@
+package schedframe.resources.units;
+
+
+
+
+
+public class ResourceUnitFactory {
+	
+	/*public static ResourceUnit creteUnit(String resourceClass, int totalAmount, int usedAmount){
+		switch(ResourceParameterName.fromValue(resourceClass)){
+			case CPUCOUNT: return new Processors(totalAmount, usedAmount, 1);
+			case MEMORY: return new Memory(totalAmount, usedAmount);
+			case FREEMEMORY: return new FreeMemory(totalAmount, usedAmount); 
+			case CPUSPEED: return new CpuSpeed(totalAmount, usedAmount); 
+		default:
+			return new FreeMemory(totalAmount, usedAmount); 
+			//throw new IllegalArgumentException("Paramter " + resourceClass + " is not supported.");
+		}
+	}*/
+	
+	public static ResourceUnit createUnit(String unitName, String resId, int totalAmount, int usedAmount){
+		if(unitName.equals(StandardResourceUnitName.CPU.getName()))
+			return new PEUnit(resId, totalAmount, usedAmount);
+		if(unitName.equals(StandardResourceUnitName.PE.getName()))
+			return new PEUnit(resId, totalAmount, usedAmount);
+		else if(unitName.equals(StandardResourceUnitName.MEMORY.getName()))
+			 return new Memory(resId, totalAmount, usedAmount);
+		else if(unitName.equals(StandardResourceUnitName.STORAGE.getName()))
+			 return new Storage(resId, totalAmount, usedAmount);
+		else if(unitName.equals(StandardResourceUnitName.GPU.getName()))
+			 return new GPU(resId, totalAmount, usedAmount);
+		else if (unitName.equals(StandardResourceUnitName.CPUSPEED.getName()))
+			return new CpuSpeed(resId, totalAmount, usedAmount); 
+		else if (unitName.equals(StandardResourceUnitName.COST.getName()))
+			return new Cost(resId, totalAmount);
+		else if (unitName.equals(StandardResourceUnitName.APPLICATION.getName()))
+			return new Applications(resId); 
+		else
+			return new SimpleResourceUnit(ResourceUnitNameFactory.createResourceUnitName(unitName), resId, totalAmount, usedAmount); 
+	}
+	
+	public static ResourceUnit createUnit(String unitName, int totalAmount, int usedAmount){
+		if(unitName.equals(StandardResourceUnitName.CPU.getName()))
+			return new PEUnit(totalAmount, usedAmount, 1);
+		else if(unitName.equals(StandardResourceUnitName.MEMORY.getName()))
+			 return new Memory(totalAmount, usedAmount);
+		else if (unitName.equals(StandardResourceUnitName.CPUSPEED.getName()))
+			return new CpuSpeed(totalAmount, usedAmount); 
+		else
+			return new SimpleResourceUnit(ResourceUnitNameFactory.createResourceUnitName(unitName), totalAmount, usedAmount); 
+	}
+	
+	
+	public static ResourceUnit createUnit(ResourceUnitName unitName, int totalAmount, int usedAmount){
+		if(unitName.equals(StandardResourceUnitName.CPU))
+			return new PEUnit(totalAmount, usedAmount, 1);
+		else if(unitName.equals(StandardResourceUnitName.MEMORY))
+			 return new Memory(totalAmount, usedAmount);
+		else if (unitName.equals(StandardResourceUnitName.CPUSPEED))
+			return new CpuSpeed(totalAmount, usedAmount); 
+		else
+			return new SimpleResourceUnit(unitName, totalAmount, usedAmount); 
+	}
+	
+	/*public static ResourceUnit creteUnit(String resourceClass, int totalAmount, int usedAmount){
+		
+		switch(ResourceUnitClass.valueOf(resourceClass)){
+			case CPU: return new Processors(totalAmount, usedAmount, 1);
+			case MEMORY: return new Memory(totalAmount, usedAmount);
+			case STORAGE: return new Storage(totalAmount, usedAmount);
+		default:
+			
+			throw new IllegalArgumentException("Paramter " + resourceClass + " is not supported.");
+		}
+	}*/
+}
Index: DCWoRMS/trunk/src/schedframe/resources/units/ResourceUnitNameFactory.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/units/ResourceUnitNameFactory.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/units/ResourceUnitNameFactory.java	(revision 477)
@@ -0,0 +1,31 @@
+package schedframe.resources.units;
+
+
+public class ResourceUnitNameFactory {
+
+	public static ResourceUnitName createResourceUnitName(String unitName){
+
+		if(unitName.equals(StandardResourceUnitName.MEMORY.getName()))
+			return StandardResourceUnitName.MEMORY;
+		
+		else if (unitName.equals(StandardResourceUnitName.STORAGE.getName()))
+			return StandardResourceUnitName.STORAGE;
+		
+		else if (unitName.equals(StandardResourceUnitName.PE.getName()))
+			return StandardResourceUnitName.PE;
+		
+		else if (unitName.equals(StandardResourceUnitName.CPUSPEED.getName()))
+			return StandardResourceUnitName.CPUSPEED;
+		
+		else if (unitName.equals(StandardResourceUnitName.GPU.getName()))
+			return StandardResourceUnitName.GPU;
+		
+		else if (unitName.equals(StandardResourceUnitName.APPLICATION.getName()))
+			return StandardResourceUnitName.APPLICATION;
+		
+		else if (unitName.equals(StandardResourceUnitName.COST.getName()))
+			return StandardResourceUnitName.COST;
+
+		else return new UserResourceUnitName(unitName);
+	}
+}
Index: DCWoRMS/trunk/src/schedframe/resources/units/Applications.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/units/Applications.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/units/Applications.java	(revision 477)
@@ -0,0 +1,74 @@
+package schedframe.resources.units;
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+
+public class Applications extends AbstractResourceUnit {
+
+	
+	protected List<String> applicationNames;
+	
+	public Applications(String resId){
+		super(StandardResourceUnitName.APPLICATION, resId);
+		
+		this.resourceType = ResourceUnitType.DISCRETE_RESOURCE;
+		this.applicationNames = new ArrayList<String>(2);
+	}
+	
+	public Applications(String resId, List<String> names){
+		super(StandardResourceUnitName.APPLICATION, resId);
+		
+		this.resourceType = ResourceUnitType.DISCRETE_RESOURCE;
+		
+		if(names == null)
+			this.applicationNames = new ArrayList<String>(2);
+		else
+			this.applicationNames = names;
+	}
+	
+	public void addApplication(String name){
+		this.applicationNames.add(name);
+	}
+	
+	public List<String> getApplicationNames(){
+		return this.applicationNames;
+	}
+	
+	public boolean containsApplication(String name){
+		return this.applicationNames.contains(name);
+	}
+	
+	public int getAmount() {
+		return this.applicationNames.size();
+	}
+
+	public int getFreeAmount() {
+		return this.getAmount();
+	}
+
+	public int getUsedAmount() {
+		return 0;
+	}
+
+	public void setUsedAmount(int amount) {
+	}
+
+	public ResourceUnit toDiscrete() throws ClassNotFoundException {
+		return this;
+	}
+
+	public int compareTo(ResourceUnit o) {
+		return 0;
+	}
+
+	public String toString(){
+		StringBuffer buffer = new StringBuffer();
+		for(int i = 0; i < this.applicationNames.size(); i++){
+			buffer.append(this.applicationNames.get(i) + ", ");
+		}
+		
+		return getName() + ": " + buffer.toString();
+	}
+}
Index: DCWoRMS/trunk/src/schedframe/resources/units/UserResourceUnitName.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/units/UserResourceUnitName.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/units/UserResourceUnitName.java	(revision 477)
@@ -0,0 +1,15 @@
+package schedframe.resources.units;
+
+public class UserResourceUnitName implements ResourceUnitName {
+
+	protected String name;
+
+	public UserResourceUnitName(String name) {
+		this.name = name;
+	}
+
+	public String getName() {
+		return name;
+	}
+
+}
Index: DCWoRMS/trunk/src/schedframe/resources/units/ResourceUnit.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/units/ResourceUnit.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/units/ResourceUnit.java	(revision 477)
@@ -0,0 +1,28 @@
+package schedframe.resources.units;
+
+import schedframe.Parameters;
+
+public interface ResourceUnit {
+
+	public ResourceUnitName getName();
+	
+	public ResourceUnitType getResourceUnitType();
+	
+	public String getResourceId();
+	
+	public int getFreeAmount() ;
+
+	public int getUsedAmount();
+	
+	public int getAmount();
+	
+	public void setUsedAmount(int amount);
+	
+	public ResourceUnit toDiscrete() throws ClassNotFoundException;
+	
+	public void init(Parameters parameters);
+	
+	public Parameters getParameters();
+	
+	public ResourceUnitProvisioner getProvisioner();
+}
Index: DCWoRMS/trunk/src/schedframe/resources/units/ResourceUnitProvisioner.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/units/ResourceUnitProvisioner.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/units/ResourceUnitProvisioner.java	(revision 477)
@@ -0,0 +1,13 @@
+package schedframe.resources.units;
+
+
+public interface ResourceUnitProvisioner {
+
+	public int getPending();
+
+	public void setPending(int pending);
+	
+	public ResourceUnitState getState();
+	
+	public void setState(ResourceUnitState newState);
+}
Index: DCWoRMS/trunk/src/schedframe/resources/units/ResourceUnitState.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/units/ResourceUnitState.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/units/ResourceUnitState.java	(revision 477)
@@ -0,0 +1,7 @@
+package schedframe.resources.units;
+
+public enum ResourceUnitState {
+	FREE,
+	PENDING,
+	BUSY;
+}
Index: DCWoRMS/trunk/src/schedframe/resources/units/ResourceUnitName.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/units/ResourceUnitName.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/units/ResourceUnitName.java	(revision 477)
@@ -0,0 +1,7 @@
+package schedframe.resources.units;
+
+public interface ResourceUnitName {
+	
+	public String getName();
+
+}
Index: DCWoRMS/trunk/src/schedframe/resources/units/ResourceUnitType.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/units/ResourceUnitType.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/units/ResourceUnitType.java	(revision 477)
@@ -0,0 +1,33 @@
+package schedframe.resources.units;
+
+/**
+ * 
+ * Type of resource unit
+ * For instance, continuous for memory, bandwidth, etc. and discrete for processors
+ * 
+ * @author Ariel
+ *
+ */
+public enum ResourceUnitType {
+
+	UNKNOWN("unknown", 0),
+	CONTINUOUS_RESOURCE("continuous resource", 1),
+	DISCRETE_RESOURCE("discrete resource", 2)
+	;
+	
+	private final int iValue;
+	private final String sValue;
+	
+	private ResourceUnitType(final String sValue, final int iValue){
+		this.sValue = sValue;
+		this.iValue = iValue;
+	}
+	
+	public String toString(){
+		return this.sValue;
+	}
+	
+	public int toInt(){
+		return this.iValue;
+	}
+}
Index: DCWoRMS/trunk/src/schedframe/resources/units/GPU.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/units/GPU.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/units/GPU.java	(revision 477)
@@ -0,0 +1,59 @@
+package schedframe.resources.units;
+
+
+
+public class GPU extends AbstractResourceUnit {
+
+	protected int total;
+	protected int used;
+
+	public GPU(GPU m) {
+		super(m);
+		this.total = m.total;
+		this.used = m.used;
+	}
+	
+	public GPU(int total, int used) {
+		super(StandardResourceUnitName.GPU);
+		this.total = total;
+		this.used = used;
+	}
+	
+	public GPU(String resId, int total, int used) {
+		super(StandardResourceUnitName.GPU, resId);
+		this.total = total;
+		this.used = used;
+	}
+
+	public int getFreeAmount() {
+		return this.total - this.used;
+	}
+
+	public int getUsedAmount(){
+		return this.used;
+	}
+	
+	public void setUsedAmount(int amount){
+		if(amount > this.total){
+			throw new IllegalArgumentException(
+					"Used amount can not be grather then total amount.");
+		}
+		this.used = amount;
+	}
+	
+	public int getAmount(){
+		return this.total;
+	}
+
+	@Override
+	public ResourceUnit toDiscrete() throws ClassNotFoundException {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	public int compareTo(ResourceUnit o) {
+		// TODO Auto-generated method stub
+		return 0;
+	}
+
+}
Index: DCWoRMS/trunk/src/schedframe/resources/computing/Core.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/computing/Core.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/computing/Core.java	(revision 477)
@@ -0,0 +1,61 @@
+package schedframe.resources.computing;
+
+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.ui.PowerInterface;
+import schedframe.resources.units.CpuSpeed;
+import schedframe.resources.units.StandardResourceUnitName;
+
+public class Core extends ComputingResource{
+	
+
+	public Core (ComputingResourceDescription resDesc) {
+		super(resDesc);
+		PowerInterface pi = PowerProfileFactory.createPowerInterface(this, resDesc.getPowerProfile());
+		accept(new EnergyExtension(pi, resDesc.getPowerProfile()));	
+	}
+
+	public Processor getProcessor(){
+		return (Processor)parent;
+	}
+	
+	public int getMIPS(){
+		int mips;
+		try {
+			mips = getSpeedUnit().getAmount();
+		} catch (NoSuchFieldException e) {
+			mips = 1;
+		}
+		return mips;
+	}
+	
+	public int getAvailableMIPS(){
+		int mips;
+		try {
+			mips = getSpeedUnit().getFreeAmount();
+		} catch (NoSuchFieldException e) {
+			mips = 1;
+		}
+		return mips;
+	}
+
+	private CpuSpeed getSpeedUnit() throws NoSuchFieldException{
+		return (CpuSpeed) resourceCharacteristic.getResourceUnit(StandardResourceUnitName.CPUSPEED);
+	}
+
+	public void initCharacteristics(ComputingResourceDescription resDesc){
+		super.initCharacteristics(resDesc);
+		try{
+			resourceCharacteristic.addResourceUnit(new CpuSpeed(name, Integer.valueOf(resDesc.getCompResourceParameterValue("speed")) * 1, 0));
+		} catch(Exception e){
+			resourceCharacteristic.addResourceUnit(new CpuSpeed(name,  1, 0));
+		}
+	}
+
+	public void accept(EnergyExtension e){
+		extensionList.add(e);
+		e.setResource(this);
+	}
+}
+
Index: DCWoRMS/trunk/src/schedframe/resources/computing/location/Location.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/computing/location/Location.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/computing/location/Location.java	(revision 477)
@@ -0,0 +1,32 @@
+package schedframe.resources.computing.location;
+
+import schedframe.Parameters;
+
+public class Location {
+	
+	protected long horizontal;
+	protected long vertical;
+	protected long depth;
+	
+	public Location(long horizontal, long vertical, long depth) {
+		super();
+		this.horizontal = horizontal;
+		this.vertical = vertical;
+		this.depth = depth;
+	}
+	
+	public long getHorizontal() {
+		return horizontal;
+	}
+	public long getVertical() {
+		return vertical;
+	}
+	public long getDepth() {
+		return depth;
+	}
+	
+	public void init(Parameters parameters){
+		
+	}
+	
+}
Index: DCWoRMS/trunk/src/schedframe/resources/computing/DataCenter.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/computing/DataCenter.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/computing/DataCenter.java	(revision 477)
@@ -0,0 +1,21 @@
+package schedframe.resources.computing;
+
+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.ui.PowerInterface;
+
+public class DataCenter extends ComputingResource{
+
+	public DataCenter(ComputingResourceDescription resDesc) {
+		super(resDesc);
+		//extensionList.add(new EnergyExtension(this, resDesc.getPowerInterface(), resDesc.getEnergyEstimationPlugin()));
+		PowerInterface pi = PowerProfileFactory.createPowerInterface(this, resDesc.getPowerProfile());
+		accept(new EnergyExtension(pi, resDesc.getPowerProfile()));
+	}
+		
+	public void accept(EnergyExtension e){
+		extensionList.add(e);
+		e.setResource(this);
+	}
+}
Index: DCWoRMS/trunk/src/schedframe/resources/computing/ComputingNode.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/computing/ComputingNode.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/computing/ComputingNode.java	(revision 477)
@@ -0,0 +1,109 @@
+package schedframe.resources.computing;
+
+import java.util.List;
+import java.util.Properties;
+
+
+import schedframe.resources.ResourceStatus;
+import schedframe.resources.StandardResourceType;
+import schedframe.resources.computing.description.ComputingResourceDescription;
+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.ui.ComputingNodePowerInterface;
+import schedframe.resources.computing.profiles.energy.power.ui.PowerInterface;
+import schedframe.resources.computing.properties.ComputingNodePropertiesBuilder;
+import schedframe.resources.computing.properties.PropertiesDirector;
+import schedframe.resources.units.Cost;
+import schedframe.resources.units.Memory;
+import schedframe.resources.units.StandardResourceUnitName;
+
+public class ComputingNode extends ComputingResource{
+	
+
+	public ComputingNode (ComputingResourceDescription resDesc) {
+		super(resDesc);
+		
+		//extensionList.add(new EnergyExtension(this, resDesc.getPowerInterface(), resDesc.getEnergyEstimationPlugin()));
+		PowerInterface pi = PowerProfileFactory.createPowerInterface(this, resDesc.getPowerProfile());
+		accept(new EnergyExtension(pi, resDesc.getPowerProfile()));	
+	}
+	
+	/*public ComputingNode (String resourceName, ResourceCharacteristics resourceCharacteristic, Category cat, PowerInterface powerInterface) {
+		super(resourceName, ResourceType.COMPUTING_NODE, resourceCharacteristic);
+		category = cat;
+		accept(powerInterface);
+	//	extensionList.add(new EnergyExtension(this, "example.energy.ComputingNodeEnergyEstimationPlugin"));
+	}*/
+	
+	
+	public ComputingNodePowerInterface getPowerInterface(){
+		ComputingNodePowerInterface powerProfile = null;
+		if(extensionList.isExtensionAvailable(ExtensionType.ENERGY_EXTENSION)){
+			EnergyExtension ee = (EnergyExtension)extensionList.getExtension(ExtensionType.ENERGY_EXTENSION);
+			powerProfile = (ComputingNodePowerInterface)ee.getPowerInterface();
+		}
+		return powerProfile;
+	}
+
+	@SuppressWarnings("unchecked")
+	public List<Processor> getProcessors(){
+		return (List<Processor>) getDescendantsByType(StandardResourceType.Processor);
+	}
+	
+	@SuppressWarnings("unchecked")
+	public List<Processor> getFreeProcessors(){
+		return (List<Processor>) getDescendantsByTypeAndStatus(StandardResourceType.Processor, ResourceStatus.FREE);
+	}
+
+	public int getProcessorsNumber() {
+		return getProcessors().size();
+	}
+
+	public int getFreeProcessorsNumber() {
+		return getFreeProcessors().size();
+	}
+	
+	
+	//MEMORY 
+	public int getFreeMemory() throws NoSuchFieldException {
+		return getMemory().getFreeAmount();
+	}
+	
+	public int getTotalMemory() throws NoSuchFieldException {
+		return getMemory().getAmount();
+	}
+
+	public boolean isMemRequirementSatisfied(int memoryReq) throws NoSuchFieldException {
+		if (getFreeMemory() < memoryReq)
+			return false;
+		return true;
+	}
+	
+	public Memory getMemory() throws NoSuchFieldException {
+		return (Memory)resourceCharacteristic.getResourceUnit(StandardResourceUnitName.MEMORY);
+	}
+	
+	//COST
+	public int getProcessingCost() throws NoSuchFieldException {
+		return getCost().getAmount();
+	}
+	
+	private Cost getCost() throws NoSuchFieldException {
+		return (Cost) resourceCharacteristic.getResourceUnit(StandardResourceUnitName.COST);
+	}
+
+	
+	public Properties getProperties(){
+		PropertiesDirector propDirector = new PropertiesDirector();
+		propDirector.setPropertiesBuilder(new ComputingNodePropertiesBuilder());
+		propDirector.constructProperties(this);
+		return propDirector.getProperties();
+	}
+	
+	
+	public void accept(EnergyExtension e){
+		extensionList.add(e);
+		e.setResource(this);
+	}
+}
Index: DCWoRMS/trunk/src/schedframe/resources/computing/properties/CpuPropertiesBuilder.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/computing/properties/CpuPropertiesBuilder.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/computing/properties/CpuPropertiesBuilder.java	(revision 477)
@@ -0,0 +1,38 @@
+package schedframe.resources.computing.properties;
+
+import java.util.Properties;
+
+import schedframe.resources.computing.ComputingResource;
+import schedframe.resources.computing.Processor;
+
+public class CpuPropertiesBuilder implements PropertiesBuilder{
+	protected Properties properties;
+	private Processor cpu;
+	
+	public Properties getProperties() {
+		return properties;
+	}
+
+	public void createProperties(ComputingResource resource) {
+		this.properties = new Properties();
+		this.cpu = (Processor)resource;
+	}
+
+	public void buildBasicProperties() {
+		properties.setProperty("name", cpu.getName());
+		properties.setProperty("type", cpu.getType().toString());
+		properties.setProperty("status", cpu.getStatus().toString());
+	}
+
+	public void buildCharacteristicsProperties() {
+		properties.setProperty("speed", String.valueOf(cpu.getMIPS()));
+	}
+
+	public void buildDescriptionProperties() {
+
+
+	}
+
+
+
+}
Index: DCWoRMS/trunk/src/schedframe/resources/computing/properties/ComputingNodePropertiesBuilder.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/computing/properties/ComputingNodePropertiesBuilder.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/computing/properties/ComputingNodePropertiesBuilder.java	(revision 477)
@@ -0,0 +1,41 @@
+package schedframe.resources.computing.properties;
+
+import java.util.Properties;
+
+import schedframe.resources.computing.ComputingNode;
+import schedframe.resources.computing.ComputingResource;
+
+public class ComputingNodePropertiesBuilder implements PropertiesBuilder{
+	protected Properties properties;
+	private ComputingNode node;
+	
+	public Properties getProperties() {
+		return properties;
+	}
+
+	public void createProperties(ComputingResource resource) {
+		this.properties = new Properties();
+		this.node = (ComputingNode)resource;
+	}
+
+	public void buildBasicProperties() {
+		properties.setProperty("name", node.getName());
+		properties.setProperty("type", node.getType().toString());
+		properties.setProperty("status", node.getStatus().toString());
+	}
+
+	public void buildCharacteristicsProperties() {
+		try {
+			properties.setProperty("totalmemory", String.valueOf(node.getTotalMemory()));
+			properties.setProperty("freememory", String.valueOf(node.getFreeMemory()));
+			properties.setProperty("cost", String.valueOf(node.getProcessingCost()));
+		} catch (NoSuchFieldException e) {
+			// TODO Auto-generated catch block
+			//e.printStackTrace();
+		}
+	}
+
+	public void buildDescriptionProperties() {
+
+	}
+}
Index: DCWoRMS/trunk/src/schedframe/resources/computing/properties/PropertiesBuilder.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/computing/properties/PropertiesBuilder.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/computing/properties/PropertiesBuilder.java	(revision 477)
@@ -0,0 +1,18 @@
+package schedframe.resources.computing.properties;
+
+import java.util.Properties;
+
+import schedframe.resources.computing.ComputingResource;
+
+public interface PropertiesBuilder {
+
+	public Properties getProperties();
+
+	public void createProperties(ComputingResource resource);
+
+	public void buildBasicProperties();
+
+	public void buildCharacteristicsProperties();
+
+	public void buildDescriptionProperties();
+}
Index: DCWoRMS/trunk/src/schedframe/resources/computing/properties/ResourceProperties.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/computing/properties/ResourceProperties.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/computing/properties/ResourceProperties.java	(revision 477)
@@ -0,0 +1,21 @@
+package schedframe.resources.computing.properties;
+
+import java.util.Properties;
+
+import schedframe.resources.computing.description.AbstractResourceDescription;
+
+public class ResourceProperties extends Properties{
+
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = -2910645588712569885L;
+
+	public ResourceProperties(){
+		
+	}
+	
+	public ResourceProperties(AbstractResourceDescription ard){
+		
+	}
+}
Index: DCWoRMS/trunk/src/schedframe/resources/computing/properties/DefaultPropertiesBuilder.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/computing/properties/DefaultPropertiesBuilder.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/computing/properties/DefaultPropertiesBuilder.java	(revision 477)
@@ -0,0 +1,35 @@
+package schedframe.resources.computing.properties;
+
+import java.util.Properties;
+
+import schedframe.resources.computing.ComputingResource;
+
+public class DefaultPropertiesBuilder implements PropertiesBuilder{
+
+	protected Properties properties;
+	private ComputingResource resource;
+	
+	public Properties getProperties() {
+		return properties;
+	}
+
+	public void createProperties(ComputingResource resource) {
+		this.properties = new Properties();
+		this.resource = resource;
+	}
+
+	public void buildBasicProperties() {
+		properties.setProperty("name", resource.getName());
+		properties.setProperty("type", resource.getType().toString());
+		properties.setProperty("status", resource.getStatus().toString());
+	}
+
+	public void buildCharacteristicsProperties() {
+		
+	}
+
+	public void buildDescriptionProperties() {
+
+	}
+
+}
Index: DCWoRMS/trunk/src/schedframe/resources/computing/properties/PropertiesDirector.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/computing/properties/PropertiesDirector.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/computing/properties/PropertiesDirector.java	(revision 477)
@@ -0,0 +1,24 @@
+package schedframe.resources.computing.properties;
+
+import java.util.Properties;
+
+import schedframe.resources.computing.ComputingResource;
+
+public class PropertiesDirector {
+	PropertiesBuilder propBuilder;
+
+	public void setPropertiesBuilder(PropertiesBuilder pb) {
+		propBuilder = pb;
+	}
+
+	public Properties getProperties() {
+		return propBuilder.getProperties();
+	}
+
+	public void constructProperties(ComputingResource resource) {
+		propBuilder.createProperties(resource);
+		propBuilder.buildBasicProperties();
+		propBuilder.buildCharacteristicsProperties();
+		propBuilder.buildDescriptionProperties();
+	}
+}
Index: DCWoRMS/trunk/src/schedframe/resources/computing/ComputingResource.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/computing/ComputingResource.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/computing/ComputingResource.java	(revision 477)
@@ -0,0 +1,295 @@
+package schedframe.resources.computing;
+
+import gridsim.GridSimTags;
+import gridsim.gssim.WormsTags;
+
+import java.util.ArrayList;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Properties;
+
+import schedframe.Initializable;
+import schedframe.events.Event;
+import schedframe.events.EventHandler;
+import schedframe.events.ResourceEventCommand;
+import schedframe.events.scheduling.EventReason;
+import schedframe.events.scheduling.SchedulingEvent;
+import schedframe.events.scheduling.SchedulingEventCommand;
+import schedframe.exceptions.ResourceException;
+import schedframe.resources.Resource;
+import schedframe.resources.ResourceStatus;
+import schedframe.resources.ResourceType;
+import schedframe.resources.computing.description.ComputingResourceDescription;
+import schedframe.resources.computing.extensions.Extension;
+import schedframe.resources.computing.extensions.ExtensionList;
+import schedframe.resources.computing.extensions.ExtensionListImpl;
+import schedframe.resources.computing.extensions.ExtensionType;
+import schedframe.resources.computing.profiles.energy.EnergyEvent;
+import schedframe.resources.computing.profiles.energy.EnergyEventType;
+import schedframe.resources.computing.profiles.energy.EnergyExtension;
+import schedframe.resources.computing.profiles.energy.power.ui.PowerInterface;
+import schedframe.resources.computing.properties.DefaultPropertiesBuilder;
+import schedframe.resources.computing.properties.PropertiesDirector;
+import schedframe.resources.computing.validator.ResourceNameValidator;
+import schedframe.resources.computing.validator.ResourcePropertiesValidator;
+import schedframe.resources.computing.validator.ResourceStatusValidator;
+import schedframe.resources.computing.validator.ResourceTypeValidator;
+import schedframe.resources.computing.validator.ResourceValidator;
+import schedframe.resources.units.PEUnit;
+import schedframe.resources.units.ResourceUnit;
+import schedframe.resources.units.StandardResourceUnitName;
+import schedframe.scheduling.Scheduler;
+
+public class ComputingResource implements Resource, Initializable{
+	
+	protected String name;
+	protected ResourceType type;
+	protected ResourceStatus status;
+
+	protected ComputingResource parent;
+	protected List<ComputingResource> children;
+	
+	protected Scheduler scheduler;
+	protected ResourceCharacteristics resourceCharacteristic;
+	protected ExtensionList extensionList;
+	
+
+	public ExtensionList getExtensionList() {
+		return extensionList;
+	}
+
+	public ComputingResource(ComputingResourceDescription resDesc) {
+		this.type = resDesc.getType();
+		this.name = resDesc.getId();
+		this.status = ResourceStatus.FREE;
+		this.extensionList = new ExtensionListImpl(1);
+		initCharacteristics(resDesc);
+		addFakeProcessors();
+	}
+
+	//TODO remove if possible (check if all scenarios can be realized - statistics issue) , since it's temporary method
+	private void addFakeProcessors() {
+		if(getResourceCharacteristic().getResourceUnits().get(StandardResourceUnitName.PE) != null){
+			for(ResourceUnit resUnit: getResourceCharacteristic().getResourceUnits().get(StandardResourceUnitName.PE)){
+				PEUnit peUnit = (PEUnit) resUnit;
+				for(int i = 0; i < peUnit.getAmount(); i++){
+					schemas.ComputingResource fakeCompResource = new schemas.ComputingResource();
+					fakeCompResource.setClazz("Processor");
+					addChild(ResourceFactory.createResource(new ComputingResourceDescription(fakeCompResource)));
+				}
+			}
+		}
+	}
+
+	protected void initCharacteristics(ComputingResourceDescription resDesc){
+		resourceCharacteristic = new ResourceCharacteristics.Builder().resourceUnits(resDesc.getResourceUnits()).location(resDesc.getLocation()).parameters(resDesc.getParameters()).build();
+	}
+	
+	public ComputingResource getParent() {
+		return parent;
+	}
+
+	public void setParent(ComputingResource newParent) {
+		parent = newParent;
+	}
+
+	public List<ComputingResource> getChildren() {
+		if (children == null)
+			return new ArrayList<ComputingResource>(1);
+		return children;
+	}
+
+	public void addChild(ComputingResource child) {
+		child.setParent(this);
+		if (children == null)
+			children = new ArrayList<ComputingResource>();
+		children.add(child);
+	}
+
+	public String getName() {
+		return name;
+	}
+
+	public ResourceType getType() {
+		return type;
+	}
+
+	public ResourceCharacteristics getResourceCharacteristic() {
+		return resourceCharacteristic;
+	}
+
+	public ResourceStatus getStatus() {
+		return status;
+	}
+
+	public void setStatus(ResourceStatus newStatus) {
+		if(newStatus != status){
+			status = newStatus;
+			if(children != null) {
+				for(ComputingResource child: children){
+					child.setStatus(status);
+				}
+			}	
+		}
+	}
+	
+	private void triggerEventUp(Event event) {
+		if(parent != null)
+			parent.handleEvent(event);
+	}
+
+	public void handleEvent(Event event){
+		ResourceEventCommand rec = new ResourceEventCommand(this);
+		rec.execute(event);
+		SchedulingEventCommand sec = new SchedulingEventCommand(this);
+		sec.execute(event);
+
+		
+		//old, correctly working method
+		/*if (extensionList != null) {
+			for (Extension extension : extensionList) {
+				if (extension.supportsEvent(event)) {
+					extension.handleEvent(event);
+				}
+			}
+		}*/
+		//TODO - delete, check before
+		//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);
+		//}
+		//triggerEventUp(event);
+	}
+	
+	public List <? extends ComputingResource> getDescendantsByType(ResourceType type) {
+		List<ResourceValidator> validators = new ArrayList<ResourceValidator>();
+		validators.add(new ResourceTypeValidator(type));
+		return searchDescendants(validators, true);
+	}
+
+	public List<? extends ComputingResource> getDescendantsByTypeAndStatus(ResourceType type, ResourceStatus status) {
+		List<ResourceValidator> validators = new ArrayList<ResourceValidator>();
+		validators.add(new ResourceStatusValidator(status));
+		validators.add(new ResourceTypeValidator(type));
+		return searchDescendants(validators, true);
+	}
+
+	public ComputingResource getDescendantByName(String resourceName) throws ResourceException {
+		List<ResourceValidator> validators = new ArrayList<ResourceValidator>();
+		validators.add(new ResourceNameValidator(resourceName));
+		List<? extends ComputingResource> resources = searchDescendants(validators, true);
+		return resources.size() == 0 ? null : resources.get(0);
+	}
+	
+	public List<? extends ComputingResource> filterDescendants(Properties properties)  {
+		List<ResourceValidator> validators = new ArrayList<ResourceValidator>();
+		validators.add(new ResourcePropertiesValidator(properties));
+		return searchDescendants(validators, false);
+	}
+	
+	protected List<? extends ComputingResource> searchDescendants(List<ResourceValidator> validators, boolean cutoff) {
+
+		List<ComputingResource> descendants = new ArrayList<ComputingResource>();
+		if (children != null) {
+			LinkedList<ComputingResource> toExamine = new LinkedList<ComputingResource>();
+			toExamine.push(this);
+
+			while (!toExamine.isEmpty()) {
+				ComputingResource resource = toExamine.pop();
+				List<ComputingResource> resources = resource.getChildren();
+				/*if (resources == null)
+					continue;*/
+				int numberOfRes = resources.size();
+				for (int i = 0; i < numberOfRes; i++) {
+					ComputingResource resourceChild = resources.get(i);
+					if (resourceChild.match(validators)) {
+						descendants.add(resourceChild);
+						if(cutoff == false) {
+							toExamine.addLast(resourceChild);
+						}
+					} else
+						//toExamine.insertElementAt(resourceChild, 0);
+						toExamine.addLast(resourceChild);
+				}
+			}
+		}
+		return descendants;
+	}
+	
+	protected boolean match(List<ResourceValidator> validators){
+		for(ResourceValidator validator: validators){
+			if(validator.validate(this) == false)
+				return false;
+		}
+		return true;
+	}
+	
+	public Properties getProperties(){
+		PropertiesDirector propDirector = new PropertiesDirector();
+		propDirector.setPropertiesBuilder(new DefaultPropertiesBuilder());
+		propDirector.constructProperties(this);
+		return propDirector.getProperties();
+	}
+	
+	public PowerInterface getPowerInterface(){
+		if (extensionList != null) {
+			for (Extension extension : extensionList) {
+				if (extension.getType() == ExtensionType.ENERGY_EXTENSION) {
+					EnergyExtension ee = (EnergyExtension)extension;
+					return ee.getPowerInterface();
+				}
+			}
+		}
+		return null;
+	}
+
+	public Scheduler getScheduler() {
+		return scheduler;
+	}
+	
+	public void setScheduler(Scheduler scheduler) {
+		this.scheduler = scheduler;
+		if(children != null){
+			for(ComputingResource child: children){
+				child.setScheduler(scheduler);
+			}	
+		}
+	}
+
+	class SimpleEventHandler implements EventHandler{
+		
+		public void handleResourceEvent(Event event){
+			if (extensionList != null) {
+				for (Extension extension : extensionList) {
+					if (extension.supportsEvent(event)) {
+						extension.handleEvent(event);
+					}
+				}
+			}
+			if(event.getReason() != EventReason.SIM_INIT)
+				triggerEventUp(event);
+		}
+		
+		public void handleSchedulingEvent(SchedulingEvent event){
+
+			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);
+			} else if(parent != null)
+				parent.getEventHandler().handleSchedulingEvent(event);
+		}
+	}
+	
+	public EventHandler getEventHandler(){
+		return new SimpleEventHandler();
+	}
+	
+	public void initiate(){
+		ResourceEventCommand rec = new ResourceEventCommand(this);
+		EnergyEvent event = new EnergyEvent(EnergyEventType.POWER_STATE_CHANGED, "Resource controller");
+		event.setReason(EventReason.SIM_INIT);
+		rec.execute(event);
+		//alternative way
+		//getEventHandler().handleResourceEvent(new EnergyEvent(EnergyEventType.POWER_STATE_CHANGED, "Resource controller"));
+	}
+}
Index: DCWoRMS/trunk/src/schedframe/resources/computing/Processor.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/computing/Processor.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/computing/Processor.java	(revision 477)
@@ -0,0 +1,94 @@
+package schedframe.resources.computing;
+
+import java.util.List;
+import java.util.Properties;
+
+import schedframe.resources.StandardResourceType;
+import schedframe.resources.computing.description.ComputingResourceDescription;
+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.ui.PowerInterface;
+import schedframe.resources.computing.profiles.energy.power.ui.ProcessorPowerInterface;
+import schedframe.resources.computing.properties.CpuPropertiesBuilder;
+import schedframe.resources.computing.properties.PropertiesDirector;
+import schedframe.resources.units.CpuSpeed;
+import schedframe.resources.units.StandardResourceUnitName;
+
+public class Processor extends ComputingResource{
+	
+
+	public Processor (ComputingResourceDescription resDesc) {
+		super(resDesc);
+		//extensionList.add(new EnergyExtension(this, resDesc.getPowerInterface(), resDesc.getEnergyEstimationPlugin()));
+		PowerInterface pi = PowerProfileFactory.createPowerInterface(this, resDesc.getPowerProfile());
+		accept(new EnergyExtension(pi, resDesc.getPowerProfile()));	
+	}
+
+
+	public ComputingNode getComputingNode(){
+		return (ComputingNode)parent;
+	}
+	
+	@SuppressWarnings("unchecked")
+	public List<Core> getCores(){
+		return (List<Core>) getDescendantsByType(StandardResourceType.Core);
+	}
+	
+	public int getMIPS(){
+		int mips;
+		try {
+			mips = getSpeedUnit().getAmount();
+		} catch (NoSuchFieldException e) {
+			mips = 1;
+		}
+		return mips;
+	}
+	
+	public int getAvailableMIPS(){
+		int mips;
+		try {
+			mips = getSpeedUnit().getFreeAmount();
+		} catch (NoSuchFieldException e) {
+			mips = 1;
+		}
+		return mips;
+	}
+
+	private CpuSpeed getSpeedUnit() throws NoSuchFieldException{
+		return (CpuSpeed) resourceCharacteristic.getResourceUnit(StandardResourceUnitName.CPUSPEED);
+	}
+	
+	public ProcessorPowerInterface getPowerInterface(){
+		if (extensionList != null) {
+			if(extensionList.isExtensionAvailable(ExtensionType.ENERGY_EXTENSION)){
+				EnergyExtension ee = (EnergyExtension)extensionList.getExtension(ExtensionType.ENERGY_EXTENSION);
+				return (ProcessorPowerInterface)ee.getPowerInterface();
+			}
+		}
+		return null;
+	}
+	
+	public void initCharacteristics(ComputingResourceDescription resDesc){
+		//resourceCharacteristic = new ResourceCharacteristics.Builder().resourceUnits().build();
+		super.initCharacteristics(resDesc);
+		try{
+			resourceCharacteristic.addResourceUnit(new CpuSpeed(name, Integer.valueOf(resDesc.getCompResourceParameterValue("speed")) * 1, 0));
+		} catch(Exception e){
+			resourceCharacteristic.addResourceUnit(new CpuSpeed(name,  1, 0));
+		}
+	}
+	
+	public Properties getProperties(){
+		PropertiesDirector propDirector = new PropertiesDirector();
+		propDirector.setPropertiesBuilder(new CpuPropertiesBuilder());
+		propDirector.constructProperties(this);
+		return propDirector.getProperties();
+	}
+
+	public void accept(EnergyExtension e){
+		extensionList.add(e);
+		e.setResource(this);
+	}
+}
+
Index: DCWoRMS/trunk/src/schedframe/resources/computing/ResourceFactory.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/computing/ResourceFactory.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/computing/ResourceFactory.java	(revision 477)
@@ -0,0 +1,61 @@
+package schedframe.resources.computing;
+
+import schedframe.resources.StandardResourceType;
+import schedframe.resources.computing.description.ComputingResourceDescription;
+import schedframe.scheduling.Scheduler;
+import schedframe.scheduling.manager.resources.ManagedResources;
+import schedframe.scheduling.plugin.SchedulingPlugin;
+import schedframe.scheduling.plugin.estimation.ExecutionTimeEstimationPlugin;
+import schedframe.scheduling.policy.AbstractManagementSystem;
+import schedframe.scheduling.policy.global.GridBroker;
+import schedframe.scheduling.policy.local.LocalManagementSystem;
+import schedframe.scheduling.queue.TaskQueueList;
+import simulator.WormsConstants;
+
+
+public class ResourceFactory {
+
+	public static ComputingResource createResource(ComputingResourceDescription resDesc){
+		
+		if (resDesc.getType().equals(StandardResourceType.DataCenter))
+			return new DataCenter(resDesc);
+		else if (resDesc.getType().equals(StandardResourceType.ComputingNode))
+			return  new ComputingNode(resDesc);
+		else if (resDesc.getType().equals(StandardResourceType.Processor))
+			return new Processor(resDesc);
+		else
+			return new ComputingResource(resDesc);
+	
+		/*switch(resDesc.getType()){
+			case Grid: return new Grid(resDesc);
+			case DataCenter: return new DataCenter(resDesc);
+			case ComputingNode: return new ComputingNode(resDesc);
+			case Processor: return new Processor(resDesc);
+		default:
+			return new ComputingResource(resDesc);
+		}*/
+	}
+
+	public static Scheduler createScheduler(StandardResourceType type, String id, SchedulingPlugin schedulingPlugin, ExecutionTimeEstimationPlugin execTimeEstimationPlugin, TaskQueueList queues, ManagedResources managedResources) throws Exception{
+		AbstractManagementSystem ms;
+		switch(type){
+			case GS: {
+				ms = new GridBroker("grid",
+						schedulingPlugin, execTimeEstimationPlugin, queues);
+				return new Scheduler(ms, type, managedResources);
+			}
+			case LS: {
+				ms = new LocalManagementSystem(id, WormsConstants.MANAGEMENT_SYSTEM,
+						schedulingPlugin, execTimeEstimationPlugin, queues);
+				return new Scheduler(ms, type, managedResources);
+			}
+
+		default:{
+				ms = new LocalManagementSystem(id, WormsConstants.MANAGEMENT_SYSTEM,
+						schedulingPlugin, execTimeEstimationPlugin, queues);
+				return new Scheduler(ms, type, managedResources);
+			}
+		}
+	}
+}
+
Index: DCWoRMS/trunk/src/schedframe/resources/computing/extensions/ExtensionList.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/computing/extensions/ExtensionList.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/computing/extensions/ExtensionList.java	(revision 477)
@@ -0,0 +1,12 @@
+package schedframe.resources.computing.extensions;
+
+import java.util.List;
+
+public interface ExtensionList extends List<Extension>{
+	
+	public <T extends Extension> List<T> get(ExtensionType type);
+	
+	public Extension getExtension(ExtensionType type);
+	
+	public boolean isExtensionAvailable(ExtensionType type);
+}
Index: DCWoRMS/trunk/src/schedframe/resources/computing/extensions/ExtensionListImpl.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/computing/extensions/ExtensionListImpl.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/computing/extensions/ExtensionListImpl.java	(revision 477)
@@ -0,0 +1,55 @@
+package schedframe.resources.computing.extensions;
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+
+public class ExtensionListImpl extends ArrayList<Extension> implements ExtensionList {
+
+	private static final long serialVersionUID = -3824600938144742457L;
+
+	public ExtensionListImpl(){
+		super();
+	}
+	
+	public ExtensionListImpl(int initialSize){
+		super(initialSize);
+	}
+	
+	public List<Extension> get(ExtensionType type){
+		List<Extension> list = null;
+		
+		for(int i = 0; i < size(); i++){
+			Extension e = get(i);
+			if(e.getType() == type){
+				list = (list == null ? new ArrayList<Extension>(1) : list);
+				list.add(e);
+			}
+		}
+		return list;
+	}
+	
+	public Extension getExtension(ExtensionType type){
+		
+		for(int i = 0; i < size(); i++){
+			Extension e = get(i);
+			if(e.getType() == type){
+				return e;
+			}
+		}
+		return null;
+	}
+	
+	public boolean isExtensionAvailable(ExtensionType type){
+		for(int i = 0; i < size(); i++){
+			Extension e = get(i);
+			if(e.getType() == type){
+				return true;
+			}
+		}
+		return false;
+	}
+	
+	
+}
Index: DCWoRMS/trunk/src/schedframe/resources/computing/extensions/ExtensionException.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/computing/extensions/ExtensionException.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/computing/extensions/ExtensionException.java	(revision 477)
@@ -0,0 +1,22 @@
+package schedframe.resources.computing.extensions;
+
+public class ExtensionException extends Exception {
+
+	private static final long serialVersionUID = -3388688857266748587L;
+	
+	public ExtensionException() {
+		super();
+	}
+
+    public ExtensionException(String message) {
+    	super(message);
+    }
+
+    public ExtensionException(String message, Throwable cause) {
+        super(message, cause);
+    }
+    
+    public ExtensionException(Throwable cause) {
+        super(cause);
+    }
+}
Index: DCWoRMS/trunk/src/schedframe/resources/computing/extensions/Extension.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/computing/extensions/Extension.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/computing/extensions/Extension.java	(revision 477)
@@ -0,0 +1,19 @@
+package schedframe.resources.computing.extensions;
+
+import java.util.Properties;
+
+import schedframe.events.Event;
+
+public interface Extension /*extends Module*/{
+
+	public boolean supportsEvent(Event event);
+
+	//public void handleEvent(Sim_event ev);
+	
+	public void handleEvent(Event event);
+	
+	public void init(Properties properties) throws ExtensionException;
+	
+	public ExtensionType getType();
+}
+
Index: DCWoRMS/trunk/src/schedframe/resources/computing/extensions/ExtensionType.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/computing/extensions/ExtensionType.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/computing/extensions/ExtensionType.java	(revision 477)
@@ -0,0 +1,26 @@
+package schedframe.resources.computing.extensions;
+
+import schedframe.resources.computing.profiles.energy.EnergyExtension;
+import schedframe.scheduling.plugin.grid.JobRegistry;
+
+public enum ExtensionType {
+
+	JOB_REGISTRY("Job registry", JobRegistry.class),
+	ENERGY_EXTENSION("EnergyExtension", EnergyExtension.class);
+	
+	private String name;
+	private Class<?> _interface;
+	
+	private ExtensionType(String name, Class<?> _class){
+		this.name = name;
+		this._interface = _class;
+	}
+	
+	public String toString(){
+		return this.name;
+	}
+	
+	public boolean isValidFor(Extension m){
+		return (m == null ? false : _interface.isAssignableFrom(m.getClass()));
+	}
+}
Index: DCWoRMS/trunk/src/schedframe/resources/computing/Rack.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/computing/Rack.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/computing/Rack.java	(revision 477)
@@ -0,0 +1,34 @@
+package schedframe.resources.computing;
+
+import java.util.List;
+
+import schedframe.resources.StandardResourceType;
+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.ui.PowerInterface;
+
+public class Rack extends ComputingResource{
+	
+
+	public Rack (ComputingResourceDescription resDesc) {
+		super(resDesc);
+		PowerInterface pi = PowerProfileFactory.createPowerInterface(this, resDesc.getPowerProfile());
+		accept(new EnergyExtension(pi, resDesc.getPowerProfile()));	
+	}
+
+	@SuppressWarnings("unchecked")
+	public List<ComputingNode> getComputingNodes(){
+		return (List<ComputingNode>) getDescendantsByType(StandardResourceType.ComputingNode);
+	}
+	
+	@SuppressWarnings("unchecked")
+	public List<Processor> getProcessors(){
+		return (List<Processor>) getDescendantsByType(StandardResourceType.Processor);
+	}
+	
+	public void accept(EnergyExtension e){
+		extensionList.add(e);
+		e.setResource(this);
+	}
+}
Index: DCWoRMS/trunk/src/schedframe/resources/computing/ResourceCharacteristics.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/computing/ResourceCharacteristics.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/computing/ResourceCharacteristics.java	(revision 477)
@@ -0,0 +1,92 @@
+package schedframe.resources.computing;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import schedframe.Parameters;
+import schedframe.resources.computing.location.Location;
+import schedframe.resources.units.ResourceUnit;
+import schedframe.resources.units.ResourceUnitName;
+
+
+public class ResourceCharacteristics /*extends Properties*/{
+
+	private static final long serialVersionUID = 2719535186621622647L;
+
+	protected Map<ResourceUnitName, List<ResourceUnit>> resUnits;
+	protected Parameters parameters;
+	protected Location location;
+
+	/*public ResourceCharacteristics(Map<ResourceUnitName, List<AbstractResourceUnit>> resUnits){
+		this.resUnits = resUnits;
+	}
+
+	public ResourceCharacteristics(){
+		this.resUnits = null;
+	}
+	
+	public ResourceCharacteristics(Map<ResourceUnitName, List<AbstractResourceUnit>> resUnits, Parameters parameters){
+		this(resUnits);
+	}*/
+	
+	public Map<ResourceUnitName, List<ResourceUnit>> getResourceUnits() {
+		if(resUnits == null)
+			return new HashMap<ResourceUnitName, List<ResourceUnit>>();
+		return resUnits;
+	}
+	
+	public ResourceUnit getResourceUnit(ResourceUnitName unitName) throws NoSuchFieldException{
+		if(getResourceUnits().containsKey(unitName))
+			return getResourceUnits().get(unitName).get(0);
+		else throw new NoSuchFieldException("Resource unit " + unitName + 
+				" is not available in this resource ");
+	}
+	
+	public void addResourceUnit(ResourceUnit unit){ 
+		if(resUnits == null){
+			resUnits = new HashMap<ResourceUnitName, List<ResourceUnit>>(2);
+		}
+		List<ResourceUnit> list = null;
+		if(resUnits.containsKey(unit.getName())){
+			list = resUnits.get(unit.getName());
+		} else {
+			list = new ArrayList<ResourceUnit>(1);
+			resUnits.put(unit.getName(), list);
+		}
+		list.add(unit);
+	}
+	
+	
+	public static class Builder {
+		  
+		protected Map<ResourceUnitName, List<ResourceUnit>> resUnits;
+		protected Location location;
+		protected Parameters parameters;
+		
+		public Builder location(Location params){this.location = params; return this; }
+        public Builder parameters(Parameters prop){this.parameters = prop; return this; }
+        public Builder resourceUnits(Map<ResourceUnitName, List<ResourceUnit>> units){this.resUnits = units; return this; }
+        public Builder resourceUnits(){this.resUnits = new HashMap<ResourceUnitName, List<ResourceUnit>>(2); return this; }
+        
+        public ResourceCharacteristics build() {
+            return new ResourceCharacteristics(this);
+        }
+	}
+	
+	private ResourceCharacteristics(Builder builder) {
+		this.location = builder.location;
+		this.parameters = builder.parameters;
+		this.resUnits = builder.resUnits;
+	}
+
+	public Parameters getParameters() {
+		return parameters;
+	}
+
+	public Location getLocation() {
+		return location;
+	}
+
+}
Index: DCWoRMS/trunk/src/schedframe/resources/computing/description/AbstractResourceDescription.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/computing/description/AbstractResourceDescription.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/computing/description/AbstractResourceDescription.java	(revision 477)
@@ -0,0 +1,59 @@
+package schedframe.resources.computing.description;
+
+
+import java.util.ArrayList;
+import java.util.List;
+
+import schedframe.resources.ResourceType;
+
+
+public abstract class AbstractResourceDescription {
+
+	protected String id;
+	protected ResourceType type;
+	protected List<AbstractResourceDescription> children;
+	
+	public AbstractResourceDescription(ResourceType type){
+		this.type = type;
+		this.children = null;
+	}
+
+	public List<AbstractResourceDescription> getChildren() {
+		return children;
+	}
+	
+	public void setChildren(List<AbstractResourceDescription> children) {
+		this.children = children;
+	}
+	
+	public void addChildren(AbstractResourceDescription child) {
+		//child.setParent(this);
+		if(children == null)
+			children = new ArrayList<AbstractResourceDescription> (1);
+		this.children.add(child);
+	}
+
+	public String getId(){
+		return this.id;
+	}
+
+	public ResourceType getType() {
+		return type;
+	}
+	
+	/*protected AbstractResourceDescription parent;
+	/public AbstractResourceDescription getParent() {
+		return parent;
+	}
+
+	public void setParent(AbstractResourceDescription parent) {
+		this.parent = parent;
+	}*/
+	
+	/*public enum ResourceType {
+		COMPUTING_RESOURCE,
+		QUEUING_SYSTEM;
+	}
+	*/
+	
+}
Index: DCWoRMS/trunk/src/schedframe/resources/computing/description/ComputingResourceDescription.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/computing/description/ComputingResourceDescription.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/computing/description/ComputingResourceDescription.java	(revision 477)
@@ -0,0 +1,267 @@
+package schedframe.resources.computing.description;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import schedframe.Parameter;
+import schedframe.Parameters;
+import schedframe.Property;
+import schedframe.resources.ResourceTypeFactory;
+import schedframe.resources.computing.location.Location;
+import schedframe.resources.computing.profiles.energy.airthroughput.AirThroughputProfile;
+import schedframe.resources.computing.profiles.energy.airthroughput.AirThroughputState;
+import schedframe.resources.computing.profiles.energy.airthroughput.plugin.AirThroughputEstimationPlugin;
+import schedframe.resources.computing.profiles.energy.airthroughput.plugin.DefaultAirThroughputEstimationPlugin;
+import schedframe.resources.computing.profiles.energy.power.PState;
+import schedframe.resources.computing.profiles.energy.power.PowerProfile;
+import schedframe.resources.computing.profiles.energy.power.PowerState;
+import schedframe.resources.computing.profiles.energy.power.PowerStateNameFactory;
+import schedframe.resources.computing.profiles.energy.power.Transition;
+import schedframe.resources.computing.profiles.energy.power.plugin.EnergyEstimationPlugin;
+import schedframe.resources.units.ResourceUnit;
+import schedframe.resources.units.ResourceUnitFactory;
+import schedframe.resources.utils.ResourceIdGenerator;
+import schemas.ComputingResource;
+import schemas.Profile;
+import simulator.utils.InstanceFactory;
+import example.energy.DefaultEnergyEstimationPlugin;
+
+public class ComputingResourceDescription extends ExecutingResourceDescription {
+
+	//protected Map<ResourceUnitName, List<AbstractResourceUnit>> resUnits;
+	protected PowerProfile powerProfile;
+	protected AirThroughputProfile airThroughputProfile;
+	protected Location location;
+	//protected Parameters parameters;
+
+	public ComputingResourceDescription(ComputingResource computingResource) {
+
+		super(ResourceTypeFactory.createResourceType(computingResource.getClazz()));
+
+		initId(computingResource);
+
+		if (computingResource.getComputingResourceTypeChoiceSequence() != null) {
+			initResourceUnits(computingResource.getComputingResourceTypeChoiceSequence().getResourceUnit());
+			initProfiles(computingResource.getComputingResourceTypeChoiceSequence().getProfile());
+			initLocation(computingResource.getComputingResourceTypeChoiceSequence().getLocation());
+			this.parameters = extractParameters(computingResource.getComputingResourceTypeChoiceSequence().getParameter());
+		}
+	}
+
+	private void initId(ComputingResource computingResource){
+		this.id = computingResource.getName() != null ? computingResource.getName() : type.toString();
+		if(computingResource.getCount() > 1 || computingResource.getName() == null){
+			this.id = id + "_" + String.valueOf(ResourceIdGenerator.getId(type));
+		}
+	}
+	
+	private void initResourceUnits(schemas.ResourceUnit[] resourceUnitCharacteristics) {
+		for (int i = 0; i < resourceUnitCharacteristics.length; i++) {
+			schemas.ResourceUnit resourceUnitCharacteristic = resourceUnitCharacteristics[i];
+			ResourceUnit resourceUnit = ResourceUnitFactory.createUnit(resourceUnitCharacteristic.getClazz(), this.id,
+					 Double.valueOf(resourceUnitCharacteristic.getAmount().getContent()).intValue(), 0);
+			Parameters params = extractParameters(resourceUnitCharacteristic.getParameter());
+			resourceUnit.init(params);
+			addResourceUnit(resourceUnit);
+		}
+	}
+
+	private void initProfiles(Profile profile) {
+		if (profile != null) {
+			initPowerProfile(profile.getPowerProfile());
+			initAirThroughputProfile(profile.getAirThroughputProfile());
+		}
+	}
+	
+	private void initPowerProfile(schemas.PowerProfile powerProfileCharacteristic) {
+		
+		if (powerProfileCharacteristic != null) {
+			EnergyEstimationPlugin energyEstimationPlugin = null;
+			List<PowerState> powerStates = null;
+			List<PState> pStates = null;
+			if(powerProfileCharacteristic.getEnergyEstimationPlugin() != null){
+				String  energyEstimationPluginName = powerProfileCharacteristic.getEnergyEstimationPlugin().getName();
+				if(energyEstimationPluginName != null) {
+					energyEstimationPlugin = (EnergyEstimationPlugin) InstanceFactory.createInstance(
+							energyEstimationPluginName, EnergyEstimationPlugin.class);			
+				} else {
+					energyEstimationPlugin = new DefaultEnergyEstimationPlugin();
+				}
+				Parameters params = extractParameters(powerProfileCharacteristic.getEnergyEstimationPlugin().getParameter());
+				energyEstimationPlugin.init(params);
+			}
+			
+			if (powerProfileCharacteristic.getPowerStates() != null) {
+				powerStates = new ArrayList<PowerState>();
+				int powerStateCount = powerProfileCharacteristic.getPowerStates().getPowerStateCount();
+				for (int i = 0; i < powerStateCount ; i++) {
+					schemas.PowerState ps = powerProfileCharacteristic.getPowerStates().getPowerState(i);
+					List<Transition> transitions = new ArrayList<Transition>();
+					int transitionCount = ps.getTransitionCount();
+					for (int j = 0; j < transitionCount; j++) {
+						schemas.Transition t = ps.getTransition(j);
+						Transition transition = new Transition(PowerStateNameFactory.createPowerStateName(t.getTo()), t
+								.getPowerUsage().getContent(), t.getTime().getContent());
+						Parameters params = extractParameters(t.getParameter());
+						transition.init(params);
+						transitions.add(transition);
+					}
+					PowerState powerState = new PowerState(PowerStateNameFactory.createPowerStateName(ps.getName()), ps
+							.getPowerUsage().getContent(), transitions);
+					Parameters params = extractParameters(ps.getParameter());
+					powerState.init(params);
+					powerStates.add(powerState);
+				}
+			}
+			
+			if(powerProfileCharacteristic.getParameter() != null){
+				pStates = new ArrayList<PState>();
+				int parameterCount =  powerProfileCharacteristic.getParameterCount();
+				for(int i = 0; i < parameterCount; i++){
+					schemas.Parameter parameter = powerProfileCharacteristic.getParameter(i);
+					if(parameter.getName().equals("pState")){
+						PState.Builder builder =  new PState.Builder();
+						int propertyCount = parameter.getParameterTypeSequence().getPropertyCount();
+						for(int j = 0; j < propertyCount; j++){
+							schemas.Property property = parameter.getParameterTypeSequence().getProperty(j);
+							if(property.getName().equals("name")){
+								 builder = builder.name(property.getStringValueWithUnit(0).getContent());
+							} else if (property.getName().equals("frequency")){
+								 builder = builder.frequency(Double.valueOf(property.getStringValueWithUnit(0).getContent()));
+							} else if (property.getName().equals("voltage")){
+								builder = builder.voltage(Double.valueOf(property.getStringValueWithUnit(0).getContent()));
+							} else if (property.getName().equals("powerUsage")){
+								builder = builder.powerUsage(Double.valueOf(property.getStringValueWithUnit(0).getContent()));
+							}
+						}
+						PState pState = builder.build();
+						pStates.add(pState);
+					}
+				}	
+			}
+			this.powerProfile = new PowerProfile(energyEstimationPlugin, powerStates, pStates);
+			Parameters params = extractParameters(powerProfileCharacteristic.getParameter());
+			this.powerProfile.init(params);
+		}
+	}
+
+	private void initAirThroughputProfile(schemas.AirThroughputProfile airThroughputProfile) {
+		if (airThroughputProfile != null) {
+			
+			AirThroughputEstimationPlugin airThroughputEstimationPlugin = null;
+			List<AirThroughputState> airThroughputStates = null;
+			if(airThroughputProfile.getAirThroughputEstimationPlugin() != null){
+				String airThroughputEstimationPluginName = airThroughputProfile.getAirThroughputEstimationPlugin().getName();
+				if(airThroughputEstimationPluginName != null) {
+					airThroughputEstimationPlugin = (AirThroughputEstimationPlugin) InstanceFactory.createInstance(
+							airThroughputEstimationPluginName, AirThroughputEstimationPlugin.class);			
+				} else {
+					airThroughputEstimationPlugin = new DefaultAirThroughputEstimationPlugin();
+				}
+				Parameters params = extractParameters(airThroughputProfile.getAirThroughputEstimationPlugin().getParameter());
+				airThroughputEstimationPlugin.init(params);
+			}
+			if(airThroughputProfile.getAirThroughputStates() != null){
+				airThroughputStates = new ArrayList<AirThroughputState>();
+				int airThrouhputStateCount =  airThroughputProfile.getAirThroughputStates().getAirThroughputStateCount();
+				for (int i = 0; i < airThrouhputStateCount; i++) {
+					schemas.AirThroughputState ats = airThroughputProfile.getAirThroughputStates().getAirThroughputState(i);
+					AirThroughputState airThroughputState = new AirThroughputState(ats.getName(), ats.getValue()
+							.getContent(), ats.getPowerUsage().getContent());
+					Parameters params = extractParameters(ats.getParameter());
+					airThroughputState.init(params);
+					airThroughputStates.add(airThroughputState);
+				}
+			}
+			this.airThroughputProfile = new AirThroughputProfile(airThroughputEstimationPlugin, airThroughputStates);
+			Parameters params = extractParameters(airThroughputProfile.getParameter());
+			this.airThroughputProfile.init(params);
+		}
+	}
+	
+	private void initLocation(schemas.Location l) {
+		if (location != null) {
+			this.location = new Location(l.getHorizontal(), l.getVertical(), l.getDepth());
+			Parameters params = extractParameters(l.getParameter());
+			this.location.init(params);
+		}
+	}
+
+
+
+	/*private Properties initProperties(schemas.Parameter[] parameters){
+		Properties prop = new Properties();
+		
+		for(int i = 0; i < parameters.length; i++){
+			schemas.Parameter parameter = parameters[i];
+			List values = new ArrayList();
+			if(parameter.getParameterTypeSequence().getProperty() != null)
+			{
+				Map<String, List<StringValueWithUnit>> properties = new HashMap<String, List<StringValueWithUnit>>();
+				List<StringValueWithUnit> propValues = new ArrayList<StringValueWithUnit>();
+				for(int j = 0; j < parameter.getParameterTypeSequence().getPropertyCount(); j++){
+					schemas.Property property = parameter.getParameterTypeSequence().getProperty(j);
+					for(int k = 0; k < property.getStringValueWithUnitCount(); k++){
+						propValues.add(property.getStringValueWithUnit(k));
+					}
+					properties.put(property.getName(), propValues);
+				}
+				values.add(properties);
+			}else {
+				for(int j = 0; j < parameter.getStringValueWithUnitCount(); j++){
+					values.add(parameter.getStringValueWithUnit(j));
+				}
+			}
+			prop.put(parameter.getName(), values);
+		}
+		return prop;
+	}*/
+	
+	private Parameters extractParameters(schemas.Parameter[] parameters){
+		
+		Parameters params = null;
+		
+		if(parameters.length != 0)
+			params = new Parameters();
+		
+		for(int i = 0; i < parameters.length; i++){
+			schemas.Parameter parameter = parameters[i];
+			Parameter param = new Parameter(parameter.getName());
+			if(parameter.getParameterTypeSequence() != null && parameter.getParameterTypeSequence().getProperty() != null)
+			{							
+				int propertyCount = parameter.getParameterTypeSequence().getPropertyCount();
+				for(int j = 0; j < propertyCount; j++){
+					schemas.Property property = parameter.getParameterTypeSequence().getProperty(j);
+					Property prop = new Property(property.getName());
+					int stringValueWithUnitCount = property.getStringValueWithUnitCount();
+					for(int k = 0; k < stringValueWithUnitCount; k++){
+						prop.add(property.getStringValueWithUnit(k));
+					}
+					param.addProperty(prop);
+				}
+			} else {
+				int stringValueWithUnitCount =  parameter.getStringValueWithUnitCount();
+				for(int j = 0; j < stringValueWithUnitCount; j++){
+					param.add(parameter.getStringValueWithUnit(j));
+				}
+			}
+			params.put(parameter.getName(), param);
+		}
+		return params;
+	}
+
+	public PowerProfile getPowerProfile() {
+		return powerProfile;
+	}
+
+	public AirThroughputProfile getAirThroughputProfile() {
+		return airThroughputProfile;
+	}
+
+	public Location getLocation() {
+		return location;
+	}
+
+
+
+}
Index: DCWoRMS/trunk/src/schedframe/resources/computing/description/ExecutingResourceDescription.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/computing/description/ExecutingResourceDescription.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/computing/description/ExecutingResourceDescription.java	(revision 477)
@@ -0,0 +1,74 @@
+package schedframe.resources.computing.description;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import schedframe.Parameters;
+import schedframe.resources.ResourceType;
+import schedframe.resources.units.ResourceUnit;
+import schedframe.resources.units.ResourceUnitName;
+
+public class ExecutingResourceDescription extends AbstractResourceDescription {
+
+	protected Map<ResourceUnitName, List<ResourceUnit>> resUnits;
+	protected Parameters parameters;
+	
+	public ExecutingResourceDescription(ResourceType type) {
+		super(type);
+	}
+
+	public Parameters getParameters() {
+		return parameters;
+	}
+	
+	public String getCompResourceParameterValue(String name){
+		return getParameters().get(name).get(0).getContent();
+	}
+	
+	public void addResourceUnit(ResourceUnit unit) {
+		if (this.resUnits == null)
+			this.resUnits = new HashMap<ResourceUnitName, List<ResourceUnit>>(1);
+		List<ResourceUnit> list = null;
+		if (this.resUnits.containsKey(unit.getName())) {
+			list = this.resUnits.get(unit.getName());
+		} else {
+			list = new ArrayList<ResourceUnit>(1);
+			this.resUnits.put(unit.getName(), list);
+		}
+		list.add(unit);
+	}
+	
+	public ResourceUnit getResourceUnit(ResourceUnitName unitName) throws NoSuchFieldException {
+		return getResourceUnitList(unitName).get(0);
+	}
+
+	public List<ResourceUnit> getResourceUnitList(ResourceUnitName unitName) throws NoSuchFieldException {
+		if (resUnits.containsKey(unitName))
+			return resUnits.get(unitName);
+		else
+			throw new NoSuchFieldException("Resource unit " + unitName + " is not available in resource " + this.id);
+	}
+
+	public Collection<ResourceUnit> getResourceUnit() {
+		if (resUnits == null)
+			return null;
+		List<ResourceUnit> values = new ArrayList<ResourceUnit>();
+		Collection<List<ResourceUnit>> lists = resUnits.values();
+		Iterator<List<ResourceUnit>> itr = lists.iterator();
+
+		while (itr.hasNext()) {
+			List<ResourceUnit> list = itr.next();
+			values.addAll(list);
+		}
+
+		return values;
+	}
+
+	public Map<ResourceUnitName, List<ResourceUnit>> getResourceUnits() {
+		return resUnits;
+	}
+}
Index: DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/power/CPUPowerProfile.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/power/CPUPowerProfile.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/power/CPUPowerProfile.java	(revision 477)
@@ -0,0 +1,24 @@
+package schedframe.resources.computing.profiles.energy.power;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import schedframe.resources.computing.profiles.energy.power.plugin.EnergyEstimationPlugin;
+
+public class CPUPowerProfile extends PowerProfile{
+
+	protected Map<String, PState> supportedPStates;
+
+	public CPUPowerProfile(EnergyEstimationPlugin energyEstimationPlugin, List<schedframe.resources.computing.profiles.energy.power.PowerState> supportedPowerStates, List<schedframe.resources.computing.profiles.energy.power.PState> pStates){
+		super(energyEstimationPlugin, supportedPowerStates);
+		supportedPStates = new HashMap<String, PState>();
+		for(PState pState: pStates){
+			supportedPStates.put(pState.getName(), pState);
+		}
+	}
+
+	public Map<String, PState> getSupportedPStates() {
+		return supportedPStates;
+	}
+}
Index: DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/power/PowerProfileFactory.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/power/PowerProfileFactory.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/power/PowerProfileFactory.java	(revision 477)
@@ -0,0 +1,50 @@
+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 PowerProfileFactory {
+
+
+
+	//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 throw new IllegalArgumentException("ResourceType " + resource.getType() + " is not supported.");
+
+		/*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/src/schedframe/resources/computing/profiles/energy/power/PowerStateNameFactory.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/power/PowerStateNameFactory.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/power/PowerStateNameFactory.java	(revision 477)
@@ -0,0 +1,25 @@
+package schedframe.resources.computing.profiles.energy.power;
+
+
+public class PowerStateNameFactory {
+	
+	public static PowerStateName createPowerStateName (String powerStateName){
+		
+		if(powerStateName.equals(StandardPowerStateName.ON.getName()))
+			return StandardPowerStateName.ON;
+		
+		else if(powerStateName.equals(StandardPowerStateName.OFF.getName()))
+			return StandardPowerStateName.OFF;
+		
+		else if(powerStateName.equals(StandardPowerStateName.HIBERNATE.getName()))
+			return StandardPowerStateName.HIBERNATE;
+		
+		else if(powerStateName.equals(StandardPowerStateName.SLEEP.getName()))
+			return StandardPowerStateName.SLEEP;
+		
+		else if(powerStateName.equals(StandardPowerStateName.SUSPEND.getName()))
+			return StandardPowerStateName.SUSPEND;
+		
+		else return new UserPowerStateName(powerStateName);
+	}
+}
Index: DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/power/Transition.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/power/Transition.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/power/Transition.java	(revision 477)
@@ -0,0 +1,29 @@
+package schedframe.resources.computing.profiles.energy.power;
+
+import schedframe.Parameters;
+
+public class Transition {
+	protected PowerStateName to;
+	protected double powerUsage;
+	protected double time;
+	
+	public Transition(PowerStateName to, double powerUsage, double time) {
+		super();
+		this.to = to;
+		this.powerUsage = powerUsage;
+		this.time = time;
+	}
+	public PowerStateName getTo() {
+		return to;
+	}
+	public double getPowerUsage() {
+		return powerUsage;
+	}
+	public double getTime() {
+		return time;
+	}
+	
+	public void init(Parameters parameters){
+		
+	}
+}
Index: DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/power/PowerProfile.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/power/PowerProfile.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/power/PowerProfile.java	(revision 477)
@@ -0,0 +1,111 @@
+package schedframe.resources.computing.profiles.energy.power;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.joda.time.DateTimeUtils;
+
+import schedframe.Parameters;
+import schedframe.resources.computing.profiles.energy.power.plugin.EnergyEstimationPlugin;
+
+public class PowerProfile {
+
+	protected List<PowerUsage> powerUsage;
+	protected EnergyEstimationPlugin energyEstimationPlugin;
+
+	protected List<schedframe.resources.computing.profiles.energy.power.PowerState> supportedPowerStates;
+	protected Map<String, PState> supportedPStates;
+	
+	protected Parameters parameters;
+	
+
+	public PowerProfile(EnergyEstimationPlugin energyEstimationPlugin, List<PowerState> supportedPowerStates) {
+		this.energyEstimationPlugin = energyEstimationPlugin;
+		this.powerUsage = new ArrayList<PowerUsage>();
+		this.supportedPowerStates = supportedPowerStates;
+	}
+	
+	public PowerProfile(EnergyEstimationPlugin energyEstimationPlugin, List<PowerState> supportedPowerStates,  List<PState> pStates) {
+		this.energyEstimationPlugin = energyEstimationPlugin;
+		this.supportedPowerStates = supportedPowerStates;
+		this.powerUsage = new ArrayList<PowerUsage>();
+		if(pStates.size() > 0)
+			this.supportedPStates = new HashMap<String, PState>();
+		for(PState pState: pStates){
+			supportedPStates.put(pState.getName(), pState);
+		}
+	}
+	
+	/*public void initPlugin(String energyEstimationPluginClassName){
+		if(energyEstimationPluginClassName != null) {
+			energyEstimationPlugin = (EnergyEstimationPluginInterface) InstanceFactory.createInstance(
+					energyEstimationPluginClassName, EnergyEstimationPluginInterface.class);
+			if(energyEstimationPlugin == null){
+				energyEstimationPlugin = new DefaultEnergyEstimationPlugin();
+				log.info("Using default energy estimation plugin: " + DefaultEnergyEstimationPlugin.class.getName());
+				
+			} else {
+				energyEstimationPlugin.init(null);
+			}		
+		} else {
+			energyEstimationPlugin = new DefaultEnergyEstimationPlugin();
+			log.info("Using default energy estimation plugin: " + DefaultEnergyEstimationPlugin.class.getName());
+		}
+	}*/
+	
+	public EnergyEstimationPlugin getEnergyEstimationPlugin() {
+		return energyEstimationPlugin;
+	}
+	
+	public List<schedframe.resources.computing.profiles.energy.power.PowerState> getSupportedPowerStates() throws NoSuchFieldException{
+		if(supportedPowerStates == null)
+			throw new NoSuchFieldException("Supported power states are not defined.");
+		return supportedPowerStates;
+	}
+	
+	public Map<String, PState> getSupportedPStates() throws NoSuchFieldException {
+		if(supportedPStates == null)
+			throw new NoSuchFieldException("Supported p-states are not defined.");
+		return supportedPStates;
+	}
+	
+	public void addToPowerUsageHistory(double power) {
+
+		if (powerUsage.size() == 0) {
+			PowerUsage usage = new PowerUsage(DateTimeUtils.currentTimeMillis(), power);
+			powerUsage.add(usage);
+			return;
+		}
+
+		int lastIdx = powerUsage.size() - 1;
+		double lastPower = powerUsage.get(lastIdx).getValue();
+		if (lastPower != power) {
+			PowerUsage usage = powerUsage.get(lastIdx);
+			long currentTime = DateTimeUtils.currentTimeMillis();
+			if (usage.getTimestamp() == currentTime) {
+				usage.setValue(power);
+				if(lastIdx > 0 && powerUsage.get(lastIdx - 1).getValue() == power)
+					powerUsage.remove(usage);
+			} else {
+				usage = new PowerUsage(DateTimeUtils.currentTimeMillis(), power);
+				powerUsage.add(usage);
+			}
+		}
+	}
+
+	public List<PowerUsage> getPowerUsageHistory() {
+		return powerUsage;
+	}
+
+	public void init(Parameters params){
+		this.parameters = params;
+	}
+	
+	public Parameters getParameters() {
+		return parameters;
+	}
+
+
+}
Index: DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/power/PowerState.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/power/PowerState.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/power/PowerState.java	(revision 477)
@@ -0,0 +1,33 @@
+package schedframe.resources.computing.profiles.energy.power;
+
+import java.util.List;
+
+import schedframe.Parameters;
+
+public class PowerState {
+	
+	protected PowerStateName name;
+	protected double powerUsage;
+	protected List<Transition> transitions;
+	
+	public PowerState(PowerStateName name, double powerUsage, List<Transition> transitions) {
+		super();
+		this.name = name;
+		this.powerUsage = powerUsage;
+		this.transitions = transitions;
+	}
+	public PowerStateName getName() {
+		return name;
+	}
+	public double getPowerUsage() {
+		return powerUsage;
+	}
+	public List<Transition> getTransitions() {
+		return transitions;
+	}
+	
+	public void init(Parameters parameters){
+		
+	}
+	
+}
Index: DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/power/UserPowerStateName.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/power/UserPowerStateName.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/power/UserPowerStateName.java	(revision 477)
@@ -0,0 +1,16 @@
+package schedframe.resources.computing.profiles.energy.power;
+
+public class UserPowerStateName implements PowerStateName {
+
+	protected String name;
+
+	public UserPowerStateName(String name) {
+		this.name = name;
+	}
+
+	public String getName() {
+		return name;
+	}
+
+
+}
Index: DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/power/ui/DataCenterPowerInterface.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/power/ui/DataCenterPowerInterface.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/power/ui/DataCenterPowerInterface.java	(revision 477)
@@ -0,0 +1,35 @@
+package schedframe.resources.computing.profiles.energy.power.ui;
+
+import schedframe.resources.computing.ComputingResource;
+import schedframe.resources.computing.DataCenter;
+import schedframe.resources.computing.profiles.energy.power.PowerProfile;
+import schedframe.resources.computing.profiles.energy.power.PowerStateName;
+import schedframe.resources.computing.profiles.energy.power.StandardPowerStateName;
+
+public class DataCenterPowerInterface extends AbstractPowerInterface{
+
+
+
+	
+	public DataCenterPowerInterface(ComputingResource resource, PowerProfile pp){
+		super(resource, pp);
+		currentPowerState = StandardPowerStateName.ON;
+	}
+
+	public boolean setPowerState(PowerStateName state) {
+		if(!supportPowerState(state))
+			return false;
+		currentPowerState = state;
+		DataCenter dataCenter = (DataCenter)resource;
+
+		for(ComputingResource child: dataCenter.getChildren()){
+			child.getPowerInterface().setPowerState(state);
+		}
+
+		return true;
+	}
+
+
+
+
+}
Index: DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/power/ui/ComputingNodePowerInterface.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/power/ui/ComputingNodePowerInterface.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/power/ui/ComputingNodePowerInterface.java	(revision 477)
@@ -0,0 +1,86 @@
+package schedframe.resources.computing.profiles.energy.power.ui;
+
+import schedframe.resources.ResourceStatus;
+import schedframe.resources.computing.ComputingNode;
+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.PowerStateName;
+import schedframe.resources.computing.profiles.energy.power.StandardPowerStateName;
+
+public class ComputingNodePowerInterface extends AbstractPowerInterface{
+
+	public static long START_TIME = 600000;
+	public static long SHUTDOWN_TIME = 300000;
+	public static double START_COST = 4000;
+	public static double SHUTDOWN_COST = 2000;
+
+	
+	public ComputingNodePowerInterface(ComputingResource resource, PowerProfile pp){
+		super(resource, pp);
+		currentPowerState = StandardPowerStateName.ON;
+	}
+
+	public boolean setPowerState(PowerStateName state){
+		if(!supportPowerState(state))
+			return false;
+		currentPowerState = state;
+		ComputingNode computingNode = (ComputingNode) resource;
+		if(computingNode.getProcessors() != null)
+		{
+			for(ComputingResource child:computingNode.getProcessors()){
+				child.getPowerInterface().setPowerState(state);
+			}
+		} else {
+			computingNode.handleEvent(new EnergyEvent(EnergyEventType.POWER_STATE_CHANGED, computingNode.getName()));
+		}
+		
+		if(state == StandardPowerStateName.OFF){
+			computingNode.setStatus(ResourceStatus.UNAVAILABLE);
+		}
+		else if(state == StandardPowerStateName.ON){
+			computingNode.setStatus(ResourceStatus.FREE);
+		}
+		//computingNode.handleEvent(new EnergyEvent(EnergyEventType.POWER_STATE_CHANGED, computingNode.getName()));
+		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(){
+		setPowerState(StandardPowerStateName.ON);
+	}
+	
+	public void turnOff(){
+		setPowerState(StandardPowerStateName.OFF);
+	}
+
+
+
+}
Index: DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/power/ui/PowerInterface.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/power/ui/PowerInterface.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/power/ui/PowerInterface.java	(revision 477)
@@ -0,0 +1,29 @@
+package schedframe.resources.computing.profiles.energy.power.ui;
+
+import java.util.List;
+
+import schedframe.Parameters;
+import schedframe.resources.computing.profiles.energy.power.PowerState;
+import schedframe.resources.computing.profiles.energy.power.PowerStateName;
+import schedframe.resources.computing.profiles.energy.power.PowerUsage;
+
+public interface PowerInterface {
+
+	public PowerStateName getPowerState();
+	
+	public boolean setPowerState(PowerStateName powerState);
+	
+	public boolean supportPowerState(PowerStateName powerState);
+	
+	public List<PowerState> getSupportedPowerStates() throws NoSuchFieldException;
+	
+	public double getPowerConsumption(PowerStateName state) throws NoSuchFieldException;
+	
+	public PowerUsage getRecentPowerUsage();
+	
+	//public double getCurrentPowerConsumption();
+	
+	List<PowerUsage> getPowerUsageHistory();
+	
+	public Parameters getParameters();
+}
Index: DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/power/ui/ProcessorPowerInterface.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/power/ui/ProcessorPowerInterface.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/power/ui/ProcessorPowerInterface.java	(revision 477)
@@ -0,0 +1,124 @@
+package schedframe.resources.computing.profiles.energy.power.ui;
+
+import java.util.Map;
+
+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.PState;
+import schedframe.resources.computing.profiles.energy.power.PowerProfile;
+import schedframe.resources.computing.profiles.energy.power.PowerStateName;
+import schedframe.resources.computing.profiles.energy.power.StandardPowerStateName;
+import schedframe.resources.units.CpuSpeed;
+import schedframe.resources.units.StandardResourceUnitName;
+
+public class ProcessorPowerInterface extends AbstractPowerInterface {
+
+	protected PState currentPState;
+
+
+	public ProcessorPowerInterface(ComputingResource resource, PowerProfile pp){
+		super(resource, pp);
+		currentPowerState = StandardPowerStateName.ON;
+		try {
+			currentPState = getSupportedPStates().get("P0");
+		} catch (NoSuchFieldException e) {
+			currentPState = null;
+		}
+	}
+	
+	public boolean setPowerState(PowerStateName powerState){
+		if(!supportPowerState(powerState))
+			return false;
+		if(powerState != currentPowerState){
+			currentPowerState = powerState;
+			//Processor cpu = (Processor) resource;
+			if(powerState == StandardPowerStateName.OFF){
+				resource.setStatus(ResourceStatus.UNAVAILABLE);
+			} else if(powerState == StandardPowerStateName.ON){
+				resource.setStatus(ResourceStatus.FREE);
+			}
+			resource.handleEvent(new EnergyEvent(EnergyEventType.POWER_STATE_CHANGED, resource.getName()));
+			//cpu.handleEvent(new EnergyEvent(EnergyEventType.POWER_STATE_CHANGED, cpu.getName()));			
+		}
+
+		return true;
+	}
+
+	public PState getPState(){
+		return currentPState;
+	}
+	
+	public Map<String, PState> getSupportedPStates() throws NoSuchFieldException {
+		return powerProfile.getSupportedPStates();
+	}
+	
+	public boolean supportPState(PState pState) {
+		try {
+			for(String pStateName: getSupportedPStates().keySet()){
+				if(pState.getName().equals(pStateName)){
+					return true;
+				}
+			}
+		} catch (NoSuchFieldException e) {
+			return false;
+		}
+		return false;
+	}
+	
+	public boolean setPState(String pStateName){
+		PState newPState;
+		try {
+			newPState = getSupportedPStates().get(pStateName);
+		} catch (NoSuchFieldException e) {
+			return false;
+		}
+
+		if(newPState != currentPState){
+			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());
+			//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());
+			return true;
+		}
+
+		return false;
+	}
+	
+	public double getFrequency() {
+		return currentPState.getFrequency();
+	}
+
+	public boolean setFrequency(double freq) {
+		try {
+			for(String pStateName: getSupportedPStates().keySet()){
+				if(getSupportedPStates().get(pStateName).getFrequency() == freq){
+					setPState(pStateName);
+					return true;
+				}
+			}
+		} catch (NoSuchFieldException e) {
+			return false;
+		}
+		return false;
+	}
+
+	public double getPowerConsumption(PState state) throws NoSuchFieldException{
+		double powerConsumption = 0;
+		if(supportPState(state)){
+			for(String pStateName: getSupportedPStates().keySet()){
+				if(pStateName.equals(state.getName())){
+					powerConsumption = getSupportedPStates().get(pStateName).getPower();
+					break;
+				}
+			}
+		}
+		return powerConsumption;
+	}
+
+}
+
Index: DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/power/ui/AbstractPowerInterface.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/power/ui/AbstractPowerInterface.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/power/ui/AbstractPowerInterface.java	(revision 477)
@@ -0,0 +1,119 @@
+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 abstract class AbstractPowerInterface implements PowerInterface{
+
+	protected PowerStateName currentPowerState;
+	protected PowerProfile powerProfile;
+	protected ComputingResource resource;
+	
+	public AbstractPowerInterface(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))
+					child.getPowerInterface().setPowerState(state);
+			}
+
+			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/src/schedframe/resources/computing/profiles/energy/power/PowerStateName.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/power/PowerStateName.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/power/PowerStateName.java	(revision 477)
@@ -0,0 +1,7 @@
+package schedframe.resources.computing.profiles.energy.power;
+
+public interface PowerStateName {
+	
+	public String getName();
+
+}
Index: DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/power/plugin/EnergyEstimationPlugin.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/power/plugin/EnergyEstimationPlugin.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/power/plugin/EnergyEstimationPlugin.java	(revision 477)
@@ -0,0 +1,16 @@
+package schedframe.resources.computing.profiles.energy.power.plugin;
+
+import schedframe.Plugin;
+import schedframe.resources.computing.ComputingResource;
+import schedframe.resources.computing.profiles.energy.EnergyEvent;
+import schedframe.scheduling.manager.tasks.JobRegistry;
+
+public interface EnergyEstimationPlugin extends Plugin {
+	
+	public double estimatePowerConsumption(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/src/schedframe/resources/computing/profiles/energy/power/StandardPowerStateName.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/power/StandardPowerStateName.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/power/StandardPowerStateName.java	(revision 477)
@@ -0,0 +1,16 @@
+package schedframe.resources.computing.profiles.energy.power;
+
+
+public enum StandardPowerStateName implements PowerStateName{
+
+	ON,
+	OFF,
+	SLEEP,
+	SUSPEND,
+	HIBERNATE;
+
+	public String getName() {
+		return toString();
+	}
+	
+}
Index: DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/power/PState.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/power/PState.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/power/PState.java	(revision 477)
@@ -0,0 +1,54 @@
+package schedframe.resources.computing.profiles.energy.power;
+
+public class PState {
+
+	protected String name;
+	protected double frequency;
+	protected double voltage;
+	protected double powerUsage;
+
+	/*public PState(PStateType name, double frequency, double voltage, double power) {
+		super();
+		this.name = name;
+		this.frequency = frequency;
+		this.voltage = voltage;
+		this.power = power;
+	}*/
+	
+	public String getName() {
+		return name;
+	}
+	public double getFrequency() {
+		return frequency;
+	}
+	public double getVoltage() {
+		return voltage;
+	}
+	public double getPower() {
+		return powerUsage;
+	}
+	
+	public static class Builder {
+	  
+		protected String name;
+		protected double frequency;
+		protected double voltage;
+		protected double powerUsage;
+		
+		public Builder name(String name){this.name = name; return this; }
+        public Builder frequency(double value){this.frequency = value; return this; }
+        public Builder voltage(double value){this.voltage = value; return this; }
+        public Builder powerUsage(double rate){this.powerUsage = rate; return this; }
+        
+        public PState build() {
+            return new PState(this);
+        }
+	}
+	
+	private PState(Builder builder) {
+		this.name = builder.name;
+		this.frequency = builder.frequency;
+		this.voltage = builder.voltage;
+		this.powerUsage = builder.powerUsage;
+	}
+}
Index: DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/power/PowerUsage.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/power/PowerUsage.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/power/PowerUsage.java	(revision 477)
@@ -0,0 +1,25 @@
+package schedframe.resources.computing.profiles.energy.power;
+
+public class PowerUsage {
+
+	protected long timestamp;
+	protected double value;
+
+	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;
+	}
+	
+}
Index: DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/EnergyEventType.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/EnergyEventType.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/EnergyEventType.java	(revision 477)
@@ -0,0 +1,33 @@
+package schedframe.resources.computing.profiles.energy;
+
+import schedframe.events.EventType;
+
+public enum EnergyEventType implements EventType {
+	
+	TASK_FINISHED(1),
+	TASK_FAILED(2),
+	TASK_CANCELED(4),
+	TASK_STARTED(8),
+
+	TIMER(16),
+
+	POWER_STATE_CHANGED(32),
+	FREQUENCY_CHANGED(64),
+	VOLTAGE_CHANGED(128),
+	RESOURCE_FAILED(256)
+	;
+
+	protected int tag;
+	
+	public int getTag() {
+		return tag;
+	}
+
+	private EnergyEventType(int tag){
+		this.tag = tag;
+	}
+	
+	public String getName(){
+		return toString();
+	}
+}
Index: DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/airthroughput/AirThroughputProfile.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/airthroughput/AirThroughputProfile.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/airthroughput/AirThroughputProfile.java	(revision 477)
@@ -0,0 +1,31 @@
+package schedframe.resources.computing.profiles.energy.airthroughput;
+
+import java.util.List;
+
+import schedframe.Parameters;
+import schedframe.resources.computing.profiles.energy.airthroughput.plugin.AirThroughputEstimationPlugin;
+
+public class AirThroughputProfile {
+	
+	protected AirThroughputEstimationPlugin airThroughputEstimationPlugin;
+	protected List <AirThroughputState> airThroughputStates;
+	protected Parameters parameters;
+
+	public AirThroughputProfile(AirThroughputEstimationPlugin airThroughputEstimationPlugin, List<AirThroughputState> airThroughputStates) {
+		super();
+		this.airThroughputEstimationPlugin = airThroughputEstimationPlugin;
+		this.airThroughputStates = airThroughputStates;
+	}
+
+	public List<AirThroughputState> getAirThroughputStates() {
+		return airThroughputStates;
+	}
+	
+	public void init(Parameters params){
+		this.parameters = params;
+	}
+
+	public Parameters getParameters() {
+		return parameters;
+	}
+}
Index: DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/airthroughput/AirThroughputState.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/airthroughput/AirThroughputState.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/airthroughput/AirThroughputState.java	(revision 477)
@@ -0,0 +1,31 @@
+package schedframe.resources.computing.profiles.energy.airthroughput;
+
+import schedframe.Parameters;
+
+public class AirThroughputState {
+
+	protected String name;
+	protected double value;
+	protected double powerUsage;
+	
+	public AirThroughputState(String name, double value, double powerUsage) {
+		super();
+		this.name = name;
+		this.value = value;
+		this.powerUsage = powerUsage;
+	}
+	
+	public String getName() {
+		return name;
+	}
+	public double getValue() {
+		return value;
+	}
+	public double getPowerUsage() {
+		return powerUsage;
+	}
+	
+	public void init(Parameters parameters){
+		
+	}
+}
Index: DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/airthroughput/ui/DefaultAirThrougputInterface.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/airthroughput/ui/DefaultAirThrougputInterface.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/airthroughput/ui/DefaultAirThrougputInterface.java	(revision 477)
@@ -0,0 +1,64 @@
+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.airthroughput.AirThroughputProfile;
+import schedframe.resources.computing.profiles.energy.airthroughput.AirThroughputState;
+
+public class DefaultAirThrougputInterface implements AirThroughputInterface{
+
+	protected String currentAirThroughputState;
+	protected AirThroughputProfile airThroughputProfile;
+	protected ComputingResource resource;
+	
+	public String getAirThroughputState() {
+		return currentAirThroughputState;
+	}
+
+	public boolean setAirThroughputState(String state) {
+		if(supportAirThroughputState(state)){
+			currentAirThroughputState = state;
+			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/src/schedframe/resources/computing/profiles/energy/airthroughput/ui/AirThroughputInterface.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/airthroughput/ui/AirThroughputInterface.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/airthroughput/ui/AirThroughputInterface.java	(revision 477)
@@ -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 airThrougputState);
+	
+	public boolean supportAirThroughputState(String powerState);
+	
+	public List<AirThroughputState> getSupportedAirThroughputStates() throws NoSuchFieldException;
+	
+	public double getPowerConsumption(String state) throws NoSuchFieldException;
+	
+	public Parameters getParameters();
+}
Index: DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/airthroughput/plugin/AirThroughputEstimationPlugin.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/airthroughput/plugin/AirThroughputEstimationPlugin.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/airthroughput/plugin/AirThroughputEstimationPlugin.java	(revision 477)
@@ -0,0 +1,11 @@
+package schedframe.resources.computing.profiles.energy.airthroughput.plugin;
+
+import schedframe.Plugin;
+import schedframe.events.Event;
+import schedframe.resources.computing.ComputingResource;
+import schedframe.scheduling.manager.tasks.JobRegistry;
+
+public interface AirThroughputEstimationPlugin extends Plugin {
+	
+	public double estimateAirThroughPut(Event event, JobRegistry jobRegistry, ComputingResource resource);
+}
Index: DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/airthroughput/plugin/DefaultAirThroughputEstimationPlugin.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/airthroughput/plugin/DefaultAirThroughputEstimationPlugin.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/airthroughput/plugin/DefaultAirThroughputEstimationPlugin.java	(revision 477)
@@ -0,0 +1,35 @@
+package schedframe.resources.computing.profiles.energy.airthroughput.plugin;
+
+import schedframe.Parameters;
+import schedframe.PluginConfiguration;
+import schedframe.events.Event;
+import schedframe.resources.computing.ComputingResource;
+import schedframe.scheduling.manager.tasks.JobRegistry;
+
+public class DefaultAirThroughputEstimationPlugin implements AirThroughputEstimationPlugin {
+
+	@Override
+	public String getName() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public void init(Parameters properties) {
+		// TODO Auto-generated method stub
+
+	}
+
+	@Override
+	public PluginConfiguration getConfiguration() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public double estimateAirThroughPut(Event event, JobRegistry jobRegistry, ComputingResource resource) {
+		// TODO Auto-generated method stub
+		return 0;
+	}
+
+}
Index: DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/EnergyExtension.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/EnergyExtension.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/EnergyExtension.java	(revision 477)
@@ -0,0 +1,121 @@
+package schedframe.resources.computing.profiles.energy;
+
+import java.util.Properties;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import schedframe.events.Event;
+import schedframe.resources.computing.ComputingResource;
+import schedframe.resources.computing.extensions.Extension;
+import schedframe.resources.computing.extensions.ExtensionException;
+import schedframe.resources.computing.extensions.ExtensionType;
+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 */{
+
+	private Log log = LogFactory.getLog(EnergyExtension.class);
+
+	protected PowerInterface powerInterface;
+	protected PowerProfile powerProfile;
+
+  	protected ComputingResource computingResource;
+
+	public EnergyExtension(PowerInterface powerInterface, PowerProfile pp) {
+		this.powerInterface = powerInterface;
+		this.powerProfile = pp;
+	}
+
+	@Override
+	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;
+		else if(event.getType().getName().equals(EnergyEventType.FREQUENCY_CHANGED.getName()))
+			return true;
+		else if(event.getType().getName().equals(EnergyEventType.TASK_STARTED.getName()))
+			return true;
+		else if(event.getType().getName().equals(EnergyEventType.TASK_FINISHED.getName()))
+			return true;
+		else return false;
+
+	}
+	
+
+	@Override
+	public void handleEvent(Event event) {
+		EnergyEvent enEvent = (EnergyEvent)event;
+		double power = 0;
+		switch (enEvent.getType()) {
+		
+		case POWER_STATE_CHANGED:
+			power = powerProfile.getEnergyEstimationPlugin().estimatePowerConsumption(enEvent, new JobRegistryImpl(computingResource.getName()), computingResource);
+			/*if(resource instanceof ComputingNode){
+				ComputingNode node = (ComputingNode)resource;
+				if(event.getData() instanceof PowerState){
+					PowerState newState = (PowerState)event.getData();
+					if(newState == PowerState.ON) {
+						addToPowerUsageHistory(power+node.getPowerInterface().START_COST);
+						addToPowerUsageHistory(DateTimeUtils.currentTimeMillis()+node.getPowerInterface().START_TIME, power);
+					}else if(newState == PowerState.OFF){
+						addToPowerUsageHistory(power+node.getPowerInterface().SHUTDOWN_COST);
+						addToPowerUsageHistory(DateTimeUtils.currentTimeMillis()+node.getPowerInterface().SHUTDOWN_TIME, power);
+					}
+				}
+			}
+			else */powerProfile.addToPowerUsageHistory(power);
+			break;
+			
+		case FREQUENCY_CHANGED:
+			power = powerProfile.getEnergyEstimationPlugin().estimatePowerConsumption(enEvent, new JobRegistryImpl(computingResource.getName()), computingResource);
+			powerProfile.addToPowerUsageHistory(power);
+			break;
+			
+		case TASK_STARTED:
+			power = powerProfile.getEnergyEstimationPlugin().estimatePowerConsumption(enEvent, new JobRegistryImpl(computingResource.getName()), computingResource);
+			powerProfile.addToPowerUsageHistory(power);
+			break;
+
+		case TASK_FINISHED:
+			//System.out.println(this.resource.getName() + " - ENERGY EXTENSION: TASK FINISHED");
+			power = powerProfile.getEnergyEstimationPlugin().estimatePowerConsumption(enEvent, new JobRegistryImpl(computingResource.getName()), computingResource);
+			//System.out.println(this.resource.getName() + " - ESTIMATED ENERGY:" + power);
+			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;
+	}
+
+	public ComputingResource getResource() {
+		return computingResource;
+	}
+
+	public void setResource(ComputingResource compRes){
+		this.computingResource = compRes;
+	}
+
+	public PowerInterface getPowerInterface() {
+		return powerInterface;
+	}
+
+	public PowerProfile getPowerProfile() {
+		return powerProfile;
+	}
+
+
+}
Index: DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/EnergyException.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/EnergyException.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/EnergyException.java	(revision 477)
@@ -0,0 +1,22 @@
+package schedframe.resources.computing.profiles.energy;
+
+public class EnergyException extends Exception{
+
+	private static final long serialVersionUID = 1L;
+
+	public EnergyException(){
+		super();
+	}
+
+	public EnergyException(String message){
+		super(message);
+	}
+	
+	public EnergyException(Throwable cause){
+		super(cause);
+	}
+	
+	public EnergyException(String message, Throwable cause){
+		super(message, cause);
+	}
+}
Index: DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/EnergyEvent.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/EnergyEvent.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/computing/profiles/energy/EnergyEvent.java	(revision 477)
@@ -0,0 +1,65 @@
+package schedframe.resources.computing.profiles.energy;
+
+import schedframe.events.Event;
+import schedframe.events.EventType;
+import schedframe.events.scheduling.EventReason;
+
+
+public class EnergyEvent implements Event{
+
+	protected EventType type;
+	protected EventReason reason;
+
+	protected String source;
+	protected Object data;
+
+	public EnergyEvent(EventType eventType, String source){
+		this.type = eventType;
+		this.source = source;
+		setReason(EventReason.UNKNOWN);
+	}
+	
+	public EnergyEvent(EventType eventType, Object data){
+		this.type = eventType;
+		this.data = data;
+		setReason(EventReason.UNKNOWN);
+	}
+	
+	public EnergyEvent(EventType eventType, String source, Object data){
+		this.type = eventType;
+		this.source = source;
+		this.data = data;
+		setReason(EventReason.UNKNOWN);
+	}
+	
+	public int getTag() {
+		return type.getTag();
+	}
+
+	public Object getData() {
+		return data;
+	}
+
+	public EnergyEventType getType() {
+		EnergyEventType enEventType; 
+		try{
+			enEventType = (EnergyEventType)type;
+		} catch(Exception e){
+			enEventType = EnergyEventType.POWER_STATE_CHANGED;
+		}
+		return enEventType;
+
+	}
+
+	public String getSource() {
+		return source;
+	}
+
+	public EventReason getReason() {
+		return reason;
+	}
+
+	public void setReason(EventReason reason) {
+		this.reason = reason;
+	}
+}
Index: DCWoRMS/trunk/src/schedframe/resources/computing/Grid.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/computing/Grid.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/computing/Grid.java	(revision 477)
@@ -0,0 +1,12 @@
+package schedframe.resources.computing;
+
+import schedframe.resources.computing.description.ComputingResourceDescription;
+
+public class Grid extends ComputingResource{
+
+	public Grid(ComputingResourceDescription resDesc) {
+		super(resDesc);
+		// TODO Auto-generated constructor stub
+	}
+
+}
Index: DCWoRMS/trunk/src/schedframe/resources/computing/validator/ResourcePropertiesValidator.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/computing/validator/ResourcePropertiesValidator.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/computing/validator/ResourcePropertiesValidator.java	(revision 477)
@@ -0,0 +1,26 @@
+package schedframe.resources.computing.validator;
+
+import java.util.Properties;
+
+import schedframe.resources.computing.ComputingResource;
+
+public class ResourcePropertiesValidator implements ResourceValidator{
+
+	private Properties properties;
+	public ResourcePropertiesValidator(Properties properties) {
+		super();
+		this.properties = properties;
+	}	
+
+	@Override
+	public boolean validate(ComputingResource resource) {
+		Properties resProperties = resource.getProperties();
+		for(Object key:  properties.keySet()){
+			String property = (String) key;
+			if(resProperties.getProperty(property) != properties.getProperty(property))
+				return false;
+		}
+		return true;
+	}
+
+}
Index: DCWoRMS/trunk/src/schedframe/resources/computing/validator/ResourceValidator.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/computing/validator/ResourceValidator.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/computing/validator/ResourceValidator.java	(revision 477)
@@ -0,0 +1,7 @@
+package schedframe.resources.computing.validator;
+
+import schedframe.resources.computing.ComputingResource;
+
+public interface ResourceValidator {
+	boolean validate(ComputingResource resource);
+}
Index: DCWoRMS/trunk/src/schedframe/resources/computing/validator/ResourceNameValidator.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/computing/validator/ResourceNameValidator.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/computing/validator/ResourceNameValidator.java	(revision 477)
@@ -0,0 +1,18 @@
+package schedframe.resources.computing.validator;
+
+import schedframe.resources.computing.ComputingResource;
+
+public class ResourceNameValidator implements ResourceValidator {
+
+	private String name;
+	public ResourceNameValidator(String name) {
+		super();
+		this.name = name;
+	}	
+
+	@Override
+	public boolean validate(ComputingResource resource) {
+		return resource.getName().equals(name);
+	}
+
+}
Index: DCWoRMS/trunk/src/schedframe/resources/computing/validator/ResourceTypeValidator.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/computing/validator/ResourceTypeValidator.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/computing/validator/ResourceTypeValidator.java	(revision 477)
@@ -0,0 +1,19 @@
+package schedframe.resources.computing.validator;
+
+import schedframe.resources.ResourceType;
+import schedframe.resources.computing.ComputingResource;
+
+public class ResourceTypeValidator implements ResourceValidator {
+
+	private ResourceType type;
+	public ResourceTypeValidator(ResourceType type) {
+		super();
+		this.type = type;
+	}	
+
+	@Override
+	public boolean validate(ComputingResource resource) {
+		return resource.getType().getName().equals(type.getName());
+	}
+
+}
Index: DCWoRMS/trunk/src/schedframe/resources/computing/validator/ResourceStatusValidator.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/computing/validator/ResourceStatusValidator.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/computing/validator/ResourceStatusValidator.java	(revision 477)
@@ -0,0 +1,20 @@
+package schedframe.resources.computing.validator;
+
+import schedframe.resources.ResourceStatus;
+import schedframe.resources.computing.ComputingResource;
+
+public class ResourceStatusValidator implements ResourceValidator{
+	
+	private ResourceStatus status;
+	
+	public ResourceStatusValidator(ResourceStatus status) {
+		super();
+		this.status = status;
+	}	
+
+	@Override
+	public boolean validate(ComputingResource resource) {
+		return resource.getStatus() == status;
+	}
+
+}
Index: DCWoRMS/trunk/src/schedframe/resources/Resource.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/Resource.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/Resource.java	(revision 477)
@@ -0,0 +1,12 @@
+package schedframe.resources;
+
+
+public interface Resource {
+
+	public String getName();
+
+	public ResourceType getType();
+
+	public ResourceStatus getStatus();
+	
+}
Index: DCWoRMS/trunk/src/schedframe/resources/UserResourceType.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/UserResourceType.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/UserResourceType.java	(revision 477)
@@ -0,0 +1,16 @@
+package schedframe.resources;
+
+
+public class UserResourceType implements ResourceType {
+
+	protected String name;
+
+	public UserResourceType(String name) {
+		this.name = name;
+	}
+
+	public String getName() {
+		return name;
+	}
+	
+}
Index: DCWoRMS/trunk/src/schedframe/resources/ResourceType.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/ResourceType.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/ResourceType.java	(revision 477)
@@ -0,0 +1,7 @@
+package schedframe.resources;
+
+public interface ResourceType {
+
+	public String getName();
+
+}
Index: DCWoRMS/trunk/src/schedframe/resources/StandardResourceType.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/StandardResourceType.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/StandardResourceType.java	(revision 477)
@@ -0,0 +1,22 @@
+package schedframe.resources;
+
+
+public enum StandardResourceType implements ResourceType {
+
+	Grid,
+	DataCenter,
+	Rack,
+	RECS,
+	ComputingNode,
+	Processor,
+	Core,
+	Undefined,
+	ResourceProvider,
+	GS,
+	LS;
+
+	public String getName() {
+		return toString();
+	}
+	
+}
Index: DCWoRMS/trunk/src/schedframe/resources/ResourceStatus.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/resources/ResourceStatus.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/resources/ResourceStatus.java	(revision 477)
@@ -0,0 +1,11 @@
+package schedframe.resources;
+
+public enum ResourceStatus {
+	BUSY,
+	FREE,
+	RESERVED,
+	FAILED,
+	PENDING,
+	AVAILABLE,
+	UNAVAILABLE;
+}
Index: DCWoRMS/trunk/src/schedframe/ResourceController.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/ResourceController.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/ResourceController.java	(revision 477)
@@ -0,0 +1,146 @@
+package schedframe;
+
+import gridsim.GridSim;
+
+import java.util.Deque;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Set;
+
+import schedframe.exceptions.ResourceException;
+import schedframe.resources.computing.ComputingResource;
+import schedframe.scheduling.Scheduler;
+
+public class ResourceController {
+
+	protected static Scheduler scheduler;
+	protected static List<ComputingResource> computingResources;
+	protected Deque<Initializable> toInit;
+	
+	public  ResourceController(Scheduler logicalStructure, List<ComputingResource> compResources){
+		scheduler = logicalStructure;
+		computingResources = compResources;
+	}
+
+	public Scheduler getScheduler() {
+		return scheduler;
+	}
+
+	public List<ComputingResource> getComputingResources() {
+		return computingResources;
+	}
+
+	public static ComputingResource getComputingResourceByName(String resourceName) throws ResourceException {
+		ComputingResource resourceWithName = null;
+		for (int i = 0; i < computingResources.size() && resourceWithName == null; i++) {
+			ComputingResource resource = computingResources.get(i);
+			if (resource.getName().equals(resourceName))
+				resourceWithName = resource;
+			else
+				resourceWithName = resource.getDescendantByName(resourceName);
+		}
+		return resourceWithName;
+	}
+
+	public static Scheduler getSchedulerByName(String schedulerName) {
+		Scheduler schedulerWithName = null;
+
+		if (scheduler.getName().compareTo(schedulerName) == 0)
+			schedulerWithName = scheduler;
+		else if (scheduler.getChildren() != null) {
+			LinkedList<Scheduler> toExamine = new LinkedList<Scheduler>();
+			toExamine.push(scheduler);
+
+			while (!toExamine.isEmpty() && schedulerWithName != null) {
+				Scheduler scheduler = toExamine.pop();
+				List<Scheduler> schedulers = scheduler .getChildren();
+
+				int numberOfSched = schedulers.size();
+				for (int i = 0; i < numberOfSched; i++) {
+					Scheduler schedulerChild = schedulers.get(i);
+					if(scheduler.getName().equals(schedulerName)){
+						schedulerWithName = schedulerChild;
+						break;
+					} else
+						toExamine.addLast(schedulerChild);
+				}
+			}
+		}
+		return schedulerWithName;
+	}
+	
+	public static Scheduler getScheduler(String resName){
+		if(GridSim.getEntityId(resName) != -1){
+			return  getSchedulerByName(resName);
+		}
+		ComputingResource resourceWithName = null;
+		try {
+			resourceWithName = getComputingResourceByName(resName);
+		} catch (ResourceException e) {
+		}
+		/*for(int i = 0 ; i < computingResources.size() && resourceWithName == null; i++){
+			ComputingResource resource = computingResources.get(i);
+			if(resource.getName().equals(resName))
+				resourceWithName = resource;
+			else
+				try {
+					resourceWithName = resource.getDescendantByName(resName);
+				} catch (ResourceException e) {
+					return null;
+				}
+		}*/
+		if(resourceWithName == null)
+			return null;
+		List<ComputingResource> children = resourceWithName.getChildren();
+		Set<Scheduler> childrenSchedulers = new HashSet<Scheduler>();
+		if(children.isEmpty())
+			return null;
+		for(ComputingResource child: children) {
+			childrenSchedulers.add(child.getScheduler());
+		}	
+
+		Set<Scheduler> tempChildrenSchedulers = new HashSet<Scheduler>(childrenSchedulers);
+		while(childrenSchedulers.size() > 1){
+			childrenSchedulers = new HashSet<Scheduler>();
+			for(Scheduler s: tempChildrenSchedulers){
+				childrenSchedulers.add(s.getParent());
+			}
+			tempChildrenSchedulers = new HashSet<Scheduler>(childrenSchedulers);
+		}
+		Iterator<Scheduler> it = childrenSchedulers.iterator();
+		Scheduler potentialScheduler = it.next();
+		if(potentialScheduler.getCompResources().containsAll(children))
+			return potentialScheduler;
+		return null;
+	}
+	
+	public static ComputingResource getCommonComputingResourceParent(List<ComputingResource> compResources){
+		if(compResources.size() == 0)
+			return null;
+		Set<ComputingResource> candidates = new HashSet<ComputingResource>(compResources);
+		while(candidates.size() > 1){
+			Set<ComputingResource> parents = new HashSet<ComputingResource>();
+			Iterator<ComputingResource> it = candidates.iterator();
+			while(it.hasNext()){
+				ComputingResource compRes = it.next();
+				if(compRes.getParent() != null){
+					parents.add(compRes.getParent());
+				}
+				it.remove();
+			}
+			candidates.addAll(parents);
+		}
+		return candidates.toArray(new ComputingResource[0])[0];
+	}
+
+	public void setInitList(Deque<Initializable> toI) {
+		toInit = toI;
+	}
+
+	public Deque<Initializable> getToInit() {
+		return toInit;
+	}
+
+}
Index: DCWoRMS/trunk/src/schedframe/Plugin.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/Plugin.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/Plugin.java	(revision 477)
@@ -0,0 +1,24 @@
+package schedframe;
+
+
+
+/**
+ * @author Stanislaw Szczepanowski
+ *
+ */
+public interface Plugin {
+	
+	/**
+	 * Returns the plugin name used in the simulation
+	 * @return the name of the plugin with all the package namespace, e.g. org.gridcompany.plugins.forecast.GridPlugin
+	 */
+	public String getName();
+	
+	/**
+	 * Initializes the plugin
+	 */
+	public void init(Parameters parameters);
+	
+	public PluginConfiguration getConfiguration();
+	
+}
Index: DCWoRMS/trunk/src/schedframe/Finalizable.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/Finalizable.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/Finalizable.java	(revision 477)
@@ -0,0 +1,7 @@
+package schedframe;
+
+public interface Finalizable {
+	
+	public void finalize();
+	
+}
Index: DCWoRMS/trunk/src/schedframe/Initializable.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/Initializable.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/Initializable.java	(revision 477)
@@ -0,0 +1,7 @@
+package schedframe;
+
+public interface Initializable {
+	
+	public void initiate();
+	
+}
Index: DCWoRMS/trunk/src/schedframe/Parameter.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/Parameter.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/Parameter.java	(revision 477)
@@ -0,0 +1,40 @@
+package schedframe;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import schemas.StringValueWithUnit;
+
+public class Parameter extends ArrayList<StringValueWithUnit> {
+
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 1L;
+	protected String name;
+	protected List<Property> properties;
+
+	public Parameter(String name) {
+		this.name = name;
+	}
+
+	public List<Property> getProperties() {
+		return properties;
+	}
+
+	public boolean addProperty(Property prop){
+		if(properties == null){
+			properties = new ArrayList<Property>();
+		}
+		return properties.add(prop);
+	}
+	
+	public Property getProperty(String propName){
+		for(Property property: properties){
+			if(property.getName().equals(propName)){
+				return property;
+			}
+		}
+		return null;
+	}
+}
Index: DCWoRMS/trunk/src/schedframe/exceptions/ModuleException.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/exceptions/ModuleException.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/exceptions/ModuleException.java	(revision 477)
@@ -0,0 +1,27 @@
+package schedframe.exceptions;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+public class ModuleException extends Exception {
+
+	private static final long serialVersionUID = -3388688857266748587L;
+	
+	public ModuleException() {
+		super();
+	}
+
+    public ModuleException(String message) {
+    	super(message);
+    }
+
+    public ModuleException(String message, Throwable cause) {
+        super(message, cause);
+    }
+    
+    public ModuleException(Throwable cause) {
+        super(cause);
+    }
+}
Index: DCWoRMS/trunk/src/schedframe/exceptions/ResourceException.java
===================================================================
--- DCWoRMS/trunk/src/schedframe/exceptions/ResourceException.java	(revision 477)
+++ DCWoRMS/trunk/src/schedframe/exceptions/ResourceException.java	(revision 477)
@@ -0,0 +1,22 @@
+package schedframe.exceptions;
+
+public class ResourceException extends Exception{
+
+	private static final long serialVersionUID = 1L;
+
+	public ResourceException() {
+		super();
+	}
+
+    public ResourceException(String message) {
+    	super(message);
+    }
+
+    public ResourceException(String message, Throwable cause) {
+        super(message, cause);
+    }
+    
+    public ResourceException(Throwable cause) {
+        super(cause);
+    }
+}
Index: DCWoRMS/trunk/src/gssim/schedframe/scheduling/plugin/local/WormsTimeOperations.java
===================================================================
--- DCWoRMS/trunk/src/gssim/schedframe/scheduling/plugin/local/WormsTimeOperations.java	(revision 477)
+++ DCWoRMS/trunk/src/gssim/schedframe/scheduling/plugin/local/WormsTimeOperations.java	(revision 477)
@@ -0,0 +1,25 @@
+package gssim.schedframe.scheduling.plugin.local;
+
+import org.joda.time.DateTime;
+
+import schedframe.scheduling.plugin.local.TimeOperations;
+
+public class WormsTimeOperations extends TimeOperations {
+
+	public WormsTimeOperations(){
+		this(0);
+	}
+	
+	public WormsTimeOperations(long timeDelta){
+		super(timeDelta);
+	}
+
+	/**
+	 * Get Calendar object representing current logic time
+	 * @return current time
+	 */
+	public DateTime getTime() {
+		return new DateTime();
+	}
+
+}
Index: DCWoRMS/trunk/src/gssim/schedframe/scheduling/utils/JobDescription.java
===================================================================
--- DCWoRMS/trunk/src/gssim/schedframe/scheduling/utils/JobDescription.java	(revision 477)
+++ DCWoRMS/trunk/src/gssim/schedframe/scheduling/utils/JobDescription.java	(revision 477)
@@ -0,0 +1,73 @@
+package gssim.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/gssim/schedframe/scheduling/utils/TaskDescription.java
===================================================================
--- DCWoRMS/trunk/src/gssim/schedframe/scheduling/utils/TaskDescription.java	(revision 477)
+++ DCWoRMS/trunk/src/gssim/schedframe/scheduling/utils/TaskDescription.java	(revision 477)
@@ -0,0 +1,108 @@
+package gssim.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/gssim/schedframe/scheduling/Executable.java
===================================================================
--- DCWoRMS/trunk/src/gssim/schedframe/scheduling/Executable.java	(revision 477)
+++ DCWoRMS/trunk/src/gssim/schedframe/scheduling/Executable.java	(revision 477)
@@ -0,0 +1,289 @@
+package gssim.schedframe.scheduling;
+
+
+import gridsim.Gridlet;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.joda.time.DateTime;
+import org.joda.time.DateTimeUtilsExt;
+import org.joda.time.ReadableDuration;
+
+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 extends Gridlet implements ExecTask{
+
+	protected Task task;
+	protected String processesSetId;
+	
+	protected List<String> visitedResources;
+
+	
+	public Executable(Task t){
+		super(0, 0, 0, 0);
+		this.task = t;
+		super.gridletID_ = (t.getJobId() + "_" + t.getId()).hashCode();
+		reservationId = null;
+		this.visitedResources = new ArrayList<String>();
+		setUserID(task.getSenderId());
+	}
+	
+	public Executable(Task t, AbstractProcesses procesesSet){
+		super(0, 0, 0, 0);
+		this.task = t;
+		this.processesSetId = procesesSet.getId(); 
+		super.gridletID_ = (t.getJobId() + "_" + t.getId() + "_" + processesSetId).hashCode();
+		this.visitedResources = new ArrayList<String>();
+		setUserID(task.getSenderId());
+	}
+	
+	public DateTime getExecutionEndTime() throws NoSuchFieldException {
+		return task.getExecutionEndTime();
+	}
+
+	public DateTime getExecutionStartTime() throws NoSuchFieldException {
+		return task.getExecutionStartTime();
+	}
+
+	public ReadableDuration getExpectedDuration() throws NoSuchFieldException {
+		return task.getExpectedDuration();
+	}
+
+	public String getId() {
+		if(processesSetId == null)
+			return task.getId();
+		else 
+			return task.getId() + "_" + processesSetId;
+	}
+
+	public String getJobId() {
+		return task.getJobId();
+	}
+
+	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 DateTime getSubmissionTimeToBroker() {
+		return task.getSubmissionTimeToBroker();
+	}
+
+	public String getUserDn() {
+		return task.getUserDn();
+	}
+
+	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 void setReservationId(String reservationId){
+		this.reservationId = reservationId;
+	}
+	
+	public String getProcessesId(){
+		return this.processesSetId;
+	}
+	
+	public String getTaskId(){
+		return this.task.getId();
+	}
+	
+	public void addSpecificResource(ResourceParameterName resourceName, Object value){
+		if(this.chosenResources == null)
+			this.chosenResources = new HashMap<ResourceParameterName, Object>();
+		
+		this.chosenResources.put(resourceName, value);
+	}
+
+	public long getWorkloadLogWaitTime() {
+		return task.getWorkloadLogWaitTime();
+	}
+	
+	
+	/*public void addToResPath(String resName){
+		task.addToResPath(resName);
+	}
+	
+	public String getResPath(){
+		return task.getResPath();
+	}
+	*/
+	
+	public void visitResource(String resName){
+		visitedResources.add(resName);
+	}
+	
+	public List<String> getVisitedResources(){
+		return visitedResources;
+	}
+	
+	
+	protected String reservationId;
+	
+	public boolean requireReservation(){
+		return (reservationId != null);
+	}
+	
+	public String getReservationId(){
+		return this.reservationId;
+	}
+	
+	
+	public boolean equals(Object obj){
+		if(obj instanceof Executable){
+			Executable t = (Executable) obj;
+			return getId().equals(t.getId());
+		}
+		return false;
+	}
+	
+	public void setGridletStatus(int newStatus) throws Exception {
+		if(status_ == newStatus)
+			return;
+		
+		super.setGridletStatus(newStatus);
+		
+		if (newStatus == Gridlet.SUCCESS || newStatus == Gridlet.CANCELED) {
+            finishTime_ = DateTimeUtilsExt.currentTimeMillis() / 1000;
+        }
+	}
+
+	/**
+	 * @return the sum of the actual CPU time values for every gird resource, 
+	 * that this sub task has been executed on
+	 */
+	public double getTotalProcessingTime() {
+		double totalProcessingTime = 0.0;
+		for (Object resObj : resList_) {
+			Resource res = (Resource) resObj;
+			totalProcessingTime += res.actualCPUTime;
+		}
+		return totalProcessingTime;
+	}
+	
+
+	protected Map<ResourceParameterName, Object> chosenResources;
+
+	
+	/**
+	 * 
+	 * @return length measured in instructions.
+	 */
+	public long getLength() {
+		return Double.valueOf(getGridletLength()).longValue();
+	}
+	
+	/**
+	 * 
+	 * @param length measured in instructions.
+	 */
+	public void setLength(long length){
+		setGridletLength(Long.valueOf(length).doubleValue());
+	}
+	
+	/**
+	 * 
+	 * @return constant which represent current task status
+	 */
+	public int getStatus() {
+		return getGridletStatus();
+	}
+	
+	/**
+	 * 
+	 * @param status constant which describes current new task status
+	 */
+	public void setStatus(int status) throws Exception {
+		setGridletStatus(status);
+	}
+	
+	public double getCpuCntRequest() throws NoSuchFieldException{
+		return getParameterDoubleValue(ResourceParameterName.CPUCOUNT);
+	}
+	
+	public double getMemoryRequest() throws NoSuchFieldException{
+		return getParameterDoubleValue(ResourceParameterName.MEMORY);
+	}
+	
+	public boolean isFinished()
+    {
+        if (index_ == -1) {
+            return false;
+        }
+
+        boolean completed = false;
+
+        // if result is 0 or -ve then this Gridlet has finished
+        double finish = ( (Resource) resList_.get(index_) ).finishedSoFar;
+        double result = gridletLength_ - finish;
+        if (result <= 0.001) {
+            completed = true;
+        }
+
+        return completed;
+    }
+	
+	public boolean expectSpecificResource(ResourceParameterName resourceName){
+		if(this.chosenResources == null)
+			return false;
+
+		return this.chosenResources.containsKey(resourceName);
+	}
+	
+	public Object getExpectedSpecificResource(ResourceParameterName resourceName){
+		if(this.chosenResources == null)
+			return null;
+		
+		return this.chosenResources.get(resourceName);
+	}
+	
+	public boolean isRegistered() {
+		return task.isRegistered();
+	}
+
+	public void register(JobRegistryImpl jobRegistry) {
+		task.register(jobRegistry);
+
+	}
+	
+	@Override
+	public void accept(WorkloadUnitHandler wuh) {
+		wuh.handleExecutable(this);
+	}
+}
Index: DCWoRMS/trunk/src/gssim/schedframe/scheduling/ExecTask.java
===================================================================
--- DCWoRMS/trunk/src/gssim/schedframe/scheduling/ExecTask.java	(revision 477)
+++ DCWoRMS/trunk/src/gssim/schedframe/scheduling/ExecTask.java	(revision 477)
@@ -0,0 +1,18 @@
+package gssim.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 addToResPath(String resName);
+	//public String getResPath();
+	
+	public void visitResource(String resName);
+	public List<String> getVisitedResources();
+}
Index: DCWoRMS/trunk/src/gssim/schedframe/scheduling/queues/AbstractStatsSupportingQueue.java
===================================================================
--- DCWoRMS/trunk/src/gssim/schedframe/scheduling/queues/AbstractStatsSupportingQueue.java	(revision 477)
+++ DCWoRMS/trunk/src/gssim/schedframe/scheduling/queues/AbstractStatsSupportingQueue.java	(revision 477)
@@ -0,0 +1,106 @@
+package gssim.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/eduni/simjava/distributions/GeneralGenerator.java
===================================================================
--- DCWoRMS/trunk/src/eduni/simjava/distributions/GeneralGenerator.java	(revision 477)
+++ DCWoRMS/trunk/src/eduni/simjava/distributions/GeneralGenerator.java	(revision 477)
@@ -0,0 +1,10 @@
+package eduni.simjava.distributions;
+
+import cern.jet.random.AbstractDistribution;
+
+public class GeneralGenerator extends AbstractSpecificGenerator{
+
+	public GeneralGenerator(AbstractDistribution generator) {
+		super(generator);
+	}
+}
Index: DCWoRMS/trunk/src/eduni/simjava/distributions/PeriodicGenerator.java
===================================================================
--- DCWoRMS/trunk/src/eduni/simjava/distributions/PeriodicGenerator.java	(revision 477)
+++ DCWoRMS/trunk/src/eduni/simjava/distributions/PeriodicGenerator.java	(revision 477)
@@ -0,0 +1,63 @@
+package eduni.simjava.distributions;
+
+import java.util.Date;
+
+import cern.jet.random.AbstractDistribution;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+public class PeriodicGenerator extends AbstractSpecificGenerator{
+	
+	private long beginValidTime;
+	private long endValidTime;
+	private boolean useTime;
+	
+	public PeriodicGenerator(AbstractDistribution generator){
+		super(generator);
+		this.useTime = false;
+	}
+	
+	public PeriodicGenerator(AbstractDistribution generator, Date beginValidTime, Date endValidTime){
+		super(generator);
+		this.beginValidTime = beginValidTime.getTime();
+		this.endValidTime = endValidTime.getTime();
+		useTime = true;
+	}
+	
+	
+	public boolean isValid(long time){
+		if(!useTime) return true;
+		
+		if(time >= beginValidTime && time <= endValidTime)
+			return true;
+		else
+			return false;
+	}
+	
+	public boolean isValid(Date time){
+		if(time == null)
+			return false;
+		
+		return isValid(time.getTime());
+	}
+	
+	public long getBeginValidTime_L(){
+		return beginValidTime;
+	}
+	
+	public long getEndValidTime_L(){
+		return endValidTime;
+	}
+	
+	public Date getBeginValidTime_D(){
+		return new Date(beginValidTime);
+	}
+	
+	public Date getEndValidTime_D(){
+		return new Date(endValidTime);
+	}
+	
+}
Index: DCWoRMS/trunk/src/eduni/simjava/distributions/DetailDistGenerator.java
===================================================================
--- DCWoRMS/trunk/src/eduni/simjava/distributions/DetailDistGenerator.java	(revision 477)
+++ DCWoRMS/trunk/src/eduni/simjava/distributions/DetailDistGenerator.java	(revision 477)
@@ -0,0 +1,49 @@
+package eduni.simjava.distributions;
+
+import cern.jet.random.AbstractDistribution;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+
+public class DetailDistGenerator extends AbstractSpecificGenerator {
+	
+	/**
+	 * interval length
+	 */ 
+	private double prcnt;
+	
+	public DetailDistGenerator(AbstractDistribution generator){
+		super(generator);
+		this.prcnt = 0;
+	}
+	
+	public DetailDistGenerator(AbstractDistribution generator, double prcnt){
+		super(generator);
+		this.prcnt = prcnt;
+	}
+
+	/**
+	 * Returns percentage interval length.
+	 * @return
+	 */
+	public double getPrcnt(){
+		return prcnt;
+	}
+
+	public int compareTo(AbstractSpecificGenerator o) {
+		if(o instanceof DetailDistGenerator) {
+			
+			DetailDistGenerator ddg = (DetailDistGenerator) o;
+			double anotherPrcnt = ddg.getPrcnt();
+			return Double.compare(prcnt, anotherPrcnt);
+			
+		} else {
+			return -1;
+		}
+		
+	}
+	
+}
Index: DCWoRMS/trunk/src/eduni/simjava/distributions/AbstractSpecificGenerator.java
===================================================================
--- DCWoRMS/trunk/src/eduni/simjava/distributions/AbstractSpecificGenerator.java	(revision 477)
+++ DCWoRMS/trunk/src/eduni/simjava/distributions/AbstractSpecificGenerator.java	(revision 477)
@@ -0,0 +1,36 @@
+package eduni.simjava.distributions;
+
+import cern.jet.random.AbstractDistribution;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+
+public abstract class AbstractSpecificGenerator implements Comparable<AbstractSpecificGenerator>{
+	protected AbstractDistribution generator;
+	
+	protected double lastGeneraterdValue;
+	
+	public AbstractSpecificGenerator(AbstractDistribution generator){
+		this.generator = generator;
+		this.lastGeneraterdValue = generator.nextDouble();
+	}
+	
+	public double getLastGeneratedValue(){
+		return lastGeneraterdValue;
+	}
+	
+	public void setLastGeneratedValue(double value){
+		lastGeneraterdValue = value;
+	}
+	
+	public AbstractDistribution getGenerator(){
+		return generator;
+	}
+	
+	public int compareTo(AbstractSpecificGenerator o){
+		return -1;
+	}
+}
Index: DCWoRMS/trunk/src/org/joda/time/DateTimeUtilsExt.java
===================================================================
--- DCWoRMS/trunk/src/org/joda/time/DateTimeUtilsExt.java	(revision 477)
+++ DCWoRMS/trunk/src/org/joda/time/DateTimeUtilsExt.java	(revision 477)
@@ -0,0 +1,52 @@
+package org.joda.time;
+
+import java.lang.reflect.Field;
+import java.util.Calendar;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.joda.time.DateTimeUtils;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+
+public class DateTimeUtilsExt extends DateTimeUtils {
+	
+	private static Log log = LogFactory.getLog(DateTimeUtilsExt.class);
+	private static Calendar offsetTime;
+	
+	public static void initVirtualTimeAccess(Calendar startTime){
+		offsetTime = startTime;
+		try {
+			Field privateStringField = DateTimeUtils.class.
+										getDeclaredField("cMillisProvider");
+			privateStringField.setAccessible(true);
+			privateStringField.set(null, new VCMilisProvider(startTime));
+			privateStringField.setAccessible(false);
+			
+			log.info("org.joda.time PACKAGE IS USING SIMJAVA VIRTUAL CLOCK " +
+									"TO DETERMINE CURRENT TIME.");
+			
+		} catch (SecurityException e) {
+			e.printStackTrace();
+		} catch (NoSuchFieldException e) {
+			e.printStackTrace();
+		} catch (IllegalArgumentException e) {
+			e.printStackTrace();
+		} catch (IllegalAccessException e) {
+			e.printStackTrace();
+		}
+	}
+	
+	public static DateTime getDateTimeAt(double vtime){
+		DateTime dt = new DateTime(offsetTime.getTimeInMillis());
+		return dt.plusSeconds((int) vtime);
+	}
+	
+	public static Calendar getOffsetTime(){
+		return offsetTime;
+	}
+}
Index: DCWoRMS/trunk/src/org/joda/time/VCMilisProvider.java
===================================================================
--- DCWoRMS/trunk/src/org/joda/time/VCMilisProvider.java	(revision 477)
+++ DCWoRMS/trunk/src/org/joda/time/VCMilisProvider.java	(revision 477)
@@ -0,0 +1,49 @@
+package org.joda.time;
+
+import java.util.Calendar;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import eduni.simjava.Sim_system;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+
+public class VCMilisProvider extends DateTimeUtils.MillisProvider {
+
+	private Log log = LogFactory.getLog(VCMilisProvider.class);
+	
+	// start time offset
+	protected long startTime; 
+	
+	public VCMilisProvider(Calendar initTime){
+
+		// cut milliseconds
+		String msg = "Cut start time milliseconds " + initTime.getTime() + 
+					" (" + initTime.getTimeInMillis() + ") to ";
+		
+		initTime.set(Calendar.MILLISECOND, 0);
+		
+		log.debug(msg + initTime.getTime() + 
+				" (" + initTime.getTimeInMillis() + ")");
+		 
+		this.startTime = initTime.getTimeInMillis();
+	}
+	
+	long getMillis() {
+		
+		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
+		vc = vc * 1000;
+		
+		return this.startTime + vc;
+	}
+
+}
Index: DCWoRMS/trunk/src/qcg/shared/constants/BrokerConstants.java
===================================================================
--- DCWoRMS/trunk/src/qcg/shared/constants/BrokerConstants.java	(revision 477)
+++ DCWoRMS/trunk/src/qcg/shared/constants/BrokerConstants.java	(revision 477)
@@ -0,0 +1,112 @@
+/*
+ * Created on Jun 13, 2004
+ *
+ */
+package qcg.shared.constants;
+
+
+/**
+ * @author yulo
+ *
+ */
+public interface BrokerConstants {
+    
+    public static final short SUBMITION_NOTIFICATION = 0;
+    public static final short MIGRATION_NOTIFICATION = 1;
+    //public static final short MIGRATION_PENDING_NOTIFICATION = 2;
+    public static final short IMPROVE_NOTIFICATION = 2;
+    
+    public static final long JOB_STATUS_UNCOMMITTED = 1;
+    public static final long JOB_STATUS_SUBMITTED = 2;
+    public static final long JOB_STATUS_ACTIVE = 4;
+    public static final long JOB_STATUS_FINISHED = 8;
+    public static final long JOB_STATUS_FAILED = 16;
+    public static final long JOB_STATUS_CANCELED = 32;
+    public static final long JOB_STATUS_SUSPENDED = 64;
+    public static final long JOB_STATUS_BROKEN = 128;
+    
+    public static final long TASK_STATUS_UNSUBMITTED = 1;
+    public static final long TASK_STATUS_QUEUED = 2;
+    public static final long TASK_STATUS_PREPROCESSING = 4;
+    public static final long TASK_STATUS_PENDING = 8;
+    public static final long TASK_STATUS_RUNNING = 16;
+    public static final long TASK_STATUS_STOPPED = 32;
+    public static final long TASK_STATUS_POSTPROCESSING = 64;
+    public static final long TASK_STATUS_FINISHED = 128;
+    public static final long TASK_STATUS_SUSPENDED = 256;
+    public static final long TASK_STATUS_FAILED = 512;
+    public static final long TASK_STATUS_CANCELED = 1024;
+    public static final long TASK_STATUS_UNCOMMITTED = 2048;
+    
+    public static final int LOCAL_STATUS_UNKNOWN = 0;
+    public static final int LOCAL_STATUS_PENDING = 1;
+    public static final int LOCAL_STATUS_ACTIVE = 2;
+    public static final int LOCAL_STATUS_FAILED = 4;
+    public static final int LOCAL_STATUS_DONE = 8;
+    public static final int LOCAL_STATUS_SUSPENDED = 16;
+    public static final int LOCAL_STATUS_UNSUBMITTED = 32;
+    public static final int LOCAL_STATUS_CANCELED = 64;
+      
+    
+    public static final int QUEUE_ACTIVE = 0;
+    public static final int QUEUE_PENDING = 1;
+    
+    public static final long TASK_QUEUED                = 1;
+    public static final long TASK_RESOURCE              = 2;
+    public static final long TASK_RESOURCE_DONE         = 4;
+    public static final long TASK_STAGE_IN              = 8;
+    public static final long TASK_STAGE_IN_DONE         = 16;
+    public static final long TASK_SUBMIT                = 32;
+    public static final long TASK_SUBMIT_DONE           = 64;
+    public static final long TASK_EXEC                  = 128;
+    public static final long TASK_EXEC_PENDING          = 256;
+    public static final long TASK_EXEC_ACTIVE           = 512;
+    public static final long TASK_EXEC_DONE             = 1024;
+    public static final long TASK_STAGE_OUT             = 2048;
+    public static final long TASK_STAGE_OUT_DONE        = 4096;
+    public static final long TASK_DONE                  = 8192;
+    public static final long TASK_FAILED                = 16384;
+    public static final long TASK_CANCEL_DONE           = 32768;
+    public static final long TASK_CANCEL_FAILED         = 65536;
+    public static final long MIGRATE_QUEUED             = 1 << 17;
+    public static final long MIGRATE_EXEC_SUSPEND       = 1 << 18;
+    public static final long MIGRATE_EXEC_SUSPEND_DONE  = 1 << 19;
+    public static final long MIGRATE_RESOURCE           = 1 << 20;
+    public static final long MIGRATE_RESOURCE_DONE      = 1 << 21;
+    public static final long MIGRATE_STAGE_IN           = 1 << 22;
+    public static final long MIGRATE_STAGE_IN_DONE      = 1 << 23;
+    public static final long MIGRATE_SUBMIT             = 1 << 24;
+    public static final long MIGRATE_DONE               = 1 << 25;
+    public static final long MIGRATE_FAILED             = 1 << 26;
+    public static final long MIGRATE_STAGE_OUT          = 1 << 27;
+    public static final long MIGRATE_STAGE_OUT_DONE     = 1 << 28;
+    public static final long REQUEST_FAILED             = 1 << 29;
+    public static final long TASK_CANCEL                = 1 << 30;
+    public static final long TASK_UNSUBMITTED           = 1 << 31;
+    public static final long TASK_UNCOMMITTED           = 1 << 32;
+    
+    public static final int PARAM_HOST = 0;
+    public static final int PARAM_LRM = 1;
+    public static final int PARAM_MEM = 2;
+    public static final int PARAM_CPUS = 3;
+    public static final int PARAM_SPEED = 4;
+    public static final int PARAM_OSTYPE = 5;
+    public static final int PARAM_OSVER = 6;
+    public static final int PARAM_OSREL = 7;
+    public static final int PARAM_BAND = 8;
+    public static final int PARAM_LAT = 9;
+    public static final int PARAM_CAP = 10;
+    public static final int PARAM_TYPE = 11;
+    public static final int PARAM_FREEMEM = 12;
+    public static final int PARAM_FREECPU = 13;
+    
+    public final static String CONFIG_FNAME = "./etc/config.prop";
+    public final static String ERRORS_FNAME = "./etc/errors.prop";
+    
+    public static final int SUBMITION_TYPE = 0;
+    public static final int MIGRATION_TYPE = 1;
+    public static final int MIGRATION_TYPE_DESC = 2;
+    public static final int MIGRATION_TYPE_NODESC = 3;
+    public static final int RESUME_TYPE_DESC = 4;
+    public static final int RESUME_TYPE_NODESC = 5;
+}
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 477)
@@ -0,0 +1,60 @@
+package example.timeestimation;
+
+import gssim.schedframe.scheduling.ExecTask;
+
+import java.util.Map;
+
+import schedframe.events.scheduling.SchedulingEvent;
+import schedframe.resources.units.PEUnit;
+import schedframe.resources.units.ResourceUnit;
+import schedframe.resources.units.ResourceUnitName;
+import schedframe.resources.units.StandardResourceUnitName;
+
+
+/**
+ * 
+ * @author Marcin Krystek && Wojciech Piatek
+ *
+ */
+
+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 completion percentage.
+	 * 
+	 * Example implementation calculate the estimation based on cpu processing power.
+	 * There is also a simple assumption, that cpu processing power is a linear function
+	 * of number of allocated cpus and their speed.
+	 */
+	public double execTimeEstimation(SchedulingEvent event, ExecTask task,
+			Map<ResourceUnitName, ResourceUnit> allocatedResources,
+			double completionPercentage) {
+		
+		// collect all information necessary to do the calculation
+		PEUnit peUnit = (PEUnit) allocatedResources.get(StandardResourceUnitName.PE);
+
+		// obtain single pe speed
+		int speed = peUnit.getSpeed();
+
+		// number of used pe  
+		int cnt = peUnit.getUsedAmount();
+
+		// estimate remainingTaskLength
+		double remainingLength =  task.getLength() * (1 - completionPercentage);
+		
+		// do the calculation
+		double execTime = (remainingLength / (cnt * speed));
+
+		// if the result is very close to 0, but less then one millisecond then round this result to 0.001
+		if (Double.compare(execTime, 0.001) < 0) {
+			execTime = 0.001;
+		}
+
+		// time is measured in integer units, so get the nearest execTime int value.
+		execTime = Math.ceil(execTime);
+		return execTime;
+	}
+
+}
Index: DCWoRMS/trunk/src/example/timeestimation/BaseTimeEstimationPlugin.java
===================================================================
--- DCWoRMS/trunk/src/example/timeestimation/BaseTimeEstimationPlugin.java	(revision 477)
+++ DCWoRMS/trunk/src/example/timeestimation/BaseTimeEstimationPlugin.java	(revision 477)
@@ -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/src/example/globalplugin/GridFCFSLoadBalancingPlugin.java
===================================================================
--- DCWoRMS/trunk/src/example/globalplugin/GridFCFSLoadBalancingPlugin.java	(revision 477)
+++ DCWoRMS/trunk/src/example/globalplugin/GridFCFSLoadBalancingPlugin.java	(revision 477)
@@ -0,0 +1,107 @@
+package example.globalplugin;
+
+
+import java.util.List;
+import java.util.Properties;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import schedframe.events.scheduling.SchedulingEvent;
+import schedframe.scheduling.SchedulerDescription;
+import schedframe.scheduling.manager.resources.ResourceManager;
+import schedframe.scheduling.manager.tasks.JobRegistry;
+import schedframe.scheduling.plan.SchedulingPlanInterface;
+import schedframe.scheduling.plan.impl.Allocation;
+import schedframe.scheduling.plan.impl.ScheduledTask;
+import schedframe.scheduling.plan.impl.SchedulingPlan;
+import schedframe.scheduling.plugin.grid.Module;
+import schedframe.scheduling.plugin.grid.ModuleList;
+import schedframe.scheduling.plugin.grid.ResourceDiscovery;
+import schedframe.scheduling.queue.TaskQueue;
+import schedframe.scheduling.queue.QueueDescription;
+import schedframe.scheduling.queue.TaskQueueList;
+import schedframe.scheduling.tasks.TaskInterface;
+import schedframe.scheduling.tasks.WorkloadUnit;
+
+public class GridFCFSLoadBalancingPlugin extends BaseGlobalPlugin {
+
+	private Log log = LogFactory.getLog(GridFCFSLoadBalancingPlugin.class);
+	
+	public SchedulingPlanInterface schedule(SchedulingEvent event,
+			TaskQueueList queues, 
+			JobRegistry jobRegistry,
+			ResourceManager resourceManager, ModuleList modules)  {
+	
+		ResourceDiscovery resources = null;
+		for(int i = 0; i < modules.size(); i++){
+			Module m = modules.get(i);
+			switch(m.getType()){
+				case RESOURCE_DISCOVERY: resources = (ResourceDiscovery) m;
+					break;
+			}
+		}
+		
+		SchedulingPlan plan = new SchedulingPlan();
+		
+		TaskQueue q = queues.get(0);
+		int size = q.size();
+		
+		// order of the resources on this list is not determined
+		List<SchedulerDescription> availableResources = resources.getResources();
+		int resourceIdx = -1;
+		
+		for(int i = 0; i < size; i++) {
+			WorkloadUnit<?> job = q.remove(0);
+			TaskInterface<?> task = (TaskInterface<?>)job;
+
+			resourceIdx = findLeastLoadedResourceIdx(availableResources);
+			SchedulerDescription sd = availableResources.get(resourceIdx);
+			
+			Allocation allocation = new Allocation();
+			allocation.setProcessesCount(1);
+			allocation.setProviderName(sd.getProvider().getProviderId());
+			
+			ScheduledTask scheduledTask = new ScheduledTask(task);
+			scheduledTask.setTaskId(task.getId());
+			scheduledTask.setJobId(task.getJobId());
+			scheduledTask.addAllocation(allocation);		
+			
+			plan.addTask(scheduledTask);
+		}
+		return plan;
+		
+	}
+
+	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);
+			long totalLoad = getQueueLoad(sd.getAvailableQueues());
+			if(totalLoad < minLoad){
+				resourceIdx = i;
+				minLoad = totalLoad;
+			}
+		}
+		return resourceIdx;
+	}
+
+	private long getQueueLoad(List<QueueDescription> queues){
+		long load = 0;
+		for(QueueDescription queue : queues){
+			load = load + queue.getLoad();
+		}
+		return load;
+	}
+	
+}
Index: DCWoRMS/trunk/src/example/globalplugin/GridFCFSRandomPlugin.java
===================================================================
--- DCWoRMS/trunk/src/example/globalplugin/GridFCFSRandomPlugin.java	(revision 477)
+++ DCWoRMS/trunk/src/example/globalplugin/GridFCFSRandomPlugin.java	(revision 477)
@@ -0,0 +1,86 @@
+package example.globalplugin;
+
+import java.util.List;
+import java.util.Properties;
+import java.util.Random;
+
+import schedframe.events.scheduling.SchedulingEvent;
+import schedframe.scheduling.SchedulerDescription;
+import schedframe.scheduling.manager.resources.ResourceManager;
+import schedframe.scheduling.manager.tasks.JobRegistry;
+import schedframe.scheduling.plan.SchedulingPlanInterface;
+import schedframe.scheduling.plan.impl.Allocation;
+import schedframe.scheduling.plan.impl.ScheduledTask;
+import schedframe.scheduling.plan.impl.SchedulingPlan;
+import schedframe.scheduling.plugin.grid.Module;
+import schedframe.scheduling.plugin.grid.ModuleList;
+import schedframe.scheduling.plugin.grid.ResourceDiscovery;
+import schedframe.scheduling.queue.TaskQueue;
+import schedframe.scheduling.queue.TaskQueueList;
+import schedframe.scheduling.tasks.TaskInterface;
+import schedframe.scheduling.tasks.WorkloadUnit;
+
+public class GridFCFSRandomPlugin extends BaseGlobalPlugin {
+
+	private Random rand;
+	
+	public GridFCFSRandomPlugin() {
+		rand = new Random(5);
+	}
+	
+	public SchedulingPlanInterface schedule(SchedulingEvent event,
+			TaskQueueList queues, 
+			JobRegistry jobRegistry,
+			ResourceManager resourceManager, ModuleList modules)  {
+		
+		ResourceDiscovery resources = null;
+		for(int i = 0; i < modules.size(); i++){
+			Module m = modules.get(i);
+			switch(m.getType()){
+				case RESOURCE_DISCOVERY: resources = (ResourceDiscovery) m;
+					break;
+			}
+		}
+		
+		SchedulingPlan plan = new SchedulingPlan();
+		
+		TaskQueue q = queues.get(0);
+		int size = q.size();
+		
+		// order of the resources on this list is not determined
+		List<SchedulerDescription> availableResources = resources.getResources(null);
+		int resourceIdx = -1;
+		
+		for(int i = 0; i < size; i++) {
+			WorkloadUnit<?> job = q.remove(0);
+			TaskInterface<?> task = (TaskInterface<?>)job;
+			
+			resourceIdx = rand.nextInt(availableResources.size());
+			SchedulerDescription sd = availableResources.get(resourceIdx);
+			
+			Allocation allocation = new Allocation();
+			allocation.setProcessesCount(1);
+			allocation.setProviderName(sd.getProvider().getProviderId());
+			
+			ScheduledTask scheduledTask = new ScheduledTask(task);
+			scheduledTask.setTaskId(task.getId());
+			scheduledTask.setJobId(task.getJobId());
+			scheduledTask.addAllocation(allocation);		
+			
+			plan.addTask(scheduledTask);
+
+		}
+		return plan;
+		
+	}
+
+
+	public String getName() {
+		return getClass().getName();
+	}
+
+	public void init(Properties properties) {
+		// no extra initialization is expected.
+	}
+
+}
Index: DCWoRMS/trunk/src/example/globalplugin/GridFCFSRoundRobinPlugin.java
===================================================================
--- DCWoRMS/trunk/src/example/globalplugin/GridFCFSRoundRobinPlugin.java	(revision 477)
+++ DCWoRMS/trunk/src/example/globalplugin/GridFCFSRoundRobinPlugin.java	(revision 477)
@@ -0,0 +1,82 @@
+package example.globalplugin;
+
+import java.util.LinkedList;
+import java.util.List;
+
+import schedframe.events.scheduling.SchedulingEvent;
+import schedframe.scheduling.SchedulerDescription;
+import schedframe.scheduling.manager.resources.ResourceManager;
+import schedframe.scheduling.manager.tasks.JobRegistry;
+import schedframe.scheduling.plan.SchedulingPlanInterface;
+import schedframe.scheduling.plan.impl.Allocation;
+import schedframe.scheduling.plan.impl.ScheduledTask;
+import schedframe.scheduling.plan.impl.SchedulingPlan;
+import schedframe.scheduling.plugin.grid.Module;
+import schedframe.scheduling.plugin.grid.ModuleList;
+import schedframe.scheduling.plugin.grid.ResourceDiscovery;
+import schedframe.scheduling.queue.TaskQueue;
+import schedframe.scheduling.queue.TaskQueueList;
+import schedframe.scheduling.tasks.TaskInterface;
+import schedframe.scheduling.tasks.WorkloadUnit;
+
+public class GridFCFSRoundRobinPlugin extends BaseGlobalPlugin {
+
+	private LinkedList<String> lastUsedResources = new LinkedList<String>();
+
+	public SchedulingPlanInterface schedule(SchedulingEvent event,
+			TaskQueueList queues, 
+			JobRegistry jobRegistry,
+			ResourceManager resourceManager, ModuleList modules)  {
+	
+		ResourceDiscovery resources = null;
+		for(int i = 0; i < modules.size(); i++){
+			Module m = modules.get(i);
+			switch(m.getType()){
+				case RESOURCE_DISCOVERY: resources = (ResourceDiscovery) m;
+					break;
+			}
+		}
+		
+		SchedulingPlan plan = new SchedulingPlan();
+		
+		TaskQueue q = queues.get(0);
+		int size = q.size();
+		
+		// order of the resources on this list is not determined
+		List<SchedulerDescription> availableResources = resources.getResources();
+		
+		for(int i = 0; i < size; i++) {
+			WorkloadUnit<?> job = q.remove(0);
+			TaskInterface<?> task = (TaskInterface<?>)job;
+			
+			SchedulerDescription sd = availableResources.get(availableResources.size() - 1);
+			for(SchedulerDescription schedDesc: availableResources){
+				if(!lastUsedResources.contains(schedDesc.getProvider().getProviderId())){
+					if(lastUsedResources.size() + 1 >= availableResources.size()){
+						lastUsedResources.poll();
+					}
+					lastUsedResources.add(schedDesc.getProvider().getProviderId());
+					sd = schedDesc;
+					break;
+				}
+			}
+		
+			Allocation allocation = new Allocation();
+			allocation.setProcessesCount(1);
+			allocation.setProviderName(sd.getProvider().getProviderId());
+			ScheduledTask scheduledTask = new ScheduledTask(task);
+			scheduledTask.setTaskId(task.getId());
+			scheduledTask.setJobId(task.getJobId());
+			scheduledTask.addAllocation(allocation);		
+			
+			plan.addTask(scheduledTask);
+		}
+		return plan;
+	}
+
+	public String getName() {
+		return getClass().getName();
+	}
+
+
+}
Index: DCWoRMS/trunk/src/example/globalplugin/BaseGlobalPlugin.java
===================================================================
--- DCWoRMS/trunk/src/example/globalplugin/BaseGlobalPlugin.java	(revision 477)
+++ DCWoRMS/trunk/src/example/globalplugin/BaseGlobalPlugin.java	(revision 477)
@@ -0,0 +1,49 @@
+package example.globalplugin;
+
+import schedframe.Parameters;
+import schedframe.PluginConfiguration;
+import schedframe.events.scheduling.SchedulingEventType;
+import schedframe.scheduling.WorkloadUnitListImpl;
+import schedframe.scheduling.manager.resources.ResourceManager;
+import schedframe.scheduling.plugin.SchedulingPluginConfiguration;
+import schedframe.scheduling.plugin.grid.GlobalSchedulingPlugin;
+import schedframe.scheduling.plugin.grid.ModuleList;
+import schedframe.scheduling.queue.TaskQueue;
+import schedframe.scheduling.queue.TaskQueueList;
+import schedframe.scheduling.tasks.WorkloadUnit;
+import schemas.StringValueWithUnit;
+
+public abstract class BaseGlobalPlugin implements GlobalSchedulingPlugin {
+
+	SchedulingPluginConfiguration plugConf;
+	
+	public PluginConfiguration getConfiguration() {
+		return plugConf;
+	}
+	
+	public int placeJobsInQueues(WorkloadUnitListImpl newJobs, TaskQueueList queues, ResourceManager resourceManager,
+			ModuleList moduleList) {
+
+		// get the first queue from all available queues.
+		TaskQueue queue = queues.get(0);
+
+		for (int i = 0; i < newJobs.size(); i++) {
+			WorkloadUnit<?> task = newJobs.get(i);
+			queue.add(task);
+		}
+
+		return 0;
+	}
+	
+	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){
+			
+		}
+	}
+	
+	
+}
Index: DCWoRMS/trunk/src/example/energy/DefaultEnergyEstimationPlugin.java
===================================================================
--- DCWoRMS/trunk/src/example/energy/DefaultEnergyEstimationPlugin.java	(revision 477)
+++ DCWoRMS/trunk/src/example/energy/DefaultEnergyEstimationPlugin.java	(revision 477)
@@ -0,0 +1,11 @@
+package example.energy;
+
+
+public class DefaultEnergyEstimationPlugin extends BaseEnergyEstimationPlugin{
+
+	@Override
+	public String getName() {
+		return getClass().getName();
+	}
+
+}
Index: DCWoRMS/trunk/src/example/energy/CPUEnergyEstimationPlugin.java
===================================================================
--- DCWoRMS/trunk/src/example/energy/CPUEnergyEstimationPlugin.java	(revision 477)
+++ DCWoRMS/trunk/src/example/energy/CPUEnergyEstimationPlugin.java	(revision 477)
@@ -0,0 +1,33 @@
+package example.energy;
+
+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.power.StandardPowerStateName;
+import schedframe.scheduling.manager.tasks.JobRegistry;
+
+public class CPUEnergyEstimationPlugin extends BaseEnergyEstimationPlugin  {
+
+	@Override
+	public double estimatePowerConsumption(EnergyEvent event, JobRegistry jobRegistry,
+			ComputingResource resource) {
+		Processor cpu = (Processor)resource;
+		if(resource.getPowerInterface().getPowerState().getName().equals(StandardPowerStateName.OFF))
+			return 0;
+		if(resource.getStatus() == ResourceStatus.BUSY)
+			try {
+				return cpu.getPowerInterface().getPowerConsumption(cpu.getPowerInterface().getPState());
+			} catch (NoSuchFieldException e) {
+				return 0;
+			}
+		else 
+			return 1; 
+	}
+
+	public String getName() {
+		return getClass().getName();
+	}
+
+
+}
Index: DCWoRMS/trunk/src/example/energy/BaseEnergyEstimationPlugin.java
===================================================================
--- DCWoRMS/trunk/src/example/energy/BaseEnergyEstimationPlugin.java	(revision 477)
+++ DCWoRMS/trunk/src/example/energy/BaseEnergyEstimationPlugin.java	(revision 477)
@@ -0,0 +1,49 @@
+package example.energy;
+
+import schedframe.Parameters;
+import schedframe.PluginConfiguration;
+import schedframe.resources.computing.ComputingResource;
+import schedframe.resources.computing.profiles.energy.EnergyEvent;
+import schedframe.resources.computing.profiles.energy.power.plugin.EnergyEstimationPlugin;
+import schedframe.scheduling.manager.tasks.JobRegistry;
+
+public abstract class BaseEnergyEstimationPlugin implements EnergyEstimationPlugin {
+
+	@Override
+	public PluginConfiguration getConfiguration() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+	
+	@Override
+	public double estimatePowerConsumption(EnergyEvent event, JobRegistry jobRegistry, ComputingResource resource) {
+		double power = 0;
+		try {
+			return resource.getPowerInterface().getPowerConsumption(resource.getPowerInterface().getPowerState());
+		} catch (NoSuchFieldException e) {
+			power = 0;
+		}
+		for(ComputingResource child:resource.getChildren()){
+			power = power + child.getPowerInterface().getRecentPowerUsage().getValue(); 
+		}
+		return power;
+	}
+
+	@Override
+	public double estimateAirThroughput(EnergyEvent event, JobRegistry jobRegistry, ComputingResource resourceManager) {
+		throw new RuntimeException("Not implemented.");
+	}
+
+	@Override
+	public double estimateTemperature(EnergyEvent event, JobRegistry jobRegistry, ComputingResource resourceManager) {
+		throw new RuntimeException("Not implemented.");
+	}
+	
+	public void init(Parameters parameters) {
+
+	}
+
+	public String getName() {
+		return getClass().getName();
+	}
+}
Index: DCWoRMS/trunk/src/example/energy/DataCenterEnergyEstimationPlugin.java
===================================================================
--- DCWoRMS/trunk/src/example/energy/DataCenterEnergyEstimationPlugin.java	(revision 477)
+++ DCWoRMS/trunk/src/example/energy/DataCenterEnergyEstimationPlugin.java	(revision 477)
@@ -0,0 +1,29 @@
+package example.energy;
+
+import schedframe.resources.computing.ComputingNode;
+import schedframe.resources.computing.ComputingResource;
+import schedframe.resources.computing.profiles.energy.EnergyEvent;
+import schedframe.resources.computing.profiles.energy.power.PowerUsage;
+import schedframe.scheduling.manager.tasks.JobRegistry;
+
+public class DataCenterEnergyEstimationPlugin extends BaseEnergyEstimationPlugin{
+
+	@Override
+	public double estimatePowerConsumption(EnergyEvent event, JobRegistry jobRegistry,
+			ComputingResource resource) {
+		double power = 0;
+		for(ComputingResource child:resource.getChildren()){
+			ComputingNode node = (ComputingNode)child;
+			PowerUsage powerUsage = node.getPowerInterface().getRecentPowerUsage();
+			power += (powerUsage == null ? 0 : powerUsage.getValue());
+		}
+		
+		//System.out.println( new DateTime() + "ENERGY CONSUMPT BY: " + resMan.getResourceName() +" IS: " + power);
+		return power;
+	}
+
+	public String getName() {
+		return getClass().getName();
+	}
+
+}
Index: DCWoRMS/trunk/src/example/energy/ComputingNodeEnergyEstimationPlugin.java
===================================================================
--- DCWoRMS/trunk/src/example/energy/ComputingNodeEnergyEstimationPlugin.java	(revision 477)
+++ DCWoRMS/trunk/src/example/energy/ComputingNodeEnergyEstimationPlugin.java	(revision 477)
@@ -0,0 +1,36 @@
+package example.energy;
+
+import schedframe.resources.computing.ComputingNode;
+import schedframe.resources.computing.ComputingResource;
+import schedframe.resources.computing.Processor;
+import schedframe.resources.computing.profiles.energy.EnergyEvent;
+import schedframe.scheduling.manager.tasks.JobRegistry;
+
+public class ComputingNodeEnergyEstimationPlugin extends BaseEnergyEstimationPlugin {
+
+	@Override
+	public double estimatePowerConsumption(EnergyEvent event, JobRegistry jobRegistry,
+			ComputingResource resource) {
+		double power = 0;
+		ComputingNode node = (ComputingNode) resource;
+		for(Processor cpu: node.getProcessors()){
+			try{
+				power = power + cpu.getPowerInterface().getRecentPowerUsage().getValue();
+			} catch(Exception e){
+				//power = power + cpu.getPowerInterface().getPowerConsumption(cpu.getPowerInterface().getPowerState());
+			}
+		}
+
+		try {
+			power += node.getPowerInterface().getPowerConsumption(node.getPowerInterface().getPowerState());
+		} catch (NoSuchFieldException e) {
+		}
+
+		return power;
+	}
+
+	public String getName() {
+		return getClass().getName();
+	}
+
+}
Index: DCWoRMS/trunk/src/example/localplugin/FCFSEnergyAwareClusterLocalPlugin.java
===================================================================
--- DCWoRMS/trunk/src/example/localplugin/FCFSEnergyAwareClusterLocalPlugin.java	(revision 477)
+++ DCWoRMS/trunk/src/example/localplugin/FCFSEnergyAwareClusterLocalPlugin.java	(revision 477)
@@ -0,0 +1,103 @@
+package example.localplugin;
+
+import gridsim.Gridlet;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+
+import schedframe.events.scheduling.SchedulingEvent;
+import schedframe.resources.computing.ComputingNode;
+import schedframe.scheduling.manager.resources.ClusterResourceManager;
+import schedframe.scheduling.manager.resources.ResourceManager;
+import schedframe.scheduling.manager.tasks.JobRegistry;
+import schedframe.scheduling.plan.SchedulingPlanInterface;
+import schedframe.scheduling.plan.impl.SchedulingPlan;
+import schedframe.scheduling.plugin.grid.ModuleList;
+import schedframe.scheduling.queue.TaskQueue;
+import schedframe.scheduling.queue.TaskQueueList;
+import schedframe.scheduling.tasks.TaskInterface;
+import schedframe.scheduling.tasks.WorkloadUnit;
+
+public class FCFSEnergyAwareClusterLocalPlugin extends BaseLocalSchedulingPlugin {
+
+	public FCFSEnergyAwareClusterLocalPlugin () {
+	}
+
+	public SchedulingPlanInterface schedule(SchedulingEvent event, TaskQueueList queues, JobRegistry jobRegistry,
+			ResourceManager resManager, ModuleList modules) {
+
+		ClusterResourceManager resourceManager = (ClusterResourceManager) resManager;
+		SchedulingPlan plan = new SchedulingPlan();
+		// chose the events types to serve.
+		// Different actions for different events are possible.
+		switch (event.getType()) {
+		case START_TASK_EXECUTION:
+		case TASK_FINISHED:
+			// our tasks are placed only in first queue (see
+			// BaseLocalPlugin.placeJobsInQueues() method)
+			TaskQueue q = queues.get(0);
+			// check all tasks in queue
+
+			for (int i = 0; i < q.size(); i++) {
+				WorkloadUnit<?> job = q.get(i);
+				TaskInterface<?> task = (TaskInterface<?>) job;
+				// if status of the tasks in READY
+				if (task.getStatus() == Gridlet.READY) {
+
+					String nodeName = chooseProviderForExecution(resourceManager, task);
+					if (nodeName != null) {
+						addToSchedulingPlan(plan, task, nodeName);
+					}
+				}
+			}
+
+			break;
+		}
+		return plan;
+	}
+
+	private String chooseProviderForExecution(ClusterResourceManager resourceManager, TaskInterface<?> task) {
+		int cpuRequest;
+		try {
+			cpuRequest = Double.valueOf(task.getCpuCntRequest()).intValue();
+		} catch (NoSuchFieldException e) {
+			cpuRequest = 1;
+		}
+		List<ComputingNode> nodes = resourceManager.getComputingNodes();
+		nodes = findSuitableNodes(cpuRequest, nodes);
+		Collections.sort(nodes, new Comparator<ComputingNode>(){
+			 
+		    public int compare(ComputingNode node1, ComputingNode node2){    
+		        return node1.getResourceCharacteristic().getParameters().get("category").get(0).getContent().compareTo(node2.getResourceCharacteristic().getParameters().get("category").get(0).getContent());
+		   
+		    }
+		});
+
+		return nodes.size() == 0 ? null : nodes.get(0).getName();
+	}
+	
+	private List<ComputingNode> findSuitableNodes(int cpuRequest, List<ComputingNode> nodes){
+		List<ComputingNode> avNodes = new ArrayList<ComputingNode>();
+		for(ComputingNode node: nodes){
+			if(node.getFreeProcessorsNumber() >= cpuRequest){
+				avNodes.add(node);
+			}
+		}
+		return avNodes;
+	}
+	
+	public String getName() {
+		return getClass().getName();
+	}
+
+	class CategoryComparator implements Comparator<String>{
+		 
+	    public int compare(String cat1, String cat2){    
+	        return cat1.compareTo(cat2);
+	   
+	    }
+	}
+}
+
Index: DCWoRMS/trunk/src/example/localplugin/BaseLocalSchedulingPlugin.java
===================================================================
--- DCWoRMS/trunk/src/example/localplugin/BaseLocalSchedulingPlugin.java	(revision 477)
+++ DCWoRMS/trunk/src/example/localplugin/BaseLocalSchedulingPlugin.java	(revision 477)
@@ -0,0 +1,119 @@
+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.WorkloadUnitListImpl;
+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 schedframe.scheduling.tasks.WorkloadUnit;
+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 placeJobsInQueues(WorkloadUnitListImpl newJobs,
+			TaskQueueList queues, 
+			ResourceManager resourceManager, ModuleList moduleList) {
+		
+		// get the first queue from all available queues.
+		TaskQueue queue = queues.get(0);
+
+		for(int i = 0; i < newJobs.size(); i++){
+			WorkloadUnit<?> task = newJobs.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/src/example/localplugin/RackLocalPlugin.java
===================================================================
--- DCWoRMS/trunk/src/example/localplugin/RackLocalPlugin.java	(revision 477)
+++ DCWoRMS/trunk/src/example/localplugin/RackLocalPlugin.java	(revision 477)
@@ -0,0 +1,61 @@
+package example.localplugin;
+
+import gridsim.Gridlet;
+import schedframe.events.scheduling.SchedulingEvent;
+import schedframe.scheduling.manager.resources.ClusterResourceManager;
+import schedframe.scheduling.manager.resources.ResourceManager;
+import schedframe.scheduling.manager.tasks.JobRegistry;
+import schedframe.scheduling.plan.SchedulingPlanInterface;
+import schedframe.scheduling.plan.impl.SchedulingPlan;
+import schedframe.scheduling.plugin.grid.ModuleList;
+import schedframe.scheduling.queue.TaskQueue;
+import schedframe.scheduling.queue.TaskQueueList;
+import schedframe.scheduling.tasks.TaskInterface;
+import schedframe.scheduling.tasks.WorkloadUnit;
+
+public class RackLocalPlugin  extends BaseLocalSchedulingPlugin {
+
+	public RackLocalPlugin() {
+	}
+
+	public SchedulingPlanInterface schedule(SchedulingEvent event, TaskQueueList queues, JobRegistry jobRegistry,
+			ResourceManager resManager, ModuleList modules) {
+
+		ClusterResourceManager resourceManager = (ClusterResourceManager) resManager;
+		SchedulingPlan plan = new SchedulingPlan();
+		// chose the events types to serve.
+		// Different actions for different events are possible.
+		switch (event.getType()) {
+		case START_TASK_EXECUTION:
+		case TASK_FINISHED:
+		//case TIMER:
+			// our tasks are placed only in first queue (see
+			// BaseLocalPlugin.placeJobsInQueues() method)
+			TaskQueue q = queues.get(0);
+			// check all tasks in queue
+
+			for (int i = 0; i < q.size(); i++) {
+				WorkloadUnit<?> job = q.get(i);
+				TaskInterface<?> task = (TaskInterface<?>) job;
+				// if status of the tasks in READY
+				if (task.getStatus() == Gridlet.READY) {
+					System.out.println(resourceManager.getSchedulers().get(0).get_name());
+					String nodeName = resourceManager.getSchedulers().get(0).get_name();
+					if (nodeName != null) {
+						addToSchedulingPlan(plan, task, nodeName);
+					}
+				}
+			}
+
+			break;
+		}
+		return plan;
+	}
+
+	
+	public String getName() {
+		return getClass().getName();
+	}
+
+
+}
Index: DCWoRMS/trunk/src/example/localplugin/FCFSClusterLocalPlugin.java
===================================================================
--- DCWoRMS/trunk/src/example/localplugin/FCFSClusterLocalPlugin.java	(revision 477)
+++ DCWoRMS/trunk/src/example/localplugin/FCFSClusterLocalPlugin.java	(revision 477)
@@ -0,0 +1,227 @@
+package example.localplugin;
+
+import gridsim.Gridlet;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+
+import schedframe.events.scheduling.SchedulingEvent;
+import schedframe.resources.ResourceStatus;
+import schedframe.resources.StandardResourceType;
+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.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 FCFSClusterLocalPlugin extends BaseLocalSchedulingPlugin {
+
+	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() == Gridlet.READY) {
+					
+					/****************3 ways to schedule task****************/
+					
+					/****************1. Choosing particular resources to perform execution****************/
+					Map<ResourceUnitName, ResourceUnit> choosenResources = chooseResourcesForExecution2(resourceManager, task);
+					if (choosenResources != null) {
+						addToSchedulingPlan(plan, task, choosenResources);
+					}
+					
+					/****************2. Choosing resource scheduler/provider to submit task.  If the given resource doesn't contains/isn't 
+					a scheduler, random resources from the given resource will be chosen in order to perform execution****************/
+					/*String provName = chooseProviderForExecution(resourceManager);
+					if (provName != null) {
+						addToSchedulingPlan(plan, task, provName);
+					}*/
+
+					/****************3. Scheduler will choose random resources to perform execution****************/
+					//addToSchedulingPlan(plan, task);
+				}
+			}
+
+			break;
+		}
+		return plan;
+	}
+
+	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) {
+
+		Map<ResourceUnitName, ResourceUnit> map = new HashMap<ResourceUnitName, ResourceUnit>();
+		List<ComputingNode> nodes = resourceManager.getComputingNodes();
+		for (ComputingNode node : nodes) {
+			int cpuRequest;
+			try {
+				cpuRequest = Double.valueOf(task.getCpuCntRequest()).intValue();
+			} catch (NoSuchFieldException e) {
+				cpuRequest = 1;
+			}
+
+			if (cpuRequest != 0) {
+
+				List<Processor> processors = node.getProcessors();
+				if (processors.size() < cpuRequest) {
+					continue;
+				}
+
+				List<ComputingResource> 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) {
+					continue;
+				}
+
+				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) {
+
+					Memory memory = null;
+					try{
+						if (node.getFreeMemory() >= memoryRequest) {		
+							memory = new Memory(node.getMemory(), memoryRequest, memoryRequest);
+						}		
+					} catch(NoSuchFieldException e){
+						continue;
+					}
+					if(memory == null)
+						continue;
+					else {
+						map.put(StandardResourceUnitName.MEMORY, memory);
+						return map;
+					}
+				}
+			}
+		}
+	
+		return null;
+	}
+
+	@SuppressWarnings("unchecked")
+	private String chooseProviderForExecution(ResourceManager unitsManager) {
+		List<ComputingResource> processingElements;
+		Properties properties = new Properties();
+		properties.setProperty("type", StandardResourceType.ComputingNode.toString());
+		// properties.setProperty("status", ResourceStatus.FREE.toString());
+		processingElements = (List<ComputingResource>) unitsManager.filterResources(properties);
+		return processingElements.get(0).getName();
+	}
+
+	public String getName() {
+		return getClass().getName();
+	}
+
+}
Index: DCWoRMS/trunk/src/example/localplugin/FCFSNodePowerManagementClusterLocalPlugin.java
===================================================================
--- DCWoRMS/trunk/src/example/localplugin/FCFSNodePowerManagementClusterLocalPlugin.java	(revision 477)
+++ DCWoRMS/trunk/src/example/localplugin/FCFSNodePowerManagementClusterLocalPlugin.java	(revision 477)
@@ -0,0 +1,159 @@
+package example.localplugin;
+
+import gridsim.Gridlet;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import schedframe.events.scheduling.SchedulingEvent;
+import schedframe.resources.ResourceStatus;
+import schedframe.resources.computing.ComputingNode;
+import schedframe.resources.computing.ComputingResource;
+import schedframe.resources.computing.profiles.energy.power.StandardPowerStateName;
+import schedframe.resources.units.ProcessingElements;
+import schedframe.resources.units.ResourceUnit;
+import schedframe.resources.units.ResourceUnitName;
+import schedframe.resources.units.StandardResourceUnitName;
+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 FCFSNodePowerManagementClusterLocalPlugin extends BaseLocalSchedulingPlugin {
+
+	public FCFSNodePowerManagementClusterLocalPlugin () {
+	}
+
+	public SchedulingPlanInterface schedule(SchedulingEvent event, TaskQueueList queues, JobRegistry jobRegistry,
+			ResourceManager resManager, ModuleList modules) {
+
+		ClusterResourceManager resourceManager = (ClusterResourceManager) resManager;
+		SchedulingPlan plan = new SchedulingPlan();
+		// chose the events types to serve.
+		// Different actions for different events are possible.
+		switch (event.getType()) {
+		case START_TASK_EXECUTION:
+		case TASK_FINISHED:
+			// our tasks are placed only in first queue (see
+			// BaseLocalPlugin.placeJobsInQueues() method)
+			TaskQueue q = queues.get(0);
+			// check all tasks in queue
+
+			for (int i = 0; i < q.size(); i++) {
+				WorkloadUnit<?> job = q.get(i);
+				TaskInterface<?> task = (TaskInterface<?>) job;
+				// if status of the tasks in READY
+				if (task.getStatus() == Gridlet.READY) {
+
+					Map<ResourceUnitName, ResourceUnit> choosenResources = chooseResourcesForExecution(resourceManager, task);
+					if (choosenResources  != null) {
+						addToSchedulingPlan(plan, task, choosenResources);
+					} else {
+						if(harnessIdleNodesToWork(task, resourceManager.getComputingNodes()))
+							i--;
+					}
+				}
+			}
+
+			turnOffIdleNodes(resourceManager.getComputingNodes());
+
+			break;
+		}
+		return plan;
+	}
+	
+	private Map<ResourceUnitName, ResourceUnit> chooseResourcesForExecution(ClusterResourceManager resourceManager, TaskInterface<?> task) {
+
+		List<ComputingNode> nodes = resourceManager.getComputingNodes();
+		nodes = findSuitableNodes(task, nodes);
+		Collections.sort(nodes, new Comparator<ComputingNode>(){
+		    public int compare(ComputingNode node1, ComputingNode node2){    
+		        return node1.getResourceCharacteristic().getParameters().get("category").get(0).getContent().compareTo(node2.getResourceCharacteristic().getParameters().get("category").get(0).getContent());
+		    }
+		});
+		if(nodes.size() > 0)
+		{
+			Map<ResourceUnitName, ResourceUnit> map = new HashMap<ResourceUnitName, ResourceUnit>();
+			List<ComputingResource> choosenResources =  new ArrayList<ComputingResource>();
+			int cpuRequest;
+			try {
+				cpuRequest = Double.valueOf(task.getCpuCntRequest()).intValue();
+			} catch (NoSuchFieldException e) {
+				cpuRequest = 1;
+			}
+			for (int i = 0; i < nodes.get(0).getProcessors().size() && cpuRequest > 0; i++) {
+				if (nodes.get(0).getProcessors().get(i).getStatus() == ResourceStatus.FREE) {
+					choosenResources.add(nodes.get(0).getProcessors().get(i));
+					cpuRequest--;
+				}
+			}
+			ProcessingElements result = new ProcessingElements(nodes.get(0).getName());
+			result.addAll(choosenResources);
+			map.put(StandardResourceUnitName.PE, result);
+			return map;
+		} else 
+			return null;
+	}
+	
+	private List<ComputingNode> findSuitableNodes(TaskInterface<?> task, List<ComputingNode> nodes){
+		int cpuRequest;
+		try {
+			cpuRequest = Double.valueOf(task.getCpuCntRequest()).intValue();
+		} catch (NoSuchFieldException e) {
+			cpuRequest = 1;
+		}
+		List<ComputingNode> avNodes = new ArrayList<ComputingNode>();
+		for(ComputingNode node: nodes){
+			if(node.getFreeProcessorsNumber() >= cpuRequest){
+				avNodes.add(node);
+			}
+		}
+		return avNodes;
+	}
+
+	private void turnOffIdleNodes(List<ComputingNode> nodes){
+		for(ComputingNode node : nodes){
+			if(node.getFreeProcessorsNumber() == node.getProcessorsNumber()){
+				node.getPowerInterface().setPowerState(StandardPowerStateName.OFF);
+			}
+		}
+	}
+	
+	private boolean harnessIdleNodesToWork(TaskInterface<?> task, List<ComputingNode> nodes){
+		int cpuRequest;
+		try {
+			cpuRequest = Double.valueOf(task.getCpuCntRequest()).intValue();
+		} catch (NoSuchFieldException e) {
+			cpuRequest = 1;
+		}
+		Collections.sort(nodes, new Comparator<ComputingNode>(){
+		    public int compare(ComputingNode node1, ComputingNode node2){    
+		        return node1.getResourceCharacteristic().getParameters().get("category").get(0).getContent().compareTo(node2.getResourceCharacteristic().getParameters().get("category").get(0).getContent());
+		    }
+		});
+		for (int i = 0; i < nodes.size() && cpuRequest > 0; i++) {
+			ComputingNode node = nodes.get(i);
+			if(node.getPowerInterface().getPowerState() == StandardPowerStateName.OFF){
+				node.getPowerInterface().setPowerState(StandardPowerStateName.ON);
+				cpuRequest -= node.getProcessorsNumber();
+			}
+		}
+		return cpuRequest > 0 ? false : true;
+	}
+	
+	public String getName() {
+		return getClass().getName();
+	}
+
+
+}
Index: DCWoRMS/trunk/src/example/localplugin/FCFSRandomClusterLocalPlugin.java
===================================================================
--- DCWoRMS/trunk/src/example/localplugin/FCFSRandomClusterLocalPlugin.java	(revision 477)
+++ DCWoRMS/trunk/src/example/localplugin/FCFSRandomClusterLocalPlugin.java	(revision 477)
@@ -0,0 +1,77 @@
+package example.localplugin;
+
+import gridsim.Gridlet;
+
+import java.util.List;
+import java.util.Random;
+
+import schedframe.events.scheduling.SchedulingEvent;
+import schedframe.resources.computing.ComputingNode;
+import schedframe.scheduling.manager.resources.ClusterResourceManager;
+import schedframe.scheduling.manager.resources.ResourceManager;
+import schedframe.scheduling.manager.tasks.JobRegistry;
+import schedframe.scheduling.plan.SchedulingPlanInterface;
+import schedframe.scheduling.plan.impl.SchedulingPlan;
+import schedframe.scheduling.plugin.grid.ModuleList;
+import schedframe.scheduling.queue.TaskQueue;
+import schedframe.scheduling.queue.TaskQueueList;
+import schedframe.scheduling.tasks.TaskInterface;
+import schedframe.scheduling.tasks.WorkloadUnit;
+
+public class FCFSRandomClusterLocalPlugin extends BaseLocalSchedulingPlugin {
+
+	private Random rand;
+	
+	public FCFSRandomClusterLocalPlugin() {
+		rand = new Random(5);
+	}
+
+	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() == Gridlet.READY) {
+					/*for(ResourceUnitName key:resManager.getSharedResourceUnits().keySet()){
+						System.out.println(key.getName());
+					}*/
+					addToSchedulingPlan(plan, task);
+					/*String nodeName = chooseRandomProvider(resourceManager);
+					if (nodeName != null) {
+						addToSchedulingPlan(plan, task, nodeName);
+					}*/
+				}
+			}
+			break;
+		}
+		return plan;
+	}
+
+	private String chooseRandomProvider(ClusterResourceManager resourceManager) {
+		List<ComputingNode> nodes = resourceManager.getComputingNodes();
+		int nodeIdx = rand.nextInt(nodes.size());
+		return nodes.get(nodeIdx).getName();
+	}
+	
+	public String getName() {
+		return getClass().getName();
+	}
+
+
+}
+
Index: DCWoRMS/trunk/src/example/localplugin/FCFS_BFLocalPlugin.java
===================================================================
--- DCWoRMS/trunk/src/example/localplugin/FCFS_BFLocalPlugin.java	(revision 477)
+++ DCWoRMS/trunk/src/example/localplugin/FCFS_BFLocalPlugin.java	(revision 477)
@@ -0,0 +1,45 @@
+package example.localplugin;
+
+import gridsim.Gridlet;
+import schedframe.events.scheduling.SchedulingEvent;
+import schedframe.scheduling.manager.resources.ResourceManager;
+import schedframe.scheduling.manager.tasks.JobRegistry;
+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 FCFS_BFLocalPlugin extends BaseLocalSchedulingPlugin {
+
+	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.
+		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() == Gridlet.READY) {
+					addToSchedulingPlan(plan, task);
+				}
+			}
+			break;
+		}
+		return plan;
+	}
+
+}
+
Index: DCWoRMS/trunk/src/example/localplugin/FCFSConsolidationClusterLocalPlugin.java
===================================================================
--- DCWoRMS/trunk/src/example/localplugin/FCFSConsolidationClusterLocalPlugin.java	(revision 477)
+++ DCWoRMS/trunk/src/example/localplugin/FCFSConsolidationClusterLocalPlugin.java	(revision 477)
@@ -0,0 +1,147 @@
+package example.localplugin;
+
+import gridsim.Gridlet;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import schedframe.events.scheduling.SchedulingEvent;
+import schedframe.resources.ResourceStatus;
+import schedframe.resources.computing.ComputingNode;
+import schedframe.resources.computing.ComputingResource;
+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.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 FCFSConsolidationClusterLocalPlugin extends BaseLocalSchedulingPlugin {
+
+	public FCFSConsolidationClusterLocalPlugin () {
+	}
+
+	public SchedulingPlanInterface schedule(SchedulingEvent event, TaskQueueList queues, JobRegistry jobRegistry,
+			ResourceManager resManager, ModuleList modules) {
+
+		ClusterResourceManager resourceManager = (ClusterResourceManager) resManager;
+		SchedulingPlan plan = new SchedulingPlan();
+		// chose the events types to serve.
+		// Different actions for different events are possible.
+		switch (event.getType()) {
+		case START_TASK_EXECUTION:
+		case TASK_FINISHED:
+			// our tasks are placed only in first queue (see
+			// BaseLocalPlugin.placeJobsInQueues() method)
+			TaskQueue q = queues.get(0);
+			// check all tasks in queue
+
+			for (int i = 0; i < q.size(); i++) {
+				WorkloadUnit<?> job = q.get(i);
+				TaskInterface<?> task = (TaskInterface<?>) job;
+				// if status of the tasks in READY
+				if (task.getStatus() == Gridlet.READY) {
+
+					Map<ResourceUnitName, ResourceUnit> choosenResources = null;
+					try {
+						choosenResources = chooseResourcesForExecution(resourceManager, task);
+					} catch (NoSuchFieldException e) {
+						// TODO Auto-generated catch block
+						e.printStackTrace();
+					}
+					if (choosenResources  != null) {
+						addToSchedulingPlan(plan, task, choosenResources);
+					} 
+				}
+			}
+
+			break;
+		}
+		return plan;
+	}
+	
+	private Map<ResourceUnitName, ResourceUnit> chooseResourcesForExecution(ClusterResourceManager resourceManager, TaskInterface<?> task) throws NoSuchFieldException {
+
+		List<ComputingNode> nodes = resourceManager.getComputingNodes();
+		nodes = findSuitableNodes(task, nodes);
+		Collections.sort(nodes, new Comparator<ComputingNode>(){
+		    public int compare(ComputingNode node1, ComputingNode node2){   
+		        return node1.getResourceCharacteristic().getParameters().get("category").get(0).getContent().compareTo(node2.getResourceCharacteristic().getParameters().get("category").get(0).getContent());
+		    }
+		});
+		if(nodes.size() > 0)
+		{
+			ComputingNode node = nodes.get(0);
+			Map<ResourceUnitName, ResourceUnit> map = new HashMap<ResourceUnitName, ResourceUnit>();
+			List<ComputingResource> choosenResources =  new ArrayList<ComputingResource>();
+			int cpuRequest;
+			try {
+				cpuRequest = Double.valueOf(task.getCpuCntRequest()).intValue();
+			} catch (NoSuchFieldException e) {
+				cpuRequest = 1;
+			}
+			for (int i = 0; i < node.getProcessors().size() && cpuRequest > 0; i++) {
+				if (node.getProcessors().get(i).getStatus() == ResourceStatus.FREE) {
+					choosenResources.add(node.getProcessors().get(i));
+					cpuRequest--;
+				}
+			}
+			ProcessingElements result = new ProcessingElements(node.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) {
+				Memory memory = new Memory(node.getMemory(), memoryRequest, memoryRequest);
+				map.put(StandardResourceUnitName.MEMORY, memory);
+			}
+			return map;
+		} else 
+			return null;
+	}
+	
+	private List<ComputingNode> findSuitableNodes(TaskInterface<?> task, List<ComputingNode> nodes) throws NoSuchFieldException{
+		int cpuRequest;
+		try {
+			cpuRequest = Double.valueOf(task.getCpuCntRequest()).intValue();
+		} catch (NoSuchFieldException e) {
+			cpuRequest = 1;
+		}
+		int memoryRequest;
+		try {
+			memoryRequest = Double.valueOf(task.getMemoryRequest()).intValue();
+		} catch (NoSuchFieldException e) {
+			memoryRequest = 0;
+		}
+		List<ComputingNode> suitableNodes = new ArrayList<ComputingNode>();
+		for(ComputingNode node: nodes){
+			if(node.getFreeProcessorsNumber() >= cpuRequest && node.getFreeMemory() >= memoryRequest){
+				suitableNodes.add(node);
+			}
+		}
+		return suitableNodes;
+	}
+	
+	public String getName() {
+		return getClass().getName();
+	}
+
+}
Index: DCWoRMS/trunk/src/example/localplugin/FCFSCPUFreqScalingClusterLocalPlugin.java
===================================================================
--- DCWoRMS/trunk/src/example/localplugin/FCFSCPUFreqScalingClusterLocalPlugin.java	(revision 477)
+++ DCWoRMS/trunk/src/example/localplugin/FCFSCPUFreqScalingClusterLocalPlugin.java	(revision 477)
@@ -0,0 +1,195 @@
+package example.localplugin;
+
+import gridsim.Gridlet;
+
+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.ComputingResource;
+import schedframe.resources.computing.Processor;
+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.UsedResourceList;
+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.SubmittedTask;
+import schedframe.scheduling.tasks.TaskInterface;
+import schedframe.scheduling.tasks.WorkloadUnit;
+
+public class FCFSCPUFreqScalingClusterLocalPlugin extends BaseLocalSchedulingPlugin {
+
+	List<Processor> allocatedCPUs;
+	public FCFSCPUFreqScalingClusterLocalPlugin () {
+		allocatedCPUs = new ArrayList<Processor>();
+	}
+
+	public SchedulingPlanInterface schedule(SchedulingEvent event, TaskQueueList queues, JobRegistry jobRegistry,
+			ResourceManager resManager, ModuleList modules) {
+
+		ClusterResourceManager resourceManager = (ClusterResourceManager) resManager;
+		SchedulingPlan plan = new SchedulingPlan();
+		// our tasks are placed only in first queue (see
+		// BaseLocalPlugin.placeJobsInQueues() method)
+		TaskQueue q = queues.get(0);
+		// chose the events types to serve.
+		// Different actions for different events are possible.
+		switch (event.getType()) {
+		
+		case START_TASK_EXECUTION:
+
+			// 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() == Gridlet.READY) {
+
+					Map<ResourceUnitName, ResourceUnit> choosenResources = chooseResourcesForExecution(resourceManager, task);
+					if (choosenResources  != null) {
+						addToSchedulingPlan(plan, task, choosenResources);
+						ProcessingElements pes = (ProcessingElements)choosenResources.get(StandardResourceUnitName.PE);
+						List<Processor> processors =  new ArrayList<Processor>();
+						for(ComputingResource res : pes){
+							processors.add((Processor) res);
+						}
+						adjustFrequency(ResourceStatus.BUSY,processors);
+					} 
+				}
+			}
+			break;
+			
+		case TASK_FINISHED:
+			TaskFinishedEvent finEvent = (TaskFinishedEvent) event;
+			SubmittedTask subTask = (SubmittedTask )jobRegistry.getSubmittedTask(finEvent.getJobId(), finEvent.getTaskId());
+			UsedResourceList<ResourceHistoryItem> usedResourcesList = subTask.getUsedResources();
+			ProcessingElements pes = (ProcessingElements)usedResourcesList.getLast().getResourceUnits().get(StandardResourceUnitName.PE);
+			List<Processor> processors =  new ArrayList<Processor>();
+			for(ComputingResource res : pes){
+				processors.add((Processor) res);
+				allocatedCPUs.add((Processor) res);
+			}
+			adjustFrequency(ResourceStatus.FREE, processors);
+			break;
+			
+		case TASK_REQUESTED_TIME_EXPIRED:
+			TaskRequestedTimeExpiredEvent timExpEvent = (TaskRequestedTimeExpiredEvent) event;
+			 subTask = (SubmittedTask )jobRegistry.getSubmittedTask(timExpEvent.getJobId(), timExpEvent.getTaskId());
+			usedResourcesList = subTask.getUsedResources();
+			pes = (ProcessingElements)usedResourcesList.getLast().getResourceUnits().get(StandardResourceUnitName.PE);
+			processors =  new ArrayList<Processor>();
+			for(ComputingResource res : pes){
+				allocatedCPUs.remove((Processor) res);
+			}
+			// 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() == Gridlet.READY) {
+
+					Map<ResourceUnitName, ResourceUnit> choosenResources = chooseResourcesForExecution(resourceManager, task);
+					if (choosenResources  != null) {
+						addToSchedulingPlan(plan, task, choosenResources);
+						pes = (ProcessingElements)choosenResources.get(StandardResourceUnitName.PE);
+						processors =  new ArrayList<Processor>();
+						for(ComputingResource res : pes){
+							processors.add((Processor) res);
+						}
+						adjustFrequency(ResourceStatus.BUSY, processors);
+					} 
+				}
+			}
+			break;
+		}
+		return plan;
+	}
+	
+	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 = resourceManager.getProcessors();
+			processors.removeAll(allocatedCPUs);
+			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();
+			result.addAll(choosenResources);
+			map.put(StandardResourceUnitName.PE, result);
+		}
+		return map;
+	}
+
+	private void adjustFrequency(ResourceStatus status, List<Processor> processors){
+		switch(status){
+		case BUSY:
+			for(Processor cpu: processors){
+				try {
+					if(cpu.getPowerInterface().getSupportedPStates().containsKey("P0"))
+						cpu.getPowerInterface().setPState("P0");
+				} catch (NoSuchFieldException e) {
+					// TODO Auto-generated catch block
+					e.printStackTrace();
+				}
+			}
+			break;
+		case FREE:
+			for(Processor cpu: processors){
+				try {
+					if(cpu.getPowerInterface().getSupportedPStates().containsKey("P3"))
+						cpu.getPowerInterface().setPState("P3");
+				} catch (NoSuchFieldException e) {
+					// TODO Auto-generated catch block
+					e.printStackTrace();
+				}
+			}
+			break;
+		}
+	}
+	
+	public String getName() {
+		return getClass().getName();
+	}
+
+}
Index: DCWoRMS/trunk/example/experiment1/RunExperiment.java
===================================================================
--- DCWoRMS/trunk/example/experiment1/RunExperiment.java	(revision 477)
+++ DCWoRMS/trunk/example/experiment1/RunExperiment.java	(revision 477)
@@ -0,0 +1,19 @@
+package experiment1;
+import simulator.DataCenterWorkloadSimulator;
+
+
+public class RunExperiment {
+	
+	public static void main(String args[]){
+		RunExperiment runner = new RunExperiment();
+		runner.run();
+	}
+	
+	public void run(){
+		String args[] = {
+				"example/experiment1/experiment1.properties"
+				};
+		DataCenterWorkloadSimulator.main(args);
+	}
+
+}
Index: DCWoRMS/trunk/example/experiment1/resources.xml
===================================================================
--- DCWoRMS/trunk/example/experiment1/resources.xml	(revision 477)
+++ DCWoRMS/trunk/example/experiment1/resources.xml	(revision 477)
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<environment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+	xsi:noNamespaceSchemaLocation="../../simulator/schemas/resources/WormsResSchema.xsd">
+	
+	<!-- Simple data center description -->
+	<resources>
+		<computingResource class="DataCenter" name="compRes">
+			<computingResource class="Processor" count="6"/>
+		</computingResource>
+		<scheduler class="Cluster" name="cluster">
+			<schedulingPlugin>
+				<name>example.localplugin.FCFSRandomClusterLocalPlugin</name>
+			</schedulingPlugin>	
+			<queues>
+				<queue>
+					<name>queue1</name>
+					<priority>1</priority>
+				</queue>
+				<queue>
+					<name>queue2</name>
+					<priority>2</priority>
+				</queue>
+			</queues>	
+			<managedComputingResources include="false">
+				<resourceName>compRes</resourceName>
+			</managedComputingResources>
+		</scheduler>	
+	</resources>
+
+</environment>
Index: DCWoRMS/trunk/example/experiment1/experiment1.properties
===================================================================
--- DCWoRMS/trunk/example/experiment1/experiment1.properties	(revision 477)
+++ DCWoRMS/trunk/example/experiment1/experiment1.properties	(revision 477)
@@ -0,0 +1,24 @@
+# Use single *.swf file as workload description.
+
+# Path to xml file which describes resource characteristics.
+resdesc=example/experiment1/resources.xml
+
+
+# and swf file, which name is declared by readscenario.workloadfilename parameter.
+# Swf file must be placed in readscenario.inputfolder directory.  
+readscenario.workloadfilename=example/experiment1/workload.swf
+
+# Choose if files with task processing history should be created.  
+printhistory=true
+
+# Choose directory where all result files should be placed.
+stats.outputfolder=../experiment1_result
+
+
+creatediagrams.gantt=true
+creatediagrams.utilization=true
+creatediagrams.energyusage=true
+
+creatediagrams.tasks=true
+creatediagrams.taskswaitingtime=true
+creatediagrams.reservations=true
Index: DCWoRMS/trunk/example/experiment1/workload.swf
===================================================================
--- DCWoRMS/trunk/example/experiment1/workload.swf	(revision 477)
+++ DCWoRMS/trunk/example/experiment1/workload.swf	(revision 477)
@@ -0,0 +1,30 @@
+;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		7200	1		-1		-1		1		-1		-1		-1		-1		-1		1		1		1		-1		-1
+		2			0			-1		7200	1		-1		-1		1		-1		-1		-1		-1		-1		1		1		1		-1		-1
+		3			0			-1		7200	1		-1		-1		1		-1		-1		-1		-1		-1		1		1		1		-1		-1
+		4			0			-1		7200	1		-1		-1		1		-1		-1		-1		-1		-1		1		1		1		-1		-1
+ 		5			0			-1		7200	1		-1		-1		1		-1		-1		-1		-1		-1		1		1		1		-1		-1
+ 		6			0			-1		10800	1		-1		-1		1		-1		-1		-1		-1		-1		1		1		1		-1		-1
+; -----------
+		7			0			-1		14400	1		-1		-1		1		-1		-1		-1		-1		-1		1		1		1		-1		-1
+		8			0			-1		28800	1		-1		-1		1		-1		-1		-1		-1		-1		1		1		1		-1		-1
+		9			3600		-1		7200	1		-1		-1		1		-1		-1		-1		-1		-1		1		1		1		-1		-1
+		10			21600		-1		21600	1		-1		-1		1		-1		-1		-1		-1		-1		1		1		1		-1		-1
+ 		11			25200		-1		25200	1		-1		-1		1		-1		-1		-1		-1		-1		1		1		1		-1		-1
+ 		12			39600		-1		14400	1		-1		-1		1		-1		-1		-1		-1		-1		1		1		1		-1		-1
+  		13			46800		-1		10800	1		-1		-1		1		-1		-1		-1		-1		-1		1		1		1		-1		-1
+ 		
Index: DCWoRMS/trunk/example/experiment3_result/Stats_Simulation 1_ResourceUtilization.txt
===================================================================
--- DCWoRMS/trunk/example/experiment3_result/Stats_Simulation 1_ResourceUtilization.txt	(revision 477)
+++ DCWoRMS/trunk/example/experiment3_result/Stats_Simulation 1_ResourceUtilization.txt	(revision 477)
@@ -0,0 +1,76 @@
+resourceName;timestamp;usage;
+ComputingNode_0;1225666800000;4;
+ComputingNode_0;1225674000000;0;
+ComputingNode_0;1225688400000;1;
+ComputingNode_0;1225692000000;2;
+ComputingNode_0;1225706400000;3;
+ComputingNode_0;1225710000000;2;
+ComputingNode_0;1225713600000;3;
+ComputingNode_0;1225717200000;2;
+ComputingNode_0;1225720800000;1;
+ComputingNode_0;1225724400000;0;
+mean: 0.4375
+
+ComputingNode_1;1225666800000;4;
+ComputingNode_1;1225674000000;3;
+ComputingNode_1;1225677600000;2;
+ComputingNode_1;1225681200000;1;
+ComputingNode_1;1225695600000;0;
+mean: 0.265625
+
+ComputingNode_2;1225670400000;1;
+ComputingNode_2;1225677600000;0;
+mean: 0.03125
+
+
+Processor_0;1225666800000;1;
+Processor_0;1225674000000;0;
+Processor_0;1225688400000;1;
+Processor_0;1225710000000;0;
+Processor_0;1225713600000;1;
+Processor_0;1225724400000;0;
+mean: 0.6875
+
+Processor_1;1225666800000;1;
+Processor_1;1225674000000;0;
+Processor_1;1225692000000;1;
+Processor_1;1225717200000;0;
+mean: 0.5625
+
+Processor_2;1225666800000;1;
+Processor_2;1225674000000;0;
+Processor_2;1225706400000;1;
+Processor_2;1225720800000;0;
+mean: 0.375
+
+Processor_3;1225666800000;1;
+Processor_3;1225674000000;0;
+mean: 0.125
+
+Processor_4;1225666800000;1;
+Processor_4;1225674000000;0;
+mean: 0.125
+
+Processor_5;1225666800000;1;
+Processor_5;1225677600000;0;
+mean: 0.1875
+
+Processor_6;1225666800000;1;
+Processor_6;1225681200000;0;
+mean: 0.25
+
+Processor_7;1225666800000;1;
+Processor_7;1225695600000;0;
+mean: 0.5
+
+Processor_8;1225670400000;1;
+Processor_8;1225677600000;0;
+mean: 0.125
+
+
+
+
+
+
+
+
Index: DCWoRMS/trunk/example/experiment3_result/Stats_Simulation 1_Energy.txt
===================================================================
--- DCWoRMS/trunk/example/experiment3_result/Stats_Simulation 1_Energy.txt	(revision 477)
+++ DCWoRMS/trunk/example/experiment3_result/Stats_Simulation 1_Energy.txt	(revision 477)
@@ -0,0 +1,112 @@
+resourceName;timestamp;usage;
+ComputingNode_0;1225666800000;2,150;
+ComputingNode_0;1225674000000;754;
+ComputingNode_0;1225688400000;1,103;
+ComputingNode_0;1225692000000;1,452;
+ComputingNode_0;1225706400000;1,801;
+ComputingNode_0;1225710000000;1,452;
+ComputingNode_0;1225713600000;1,801;
+ComputingNode_0;1225717200000;1,452;
+ComputingNode_0;1225720800000;1,103;
+ComputingNode_0;1225724400000;754;
+mean: 1364.75 sum: 21836.0
+
+ComputingNode_1;1225666800000;2,150;
+ComputingNode_1;1225674000000;1,801;
+ComputingNode_1;1225677600000;1,452;
+ComputingNode_1;1225681200000;1,103;
+ComputingNode_1;1225695600000;754;
+ComputingNode_1;1225724400000;754;
+mean: 1124.8125 sum: 17997.0
+
+ComputingNode_2;1225666800000;750;
+ComputingNode_2;1225670400000;1,103;
+ComputingNode_2;1225677600000;754;
+ComputingNode_2;1225724400000;754;
+mean: 797.375 sum: 12758.0
+
+ComputingNode_3;1225666800000;750;
+ComputingNode_3;1225724400000;750;
+mean: 750.0 sum: 12000.0
+
+Processor_0;1225666800000;350;
+Processor_0;1225674000000;1;
+Processor_0;1225688400000;350;
+Processor_0;1225710000000;1;
+Processor_0;1225713600000;350;
+Processor_0;1225724400000;1;
+mean: 240.9375 sum: 3855.0
+
+Processor_1;1225666800000;350;
+Processor_1;1225674000000;1;
+Processor_1;1225692000000;350;
+Processor_1;1225717200000;1;
+Processor_1;1225724400000;1;
+mean: 197.3125 sum: 3157.0
+
+Processor_2;1225666800000;350;
+Processor_2;1225674000000;1;
+Processor_2;1225706400000;350;
+Processor_2;1225720800000;1;
+Processor_2;1225724400000;1;
+mean: 131.875 sum: 2110.0
+
+Processor_3;1225666800000;350;
+Processor_3;1225674000000;1;
+Processor_3;1225724400000;1;
+mean: 44.625 sum: 714.0
+
+Processor_4;1225666800000;350;
+Processor_4;1225674000000;1;
+Processor_4;1225724400000;1;
+mean: 44.625 sum: 714.0
+
+Processor_5;1225666800000;350;
+Processor_5;1225677600000;1;
+Processor_5;1225724400000;1;
+mean: 66.4375 sum: 1063.0
+
+Processor_6;1225666800000;350;
+Processor_6;1225681200000;1;
+Processor_6;1225724400000;1;
+mean: 88.25 sum: 1412.0
+
+Processor_7;1225666800000;350;
+Processor_7;1225695600000;1;
+Processor_7;1225724400000;1;
+mean: 175.5 sum: 2808.0
+
+Processor_8;1225666800000;1;
+Processor_8;1225670400000;350;
+Processor_8;1225677600000;1;
+Processor_8;1225724400000;1;
+mean: 44.625 sum: 714.0
+
+Processor_9;1225666800000;1;
+Processor_9;1225724400000;1;
+mean: 1.0 sum: 16.0
+
+Processor_10;1225666800000;1;
+Processor_10;1225724400000;1;
+mean: 1.0 sum: 16.0
+
+Processor_11;1225666800000;1;
+Processor_11;1225724400000;1;
+mean: 1.0 sum: 16.0
+
+Processor_12;1225666800000;1;
+Processor_12;1225724400000;1;
+mean: 1.0 sum: 16.0
+
+Processor_13;1225666800000;1;
+Processor_13;1225724400000;1;
+mean: 1.0 sum: 16.0
+
+Processor_14;1225666800000;1;
+Processor_14;1225724400000;1;
+mean: 1.0 sum: 16.0
+
+Processor_15;1225666800000;1;
+Processor_15;1225724400000;1;
+mean: 1.0 sum: 16.0
+
Index: DCWoRMS/trunk/example/experiment3_result/experiment.properties
===================================================================
--- DCWoRMS/trunk/example/experiment3_result/experiment.properties	(revision 477)
+++ DCWoRMS/trunk/example/experiment3_result/experiment.properties	(revision 477)
@@ -0,0 +1,20 @@
+# Use single *.swf file as workload description.
+
+# Path to xml file which describes resource characteristics.
+resdesc=example/experiment3/resources.xml
+
+
+# and swf file, which name is declared by readscenario.workloadfilename parameter.
+# Swf file must be placed in readscenario.inputfolder directory.  
+readscenario.workloadfilename=example/experiment3/workload.swf
+
+# Choose if files with task processing history should be created.  
+printhistory=true
+
+# Choose directory where all result files should be placed.
+stats.outputfolder=../experiment3_result
+
+
+creatediagrams.gantt=true
+creatediagrams.utilization=true
+creatediagrams.taskswaitingtime=false
Index: DCWoRMS/trunk/example/experiment2/RunExperiment.java
===================================================================
--- DCWoRMS/trunk/example/experiment2/RunExperiment.java	(revision 477)
+++ DCWoRMS/trunk/example/experiment2/RunExperiment.java	(revision 477)
@@ -0,0 +1,19 @@
+package experiment2;
+import simulator.DataCenterWorkloadSimulator;
+
+
+public class RunExperiment {
+	
+	public static void main(String args[]){
+		RunExperiment runner = new RunExperiment();
+		runner.run();
+	}
+	
+	public void run(){
+		String args[] = {
+				"example/experiment2/experiment2.properties"
+				};
+		DataCenterWorkloadSimulator.main(args);
+	}
+
+}
Index: DCWoRMS/trunk/example/experiment2/resources.xml
===================================================================
--- DCWoRMS/trunk/example/experiment2/resources.xml	(revision 477)
+++ DCWoRMS/trunk/example/experiment2/resources.xml	(revision 477)
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<environment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+	xsi:noNamespaceSchemaLocation="../../simulator/schemas/resources/WormsResSchema.xsd">
+	
+	<!-- Data center description with some basic characteristics -->
+	<resources>
+		<computingResource class="DataCenter" name="compRes">
+			<computingResource class="Rack">
+				<resourceUnit class="storage">
+					<amount>1000000</amount>
+				</resourceUnit>
+				<computingResource class="ComputingNode" count="8">
+					<resourceUnit class="memory">
+						<amount>16384</amount>
+					</resourceUnit>
+					<computingResource class="Processor" count="2">
+						<parameter name="speed">
+							<value>1</value>
+						</parameter>
+					</computingResource>
+				</computingResource>	
+				<computingResource class="ComputingNode" count="4">
+					<resourceUnit class="memory">
+						<amount>65536</amount>
+					</resourceUnit>
+					<computingResource class="Processor" count="2">
+						<parameter name="speed">
+							<value>2</value>
+						</parameter>
+					</computingResource>
+				</computingResource>		
+			</computingResource>
+		</computingResource>
+		<scheduler class="Cluster" name="cluster">
+			<schedulingPlugin>
+				<name>example.localplugin.FCFSClusterLocalPlugin</name>
+			</schedulingPlugin>		
+				<managedComputingResources include="true">
+					<resourceName>Rack_0</resourceName>
+				</managedComputingResources>
+		</scheduler>	
+	</resources>
+	
+</environment>
Index: DCWoRMS/trunk/example/experiment2/experiment2.properties
===================================================================
--- DCWoRMS/trunk/example/experiment2/experiment2.properties	(revision 477)
+++ DCWoRMS/trunk/example/experiment2/experiment2.properties	(revision 477)
@@ -0,0 +1,20 @@
+# Use single *.swf file as workload description.
+
+# Path to xml file which describes resource characteristics.
+resdesc=example/experiment2/resources.xml
+
+
+# and swf file, which name is declared by readscenario.workloadfilename parameter.
+# Swf file must be placed in readscenario.inputfolder directory.  
+readscenario.workloadfilename=example/experiment2/workload.swf
+
+# Choose if files with task processing history should be created.  
+printhistory=true
+
+# Choose directory where all result files should be placed.
+stats.outputfolder=../experiment2_result
+
+
+creatediagrams.gantt=true
+creatediagrams.utilization=true
+creatediagrams.taskswaitingtime=false
Index: DCWoRMS/trunk/example/experiment2/workload.swf
===================================================================
--- DCWoRMS/trunk/example/experiment2/workload.swf	(revision 477)
+++ DCWoRMS/trunk/example/experiment2/workload.swf	(revision 477)
@@ -0,0 +1,30 @@
+;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		7200	1		-1		16384		1		-1		16384		-1		-1		-1		1		1		1		-1		-1
+		2			0			-1		7200	1		-1		16384		1		-1		16384		-1		-1		-1		1		1		1		-1		-1
+		3			0			-1		7200	1		-1		16384		1		-1		16384		-1		-1		-1		1		1		1		-1		-1
+		4			0			-1		7200	1		-1		16384		1		-1		16384		-1		-1		-1		1		1		1		-1		-1
+ 		5			0			-1		7200	1		-1		16384		1		-1		16384		-1		-1		-1		1		1		1		-1		-1
+ 		6			0			-1		10800	1		-1		24576		1		-1		24576		-1		-1		-1		1		1		1		-1		-1
+; -----------
+		7			0			-1		14400	1		-1		32768		1		-1		32768		-1		-1		-1		1		1		1		-1		-1
+		8			0			-1		28800	1		-1		65536		1		-1		65536		-1		-1		-1		1		1		1		-1		-1
+		9			3600		-1		7200	1		-1		16384		1		-1		16384		-1		-1		-1		1		1		1		-1		-1
+		10			21600		-1		21600	1		-1		49152		1		-1		49152		-1		-1		-1		1		1		1		-1		-1
+ 		11			25200		-1		25200	1		-1		57344		1		-1		57344		-1		-1		-1		1		1		1		-1		-1
+ 		12			39600		-1		14400	1		-1		32768		1		-1		32768		-1		-1		-1		1		1		1		-1		-1
+  		13			46800		-1		10800	1		-1		24576		1		-1		24576		-1		-1		-1		1		1		1		-1		-1
+ 		
Index: DCWoRMS/trunk/example/experiment3/resources.xml
===================================================================
--- DCWoRMS/trunk/example/experiment3/resources.xml	(revision 477)
+++ DCWoRMS/trunk/example/experiment3/resources.xml	(revision 477)
@@ -0,0 +1,200 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<environment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+	xsi:noNamespaceSchemaLocation="../../simulator/schemas/resources/WormsResSchema.xsd">
+	
+	<!-- Data Center description with energy parameters -->
+	<resources>
+		<computingResource class="DataCenter" name="compRes">
+			<computingResource class="Rack">
+				<computingResource class="ComputingNode" count="2">
+					<profile>
+						<powerProfile>
+							<energyEstimationPlugin>
+								<name>example.energy.ComputingNodeEnergyEstimationPlugin</name>
+							</energyEstimationPlugin>	
+							<powerStates>
+								<powerState>
+									<name>ON</name>
+									<powerUsage>750</powerUsage>
+								</powerState>
+								<powerState>
+									<name>OFF</name>
+									<powerUsage>0</powerUsage>
+								</powerState>
+							</powerStates>				
+						</powerProfile>
+					</profile>
+					<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">3000</value>
+									</property>		
+									<property name="voltage">
+										<value unit="V">0</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`">2660</value>
+									</property>		
+									<property name="voltage">
+										<value unit="V">0</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`">2330</value>
+									</property>		
+									<property name="voltage">
+										<value unit="V">0</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`">2000</value>
+									</property>		
+									<property name="voltage">
+										<value unit="V">0</value>
+									</property>
+									<property name="powerUsage">
+										<value unit="W">330</value>
+									</property>						
+								</parameter>								
+							</powerProfile>
+						</profile>
+					</computingResource>
+				</computingResource>	
+				<computingResource class="ComputingNode" count="2">
+					<profile>
+						<powerProfile>
+							<energyEstimationPlugin>
+								<name>example.energy.ComputingNodeEnergyEstimationPlugin</name>
+							</energyEstimationPlugin>	
+							<powerStates>
+								<powerState>
+									<name>ON</name>
+									<powerUsage>750</powerUsage>
+								</powerState>
+								<powerState>
+									<name>OFF</name>
+									<powerUsage>0</powerUsage>
+								</powerState>
+							</powerStates>				
+						</powerProfile>
+					</profile>
+					<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">3000</value>
+									</property>		
+									<property name="voltage">
+										<value unit="V">0</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`">2660</value>
+									</property>		
+									<property name="voltage">
+										<value unit="V">0</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`">2330</value>
+									</property>		
+									<property name="voltage">
+										<value unit="V">0</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`">2000</value>
+									</property>		
+									<property name="voltage">
+										<value unit="V">0</value>
+									</property>
+									<property name="powerUsage">
+										<value unit="W">330</value>
+									</property>						
+								</parameter>								
+							</powerProfile>
+						</profile>
+					</computingResource>
+				</computingResource>	
+			</computingResource>
+		</computingResource>
+		<scheduler class="Cluster" name="cluster">
+			<schedulingPlugin>
+				<name>example.localplugin.FCFSRandomClusterLocalPlugin</name>
+			</schedulingPlugin>	
+			<queues>
+						<queue>
+				<name>queue1</name>
+				<priority>1</priority>
+			</queue>
+						<queue>
+				<name>queue1</name>
+				<priority>1</priority>
+			</queue>
+			</queues>	
+
+			<managedComputingResources include="false">
+				<resourceName>compRes</resourceName>
+			</managedComputingResources>
+		</scheduler>	
+	</resources>
+
+</environment>
Index: DCWoRMS/trunk/example/experiment3/experiment3.properties
===================================================================
--- DCWoRMS/trunk/example/experiment3/experiment3.properties	(revision 477)
+++ DCWoRMS/trunk/example/experiment3/experiment3.properties	(revision 477)
@@ -0,0 +1,20 @@
+# Use single *.swf file as workload description.
+
+# Path to xml file which describes resource characteristics.
+resdesc=example/experiment3/resources.xml
+
+
+# and swf file, which name is declared by readscenario.workloadfilename parameter.
+# Swf file must be placed in readscenario.inputfolder directory.  
+readscenario.workloadfilename=example/experiment3/workload.swf
+
+# Choose if files with task processing history should be created.  
+printhistory=true
+
+# Choose directory where all result files should be placed.
+stats.outputfolder=../experiment3_result
+
+
+creatediagrams.gantt=true
+creatediagrams.utilization=true
+creatediagrams.taskswaitingtime=false
Index: DCWoRMS/trunk/example/experiment3/workload.swf
===================================================================
--- DCWoRMS/trunk/example/experiment3/workload.swf	(revision 477)
+++ DCWoRMS/trunk/example/experiment3/workload.swf	(revision 477)
@@ -0,0 +1,30 @@
+;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		7200	1		-1		-1		1		-1		-1		-1		-1		-1		1		1		1		-1		-1
+		2			0			-1		7200	1		-1		-1		1		-1		-1		-1		-1		-1		1		1		1		-1		-1
+		3			0			-1		7200	1		-1		-1		1		-1		-1		-1		-1		-1		1		1		1		-1		-1
+		4			0			-1		7200	1		-1		-1		1		-1		-1		-1		-1		-1		1		1		1		-1		-1
+ 		5			0			-1		7200	1		-1		-1		1		-1		-1		-1		-1		-1		1		1		1		-1		-1
+ 		6			0			-1		10800	1		-1		-1		1		-1		-1		-1		-1		-1		1		1		1		-1		-1
+; -----------
+		7			0			-1		14400	1		-1		-1		1		-1		-1		-1		-1		-1		1		1		1		-1		-1
+		8			0			-1		28800	1		-1		-1		1		-1		-1		-1		-1		-1		1		1		1		-1		-1
+		9			3600		-1		7200	1		-1		-1		1		-1		-1		-1		-1		-1		1		1		1		-1		-1
+		10			21600		-1		21600	1		-1		-1		1		-1		-1		-1		-1		-1		1		1		1		-1		-1
+ 		11			25200		-1		25200	1		-1		-1		1		-1		-1		-1		-1		-1		1		1		1		-1		-1
+ 		12			39600		-1		14400	1		-1		-1		1		-1		-1		-1		-1		-1		1		1		1		-1		-1
+  		13			46800		-1		10800	1		-1		-1		1		-1		-1		-1		-1		-1		1		1		1		-1		-1
+ 		
Index: DCWoRMS/trunk/example/experiment3/RunExperiment.java
===================================================================
--- DCWoRMS/trunk/example/experiment3/RunExperiment.java	(revision 477)
+++ DCWoRMS/trunk/example/experiment3/RunExperiment.java	(revision 477)
@@ -0,0 +1,19 @@
+package experiment3;
+import simulator.DataCenterWorkloadSimulator;
+
+
+public class RunExperiment {
+	
+	public static void main(String args[]){
+		RunExperiment runner = new RunExperiment();
+		runner.run();
+	}
+	
+	public void run(){
+		String args[] = {
+				"example/experiment3/experiment3.properties"
+				};
+		DataCenterWorkloadSimulator.main(args);
+	}
+
+}
Index: DCWoRMS/trunk/example/workloads/SDSC-SP2-68000-69000.swf
===================================================================
--- DCWoRMS/trunk/example/workloads/SDSC-SP2-68000-69000.swf	(revision 477)
+++ DCWoRMS/trunk/example/workloads/SDSC-SP2-68000-69000.swf	(revision 477)
@@ -0,0 +1,983 @@
+68000 52505134  13284  16437   12  16200    -1   12  43200    -1  1 256  39 42853  3 -1 -1 -1
+68001 52506146  12273  53027    6  52455    -1    6  64800    -1  1 292 106 42857  3 -1 -1 -1
+68002 52506458     14   5566   14   5479    -1   14   9000    -1  1 290 103 46818  4 -1 -1 -1
+68003 52508194  91831   8160   64   6699    -1   64  14400    -1  1   5   5 42861  3 -1 -1 -1
+68004 52510078  33099  56817   25  56288    -1   25  64800    -1  1 183  80 42865  3 -1 -1 -1
+68005 52512914     14    325    6 283.50    -1    6    900    -1  1  23  21 15885  3 -1 -1 -1
+68006 52513555  12865  26259    6  25959    -1    6  43200    -1  1  23  21 15885  3 -1 -1 -1
+68007 52515045 173850  28048   64  27639    -1   64  43200    -1  1 128  12 42875  4 -1 -1 -1
+68008 52518189    227   7991   16   7870    -1   16   9000    -1  1 290 103 46822  4 -1 -1 -1
+68009 52519908     11   1063    1     -1    -1    1   1500    -1  5 342  33 46826  3 -1 -1 -1
+68010 52521409     11    727    1  30.00    -1    1   1500    -1  1 342  33 46830  3 -1 -1 -1
+68011 52522196      4    157    1   6.00    -1    1   1500    -1  1 342  33 46833  3 -1 -1 -1
+68012 52522576     29     94    1   3.00    -1    1   1500    -1  1 342  33 46837  3 -1 -1 -1
+68013 52523038      5    547    1     -1    -1    1   1500    -1  5 342  33 46841  3 -1 -1 -1
+68014 52523600      4   1523    1     -1    -1    1   1500    -1  5 342  33 46845  3 -1 -1 -1
+68015 52527207     83     -1   -1     -1    -1   64    300    -1  5  43  32 46849  3 -1 -1 -1
+68016 52527527 108699   7257   64   7067    -1   64   7200    -1  5  43  32 46853  4 -1 -1 -1
+68017 52537556  15278  26204    6  25963    -1    6  43200    -1  1  23  21 15885  3 -1 -1 -1
+68018 52539665 149714     88   64   4.25    -1   64  64800    -1  1  19  17 42882  4 -1 -1 -1
+68019 52548298   2497    177   32 122.19    -1   32   3600    -1  1 361 130 46857  2 -1 -1 -1
+68020 52548348     25     -1   -1     -1    -1   32   3600    -1  5 361 130 46861  2 -1 -1 -1
+68021 52550753 138729  18026   64  17739    -1   64  43200    -1  1 128  12 42886  4 -1 -1 -1
+68022 52551045   1661    110    8  52.25    -1    8  39600    -1  1   3   3 42890  2 -1 -1 -1
+68023 52573285     14     25    1     -1    -1    1   1200    -1  1 204  87 46867  4 -1 -1 -1
+68024 52578559 128964    197   64   0.91    -1   64  43200    -1  5 128  12 46870  4 -1 -1 -1
+68025 52587457    160     -1   -1     -1    -1   16   9000    -1  5 290 103 46874  4 -1 -1 -1
+68026 52587662     27   8844   14   8738    -1   14  12000    -1  1 290 103 46877  4 -1 -1 -1
+68027 52589884  40928  14759    8  14611    -1    8  16200    -1  1 204  87 46890  4 -1 -1 -1
+68028 52599390 324037  64854   25  38505    -1   25  64800    -1  5 183  80 42894  3 -1 -1 -1
+68029 52604898  31331  38539   24  38152    -1   24  64800    -1  1 339 121 46894  4 -1 -1 -1
+68030 52610323 313105  53079   25  52498    -1   25  64800    -1  1 183  80 46898  3 -1 -1 -1
+68031 52612775  94973  18051   64  17815    -1   64  43200    -1  1 128  12 46902  4 -1 -1 -1
+68032 52630749  86233  27952   64  27624    -1   64  43200    -1  1 128  12 42898  4 -1 -1 -1
+68033 52636191  89644  17993   64  17753    -1   64  43200    -1  1 128  12 46906  4 -1 -1 -1
+68034 52639383 236312  17861   16  17686    -1   16  28800    -1  1 109  60 42902  3 -1 -1 -1
+68035 52639386 348921  17861   16  17657    -1   16  28800    -1  1 109  60 42906  3 -1 -1 -1
+68036 52644607  30178    483   32 420.75    -1   32   1800    -1  1 175  78 42910  3 -1 -1 -1
+68037 52671303  72538    153   64   0.89    -1   64  43200    -1  5 128  12 42914  4 -1 -1 -1
+68038 52679205     13   2272   32   2181    -1   32   3600    -1  1 290 103 46910  4 -1 -1 -1
+68039 52689311  55194  25627   64  25330    -1   64  43200    -1  1 128  12 42918  4 -1 -1 -1
+68040 52692328  51677    477   32 410.56    -1   32   1800    -1  1 175  78 46914  3 -1 -1 -1
+68041 52692919 146198     -1   -1     -1    -1   32  64800    -1  5  37  27 42922  4 -1 -1 -1
+68042 52692986 146139     -1   -1     -1    -1   32  64800    -1  5  37  27 42926  4 -1 -1 -1
+68043 52693178 182708  10451   32  10270    -1   32  23400    -1  5  37  27 42930  3 -1 -1 -1
+68044 52693244      9     -1   -1     -1    -1   32  64800    -1  5  37  27 42934  4 -1 -1 -1
+68045 52693266 304241  19553   32  19236    -1   32  23400    -1  1  37  27 42938  4 -1 -1 -1
+68046 52707480  37492  27927   64  27613    -1   64  43200    -1  1 128  12 42942  4 -1 -1 -1
+68047 52707576  62563    152   64   0.89    -1   64  43200    -1  5 128  12 42946  4 -1 -1 -1
+68048 52716915  53391  29031   64  28586    -1   64  43200    -1  1 128  12 46918  4 -1 -1 -1
+68049 52725770  47168  28087   64  27715    -1   64  43200    -1  1 128  12 42950  4 -1 -1 -1
+68050 52743801  56055  34646   64  34229    -1   64  43200    -1  1 128  12 46922  4 -1 -1 -1
+68051 52743857  57206  27916   64  27565    -1   64  43200    -1  1 128  12 46926  4 -1 -1 -1
+68052 52744904  84541  27926   64  27588    -1   64  43200    -1  1 128  12 46930  4 -1 -1 -1
+68053 52770102  87279  17989   64  17707    -1   64  43200    -1  1 128  12 42954  4 -1 -1 -1
+68054 52770158 135086  25860   64  25551    -1   64  43200    -1  1 128  12 42958  4 -1 -1 -1
+68055 52772873 132370  18162   64  17919    -1   64  43200    -1  1 128  12 46934  4 -1 -1 -1
+68056 52784208  15143    469   32 409.12    -1   32   1800    -1  1 175  78 42962  3 -1 -1 -1
+68057 52789705   9644    180   32 121.19    -1   32   3600    -1  1 361 130 46938  2 -1 -1 -1
+68058 52799311 131802  17841   64  17619    -1   64  43200    -1  1 128  12 42966  4 -1 -1 -1
+68059 52800996 147992  17990   64  17714    -1   64  43200    -1  1 128  12 46942  4 -1 -1 -1
+68060 52802454  26551    433   32 367.56    -1   32   1800    -1  1 175  78 46946  3 -1 -1 -1
+68061 52809506  25036   8168   64   6707    -1   64  14400    -1  1   5   5 42970  3 -1 -1 -1
+68062 52813361  15641    109    4   0.75    -1    4   1200    -1  5  11  10 46949  2 -1 -1 -1
+68063 52813749  15253    111    4   0.75    -1    4   1200    -1  5  11  10 46953  2 -1 -1 -1
+68064 52814126  14877    107    4   0.75    -1    4   1800    -1  5  11  10 46957  2 -1 -1 -1
+68065 52814357  14646    111    4   0.75    -1    4   3600    -1  5  11  10 46961  2 -1 -1 -1
+68066 52816175  12829     27    1     -1    -1    1    120    -1  1 178  45 42974  2 -1 -1 -1
+68067 52828954 146359   9944   64   9631    -1   64  43200    -1  5 128  12 42978  4 -1 -1 -1
+68068 52829067     34     24    1     -1    -1    1    300    -1  1 178  45 42982  5 -1 -1 -1
+68069 52834478 150800  18187   64  17845    -1   64  43200    -1  1 128  12 42986  4 -1 -1 -1
+68070 52839142   3583  61894   32  61035    -1   32  64800    -1  1  37  27 42990  2 -1 -1 -1
+68071 52839213   3514  61624   32  60753    -1   32  64800    -1  1  37  27 42994  2 -1 -1 -1
+68072 52839853 138371     -1   -1     -1    -1   32  64800    -1  5  80  42 46965  3 -1 -1 -1
+68073 52845364 132750     -1   -1     -1    -1   32  64800    -1  5  37  27 42998  3 -1 -1 -1
+68074 52845769   1171     -1   -1     -1    -1   32  23400    -1  5  37  27 43002  2 -1 -1 -1
+68075 52849743  73686  14230    4  13251    -1    4  64800    -1  1   4   4 140  3 -1 -1 -1
+68076 52853819  21562    478   32 414.88    -1   32   1800    -1  1 175  78 46972  3 -1 -1 -1
+68077 52857346 146130  33156   64  32809    -1   64  43200    -1  1 128  12 46976  4 -1 -1 -1
+68078 52858420 227027  40103   19  39540    -1   19  64800    -1  1  24  22 43006  3 -1 -1 -1
+68079 52859055  16322     26    1     -1    -1    1    120    -1  1 178  45 43010  2 -1 -1 -1
+68080 52873219   2159    623    4 584.00    -1    4    600    -1  1  11  10 43014  2 -1 -1 -1
+68081 52873256   2122    629    4 590.00    -1    4    600    -1  5  11  10 43018  2 -1 -1 -1
+68082 52873301   2077   1229    4   1189    -1    4   1200    -1  5  11  10 43022  2 -1 -1 -1
+68083 52873375   2004   3629    4   3564    -1    4   3600    -1  5  11  10 43026  2 -1 -1 -1
+68084 52875343 141740  30339   64  29938    -1   64  43200    -1  1 128  12 43030  4 -1 -1 -1
+68085 52875687    290     -1   -1     -1    -1  128  19800    -1  5  34   7 43034  3 -1 -1 -1
+68088 52876693  16885    175   64  94.08    -1   64    500    -1  1  49   7 43045  2 -1 -1 -1
+68089 52876834   9522    197   32 144.66    -1   32   1000    -1  1  49   7 43049  2 -1 -1 -1
+68090 52876953   2082    283   16 236.06    -1   16   1000    -1  1  49   7 43053  2 -1 -1 -1
+68091 52877047      6    436    8 399.75    -1    8   1000    -1  1  49   7 43057  1 -1 -1 -1
+68092 52877215     28    936    4 898.00    -1    4   2000    -1  1  49   7 43061  1 -1 -1 -1
+68093 52882638   3938    693   32 627.16    -1   32   1800    -1  1 175  78 46980  3 -1 -1 -1
+68094 52886512  91722     -1   -1     -1    -1   32  23400    -1  5  37  27 43065  3 -1 -1 -1
+68095 52888277     19   1553   32   1487    -1   32   1800    -1  1 175  78 43069  3 -1 -1 -1
+68096 52894584  72506   8183   64   6710    -1   64  14400    -1  1   5   5 46984  3 -1 -1 -1
+68097 52923381 130592  18162   64  17924    -1   64  43200    -1  1 128  12 43073  4 -1 -1 -1
+68098 52931078 123989  30363   64  30024    -1   64  43200    -1  1 128  12 43077  4 -1 -1 -1
+68099 52932125     13   5700   10   5617    -1   10   7200    -1  1 290 103 46988  4 -1 -1 -1
+68100 52933983  42552   1532   32   1457    -1   32   1800    -1  1 175  78 43081  3 -1 -1 -1
+68107 52944659     12     27    1     -1    -1    1    120    -1  1 178  45 46992  2 -1 -1 -1
+68108 52944731      3     24    1     -1    -1    1    300    -1  1 178  45 46996  5 -1 -1 -1
+68109 52948925 136523  18067   64  17811    -1   64  43200    -1  1 128  12 47000  4 -1 -1 -1
+68110 52950632 194569  64528   16  56186    -1   16  64800    -1  1 186  82 3865  3 -1 -1 -1
+68111 52956836     15     29    1   4.00    -1    1   1200    -1  1  34   7 43111  1 -1 -1 -1
+68112 52957162     31    109    8   0.75    -1    8    900    -1  5  34   7 43114  1 -1 -1 -1
+68113 52957514     22    457    8 263.50    -1    8    900    -1  1  34   7 43118  1 -1 -1 -1
+68114 52966953 178247  18131   64  17898    -1   64  43200    -1  1 128  12 43122  4 -1 -1 -1
+68115 52972827     11    109    2   0.50    -1    2    300    -1  5 178   1 47004  5 -1 -1 -1
+68116 52978244     10  19221   32  18897    -1   32  23400    -1  1  37  27 43126  2 -1 -1 -1
+68117 52983263 102184  56566   25  55985    -1   25  64800    -1  1 183  80 43130  3 -1 -1 -1
+68118 52985083 252769     43   64   0.66    -1   64  43200    -1  5 128  12 47007  4 -1 -1 -1
+68119 52992328 149707  59123   25  58565    -1   25  64800    -1  1 183  80 47011  3 -1 -1 -1
+68120 52994231      3     28    1     -1    -1    1    120    -1  1 178  45 47014  2 -1 -1 -1
+68121 52994275     21     24    1     -1    -1    1    300    -1  1 178  45 47018  5 -1 -1 -1
+68122 52994434     18     24    1     -1    -1    1    120    -1  1 178  45 43134  2 -1 -1 -1
+68123 52994508      6     25    1     -1    -1    1    300    -1  1 178  45 47022  5 -1 -1 -1
+68124 52995801    139     -1   -1     -1    -1    1    300    -1  5 178   1 43137  6 -1 -1 -1
+68125 52995993     53     -1   -1     -1    -1    1    300    -1  5 178   1 43141  6 -1 -1 -1
+68126 52996396     29     -1   -1     -1    -1    1    300    -1  5 178   1 47026  6 -1 -1 -1
+68127 52996441      6     24    1     -1    -1    1    300    -1  1 178  45 43145  2 -1 -1 -1
+68128 52997677     48     -1   -1     -1    -1    1  36000    -1  5 178  45 43149  2 -1 -1 -1
+68129 52997756     31     25    1     -1    -1    1    300    -1  1 178  45 43153  2 -1 -1 -1
+68130 52997981     25     24    1     -1    -1    1    120    -1  1 178  45 47030  2 -1 -1 -1
+68131 52998051     18     24    1     -1    -1    1    300    -1  1 178  45 47034  5 -1 -1 -1
+68132 53003440 234445  18220   64  17981    -1   64  43200    -1  1 128  12 47038  4 -1 -1 -1
+68133 53017327  34369     47    2   4.00    -1    2    300    -1  1 383 140 47042  2 -1 -1 -1
+68134 53023185  30787   1061   16   1007    -1   16   3600    -1  1  25  16 43157  2 -1 -1 -1
+68135 53031466  80303     -1   -1     -1    -1   19  64800    -1  5  24  22 43161  3 -1 -1 -1
+68137 53035111 101891   8189   64   6710    -1   64  14400    -1  1   5   5 43168  3 -1 -1 -1
+68138 53035670  16025     55    1  25.00    -1    1    600    -1  1  34   7 43171  1 -1 -1 -1
+68139 53036606 201310  26162   64  25845    -1   64  43200    -1  1 128  12 43175  4 -1 -1 -1
+68141 53044886    386     -1   -1     -1    -1    1    120    -1  5 178  45 43183  2 -1 -1 -1
+68142 53045411  58135  17889   16  17704    -1   16  28800    -1  1 109  60 43187  3 -1 -1 -1
+68143 53045449  58097   8096   16   7984    -1   16  28800    -1  1 109  60 43191  3 -1 -1 -1
+68144 53045482  26695   9033   16   8925    -1   16   9000    -1  5 109  60 43195  3 -1 -1 -1
+68145 53045505  26673   6779   16   6689    -1   16   9000    -1  1 109  60 43198  3 -1 -1 -1
+68146 53045506   6190     25    1     -1    -1    1    120    -1  1 178  45 43202  2 -1 -1 -1
+68147 53047393 208730  18210   64  17972    -1   64  43200    -1  1 128  12 43206  4 -1 -1 -1
+68148 53050219     36     32    1   1.00    -1    1   1800    -1  1 140  69 43209  3 -1 -1 -1
+68149 53050239     15     32    2   2.00    -1    2   1800    -1  1 140  69 43213  3 -1 -1 -1
+68150 53050247      7     34    4   1.75    -1    4   1800    -1  1 140  69 43217  3 -1 -1 -1
+68151 53050255     40     46    8   1.88    -1    8   1800    -1  1 140  69 43221  3 -1 -1 -1
+68152 53050267     27     60   16   1.94    -1   16   1800    -1  1 140  69 43224  3 -1 -1 -1
+68153 53050275     19     65   32   2.00    -1   32   1800    -1  1 140  69 43228  3 -1 -1 -1
+68154 53050283      6     94   64   2.16    -1   64   1800    -1  1 140  69 43231  3 -1 -1 -1
+68155 53050292     90     -1   -1     -1    -1  128   1800    -1  5 140  69 43235  3 -1 -1 -1
+68156 53050434     20    171    1 128.00    -1    1   1800    -1  1 140  69 43238  3 -1 -1 -1
+68157 53051198     35    195    1 127.00    -1    1   1800    -1  1 140  69 43241  3 -1 -1 -1
+68158 53051221     12    125    2  75.50    -1    2   1800    -1  1 140  69 43245  3 -1 -1 -1
+68159 53051284     14    103    4  41.50    -1    4   1800    -1  1 140  69 43248  3 -1 -1 -1
+68160 53051291      7     76    8  23.00    -1    8   1800    -1  1 140  69 43252  3 -1 -1 -1
+68161 53051299     38     89   16  23.44    -1   16   1800    -1  1 140  69 43255  3 -1 -1 -1
+68162 53051309     26     89   32  10.12    -1   32   1800    -1  1 140  69 43259  3 -1 -1 -1
+68163 53051321     11    130   64   8.73    -1   64   1800    -1  1 140  69 43263  3 -1 -1 -1
+68165 53054766     16     24    1     -1    -1    1    120    -1  1 178  45 43271  2 -1 -1 -1
+68166 53054840      5     24    1     -1    -1    1    300    -1  1 178  45 43275  5 -1 -1 -1
+68167 53064011   8133  64832    4  64239    -1    4  64800    -1  5  11  10 43279  2 -1 -1 -1
+68168 53064031   8113  64834    4  64243    -1    4  64800    -1  5  11  10 43283  2 -1 -1 -1
+68169 53064049   8096  64833    4  64250    -1    4  64800    -1  5  11  10 43287  2 -1 -1 -1
+68170 53064077   8069  64830    4  64202    -1    4  64800    -1  5  11  10 43291  2 -1 -1 -1
+68171 53072106 192010  25987   64  25682    -1   64  43200    -1  1 128  12 43295  4 -1 -1 -1
+68172 53085402 204708  26131   64  25770    -1   64  43200    -1  1 128  12 43299  4 -1 -1 -1
+68173 53087979     19     24    1     -1    -1    1    300    -1  1 178  45 47046  5 -1 -1 -1
+68174 53088315     26     24    1     -1    -1    1    120    -1  1 178  45 47050  2 -1 -1 -1
+68175 53089866      5     24    1     -1    -1    1    300    -1  1 178  45 43303  2 -1 -1 -1
+68176 53096207     23     24    1     -1    -1    1    120    -1  1 178  45 47053  2 -1 -1 -1
+68177 53096277     15     24    1     -1    -1    1    300    -1  1 178  45 47057  5 -1 -1 -1
+68178 53096538 209871     -1   -1     -1    -1    1    120    -1  5 178   1 47061  6 -1 -1 -1
+68179 53097314      9     57    2  10.00    -1    2    300    -1  1 383 140 47065  2 -1 -1 -1
+68180 53099863     24   2256    4   2206    -1    4  36000    -1  5 290 103 47069  4 -1 -1 -1
+68181 53102195     28  47786    4  47332    -1    4  54000    -1  1 290 103 47073  4 -1 -1 -1
+68182 53102426   1115     47    8   1.88    -1    8  39600    -1  1   3   3 43307  2 -1 -1 -1
+68183 53103479 212228  33620   64  33242    -1   64  43200    -1  1 128  12 47077  4 -1 -1 -1
+68184 53103969      8  39635    8  39037    -1    8  39600    -1  5   3   3 43311  2 -1 -1 -1
+68185 53104512     28    927    2 441.00    -1    2    900    -1  5  23  21 15885  3 -1 -1 -1
+68186 53107858     24    107    4   0.75    -1    4   3600    -1  5  25  16 43315  1 -1 -1 -1
+68187 53108238     20    981    4 945.00    -1    4   3600    -1  5  25  16 43319  1 -1 -1 -1
+68188 53109481     30    579    4 541.75    -1    4   3600    -1  5  25  16 43323  1 -1 -1 -1
+68189 53109879  27090  58304    6  57678    -1    6  64800    -1  1 292 106 42857  3 -1 -1 -1
+68190 53110370     25   3628    4   3574    -1    4   3600    -1  5  25  16 43327  1 -1 -1 -1
+68191 53111714      8    127    2  89.00    -1    2    900    -1  1  23  21 15885  3 -1 -1 -1
+68192 53111902      8    110    8   0.88    -1    8   3600    -1  5 185  81 43333  2 -1 -1 -1
+68193 53112086     14    773    8 728.25    -1    8   3600    -1  5 185  81 43336  2 -1 -1 -1
+68194 53112857     30    277    8 234.50    -1    8   3600    -1  1 185  81 43340  2 -1 -1 -1
+68195 53114453     32   1134   36   1046    -1   36   3600    -1  1 185  81 43344  2 -1 -1 -1
+68196 53116872     12   4858    8   4791    -1    8  28800    -1  5 185  81 43348  2 -1 -1 -1
+68197 53117149   5614     -1   -1     -1    -1    6  28800    -1  5  23  21 15885  3 -1 -1 -1
+68198 53117189    179     -1   -1     -1    -1    6  28800    -1  5  23  21 15885  3 -1 -1 -1
+68199 53117413   5359     -1   -1     -1    -1    6  28800    -1  5  23  21 15885  3 -1 -1 -1
+68200 53117513   5268     -1   -1     -1    -1    6  28800    -1  5  23  21 15885  3 -1 -1 -1
+68201 53117637   5152     -1   -1     -1    -1    6  28800    -1  5  23  21 15885  3 -1 -1 -1
+68202 53121442     10  15042    8  14667    -1    8  43200    -1  1 185  81 43367  2 -1 -1 -1
+68203 53122285     12  15041    8  14669    -1    8  28800    -1  1 185  81 43371  2 -1 -1 -1
+68204 53122351      9  15059    8  14669    -1    8  43200    -1  1 185  81 43375  2 -1 -1 -1
+68205 53122839     25    358    6 265.00    -1    6  27000    -1  5  23  21 15885  3 -1 -1 -1
+68206 53122869     27    329    6 237.67    -1    6  27000    -1  5  23  21 15885  3 -1 -1 -1
+68207 53122903     24    297    6 255.83    -1    6  27000    -1  5  23  21 15885  3 -1 -1 -1
+68208 53122925      2    298    6 253.67    -1    6  27000    -1  5  23  21 15885  3 -1 -1 -1
+68209 53123006  61498  17811   16  17620    -1   16  28800    -1  1 109  60 43379  3 -1 -1 -1
+68210 53123268      8    285    6 243.00    -1    6  26700    -1  5  23  21 15885  3 -1 -1 -1
+68211 53123320     19    221    6 150.50    -1    6  26700    -1  5  23  21 15885  3 -1 -1 -1
+68212 53123366      5    190    6 149.17    -1    6  26700    -1  5  23  21 15885  3 -1 -1 -1
+68213 53123406     28    128    6  86.83    -1    6  26700    -1  5  23  21 15885  3 -1 -1 -1
+68214 53123737     11     24    1     -1    -1    1   1200    -1  1  23  21 47113  3 -1 -1 -1
+68215 53123828     14    194    1 148.00    -1    1   1200    -1  1  23  21 47113  3 -1 -1 -1
+68216 53124197  26029  25604    6  25330    -1    6  27000    -1  1  23  21 15885  3 -1 -1 -1
+68217 53124245  60261  24772    6  24533    -1    6  27000    -1  1  23  21 15885  3 -1 -1 -1
+68218 53124290  63898  24747    6  24518    -1    6  27000    -1  1  23  21 15885  3 -1 -1 -1
+68219 53124345  76842  24816    6  24528    -1    6  27000    -1  1  23  21 15885  3 -1 -1 -1
+68220 53125281  59223  17901   16  17717    -1   16  28800    -1  1 109  60 43383  3 -1 -1 -1
+68221 53125316  59189   7701   16   7596    -1   16  28800    -1  1 109  60 43387  3 -1 -1 -1
+68222 53126639    377     -1   -1     -1    -1    8  24000    -1  5  47   3 47130  4 -1 -1 -1
+68223 53127025      2   9032    8   8655    -1    8   9000    -1  5  47   3 47133  4 -1 -1 -1
+68224 53128536  72651   7730   12   7631    -1   12  21600    -1  1 109  60 43391  3 -1 -1 -1
+68225 53129948     20   1893   32   1718    -1   32   1800    -1  1 175  78 43395  3 -1 -1 -1
+68226 53129954    417     -1   -1     -1    -1   32   1800    -1  5 175  78 43399  3 -1 -1 -1
+68227 53144196     28    163    4 129.00    -1    4   3600    -1  1  25  16 43403  1 -1 -1 -1
+68228 53144411     32    264    4 231.00    -1    4   3600    -1  1  25  16 43407  1 -1 -1 -1
+68229 53144790     28  26118    8  25738    -1    8  39600    -1  1   3   3 47137  2 -1 -1 -1
+68230 53145452     28    472    2 438.50    -1    2   3600    -1  1  25  16 43411  1 -1 -1 -1
+68231 53146010   4027    164    8 129.75    -1    8   3600    -1  1  25  16 43415  1 -1 -1 -1
+68232 53149587 254021  58807   25  58206    -1   25  64800    -1  1 183  80 47141  3 -1 -1 -1
+68233 53151142     23    167    1 133.00    -1    1   1800    -1  1  11  10 47145  2 -1 -1 -1
+68234 53151215     13    220    1 187.00    -1    1   1800    -1  1  11  10 47149  2 -1 -1 -1
+68235 53151259      0    324    1 290.00    -1    1   1800    -1  1  11  10 47152  2 -1 -1 -1
+68236 53151318     36    503    1 468.00    -1    1   2700    -1  1  11  10 47156  2 -1 -1 -1
+68237 53153128  20289  55465    4  54897    -1    4  64800    -1  1  11  10 47159  2 -1 -1 -1
+68238 53153150  20268  64176    4  63555    -1    4  64800    -1  1  11  10 47163  2 -1 -1 -1
+68239 53153172  20247  61469    4  60876    -1    4  64800    -1  1  11  10 47167  2 -1 -1 -1
+68240 53153198  20221  54572    4  54035    -1    4  64800    -1  1  11  10 47171  2 -1 -1 -1
+68241 53154204      7     50    3  19.33    -1    3    600    -1  1  11  10 43419  2 -1 -1 -1
+68242 53154442     19    188    1 156.00    -1    1    360    -1  1  11  10 43423  2 -1 -1 -1
+68243 53154918     11    186    1 154.00    -1    1    360    -1  1  11  10 43427  2 -1 -1 -1
+68244 53156197   7143  10119   32   9987    -1   32  11520    -1  1  11  10 43431  2 -1 -1 -1
+68245 53156730   6611  10072   32   9941    -1   32  11520    -1  1  11  10 43435  2 -1 -1 -1
+68246 53161888   9690  16595    8  16121    -1    8  19800    -1  1  47   3 47175  2 -1 -1 -1
+68247 53163306 152971  25998   64  25692    -1   64  43200    -1  1 128  12 43438  4 -1 -1 -1
+68248 53169947      5    445    2 411.50    -1    2   3600    -1  5  25  16 43441  1 -1 -1 -1
+68249 53170380    575    599    8 560.88    -1    8   3600    -1  1  25  16 43445  1 -1 -1 -1
+68250 53171949   1468    352   16 306.50    -1   16   3600    -1  1  25  16 43449  2 -1 -1 -1
+68251 53183814      2    229   32 174.84    -1   32   3600    -1  1  25  16 43453  2 -1 -1 -1
+68252 53184437  28800    189   64 113.84    -1   64   3600    -1  1  25  16 43457  2 -1 -1 -1
+68254 53185060     13   2163    2   2114    -1    2   3600    -1  1  25  16 43465  1 -1 -1 -1
+68255 53187185  15149  14372   16  14214    -1   16  14400    -1  1 290 103 47179  4 -1 -1 -1
+68256 53188002    185   1118    4   1077    -1    4   3600    -1  1  25  16 43469  1 -1 -1 -1
+68257 53189024   6273  31066    8  30496    -1    8  39600    -1  1   3   3 47183  2 -1 -1 -1
+68258 53191113     25    178    4 145.75    -1    4  28800    -1  1 185  81 43473  2 -1 -1 -1
+68259 53191159     14     -1   -1     -1    -1    4    600    -1  5 185  81 43476  2 -1 -1 -1
+68260 53192007    208  41346   18  40886    -1   18  43200    -1  1 185  81 43479  2 -1 -1 -1
+68261 53192280  10150  10793   16  10663    -1   16  14400    -1  1 290 103 43483  4 -1 -1 -1
+68262 53206458   3282   1801   32   1717    -1   32   1800    -1  1 175  78 47187  3 -1 -1 -1
+68263 53211714     32     25    1     -1    -1    1    120    -1  1 178  45 47191  2 -1 -1 -1
+68264 53211786     25     23    1     -1    -1    1    300    -1  1 178  45 43487  5 -1 -1 -1
+68265 53212325 191286  64853   25  38535    -1   25  64800    -1  5 183  80 47195  3 -1 -1 -1
+68266 53256077  86216  25981   64  25679    -1   64  43200    -1  1 128  12 47199  4 -1 -1 -1
+68267 53264051  85316  18010   64  17774    -1   64  43200    -1  1 128  12 47202  4 -1 -1 -1
+68268 53270408   3939  41330   18  40888    -1   18  43200    -1  1 185  81 43491  2 -1 -1 -1
+68269 53273314   1033     26    1     -1    -1    1    120    -1  1 178  45 43495  2 -1 -1 -1
+68270 53274020  26205     -1   -1     -1    -1   64  43200    -1  5 128  12 47206  4 -1 -1 -1
+68271 53274307  93078  18044   64  17807    -1   64  43200    -1  1 128  12 43499  4 -1 -1 -1
+68272 53274412     29     24    1     -1    -1    1    300    -1  1 178  45 43503  5 -1 -1 -1
+68273 53290074  78217  11930   64  11618    -1   64  43200    -1  5 128  12 43507  4 -1 -1 -1
+68274 53300260  85190  18141   64  17862    -1   64  43200    -1  1 128  12 47209  4 -1 -1 -1
+68275 53316215  87391  30005   64  29670    -1   64  43200    -1  1 128  12 47213  4 -1 -1 -1
+68276 53336483  12853     24    1     -1    -1    1    120    -1  1 178  45 43511  2 -1 -1 -1
+68277 53337375  96247  41732   18  41079    -1   18  43200    -1  1 185  81 43515  2 -1 -1 -1
+68278 53342246 120196  18130   64  17849    -1   64  43200    -1  1 128  12 43519  4 -1 -1 -1
+68279 53349299 131311  18033   64  17801    -1   64  43200    -1  1 128  12 47217  4 -1 -1 -1
+68280 53349384  30856     25    1     -1    -1    1    300    -1  1 178  45 47221  5 -1 -1 -1
+68281 53367350 131331  33566   64  33204    -1   64  43200    -1  1 128  12 43523  4 -1 -1 -1
+68282 53368250 158965  30005   64  29658    -1   64  43200    -1  1 128  12 43527  4 -1 -1 -1
+68283 53380067 152202  18011   64  17773    -1   64  43200    -1  1 128  12 43531  4 -1 -1 -1
+68284 53385398 164941  17998   64  17715    -1   64  43200    -1  1 128  12 43535  4 -1 -1 -1
+68285 53403567 153703  30091   64  29699    -1   64  43200    -1  1 128  12 47225  4 -1 -1 -1
+68286 53433584 143474    148   64   0.91    -1   64  43200    -1  5 128  12 47229  4 -1 -1 -1
+68287 53453686  20114  53397   32  52856    -1   32  64800    -1  1 273  61 43539  4 -1 -1 -1
+68288 53466518   8843  18149   16  17923    -1   16  28800    -1  1 109  60 43543  3 -1 -1 -1
+68289 53466532  26989   8061   16   7967    -1   16  28800    -1  1 109  60 43547  3 -1 -1 -1
+68290 53469014 212164  64563   16  56182    -1   16  64800    -1  1 186  82 3865  3 -1 -1 -1
+68291 53473778     21     35    8   1.12    -1    8  36000    -1  1  51  16 3865  2 -1 -1 -1
+68292 53473914      9     46    8   2.62    -1    8  36000    -1  1  51  16 3865  2 -1 -1 -1
+68293 53474174     29  36033    8  32760    -1    8  36000    -1  5  51  16 3865  2 -1 -1 -1
+68294 53477780  23808   9982   12   9872    -1   12  21600    -1  1 109  60 43554  3 -1 -1 -1
+68295 53480318  21270  13061   12  12806    -1   12  36000    -1  1 109  60 43558  3 -1 -1 -1
+68296 53480545  96675  17968   64  17741    -1   64  43200    -1  1 128  12 43562  4 -1 -1 -1
+68297 53485222     24    181    1 124.00    -1    1   1800    -1  1 382   7 43566  3 -1 -1 -1
+68298 53486126     23     27    1     -1    -1    1    120    -1  1 178  45 47242  2 -1 -1 -1
+68299 53486196     15     24    1     -1    -1    1    300    -1  1 178  45 47246  5 -1 -1 -1
+68300 53493618 187440  58247   25  57618    -1   25  64800    -1  1 183  80 43570  3 -1 -1 -1
+68301 53493750 187308     99   25  13.92    -1   25  64800    -1  1 183  80 43573  3 -1 -1 -1
+68302 53498613  88822  30076   64  29729    -1   64  43200    -1  1 128  12 47250  4 -1 -1 -1
+68303 53503761  64669   8184   64   6706    -1   64  14400    -1  1   5   5 43577  3 -1 -1 -1
+68304 53504426   5836     25    1     -1    -1    1    120    -1  1 178  45 47253  2 -1 -1 -1
+68305 53510322      3     24    1     -1    -1    1    300    -1  1 178  45 43581  5 -1 -1 -1
+68306 53531386 209682  53687   32  53173    -1   32  64800    -1  1 273  61 47257  4 -1 -1 -1
+68307 53532222  71181  17964   64  17727    -1   64  43200    -1  1 128  12 47261  4 -1 -1 -1
+68308 53550246  70652  29985   64  29586    -1   64  43200    -1  1 128  12 43585  4 -1 -1 -1
+68309 53555398 118484  12792   12  12658    -1   12  21600    -1  1 109  60 43589  3 -1 -1 -1
+68310 53557180  65494  17847   64  17622    -1   64  43200    -1  1 128  12 43593  4 -1 -1 -1
+68311 53560265   8102     32    4   0.75    -1    4   3600    -1  1   3  74 47265  1 -1 -1 -1
+68312 53563474 123209  43233   16  42871    -1   16  43200    -1  5 109  60 43606  3 -1 -1 -1
+68313 53563484 175839  32536   16  32257    -1   16  43200    -1  1 109  60 43610  3 -1 -1 -1
+68314 53563494 182278  43233   16  42855    -1   16  43200    -1  5 109  60 43614  3 -1 -1 -1
+68315 53563504 208502  32025   16  31753    -1   16  43200    -1  1 109  60 43618  3 -1 -1 -1
+68316 53568302  72337  33208   64  32795    -1   64  43200    -1  1 128  12 43621  4 -1 -1 -1
+68317 53568602    747     -1   -1     -1    -1    1    300    -1  5  26   7 43624  2 -1 -1 -1
+68318 53569369    106     -1   -1     -1    -1    1    300    -1  5  26   7 43627  2 -1 -1 -1
+68319 53569372    106     -1   -1     -1    -1    2    300    -1  5  26   7 43630  2 -1 -1 -1
+68320 53569374    107     -1   -1     -1    -1    4    300    -1  5  26   7 43633  2 -1 -1 -1
+68321 53569377    109     -1   -1     -1    -1    8    300    -1  5  26   7 43636  2 -1 -1 -1
+68322 53569381    107     -1   -1     -1    -1   16    300    -1  5  26   7 43639  2 -1 -1 -1
+68323 53569384    106     -1   -1     -1    -1   32    300    -1  5  26   7 43642  2 -1 -1 -1
+68324 53569387    105     -1   -1     -1    -1   48    300    -1  5  26   7 43645  2 -1 -1 -1
+68325 53569389    105     -1   -1     -1    -1   64    300    -1  5  26   7 43648  2 -1 -1 -1
+68326 53569818   7046     56    1  20.00    -1    1    300    -1  1  26   7 43651  2 -1 -1 -1
+68327 53569820   7043    166    2 127.00    -1    2    300    -1  1  26   7 43654  2 -1 -1 -1
+68328 53569823   7040    117    4  76.75    -1    4    300    -1  1  26   7 43657  2 -1 -1 -1
+68329 53569826   7036     96    8  48.00    -1    8    300    -1  1  26   7 43660  2 -1 -1 -1
+68330 53569828   6930     93   16  34.88    -1   16    300    -1  1  26   7 43663  2 -1 -1 -1
+68331 53569831   7031     86   32  28.16    -1   32    300    -1  1  26   7 43665  2 -1 -1 -1
+68332 53569834   6923     89   48  26.35    -1   48    300    -1  1  26   7 43668  2 -1 -1 -1
+68333 53569836   6796    111   64  29.05    -1   64    300    -1  1  26   7 43671  2 -1 -1 -1
+68334 53572903  42666     -1   -1     -1    -1    1   1800    -1  5   3  74 47269  4 -1 -1 -1
+68335 53573093  42479     -1   -1     -1    -1    1   3600    -1  5   3  74 47273  4 -1 -1 -1
+68336 53577070  73960  29996   64  29604    -1   64  43200    -1  1 128  12 47277  4 -1 -1 -1
+68337 53577149  18077   8163   64   6710    -1   64  14400    -1  1   5   5 47281  3 -1 -1 -1
+68338 53579623   7749     31    1     -1    -1    1    300    -1  1  26   7 43674  2 -1 -1 -1
+68339 53587336  94277  18014   64  17775    -1   64  43200    -1  1 128  12 43677  4 -1 -1 -1
+68340 53595161 104600  17977   64  17687    -1   64  43200    -1  1 128  12 43681  4 -1 -1 -1
+68341 53615589   1934   1190    1  72.00    -1    1   1800    -1  1   3  74 43685  1 -1 -1 -1
+68342 53615605   1918   3358    1 228.00    -1    1   3600    -1  1   3  74 43689  1 -1 -1 -1
+68343 53617483 108614  18001   64  17720    -1   64  43200    -1  1 128  12 43693  4 -1 -1 -1
+68344 53617767   3615    756   64 231.83    -1   64   1800    -1  1   3  74 47285  3 -1 -1 -1
+68345 53618772     32     83   16  10.38    -1   16   1800    -1  1   3  74 43697  4 -1 -1 -1
+68346 53619468     24    643   16 479.50    -1   16   1200    -1  1   3  74 43701  4 -1 -1 -1
+68347 53620252     15     -1   -1     -1    -1   64   1800    -1  5   3  74 47289  2 -1 -1 -1
+68348 53620908    972     -1   -1     -1    -1   16   1200    -1  5   3  74 43705  4 -1 -1 -1
+68349 53621341 122783  17987   64  17758    -1   64  43200    -1  1 128  12 43709  4 -1 -1 -1
+68350 53621942    201    517   16 347.69    -1   16   1200    -1  1   3  74 43713  2 -1 -1 -1
+68351 53631494   9046     82   32  29.12    -1   32    300    -1  1 328   7 43716  3 -1 -1 -1
+68352 53632178      5     -1   -1     -1    -1    4   3600    -1  5   3  74 43719  1 -1 -1 -1
+68353 53632466   8073     37    8   0.88    -1    8  19800    -1  1  47  74 47296  2 -1 -1 -1
+68354 53640492 121656  17995   64  17692    -1   64  43200    -1  1 128  12 47300  4 -1 -1 -1
+68355 53641893   9009    109   32  36.66    -1   32    300    -1  1 328   7 43722  3 -1 -1 -1
+68356 53642163  20435     -1   -1     -1    -1    2  21600    -1  5 100  74 43725  3 -1 -1 -1
+68357 53642659    235     -1   -1     -1    -1    8    600    -1  5 137  50 47304  3 -1 -1 -1
+68358 53643402   7501     43    8   3.50    -1    8    600    -1  1 137  50 47308  1 -1 -1 -1
+68359 53646208  27673     91   32  29.50    -1   32    300    -1  1 328   7 43728  3 -1 -1 -1
+68360 53647714 297586  18206   16  18024    -1   16  28800    -1  1 109  60 43731  3 -1 -1 -1
+68361 53647776 297524   8127   16   8015    -1   16  28800    -1  1 109  60 43734  3 -1 -1 -1
+68362 53650844 129463  33186   64  32810    -1   64  43200    -1  1 128  12 43738  4 -1 -1 -1
+68363 53651068  22813   1620    1   1569    -1    1   7200    -1  1  51  16 3865  2 -1 -1 -1
+68364 53651439  22537     36   32   0.88    -1   32    300    -1  5 328   7 43742  3 -1 -1 -1
+68365 53652558  21450    253    8 213.38    -1    8   4500    -1  1 206  53 47314  3 -1 -1 -1
+68366 53655487  25784    318   64  37.08    -1   64   1200    -1  1   5   5 43746  3 -1 -1 -1
+68367 53656603   6558     -1   -1     -1    -1    8    600    -1  5 137  50 47318  1 -1 -1 -1
+68368 53662554  11327   3979    2   3734    -1    2  21600    -1  1 100  74 43750  2 -1 -1 -1
+68369 53663471  10409    112    8   0.88    -1    8    600    -1  5 137  50 43754  1 -1 -1 -1
+68370 53663476  10404    108    4   0.75    -1    4   1200    -1  5 137  50 43757  1 -1 -1 -1
+68371 53663480  10400    113    2   0.50    -1    2   2400    -1  5 137  50 43760  1 -1 -1 -1
+68372 53663485  10395     29    1     -1    -1    1   4800    -1  1 137  50 43764  1 -1 -1 -1
+68373 53671340   2541     28    1     -1    -1    1    120    -1  1 178  45 47322  2 -1 -1 -1
+68374 53673811 140069  17926   64  17613    -1   64  43200    -1  1 128  12 43768  4 -1 -1 -1
+68375 53673949     27     24    1     -1    -1    1    300    -1  1 178  45 43771  5 -1 -1 -1
+68376 53674764     36    275    8 204.38    -1    8    600    -1  1 137  50 43775  1 -1 -1 -1
+68377 53674773     28    438    4 395.50    -1    4   1200    -1  1 137  50 43779  1 -1 -1 -1
+68378 53674775     31    838    2 726.00    -1    2   2400    -1  1 137  50 43783  1 -1 -1 -1
+68379 53674778     28     79    1  19.00    -1    1   4800    -1  1 137  50 43787  1 -1 -1 -1
+68380 53675441     29    141   16  89.81    -1   16    600    -1  1 137  50 43791  2 -1 -1 -1
+68381 53675773     11    209   12 159.08    -1   12    600    -1  1 137  50 43795  2 -1 -1 -1
+68382 53675978     33    806    4 762.50    -1    4   1200    -1  1 137  50 43798  1 -1 -1 -1
+68383 53676787     21     42    4   2.25    -1    4   1200    -1  1 137  50 43801  1 -1 -1 -1
+68384 53676795     13     36    2   2.00    -1    2   2400    -1  1 137  50 43805  1 -1 -1 -1
+68385 53676799      9     37    1   1.00    -1    1   4800    -1  1 137  50 43809  1 -1 -1 -1
+68386 53676802      6     36    8   2.00    -1    8    600    -1  1 137  50 43813  1 -1 -1 -1
+68387 53676805      3     44   12   2.17    -1   12    600    -1  1 137  50 43817  2 -1 -1 -1
+68388 53676808     32     43   16   2.38    -1   16    600    -1  5 137  50 43821  2 -1 -1 -1
+68389 53676942     24    245    8 204.38    -1    8    600    -1  1 137  50 43825  1 -1 -1 -1
+68390 53676945     21    436    4 397.25    -1    4   1200    -1  1 137  50 43829  1 -1 -1 -1
+68391 53676948     19    802    2 724.50    -1    2   2400    -1  1 137  50 43833  1 -1 -1 -1
+68392 53676951     16     51    1  19.00    -1    1   4800    -1  1 137  50 43836  1 -1 -1 -1
+68393 53677117      6    113    8   0.75    -1    8    600    -1  5 137  50 43840  1 -1 -1 -1
+68394 53677163     23    147    8 103.75    -1    8    600    -1  1 137  50 43844  1 -1 -1 -1
+68395 53677271      9    199   12 157.50    -1   12    600    -1  1 137  50 43848  2 -1 -1 -1
+68396 53677294     17     40    4   8.75    -1    4   1200    -1  1 137  50 43852  1 -1 -1 -1
+68397 53677299     12     43    2   8.00    -1    2   2400    -1  1 137  50 43856  1 -1 -1 -1
+68398 53677302      9     39    1   8.00    -1    1   4800    -1  1 137  50 43860  1 -1 -1 -1
+68399 53677307     69     50   12   8.67    -1   12    600    -1  1 137  50 43864  2 -1 -1 -1
+68400 53677310      2    114   16  68.06    -1   16    600    -1  1 137  50 43868  2 -1 -1 -1
+68401 53677447     25    130   32  71.03    -1   32    600    -1  1 137  50 43872  2 -1 -1 -1
+68402 53677528     99    124   24  74.71    -1   24    600    -1  1 137  50 43876  2 -1 -1 -1
+68403 53677831     16    785    4 748.50    -1    4   1200    -1  5 137  50 43880  1 -1 -1 -1
+68404 53677876      2    195    8 154.25    -1    8    600    -1  1 137  50 43884  1 -1 -1 -1
+68405 53677915     26    682    4 643.00    -1    4   1200    -1  5 137  50 43888  1 -1 -1 -1
+68406 53678342   2711    199   64  99.34    -1   64    600    -1  1 137  50 43892  2 -1 -1 -1
+68407 53678619      7    550    4 512.75    -1    4   1200    -1  1 137  50 43896  1 -1 -1 -1
+68408 53680959 111537     -1   -1     -1    -1   64  43200    -1  5 128  12 43900  4 -1 -1 -1
+68409 53682956  34907   8110   64   6681    -1   64  14400    -1  1   5   5 47326  3 -1 -1 -1
+68410 53688307     24     24    1     -1    -1    1   4800    -1  5 137  50 43904  1 -1 -1 -1
+68411 53688348     14     66    1  33.00    -1    1   4800    -1  1 137  50 43908  1 -1 -1 -1
+68412 53688367     26     57    2  22.00    -1    2   2400    -1  1 137  50 43912  1 -1 -1 -1
+68413 53688386      7     51    4  15.50    -1    4   1200    -1  1 137  50 43916  1 -1 -1 -1
+68414 53688390   2040     -1   -1     -1    -1    8    600    -1  5 137  50 43920  1 -1 -1 -1
+68415 53688393   2038     -1   -1     -1    -1   16    600    -1  5 137  50 43924  2 -1 -1 -1
+68416 53688397   2034     -1   -1     -1    -1   32    600    -1  5 137  50 43928  2 -1 -1 -1
+68417 53688449      7     76    1  42.00    -1    1   4800    -1  1 137  50 43932  1 -1 -1 -1
+68418 53688455      0     59    2  27.00    -1    2   2400    -1  1 137  50 43936  1 -1 -1 -1
+68419 53688458     29     51    4  19.00    -1    4   1200    -1  1 137  50 43940  1 -1 -1 -1
+68420 53688461   1969     -1   -1     -1    -1    8    600    -1  5 137  50 43944  1 -1 -1 -1
+68421 53688464   1967     -1   -1     -1    -1   16    600    -1  5 137  50 43948  2 -1 -1 -1
+68422 53688468   1963     -1   -1     -1    -1   32    600    -1  5 137  50 43952  2 -1 -1 -1
+68423 53689762     30     98    1  12.00    -1    1   4800    -1  1 137  50 43956  1 -1 -1 -1
+68424 53689999     11    118    2  21.00    -1    2   4800    -1  1 137  50 43960  1 -1 -1 -1
+68425 53690002      8     33    4   3.00    -1    4   4800    -1  1 137  50 43964  1 -1 -1 -1
+68426 53690005    426     -1   -1     -1    -1    8   4800    -1  5 137  50 43968  1 -1 -1 -1
+68427 53690016    416     -1   -1     -1    -1   16   4800    -1  5 137  50 43972  2 -1 -1 -1
+68428 53690147     19     52    4  16.50    -1    4   4800    -1  1 137  50 43976  1 -1 -1 -1
+68429 53690265     26    259    4 216.50    -1    4   4800    -1  1 137  50 43980  1 -1 -1 -1
+68430 53690471   9163     76    8  37.62    -1    8    600    -1  1 137  50 43984  1 -1 -1 -1
+68431 53690477   9158     68   16  22.81    -1   16    600    -1  1 137  50 43988  2 -1 -1 -1
+68432 53690570   9065     91    8  55.00    -1    8   4800    -1  1 137  50 43992  1 -1 -1 -1
+68433 53690690   8976     89   16  41.81    -1   16   4800    -1  1 137  50 43996  2 -1 -1 -1
+68434 53690869     18     79    1  41.00    -1    1   4800    -1  1 137  50 44000  1 -1 -1 -1
+68435 53693000      5     58    4  23.25    -1    4   1200    -1  1 137  50 44004  1 -1 -1 -1
+68436 53693210     13     78    1  40.00    -1    1   4800    -1  1 137  50 44008  1 -1 -1 -1
+68437 53693213     10     58    2  27.00    -1    2   2400    -1  1 137  50 44012  1 -1 -1 -1
+68438 53693234     21     51    4  19.00    -1    4   1200    -1  1 137  50 44016  1 -1 -1 -1
+68439 53693271     16     75    1  42.00    -1    1   4800    -1  1 137  50 44020  1 -1 -1 -1
+68440 53693354     26     68    2  28.50    -1    2   2400    -1  1 137  50 44024  1 -1 -1 -1
+68441 53693471      2     81    1  43.00    -1    1   4800    -1  1 137  50 44028  1 -1 -1 -1
+68442 53693475     30     76    2  33.00    -1    2   2400    -1  1 137  50 44032  1 -1 -1 -1
+68443 53693478     27     60    4  22.75    -1    4   1200    -1  1 137  50 44036  1 -1 -1 -1
+68444 53693605     25    194    1 133.00    -1    1   4800    -1  1 137  50 44040  1 -1 -1 -1
+68445 53693608     22    125    2  80.50    -1    2   2400    -1  1 137  50 44044  1 -1 -1 -1
+68446 53693610     19     93    4  54.25    -1    4   1200    -1  1 137  50 44048  1 -1 -1 -1
+68447 53693850     28    132    4  72.75    -1    4   1200    -1  1 137  50 44052  1 -1 -1 -1
+68448 53694238     14    221    4 181.50    -1    4   1200    -1  1 137  50 44056  1 -1 -1 -1
+68449 53695094     28     40    1   9.00    -1    1   4800    -1  1 137  50 44059  1 -1 -1 -1
+68450 53695096     26    346    2 261.00    -1    2   2400    -1  1 137  50 44062  1 -1 -1 -1
+68451 53695099     22    252    4 205.75    -1    4   1200    -1  1 137  50 44065  1 -1 -1 -1
+68452 53695477     17    181    4 142.00    -1    4   1200    -1  1 137  50 44069  1 -1 -1 -1
+68453 53695549      8    373    1 220.00    -1    1   4800    -1  1 137  50 44073  1 -1 -1 -1
+68454 53695917     12    160    2 128.00    -1    2   4800    -1  1 137  50 44077  1 -1 -1 -1
+68455 53696002     21     44    1  10.00    -1    1   4800    -1  1 137  50 44081  1 -1 -1 -1
+68456 53696093     23    176    1 133.00    -1    1   4800    -1  1 137  50 44085  1 -1 -1 -1
+68457 53696117     31    110    4  78.00    -1    4   4800    -1  1 137  50 44089  1 -1 -1 -1
+68458 53696609      3    112    2  74.50    -1    2   2400    -1  1 137  50 44093  1 -1 -1 -1
+68459 53696628   3007     39    8   3.00    -1    8   4800    -1  1 137  50 44097  1 -1 -1 -1
+68460 53699598 118249  32284   64  31883    -1   64  43200    -1  1 128  12 47330  4 -1 -1 -1
+68461 53700732  17036     83   16  41.75    -1   16   4800    -1  1 137  50 44101  2 -1 -1 -1
+68462 53700798     24    421    1 228.00    -1    1   4800    -1  1 137  50 44105  1 -1 -1 -1
+68463 53701367     14    424    1 207.00    -1    1   4800    -1  1 137  50 44108  1 -1 -1 -1
+68464 53702021     15    164    2 128.00    -1    2   4800    -1  1 137  50 44112  1 -1 -1 -1
+68465 53710120     27     31    1     -1    -1    1   7200    -1  1  51  16 3865  2 -1 -1 -1
+68466 53710351     13   2969    1   2919    -1    1   7200    -1  1  51  16 3865  2 -1 -1 -1
+68467 53713989     14   5847    1   5775    -1    1   7200    -1  1  51  16 3865  2 -1 -1 -1
+68468 53715970     25     33    4   1.75    -1    4    300    -1  1  28   7 47343  5 -1 -1 -1
+68469 53717672 114173  17908   64  17681    -1   64  43200    -1  1 128  12 47347  4 -1 -1 -1
+68470 53717940     16     23    1     -1    -1    1    120    -1  1 178  45 44116  2 -1 -1 -1
+68471 53718014      4     24    1     -1    -1    1    300    -1  1 178  45 44120  5 -1 -1 -1
+68472 53718886   7111     84   32  30.75    -1   32    300    -1  1 328   7 44124  2 -1 -1 -1
+68473 53719618  10322    116    8   0.75    -1    8   3600    -1  5 206  53 47351  3 -1 -1 -1
+68474 53719654   6344     66   16  23.69    -1   16    600    -1  1 137  50 44128  2 -1 -1 -1
+68475 53720033     11   1449    2 792.50    -1    2   7200    -1  1  51  16 3865  2 -1 -1 -1
+68476 53720068      7    325    4 101.75    -1    4   7200    -1  1 100  74 47358  3 -1 -1 -1
+68477 53720318    102    320    4 100.75    -1    4   7200    -1  1 100  74 47362  3 -1 -1 -1
+68478 53721387      2     79    1  11.00    -1    1   4800    -1  5 137  50 44131  1 -1 -1 -1
+68479 53721432     19    346    1 197.00    -1    1   4800    -1  1 137  50 44135  1 -1 -1 -1
+68480 53721545     31   3623    2   2946    -1    2   7200    -1  1  51  16 3865  2 -1 -1 -1
+68481 53726270     14   2521    4   1549    -1    4   7200    -1  1  51  16 3865  2 -1 -1 -1
+68482 53726920  77134   8206   64   6702    -1   64  14400    -1  1   5   5 44139  3 -1 -1 -1
+68483 53727962  11360     87   32  29.97    -1   32    300    -1  1 328   7 44143  2 -1 -1 -1
+68484 53728918   1021   1975    8 833.75    -1    8   7200    -1  1  51  16 3865  2 -1 -1 -1
+68485 53732497     22   3825    4   3756    -1    4  30000    -1  1  25  16 44147  2 -1 -1 -1
+68486 53732725     10    147    2 114.50    -1    2   4800    -1  1 137  50 44151  1 -1 -1 -1
+68487 53732920      1    105    4  72.25    -1    4   4800    -1  1 137  50 44155  1 -1 -1 -1
+68488 53733052     26     89    8  51.38    -1    8   4800    -1  1 137  50 44159  1 -1 -1 -1
+68489 53733291      6     80   16  40.25    -1   16   4800    -1  1 137  50 44163  2 -1 -1 -1
+68490 53734012     32     24    1     -1    -1    1    120    -1  1 178  45 44167  2 -1 -1 -1
+68491 53734082     25     23    1     -1    -1    1    300    -1  1 178  45 44171  5 -1 -1 -1
+68492 53734880      7   1780   16 486.56    -1   16   7200    -1  1  51  16 3865  2 -1 -1 -1
+68493 53736719   2726   1593   32 305.28    -1   32   7200    -1  1  51  16 3865  2 -1 -1 -1
+68494 53737697      3    106    2   0.50    -1    2    300    -1  5 178   1 44175  5 -1 -1 -1
+68495 53738623     12     45    4   7.25    -1    4    300    -1  1  28   7 47380  5 -1 -1 -1
+68496 53738900     15     46    4   7.25    -1    4    300    -1  1  28   7 44179  5 -1 -1 -1
+68497 53739882   2697     -1   -1     -1    -1    4    300    -1  5  28   7 44183  5 -1 -1 -1
+68498 53741961    628     -1   -1     -1    -1    4    300    -1  5  28   7 47384  5 -1 -1 -1
+68499 53742309    291     -1   -1     -1    -1    4    300    -1  5  28   7 44187  2 -1 -1 -1
+68500 53742520     89     -1   -1     -1    -1    4    300    -1  5  28   7 44191  3 -1 -1 -1
+68501 53744074 106073  17852   64  17605    -1   64  43200    -1  1 128  12 47388  4 -1 -1 -1
+68502 53748615     38     -1   -1     -1    -1    4    603    -1  5  53   8 47392  5 -1 -1 -1
+68503 53748674  23208     50    4   2.50    -1    4    603    -1  1  53   8 47399  3 -1 -1 -1
+68504 53748711  23171    108    8   0.75    -1    8  39600    -1  5  61  74 47403  4 -1 -1 -1
+68505 53752894 265814  56550   25  55958    -1   25  64800    -1  1 183  80 44195  3 -1 -1 -1
+68506 53762087 114148  17927   64  17690    -1   64  43200    -1  1 128  12 47407  4 -1 -1 -1
+68507 53770103   1778    117    4  76.75    -1    4   4800    -1  1 137  50 44199  1 -1 -1 -1
+68508 53772450   7701    145    8  63.62    -1    8   4800    -1  1 137  50 44203  1 -1 -1 -1
+68509 53780085 112967  32143   64  31751    -1   64  43200    -1  1 128  12 47411  4 -1 -1 -1
+68510 53782693 199768     -1   -1     -1    -1    8  39600    -1  5  61  74 47415  4 -1 -1 -1
+68511 53791441 249562  64611   16  56189    -1   16  64800    -1  1 186  82 3865  3 -1 -1 -1
+68512 53792504  79663     -1   -1     -1    -1   64  43200    -1  5 128  12 47422  4 -1 -1 -1
+68513 53793036      8    214    8 176.12    -1    8   4500    -1  1 206  53 44206  3 -1 -1 -1
+68514 53793287      6    113    8   0.88    -1    8   3600    -1  5 206  53 47426  3 -1 -1 -1
+68515 53793588     16    255    8 220.88    -1    8   3600    -1  1 206  53 47430  3 -1 -1 -1
+68516 53795184     10     98    8  64.38    -1    8   3600    -1  1 206  53 47434  3 -1 -1 -1
+68517 53795694     28     73    8  34.62    -1    8   4500    -1  1 206  53 44209  3 -1 -1 -1
+68518 53798267      7     77    8  42.62    -1    8   4500    -1  1 206  53 44213  3 -1 -1 -1
+68519 53799914      6     90    8  56.75    -1    8   3600    -1  1 206  53 47437  3 -1 -1 -1
+68520 53801788     27     44    4   6.50    -1    4    300    -1  5  28   7 47441  3 -1 -1 -1
+68521 53801871      6     44    4   6.75    -1    4    300    -1  1  28   7 47445  3 -1 -1 -1
+68522 53804529   8991     80   32  29.53    -1   32    300    -1  1 328   7 44217  2 -1 -1 -1
+68523 53806970   5331   1564   64 219.03    -1   64   7200    -1  1  51  16 3865  2 -1 -1 -1
+68524 53809369   4151     92    8  55.25    -1    8   4500    -1  1 206  53 47452  3 -1 -1 -1
+68525 53810145    168     -1   -1     -1    -1    2   7200    -1  5 100  74 47456  3 -1 -1 -1
+68526 53810288   3232   4298    2   4054    -1    2   7200    -1  1 100  74 47460  2 -1 -1 -1
+68527 53811120 229885  57633   16  57097    -1   16  57600    -1  5 109  60 44221  3 -1 -1 -1
+68528 53811136 266169     -1   -1     -1    -1   16  57600    -1  5 109  60 44225  3 -1 -1 -1
+68529 53813470  80734  17914   64  17635    -1   64  43200    -1  1 128  12 44229  4 -1 -1 -1
+68530 53814484     18     79   32  28.56    -1   32    300    -1  1 328   7 44233  2 -1 -1 -1
+68531 53814770     18     84   32  28.53    -1   32    300    -1  1 328   7 44236  2 -1 -1 -1
+68532 53815804     16     24    1     -1    -1    1    120    -1  1 178  45 47464  2 -1 -1 -1
+68533 53815876      6     23    1     -1    -1    1    300    -1  1 178  45 47468  5 -1 -1 -1
+68534 53816299  51736   8185   64   6705    -1   64  14400    -1  1   5   5 44240  3 -1 -1 -1
+68535 53819164 126137     89    8  50.38    -1    8   3600    -1  1 206  53 47472  3 -1 -1 -1
+68536 53831018 332364    180   19   0.89    -1   19  64800    -1  5  24  22 44244  3 -1 -1 -1
+68537 53831779  80381  33132   64  32781    -1   64  43200    -1  1 128  12 44247  4 -1 -1 -1
+68538 53847786   1989  43252   64  42818    -1   64  43200    -1  5 287  81 47476  2 -1 -1 -1
+68539 53849047  18956     26    1     -1    -1    1    120    -1  1 178  45 44250  2 -1 -1 -1
+68540 53849729  83754  32088   64  31736    -1   64  43200    -1  1 128  12 44253  4 -1 -1 -1
+68541 53850107 113426  17904   64  17673    -1   64  43200    -1  1 128  12 44256  4 -1 -1 -1
+68542 53867970  97614  16105   64  15893    -1   64  43200    -1  5 128  12 44259  4 -1 -1 -1
+68543 53868047  26125     23    1     -1    -1    1    300    -1  1 178  45 47480  5 -1 -1 -1
+68544 53872175  47025     -1   -1     -1    -1   64  43200    -1  5 128  12 47484  4 -1 -1 -1
+68545 53884643 278709     69    8  19.12    -1    8  64800    -1  1 292 106 42878  3 -1 -1 -1
+68546 53894137  87591  18108   64  17826    -1   64  43200    -1  1 128  12 44262  4 -1 -1 -1
+68547 53899929  25306   8200   64   6717    -1   64  14400    -1  1   5   5 44265  3 -1 -1 -1
+68548 53900634  11494     24    1     -1    -1    1    120    -1  1 178  45 44268  2 -1 -1 -1
+68549 53912091  77569  33102   64  32689    -1   64  43200    -1  1 128  12 47491  4 -1 -1 -1
+68550 53912165  21286     26    1     -1    -1    1    300    -1  1 178  45 44271  5 -1 -1 -1
+68551 53919219  81461     -1   -1     -1    -1   64  43200    -1  5 128  12 44274  4 -1 -1 -1
+68552 53925168  75521  18010   64  17778    -1   64  43200    -1  1 128  12 44277  4 -1 -1 -1
+68553 53931615   1836     26    1     -1    -1    1   1200    -1  1 204  87 47497  2 -1 -1 -1
+68554 53936463   8837     28    1     -1    -1    1   1200    -1  1 204  87 47501  2 -1 -1 -1
+68555 53940466  41007   8172   64   6703    -1   64  14400    -1  1   5   5 47505  3 -1 -1 -1
+68556 53945264  77526  18201   64  17950    -1   64  43200    -1  1 128  12 47509  4 -1 -1 -1
+68557 53965546  83665  17912   64  17686    -1   64  43200    -1  1 128  12 44281  4 -1 -1 -1
+68558 53969952  11487     25    1     -1    -1    1    300    -1  1 204  87 44285  2 -1 -1 -1
+68559 53977206  41503  10845   32  10213    -1   32  10800    -1  5 129  50 44288  3 -1 -1 -1
+68560 53981411  85729  33215   64  32822    -1   64  43200    -1  1 128  12 44291  4 -1 -1 -1
+68561 53982049 125347  17971   64  17724    -1   64  43200    -1  1 128  12 47513  4 -1 -1 -1
+68562 53982488  74410     -1   -1     -1    -1    8  39600    -1  5  61  74 47517  3 -1 -1 -1
+68563 53982728  17116     25    1     -1    -1    1    120    -1  1 178  45 44294  2 -1 -1 -1
+68564 53990603   9241    830    1 769.00    -1    1   3660    -1  1 204  87 44297  2 -1 -1 -1
+68565 53991304   1289     -1   -1     -1    -1    1   3660    -1  5 204  87 44300  3 -1 -1 -1
+68566 53999811 125587  18007   64  17686    -1   64  43200    -1  1 128  12 47521  4 -1 -1 -1
+68567 53999894     13     24    1     -1    -1    1    300    -1  1 178  45 47525  5 -1 -1 -1
+68568 54000691  48403     -1   -1     -1    -1   64  43200    -1  5 128  12 47528  4 -1 -1 -1
+68569 54001546  17170    883    1 785.00    -1    1   3660    -1  1 204  87 47532  2 -1 -1 -1
+68570 54014120   4587    338    2 145.50    -1    2    300    -1  5 184  53 44303  1 -1 -1 -1
+68571 54015475   3234     26    1     -1    -1    1    600    -1  5 368 135 44306  3 -1 -1 -1
+68572 54015553  25450   8195   64   6706    -1   64  14400    -1  1   5   5 44309  3 -1 -1 -1
+68573 54018672 111510  32796   64  32456    -1   64  43200    -1  1 128  12 44312  4 -1 -1 -1
+68574 54021472      3    817    1 771.00    -1    1   3660    -1  1 204  87 44316  2 -1 -1 -1
+68575 54022727 122864  17754   64  17530    -1   64  43200    -1  1 128  12 47536  4 -1 -1 -1
+68576 54040968 122383  18167   64  17881    -1   64  43200    -1  1 128  12 47540  4 -1 -1 -1
+68577 54048480  26797  18046   32  16833    -1   32  18000    -1  5 129  50 47544  3 -1 -1 -1
+68578 54049107  84287     -1   -1     -1    -1   64  43200    -1  5 128  12 47548  4 -1 -1 -1
+68579 54055320     24    257    4  49.75    -1    4   7200    -1  1 100  74 44320  2 -1 -1 -1
+68580 54055536     26   4073    2   3834    -1    2   7200    -1  1 100  74 44324  2 -1 -1 -1
+68581 54056917  50481  14544    8  14240    -1    8  21600    -1  1  61  74 47552  3 -1 -1 -1
+68582 54061843      6     26    1     -1    -1    1    120    -1  1 178  45 47556  2 -1 -1 -1
+68583 54061915     27     24    1     -1    -1    1    300    -1  1 178  45 47560  5 -1 -1 -1
+68584 54063103     20    243    4  44.75    -1    4   3600    -1  1 100  74 44328  2 -1 -1 -1
+68585 54064212      1    338    2 146.00    -1    2    300    -1  5 184  53 44332  1 -1 -1 -1
+68586 54064850  57121   8197   64   6706    -1   64  14400    -1  1   5   5 47564  3 -1 -1 -1
+68587 54065223     18    339    2 148.00    -1    2    300    -1  5 184  53 44336  1 -1 -1 -1
+68588 54066003     15    337    2 150.50    -1    2    300    -1  5 184  53 44340  1 -1 -1 -1
+68589 54067098 116304  18125   64  17827    -1   64  43200    -1  1 128  12 47568  4 -1 -1 -1
+68590 54068742     14    337    2 147.50    -1    2    300    -1  5 184  53 44343  1 -1 -1 -1
+68592 54069347      2    337    2 147.50    -1    2    300    -1  5 184  53 44347  1 -1 -1 -1
+68593 54075383 778574     -1   -1     -1    -1    3  36000    -1  5  28   7 44351  6 -1 -1 -1
+68594 54075412 134345  58783   25  58122    -1   25  64800    -1  1 183  80 47575  3 -1 -1 -1
+68595 54075946 295535    155   25  21.92    -1   25  64800    -1  1 183  80 47579  3 -1 -1 -1
+68596 54076423 777542     -1   -1     -1    -1    4  36000    -1  5  28   7 47583  6 -1 -1 -1
+68597 54076844  16498   2950   16   2882    -1   16  14400    -1  1 109  60 44355  3 -1 -1 -1
+68598 54077033  16653   2765   16   2707    -1   16  14400    -1  1 109  60 44359  3 -1 -1 -1
+68599 54077162  30234   2577   16   2493    -1   16  14400    -1  1 109  60 44363  3 -1 -1 -1
+68600 54085383    125     -1   -1     -1    -1    8    600    -1  5 385 142 47587  3 -1 -1 -1
+68601 54085530     42     -1   -1     -1    -1    8    300    -1  5 385 142 47591  1 -1 -1 -1
+68602 54085641  77805     46    8   4.25    -1    8  36000    -1  1 385 142 47595  3 -1 -1 -1
+68603 54086936 767037     -1   -1     -1    -1    3  36000    -1  5  28   7 44367  6 -1 -1 -1
+68604 54087788 782191     -1   -1     -1    -1    3  36000    -1  5 178   1 47599  6 -1 -1 -1
+68605 54088003 781976     -1   -1     -1    -1    3  36000    -1  5 178   1 47603  6 -1 -1 -1
+68606 54088339 781639     -1   -1     -1    -1    3  36000    -1  5 178   1 44371  6 -1 -1 -1
+68607 54089697    473     -1   -1     -1    -1    4   3600    -1  5 100  74 44375  2 -1 -1 -1
+68608 54091229  16166   4456    2   3935    -1    2  21600    -1  1 100  74 44379  2 -1 -1 -1
+68609 54093271     70    337    2 143.00    -1    2    300    -1  5 184  53 44383  1 -1 -1 -1
+68610 54094324   1985    337    2 147.00    -1    2    300    -1  5 184  53 44387  1 -1 -1 -1
+68611 54098284     17     36    8   0.88    -1    8    300    -1  1 111  45 44391  5 -1 -1 -1
+68612 54098791      8     30    2   0.50    -1    2    300    -1  1 111  45 44395  5 -1 -1 -1
+68613 54098874     19     41   12   1.00    -1   12    300    -1  1 111  45 44399  5 -1 -1 -1
+68614 54099140      2     54   32   1.03    -1   32    300    -1  1 111  45 47607  3 -1 -1 -1
+68615 54099569      8     29    1     -1    -1    1    300    -1  1 111  45 47611  5 -1 -1 -1
+68616 54099635   7763   8908   16   8787    -1   16  14400    -1  1 109  60 44403  3 -1 -1 -1
+68617 54100328 109429  33145   64  32777    -1   64  43200    -1  1 128  12 44406  4 -1 -1 -1
+68618 54100486     32    337    2 146.00    -1    2    300    -1  5 184  53 47615  1 -1 -1 -1
+68619 54100616     26     31    1     -1    -1    1    300    -1  1 111  45 47619  5 -1 -1 -1
+68620 54101109   6289     39    2   0.50    -1    2   6000    -1  1 111  45 47623  5 -1 -1 -1
+68621 54101224      9    337    2 147.50    -1    2    300    -1  5 184  53 47627  1 -1 -1 -1
+68622 54101718     14    336    2 147.00    -1    2    300    -1  5 184  53 47631  1 -1 -1 -1
+68627 54125339 274956  18117   64  17885    -1   64  43200    -1  1 128  12 44418  4 -1 -1 -1
+68628 54133403  11028     -1   -1     -1    -1   64  43200    -1  5 128  12 47643  4 -1 -1 -1
+68629 54137289  26094    181   32   0.91    -1   32  37800    -1  5 146  12 47647  3 -1 -1 -1
+68630 54140622   2708     -1   -1     -1    -1    8   7200    -1  5 100  74 44422  3 -1 -1 -1
+68631 54142047 309200  27450   32  26839    -1   32  37800    -1  1 146  12 47651  3 -1 -1 -1
+68632 54143301    133   1862    8 146.62    -1    8   7200    -1  1 100  74 44426  2 -1 -1 -1
+68633 54143377 283916  18386   64  18094    -1   64  43200    -1  1 128  12 47655  4 -1 -1 -1
+68634 54144099     21    560   56  80.98    -1   56   6240    -1  1 111  45 47659  3 -1 -1 -1
+68635 54144442 246957     -1   -1     -1    -1   64  43200    -1  5 128  12 44430  4 -1 -1 -1
+68636 54145119      5    442   56  49.57    -1   56   5220    -1  1 111  45 44433  3 -1 -1 -1
+68637 54147890  15619  13798    8  13467    -1    8  21600    -1  1  61  74 47663  3 -1 -1 -1
+68638 54148691  14323     85   32  29.75    -1   32    300    -1  1 328   7 44437  2 -1 -1 -1
+68639 54148843  52693   8207   64   6704    -1   64  14400    -1  1   5   5 47667  3 -1 -1 -1
+68640 54149107  13876    351    2 287.50    -1    2    300    -1  5 184  53 44441  1 -1 -1 -1
+68641 54149346  14227   8976   16   8807    -1   16  14400    -1  1 109  60 44445  3 -1 -1 -1
+68642 54149429  14145   8921   16   8748    -1   16  14400    -1  1 109  60 44449  3 -1 -1 -1
+68643 54152654 417161  25095   32  24550    -1   32  37800    -1  1 146  12 47671  3 -1 -1 -1
+68644 54153686  52207  64571   16  56221    -1   16  64800    -1  1 186  82 3865  3 -1 -1 -1
+68645 54154732   8314     33    2   1.50    -1    2  21600    -1  1 100  74 44453  2 -1 -1 -1
+68646 54155614   7600     84   32  28.91    -1   32    300    -1  1 328   7 44457  2 -1 -1 -1
+68647 54161911   1472    253    4  18.75    -1    4    600    -1  1  61  74 44461  3 -1 -1 -1
+68648 54161990   1124     90   62   3.10    -1   62  43200    -1  1 287  81 44465  2 -1 -1 -1
+68649 54162022    263     -1   -1     -1    -1   16  21000    -1  5 364 132 44469  4 -1 -1 -1
+68650 54162326   1248  19807   16  19438    -1   16  21000    -1  1 364 132 44473  4 -1 -1 -1
+68651 54162737    246     43    2  12.50    -1    2   1800    -1  1  26   7 44477  1 -1 -1 -1
+68652 54162950 323954  17951   64  17715    -1   64  43200    -1  1 128  12 44481  4 -1 -1 -1
+68653 54163321 325818  33445   64  33001    -1   64  43200    -1  1 128  12 44485  4 -1 -1 -1
+68654 54163534  18019    666   64 513.38    -1   64  43200    -1  1 287  81 44489  2 -1 -1 -1
+68655 54163558     14    882    2 841.00    -1    2   1800    -1  1  26   7 44493  1 -1 -1 -1
+68656 54163760     32    454    6 328.50    -1    6  21060    -1  1 111  45 47678  3 -1 -1 -1
+68657 54164914      2     37    4   1.00    -1    4  11520    -1  5 111  45 44497  3 -1 -1 -1
+68658 54164924  24018     30    2   0.50    -1    2  64500    -1  1 111  45 47682  3 -1 -1 -1
+68659 54165054     18     78    8  19.62    -1    8  19740    -1  1 111  45 44501  3 -1 -1 -1
+68660 54165222  44536     82    8  29.62    -1    8  64800    -1  1 292 106 42878  3 -1 -1 -1
+68661 54165253      6    702    8 559.88    -1    8  19560    -1  1 111  45 47689  3 -1 -1 -1
+68662 54166042    140     -1   -1     -1    -1   16  14400    -1  5 109  60 44505  3 -1 -1 -1
+68663 54166223  43536  11929   12  11791    -1   12  14400    -1  1 109  60 44509  3 -1 -1 -1
+68664 54166380      1    338    2 147.00    -1    2    300    -1  5 184  53 44513  1 -1 -1 -1
+68665 54166414     31    472    6 333.67    -1    6  18420    -1  1 111  45 44517  3 -1 -1 -1
+68666 54166555  55161  12742   12  12617    -1   12  14400    -1  1 109  60 44521  3 -1 -1 -1
+68667 54167349      1    337    2 147.50    -1    2    300    -1  5 184  53 44525  1 -1 -1 -1
+68668 54167849     30    338    2 148.00    -1    2    300    -1  5 184  53 44529  1 -1 -1 -1
+68669 54168123      5    974    6 747.67    -1    6  16680    -1  1 111  45 44533  3 -1 -1 -1
+68670 54168918  12666   7349    2   6967    -1    2  21600    -1  1 100  74 44537  2 -1 -1 -1
+68671 54169022     18    338    2 138.00    -1    2    300    -1  5 184  53 44541  1 -1 -1 -1
+68672 54169557     14    437    8 295.38    -1    8  15240    -1  1 111  45 44545  3 -1 -1 -1
+68673 54171189      3    337    2 148.00    -1    2    300    -1  5 184  53 44549  1 -1 -1 -1
+68674 54171778      5    338    2 148.00    -1    2    300    -1  5 184  53 44553  1 -1 -1 -1
+68675 54171907   9677  23663   31  23392    -1   31  64800    -1  1 145  72 47693  2 -1 -1 -1
+68676 54171966  10277  23631   31  23379    -1   31  64800    -1  1 145  72 47697  2 -1 -1 -1
+68677 54175625  58857  14372   12  14240    -1   12  14400    -1  1 109  60 44557  3 -1 -1 -1
+68678 54178392     30    542   48  94.29    -1   48   5880    -1  1 111  45 47701  3 -1 -1 -1
+68679 54179405     18    394   48  59.56    -1   48   4860    -1  1 111  45 44561  3 -1 -1 -1
+68680 54180988     26    555   48  94.31    -1   48   3300    -1  1 111  45 47705  3 -1 -1 -1
+68681 54181490 341147  18221   64  17978    -1   64  43200    -1  1 128  12 47709  4 -1 -1 -1
+68682 54182010     12    436   15 159.07    -1   15   2280    -1  1 111  45 44565  3 -1 -1 -1
+68683 54182466  27385  13705    8  13427    -1    8  21600    -1  1  61  74 44569  3 -1 -1 -1
+68684 54189328     18   2553    2   2234    -1    2  64500    -1  1 111  45 47713  3 -1 -1 -1
+68685 54192338     25    585    2 477.50    -1    2  64500    -1  1 111  45 47717  3 -1 -1 -1
+68686 54194112     21   2575    2   2233    -1    2  64500    -1  1 111  45 47721  3 -1 -1 -1
+68687 54197189     25    590    2 476.00    -1    2  64500    -1  1 111  45 44573  3 -1 -1 -1
+68688 54199145     26   2568    2   2233    -1    2  64500    -1  1 111  45 44577  3 -1 -1 -1
+68689 54201502 339957  18217   64  17972    -1   64  43200    -1  1 128  12 47725  4 -1 -1 -1
+68690 54202265     18    616    2 485.50    -1    2  64500    -1  1 111  45 47729  3 -1 -1 -1
+68691 54204206      8   2688    2   2233    -1    2  64500    -1  1 111  45 47733  3 -1 -1 -1
+68692 54207244 362573  26690   32  26033    -1   32  37800    -1  1 146  12 44581  3 -1 -1 -1
+68693 54207335     21    354   43  56.98    -1   43   8280    -1  1 111  45 44585  3 -1 -1 -1
+68694 54207344     12    339    5  78.60    -1    5  64500    -1  1 111  45 44589  3 -1 -1 -1
+68695 54208852     31    508   43  90.93    -1   43   6780    -1  1 111  45 47737  3 -1 -1 -1
+68696 54208863     20    493    5 123.20    -1    5  64500    -1  1 111  45 44593  3 -1 -1 -1
+68697 54209825     26    523    3 418.00    -1    3  64500    -1  1 111  45 47741  3 -1 -1 -1
+68698 54211521     13   1741    3   1492    -1    3  64500    -1  1 111  45 47745  3 -1 -1 -1
+68699 54213710      3    565    3 448.00    -1    3  64500    -1  1 111  45 47749  3 -1 -1 -1
+68700 54215423      2   1739    3   1492    -1    3  64500    -1  1 111  45 47753  3 -1 -1 -1
+68701 54217601      7    539    3 433.33    -1    3  64500    -1  1 111  45 47757  3 -1 -1 -1
+68702 54219289     30   1765    3   1491    -1    3  64500    -1  1 111  45 47761  3 -1 -1 -1
+68703 54221519     10    557    3 432.67    -1    3  64500    -1  1 111  45 47765  3 -1 -1 -1
+68704 54223226     18   1738    3   1491    -1    3  64500    -1  1 111  45 44597  3 -1 -1 -1
+68705 54225281     18    846    8  27.88    -1    8   7200    -1  1 100  74 47769  3 -1 -1 -1
+68706 54225476      9    544    3 403.00    -1    3  64500    -1  1 111  45 44601  3 -1 -1 -1
+68707 54227167      2    582   11 407.18    -1   11  64500    -1  1 111  45 47773  3 -1 -1 -1
+68708 54227549    111     -1   -1     -1    -1    8   7200    -1  5 100  74 47777  3 -1 -1 -1
+68709 54227644    115    970    8 114.88    -1    8   7200    -1  1 100  74 47781  2 -1 -1 -1
+68710 54228063 394489  54046   32  52049    -1   32  54000    -1  5 129  50 47785  3 -1 -1 -1
+68711 54228244     15    534    3 393.00    -1    3  64500    -1  1 111  45 47789  3 -1 -1 -1
+68712 54229915     22    585   11 407.36    -1   11  64500    -1  1 111  45 44605  3 -1 -1 -1
+68713 54231166     15    107    2   0.50    -1    2   7200    -1  5 100  74 47793  2 -1 -1 -1
+68714 54231515      8    106    2   0.50    -1    2   7200    -1  5 100  74 47797  2 -1 -1 -1
+68715 54231868     29    164    2 120.50    -1    2   7200    -1  5 100  74 47801  2 -1 -1 -1
+68716 54232069     16   2398    2   2212    -1    2   7200    -1  1 100  74 47805  2 -1 -1 -1
+68717 54233025     27  12303    8  12090    -1    8  21600    -1  1  61  74 47809  3 -1 -1 -1
+68718 54233400    103     -1   -1     -1    -1   32    300    -1  5 111  45 47813  3 -1 -1 -1
+68719 54233634     25     -1   -1     -1    -1   32    300    -1  5 111  45 47817  3 -1 -1 -1
+68720 54233881   9056  54429   31  53867    -1   31  64800    -1  1 145  72 47821  2 -1 -1 -1
+68721 54233920    181     -1   -1     -1    -1   32    300    -1  5 111  45 47825  3 -1 -1 -1
+68722 54233929   9008  54695   31  54111    -1   31  64800    -1  1 145  72 47829  2 -1 -1 -1
+68723 54233976    130     -1   -1     -1    -1   32   1080    -1  5 111  45 47833  3 -1 -1 -1
+68724 54234168     51     -1   -1     -1    -1   32   1080    -1  5 111  45 44609  3 -1 -1 -1
+68725 54234356      3   5069    1   4458    -1    1   6900    -1  1 111  45 47837  3 -1 -1 -1
+68726 54234882  33691     81   32  29.41    -1   32    300    -1  1 328   7 44613  3 -1 -1 -1
+68727 54235821      3    338    2 147.00    -1    2    300    -1  5 184  53 44617  1 -1 -1 -1
+68728 54236362 182068   8175   64   6704    -1   64  14400    -1  1   5   5 47841  3 -1 -1 -1
+68729 54236810      9    338    2 148.00    -1    2    300    -1  5 184  53 44620  1 -1 -1 -1
+68730 54238737     16    337    2 148.00    -1    2    300    -1  5 184  53 44624  1 -1 -1 -1
+68731 54239038  10466  19270   16  18985    -1   16  21000    -1  1 364 132 47845  4 -1 -1 -1
+68732 54239441     28    337    2 148.00    -1    2    300    -1  5 184  53 44628  1 -1 -1 -1
+68733 54239890     17    527    3 408.67    -1    3  64500    -1  1 111  45 47849  3 -1 -1 -1
+68734 54240433     32    338    2 148.00    -1    2    300    -1  5 184  53 44632  1 -1 -1 -1
+68735 54241191     23    337    2 148.00    -1    2    300    -1  5 184  53 44636  1 -1 -1 -1
+68736 54241490   3883    744    8 559.12    -1    8   1980    -1  1 111  45 47853  3 -1 -1 -1
+68737 54242877 316912  33626   64  33272    -1   64  43200    -1  1 128  12 44640  4 -1 -1 -1
+68738 54244470  24203    454   32 316.91    -1   32    600    -1  1 290 103 47857  4 -1 -1 -1
+68739 54244773      6    134    5  79.80    -1    5    600    -1  5 290 103 47861  4 -1 -1 -1
+68740 54244815    119     33    2   2.00    -1    2   7200    -1  1 100  74 47865  2 -1 -1 -1
+68741 54246206     12    535   11 343.55    -1   11  28020    -1  1 111  45 44644  3 -1 -1 -1
+68742 54246216      2    535    2 351.00    -1    2  64500    -1  1 111  45 44648  3 -1 -1 -1
+68743 54247199     20    351   11 194.64    -1   11  27060    -1  1 111  45 44652  3 -1 -1 -1
+68744 54247206     13    349    2 202.00    -1    2  64500    -1  1 111  45 44656  3 -1 -1 -1
+68745 54247543     48    338    2 147.50    -1    2    300    -1  5 184  53 47869  1 -1 -1 -1
+68746 54248678    195    610   16 280.12    -1   16   1380    -1  1 111  45 44659  3 -1 -1 -1
+68747 54249177     10     43    2   2.50    -1    2    300    -1  1 184  53 47873  1 -1 -1 -1
+68748 54249574     25    650    9 498.00    -1    9  64500    -1  1 111  45 44662  3 -1 -1 -1
+68749 54250678     12    357    9 236.22    -1    9  64500    -1  1 111  45 47877  3 -1 -1 -1
+68750 54251188  46457  13212   10  13063    -1   10  14400    -1  1 109  60 44665  3 -1 -1 -1
+68751 54251228  46980  11279   10  11152    -1   10  14400    -1  1 109  60 44669  3 -1 -1 -1
+68752 54251234  58758  10371   10  10259    -1   10  14400    -1  1 109  60 44673  3 -1 -1 -1
+68753 54251797  45848  12321   12  12172    -1   12  14400    -1  1 109  60 44677  3 -1 -1 -1
+68754 54251954  17188    566   32 140.66    -1   32   1080    -1  1 111  45 44681  3 -1 -1 -1
+68755 54253391      9     37    4   1.00    -1    4    900    -1  1   3  74 47881  4 -1 -1 -1
+68756 54253486      6     40    4   5.50    -1    4    900    -1  1   3  74 47885  4 -1 -1 -1
+68757 54253732     10    180    4 120.00    -1    4    900    -1  1   3  74 47889  4 -1 -1 -1
+68758 54253980     12    729    4 564.50    -1    4    900    -1  1   3  74 47893  4 -1 -1 -1
+68759 54254580  60390     -1   -1     -1    -1   32   1800    -1  5   3  74 44684  3 -1 -1 -1
+68760 54256780     25   9378    8   8898    -1    8  14400    -1  1  47  74 44687  4 -1 -1 -1
+68761 54258955   7248     41    2   2.50    -1    2    300    -1  1 184  53 44690  1 -1 -1 -1
+68762 54261092   9405  64901   64  64072    -1   64  64800    -1  5 287  81 47897  2 -1 -1 -1
+68763 54263451   2752    409    4 367.75    -1    4    600    -1  1   3  74 44693  2 -1 -1 -1
+68764 54269796     12    521   48  90.00    -1   48    600    -1  1 111  45 47901  3 -1 -1 -1
+68765 54269805      3    500    2 105.50    -1    2  64500    -1  1 111  45 47905  3 -1 -1 -1
+68766 54269957    383     47    2   2.50    -1    2    300    -1  1 184  53 47909  1 -1 -1 -1
+68767 54270753     23    547    2 433.00    -1    2  36720    -1  1 111  45 47913  3 -1 -1 -1
+68768 54271483      6     37    2   2.50    -1    2    300    -1  1 184  53 47917  1 -1 -1 -1
+68769 54271768      1     32    2   1.50    -1    2    300    -1  1 184  53 47921  1 -1 -1 -1
+68770 54272252  25132    801    8 559.25    -1    8   1980    -1  1 111  45 47925  3 -1 -1 -1
+68771 54272437     16     32    2   2.00    -1    2    300    -1  1 184  53 47929  1 -1 -1 -1
+68772 54273349      8     31    2   1.50    -1    2    300    -1  1 184  53 47933  1 -1 -1 -1
+68773 54273894     25     32    2   2.00    -1    2    300    -1  1 184  53 47937  1 -1 -1 -1
+68774 54274364     20     32    2   2.00    -1    2    300    -1  1 184  53 47941  1 -1 -1 -1
+68775 54282992  14392  58777   25  58153    -1   25  64800    -1  1 183  80 44696  2 -1 -1 -1
+68776 54298330      2    839    5 644.00    -1    5  36660    -1  1 111  45 47945  3 -1 -1 -1
+68777 54298352     12    806    2 634.00    -1    2  64500    -1  1 111  45 47949  3 -1 -1 -1
+68778 54299610     10    400    5 287.20    -1    5  35400    -1  1 111  45 47953  3 -1 -1 -1
+68779 54299619     33    367    2 261.00    -1    2  64500    -1  1 111  45 47957  3 -1 -1 -1
+68780 54300910   8603    601   16 279.94    -1   16   1380    -1  1 111  45 44699  3 -1 -1 -1
+68781 54310197     14    542   17 236.06    -1   17  24780    -1  1 111  45 47961  3 -1 -1 -1
+68782 54310211     32    508    2 239.00    -1    2  64500    -1  1 111  45 47965  3 -1 -1 -1
+68783 54311196     15    317   27  87.30    -1   27  23760    -1  1 111  45 44702  3 -1 -1 -1
+68784 54311206      5    308    2 105.00    -1    2  64500    -1  1 111  45 44705  3 -1 -1 -1
+68785 54311872     43     -1   -1     -1    -1   32   4200    -1  5 290 103 47969  4 -1 -1 -1
+68786 54311953      7    115   29  57.10    -1   29   4200    -1  1 290 103 47973  4 -1 -1 -1
+68787 54312466  15425    559   32 140.50    -1   32   1080    -1  1 111  45 44708  3 -1 -1 -1
+68788 54312878     19    152   29  96.31    -1   29   4200    -1  1 290 103 47977  4 -1 -1 -1
+68789 54313651     25   9638   29   9516    -1   29   9600    -1  5 290 103 47981  4 -1 -1 -1
+68790 54314963   8372   1774   32   1545    -1   32   1800    -1  5   3  74 44711  2 -1 -1 -1
+68791 54315771   4604     26    1     -1    -1    1    120    -1  1 178  45 47985  2 -1 -1 -1
+68792 54316626  55019  64697   16  56294    -1   16  64800    -1  1 186  82 3865  3 -1 -1 -1
+68793 54320285  15143  64857   64  64175    -1   64  64800    -1  5 287  81 47991  2 -1 -1 -1
+68794 54320419     18     24    1     -1    -1    1    300    -1  1 178  45 47995  5 -1 -1 -1
+68795 54322087  13344     41   16   0.81    -1   16  20400    -1  5 364 132 44714  4 -1 -1 -1
+68796 54325046     67    215   32 141.72    -1   32   1800    -1  5   3  74 44717  2 -1 -1 -1
+68797 54325261    103    631   32 531.06    -1   32   1800    -1  5   3  74 44720  2 -1 -1 -1
+68798 54325935     81   1859   32   1278    -1   32   1800    -1  5   3  74 44723  2 -1 -1 -1
+68799 54326310     17     75    6  23.67    -1    6    600    -1  1 340 122 44726  3 -1 -1 -1
+68800 54326862     28     48    4   3.00    -1    4    300    -1  1  49   7 44729  1 -1 -1 -1
+68801 54328033    434   2863   32   2577    -1   32   3600    -1  1   3  74 44732  2 -1 -1 -1
+68802 54328593     28    840    5 642.20    -1    5   6420    -1  1 111  45 44735  3 -1 -1 -1
+68803 54328600     22    838    2 634.00    -1    2  64500    -1  1 111  45 44738  3 -1 -1 -1
+68804 54328726    766     34    4   3.00    -1    4    300    -1  1  49   7 44741  1 -1 -1 -1
+68805 54329913     16    879    2 168.00    -1    2   3900    -1  1 100  74 47999  3 -1 -1 -1
+68806 54329919     10    493    5 361.60    -1    5   5040    -1  1 111  45 44744  3 -1 -1 -1
+68807 54329925    909     36    2   0.50    -1    2  64500    -1  1 111  45 44747  3 -1 -1 -1
+68808 54330415    918     38   32   0.84    -1   32    900    -1  5   3  74 44750  2 -1 -1 -1
+68809 54330477    919     66    6  28.00    -1    6    600    -1  1 340 122 44753  3 -1 -1 -1
+68810 54330626     22    907    2 150.50    -1    2   3900    -1  1 100  74 48003  3 -1 -1 -1
+68811 54331480     11    504   32 409.31    -1   32   3600    -1  1   3  74 48007  2 -1 -1 -1
+68812 54331514    505    766    8 558.75    -1    8   1980    -1  1 111  45 48011  3 -1 -1 -1
+68813 54331755  24505  15114   64  12066    -1   64  21600    -1  1  47  74 48015  2 -1 -1 -1
+68814 54331947 261507  27857   64  27344    -1   64  43200    -1  1 340 122 44756  3 -1 -1 -1
+68815 54332875     21    506   37 113.97    -1   37   2100    -1  1 111  45 44759  3 -1 -1 -1
+68816 54332884     12    493    2 149.50    -1    2  64500    -1  1 111  45 44762  3 -1 -1 -1
+68817 54333359     35   4082    2   3824    -1    2   7200    -1  1 100  74 44765  2 -1 -1 -1
+68818 54333391     33     34    4   3.00    -1    4    300    -1  1  49   7 44769  1 -1 -1 -1
+68819 54333625     18     34    4   3.00    -1    4    300    -1  1  49   7 44772  1 -1 -1 -1
+68820 54333716   1714   2469    2   2237    -1    2   7200    -1  1 100  74 44775  2 -1 -1 -1
+68821 54333829      2    363   37  80.14    -1   37   1140    -1  1 111  45 48019  3 -1 -1 -1
+68822 54333925    285     34    4   3.00    -1    4    300    -1  1  49   7 44778  1 -1 -1 -1
+68823 54334331      3     34    4   3.00    -1    4    300    -1  1  49   7 44781  1 -1 -1 -1
+68824 54335289    141    610   16 280.00    -1   16   1380    -1  1 111  45 48023  3 -1 -1 -1
+68825 54335698     19    882    2 161.00    -1    2   3900    -1  1 100  74 48026  3 -1 -1 -1
+68826 54335708      8     37    2   1.50    -1    2    300    -1  1 184  53 48030  1 -1 -1 -1
+68827 54335769     10  19145   16  18860    -1   16  20400    -1  1 364 132 44784  4 -1 -1 -1
+68828 54335784    258    768    2 151.50    -1    2   3900    -1  1 100  74 48034  3 -1 -1 -1
+68829 54336148     20    558   15 299.20    -1   15  25740    -1  1 111  45 48038  3 -1 -1 -1
+68830 54336582     25     42    2   1.50    -1    2    300    -1  1 184  53 48042  1 -1 -1 -1
+68831 54337164      7    359   19 139.16    -1   19  24720    -1  1 111  45 48046  3 -1 -1 -1
+68832 54338639  16390    569   32 140.53    -1   32   1080    -1  1 111  45 48050  3 -1 -1 -1
+68833 54339129      8     33    2   1.50    -1    2    300    -1  1 184  53 48054  1 -1 -1 -1
+68834 54339779     14     32    2   2.00    -1    2    300    -1  1 184  53 48058  1 -1 -1 -1
+68835 54343171  11761     84   32  30.03    -1   32    300    -1  1 328   7 44787  2 -1 -1 -1
+68836 54349754      9     33    4   2.00    -1    4    300    -1  5  49   7 44790  1 -1 -1 -1
+68837 54349827     28     40    4   8.50    -1    4    300    -1  1  49   7 44793  1 -1 -1 -1
+68838 54355687      6    551   39 115.79    -1   39   6180    -1  1 111  45 48062  3 -1 -1 -1
+68839 54356871  14514    967    2 156.00    -1    2   3900    -1  1 100  74 48066  2 -1 -1 -1
+68840 54356944  14441    978    2 156.00    -1    2   3900    -1  1 100  74 48070  2 -1 -1 -1
+68841 54357054  14331  58041   25  57394    -1   25  64800    -1  1 183  80 48074  2 -1 -1 -1
+68842 54359021  12364    810    8 559.25    -1    8   1980    -1  1 111  45 48078  3 -1 -1 -1
+68843 54367782     36     -1   -1     -1    -1   10   3600    -1  5 185  81 44796  3 -1 -1 -1
+68844 54367836   3549     70   10   2.90    -1   10   3600    -1  1 185  81 44799  2 -1 -1 -1
+68845 54368388   2997     68   10   2.80    -1   10   7200    -1  1 185  81 44802  2 -1 -1 -1
+68846 54371867     31   7068   10   6965    -1   10   7200    -1  1 185  81 44805  2 -1 -1 -1
+68847 54372151    809   3387   10   3316    -1   10   3600    -1  1 185  81 44808  2 -1 -1 -1
+68848 54372290     17    646    8 496.62    -1    8   2700    -1  1 111  45 48082  3 -1 -1 -1
+68849 54372297     10    644    1 507.00    -1    1   6900    -1  1 111  45 48086  3 -1 -1 -1
+68850 54372600   1076     -1   -1     -1    -1    7  21600    -1  5 185  81 44811  3 -1 -1 -1
+68851 54373609      6    597    3 453.00    -1    3  64500    -1  1 111  45 48090  3 -1 -1 -1
+68852 54373611     65     -1   -1     -1    -1    7  21600    -1  5 185  81 44814  3 -1 -1 -1
+68853 54373650     26     -1   -1     -1    -1    7  21600    -1  5 185  81 44817  3 -1 -1 -1
+68854 54375340   9456    634   16 280.44    -1   16   1380    -1  1 111  45 48094  3 -1 -1 -1
+68855 54377735     28   7027   10   6925    -1   10   7200    -1  1 185  81 48098  2 -1 -1 -1
+68856 54385516      3    528   23 195.61    -1   23  64500    -1  1 111  45 44820  3 -1 -1 -1
+68857 54386485     28    351   23 117.70    -1   23  64500    -1  1 111  45 44823  3 -1 -1 -1
+68858 54387957  38664    641   32 140.59    -1   32   1080    -1  1 111  45 48102  3 -1 -1 -1
+68859 54391410 142388     -1   -1     -1    -1   64  43200    -1  5 128  12 44826  4 -1 -1 -1
+68860 54401528     13   1761    8   1711    -1    8   3600    -1  1  25  16 44829  1 -1 -1 -1
+68861 54402676     21   3372   15   3300    -1   15   7200    -1  1 290 103 48106  4 -1 -1 -1
+68862 54403795     24   2204    8   2158    -1    8   7200    -1  1 109  60 44832  3 -1 -1 -1
+68863 54403821   2272   1052    2 261.50    -1    2   3900    -1  1 100  74 48110  3 -1 -1 -1
+68864 54403825   2205   1859    8   1808    -1    8   3600    -1  1  25  16 44835  1 -1 -1 -1
+68865 54408752     20     33    2   2.00    -1    2    300    -1  1 184  53 44838  1 -1 -1 -1
+68866 54409705     29     32    2   1.50    -1    2    300    -1  1 184  53 44841  1 -1 -1 -1
+68867 54409982      0     32    2   2.00    -1    2    300    -1  1 184  53 44844  1 -1 -1 -1
+68868 54410804     16     34    2   2.50    -1    2    300    -1  1 184  53 44847  1 -1 -1 -1
+68869 54411461     11     36    4   3.50    -1    4    300    -1  1   3  74 48114  4 -1 -1 -1
+68870 54411753     29     35    4   3.50    -1    4    300    -1  1   3  74 48118  4 -1 -1 -1
+68871 54412202     16     35    2   2.50    -1    2    300    -1  1 184  53 44850  1 -1 -1 -1
+68872 54412520      9     35    2   2.50    -1    2    300    -1  1 184  53 44853  1 -1 -1 -1
+68873 54412721     27     31    4   0.75    -1    4   7200    -1  1  25  16 44856  1 -1 -1 -1
+68874 54414180      7     35    2   2.50    -1    2    300    -1  1 184  53 44859  1 -1 -1 -1
+68875 54414697     21     35    2   2.50    -1    2    300    -1  1 184  53 44862  1 -1 -1 -1
+68876 54415331     12     36    2   2.50    -1    2    300    -1  1 184  53 44865  1 -1 -1 -1
+68877 54415910     27     35    2   2.50    -1    2    300    -1  1 184  53 44868  1 -1 -1 -1
+68878 54416729 205792  15267   64  12197    -1   64  21600    -1  1  47  74 48122  3 -1 -1 -1
+68879 54417010     17     34    4   0.75    -1    4   7200    -1  1  25  16 44871  1 -1 -1 -1
+68880 54417310     30    787    8 746.38    -1    8   7200    -1  5  25  16 44874  1 -1 -1 -1
+68881 54418107     11    315    4 277.00    -1    4   3000    -1  1  25  16 44877  1 -1 -1 -1
+68882 54418111      7    338    2 146.50    -1    2    300    -1  5 184  53 44880  1 -1 -1 -1
+68883 54418387 219412  18159   64  17899    -1   64  43200    -1  1 128  12 44883  4 -1 -1 -1
+68884 54419012      9    337    2 147.50    -1    2    300    -1  5 184  53 44886  1 -1 -1 -1
+68885 54419186     23   1970    8   1922    -1    8   7200    -1  1 109  60 44889  3 -1 -1 -1
+68886 54419368     27     26    1     -1    -1    1    120    -1  1 178  45 44892  2 -1 -1 -1
+68887 54419444     13     24    1     -1    -1    1    300    -1  1 178  45 44895  5 -1 -1 -1
+68888 54420690     13     35    2   2.50    -1    2    300    -1  1 184  53 44898  1 -1 -1 -1
+68889 54421019     22     -1   -1     -1    -1   25  64800    -1  5 183  80 48126  3 -1 -1 -1
+68890 54421062   5558    123   25  13.56    -1   25  64800    -1  1 183  80 48130  2 -1 -1 -1
+68891 54421762     30     26    1     -1    -1    1   7200    -1  1  60  20 44901  4 -1 -1 -1
+68892 54422015     26  19101   16  18826    -1   16  20400    -1  1 364 132 48134  4 -1 -1 -1
+68893 54426395      8     44    4   4.00    -1    4    300    -1  1   3  74 48138  4 -1 -1 -1
+68894 54426810     10     43    4   4.25    -1    4    300    -1  1   3  74 48142  4 -1 -1 -1
+68895 54427344     12    873    7 642.14    -1    7  14760    -1  1 111  45 48146  3 -1 -1 -1
+68896 54427532 182108   8241   64   6703    -1   64  14400    -1  1   5   5 48150  3 -1 -1 -1
+68897 54427682    549    630    4 588.50    -1    4    600    -1  5  26   7 44904  1 -1 -1 -1
+68898 54428199   1248     67   25  18.52    -1   25  64800    -1  1 183  80 44907  2 -1 -1 -1
+68899 54428694      4    597    3 452.67    -1    3  64500    -1  1 111  45 48154  3 -1 -1 -1
+68900 54430163     34  56691   25  56162    -1   25  64800    -1  1 183  80 44910  2 -1 -1 -1
+68901 54430252  20901     74   25  10.84    -1   25  64800    -1  1 183  80 44913  2 -1 -1 -1
+68902 54430409   5951    755    8 558.50    -1    8   1980    -1  1 111  45 44916  3 -1 -1 -1
+68903 54430691     35     26    1     -1    -1    1   7200    -1  1  60  20 44919  4 -1 -1 -1
+68904 54436457   9254  43392   64  42930    -1   64  64800    -1  5 287  81 48158  2 -1 -1 -1
+68905 54437200      3    531   23 195.39    -1   23  64500    -1  1 111  45 48162  3 -1 -1 -1
+68906 54438174     27    346   23 117.09    -1   23  64500    -1  1 111  45 44922  3 -1 -1 -1
+68907 54438686     12  11090   16  10957    -1   16  21600    -1  1 109  60 44925  3 -1 -1 -1
+68908 54438744   3054   9339   16   9226    -1   16  21600    -1  1 109  60 44928  3 -1 -1 -1
+68909 54438795 159275   8439   16   8229    -1   16  21600    -1  1 109  60 44931  3 -1 -1 -1
+68910 54439605   1557    615   16 280.06    -1   16   1380    -1  1 111  45 48166  3 -1 -1 -1
+68911 54441861     31    806    7 639.43    -1    7  64500    -1  1 111  45 44934  3 -1 -1 -1
+68912 54443139     32    413    7 303.29    -1    7  64500    -1  1 111  45 48170  3 -1 -1 -1
+68913 54444631  34088    571   32 140.62    -1   32   1080    -1  1 111  45 48174  3 -1 -1 -1
+68914 54445653 210319  18054   64  17813    -1   64  43200    -1  1 128  12 44937  4 -1 -1 -1
+68915 54464771     21     23    1     -1    -1    1    120    -1  1 178  45 44940  2 -1 -1 -1
+68916 54464846      8     24    1     -1    -1    1    300    -1  1 178  45 44943  5 -1 -1 -1
+68917 54479371      6    515   39 115.74    -1   39  15300    -1  1 111  45 48178  3 -1 -1 -1
+68918 54480345     33     39   39   0.85    -1   39  14340    -1  5 111  45 44946  3 -1 -1 -1
+68919 54482206      6    747    8 558.62    -1    8   1980    -1  1 111  45 48182  3 -1 -1 -1
+68920 54483039     17    508   39 115.74    -1   39  11640    -1  1 111  45 48186  3 -1 -1 -1
+68921 54483992     28    363   39  67.18    -1   39  10680    -1  1 111  45 44949  3 -1 -1 -1
+68922 54485419     10    621   16 279.69    -1   16   1380    -1  1 111  45 44953  3 -1 -1 -1
+68923 54486147      1    518   39 115.74    -1   39   8520    -1  1 111  45 48190  3 -1 -1 -1
+68924 54488933  51954    566   32 140.53    -1   32   1080    -1  1 111  45 48194  3 -1 -1 -1
+68925 54492752  12172  64878   64  64167    -1   64  64800    -1  5 287  81 48198  2 -1 -1 -1
+68926 54497908   6953     37    2   2.50    -1    2    300    -1  1 184  53 44957  1 -1 -1 -1
+68927 54503856   1005     38    4   3.00    -1    4    300    -1  1   3  74 48202  4 -1 -1 -1
+68928 54504829 170833  18101   64  17802    -1   64  43200    -1  1 128  12 44961  4 -1 -1 -1
+68929 54510869  30017     27    1     -1    -1    1    120    -1  1 178  45 44965  2 -1 -1 -1
+68930 54514377  26509     28    1     -1    -1    1   7200    -1  1  60  20 44969  4 -1 -1 -1
+68931 54522526 192818  18115   64  17851    -1   64  43200    -1  1 128  12 48206  4 -1 -1 -1
+68932 54525440  15446     89   25  11.40    -1   25  64800    -1  1 183  80 48209  2 -1 -1 -1
+68933 54529619    312     -1   -1     -1    -1    1   3600    -1  5 204  87 48213  3 -1 -1 -1
+68934 54533807 199668  33142   64  32687    -1   64  43200    -1  1 128  12 48217  4 -1 -1 -1
+68935 54540833 226623  18169   64  17847    -1   64  43200    -1  1 128  12 44972  4 -1 -1 -1
+68936 54541001     22     26    1     -1    -1    1    300    -1  1 178  45 48221  5 -1 -1 -1
+68937 54542069  17625     59   25  12.08    -1   25  64800    -1  1 183  80 44976  2 -1 -1 -1
+68938 54559651 268583  33215   64  32817    -1   64  43200    -1  1 128  12 44980  4 -1 -1 -1
+68939 54586680   8266  10838   32  10643    -1   32  10800    -1  5 290 103 48225  4 -1 -1 -1
+68940 54593390 341145  18132   64  17846    -1   64  43200    -1  1 128  12 48229  4 -1 -1 -1
+68941 54596618      6    578   32 141.00    -1   32   8820    -1  1 111  45 48233  3 -1 -1 -1
+68942 54597644     12    371   32  84.50    -1   32   7800    -1  1 111  45 48237  3 -1 -1 -1
+68943 54597890    180   3637   16   3166    -1   16   3600    -1  5 140  69 44984  3 -1 -1 -1
+68944 54597900   7890   3639   32   3161    -1   32   3600    -1  5 140  69 44988  3 -1 -1 -1
+68945 54597908  19985   3713   64   3139    -1   64   3600    -1  5 140  69 44992  3 -1 -1 -1
+68947 54598129   3607   2623    1   2006    -1    1   7200    -1  1  60  20 45000  4 -1 -1 -1
+68948 54598809   2927   3270    1   2163    -1    1   7200    -1  1  60  20 45004  4 -1 -1 -1
+68949 54599223   2512    743    8 559.25    -1    8   1980    -1  1 111  45 45008  3 -1 -1 -1
+68950 54599250  23270  59922   25  59319    -1   25  64800    -1  1 183  80 45012  2 -1 -1 -1
+68951 54602578     15    527   14 320.29    -1   14  33780    -1  1 111  45 45015  3 -1 -1 -1
+68952 54603554      9    362   14 192.64    -1   14  32820    -1  1 111  45 45019  3 -1 -1 -1
+68953 54605018     17    576   16 279.81    -1   16   1380    -1  1 111  45 45023  3 -1 -1 -1
+68954 54605694      1    529   16 280.38    -1   16  30660    -1  1 111  45 45027  3 -1 -1 -1
+68955 54606647     15    365   32  87.81    -1   32  29700    -1  1 111  45 45030  3 -1 -1 -1
+68956 54608169     20    730   32 140.59    -1   32   1080    -1  1 111  45 45033  3 -1 -1 -1
+68957 54608991     16    589   32 140.81    -1   32  27360    -1  1 111  45 45036  3 -1 -1 -1
+68958 54611976  62073    847    8 559.25    -1    8   1980    -1  1 111  45 48241  3 -1 -1 -1
+68959 54651977   6264     -1   -1     -1    -1   32  10800    -1  5 290 103 48245  4 -1 -1 -1
+68960 54655933 453187  18062   64  17754    -1   64  43200    -1  1 128  12 45040  4 -1 -1 -1
+68961 54660408     15    332    7 293.71    -1    7   1800    -1  5 290 103 48249  4 -1 -1 -1
+68962 54660836  13213    209   32  90.16    -1   32   1800    -1  1 290 103 48253  4 -1 -1 -1
+68963 54669276  46069  64833   16  53463    -1   16  64800    -1  5 186  82 3865  3 -1 -1 -1
+68964 54672367     24    278    4 241.00    -1    4   1800    -1  1 340 122 48260  3 -1 -1 -1
+68965 54672564   1485   1586   16 482.31    -1   16   7200    -1  1  51  16 3865  2 -1 -1 -1
+68966 54673222 408580  27295   64  26811    -1   64  36000    -1  1 340 122 48266  3 -1 -1 -1
+68967 54673987 453232  18177   64  17939    -1   64  43200    -1  1 128  12 45044  4 -1 -1 -1
+68968 54674626  28056  12639   32  12480    -1   32  12600    -1  5 290 103 48269  4 -1 -1 -1
+68969 54674765     21   3683    1   2201    -1    1   7200    -1  1  60  20 45047  4 -1 -1 -1
+68970 54674986     19    515   47  80.15    -1   47   1260    -1  1 111  45 48273  3 -1 -1 -1
+68971 54674997      7    503    7 109.57    -1    7  64500    -1  1 111  45 45051  3 -1 -1 -1
+68972 54675581     18   3362    1   2216    -1    1   7200    -1  1  60  20 45055  4 -1 -1 -1
+68973 54675729     27   3210    1   2194    -1    1   7200    -1  1  60  20 45059  4 -1 -1 -1
+68974 54675955     20    604    4 481.50    -1    4  11100    -1  1 111  45 48277  3 -1 -1 -1
+68975 54677594 183877   8183   64   6702    -1   64  14400    -1  1   5   5 48281  3 -1 -1 -1
+68976 54677937      7    625   16 279.75    -1   16   1380    -1  1 111  45 45062  3 -1 -1 -1
+68977 54678651     33    512   37 121.97    -1   37   8340    -1  1 111  45 45066  3 -1 -1 -1
+68978 54679074  33366  24179    8  23914    -1    8  64800    -1  1 329 117 48285  3 -1 -1 -1
+68979 54679628     21    396   39  78.28    -1   39   7380    -1  1 111  45 45070  3 -1 -1 -1
+68980 54679839 171953     -1   -1     -1    -1   32  64800    -1  5 273  61 48289  4 -1 -1 -1
+68981 54680276      2   1507   32 310.97    -1   32   7200    -1  1  51  16 3865  2 -1 -1 -1
+68982 54680484   1983  19810   64  19499    -1   64  64800    -1  5 287  81 48296  2 -1 -1 -1
+68983 54680606  14660  17167   64  16942    -1   64  64800    -1  1 287  81 48300  2 -1 -1 -1
+68984 54681280    525    609   32 140.59    -1   32   1080    -1  1 111  45 48304  3 -1 -1 -1
+68985 54682146  11656   1444   64 222.94    -1   64   7200    -1  1  51  16 3865  2 -1 -1 -1
+68986 54682440  19865  58735   25  58114    -1   25  64800    -1  1 183  80 45074  2 -1 -1 -1
+68987 54682461  72886     -1   -1     -1    -1   32  64800    -1  5 388  61 45078  3 -1 -1 -1
+68988 54683097  19210    345   32 279.09    -1   32  54000    -1  1 129  50 45082  3 -1 -1 -1
+68989 54684940  27500    780    8 558.50    -1    8   1980    -1  1 111  45 45086  3 -1 -1 -1
+68990 54685406  16901   3584    1   2218    -1    1   7200    -1  1  60  20 45090  4 -1 -1 -1
+68991 54685510  16797   3529    1   2213    -1    1   7200    -1  1  60  20 45094  4 -1 -1 -1
+68992 54685531  16776   3520    1   2207    -1    1   7200    -1  1  60  20 45098  4 -1 -1 -1
+68993 54693736 451673  18044   64  17811    -1   64  43200    -1  1 128  12 45102  4 -1 -1 -1
+68994 54696851  40397  11222   16  11105    -1   16  21600    -1  1 109  60 45106  3 -1 -1 -1
+68995 54696863  54281   9501   16   9316    -1   16  21600    -1  1 109  60 45110  3 -1 -1 -1
+68996 54696872  59857     -1   -1     -1    -1   16  21600    -1  5 109  60 45114  3 -1 -1 -1
+68997 54704537   7902    112   25  11.44    -1   25  64800    -1  1 183  80 48311  2 -1 -1 -1
+68998 54713318     32    523   54  69.87    -1   54   1680    -1  1 111  45 48315  3 -1 -1 -1
+68999 54713326     24    507    9  85.56    -1    9  64500    -1  1 111  45 45118  3 -1 -1 -1
+69000 54714295     21    381   54  44.48    -1   54    660    -1  1 111  45 48319  3 -1 -1 -1
Index: DCWoRMS/trunk/example/workloads/SDSC-SP2-0-1000.swf
===================================================================
--- DCWoRMS/trunk/example/workloads/SDSC-SP2-0-1000.swf	(revision 477)
+++ DCWoRMS/trunk/example/workloads/SDSC-SP2-0-1000.swf	(revision 477)
@@ -0,0 +1,988 @@
+       1        0 864895     -1   -1     -1    -1   64  43200    -1  5   3  74 12894  4 -1 -1 -1
+    2   316932 377351     -1   -1     -1    -1   32  64800    -1  5 119  76 17838  4 -1 -1 -1
+    3   318935 375363     -1   -1     -1    -1   32  64800    -1  5 119  76 17841  4 -1 -1 -1
+    4   399264  22885 172830    5 171477    -1    5 172800    -1  5 199  86 17974  3 -1 -1 -1
+    5   427130    794 172829    5 171417    -1    5 172800    -1  5 199  86 18008  3 -1 -1 -1
+    6   494829   1003 172832    5 171439    -1    5 172800    -1  5 199  86 18084  3 -1 -1 -1
+    7   495154  15075 172831    5 170993    -1    5 172800    -1  5 199  86 18087  3 -1 -1 -1
+    8   506793  63437  35968   11   3240    -1   11  36000    -1  5 160  75 18107  3 -1 -1 -1
+    9   522378 252236  11872   63   2352    -1   63  43200    -1  1 131  20 18123  4 -1 -1 -1
+   10   559483      2  59965    4  57145    -1    4  64500    -1  1 162  75 18135  4 -1 -1 -1
+   11   566129      5  28826    1  27758    -1    1  28800    -1  5 153  75 18180  3 -1 -1 -1
+   12   566290    532  26171    1  24666    -1    1  28800    -1  1 153  75 18184  3 -1 -1 -1
+   13   567314  15757   8071    8   7334    -1    8  64800    -1  1 150   6 13592  4 -1 -1 -1
+   14   571164  21568  64832   32  44134    -1   32  64800    -1  5   6   6 13602  3 -1 -1 -1
+   15   574294   4647  64384    7  58033    -1    7  64800    -1  1 151  75 13607  3 -1 -1 -1
+   16   576100      6  19000    1  18830    -1    1  43200    -1  1 152  75 13610  3 -1 -1 -1
+   17   577685   3793 118561    5 117278    -1    5 172800    -1  1 199  86 18261  3 -1 -1 -1
+   18   578846      8  24861    1  23875    -1    1  28800    -1  1 153  75 13613  3 -1 -1 -1
+   19   580157  20861     -1   -1     -1    -1   38   6900    -1  5 189  75 18288  5 -1 -1 -1
+   20   581034   2038  10979    1  10894    -1    1  18000    -1  1 154  75 13634  4 -1 -1 -1
+   21   581434   2139  16674   11  16258    -1   11  36000    -1  1 160  75 18301  3 -1 -1 -1
+   22   582841   1199   8385   32   1536    -1   32  14400    -1  1 150   6 13641  2 -1 -1 -1
+   23   583532  21288  16793   11  16264    -1   11  36000    -1  1 160  75 18305  3 -1 -1 -1
+   24   584165  16591   3634   24   3504    -1   24   3600    -1  5 133  50 13646  3 -1 -1 -1
+   25   584785   4129   1229    2   1089    -1    2   1200    -1  5  34   7 13651  3 -1 -1 -1
+   26   584801  10510   2207   16   1195    -1   16   3600    -1  1   7   7 234  3 -1 -1 -1
+   27   584826   6324     40    8   7.38    -1    8   1200    -1  1  34   7 13662  3 -1 -1 -1
+   28   584832   6361    311    8 259.00    -1    8   2400    -1  1  34   7 13665  3 -1 -1 -1
+   29   584838   6677   1228    8   1157    -1    8   1200    -1  5  34   7 13668  3 -1 -1 -1
+   30   584875  10119     47   16   6.00    -1   16   1200    -1  1  34   7 13671  3 -1 -1 -1
+   31   584919  10126    213   16 156.94    -1   16   1200    -1  1  34   7 13674  3 -1 -1 -1
+   32   584928  10338     40   16   1.25    -1   16   1200    -1  1  34   7 13677  3 -1 -1 -1
+   33   585786   3129  51164    1  50753    -1    1  64800    -1  1 155  75 13680  3 -1 -1 -1
+   34   586496   2458   1970    2   1902    -1    2   7200    -1  1 161  75 18312  3 -1 -1 -1
+   35   588559    686  58046    4  57552    -1    4  64800    -1  1 156  75 13688  3 -1 -1 -1
+   36   588873  16880  14805   11  14385    -1   11  36000    -1  1 160  75 18316  3 -1 -1 -1
+   37   589428     10     28    2     -1    -1    2  36000    -1  5 157   1 13691  2 -1 -1 -1
+   38   589449     22    275    1  15.00    -1    1   2400    -1  1 158  73 13694  3 -1 -1 -1
+   39   589503    396   3708    2     -1    -1    2  36000    -1  5 157   1 13697  2 -1 -1 -1
+   40   589535     11   3625    1     -1    -1    1  36000    -1  1 157   1 13700  2 -1 -1 -1
+   41   590405  13993     54   32   4.84    -1   32   1200    -1  1  34   7 13703  3 -1 -1 -1
+   42   590414  14049     45   32   1.38    -1   32   1200    -1  1  34   7 13706  3 -1 -1 -1
+   43   590419  14099    292   32 215.47    -1   32   1200    -1  1  34   7 13709  3 -1 -1 -1
+   44   590427  85075     42   64   0.25    -1   64   1200    -1  5  34   7 13712  3 -1 -1 -1
+   45   590434  85120    155   64  57.12    -1   64   1200    -1  1  34   7 13715  3 -1 -1 -1
+   46   590439  85278     66   64   1.42    -1   64   1200    -1  1  34   7 13718  3 -1 -1 -1
+   47   590470      5     64    1     -1    -1    1  36000    -1  5 157   1 18320  2 -1 -1 -1
+   48   590531      9     34    1     -1    -1    1  36000    -1  1 157   1 18324  2 -1 -1 -1
+   49   590978     10    252    2 214.00    -1    2    900    -1  1 159  75 13721  1 -1 -1 -1
+   50   591090     87     -1   -1     -1    -1    8  36000    -1  5 173  75 14298  4 -1 -1 -1
+   51   591120      7  11298    2 686.00    -1    2  50400    -1  1 173  75 14298  4 -1 -1 -1
+   52   591442      8  16440    1  15992    -1    1  28800    -1  1 153  75 18333  3 -1 -1 -1
+   53   591612    820    293    2 257.50    -1    2    900    -1  1 159  75 13724  1 -1 -1 -1
+   54   593508      3    257    2 217.50    -1    2    900    -1  1 159  75 13727  1 -1 -1 -1
+   55   595008      4    216    2 177.00    -1    2    900    -1  1 159  75 13730  1 -1 -1 -1
+   56   595228      9     32    2   2.50    -1    2    300    -1  1 159  75 13733  1 -1 -1 -1
+   57   595239     10  24866    1  23861    -1    1  28800    -1  1 153  75 13736  4 -1 -1 -1
+   58   595276      2     34    4   3.25    -1    4    300    -1  1 159  75 13739  1 -1 -1 -1
+   59   595584      5  26228    1  24818    -1    1  28800    -1  1 153  75 13742  3 -1 -1 -1
+   60   595641      1    213    2 178.50    -1    2    900    -1  1 159  75 13745  1 -1 -1 -1
+   61   596042      5    214    2 179.50    -1    2    900    -1  1 159  75 13748  1 -1 -1 -1
+   62   596561      8    212    2 179.00    -1    2    900    -1  1 159  75 13751  1 -1 -1 -1
+   63   597048     11    276    1  14.00    -1    1   2400    -1  1 158  73 13754  3 -1 -1 -1
+   64   597139    389    144    4 109.75    -1    4    900    -1  1 159  75 13757  1 -1 -1 -1
+   65   597147    382    106    8  71.50    -1    8   7200    -1  1 159  75 13760  1 -1 -1 -1
+   66   597497      9    314    1 274.00    -1    1    900    -1  1 159  75 13763  1 -1 -1 -1
+   67   597928   6889    925   16 876.81    -1   16   3600    -1  1 159  75 13766  3 -1 -1 -1
+   68   597955  23662    689   32 631.00    -1   32   1800    -1  1 159  75 13769  3 -1 -1 -1
+   69   598080      3    203    8 167.25    -1    8   3600    -1  1 159  75 13772  1 -1 -1 -1
+   70   598354      6    274    4 235.50    -1    4    900    -1  1 159  75 13775  1 -1 -1 -1
+   71   598608      8    412    2 366.50    -1    2    900    -1  1 159  75 13778  1 -1 -1 -1
+   72   598823      7    691    1 600.00    -1    1    900    -1  1 159  75 13781  1 -1 -1 -1
+   73   599263      4   1716    8   1545    -1    8   6000    -1  1 159  75 13784  1 -1 -1 -1
+   74   600209   4609  16792   11  16215    -1   11  36000    -1  1 160  75 13787  3 -1 -1 -1
+   75   601024     93     -1   -1     -1    -1   38   6900    -1  5 189  75 18336  5 -1 -1 -1
+   76   601123  57528     -1   -1     -1    -1   38  64500    -1  5 189  75 18340  5 -1 -1 -1
+   77   606843  68951  24257   63  23997    -1   63  43200    -1  1  24  22 13790  3 -1 -1 -1
+   78   608347 107242  57648   63   2930    -1   63  57600    -1  5  24  22 13793  3 -1 -1 -1
+   79   613890     12     -1   -1     -1    -1   64  54000    -1  5   3  74 13796  2 -1 -1 -1
+   80   613917  86619     95   64  19.22    -1   64   3600    -1  1   3  74 13799  3 -1 -1 -1
+   81   614987      2    336   16  18.25    -1   16   1800    -1  1 147  73 13802  3 -1 -1 -1
+   82   615362     10    277    1  14.00    -1    1   1800    -1  1 147  73 13805  3 -1 -1 -1
+   83   617472     11    257   16 107.88    -1   16   1800    -1  1 147  73 13808  3 -1 -1 -1
+   84   617477   4833    343   32 146.66    -1   32   1800    -1  1 147  73 13811  3 -1 -1 -1
+   85   617482  83162    387   64 166.80    -1   64   2700    -1  1 147  73 13814  3 -1 -1 -1
+   87   617729     21    182   16  42.12    -1   16   1800    -1  1 147  73 13820  3 -1 -1 -1
+   88   617737   4924    216   32  55.06    -1   32   1800    -1  1 147  73 13823  3 -1 -1 -1
+   89   617741  26970     -1   -1     -1    -1   64   2700    -1  5 147  73 13826  3 -1 -1 -1
+   90   617748  83296    263   64  62.39    -1   64   2700    -1  1 147  73 13829  3 -1 -1 -1
+   92   617914     28    165   16  24.25    -1   16   1800    -1  1 147  73 13835  3 -1 -1 -1
+   93   617917   4969    180   32  24.75    -1   32   1800    -1  1 147  73 13837  3 -1 -1 -1
+   94   617923  83393    199   64  24.52    -1   64   2700    -1  1 147  73 13840  3 -1 -1 -1
+   96   618202      7    353   16  28.25    -1   16   1800    -1  1 147  73 13846  3 -1 -1 -1
+   97   618628      8    174   16  19.56    -1   16   1800    -1  1 147  73 13849  3 -1 -1 -1
+   98   618949      7    161   16  19.38    -1   16   1800    -1  1 147  73 13852  3 -1 -1 -1
+   99   619684     93  19199    4  18219    -1    4  64500    -1  1 162  75 18344  4 -1 -1 -1
+  100   619766     10     37    8   3.38    -1    8  64800    -1  5 162  75 18347  2 -1 -1 -1
+  101   619804      6     24    1     -1    -1    1   1800    -1  1 147  73 13855  3 -1 -1 -1
+  102   620527  18793  35969   11   3.55    -1   11  36000    -1  5 160  75 13858  3 -1 -1 -1
+  103   621578  17802  35968   11   3213    -1   11  36000    -1  5 160  75 18350  3 -1 -1 -1
+  104   621582  17739  35969   11   3.73    -1   11  36000    -1  5 160  75 13861  3 -1 -1 -1
+  105   638224  37333   8027    8   7338    -1    8  64800    -1  1 150   6 13592  4 -1 -1 -1
+  106   639157    845  18855    4  17851    -1    4  64500    -1  1 162  75 18353  4 -1 -1 -1
+  107   639295     14     -1   -1     -1    -1    4  64500    -1  5 162  75 18355  4 -1 -1 -1
+  108   639316      3     58   13   5.08    -1   13  64800    -1  5 162  75 18358  2 -1 -1 -1
+  109   639459      7     60   16   9.38    -1   16  64800    -1  5 162  75 18361  2 -1 -1 -1
+  110   639523      7     62   19   6.00    -1   19  64800    -1  5 162  75 18364  2 -1 -1 -1
+  111   639759      7     61    3  21.33    -1    3  64800    -1  5 162  75 18366  2 -1 -1 -1
+  112   639907    130     -1   -1     -1    -1  110    600    -1  5 162  75 18369  2 -1 -1 -1
+  113   639994      6     41    8   6.38    -1    8  64800    -1  5 162  75 18373  1 -1 -1 -1
+  114   639995      6     45    8   8.12    -1    8  64800    -1  5 162  75 18377  1 -1 -1 -1
+  115   644835      4    179   16  20.12    -1   16   1800    -1  1 147  73 18381  3 -1 -1 -1
+  116   645249      4    155   16  18.94    -1   16   1800    -1  1 147  73 18385  3 -1 -1 -1
+  117   645444      1    313   16  15.69    -1   16   1800    -1  1 147  73 18388  3 -1 -1 -1
+  118   645540      2  35621    1  34803    -1    1  57600    -1  1 153  75 13866  4 -1 -1 -1
+  119   645808      3  48803    1  46863    -1    1  57600    -1  1 153  75 13869  3 -1 -1 -1
+  120   645978      3  23055    1  21935    -1    1  57600    -1  1 153  75 13872  4 -1 -1 -1
+  121   646088     11    332   16  15.88    -1   16   1800    -1  1 147  73 18392  3 -1 -1 -1
+  122   646393      5  54148    1  51173    -1    1  57600    -1  1 153  75 13875  4 -1 -1 -1
+  123   646521      5    110   16   0.25    -1   16   1800    -1  5 147  73 18396  3 -1 -1 -1
+  124   647272      9    359   16  17.56    -1   16   1800    -1  1 147  73 18400  3 -1 -1 -1
+  125   647739     11    303   27  16.37    -1   27   1800    -1  1 147  73 18404  3 -1 -1 -1
+  126   648093      9    370   27  19.19    -1   27   1800    -1  1 147  73 18407  3 -1 -1 -1
+  127   648486     10    344   27  18.56    -1   27   1800    -1  1 147  73 18411  3 -1 -1 -1
+  128   649148      7    336   27  18.07    -1   27   1800    -1  1 147  73 18415  3 -1 -1 -1
+  129   649620      4    328   27  16.52    -1   27   1800    -1  1 147  73 18419  3 -1 -1 -1
+  130   650241      4    332   27  18.04    -1   27   1800    -1  1 147  73 18423  3 -1 -1 -1
+  131   650849      2    373   16  19.75    -1   16   1800    -1  1 147  73 18426  3 -1 -1 -1
+  132   651272      8    337   27  17.33    -1   27   1800    -1  1 147  73 13878  3 -1 -1 -1
+  133   651683      3    326   27  18.33    -1   27   1800    -1  1 147  73 13881  3 -1 -1 -1
+  134   652035      4    331   16  17.06    -1   16   1800    -1  1 147  73 13884  3 -1 -1 -1
+  135   652231   9006  14769   11  14279    -1   11  36000    -1  1 160  75 13887  3 -1 -1 -1
+  136   652517      2    315   16  16.00    -1   16   1800    -1  1 147  73 13890  3 -1 -1 -1
+  137   653274     11    302   27  17.19    -1   27   1800    -1  1 147  73 13893  3 -1 -1 -1
+  138   653562   5079  14390    1  14200    -1    1  18000    -1  1 154  75 13896  4 -1 -1 -1
+  139   653617     10    307   16  16.94    -1   16   1800    -1  1 147  73 18429  3 -1 -1 -1
+  140   658633      6   2548   38   2366    -1   38  64500    -1  1 189  75 18433  2 -1 -1 -1
+  141   658981  88138    287   32 180.19    -1   32  64800    -1  1 163  75 18437  3 -1 -1 -1
+  142   661229      5   3806   50   3551    -1   50  64500    -1  5 189  75 18441  2 -1 -1 -1
+  143   662796   2247  64827    4  64133    -1    4  64800    -1  5 156  75 13899  3 -1 -1 -1
+  145   664898     10  58075    1  57610    -1    1  64800    -1  1 155  75 13902  3 -1 -1 -1
+  146   665386      8    302   16  16.56    -1   16   1800    -1  1 147  73 13905  3 -1 -1 -1
+  147   667115      2    309   16  16.88    -1   16   1800    -1  1 147  73 13908  3 -1 -1 -1
+  148   667886      8    277    1  15.00    -1    1   2400    -1  1 158  73 13911  3 -1 -1 -1
+  149   668596     10    715    1  17.00    -1    1   2400    -1  1 158  73 13914  3 -1 -1 -1
+  150   668645      4    416   16  19.31    -1   16   1800    -1  1 147  73 13917  3 -1 -1 -1
+  151   669401      6    336   16  17.94    -1   16   1800    -1  1 147  73 13920  3 -1 -1 -1
+  152   669446      4    182   16  19.56    -1   16   1800    -1  1 147  73 13923  3 -1 -1 -1
+  153   669599     45    842   32  42.09    -1   32   2400    -1  1 158  73 13926  3 -1 -1 -1
+  154   670019     10    167   16  19.19    -1   16   1800    -1  1 147  73 13929  3 -1 -1 -1
+  155   670042    158    301   16  16.56    -1   16   1800    -1  1 147  73 13932  3 -1 -1 -1
+  156   670636      7    330   32  17.69    -1   32   2400    -1  1 158  73 13935  3 -1 -1 -1
+  157   671461     11    855   32  47.69    -1   32   2400    -1  1 158  73 13938  3 -1 -1 -1
+  158   672327      9    319   16  25.44    -1   16   1800    -1  1 147  73 13941  3 -1 -1 -1
+  159   672431     12    340   32  16.81    -1   32   2400    -1  1 158  73 13944  3 -1 -1 -1
+  160   672948      8    797   32  40.88    -1   32   2400    -1  1 158  73 13947  3 -1 -1 -1
+  161   673296      3    379   16  27.75    -1   16   1800    -1  1 147  73 13950  3 -1 -1 -1
+  162   673798     96     -1   -1     -1    -1   16   1800    -1  5 147  73 13953  3 -1 -1 -1
+  163   673864  26203    331   32  17.56    -1   32   2400    -1  1 158  73 13956  3 -1 -1 -1
+  164   673907   1598     38   16     -1    -1   16   1800    -1  5 147  73 13959  3 -1 -1 -1
+  165   674530   1772     -1   -1     -1    -1   48   1800    -1  5 133  50 18452  3 -1 -1 -1
+  166   674689   1613     -1   -1     -1    -1   24   4800    -1  5 133  50 18456  3 -1 -1 -1
+  167   674883      1    396    2 295.50    -1    2   1800    -1  1 161  75 13962  3 -1 -1 -1
+  168   675761     11     37    2   1.00    -1    2    600    -1  1   3  74 18460  4 -1 -1 -1
+  169   675846      3     38    4   2.75    -1    4    600    -1  1   3  74 18464  4 -1 -1 -1
+  170   675975      2  14696   11  14258    -1   11  36000    -1  1 160  75 18468  3 -1 -1 -1
+  172   676178      3     47    4  10.25    -1    4    600    -1  1   3  74 18475  4 -1 -1 -1
+  173   676289     10   3911   15   3749    -1   15   9000    -1  1 133  50 18479  3 -1 -1 -1
+  174   676578   6493     48    4  10.00    -1    4    600    -1  1   3  74 18483  4 -1 -1 -1
+  175   678396   1824  11121   15  10917    -1   15  18000    -1  1 133  50 18487  3 -1 -1 -1
+  176   680929  10423  18334   15  18058    -1   15  21600    -1  1 133  50 18490  3 -1 -1 -1
+  177   688262      2  14154    2  13834    -1    2  28500    -1  1 162  75 13965  4 -1 -1 -1
+  178   688508     11  15439    1  15320    -1    1  18000    -1  1 154  75 13968  4 -1 -1 -1
+  179   688521     10  60794    4  57950    -1    4  64500    -1  1 162  75 13971  4 -1 -1 -1
+  180   690642     41   9665   11   9426    -1   11  36000    -1  1 160  75 13974  3 -1 -1 -1
+  181   694333   5731    465   32 402.84    -1   32  64800    -1  1 119  76 13977  2 -1 -1 -1
+  182   694413  50715   1987   32   1916    -1   32  64800    -1  1 119  76 13980  3 -1 -1 -1
+  183   700318      4  10210   11   9976    -1   11  36000    -1  1 160  75 18494  3 -1 -1 -1
+  184   700639  46776    911   32 851.75    -1   32  64800    -1  1 119  76 18498  3 -1 -1 -1
+  185   702943     10    129    2  97.00    -1    2   1800    -1  5 161  75 18501  3 -1 -1 -1
+  186   703160      6     59    2  21.00    -1    2   1800    -1  1 161  75 18501  3 -1 -1 -1
+  187   703445      8    223   64 147.69    -1   64   3600    -1  1   3  74 13983  4 -1 -1 -1
+  188   704670      2    341    1  17.00    -1    1   3600    -1  1 158  73 13986  3 -1 -1 -1
+  189   705671      9    266    1  14.00    -1    1   3600    -1  1 158  73 13989  3 -1 -1 -1
+  190   710503      3   1661   11   1524    -1   11  36000    -1  1 160  75 13991  3 -1 -1 -1
+  191   712143     13   1662   11   1530    -1   11  36000    -1  1 160  75 18506  3 -1 -1 -1
+  192   713788      2   1668   11   1533    -1   11  36000    -1  1 160  75 13993  3 -1 -1 -1
+  193   715427      2   1740   11   1587    -1   11  36000    -1  1 160  75 13996  3 -1 -1 -1
+  194   724251      8    160   16  19.44    -1   16   1800    -1  1 147  73 13998  3 -1 -1 -1
+  195   724630     10    173   32  19.38    -1   32   1800    -1  1 147  73 14000  3 -1 -1 -1
+  196   724939     10    323   16  16.50    -1   16   1800    -1  1 147  73 14003  3 -1 -1 -1
+  197   725561      3    359   16  30.81    -1   16   1800    -1  1 147  73 14006  3 -1 -1 -1
+  198   726021      9    335   16  28.56    -1   16   1800    -1  1 147  73 14008  3 -1 -1 -1
+  199   726531      8    380   32  18.97    -1   32   1800    -1  1 147  73 14011  3 -1 -1 -1
+  200   727021      7    176   16  20.75    -1   16   1800    -1  1 147  73 14014  3 -1 -1 -1
+  201   727528      8    687    8 596.00    -1    8  64800    -1  5 150   6 13592  4 -1 -1 -1
+  202   728987      2    651    8 563.25    -1    8  64800    -1  5 150   6 13592  4 -1 -1 -1
+  203   729694      3     59    8  21.75    -1    8  64800    -1  5 150   6 13592  4 -1 -1 -1
+  204   729746     16    163    8 104.50    -1    8  64800    -1  5 150   6 13592  4 -1 -1 -1
+  205   730567      9    497    8 359.88    -1    8  64800    -1  5 150   6 13592  4 -1 -1 -1
+  206   731943     12   9503    8   7655    -1    8  64800    -1  1 150   6 13592  4 -1 -1 -1
+  207   735775      2  11576    1  11259    -1    1  57600    -1  1 153  75 14029  4 -1 -1 -1
+  209   736042     11  12358    1  11771    -1    1  57600    -1  1 153  75 14035  4 -1 -1 -1
+  210   736252      3  11294    1  10709    -1    1  57600    -1  1 153  75 14038  4 -1 -1 -1
+  211   736570      2  57621    1  57214    -1    1  57600    -1  5 153  75 14041  4 -1 -1 -1
+  212   737565      2  16057    1  15941    -1    1  18000    -1  1 154  75 14044  4 -1 -1 -1
+  213   742701      7     46    4  11.75    -1    4    600    -1  1   3  74 14047  4 -1 -1 -1
+  214   743081      9     50    4  18.25    -1    4    600    -1  1   3  74 14049  4 -1 -1 -1
+  215   743261     10     49    4  17.75    -1    4    600    -1  1   3  74 14052  4 -1 -1 -1
+  216   743392      6     49    4  17.25    -1    4    600    -1  1   3  74 14055  4 -1 -1 -1
+  217   743486      8     50    4  18.25    -1    4    600    -1  1   3  74 14058  4 -1 -1 -1
+  218   743663      1     56    4  15.25    -1    4    600    -1  1   3  74 14061  4 -1 -1 -1
+  219   743706  30232    667   64 592.22    -1   64   3600    -1  1   3  74 14064  4 -1 -1 -1
+  220   743790      2     57    4  15.25    -1    4    600    -1  1   3  74 14066  4 -1 -1 -1
+  221   744023      3     97    4  51.50    -1    4    600    -1  1   3  74 14068  4 -1 -1 -1
+  222   744252      7    100    4  51.25    -1    4    600    -1  1   3  74 14070  4 -1 -1 -1
+  223   744749      8     31    2   1.00    -1    2   1800    -1  1 161  75 13962  3 -1 -1 -1
+  224   745118  28131    673   64 597.78    -1   64   1800    -1  1   3  74 14073  2 -1 -1 -1
+  225   749690      8   9532    8   7652    -1    8  64800    -1  1 150   6 13592  4 -1 -1 -1
+  226   750402      5  58084    4  57466    -1    4  64800    -1  1 156  75 14076  3 -1 -1 -1
+  227   750719      5    423    2 326.50    -1    2   1800    -1  1 161  75 14093  3 -1 -1 -1
+  228   767070      5    289   32 180.59    -1   32  64800    -1  1 163  75 14078  3 -1 -1 -1
+  229   767401      3    798   32 542.75    -1   32  64800    -1  1 163  75 14081  3 -1 -1 -1
+  230   768967      3    427   32 291.47    -1   32  64800    -1  1 163  75 18510  3 -1 -1 -1
+  231   769671      8    788   32 528.00    -1   32  64800    -1  1 163  75 14084  3 -1 -1 -1
+  232   769963      4     64    4  17.25    -1    4   3600    -1  1 197  84 18520  1 -1 -1 -1
+  233   770574      7    426   32 291.62    -1   32  64800    -1  1 163  75 18524  3 -1 -1 -1
+  234   771302     11  64835   32  19918    -1   32  64800    -1  5 163  75 14087  3 -1 -1 -1
+  235   776280 138493  29058   63  28355    -1   63  57600    -1  5  24  22 14090  3 -1 -1 -1
+  236   781770      3    375    2 293.50    -1    2    900    -1  1 161  75 14093  3 -1 -1 -1
+  237   783245      7     32    8   0.50    -1    8  21600    -1  1 161  75 14096  3 -1 -1 -1
+  238   783624      9    304    8  44.75    -1    8  21600    -1  5 161  75 14099  3 -1 -1 -1
+  239   784168      7  21629    8 526.50    -1    8  21600    -1  5 161  75 14099  3 -1 -1 -1
+  240   784765      5   1226    1   1149    -1    1  18000    -1  1 154  75 14103  4 -1 -1 -1
+  241   789290      2    167    1   6.00    -1    1  57600    -1  1 153  75 14106  3 -1 -1 -1
+  242   789404      6    186    1   9.00    -1    1  57600    -1  1 153  75 14109  3 -1 -1 -1
+  243   789496     10    200    1  11.00    -1    1  57600    -1  1 153  75 14111  3 -1 -1 -1
+  244   789914      6    188    1  10.00    -1    1  57600    -1  1 153  75 14114  3 -1 -1 -1
+  245   790054      5    163    1   6.00    -1    1  57600    -1  1 153  75 14117  3 -1 -1 -1
+  246   790101     12    197    1  10.00    -1    1  57600    -1  1 153  75 14120  3 -1 -1 -1
+  247   807488      4   8023    8   7332    -1    8  64800    -1  1 150   6 13592  4 -1 -1 -1
+  248   808329      9     43    4   5.00    -1    4    900    -1  1 147  73 14125  3 -1 -1 -1
+  249   816636     12    343   32  27.47    -1   32   1800    -1  1 147  73 14128  3 -1 -1 -1
+  250   817954      1     51    2  12.50    -1    2  64800    -1  1   4   4 14131  3 -1 -1 -1
+  251   818634     12    113   32   7.78    -1   32   1800    -1  1 147  73 14133  3 -1 -1 -1
+  252   818881     11    113   32   7.84    -1   32   1800    -1  1 147  73 14136  3 -1 -1 -1
+  253   819048      6    359   32  28.34    -1   32   1800    -1  1 147  73 14139  3 -1 -1 -1
+  254   821433      5  57498    4  56838    -1    4  64800    -1  1 156  75 14142  3 -1 -1 -1
+  255   821568     10    205    2 154.50    -1    2    600    -1  1 164  75 14145  2 -1 -1 -1
+  256   821574      3    205    2 153.50    -1    2    600    -1  1 164  75 14148  1 -1 -1 -1
+  257   822311     11     23    1     -1    -1    1   1800    -1  1 147  73 18531  3 -1 -1 -1
+  258   822371      5    112   32   0.28    -1   32   1800    -1  5 147  73 18535  3 -1 -1 -1
+  259   822557      1     87   32   0.31    -1   32   1800    -1  5 147  73 18539  3 -1 -1 -1
+  260   822685      1     55   32   3.16    -1   32   3600    -1  1 133  50 18543  3 -1 -1 -1
+  261   822821      5   2179   32   2097    -1   32   3600    -1  1 133  50 18546  3 -1 -1 -1
+  262   822831      8     46   32   1.41    -1   32   1800    -1  1 147  73 18549  3 -1 -1 -1
+  263   823038      2     74   32   4.44    -1   32   1800    -1  5 147  73 18552  3 -1 -1 -1
+  264   823115      2    381   32  29.12    -1   32   1800    -1  1 147  73 18556  3 -1 -1 -1
+  265   823571      3    358   32  27.84    -1   32   1800    -1  1 147  73 18559  3 -1 -1 -1
+  266   824528     10  95061    8  11058    -1    8  64800    -1  5 150   6 13592  4 -1 -1 -1
+  267   825285      4  20332    1  20103    -1    1  57600    -1  5 153  75 18563  3 -1 -1 -1
+  268   825643      6   1336   32   1268    -1   32   3600    -1  1 133  50 18567  3 -1 -1 -1
+  269   825930      5    113    1   6.00    -1    1  57600    -1  1 153  75 18571  3 -1 -1 -1
+  270   825952      5   1492    1   1249    -1    1  21600    -1  5 153  75 18575  3 -1 -1 -1
+  271   825971     82    130    1  11.00    -1    1  57600    -1  1 153  75 18578  3 -1 -1 -1
+  272   827065      3   3383   32   3307    -1   32   3600    -1  1 133  50 18582  3 -1 -1 -1
+  273   827246      3    111    1  57.00    -1    1  57600    -1  5 153  75 18586  3 -1 -1 -1
+  274   827378      9  37309    1  36497    -1    1  57600    -1  1 153  75 18590  3 -1 -1 -1
+  275   827522      4    125    1   9.00    -1    1  57600    -1  1 153  75 18594  3 -1 -1 -1
+  276   827775      5   5975    1   5688    -1    1  57600    -1  1 153  75 18598  3 -1 -1 -1
+  277   827833   1175   4572    1   4275    -1    1  57600    -1  1 153  75 18602  3 -1 -1 -1
+  278   828709      2    314    4 233.25    -1    4   7200    -1  5 161  75 14099  3 -1 -1 -1
+  279   829129      6   2091    4 189.75    -1    4  21600    -1  5 161  75 14099  3 -1 -1 -1
+  280   829950     15     -1   -1     -1    -1   32   3600    -1  5 133  50 18612  3 -1 -1 -1
+  281   829971    489    112   48  27.08    -1   48   1800    -1  1 133  50 18615  3 -1 -1 -1
+  282   830638      4   1839   48   1714    -1   48   1800    -1  5 133  50 18619  3 -1 -1 -1
+  283   831299     10    104    4  34.75    -1    4   3600    -1  1 161  75 14099  3 -1 -1 -1
+  284   831662      8  15878    4   1053    -1    4  21600    -1  5 161  75 14099  3 -1 -1 -1
+  285   832355   4326    100   64  24.59    -1   64   2400    -1  1  34   7 14153  3 -1 -1 -1
+  286   832384    106     54   32   1.34    -1   32   2400    -1  1  34   7 14155  3 -1 -1 -1
+  287   832471     85     37   48   0.29    -1   48   3600    -1  5 133  50 18629  3 -1 -1 -1
+  288   832474     19     40   16   1.25    -1   16   2400    -1  1  34   7 14157  3 -1 -1 -1
+  289   832503      9   1479    8   1393    -1    8   3000    -1  1  34   7 14159  3 -1 -1 -1
+  290   832535     20     32    4   1.25    -1    4   3000    -1  1  34   7 14162  3 -1 -1 -1
+  291   832558     39   4073   48   3906    -1   48   5400    -1  1 133  50 18633  3 -1 -1 -1
+  292   832565      4   2068    2   2015    -1    2   3000    -1  1  34   7 14165  3 -1 -1 -1
+  293   832619     13     -1   -1     -1    -1   44   5400    -1  5 133  50 18637  3 -1 -1 -1
+  294   832711   3148     43   16   5.81    -1   16   1200    -1  1  34   7 14167  3 -1 -1 -1
+  295   832737   3176    211   16 156.75    -1   16   1200    -1  1  34   7 14169  3 -1 -1 -1
+  296   832759   3367     38   16   1.25    -1   16   2400    -1  1  34   7 14171  3 -1 -1 -1
+  297   832808      3     47    2  14.50    -1    2   1200    -1  1  34   7 14173  3 -1 -1 -1
+  298   832835      8   2070    2   2020    -1    2   3000    -1  1  34   7 14176  3 -1 -1 -1
+  299   832863    724     46    4  10.25    -1    4   1200    -1  1  34   7 14179  3 -1 -1 -1
+  300   832884    756     32    4   1.25    -1    4   3000    -1  1  34   7 14181  3 -1 -1 -1
+  301   832925   1077     47    8   7.25    -1    8   1200    -1  1  34   7 14183  3 -1 -1 -1
+  302   832947   1108    312    8 258.62    -1    8   2400    -1  1  34   7 14185  3 -1 -1 -1
+  303   832983   1392   1473    8   1392    -1    8   3000    -1  1  34   7 14187  3 -1 -1 -1
+  304   833122   3039     50   32   1.50    -1   32   2400    -1  1  34   7 14189  3 -1 -1 -1
+  305   833290   3503     91   64   4.72    -1   64   1200    -1  1  34   7 14191  3 -1 -1 -1
+  306   833341   2873     50   32   4.94    -1   32   1200    -1  1  34   7 14193  3 -1 -1 -1
+  307   833366   2903    331   32 217.56    -1   32   1200    -1  1  34   7 14195  3 -1 -1 -1
+  308   833504  14018    959    4 876.00    -1    4  21600    -1  5 161  75 18641  3 -1 -1 -1
+  309   836703     49     -1   -1     -1    -1   48   7200    -1  5 133  50 18645  3 -1 -1 -1
+  310   836740      8     65   32   0.38    -1   32  14400    -1  5 133  50 18649  3 -1 -1 -1
+  311   836814      2  12402   32  12023    -1   32  14400    -1  1 133  50 18653  3 -1 -1 -1
+  312   837305      5    124    2  65.00    -1    2   1200    -1  1  34   7 14197  3 -1 -1 -1
+  313   837319      2    104    2     -1    -1    2   1200    -1  5  34   7 14199  3 -1 -1 -1
+  314   837359      5    106    2     -1    -1    2   1200    -1  5  34   7 14201  3 -1 -1 -1
+  315   837373      2     64    4  31.75    -1    4   1200    -1  1  34   7 14203  3 -1 -1 -1
+  316   837384      3    105    4   0.25    -1    4   1200    -1  5  34   7 14206  3 -1 -1 -1
+  317   837389      9    106    4     -1    -1    4   1200    -1  5  34   7 14208  3 -1 -1 -1
+  318   839360      6    103    2  63.50    -1    2   1200    -1  1  34   7 14210  3 -1 -1 -1
+  319   839368      9     62    4  31.25    -1    4   1200    -1  1  34   7 14212  3 -1 -1 -1
+  320   839463     10     55    8  18.38    -1    8   1200    -1  1  34   7 14214  3 -1 -1 -1
+  321   839468      6    497    8 244.25    -1    8   1200    -1  1  34   7 14216  3 -1 -1 -1
+  322   839473      2    107    8   0.12    -1    8   1200    -1  5  34   7 14218  3 -1 -1 -1
+  323   839498     10     47   16   9.75    -1   16   1200    -1  1  34   7 14220  2 -1 -1 -1
+  324   839503      6    165   16 123.62    -1   16   1200    -1  1  34   7 14222  3 -1 -1 -1
+  325   839509     22    112   16   0.25    -1   16   1200    -1  5  34   7 14225  3 -1 -1 -1
+  326   839546    104     54   32   6.03    -1   32   1200    -1  1  34   7 14227  3 -1 -1 -1
+  327   839554    160    122   32  64.38    -1   32   1200    -1  1  34   7 14229  3 -1 -1 -1
+  328   839562    281   2136   32 382.50    -1   32   2400    -1  1  34   7 14232  3 -1 -1 -1
+  329   839576   4602     90   64   3.98    -1   64   1200    -1  1  34   7 14235  3 -1 -1 -1
+  330   839582   4701    114   64  34.58    -1   64   1200    -1  1  34   7 14238  3 -1 -1 -1
+  331   839587   4821    269   64 169.11    -1   64   1200    -1  1  34   7 14241  3 -1 -1 -1
+  332   840194     10     47    4  10.25    -1    4   1200    -1  1  34   7 14244  3 -1 -1 -1
+  333   840240      8     38    4   1.00    -1    4   3000    -1  1  34   7 14247  3 -1 -1 -1
+  334   840270     10     44   16   5.81    -1   16   1200    -1  1  34   7 14250  3 -1 -1 -1
+  335   840299      4    212   16 156.75    -1   16   3000    -1  1  34   7 14253  3 -1 -1 -1
+  336   840332      4     60   16   1.25    -1   16   3600    -1  1  34   7 14256  3 -1 -1 -1
+  337   840381    142     47   32   1.34    -1   32   3000    -1  1  34   7 14259  3 -1 -1 -1
+  338   840617      2     88    2  56.50    -1    2   1200    -1  1  34   7 14262  3 -1 -1 -1
+  339   841203     10     62    4  31.50    -1    4   1200    -1  1  34   7 14265  3 -1 -1 -1
+  340   841621      6   2541   32 390.12    -1   32   3600    -1  1  34   7 14268  3 -1 -1 -1
+  341   842026   2659     72   64   4.59    -1   64   1200    -1  1  34   7 14271  3 -1 -1 -1
+  342   842056   2711    154   64  57.48    -1   64   1200    -1  1  34   7 14274  3 -1 -1 -1
+  343   842086   2848     70   64   1.47    -1   64   3000    -1  1  34   7 14277  3 -1 -1 -1
+  344   843552 132215   2337   32   2234    -1   32  64800    -1  1 163  75 14280  3 -1 -1 -1
+  345   843673     10     62    8  18.38    -1    8   1200    -1  1  34   7 14283  3 -1 -1 -1
+  346   845024      7  37996    1  36784    -1    1  57600    -1  1 153  75 14286  3 -1 -1 -1
+  347   845045    581  16542    1  15774    -1    1  57600    -1  1 153  75 14289  3 -1 -1 -1
+  348   845627   1896  10132    1   9976    -1    1  57600    -1  5 153  75 18655  3 -1 -1 -1
+  349   846197     12     46   16   9.75    -1   16   1200    -1  1  34   7 14292  2 -1 -1 -1
+  350   846218     12    166   16 123.75    -1   16   1200    -1  1  34   7 14295  3 -1 -1 -1
+  351   848867     11     47   32   1.75    -1   32   3600    -1  1 133  50 18658  3 -1 -1 -1
+  352   849016     11   3635   32   3551    -1   32   3600    -1  5 133  50 18662  3 -1 -1 -1
+  353   849450     12    452    8 399.62    -1    8   7200    -1  1 127  75 14298  3 -1 -1 -1
+  354   850353 127754  43248   63   8547    -1   63  43200    -1  5 131  20 18666  4 -1 -1 -1
+  355   852708      4     95   48  33.31    -1   48   5400    -1  1 133  50 18670  3 -1 -1 -1
+  356   852801     17   1449   48   1374    -1   48   5400    -1  5 133  50 18674  3 -1 -1 -1
+  357   854322      6     59   48   2.77    -1   48   3600    -1  1 133  50 18678  3 -1 -1 -1
+  358   854453      4  65143   48   2088    -1   48   3600    -1  5 133  50 18682  3 -1 -1 -1
+  359   855869  55282     -1   -1     -1    -1   64   5400    -1  5 133  50 18686  3 -1 -1 -1
+  360   857145      6    256    1 217.00    -1    1    900    -1  1 159  75 14301  1 -1 -1 -1
+  361   857230      6    182    2 147.50    -1    2    900    -1  1 159  75 14304  1 -1 -1 -1
+  362   857593      3    181    2 148.50    -1    2    900    -1  1 159  75 14307  1 -1 -1 -1
+  363   857696   2962  38541    1  36520    -1    1  57600    -1  1 153  75 18690  3 -1 -1 -1
+  364   857877   2781     24    1     -1    -1    1   3600    -1  1 166  75 14312  3 -1 -1 -1
+  365   858162   2498  13584    1  13476    -1    1  18000    -1  1 154  75 14315  4 -1 -1 -1
+  366   860654      4    105   43  54.65    -1   43  64800    -1  1  41  30 14318  2 -1 -1 -1
+  367   861020      1    199   43 146.47    -1   43  64800    -1  1  41  30 14321  2 -1 -1 -1
+  368   861521     10    110   43  60.07    -1   43  64800    -1  1  41  30 14324  2 -1 -1 -1
+  369   862186      3    115   43  60.28    -1   43  64800    -1  1  41  30 14327  2 -1 -1 -1
+  370   872655     10   1091   32 194.41    -1   32  10800    -1  1 150   6 13641  2 -1 -1 -1
+  371   872900     10  39487    1  37945    -1    1  57600    -1  5 153  75 14330  3 -1 -1 -1
+  372   880898     10   1603   32   1513    -1   32   3600    -1  1 163  75 18694  2 -1 -1 -1
+  373   886751  27938  57958    8  54476    -1    8  64800    -1  5 150   6 13592  4 -1 -1 -1
+  374   906748     83     -1   -1     -1    -1    8   3600    -1  5 167  73 14334  3 -1 -1 -1
+  375   906839     28     -1   -1     -1    -1    8    600    -1  5 167  73 14334  5 -1 -1 -1
+  376   906857     17     -1   -1     -1    -1   64   5400    -1  5 133  50 18698  3 -1 -1 -1
+  377   906884    183     -1   -1     -1    -1    8    600    -1  5 167  73 14334  2 -1 -1 -1
+  378   911140    645     -1   -1     -1    -1   64   9000    -1  5 133  50 14341  3 -1 -1 -1
+  379   911465      2    202    2 156.00    -1    2    600    -1  1 164  75 14344  2 -1 -1 -1
+  380   911555      2    232    2 174.00    -1    2    600    -1  1 164  75 14347  2 -1 -1 -1
+  381   911696     27     -1   -1     -1    -1   48   9000    -1  5 133  50 14350  3 -1 -1 -1
+  382   911751   4547     -1   -1     -1    -1   36   9000    -1  5 133  50 14352  3 -1 -1 -1
+  383   911937   2750  34440    1  33061    -1    1  57600    -1  1 153  75 18702  3 -1 -1 -1
+  384   912128   2561  16070    1  15944    -1    1  18000    -1  1 154  75 18706  4 -1 -1 -1
+  385   912141   2546  49143    1  46451    -1    1  57600    -1  1 153  75 18710  3 -1 -1 -1
+  386   912284   2402  64828    4  64210    -1    4  64800    -1  5 156  75 14355  3 -1 -1 -1
+  387   912390   2298    146    1  10.00    -1    1  57600    -1  1 153  75 18714  3 -1 -1 -1
+  388   915785      5     24    1     -1    -1    1  17400    -1  1 166  75 14358  3 -1 -1 -1
+  389   916285     10   9171   22   8993    -1   22  12600    -1  1 133  50 14361  3 -1 -1 -1
+  390   919428  13155     -1   -1     -1    -1   43  64800    -1  5  41  30 14370  2 -1 -1 -1
+  391   919629  24210     72   32   5.94    -1   32   1200    -1  1  34   7 14373  3 -1 -1 -1
+  392   919650  24193    112   32  63.62    -1   32   1200    -1  1  34   7 14376  3 -1 -1 -1
+  393   919680  24557     70   64   3.86    -1   64   1200    -1  1  34   7 14379  3 -1 -1 -1
+  394   919695  24693    101   64  34.16    -1   64   1200    -1  1  34   7 14382  3 -1 -1 -1
+  395   919715  24786    244   64 167.62    -1   64   1200    -1  1  34   7 14385  3 -1 -1 -1
+  396   919764   5709    607   23 562.87    -1   23  64800    -1  1  41  30 14388  2 -1 -1 -1
+  397   920266     10    628    2 534.50    -1    2   7200    -1  5  15  75 14391  3 -1 -1 -1
+  398   920556   5532     36   16   0.44    -1   16   1200    -1  1  34   7 14394  3 -1 -1 -1
+  399   920614   5518     59   16  22.25    -1   16   1200    -1  1  34   7 14396  3 -1 -1 -1
+  400   920669   5529    127   16  87.62    -1   16   1200    -1  1  34   7 14399  3 -1 -1 -1
+  401   920727      3     32    8   0.50    -1    8   1200    -1  1  34   7 14402  3 -1 -1 -1
+  402   920778      6    105    8   0.12    -1    8   1200    -1  5  34   7 14404  3 -1 -1 -1
+  403   920954     11    746    2 641.50    -1    2   7200    -1  1  15  75 14407  3 -1 -1 -1
+  404   921088      4    105    8   0.12    -1    8   1200    -1  5  34   7 14410  3 -1 -1 -1
+  405   921151      6     51    4  21.00    -1    4   1200    -1  1  34   7 14413  3 -1 -1 -1
+  406   921191      9    103    4   0.25    -1    4   1200    -1  5  34   7 14416  3 -1 -1 -1
+  407   921235      8    104    4   0.25    -1    4   1200    -1  5  34   7 14419  3 -1 -1 -1
+  408   921301      6     70    2  39.50    -1    2   1200    -1  1  34   7 14422  3 -1 -1 -1
+  409   921340     10    105    2     -1    -1    2   1200    -1  5  34   7 14425  3 -1 -1 -1
+  410   921391      2    104    2     -1    -1    2   1200    -1  5  34   7 14428  3 -1 -1 -1
+  411   921705      6     31    8   0.38    -1    8   1200    -1  1  34   7 14431  3 -1 -1 -1
+  412   921724      9     51    4  21.00    -1    4   1200    -1  1  34   7 14434  3 -1 -1 -1
+  413   921747      8     69    2  38.50    -1    2   1200    -1  1  34   7 14437  3 -1 -1 -1
+  414   921939      7     43    8  10.88    -1    8   1200    -1  1  34   7 14440  3 -1 -1 -1
+  415   922156  21761     48   32   3.75    -1   32   1200    -1  1  34   7 14443  3 -1 -1 -1
+  416   922213  21752     44   32   0.47    -1   32   1200    -1  1  34   7 14446  3 -1 -1 -1
+  417   922221     11  49867    8  48627    -1    8  54000    -1  1 173  75 14298  4 -1 -1 -1
+  418   922247  21726     96   32  45.28    -1   32   1200    -1  1  34   7 14449  3 -1 -1 -1
+  419   922339   3751     36    8   1.12    -1    8  57600    -1  1  90  75 18720  3 -1 -1 -1
+  420   923540      4     61    2  18.50    -1    2   7200    -1  5  15  75 14452  3 -1 -1 -1
+  421   923597     11     77    2  28.00    -1    2   7200    -1  5  15  75 14455  3 -1 -1 -1
+  422   923901      4     38    4   4.75    -1    4    300    -1  1  35   7 14457  3 -1 -1 -1
+  423   924076     10  38648    1  37293    -1    1  57600    -1  1 153  75 18724  3 -1 -1 -1
+  424   924664   1470    105    8   0.12    -1    8  43200    -1  5  90  75 18727  3 -1 -1 -1
+  425   925236  18781     87   32   2.69    -1   32  14400    -1  1 133  50 14459  3 -1 -1 -1
+  426   926297      8  44927    8  44543    -1    8  57600    -1  1  90  75 18731  3 -1 -1 -1
+  427   926370     10    106    8   0.12    -1    8  43200    -1  5  90  75 18734  3 -1 -1 -1
+  428   926593     10  24887    8  24624    -1    8  43200    -1  1  90  75 18738  3 -1 -1 -1
+  429   927444      5     24    1     -1    -1    1  17400    -1  1 166  75 18740  3 -1 -1 -1
+  430   927848  16261    108   16   0.25    -1   16  17400    -1  5 166  75 18744  3 -1 -1 -1
+  431   931074 869430  10871   63   1891    -1   63  43200    -1  1 131  20 18748  4 -1 -1 -1
+  432   931335   1337     -1   -1     -1    -1   23  64800    -1  5  41  30 14461  2 -1 -1 -1
+  433   932068    494     -1   -1     -1    -1   23  64800    -1  5  41  30 14464  3 -1 -1 -1
+  434   932665      9    225    2 114.00    -1    2   7200    -1  5  15  75 14467  3 -1 -1 -1
+  435   933127     14     -1   -1     -1    -1   23  64800    -1  5  41  30 14469  3 -1 -1 -1
+  436   933174   1244     -1   -1     -1    -1   23  64800    -1  5  41  30 14471  2 -1 -1 -1
+  437   933923     10  14132    1  14003    -1    1  18000    -1  1 154  75 14474  4 -1 -1 -1
+  438   934641      1     43    8  10.88    -1    8   1800    -1  1  34   7 14477  3 -1 -1 -1
+  439   934669   9404     37   16   0.44    -1   16   1800    -1  1  34   7 14480  3 -1 -1 -1
+  440   934693   9381     59   16  22.25    -1   16   1200    -1  1  34   7 14483  3 -1 -1 -1
+  441   934709   9398    127   16  87.69    -1   16   1200    -1  1  34   7 14485  3 -1 -1 -1
+  442   939356  13281   3647   64 691.47    -1   64   3600    -1  5  62  79 18752  3 -1 -1 -1
+  443   942517      7    224    2 116.00    -1    2   7200    -1  5  15  75 14488  3 -1 -1 -1
+  444   942561     82     -1   -1     -1    -1   43  64800    -1  5  41  30 14490  2 -1 -1 -1
+  445   942670  33101    161   43 105.56    -1   43  64800    -1  1  41  30 14493  3 -1 -1 -1
+  446   943681 378460  64848   63  64378    -1   63  64800    -1  5  24  22 18756  3 -1 -1 -1
+  447   944051     10     62    2  14.00    -1    2   7200    -1  5  15  75 14496  3 -1 -1 -1
+  448   944262     53     67   63   0.38    -1   63  57600    -1  1  24  22 18760  2 -1 -1 -1
+  449   944613    143   6075   63   5863    -1   63  57600    -1  5  24  22 18764  2 -1 -1 -1
+  450   945431   5411   4115   16   2901    -1   16  17400    -1  1 166  75 14499  3 -1 -1 -1
+  451   945664      3  45728    1  45388    -1    1  64800    -1  1 155  75 18768  3 -1 -1 -1
+  452   946498      5    550    8 244.12    -1    8   1200    -1  1  34   7 14501  3 -1 -1 -1
+  453   946546   5852     75   64   0.53    -1   64   1200    -1  1  34   7 14503  3 -1 -1 -1
+  454   946585   5899     66   64   0.53    -1   64   1200    -1  1  34   7 14505  3 -1 -1 -1
+  455   946620   5941     65   64   0.52    -1   64   1200    -1  1  34   7 14507  3 -1 -1 -1
+  456   946643   4855     50   32   3.66    -1   32   1200    -1  1  34   7 14510  3 -1 -1 -1
+  457   946672   4881     43   32   0.50    -1   32   1200    -1  1  34   7 14512  3 -1 -1 -1
+  458   947039   4564     92   32  45.28    -1   32   1200    -1  1  34   7 14515  3 -1 -1 -1
+  459   950786     53   1557   32 291.34    -1   32  10800    -1  1 150   6 13641  2 -1 -1 -1
+  460   951728   3234  49584    8  49123    -1    8  50400    -1  1  90  75 18772  3 -1 -1 -1
+  461   952787   3507   1597   32 295.06    -1   32  10800    -1  1 150   6 13641  2 -1 -1 -1
+  462   953772   3343     -1   -1     -1    -1   63  57600    -1  5  24  22 18776  2 -1 -1 -1
+  463   971478      4   2787   32   2579    -1   32   7200    -1  1 163  75 18780  2 -1 -1 -1
+  464   971722   4050  64830    8  60981    -1    8  64800    -1  5 150   6 13592  4 -1 -1 -1
+  465   978080      5     30    4   0.25    -1    4    300    -1  1  94  53 18784  1 -1 -1 -1
+  466   978324      6     30    4   0.25    -1    4    300    -1  1  94  53 18788  1 -1 -1 -1
+  467   978410      6     30    4   0.25    -1    4    300    -1  1  94  53 18792  1 -1 -1 -1
+  468   978593      4     30    4   0.25    -1    4    300    -1  1  94  53 18795  1 -1 -1 -1
+  469   981872      8     30    4   0.25    -1    4    300    -1  1  94  53 18799  1 -1 -1 -1
+  470   982104     10     33    4   2.50    -1    4    300    -1  1  94  53 18803  1 -1 -1 -1
+  471   990314      3     29    4   0.25    -1    4    300    -1  1  94  53 18807  1 -1 -1 -1
+  472   990429      5     30    4   0.25    -1    4    300    -1  1  94  53 18811  1 -1 -1 -1
+  473   990508      1     30    4   0.25    -1    4    300    -1  1  94  53 18815  1 -1 -1 -1
+  474   990698      3     29    4   0.25    -1    4    300    -1  1  94  53 18819  1 -1 -1 -1
+  475   990856      5     30    4   0.25    -1    4    300    -1  1  94  53 18823  1 -1 -1 -1
+  476   990929      7     31    4   0.25    -1    4    300    -1  1  94  53 18827  1 -1 -1 -1
+  477   991026      7     29    4   0.25    -1    4    300    -1  1  94  53 18831  1 -1 -1 -1
+  478   991228      7     31    4   0.25    -1    4    300    -1  1  94  53 18835  1 -1 -1 -1
+  479   991258     10     29    4   0.25    -1    4    300    -1  1  94  53 18839  1 -1 -1 -1
+  480   992559      5  15421    1  15284    -1    1  18000    -1  1 154  75 18843  4 -1 -1 -1
+  481   993299      9  14436   32  14224    -1   32  14400    -1  5 133  50 14521  3 -1 -1 -1
+  482   993319  44595  25922    8  24265    -1    8  64800    -1  5 150   6 13592  4 -1 -1 -1
+  483   993407  10460     -1   -1     -1    -1   32  10800    -1  5 150   6 13641  2 -1 -1 -1
+  484   996045      5  43197    1  41724    -1    1  57600    -1  1 153  75 18847  3 -1 -1 -1
+  485   996238      3  53694    1  50739    -1    1  57600    -1  1 153  75 18851  3 -1 -1 -1
+  486   996620      3  33534    1  32358    -1    1  57600    -1  1 153  75 18854  3 -1 -1 -1
+  487   998538   6014  57305    4  56820    -1    4  64800    -1  1 156  75 14526  3 -1 -1 -1
+  488   999237  13136  13453   32  13303    -1   32  64800    -1  1 171  75 18858  2 -1 -1 -1
+  489  1000998  23183  14731   11  14327    -1   11  36000    -1  1 160  75 14529  3 -1 -1 -1
+  490  1001018  23164  16712   11  16193    -1   11  36000    -1  1 160  75 14532  3 -1 -1 -1
+  491  1001024  24853  16774   11  16269    -1   11  36000    -1  1 160  75 14535  3 -1 -1 -1
+  492  1001077  24801    541   11 183.45    -1   11  36000    -1  1 160  75 14538  3 -1 -1 -1
+  493  1001582   2970   1014    1 972.00    -1    1  14400    -1  1 152  75 14541  3 -1 -1 -1
+  494  1002974   1579  44754    1  44420    -1    1  64800    -1  1 155  75 18862  3 -1 -1 -1
+  495  1006298     21     -1   -1     -1    -1   32   7200    -1  5 163  75 14544  3 -1 -1 -1
+  496  1006344   1411   2963   32   2277    -1   32  10800    -1  1 163  75 14546  2 -1 -1 -1
+  497  1006600      2     68    3  38.33    -1    3    900    -1  1 147  73 18866  3 -1 -1 -1
+  498  1006884      4     74    3  45.00    -1    3    900    -1  1 147  73 18870  3 -1 -1 -1
+  499  1007209  20375     51   16   0.25    -1   16  17400    -1  5  32  75 18874  3 -1 -1 -1
+  500  1007513      9  38342    1  36462    -1    1  57600    -1  1 153  75 14549  3 -1 -1 -1
+  501  1007626   3103   1638   32 294.69    -1   32  10800    -1  1 150   6 13641  2 -1 -1 -1
+  502  1008336      2     67    3  36.67    -1    3    900    -1  1 147  73 18878  3 -1 -1 -1
+  503  1008438      7     72    3  43.00    -1    3    900    -1  1 147  73 18882  3 -1 -1 -1
+  504  1008697  12825     -1   -1     -1    -1   32   3600    -1  5 133  50 14554  3 -1 -1 -1
+  505  1009720      5  12979    1  12861    -1    1  18000    -1  1 154  75 14557  4 -1 -1 -1
+  506  1010326  17158     82   43  26.19    -1   43  64800    -1  1  41  30 14560  3 -1 -1 -1
+  507  1011364      1     94    1  58.00    -1    1  64800    -1  5 152  75 14563  3 -1 -1 -1
+  508  1011421     40  30109    2  28207    -1    2  64800    -1  1  42  75 14566  3 -1 -1 -1
+  509  1011456  11522  57340    1  35591    -1    1  64800    -1  1 152  75 14569  3 -1 -1 -1
+  510  1011757   9611     68    3  38.00    -1    3    900    -1  1 147  73 18886  3 -1 -1 -1
+  511  1012707   3701     -1   -1     -1    -1    2   1200    -1  5  15  75 14572  3 -1 -1 -1
+  512  1013279   8090   1596   32 290.66    -1   32  10800    -1  1 150   6 13641  2 -1 -1 -1
+  513  1016083   5283    227    2 183.00    -1    2    900    -1  1 159  75 18890  1 -1 -1 -1
+  514  1018145   4832   2892   32   2686    -1   32  10800    -1  1 163  75 14576  2 -1 -1 -1
+  515  1021510      7   2657   26   2539    -1   26   3600    -1  1 133  50 14578  3 -1 -1 -1
+  516  1021557      4     69    3  38.00    -1    3    900    -1  1 147  73 18893  3 -1 -1 -1
+  517  1021683      7     65    3  36.00    -1    3    900    -1  1 147  73 18896  3 -1 -1 -1
+  518  1021699      2    314    1 272.00    -1    1    900    -1  1 159  75 14581  1 -1 -1 -1
+  519  1022379      1     65    3  35.00    -1    3    900    -1  1 147  73 18899  3 -1 -1 -1
+  520  1022750      2    187    2 148.00    -1    2    900    -1  1 159  75 14584  1 -1 -1 -1
+  521  1022947      7     39    2     -1    -1    2    900    -1  1 159  75 14587  1 -1 -1 -1
+  522  1023046      8   2745    1   2685    -1    1  18000    -1  1 154  75 14590  4 -1 -1 -1
+  523  1023132   2705   1623   32 291.16    -1   32  10800    -1  1 150   6 13641  2 -1 -1 -1
+  524  1023155      7    216    2 181.50    -1    2    900    -1  1 159  75 14595  1 -1 -1 -1
+  525  1023831    384  45617    8  45158    -1    8  57600    -1  1  90  75 18901  3 -1 -1 -1
+  526  1023982      8    216    2 180.50    -1    2    900    -1  1 159  75 14598  1 -1 -1 -1
+  527  1024020   2402  50428    8  49861    -1    8  50400    -1  5  90  75 18905  3 -1 -1 -1
+  528  1025196   1225   4936    2 566.00    -1    2  14400    -1  5 161  75 14099  3 -1 -1 -1
+  529  1025397  24414    757   64 682.66    -1   64   3600    -1  1 159  75 14603  3 -1 -1 -1
+  530  1025795  24779    127   64   0.30    -1   64   1200    -1  5  34   7 14606  3 -1 -1 -1
+  531  1025810  24893    130   64   0.28    -1   64   1200    -1  5  34   7 14609  3 -1 -1 -1
+  532  1025824  25019    134   64   0.30    -1   64   1200    -1  5  34   7 14612  3 -1 -1 -1
+  533  1025854  25128  24983   32  24761    -1   32  64800    -1  1 119  76 14615  3 -1 -1 -1
+  534  1026315      9    363    2 327.50    -1    2    900    -1  1 159  75 14618  1 -1 -1 -1
+  535  1026344      2    149    8 110.50    -1    8   3600    -1  1 159  75 14621  1 -1 -1 -1
+  536  1026387  11526  11889   11  11468    -1   11  36000    -1  1 160  75 18909  3 -1 -1 -1
+  537  1026761      7    227    4 187.25    -1    4    900    -1  1 159  75 14624  1 -1 -1 -1
+  538  1027017    566   3634   24   3542    -1   24   3600    -1  5 133  50 14627  3 -1 -1 -1
+  539  1027423 199474   3655   64 691.91    -1   64   3600    -1  5  62  79 18913  3 -1 -1 -1
+  540  1027706      7    130    8  96.75    -1    8   3600    -1  1 159  75 14630  1 -1 -1 -1
+  541  1027716      8    194    4 161.00    -1    4    900    -1  1 159  75 14633  1 -1 -1 -1
+  542  1027720      5    321    2 287.50    -1    2    900    -1  1 159  75 14636  1 -1 -1 -1
+  543  1029051  24713    144   43  80.00    -1   43  64800    -1  1  41  30 14639  3 -1 -1 -1
+  544  1029268      7    294    4 254.00    -1    4   1200    -1  1  34   7 14642  3 -1 -1 -1
+  545  1029276     10   1228    4   1171    -1    4   1200    -1  5  34   7 14645  3 -1 -1 -1
+  546  1029285      2   1228    4   1180    -1    4   1200    -1  5  34   7 14648  3 -1 -1 -1
+  547  1029320     11    527    2 488.00    -1    2   1200    -1  1  34   7 14651  3 -1 -1 -1
+  548  1029353     10   1228    2   1182    -1    2   1200    -1  5  34   7 14654  3 -1 -1 -1
+  549  1029383      2    106    2     -1    -1    2   1200    -1  5  34   7 14657  3 -1 -1 -1
+  550  1029422    155    187    8 139.62    -1    8   1200    -1  1  34   7 14660  3 -1 -1 -1
+  551  1029461    309    643    8 569.00    -1    8   1200    -1  1  34   7 14663  3 -1 -1 -1
+  552  1029545    875   1227    8   1147    -1    8   1200    -1  5  34   7 14666  3 -1 -1 -1
+  553  1029767     99    700    1 268.00    -1    1   1800    -1  5 153  75 14669  3 -1 -1 -1
+  554  1029875   1356   9120   24   8890    -1   24  12600    -1  1 133  50 14672  3 -1 -1 -1
+  555  1029921   1728    131   16  80.25    -1   16   1200    -1  1  34   7 14675  3 -1 -1 -1
+  556  1029953   1837    370   16 297.50    -1   16   1200    -1  1  34   7 14678  3 -1 -1 -1
+  557  1030024   2146   1230   16   1110    -1   16   1200    -1  5  34   7 14681  3 -1 -1 -1
+  558  1030292 502443     -1   -1     -1    -1   63  57600    -1  5  24  22 18917  3 -1 -1 -1
+  559  1030452     11  43101    1  41346    -1    1  57600    -1  1 153  75 18921  3 -1 -1 -1
+  560  1031510      9   8945    1   8867    -1    1  18000    -1  1 154  75 18925  4 -1 -1 -1
+  561  1037903   2708   1021   32 182.12    -1   32  10800    -1  1 150   6 13641  2 -1 -1 -1
+  562  1038881     42  14831   11  14316    -1   11  36000    -1  1 160  75 18929  3 -1 -1 -1
+  563  1039011  31791  64681   13  59925    -1   13  64800    -1  1 151  75 18931  3 -1 -1 -1
+  564  1040863  13050  16844   11  16201    -1   11  36000    -1  1 160  75 14686  3 -1 -1 -1
+  565  1042339     10  37354    1  35957    -1    1  58200    -1  1 153  75 14689  3 -1 -1 -1
+  566  1042620  11294  16880   11  16242    -1   11  36000    -1  1 160  75 14692  3 -1 -1 -1
+  567  1049771   4145  14912   11  14325    -1   11  36000    -1  1 160  75 14695  3 -1 -1 -1
+  568  1051747      9     49   32   1.53    -1   32    300    -1  1 158  73 14698  3 -1 -1 -1
+  569  1052979      6     32    2   2.00    -1    2    300    -1  1 158  73 14701  3 -1 -1 -1
+  570  1053155     11     32    5   1.20    -1    5    300    -1  1 158  73 14704  3 -1 -1 -1
+  571  1053370      9     45   32   2.31    -1   32    300    -1  1 158  73 14707  3 -1 -1 -1
+  572  1053645     11     46   32   2.25    -1   32    300    -1  1 158  73 14710  3 -1 -1 -1
+  573  1053723  24106  14911   11  14382    -1   11  36000    -1  1 160  75 18934  3 -1 -1 -1
+  574  1053953   3057     -1   -1     -1    -1   32    300    -1  5 158  73 14713  3 -1 -1 -1
+  575  1055143      2    106    3     -1    -1    3    900    -1  5 158  73 14716  3 -1 -1 -1
+  576  1055389     12     72    3  41.67    -1    3    900    -1  1 158  73 14719  3 -1 -1 -1
+  577  1057064     10     38   16   2.19    -1   16    300    -1  1 158  73 14722  3 -1 -1 -1
+  578  1057253  30038     81   64   2.42    -1   64    300    -1  1 158  73 14725  3 -1 -1 -1
+  579  1057333  30048     73   64   2.25    -1   64    300    -1  1 158  73 14728  3 -1 -1 -1
+  580  1057969  18006   2969   32   2279    -1   32   7200    -1  1 163  75 14731  3 -1 -1 -1
+  581  1059825      2    360    8 144.62    -1    8  64800    -1  1 150   6 13592  4 -1 -1 -1
+  582  1061231     10    336    8 143.75    -1    8  64800    -1  1 150   6 13592  4 -1 -1 -1
+  583  1061247   7590  13005   32  12823    -1   32  64800    -1  1 171  75 14738  2 -1 -1 -1
+  584  1061885   6955    386    8 145.88    -1    8  64800    -1  1 150   6 13592  4 -1 -1 -1
+  585  1068797   1040  14867   11  14330    -1   11  36000    -1  1 160  75 14743  3 -1 -1 -1
+  586  1069383      8    337    8 143.62    -1    8  64800    -1  1 150   6 13592  4 -1 -1 -1
+  587  1070476  35138  44837    8  34793    -1    8  64800    -1  5 150   6 13592  4 -1 -1 -1
+  588  1070725     33  16746   11  16175    -1   11  36000    -1  1 160  75 14750  3 -1 -1 -1
+  589  1070763  17169  16654   11  16211    -1   11  36000    -1  1 160  75 18937  3 -1 -1 -1
+  590  1073175  58079     -1   -1     -1    -1   64   2700    -1  5 147  73 18941  3 -1 -1 -1
+  591  1073195  58059     -1   -1     -1    -1   64   2700    -1  5 147  73 18945  3 -1 -1 -1
+  592  1077428      8    388   10  30.30    -1   10   1800    -1  1 147  73 18949  3 -1 -1 -1
+  593  1077698   1253    734   32 126.41    -1   32  10800    -1  1 150   6 13641  2 -1 -1 -1
+  594  1077982     19     -1   -1     -1    -1   10   1800    -1  5 147  73 18953  3 -1 -1 -1
+  595  1078041   1652    376   10  27.50    -1   10   1800    -1  1 147  73 18957  3 -1 -1 -1
+  596  1078979  18883  45411    8  44999    -1    8  57600    -1  1  90  75 18961  3 -1 -1 -1
+  597  1079751      6   2157   24   1992    -1   24  21600    -1  5 133  50 14755  3 -1 -1 -1
+  598  1080326      5  25227    8  24851    -1    8  25200    -1  5  90  75 18965  3 -1 -1 -1
+  599  1081651     11   5179    1   5069    -1    1   7200    -1  1 172  77 14758  4 -1 -1 -1
+  600  1081809     41    325   10  26.80    -1   10   1800    -1  1 147  73 18969  3 -1 -1 -1
+  601  1081821     12  40553    1  38356    -1    1  57600    -1  1 153  75 18973  3 -1 -1 -1
+  602  1081871     49    109   26   3.23    -1   26   9000    -1  1 133  50 14761  3 -1 -1 -1
+  603  1082044      5     83   26   2.69    -1   26   9000    -1  1 133  50 14764  3 -1 -1 -1
+  604  1082114     10  34281    1  32828    -1    1  57600    -1  1 153  75 18977  3 -1 -1 -1
+  605  1082147     10     61   26   2.69    -1   26   9000    -1  1 133  50 14767  3 -1 -1 -1
+  606  1082294      3    358   32  28.12    -1   32   1800    -1  1 147  73 18981  3 -1 -1 -1
+  607  1082315      3     93   26   3.23    -1   26   9000    -1  1 133  50 14770  3 -1 -1 -1
+  608  1082365     50  58227    1  55249    -1    1  58200    -1  5 153  75 18984  3 -1 -1 -1
+  609  1082669      2    378   32  29.56    -1   32   1800    -1  5 147  73 18987  3 -1 -1 -1
+  610  1082851    200     56   26   2.54    -1   26   9000    -1  1 133  50 14773  3 -1 -1 -1
+  611  1083035     19   4225   26   4125    -1   26   9000    -1  1 133  50 14776  3 -1 -1 -1
+  612  1083041     13  36626    1  35370    -1    1  36600    -1  5 153  75 18990  3 -1 -1 -1
+  613  1083108    982     -1   -1     -1    -1   32   1800    -1  5 147  73 18994  3 -1 -1 -1
+  614  1083185      9   7671    1   7595    -1    1  18000    -1  1 154  75 14779  4 -1 -1 -1
+  615  1084110      6    349   29  28.14    -1   29   1800    -1  1 147  73 18998  3 -1 -1 -1
+  616  1084673   2789  14847   11  14316    -1   11  36000    -1  1 160  75 14782  3 -1 -1 -1
+  617  1085603      2     71    3  36.33    -1    3    900    -1  1 147  73 14785  3 -1 -1 -1
+  618  1086559     21     -1   -1     -1    -1   16  17400    -1  5  32  75 19002  3 -1 -1 -1
+  619  1086674    792    110   16   0.25    -1   16  17400    -1  5  32  75 19006  3 -1 -1 -1
+  620  1087318    147    872   40 788.15    -1   40  18000    -1  5 133  50 14788  3 -1 -1 -1
+  621  1087473  62955  17091   11  16327    -1   11  36000    -1  1 160  75 19010  3 -1 -1 -1
+  622  1087809      6  17499   16   0.12    -1   16  17400    -1  5  32  75 19014  3 -1 -1 -1
+  623  1087926    415   1110   32 198.50    -1   32  10800    -1  1 150   6 13641  2 -1 -1 -1
+  624  1088050   1485  23100    1  22903    -1    1  64800    -1  1 155  75 19017  3 -1 -1 -1
+  625  1088289   1170     67   40   2.83    -1   40  18000    -1  1 133  50 14793  3 -1 -1 -1
+  626  1089288   7164   1444    4 134.75    -1    4  28800    -1  5 161  75 14099  3 -1 -1 -1
+  627  1090686      3  13523   39  13342    -1   39  18000    -1  1 133  50 14796  3 -1 -1 -1
+  628  1090719     12     -1   -1     -1    -1   32  18000    -1  5 133  50 14799  3 -1 -1 -1
+  629  1091323 139241    755   64 682.30    -1   64   3600    -1  1 159  75 19023  3 -1 -1 -1
+  630  1092118    626    528    2 486.50    -1    2   1200    -1  1  34   7 14802  3 -1 -1 -1
+  631  1092145    600   1828    2   1767    -1    2   1800    -1  5  34   7 14805  3 -1 -1 -1
+  632  1092177    569    298    4 253.75    -1    4   1200    -1  1  34   7 14808  3 -1 -1 -1
+  633  1092200    547   1290    4   1226    -1    4   2400    -1  1  34   7 14813  3 -1 -1 -1
+  634  1092227    828   2428    4   2363    -1    4   2400    -1  5  34   7 14816  3 -1 -1 -1
+  635  1092248   2335    186    8 139.62    -1    8   1200    -1  1  34   7 14819  3 -1 -1 -1
+  636  1092270   2505    644    8 570.88    -1    8   1200    -1  1  34   7 14822  3 -1 -1 -1
+  637  1092292   3130   2430    8   2295    -1    8   2400    -1  5  34   7 14825  3 -1 -1 -1
+  638  1092316  13005    130   16  80.19    -1   16   1200    -1  1  34   7 14828  3 -1 -1 -1
+  639  1092334  13127    369   16 296.44    -1   16   1200    -1  1  34   7 14831  3 -1 -1 -1
+  640  1092371  13123   1499   16   1360    -1   16   2400    -1  1  34   7 14834  3 -1 -1 -1
+  641  1092617  13224  39802   32  13917    -1   32  64800    -1  5 163  75 14837  3 -1 -1 -1
+  642  1092709  57720  14972   11  14405    -1   11  36000    -1  1 160  75 19027  3 -1 -1 -1
+  643  1093742      3     34    1   4.00    -1    1    300    -1  1 173  75 14840  4 -1 -1 -1
+  644  1094694    793    959    1 865.00    -1    1   7200    -1  1 152  75 14843  3 -1 -1 -1
+  645  1094887 499257  62956   32  62490    -1   32  64800    -1  1 119  76 19031  3 -1 -1 -1
+  646  1098228      6   2306    2   2250    -1    2   3000    -1  1  34   7 14845  3 -1 -1 -1
+  647  1098228      7     24    1     -1    -1    1   7200    -1  1 152  75 14848  3 -1 -1 -1
+  648  1098329      2     30    1   2.00    -1    1   7200    -1  1 152  75 14851  3 -1 -1 -1
+  649  1098383   5838   5288    4   5180    -1    4   6000    -1  1  34   7 14854  3 -1 -1 -1
+  650  1098455   5768   2798    8   2651    -1    8   6000    -1  1  34   7 14857  3 -1 -1 -1
+  651  1098498  12374    106   32  50.66    -1   32   1200    -1  1  34   7 14860  3 -1 -1 -1
+  652  1098510  12471  61020   32  47440    -1   32  64800    -1  5   6   6 13602  3 -1 -1 -1
+  653  1098542  36943    244   32 169.72    -1   32   1200    -1  1  34   7 14865  3 -1 -1 -1
+  654  1098935     11   5111    1   5058    -1    1   7200    -1  1 172  77 14868  4 -1 -1 -1
+  655  1098949      9   5105    1   5052    -1    1   7200    -1  1 172  77 14871  4 -1 -1 -1
+  656  1098957   1588   5104    1   5054    -1    1   7200    -1  1 172  77 14874  4 -1 -1 -1
+  657  1098973   3342   5102    1   5049    -1    1   7200    -1  1 172  77 14877  4 -1 -1 -1
+  658  1098983   3333   5111    1   5055    -1    1   7200    -1  1 172  77 14880  4 -1 -1 -1
+  659  1098995   3321   5108    1   5053    -1    1   7200    -1  1 172  77 14883  4 -1 -1 -1
+  660  1099008   5050   5114    1   5062    -1    1   7200    -1  1 172  77 14886  4 -1 -1 -1
+  661  1099019   5050   5120    1   5063    -1    1   7200    -1  1 172  77 14889  4 -1 -1 -1
+  662  1099028   5196   5124    1   5068    -1    1   7200    -1  1 172  77 14892  4 -1 -1 -1
+  663  1099046   5179   5128    1   5049    -1    1   7200    -1  1 172  77 14895  4 -1 -1 -1
+  664  1099071   5155   5115    1   5071    -1    1   7200    -1  1 172  77 14898  4 -1 -1 -1
+  665  1099080   6578   5111    1   5062    -1    1   7200    -1  1 172  77 14901  4 -1 -1 -1
+  666  1099089  10088   5118    1   5068    -1    1   7200    -1  1 172  77 14904  4 -1 -1 -1
+  667  1099098  10101   5127    1   5077    -1    1   7200    -1  1 172  77 14907  4 -1 -1 -1
+  668  1099107  10242   5118    1   5064    -1    1   7200    -1  1 172  77 14910  4 -1 -1 -1
+  669  1099116  10234   5114    1   5057    -1    1   7200    -1  1 172  77 14913  4 -1 -1 -1
+  670  1099126  10236   5122    1   5070    -1    1   7200    -1  1 172  77 14916  4 -1 -1 -1
+  671  1099132  11698   5114    1   5065    -1    1   7200    -1  1 172  77 14919  4 -1 -1 -1
+  672  1099147  13609   5121    1   5064    -1    1   7200    -1  1 172  77 14922  4 -1 -1 -1
+  673  1099541  14947   5121    1   5071    -1    1   7200    -1  1 172  77 14925  4 -1 -1 -1
+  674  1099868    676   7231    1   4344    -1    1   7200    -1  5 152  75 14928  3 -1 -1 -1
+  675  1100795 103888    120   64  33.22    -1   64   1200    -1  1  34   7 14931  3 -1 -1 -1
+  676  1100835 103977    195   64 102.03    -1   64   1200    -1  1  34   7 14934  3 -1 -1 -1
+  677  1100905  34837    830   32 710.81    -1   32   3000    -1  1  34   7 14937  3 -1 -1 -1
+  678  1100937 104079    514   64 383.36    -1   64   3000    -1  1  34   7 14940  3 -1 -1 -1
+  679  1101366   2853   1269   32 237.25    -1   32  10800    -1  1 150   6 13641  2 -1 -1 -1
+  680  1102277   2315  14716   11  14259    -1   11  36000    -1  1 160  75 14945  3 -1 -1 -1
+  681  1103064 102479   1427   43   1365    -1   43  64800    -1  1  41  30 14948  3 -1 -1 -1
+  682  1103490  12458   5118    1   5067    -1    1   7200    -1  1 172  77 14951  4 -1 -1 -1
+  683  1103502  12905   5120    1   5055    -1    1   7200    -1  1 172  77 14954  4 -1 -1 -1
+  684  1103513  15848   5125    1   5071    -1    1   7200    -1  1 172  77 14957  4 -1 -1 -1
+  685  1103521  15840   5123    1   5067    -1    1   7200    -1  1 172  77 14960  4 -1 -1 -1
+  686  1104260  32321   5021   24   4936    -1   24   7200    -1  1 133  50 14963  3 -1 -1 -1
+  687  1104555  45902  17074   11  16345    -1   11  36000    -1  1 160  75 19035  3 -1 -1 -1
+  688  1105075    421    107    8   0.12    -1    8   3600    -1  5  90  75 19039  3 -1 -1 -1
+  689  1105805    973     -1   -1     -1    -1   16  39000    -1  5  32  75 19043  3 -1 -1 -1
+  690  1106150    473     -1   -1     -1    -1    2   1200    -1  5  42  75 14967  5 -1 -1 -1
+  691  1106173  13189   5120    1   5064    -1    1   7200    -1  1 172  77 14970  4 -1 -1 -1
+  692  1106181   3332   1304   32 236.06    -1   32  10800    -1  1 150   6 13641  2 -1 -1 -1
+  693  1106202  13418   5115    1   5066    -1    1   7200    -1  1 172  77 14975  4 -1 -1 -1
+  694  1106212  13474   5119    1   5064    -1    1   7200    -1  1 172  77 14978  4 -1 -1 -1
+  695  1106221  13680   5117    1   5068    -1    1   7200    -1  1 172  77 14981  4 -1 -1 -1
+  696  1106231  13671   5113    1   5068    -1    1   7200    -1  1 172  77 14984  4 -1 -1 -1
+  697  1106798  34813  39099   16   0.12    -1   16  39000    -1  5  32  75 14987  3 -1 -1 -1
+  698  1108440  13998     33    8   1.25    -1    8   3600    -1  1  90  75 19046  3 -1 -1 -1
+  699  1109426  10477   5118    1   5065    -1    1   7200    -1  1 172  77 14990  4 -1 -1 -1
+  700  1109434  11410   5128    1   5080    -1    1   7200    -1  1 172  77 14993  4 -1 -1 -1
+  701  1109447  11622   5125    1   5077    -1    1   7200    -1  1 172  77 14996  4 -1 -1 -1
+  702  1109454  12075   5115    1   5070    -1    1   7200    -1  1 172  77 14999  4 -1 -1 -1
+  703  1109462  12932   5126    1   5070    -1    1   7200    -1  1 172  77 15002  4 -1 -1 -1
+  704  1109469  13013   5136    1   5081    -1    1   7200    -1  1 172  77 15005  4 -1 -1 -1
+  705  1109478  13005   5134    1   5078    -1    1   7200    -1  1 172  77 15008  4 -1 -1 -1
+  706  1109487  12997   5144    1   5089    -1    1   7200    -1  1 172  77 15011  4 -1 -1 -1
+  707  1109494  12991   5124    1   5069    -1    1   7200    -1  1 172  77 15014  4 -1 -1 -1
+  708  1109504  12982   5120    1   5066    -1    1   7200    -1  1 172  77 15017  4 -1 -1 -1
+  709  1109729   1099     35    4   3.00    -1    4    300    -1  1  94  53 19050  1 -1 -1 -1
+  710  1110822   3759   5315    4   5184    -1    4   6000    -1  1  34   7 15020  3 -1 -1 -1
+  711  1110839   8792   2796    8   2651    -1    8   6000    -1  1  34   7 15023  3 -1 -1 -1
+  712  1110872  16979   1498   16   1360    -1   16   2400    -1  1  34   7 15026  3 -1 -1 -1
+  713  1111960   2506     65    3  33.67    -1    3    900    -1  1 147  73 19053  3 -1 -1 -1
+  714  1113407   1131     35    4   3.75    -1    4    300    -1  1  94  53 19057  1 -1 -1 -1
+  715  1114865     95     -1   -1     -1    -1   16   1200    -1  5  34   7 15029  3 -1 -1 -1
+  716  1115016  15297    106   16  19.94    -1   16   1200    -1  1  34   7 15032  3 -1 -1 -1
+  717  1115045  15386     48   16   6.75    -1   16   1200    -1  1  34   7 15035  3 -1 -1 -1
+  718  1115078  15407    107   16   0.25    -1   16   1200    -1  5  34   7 15038  3 -1 -1 -1
+  719  1115454   3862     39    3   5.00    -1    3    900    -1  1 147  73 15041  3 -1 -1 -1
+  720  1116449   2910    267    8  30.12    -1    8   7200    -1  5 163  75 15044  2 -1 -1 -1
+  721  1116616   1268  35205    1  33808    -1    1  57600    -1  1 153  75 15047  3 -1 -1 -1
+  722  1117443   1872     39    4   3.75    -1    4    300    -1  1  94  53 19060  1 -1 -1 -1
+  723  1118202  23412     38   16   0.56    -1   16  17400    -1  1 166  75 19063  3 -1 -1 -1
+  724  1119623    260     -1   -1     -1    -1    3    900    -1  5 147  73 15050  3 -1 -1 -1
+  725  1119812     88    941    1 903.00    -1    1   7200    -1  1 163  75 15053  2 -1 -1 -1
+  726  1119919   2562     74    3  44.00    -1    3    900    -1  1 147  73 19067  3 -1 -1 -1
+  727  1123041     12     62    3  32.67    -1    3    900    -1  1 147  73 15056  3 -1 -1 -1
+  728  1123760      9     68    3  37.33    -1    3    900    -1  1 147  73 15059  3 -1 -1 -1
+  729  1123940      2     67    3  37.67    -1    3    900    -1  1 147  73 15062  3 -1 -1 -1
+  730  1124295     10     36    3   5.67    -1    3    900    -1  1 147  73 15065  3 -1 -1 -1
+  731  1124656      3     35    3   5.67    -1    3    900    -1  1 147  73 15068  3 -1 -1 -1
+  732  1124719      5     35    3   5.67    -1    3    900    -1  1 147  73 15071  3 -1 -1 -1
+  733  1125120     15  22439    1  22269    -1    1  64800    -1  1 155  75 15074  3 -1 -1 -1
+  734  1125470      6    944    4 906.00    -1    4   3600    -1  1 163  75 15077  2 -1 -1 -1
+  735  1126892      1    947    8 906.25    -1    8   3600    -1  1 163  75 15080  2 -1 -1 -1
+  736  1128678    679    953   16 907.25    -1   16   3600    -1  1 163  75 15083  2 -1 -1 -1
+  737  1129572   7011  58228    1  55065    -1    1  58200    -1  5 153  75 15086  3 -1 -1 -1
+  738  1130669      8     35    3   5.67    -1    3    900    -1  1 147  73 15089  3 -1 -1 -1
+  739  1131469      3    236   16  87.94    -1   16   1800    -1  1 147  73 15092  3 -1 -1 -1
+  740  1131473  14177    267   32 118.88    -1   32   1800    -1  1 147  73 15095  3 -1 -1 -1
+  741  1131477  94230    318   64 141.94    -1   64   2700    -1  1 147  73 15098  3 -1 -1 -1
+  743  1131596    121    165   16  38.69    -1   16   1800    -1  1 147  73 15104  3 -1 -1 -1
+  744  1131601  14326    186   32  49.38    -1   32   1800    -1  1 147  73 15107  3 -1 -1 -1
+  745  1131603  94435    226   64  63.95    -1   64   2700    -1  1 147  73 15110  3 -1 -1 -1
+  747  1131672    216    157   16  32.00    -1   16   1800    -1  1 147  73 15116  3 -1 -1 -1
+  748  1131677  14443    172   32  37.53    -1   32   1800    -1  1 147  73 15119  3 -1 -1 -1
+  749  1131679  94594    220   64  60.11    -1   64   2700    -1  1 147  73 15122  3 -1 -1 -1
+  751  1138102      9     46    6   2.00    -1    6   3600    -1  1 196  83 19071  5 -1 -1 -1
+  752  1138281     11    721    6 675.17    -1    6   3600    -1  1 196  83 19074  5 -1 -1 -1
+  753  1139566     10    712    6 665.50    -1    6   3600    -1  1 196  83 19078  5 -1 -1 -1
+  754  1143733      9    381    6 335.33    -1    6   3600    -1  1 196  83 19082  5 -1 -1 -1
+  755  1146078 448076  64835   32  36619    -1   32  64800    -1  5 163  75 19086  3 -1 -1 -1
+  756  1150460  36420  38818    8  36089    -1    8  64800    -1  1 150   6 13592  4 -1 -1 -1
+  757  1160351      2    323   29  54.76    -1   29   1800    -1  1 147  73 19089  3 -1 -1 -1
+  758  1162115      6     59   32   2.78    -1   32  64800    -1  1 171  75 19093  2 -1 -1 -1
+  759  1162275      5  24025   32  23833    -1   32  64800    -1  1 171  75 19097  2 -1 -1 -1
+  760  1164039   1367     36    2   3.50    -1    2   1800    -1  1 147  73 19101  3 -1 -1 -1
+  761  1165370   6671  14825   11  14336    -1   11  36000    -1  1 160  75 19105  3 -1 -1 -1
+  762  1165714     10  57867    4  57329    -1    4  64800    -1  1 156  75 15129  3 -1 -1 -1
+  763  1165786      2     36    2   3.00    -1    2   1800    -1  1 147  73 19109  3 -1 -1 -1
+  764  1165853     10     37    2   5.00    -1    2   1800    -1  1 147  73 19113  3 -1 -1 -1
+  765  1165981     10     37    2   5.00    -1    2   1800    -1  1 147  73 19117  3 -1 -1 -1
+  766  1166117      2     33    2   3.50    -1    2   1800    -1  1 147  73 19121  3 -1 -1 -1
+  767  1166149      2     37    2   3.00    -1    2   1800    -1  1 147  73 19125  3 -1 -1 -1
+  768  1166426      1     36    3   5.67    -1    3    900    -1  1 147  73 19129  3 -1 -1 -1
+  769  1166504      9     32    4   1.75    -1    4    900    -1  1 147  73 19133  3 -1 -1 -1
+  770  1166555      1     31    4   1.75    -1    4    900    -1  1 147  73 19137  3 -1 -1 -1
+  771  1166608      2     35    3   5.67    -1    3    900    -1  1 147  73 19141  3 -1 -1 -1
+  772  1166700      6     36    3   5.67    -1    3    900    -1  1 147  73 19145  3 -1 -1 -1
+  773  1167488  18823  16789   11  16240    -1   11  36000    -1  1 160  75 19149  3 -1 -1 -1
+  774  1167500     33  16969   11  16450    -1   11  36000    -1  1 160  75 15132  3 -1 -1 -1
+  775  1167922   1242     -1   -1     -1    -1   19  16200    -1  5 133  50 15135  3 -1 -1 -1
+  776  1169142     13   3282   19   3146    -1   19   5400    -1  1 133  50 15138  3 -1 -1 -1
+  777  1169718   2288   1220    1 348.00    -1    1   7200    -1  5 152  75 15141  3 -1 -1 -1
+  778  1169820   1974     -1   -1     -1    -1   19   5400    -1  5 133  50 15144  3 -1 -1 -1
+  779  1171775     58     -1   -1     -1    -1   19   7800    -1  5 133  50 15147  3 -1 -1 -1
+  780  1171819    188     57   18   0.50    -1   18   7800    -1  5 133  50 15150  3 -1 -1 -1
+  781  1171853    155  43828    1  41343    -1    1  43800    -1  5 153  75 19153  3 -1 -1 -1
+  782  1172126    314   4704   32   4580    -1   32   5400    -1  1 133  50 15153  3 -1 -1 -1
+  783  1172505     10     -1   -1     -1    -1   32   5400    -1  5 133  50 15156  3 -1 -1 -1
+  784  1172784      7     35    2   3.50    -1    2   1800    -1  1 147  73 19157  3 -1 -1 -1
+  785  1173250     13     -1    1     -1    -1    1   7200    -1  5 152  75 15159  3 -1 -1 -1
+  786  1173562   1856  37434    1  35810    -1    1  57600    -1  1 153  75 19160  3 -1 -1 -1
+  787  1174112   1305  43830    1  41435    -1    1  43800    -1  5 153  75 19164  3 -1 -1 -1
+  788  1174945    473     33    1     -1    -1    1  17400    -1  1 166  75 19167  3 -1 -1 -1
+  789  1175640     12   4399    1 585.00    -1    1   7200    -1  1 152  75 15162  3 -1 -1 -1
+  790  1175753      5     30    1     -1    -1    1  17400    -1  1 166  75 15165  3 -1 -1 -1
+  791  1175755   5107  45398    8  44956    -1    8  57600    -1  1  90  75 19170  3 -1 -1 -1
+  792  1176135   1015     66    8  28.00    -1    8   3600    -1  1  90  75 19173  3 -1 -1 -1
+  793  1176271      7     33    2   3.50    -1    2   1800    -1  1 147  73 19176  3 -1 -1 -1
+  794  1176492      9     42    2  11.00    -1    2   1800    -1  1 147  73 19179  3 -1 -1 -1
+  795  1176510    641   3693   13   3127    -1   13  14400    -1  1 151  75 19182  3 -1 -1 -1
+  796  1177227   3623     36   28   0.32    -1   28  18000    -1  5 133  50 15168  3 -1 -1 -1
+  797  1177414      2   1728    8   1683    -1    8   3600    -1  1  90  75 19186  3 -1 -1 -1
+  798  1177423      5    186    1 152.00    -1    1  17400    -1  5 166  75 19190  3 -1 -1 -1
+  799  1177776      3   3951   15   3794    -1   15   5400    -1  1 133  50 15171  3 -1 -1 -1
+  800  1177985   1164     29    1     -1    -1    1  17400    -1  1 166  75 15174  3 -1 -1 -1
+  801  1179439      8     28    1     -1    -1    1  17400    -1  1 166  75 15177  3 -1 -1 -1
+  802  1179510   7069  50427    8  49977    -1    8  50400    -1  5  90  75 19194  3 -1 -1 -1
+  803  1179790      7    127    1  96.00    -1    1  17400    -1  5 166  75 15180  3 -1 -1 -1
+  804  1180990   1054     -1   -1     -1    -1   40  10800    -1  5 133  50 15183  3 -1 -1 -1
+  805  1181146   5164    263    8 224.75    -1    8  64800    -1  5 103  50 15186  3 -1 -1 -1
+  806  1181202      6     36    1   5.00    -1    1    300    -1  1 173  75 14840  4 -1 -1 -1
+  807  1181253      9   1166   13 862.15    -1   13  14400    -1  1 151  75 19198  3 -1 -1 -1
+  808  1181527     11     84    1  49.00    -1    1    300    -1  1 173  75 14840  4 -1 -1 -1
+  809  1182022      6  11491   32  11279    -1   32  12600    -1  1 133  50 15193  3 -1 -1 -1
+  810  1184471  22053  35969   11   3196    -1   11  36000    -1  5 160  75 19202  3 -1 -1 -1
+  811  1185179     12     51    8  12.25    -1    8   1200    -1  1  34   7 15196  3 -1 -1 -1
+  812  1185270      6    117   16  20.19    -1   16   1200    -1  1  34   7 15199  3 -1 -1 -1
+  813  1185311      9     51    4  19.00    -1    4   1200    -1  1  34   7 15202  3 -1 -1 -1
+  814  1185396     10     69    8  30.75    -1    8   1200    -1  1  34   7 15205  3 -1 -1 -1
+  815  1185442      7     90    4  57.00    -1    4   1200    -1  1  34   7 15208  3 -1 -1 -1
+  816  1185595      3    184    2  36.50    -1    2   1200    -1  1  34   7 15211  3 -1 -1 -1
+  817  1185624      7     36    2   4.50    -1    2   1200    -1  1  34   7 15214  3 -1 -1 -1
+  818  1185649      4     49    4  19.00    -1    4   1200    -1  1  34   7 15217  3 -1 -1 -1
+  819  1185656      8    324    1 275.00    -1    1    900    -1  1 159  75 15220  1 -1 -1 -1
+  820  1185669      7     46    8  12.12    -1    8   1200    -1  1  34   7 15223  3 -1 -1 -1
+  821  1185703     27     61   16   7.31    -1   16   1200    -1  1  34   7 15226  3 -1 -1 -1
+  822  1185724     71    120   16  20.62    -1   16   1200    -1  1  34   7 15229  3 -1 -1 -1
+  823  1185752    173     66    8  29.62    -1    8   1200    -1  1  34   7 15232  3 -1 -1 -1
+  824  1185807    507     65   32   5.22    -1   32   1200    -1  1  34   7 15235  3 -1 -1 -1
+  825  1185907    588    111   32  13.31    -1   32   1200    -1  1  34   7 15238  3 -1 -1 -1
+  826  1185915      9     35    4   2.50    -1    4    480    -1  1  27   7 15241  2 -1 -1 -1
+  827  1185942    669    317   32  67.16    -1   32   1200    -1  1  34   7 15244  3 -1 -1 -1
+  828  1186005      6    106    8  70.88    -1    8   3600    -1  1 159  75 15247  1 -1 -1 -1
+  829  1186331     57     98    8  64.88    -1    8   3600    -1  1 159  75 15250  1 -1 -1 -1
+  830  1186331      3     90    4  56.75    -1    4   1200    -1  1  34   7 15253  3 -1 -1 -1
+  831  1186496     11   1237    2 592.00    -1    2   1200    -1  5  34   7 15256  3 -1 -1 -1
+  832  1186515      4    159    2  35.50    -1    2   1200    -1  1  34   7 15259  3 -1 -1 -1
+  833  1186587  17822     97   64   4.12    -1   64   1200    -1  1  34   7 15262  2 -1 -1 -1
+  834  1186676  17840    157   64  10.30    -1   64   1200    -1  1  34   7 15265  2 -1 -1 -1
+  835  1186835  64880  14888   11  14312    -1   11  36000    -1  1 160  75 19206  3 -1 -1 -1
+  836  1186845     33    132    4  94.25    -1    4    900    -1  1 159  75 15268  1 -1 -1 -1
+  837  1186863     16    191    2 150.00    -1    2    900    -1  1 159  75 15271  1 -1 -1 -1
+  838  1186890     44    830   32 711.56    -1   32   1200    -1  1  34   7 15274  3 -1 -1 -1
+  839  1186907   4182  12328   13  10840    -1   13  14400    -1  1 151  75 19210  3 -1 -1 -1
+  840  1186910    862    245   32 170.38    -1   32   1200    -1  1  34   7 15277  3 -1 -1 -1
+  841  1186932   1096    106   32  50.56    -1   32   1200    -1  1  34   7 15280  3 -1 -1 -1
+  842  1187244     10   1285    4   1227    -1    4   2400    -1  1  34   7 15283  3 -1 -1 -1
+  843  1187474      4    181    2 147.50    -1    2    900    -1  1 159  75 15286  1 -1 -1 -1
+  844  1187676  64035  64838   32  44627    -1   32  64800    -1  5   6   6 13602  3 -1 -1 -1
+  845  1188120      5    264    4 217.00    -1    4    900    -1  1 159  75 15291  1 -1 -1 -1
+  846  1188330     10     37    4   2.25    -1    4    480    -1  1  27   7 15294  2 -1 -1 -1
+  847  1188345      6    643    1 550.00    -1    1    900    -1  1 159  75 15297  1 -1 -1 -1
+  848  1188536      7    734    8 695.75    -1    8   2400    -1  1 103  50 15300  3 -1 -1 -1
+  849  1188633      7   1371   23   1322    -1   23   3600    -1  1  41  30 19214  3 -1 -1 -1
+  850  1188820      2    384    2 338.50    -1    2    900    -1  1 159  75 15303  1 -1 -1 -1
+  851  1188930     10   5747    1   5467    -1    1  17400    -1  5 166  75 19218  3 -1 -1 -1
+  852  1189261      8    201    8 162.50    -1    8   3600    -1  1 159  75 15306  1 -1 -1 -1
+  853  1189491      2  61229    7  58519    -1    7  61200    -1  5 173  75 15698  4 -1 -1 -1
+  854  1189678    146     30    4   0.25    -1    4  64500    -1  1 162  75 19225  4 -1 -1 -1
+  855  1189816      7     31    5   0.20    -1    5  64800    -1  5 162  75 19229  1 -1 -1 -1
+  856  1190004      2    106    8   0.12    -1    8   1800    -1  5 103  50 15309  3 -1 -1 -1
+  857  1190223     11   1748    8   1668    -1    8   1800    -1  5 103  50 15312  3 -1 -1 -1
+  858  1191082      6     32    5   0.40    -1    5  64800    -1  1 162  75 19232  1 -1 -1 -1
+  859  1191981      6    196    8 158.88    -1    8   3600    -1  1 159  75 15315  1 -1 -1 -1
+  860  1192027      3   1317    8   1273    -1    8   1800    -1  1 103  50 15318  3 -1 -1 -1
+  861  1192823    707   4391   24   4301    -1   24   7200    -1  1 133  50 15321  3 -1 -1 -1
+  862  1193306     10     32    2   2.00    -1    2    300    -1  1 158  73 15324  3 -1 -1 -1
+  863  1193857     14     47    3   5.67    -1    3    900    -1  1 158  73 15327  3 -1 -1 -1
+  864  1194390   3535     47   32   2.62    -1   32    300    -1  1 158  73 15330  3 -1 -1 -1
+  865  1194457      7    249    8 163.88    -1    8   3600    -1  1 159  75 15333  1 -1 -1 -1
+  866  1194732    857    615    4 576.00    -1    4  17400    -1  1 166  75 15336  3 -1 -1 -1
+  867  1194826      9    242    8 164.62    -1    8   3600    -1  1 159  75 15338  1 -1 -1 -1
+  868  1194883   3097     64   32   5.25    -1   32   1200    -1  1  34   7 15341  3 -1 -1 -1
+  869  1194902   3149    104   32  13.12    -1   32   1200    -1  1  34   7 15344  3 -1 -1 -1
+  870  1194922   3249    307   32  66.75    -1   32   1200    -1  1  34   7 15347  3 -1 -1 -1
+  871  1195007  31495    382   64  43.06    -1   64   1200    -1  1  34   7 15350  3 -1 -1 -1
+  872  1195166     11    383    2 338.00    -1    2    900    -1  1 159  75 15353  1 -1 -1 -1
+  873  1195519     10    604    4 341.00    -1    4   1200    -1  1  34   7 15356  3 -1 -1 -1
+  874  1195574      4     37    4   4.75    -1    4   1200    -1  5  34   7 15359  3 -1 -1 -1
+  875  1195605      6    106    4     -1    -1    4   1200    -1  5  34   7 15362  3 -1 -1 -1
+  876  1195628      5    107    4     -1    -1    4   1200    -1  5  34   7 15365  3 -1 -1 -1
+  877  1195647      9    588    9 178.78    -1    9   1200    -1  1  34   7 15368  3 -1 -1 -1
+  878  1195663     78   1114    9 631.11    -1    9   1200    -1  1  34   7 15371  3 -1 -1 -1
+  879  1195776    360    583    4 338.75    -1    4   1200    -1  1  34   7 15374  3 -1 -1 -1
+  880  1195963   7142  58399    8  57910    -1    8  64800    -1  1 103  50 15377  3 -1 -1 -1
+  881  1198020   1053     -1   -1     -1    -1   19   7800    -1  5 133  50 15380  3 -1 -1 -1
+  882  1198783      5  60364    1  57562    -1    1  61800    -1  1 153  75 15383  3 -1 -1 -1
+  883  1199058      8   4242   48   4135    -1   48   4200    -1  5 133  50 15386  3 -1 -1 -1
+  884  1199079   4241    107    9   0.22    -1    9   1200    -1  5  34   7 15389  3 -1 -1 -1
+  885  1199111   4210    597    9 179.00    -1    9   1200    -1  1  34   7 15392  3 -1 -1 -1
+  886  1199153   4169   1082    9 631.33    -1    9   1200    -1  1  34   7 15395  3 -1 -1 -1
+  887  1199180   4143    592   16 118.38    -1   16   1200    -1  1  34   7 15398  3 -1 -1 -1
+  888  1199212   6334    854   16 380.81    -1   16   1200    -1  1  34   7 15401  3 -1 -1 -1
+  889  1199236   7168    108   16   0.25    -1   16   1200    -1  5  34   7 15404  3 -1 -1 -1
+  890  1199434     75     -1   -1     -1    -1   43   1800    -1  5  41  30 19236  3 -1 -1 -1
+  891  1199475   3631    617    4 574.50    -1    4  17400    -1  1 166  75 19240  3 -1 -1 -1
+  892  1201360   5621  13696   32  13503    -1   32  14400    -1  1 133  50 15407  3 -1 -1 -1
+  893  1203069   3453  17028   11  16258    -1   11  36000    -1  1 160  75 15410  3 -1 -1 -1
+  894  1206743  44971  64834   13  62621    -1   13  64800    -1  5 151  75 15413  3 -1 -1 -1
+  895  1214335      4    108    2     -1    -1    2   3300    -1  5 162  75 19244  4 -1 -1 -1
+  896  1214516      4     31    4   0.25    -1    4  64500    -1  1 162  75 19247  4 -1 -1 -1
+  897  1214542     16    105    2     -1    -1    2   3300    -1  5 162  75 19251  4 -1 -1 -1
+  898  1214627      6    106    2     -1    -1    2   3300    -1  5 162  75 19255  4 -1 -1 -1
+  899  1214896      3    105    2     -1    -1    2   3300    -1  5 162  75 19258  4 -1 -1 -1
+  900  1215091     11    104    2     -1    -1    2   3300    -1  5 162  75 19262  4 -1 -1 -1
+  901  1215306      8    104    2     -1    -1    2    300    -1  5 162  75 19265  4 -1 -1 -1
+  902  1215560      9    104    2     -1    -1    2    300    -1  5 162  75 19268  4 -1 -1 -1
+  903  1215652      2    105    2     -1    -1    2    300    -1  5 162  75 19272  4 -1 -1 -1
+  904  1216062      6  34315    4  32818    -1    4  64500    -1  1 162  75 19275  4 -1 -1 -1
+  905  1217705      5     35    2   3.50    -1    2    300    -1  1 158  73 15416  3 -1 -1 -1
+  906  1218193      5     33    2   3.50    -1    2   1800    -1  1 147  73 15419  3 -1 -1 -1
+  907  1218233      9     32    2   3.50    -1    2   1800    -1  1 147  73 15422  3 -1 -1 -1
+  908  1218280      5     41    2  11.00    -1    2   1800    -1  1 147  73 15425  3 -1 -1 -1
+  909  1218395      7     32    2   2.50    -1    2   1800    -1  1 147  73 15428  3 -1 -1 -1
+  910  1223518  28198  16934   11  16244    -1   11  36000    -1  1 160  75 19279  3 -1 -1 -1
+  911  1236581  45682  39585    8  37262    -1    8  64800    -1  5 150   6 13592  4 -1 -1 -1
+  912  1241761      4    227   64  64.67    -1   64   2700    -1  1 147  73 15433  3 -1 -1 -1
+  913  1241767    233    191   64  34.14    -1   64   2700    -1  1 147  73 15436  3 -1 -1 -1
+  914  1241773    426    188   64  34.64    -1   64   2700    -1  1 147  73 15439  3 -1 -1 -1
+  915  1241779    618    191   64  33.89    -1   64   2700    -1  1 147  73 15442  3 -1 -1 -1
+  916  1241786    810    190   64  31.97    -1   64   2700    -1  1 147  73 15445  3 -1 -1 -1
+  917  1241792   1008    198   64  43.17    -1   64   2700    -1  1 147  73 15448  3 -1 -1 -1
+  918  1241799   1209    216   64  54.19    -1   64   2700    -1  1 147  73 15450  3 -1 -1 -1
+  919  1242333    899    211   64  45.41    -1   64   2700    -1  1 147  73 15453  3 -1 -1 -1
+  921  1244297      9    208   16  75.88    -1   16   1800    -1  1 147  73 19282  3 -1 -1 -1
+  922  1244309      9    207   32  68.91    -1   32   1800    -1  1 147  73 19285  3 -1 -1 -1
+  923  1249490      8  45633    1  43894    -1    1  57600    -1  1 153  75 15458  3 -1 -1 -1
+  924  1250024      3  18787    1  17642    -1    1  43800    -1  1 153  75 15461  3 -1 -1 -1
+  925  1250313     75  46380    1  43824    -1    1  47400    -1  1 153  75 15464  3 -1 -1 -1
+  926  1253016     12    246   32 102.12    -1   32   1800    -1  1 147  73 19288  3 -1 -1 -1
+  927  1253601      8    242   32 101.72    -1   32   1800    -1  1 147  73 19291  3 -1 -1 -1
+  928  1254296      2    182   32  10.41    -1   32   1800    -1  5 147  73 19294  3 -1 -1 -1
+  929  1254443     42    359   32  82.28    -1   32   1800    -1  1 147  73 19298  3 -1 -1 -1
+  930  1260740      3    218   16  77.94    -1   16   1800    -1  1 147  73 15467  3 -1 -1 -1
+  931  1264171     11  50429    8  50029    -1    8  50400    -1  5  90  75 19302  3 -1 -1 -1
+  932  1266572     10  14848   11  14351    -1   11  36000    -1  1 160  75 15469  3 -1 -1 -1
+  933  1266906      5   3628    8   3565    -1    8   3600    -1  5  90  75 19306  3 -1 -1 -1
+  934  1267827      4   3629    8   3564    -1    8   3600    -1  5  90  75 19310  3 -1 -1 -1
+  935  1268619      6  16775   11  16218    -1   11  36000    -1  1 160  75 19314  3 -1 -1 -1
+  936  1273325     12   4207   32   4108    -1   32   7200    -1  1 133  50 15472  3 -1 -1 -1
+  937  1275715   1838   5903   32   5794    -1   32   7200    -1  1 133  50 15475  3 -1 -1 -1
+  938  1276632   5588  58122    4  57664    -1    4  64800    -1  1 156  75 15478  3 -1 -1 -1
+  939  1281337   9149     -1   -1     -1    -1   43   1800    -1  5  41  30 19317  3 -1 -1 -1
+  940  1282082  14464  63458    4  60424    -1    4  64500    -1  1 162  75 15481  4 -1 -1 -1
+  941  1282217      2     37   10   0.30    -1   10  64800    -1  5 162  75 15483  2 -1 -1 -1
+  942  1282336      2     76    1  43.00    -1    1  64800    -1  5 162  75 15486  2 -1 -1 -1
+  943  1283598      4  13721   32  13512    -1   32  14400    -1  1 133  50 15489  3 -1 -1 -1
+  944  1287837     21     -1   -1     -1    -1   32   7200    -1  5 133  50 15492  3 -1 -1 -1
+  945  1290496   6879     47   43   0.40    -1   43   1800    -1  1  41  30 19320  3 -1 -1 -1
+  946  1296537      9     37   10   0.30    -1   10  64800    -1  5 162  75 15495  2 -1 -1 -1
+  947  1296811     10     30   13   0.23    -1   13   1800    -1  5  41  30 15498  2 -1 -1 -1
+  948  1296851      3     33   13   0.38    -1   13   1800    -1  1  41  30 15501  3 -1 -1 -1
+  949  1297320     10     33   13   0.38    -1   13   1800    -1  1  41  30 15504  3 -1 -1 -1
+  950  1298037      3   5715   32   5630    -1   32   7200    -1  1 133  50 15507  3 -1 -1 -1
+  951  1301045      5    608   11 281.55    -1   11  36000    -1  1 160  75 15510  3 -1 -1 -1
+  952  1301197  20665  16101    4  15974    -1    4  64800    -1  1 155  75 15513  3 -1 -1 -1
+  953  1301626     38  16721   11  16209    -1   11  36000    -1  1 160  75 19323  3 -1 -1 -1
+  954  1304453 922561     -1   -1     -1    -1   63  43200    -1  5 131  20 19326  4 -1 -1 -1
+  955  1316948   5188  61227    8  60763    -1    8  61200    -1  5 103  50 15516  3 -1 -1 -1
+  956  1318354   3783  16788   11  16230    -1   11  36000    -1  1 160  75 15519  3 -1 -1 -1
+  957  1322044     94   5310    8   4956    -1    8  64800    -1  5 150   6 13592  3 -1 -1 -1
+  958  1328141      2  35961    8  34382    -1    8  64800    -1  1 150   6 13592  3 -1 -1 -1
+  959  1335593 434909     -1   -1     -1    -1   32  64800    -1  5   6   6 13602  3 -1 -1 -1
+  960  1338894      3  16745   11  16210    -1   11  36000    -1  1 160  75 15526  3 -1 -1 -1
+  961  1343751     11    221    1   6.00    -1    1  43800    -1  1 153  75 15529  3 -1 -1 -1
+  962  1343972      2  47429    1  45193    -1    1  47400    -1  5 153  75 15532  3 -1 -1 -1
+  963  1344047     12  50416    1  47847    -1    1  61800    -1  1 153  75 15535  3 -1 -1 -1
+  964  1348333      2    189   16  49.50    -1   16   1800    -1  1 147  73 15538  3 -1 -1 -1
+  965  1348337  11670    228   32  82.28    -1   32   1800    -1  1 147  73 15541  3 -1 -1 -1
+  966  1348342  38685    259   64 100.75    -1   64   2700    -1  1 147  73 15544  3 -1 -1 -1
+  968  1355611   4633  16764   11  16227    -1   11  36000    -1  1 160  75 15550  3 -1 -1 -1
+  969  1357094      6     52    2  22.00    -1    2    900    -1  1 177  73 15553  3 -1 -1 -1
+  970  1357255      4     44    2  13.50    -1    2    900    -1  1 177  73 15556  3 -1 -1 -1
+  971  1357313     11     51    2  22.00    -1    2    900    -1  1 177  73 15559  3 -1 -1 -1
+  972  1358513      4     52    2  21.50    -1    2    900    -1  1 177  73 15562  3 -1 -1 -1
+  973  1359991      5     51    2  22.00    -1    2    900    -1  1 147  73 19333  3 -1 -1 -1
+  974  1360119      6     43    2  13.50    -1    2    900    -1  1 147  73 19337  3 -1 -1 -1
+  975  1360215     35  60629    4  57910    -1    4  64500    -1  1 162  75 19341  4 -1 -1 -1
+  976  1360286     18     -1   -1     -1    -1   50   1200    -1  5 162  75 19345  2 -1 -1 -1
+  977  1364782      4  57881    4  57430    -1    4  64800    -1  1 156  75 15565  3 -1 -1 -1
+  979  1370752      9   1289    2   1245    -1    2  14400    -1  1 161  75 15568  3 -1 -1 -1
+  980  1371174     11  62597   13  61157    -1   13  64800    -1  1 151  75 19353  3 -1 -1 -1
+  981  1372308      7     33    8   0.50    -1    8  36000    -1  5 161  75 19357  3 -1 -1 -1
+  982  1372419      8   9622    8   9243    -1    8  36000    -1  1 161  75 15568  3 -1 -1 -1
+  983  1374009      6    261    2 194.00    -1    2    600    -1  5  15  75 15571  3 -1 -1 -1
+  984  1374334      9    287    1 254.00    -1    1    600    -1  5  15  75 15574  3 -1 -1 -1
+  985  1374823      7     53    1  24.00    -1    1    600    -1  1  15  75 15577  3 -1 -1 -1
+  986  1375515      2     53    1  24.00    -1    1    600    -1  1  15  75 15580  3 -1 -1 -1
+  987  1376235     11    312    1 279.00    -1    1    600    -1  5  15  75 15583  3 -1 -1 -1
+  988  1376971      5     70    1  41.00    -1    1    600    -1  1  15  75 15586  3 -1 -1 -1
+  989  1377968      2     57    1  24.00    -1    1    600    -1  1  15  75 15589  3 -1 -1 -1
+  990  1378580      3     54    1  24.00    -1    1    600    -1  1  15  75 15592  3 -1 -1 -1
+  991  1379286      5     56    1  26.00    -1    1    600    -1  1  15  75 15595  3 -1 -1 -1
+  992  1381058      8     56    1  26.00    -1    1    600    -1  1  15  75 15598  3 -1 -1 -1
+  993  1381200      4    290    1 259.00    -1    1    600    -1  1  15  75 15601  3 -1 -1 -1
+  994  1391005   7246  46540    8  46182    -1    8  64800    -1  1 103  50 15604  3 -1 -1 -1
+  995  1395272      5   1753    2   1689    -1    2  14400    -1  1 161  75 19364  3 -1 -1 -1
+  996  1398233      6     32    6   0.33    -1    6   3600    -1  5 196  83 19367  5 -1 -1 -1
+  997  1398371      7   1459    6   1408    -1    6   3600    -1  1 196  83 19370  5 -1 -1 -1
+  998  1400018      7    458    6 412.67    -1    6   3600    -1  1 196  83 19374  5 -1 -1 -1
+  999  1400760      5    542    6 497.50    -1    6   3600    -1  1 196  83 19378  5 -1 -1 -1
+ 1000  1402264      1     64   12   2.25    -1   12   3600    -1  1 196  83 19382  5 -1 -1 -1
Index: DCWoRMS/trunk/example/workgen/workload30/GeneratorConfig.xml
===================================================================
--- DCWoRMS/trunk/example/workgen/workload30/GeneratorConfig.xml	(revision 477)
+++ DCWoRMS/trunk/example/workgen/workload30/GeneratorConfig.xml	(revision 477)
@@ -0,0 +1,26 @@
+<tns:WorkloadConfiguration 
+	xmlns:tns="http://www.man.poznan.pl/WorkloadSchema" 
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ 
+  	<SimulationStartTime>2009-01-15T10:00:00</SimulationStartTime>
+ 
+	<JobCount avg="1000" distribution="constant"/>
+ 
+	<TaskCount avg="1" distribution="constant"/>
+ 
+	<TaskLength avg="14400" min="10800" max="18000" stdev="3600.0" distribution="normal"/>
+ 
+	<JobPackageLength avg="1.0" min="1.0" max="1.0" stdev="0.0" distribution="constant"/>
+ 
+	<JobInterval avg="100" min="0" max="130" stdev="30" distribution="poisson" seed="21"/>
+	
+	<ComputingResourceHostParameter metric="cpucount">
+		<value id="cpucnt">
+	  		<MultiDistribution>
+      			<dist avg="1" min="1" max="1" stdev="0" distribution="uniform">0.95</dist>
+     		 	<dist avg="4" min="4" max="4" stdev="0" distribution="uniform">0.05</dist>
+   			</MultiDistribution>
+   		</value>	
+	</ComputingResourceHostParameter>
+ 
+</tns:WorkloadConfiguration>
Index: DCWoRMS/trunk/example/workgen/workload30/workload.swf
===================================================================
--- DCWoRMS/trunk/example/workgen/workload30/workload.swf	(revision 477)
+++ DCWoRMS/trunk/example/workgen/workload30/workload.swf	(revision 477)
@@ -0,0 +1,1116 @@
+;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|
+;PUSpeed: 1
+;StartTime: Thu Jan 15 10:00:00 CET 2009
+		0		81		-1		14291		1		-1		-1		1		14291		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		1		174		-1		11578		1		-1		-1		1		11578		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		2		266		-1		11825		1		-1		-1		1		11825		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		3		370		-1		17157		4		-1		-1		4		17157		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		4		478		-1		14361		1		-1		-1		1		14361		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		5		570		-1		17237		1		-1		-1		1		17237		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		6		665		-1		14240		1		-1		-1		1		14240		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		7		772		-1		14190		1		-1		-1		1		14190		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		8		871		-1		16760		1		-1		-1		1		16760		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		9		969		-1		11996		1		-1		-1		1		11996		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		10		1076		-1		14635		1		-1		-1		1		14635		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		11		1164		-1		10983		1		-1		-1		1		10983		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		12		1277		-1		14640		1		-1		-1		1		14640		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		13		1387		-1		13713		1		-1		-1		1		13713		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		14		1495		-1		11990		1		-1		-1		1		11990		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		15		1590		-1		13504		1		-1		-1		1		13504		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		16		1697		-1		13805		1		-1		-1		1		13805		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		17		1803		-1		10961		1		-1		-1		1		10961		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		18		1907		-1		14458		1		-1		-1		1		14458		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		19		2024		-1		17883		1		-1		-1		1		17883		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		20		2118		-1		13965		1		-1		-1		1		13965		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		21		2211		-1		17100		1		-1		-1		1		17100		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		22		2304		-1		14090		1		-1		-1		1		14090		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		23		2395		-1		14839		1		-1		-1		1		14839		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		24		2506		-1		13449		1		-1		-1		1		13449		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		25		2595		-1		11258		1		-1		-1		1		11258		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		26		2700		-1		12595		1		-1		-1		1		12595		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		27		2800		-1		11024		1		-1		-1		1		11024		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		28		2887		-1		16712		1		-1		-1		1		16712		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		29		2993		-1		11263		1		-1		-1		1		11263		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		30		3083		-1		12495		1		-1		-1		1		12495		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		31		3191		-1		11583		1		-1		-1		1		11583		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		32		3289		-1		12114		1		-1		-1		1		12114		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		33		3390		-1		15447		1		-1		-1		1		15447		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		34		3487		-1		17754		1		-1		-1		1		17754		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		35		3581		-1		12154		1		-1		-1		1		12154		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		36		3678		-1		11254		1		-1		-1		1		11254		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		37		3776		-1		13744		1		-1		-1		1		13744		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		38		3879		-1		17175		1		-1		-1		1		17175		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		39		3973		-1		15720		1		-1		-1		1		15720		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		40		4057		-1		14908		1		-1		-1		1		14908		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		41		4158		-1		12552		1		-1		-1		1		12552		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		42		4244		-1		11269		1		-1		-1		1		11269		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		43		4356		-1		17966		1		-1		-1		1		17966		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		44		4450		-1		17973		4		-1		-1		4		17973		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		45		4537		-1		14385		1		-1		-1		1		14385		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		46		4635		-1		15115		1		-1		-1		1		15115		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		47		4729		-1		12645		1		-1		-1		1		12645		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		48		4825		-1		12848		1		-1		-1		1		12848		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		49		4924		-1		13720		1		-1		-1		1		13720		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		50		5036		-1		13437		1		-1		-1		1		13437		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		51		5139		-1		13994		1		-1		-1		1		13994		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		52		5216		-1		11580		1		-1		-1		1		11580		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		53		5295		-1		11981		1		-1		-1		1		11981		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		54		5407		-1		14555		1		-1		-1		1		14555		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		55		5505		-1		17385		1		-1		-1		1		17385		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		56		5615		-1		11479		1		-1		-1		1		11479		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		57		5709		-1		12559		1		-1		-1		1		12559		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		58		5806		-1		15321		1		-1		-1		1		15321		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		59		5915		-1		13382		1		-1		-1		1		13382		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		60		6018		-1		15403		1		-1		-1		1		15403		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		61		6103		-1		15074		1		-1		-1		1		15074		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		62		6214		-1		14217		1		-1		-1		1		14217		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		63		6311		-1		13119		1		-1		-1		1		13119		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		64		6409		-1		14512		1		-1		-1		1		14512		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		65		6522		-1		14134		1		-1		-1		1		14134		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		66		6620		-1		12014		1		-1		-1		1		12014		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		67		6724		-1		14425		1		-1		-1		1		14425		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		68		6821		-1		12763		1		-1		-1		1		12763		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		69		6923		-1		12467		1		-1		-1		1		12467		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		70		7036		-1		13187		1		-1		-1		1		13187		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		71		7140		-1		16844		1		-1		-1		1		16844		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		72		7244		-1		13258		1		-1		-1		1		13258		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		73		7335		-1		17969		1		-1		-1		1		17969		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		74		7419		-1		15457		1		-1		-1		1		15457		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		75		7516		-1		14226		1		-1		-1		1		14226		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		76		7604		-1		15451		1		-1		-1		1		15451		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		77		7715		-1		11395		1		-1		-1		1		11395		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		78		7825		-1		12222		1		-1		-1		1		12222		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		79		7934		-1		13757		1		-1		-1		1		13757		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		80		8034		-1		13674		1		-1		-1		1		13674		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		81		8140		-1		14910		1		-1		-1		1		14910		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		82		8221		-1		12128		4		-1		-1		4		12128		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		83		8316		-1		13744		1		-1		-1		1		13744		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		84		8409		-1		12482		1		-1		-1		1		12482		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		85		8506		-1		14682		1		-1		-1		1		14682		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		86		8618		-1		15960		1		-1		-1		1		15960		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		87		8730		-1		12775		1		-1		-1		1		12775		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		88		8836		-1		14710		1		-1		-1		1		14710		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		89		8951		-1		11480		1		-1		-1		1		11480		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		90		9057		-1		17458		1		-1		-1		1		17458		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		91		9146		-1		17150		1		-1		-1		1		17150		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		92		9227		-1		13247		1		-1		-1		1		13247		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		93		9325		-1		11906		1		-1		-1		1		11906		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		94		9419		-1		11987		1		-1		-1		1		11987		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		95		9523		-1		15699		1		-1		-1		1		15699		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		96		9628		-1		12224		1		-1		-1		1		12224		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		97		9725		-1		16755		1		-1		-1		1		16755		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		98		9817		-1		16795		1		-1		-1		1		16795		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		99		9908		-1		15406		1		-1		-1		1		15406		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		100		9996		-1		15587		1		-1		-1		1		15587		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		101		10094		-1		16678		4		-1		-1		4		16678		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		102		10195		-1		16161		4		-1		-1		4		16161		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		103		10276		-1		12820		4		-1		-1		4		12820		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		104		10374		-1		11602		1		-1		-1		1		11602		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		105		10469		-1		15075		1		-1		-1		1		15075		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		106		10565		-1		13696		1		-1		-1		1		13696		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		107		10667		-1		17600		1		-1		-1		1		17600		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		108		10768		-1		14490		1		-1		-1		1		14490		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		109		10883		-1		13845		1		-1		-1		1		13845		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		110		10970		-1		17008		1		-1		-1		1		17008		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		111		11062		-1		13096		1		-1		-1		1		13096		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		112		11163		-1		13820		1		-1		-1		1		13820		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		113		11251		-1		16977		1		-1		-1		1		16977		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		114		11354		-1		14699		1		-1		-1		1		14699		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		115		11451		-1		14322		1		-1		-1		1		14322		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		116		11566		-1		11958		1		-1		-1		1		11958		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		117		11673		-1		13055		1		-1		-1		1		13055		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		118		11775		-1		16174		1		-1		-1		1		16174		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		119		11881		-1		16074		1		-1		-1		1		16074		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		120		11986		-1		15613		1		-1		-1		1		15613		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		121		12084		-1		12960		1		-1		-1		1		12960		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		122		12189		-1		12289		1		-1		-1		1		12289		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		123		12285		-1		14419		1		-1		-1		1		14419		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		124		12376		-1		17875		1		-1		-1		1		17875		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		125		12463		-1		15054		1		-1		-1		1		15054		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		126		12568		-1		15248		1		-1		-1		1		15248		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		127		12672		-1		16910		1		-1		-1		1		16910		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		128		12761		-1		13170		1		-1		-1		1		13170		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		129		12857		-1		12673		1		-1		-1		1		12673		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		130		12957		-1		16052		1		-1		-1		1		16052		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		131		13059		-1		13025		1		-1		-1		1		13025		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		132		13159		-1		14269		1		-1		-1		1		14269		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		133		13253		-1		11729		1		-1		-1		1		11729		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		134		13355		-1		15354		1		-1		-1		1		15354		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		135		13438		-1		12622		1		-1		-1		1		12622		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		136		13530		-1		15543		1		-1		-1		1		15543		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		137		13632		-1		17081		1		-1		-1		1		17081		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		138		13735		-1		15259		1		-1		-1		1		15259		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		139		13829		-1		16125		1		-1		-1		1		16125		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		140		13936		-1		16005		1		-1		-1		1		16005		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		141		14022		-1		15587		1		-1		-1		1		15587		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		142		14116		-1		17328		1		-1		-1		1		17328		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		143		14218		-1		14462		1		-1		-1		1		14462		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		144		14313		-1		11522		1		-1		-1		1		11522		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		145		14423		-1		13928		1		-1		-1		1		13928		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		146		14520		-1		14107		1		-1		-1		1		14107		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		147		14614		-1		16557		1		-1		-1		1		16557		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		148		14711		-1		11731		1		-1		-1		1		11731		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		149		14826		-1		17645		1		-1		-1		1		17645		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		150		14913		-1		12455		1		-1		-1		1		12455		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		151		15030		-1		13708		1		-1		-1		1		13708		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		152		15154		-1		13325		4		-1		-1		4		13325		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		153		15282		-1		17083		1		-1		-1		1		17083		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		154		15385		-1		17533		1		-1		-1		1		17533		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		155		15480		-1		13542		1		-1		-1		1		13542		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		156		15570		-1		17482		1		-1		-1		1		17482		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		157		15671		-1		15302		1		-1		-1		1		15302		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		158		15783		-1		17576		4		-1		-1		4		17576		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		159		15878		-1		10819		1		-1		-1		1		10819		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		160		16003		-1		12121		1		-1		-1		1		12121		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		161		16111		-1		17329		1		-1		-1		1		17329		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		162		16197		-1		12543		1		-1		-1		1		12543		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		163		16297		-1		13896		1		-1		-1		1		13896		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		164		16392		-1		16970		1		-1		-1		1		16970		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		165		16499		-1		14920		1		-1		-1		1		14920		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		166		16599		-1		12567		1		-1		-1		1		12567		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		167		16688		-1		17366		1		-1		-1		1		17366		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		168		16785		-1		15905		1		-1		-1		1		15905		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		169		16876		-1		17291		1		-1		-1		1		17291		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		170		16976		-1		13140		1		-1		-1		1		13140		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		171		17069		-1		12477		1		-1		-1		1		12477		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		172		17162		-1		17478		1		-1		-1		1		17478		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		173		17265		-1		13231		1		-1		-1		1		13231		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		174		17365		-1		15916		1		-1		-1		1		15916		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		175		17454		-1		17353		4		-1		-1		4		17353		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		176		17547		-1		14549		4		-1		-1		4		14549		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		177		17646		-1		12597		1		-1		-1		1		12597		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		178		17760		-1		15416		1		-1		-1		1		15416		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		179		17863		-1		14498		1		-1		-1		1		14498		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		180		17960		-1		17673		1		-1		-1		1		17673		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		181		18060		-1		17376		4		-1		-1		4		17376		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		182		18175		-1		16865		1		-1		-1		1		16865		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		183		18274		-1		13269		1		-1		-1		1		13269		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		184		18356		-1		17773		1		-1		-1		1		17773		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		185		18466		-1		16596		1		-1		-1		1		16596		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		186		18579		-1		17590		1		-1		-1		1		17590		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		187		18664		-1		14689		1		-1		-1		1		14689		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		188		18752		-1		11148		1		-1		-1		1		11148		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		189		18840		-1		14075		1		-1		-1		1		14075		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		190		18944		-1		12221		1		-1		-1		1		12221		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		191		19042		-1		16848		1		-1		-1		1		16848		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		192		19141		-1		16840		1		-1		-1		1		16840		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		193		19252		-1		10842		1		-1		-1		1		10842		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		194		19350		-1		12105		1		-1		-1		1		12105		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		195		19458		-1		14429		1		-1		-1		1		14429		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		196		19546		-1		12638		1		-1		-1		1		12638		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		197		19643		-1		11748		1		-1		-1		1		11748		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		198		19734		-1		15548		1		-1		-1		1		15548		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		199		19831		-1		12706		1		-1		-1		1		12706		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		200		19934		-1		13756		1		-1		-1		1		13756		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		201		20020		-1		13213		1		-1		-1		1		13213		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		202		20128		-1		11787		1		-1		-1		1		11787		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		203		20227		-1		13790		1		-1		-1		1		13790		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		204		20341		-1		14222		1		-1		-1		1		14222		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		205		20438		-1		11794		1		-1		-1		1		11794		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		206		20535		-1		12946		1		-1		-1		1		12946		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		207		20615		-1		13313		1		-1		-1		1		13313		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		208		20692		-1		13337		1		-1		-1		1		13337		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		209		20807		-1		13415		1		-1		-1		1		13415		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		210		20901		-1		15048		1		-1		-1		1		15048		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		211		21013		-1		12170		4		-1		-1		4		12170		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		212		21131		-1		17626		1		-1		-1		1		17626		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		213		21241		-1		16242		1		-1		-1		1		16242		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		214		21332		-1		11369		1		-1		-1		1		11369		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		215		21427		-1		15147		4		-1		-1		4		15147		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		216		21531		-1		15947		4		-1		-1		4		15947		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		217		21637		-1		16581		1		-1		-1		1		16581		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		218		21750		-1		16832		1		-1		-1		1		16832		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		219		21856		-1		11634		1		-1		-1		1		11634		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		220		21944		-1		11563		1		-1		-1		1		11563		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		221		22056		-1		11339		1		-1		-1		1		11339		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		222		22153		-1		15210		1		-1		-1		1		15210		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		223		22219		-1		11685		1		-1		-1		1		11685		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		224		22319		-1		15725		1		-1		-1		1		15725		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		225		22410		-1		13285		1		-1		-1		1		13285		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		226		22521		-1		11644		1		-1		-1		1		11644		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		227		22608		-1		14882		1		-1		-1		1		14882		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		228		22695		-1		13178		1		-1		-1		1		13178		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		229		22815		-1		10974		1		-1		-1		1		10974		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		230		22917		-1		16433		1		-1		-1		1		16433		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		231		23020		-1		17565		1		-1		-1		1		17565		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		232		23110		-1		15676		1		-1		-1		1		15676		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		233		23207		-1		14011		1		-1		-1		1		14011		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		234		23290		-1		15051		1		-1		-1		1		15051		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		235		23374		-1		15998		1		-1		-1		1		15998		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		236		23465		-1		12162		1		-1		-1		1		12162		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		237		23549		-1		15059		1		-1		-1		1		15059		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		238		23659		-1		17135		1		-1		-1		1		17135		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		239		23771		-1		12565		1		-1		-1		1		12565		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		240		23871		-1		13841		1		-1		-1		1		13841		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		241		23960		-1		17485		1		-1		-1		1		17485		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		242		24083		-1		13826		1		-1		-1		1		13826		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		243		24172		-1		16578		1		-1		-1		1		16578		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		244		24269		-1		11219		1		-1		-1		1		11219		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		245		24372		-1		11394		1		-1		-1		1		11394		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		246		24458		-1		16772		1		-1		-1		1		16772		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		247		24543		-1		16478		1		-1		-1		1		16478		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		248		24636		-1		10849		1		-1		-1		1		10849		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		249		24748		-1		12750		1		-1		-1		1		12750		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		250		24859		-1		14661		1		-1		-1		1		14661		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		251		24950		-1		12277		1		-1		-1		1		12277		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		252		25030		-1		17727		1		-1		-1		1		17727		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		253		25128		-1		16162		1		-1		-1		1		16162		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		254		25234		-1		15381		1		-1		-1		1		15381		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		255		25350		-1		11304		1		-1		-1		1		11304		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		256		25473		-1		16406		1		-1		-1		1		16406		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		257		25574		-1		17650		1		-1		-1		1		17650		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		258		25659		-1		15139		1		-1		-1		1		15139		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		259		25760		-1		13216		1		-1		-1		1		13216		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		260		25869		-1		16206		1		-1		-1		1		16206		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		261		25967		-1		13372		1		-1		-1		1		13372		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		262		26078		-1		16040		1		-1		-1		1		16040		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		263		26165		-1		17209		1		-1		-1		1		17209		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		264		26248		-1		17667		1		-1		-1		1		17667		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		265		26350		-1		15424		1		-1		-1		1		15424		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		266		26458		-1		17848		1		-1		-1		1		17848		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		267		26564		-1		14888		1		-1		-1		1		14888		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		268		26657		-1		16830		1		-1		-1		1		16830		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		269		26764		-1		14006		1		-1		-1		1		14006		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		270		26884		-1		15100		1		-1		-1		1		15100		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		271		26987		-1		16313		1		-1		-1		1		16313		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		272		27083		-1		15490		1		-1		-1		1		15490		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		273		27190		-1		16589		1		-1		-1		1		16589		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		274		27276		-1		13633		1		-1		-1		1		13633		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		275		27365		-1		16986		1		-1		-1		1		16986		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		276		27465		-1		11699		1		-1		-1		1		11699		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		277		27573		-1		16979		1		-1		-1		1		16979		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		278		27667		-1		14190		1		-1		-1		1		14190		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		279		27755		-1		13570		1		-1		-1		1		13570		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		280		27873		-1		17372		1		-1		-1		1		17372		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		281		27965		-1		13477		1		-1		-1		1		13477		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		282		28059		-1		17025		1		-1		-1		1		17025		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		283		28168		-1		12605		1		-1		-1		1		12605		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		284		28281		-1		17783		1		-1		-1		1		17783		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		285		28364		-1		12653		1		-1		-1		1		12653		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		286		28451		-1		13503		1		-1		-1		1		13503		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		287		28538		-1		17036		1		-1		-1		1		17036		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		288		28646		-1		13539		1		-1		-1		1		13539		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		289		28744		-1		17637		1		-1		-1		1		17637		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		290		28840		-1		14921		1		-1		-1		1		14921		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		291		28941		-1		14037		1		-1		-1		1		14037		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		292		29027		-1		12313		1		-1		-1		1		12313		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		293		29127		-1		16710		1		-1		-1		1		16710		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		294		29215		-1		12705		1		-1		-1		1		12705		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		295		29305		-1		12524		1		-1		-1		1		12524		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		296		29404		-1		14472		1		-1		-1		1		14472		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		297		29502		-1		12454		1		-1		-1		1		12454		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		298		29593		-1		16154		1		-1		-1		1		16154		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		299		29684		-1		11901		1		-1		-1		1		11901		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		300		29795		-1		15454		1		-1		-1		1		15454		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		301		29887		-1		12713		1		-1		-1		1		12713		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		302		29994		-1		11393		1		-1		-1		1		11393		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		303		30108		-1		13700		1		-1		-1		1		13700		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		304		30207		-1		14848		1		-1		-1		1		14848		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		305		30299		-1		17908		1		-1		-1		1		17908		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		306		30411		-1		14197		1		-1		-1		1		14197		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		307		30512		-1		12297		1		-1		-1		1		12297		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		308		30611		-1		10880		1		-1		-1		1		10880		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		309		30706		-1		16675		1		-1		-1		1		16675		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		310		30803		-1		14312		1		-1		-1		1		14312		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		311		30895		-1		12902		1		-1		-1		1		12902		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		312		30986		-1		16105		4		-1		-1		4		16105		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		313		31083		-1		15434		1		-1		-1		1		15434		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		314		31172		-1		12540		1		-1		-1		1		12540		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		315		31261		-1		11162		1		-1		-1		1		11162		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		316		31383		-1		11109		1		-1		-1		1		11109		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		317		31482		-1		14163		1		-1		-1		1		14163		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		318		31595		-1		12088		1		-1		-1		1		12088		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		319		31691		-1		11602		1		-1		-1		1		11602		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		320		31783		-1		13961		1		-1		-1		1		13961		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		321		31873		-1		13343		1		-1		-1		1		13343		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		322		31971		-1		11984		1		-1		-1		1		11984		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		323		32069		-1		14495		1		-1		-1		1		14495		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		324		32164		-1		16049		1		-1		-1		1		16049		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		325		32265		-1		13662		1		-1		-1		1		13662		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		326		32362		-1		12687		1		-1		-1		1		12687		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		327		32468		-1		16891		1		-1		-1		1		16891		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		328		32564		-1		16061		1		-1		-1		1		16061		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		329		32648		-1		15397		1		-1		-1		1		15397		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		330		32746		-1		17823		1		-1		-1		1		17823		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		331		32851		-1		13978		1		-1		-1		1		13978		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		332		32959		-1		16429		1		-1		-1		1		16429		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		333		33053		-1		13735		1		-1		-1		1		13735		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		334		33145		-1		14242		1		-1		-1		1		14242		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		335		33251		-1		15368		1		-1		-1		1		15368		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		336		33371		-1		12464		1		-1		-1		1		12464		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		337		33462		-1		15774		1		-1		-1		1		15774		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		338		33550		-1		17954		1		-1		-1		1		17954		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		339		33649		-1		14493		1		-1		-1		1		14493		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		340		33741		-1		12046		1		-1		-1		1		12046		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		341		33841		-1		12131		1		-1		-1		1		12131		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		342		33943		-1		13157		1		-1		-1		1		13157		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		343		34043		-1		12011		1		-1		-1		1		12011		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		344		34157		-1		15885		1		-1		-1		1		15885		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		345		34254		-1		12334		1		-1		-1		1		12334		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		346		34350		-1		12343		1		-1		-1		1		12343		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		347		34457		-1		13411		1		-1		-1		1		13411		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		348		34560		-1		13194		1		-1		-1		1		13194		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		349		34658		-1		11004		1		-1		-1		1		11004		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		350		34753		-1		15611		1		-1		-1		1		15611		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		351		34842		-1		14469		1		-1		-1		1		14469		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		352		34940		-1		15459		4		-1		-1		4		15459		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		353		35038		-1		12501		1		-1		-1		1		12501		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		354		35128		-1		17183		1		-1		-1		1		17183		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		355		35228		-1		15594		1		-1		-1		1		15594		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		356		35341		-1		17096		1		-1		-1		1		17096		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		357		35450		-1		14660		1		-1		-1		1		14660		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		358		35544		-1		12328		1		-1		-1		1		12328		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		359		35650		-1		15399		4		-1		-1		4		15399		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		360		35734		-1		15394		1		-1		-1		1		15394		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		361		35834		-1		12359		1		-1		-1		1		12359		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		362		35926		-1		15706		1		-1		-1		1		15706		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		363		36042		-1		15309		1		-1		-1		1		15309		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		364		36146		-1		17420		1		-1		-1		1		17420		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		365		36233		-1		15073		1		-1		-1		1		15073		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		366		36340		-1		12296		1		-1		-1		1		12296		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		367		36442		-1		11914		1		-1		-1		1		11914		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		368		36552		-1		16173		1		-1		-1		1		16173		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		369		36636		-1		15076		1		-1		-1		1		15076		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		370		36741		-1		17959		1		-1		-1		1		17959		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		371		36833		-1		15986		1		-1		-1		1		15986		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		372		36918		-1		12666		1		-1		-1		1		12666		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		373		37019		-1		11130		1		-1		-1		1		11130		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		374		37120		-1		13713		1		-1		-1		1		13713		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		375		37226		-1		14466		1		-1		-1		1		14466		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		376		37325		-1		13536		1		-1		-1		1		13536		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		377		37434		-1		12108		1		-1		-1		1		12108		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		378		37550		-1		17354		1		-1		-1		1		17354		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		379		37639		-1		13815		1		-1		-1		1		13815		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		380		37747		-1		17941		1		-1		-1		1		17941		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		381		37854		-1		12897		1		-1		-1		1		12897		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		382		37961		-1		13827		1		-1		-1		1		13827		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		383		38067		-1		17020		4		-1		-1		4		17020		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		384		38170		-1		12800		1		-1		-1		1		12800		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		385		38275		-1		13692		1		-1		-1		1		13692		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		386		38401		-1		15875		1		-1		-1		1		15875		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		387		38493		-1		16748		1		-1		-1		1		16748		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		388		38587		-1		13028		1		-1		-1		1		13028		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		389		38700		-1		12618		1		-1		-1		1		12618		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		390		38777		-1		15054		1		-1		-1		1		15054		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		391		38850		-1		12464		1		-1		-1		1		12464		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		392		38961		-1		13907		1		-1		-1		1		13907		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		393		39060		-1		11022		1		-1		-1		1		11022		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		394		39152		-1		15609		1		-1		-1		1		15609		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		395		39263		-1		16482		1		-1		-1		1		16482		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		396		39353		-1		17732		4		-1		-1		4		17732		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		397		39450		-1		14883		1		-1		-1		1		14883		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		398		39543		-1		15153		1		-1		-1		1		15153		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		399		39640		-1		11206		1		-1		-1		1		11206		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		400		39748		-1		15220		1		-1		-1		1		15220		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		401		39867		-1		16058		1		-1		-1		1		16058		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		402		39979		-1		17286		1		-1		-1		1		17286		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		403		40072		-1		11273		1		-1		-1		1		11273		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		404		40182		-1		12165		1		-1		-1		1		12165		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		405		40290		-1		12182		1		-1		-1		1		12182		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		406		40404		-1		14580		1		-1		-1		1		14580		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		407		40500		-1		13965		1		-1		-1		1		13965		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		408		40617		-1		17219		1		-1		-1		1		17219		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		409		40710		-1		11202		1		-1		-1		1		11202		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		410		40813		-1		14586		1		-1		-1		1		14586		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		411		40932		-1		15606		1		-1		-1		1		15606		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		412		41046		-1		14414		1		-1		-1		1		14414		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		413		41134		-1		12695		1		-1		-1		1		12695		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		414		41234		-1		11055		1		-1		-1		1		11055		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		415		41343		-1		15797		1		-1		-1		1		15797		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		416		41446		-1		17544		1		-1		-1		1		17544		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		417		41547		-1		17374		1		-1		-1		1		17374		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		418		41650		-1		16301		1		-1		-1		1		16301		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		419		41739		-1		15795		1		-1		-1		1		15795		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		420		41832		-1		13506		1		-1		-1		1		13506		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		421		41939		-1		12634		1		-1		-1		1		12634		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		422		42033		-1		11745		1		-1		-1		1		11745		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		423		42131		-1		17196		1		-1		-1		1		17196		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		424		42239		-1		15044		1		-1		-1		1		15044		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		425		42342		-1		13283		1		-1		-1		1		13283		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		426		42442		-1		12270		1		-1		-1		1		12270		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		427		42554		-1		11584		1		-1		-1		1		11584		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		428		42647		-1		15000		1		-1		-1		1		15000		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		429		42728		-1		16638		1		-1		-1		1		16638		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		430		42839		-1		13187		1		-1		-1		1		13187		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		431		42945		-1		14784		1		-1		-1		1		14784		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		432		43038		-1		15565		1		-1		-1		1		15565		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		433		43151		-1		17705		1		-1		-1		1		17705		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		434		43254		-1		14818		1		-1		-1		1		14818		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		435		43360		-1		16029		1		-1		-1		1		16029		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		436		43460		-1		15421		1		-1		-1		1		15421		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		437		43553		-1		13637		1		-1		-1		1		13637		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		438		43645		-1		14108		1		-1		-1		1		14108		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		439		43746		-1		13521		1		-1		-1		1		13521		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		440		43841		-1		16218		1		-1		-1		1		16218		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		441		43936		-1		15632		1		-1		-1		1		15632		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		442		44017		-1		14777		1		-1		-1		1		14777		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		443		44106		-1		10861		4		-1		-1		4		10861		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		444		44217		-1		17560		1		-1		-1		1		17560		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		445		44320		-1		15542		1		-1		-1		1		15542		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		446		44415		-1		11335		1		-1		-1		1		11335		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		447		44515		-1		15216		1		-1		-1		1		15216		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		448		44625		-1		11414		1		-1		-1		1		11414		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		449		44727		-1		15709		1		-1		-1		1		15709		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		450		44826		-1		14748		1		-1		-1		1		14748		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		451		44918		-1		16098		1		-1		-1		1		16098		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		452		45048		-1		14880		1		-1		-1		1		14880		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		453		45143		-1		14607		1		-1		-1		1		14607		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		454		45240		-1		12190		1		-1		-1		1		12190		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		455		45343		-1		13708		1		-1		-1		1		13708		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		456		45450		-1		11737		1		-1		-1		1		11737		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		457		45549		-1		16898		4		-1		-1		4		16898		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		458		45651		-1		16389		1		-1		-1		1		16389		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		459		45751		-1		15839		1		-1		-1		1		15839		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		460		45835		-1		14518		1		-1		-1		1		14518		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		461		45927		-1		13970		1		-1		-1		1		13970		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		462		46030		-1		17570		1		-1		-1		1		17570		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		463		46133		-1		11060		1		-1		-1		1		11060		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		464		46239		-1		17108		1		-1		-1		1		17108		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		465		46346		-1		14398		1		-1		-1		1		14398		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		466		46449		-1		12570		1		-1		-1		1		12570		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		467		46556		-1		12825		1		-1		-1		1		12825		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		468		46681		-1		11504		4		-1		-1		4		11504		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		469		46771		-1		13580		1		-1		-1		1		13580		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		470		46883		-1		12769		4		-1		-1		4		12769		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		471		46981		-1		11908		1		-1		-1		1		11908		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		472		47103		-1		16674		1		-1		-1		1		16674		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		473		47210		-1		15486		1		-1		-1		1		15486		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		474		47323		-1		15811		1		-1		-1		1		15811		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		475		47430		-1		13230		1		-1		-1		1		13230		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		476		47539		-1		15281		1		-1		-1		1		15281		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		477		47646		-1		11646		1		-1		-1		1		11646		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		478		47764		-1		15393		1		-1		-1		1		15393		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		479		47866		-1		17152		1		-1		-1		1		17152		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		480		47973		-1		16410		1		-1		-1		1		16410		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		481		48071		-1		14303		1		-1		-1		1		14303		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		482		48158		-1		14720		1		-1		-1		1		14720		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		483		48255		-1		13719		1		-1		-1		1		13719		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		484		48360		-1		12750		1		-1		-1		1		12750		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		485		48467		-1		10953		4		-1		-1		4		10953		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		486		48563		-1		10940		1		-1		-1		1		10940		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		487		48655		-1		11700		1		-1		-1		1		11700		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		488		48757		-1		13789		1		-1		-1		1		13789		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		489		48861		-1		14036		1		-1		-1		1		14036		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		490		48965		-1		16230		1		-1		-1		1		16230		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		491		49050		-1		15407		1		-1		-1		1		15407		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		492		49147		-1		15429		4		-1		-1		4		15429		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		493		49231		-1		16256		1		-1		-1		1		16256		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		494		49340		-1		12155		1		-1		-1		1		12155		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		495		49438		-1		16847		1		-1		-1		1		16847		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		496		49536		-1		14259		1		-1		-1		1		14259		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		497		49632		-1		15036		1		-1		-1		1		15036		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		498		49740		-1		17459		1		-1		-1		1		17459		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		499		49819		-1		11444		1		-1		-1		1		11444		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		500		49917		-1		13551		1		-1		-1		1		13551		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		501		50034		-1		14963		1		-1		-1		1		14963		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		502		50126		-1		16126		1		-1		-1		1		16126		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		503		50212		-1		17766		1		-1		-1		1		17766		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		504		50302		-1		16235		1		-1		-1		1		16235		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		505		50394		-1		14545		1		-1		-1		1		14545		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		506		50484		-1		17834		1		-1		-1		1		17834		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		507		50599		-1		14738		1		-1		-1		1		14738		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		508		50687		-1		16790		1		-1		-1		1		16790		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		509		50799		-1		14246		1		-1		-1		1		14246		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		510		50898		-1		15128		1		-1		-1		1		15128		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		511		50986		-1		17423		1		-1		-1		1		17423		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		512		51080		-1		14390		1		-1		-1		1		14390		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		513		51178		-1		13346		4		-1		-1		4		13346		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		514		51268		-1		16758		1		-1		-1		1		16758		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		515		51357		-1		14424		1		-1		-1		1		14424		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		516		51446		-1		16177		1		-1		-1		1		16177		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		517		51556		-1		13540		1		-1		-1		1		13540		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		518		51651		-1		14638		1		-1		-1		1		14638		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		519		51747		-1		15626		1		-1		-1		1		15626		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		520		51839		-1		14729		1		-1		-1		1		14729		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		521		51956		-1		16776		1		-1		-1		1		16776		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		522		52063		-1		15664		1		-1		-1		1		15664		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		523		52152		-1		10841		4		-1		-1		4		10841		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		524		52259		-1		16871		1		-1		-1		1		16871		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		525		52356		-1		16442		4		-1		-1		4		16442		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		526		52451		-1		11986		1		-1		-1		1		11986		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		527		52560		-1		15652		1		-1		-1		1		15652		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		528		52653		-1		17006		1		-1		-1		1		17006		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		529		52755		-1		17631		1		-1		-1		1		17631		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		530		52865		-1		17094		4		-1		-1		4		17094		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		531		52971		-1		17148		1		-1		-1		1		17148		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		532		53055		-1		14861		1		-1		-1		1		14861		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		533		53157		-1		17679		4		-1		-1		4		17679		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		534		53257		-1		13691		1		-1		-1		1		13691		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		535		53361		-1		13310		1		-1		-1		1		13310		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		536		53467		-1		16723		1		-1		-1		1		16723		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		537		53556		-1		14164		1		-1		-1		1		14164		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		538		53660		-1		12124		1		-1		-1		1		12124		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		539		53759		-1		11358		1		-1		-1		1		11358		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		540		53858		-1		15672		1		-1		-1		1		15672		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		541		53959		-1		11477		1		-1		-1		1		11477		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		542		54056		-1		14648		1		-1		-1		1		14648		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		543		54152		-1		17044		1		-1		-1		1		17044		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		544		54256		-1		10973		1		-1		-1		1		10973		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		545		54341		-1		13638		1		-1		-1		1		13638		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		546		54431		-1		12440		1		-1		-1		1		12440		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		547		54546		-1		11509		1		-1		-1		1		11509		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		548		54630		-1		14329		1		-1		-1		1		14329		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		549		54731		-1		14575		1		-1		-1		1		14575		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		550		54831		-1		11556		1		-1		-1		1		11556		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		551		54922		-1		13628		1		-1		-1		1		13628		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		552		55032		-1		11686		1		-1		-1		1		11686		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		553		55144		-1		16344		1		-1		-1		1		16344		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		554		55256		-1		17172		1		-1		-1		1		17172		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		555		55344		-1		15096		1		-1		-1		1		15096		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		556		55423		-1		11956		4		-1		-1		4		11956		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		557		55520		-1		16063		1		-1		-1		1		16063		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		558		55615		-1		12668		1		-1		-1		1		12668		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		559		55735		-1		11298		1		-1		-1		1		11298		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		560		55820		-1		11666		1		-1		-1		1		11666		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		561		55916		-1		16653		1		-1		-1		1		16653		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		562		56032		-1		10811		1		-1		-1		1		10811		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		563		56143		-1		14995		1		-1		-1		1		14995		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		564		56250		-1		13729		1		-1		-1		1		13729		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		565		56372		-1		15045		1		-1		-1		1		15045		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		566		56463		-1		11610		1		-1		-1		1		11610		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		567		56566		-1		16037		1		-1		-1		1		16037		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		568		56656		-1		15531		1		-1		-1		1		15531		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		569		56774		-1		12130		1		-1		-1		1		12130		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		570		56885		-1		11113		1		-1		-1		1		11113		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		571		56982		-1		15706		1		-1		-1		1		15706		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		572		57069		-1		14178		4		-1		-1		4		14178		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		573		57159		-1		14496		1		-1		-1		1		14496		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		574		57255		-1		13480		1		-1		-1		1		13480		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		575		57356		-1		17445		1		-1		-1		1		17445		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		576		57465		-1		12961		1		-1		-1		1		12961		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		577		57576		-1		17294		1		-1		-1		1		17294		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		578		57673		-1		16071		1		-1		-1		1		16071		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		579		57767		-1		13936		1		-1		-1		1		13936		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		580		57856		-1		15038		1		-1		-1		1		15038		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		581		57966		-1		14516		1		-1		-1		1		14516		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		582		58067		-1		13870		1		-1		-1		1		13870		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		583		58168		-1		14863		1		-1		-1		1		14863		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		584		58267		-1		11474		1		-1		-1		1		11474		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		585		58381		-1		10928		1		-1		-1		1		10928		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		586		58482		-1		17989		1		-1		-1		1		17989		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		587		58582		-1		15076		1		-1		-1		1		15076		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		588		58696		-1		14533		1		-1		-1		1		14533		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		589		58794		-1		16055		1		-1		-1		1		16055		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		590		58899		-1		14604		1		-1		-1		1		14604		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		591		58999		-1		16034		1		-1		-1		1		16034		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		592		59099		-1		11026		1		-1		-1		1		11026		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		593		59194		-1		16283		1		-1		-1		1		16283		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		594		59281		-1		14114		1		-1		-1		1		14114		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		595		59388		-1		17179		1		-1		-1		1		17179		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		596		59498		-1		14293		1		-1		-1		1		14293		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		597		59590		-1		12332		1		-1		-1		1		12332		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		598		59707		-1		13693		1		-1		-1		1		13693		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		599		59816		-1		15327		1		-1		-1		1		15327		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		600		59927		-1		10884		1		-1		-1		1		10884		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		601		60035		-1		12409		1		-1		-1		1		12409		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		602		60128		-1		16479		1		-1		-1		1		16479		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		603		60223		-1		16869		1		-1		-1		1		16869		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		604		60343		-1		14633		1		-1		-1		1		14633		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		605		60450		-1		14388		1		-1		-1		1		14388		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		606		60551		-1		13281		1		-1		-1		1		13281		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		607		60639		-1		12896		1		-1		-1		1		12896		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		608		60738		-1		14089		1		-1		-1		1		14089		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		609		60852		-1		17968		1		-1		-1		1		17968		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		610		60962		-1		15851		1		-1		-1		1		15851		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		611		61077		-1		16567		1		-1		-1		1		16567		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		612		61177		-1		11038		1		-1		-1		1		11038		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		613		61289		-1		13682		1		-1		-1		1		13682		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		614		61385		-1		13656		1		-1		-1		1		13656		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		615		61491		-1		16737		1		-1		-1		1		16737		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		616		61590		-1		16208		1		-1		-1		1		16208		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		617		61679		-1		12260		1		-1		-1		1		12260		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		618		61786		-1		14968		1		-1		-1		1		14968		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		619		61879		-1		14729		1		-1		-1		1		14729		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		620		61961		-1		15774		1		-1		-1		1		15774		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		621		62059		-1		17307		1		-1		-1		1		17307		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		622		62158		-1		16693		1		-1		-1		1		16693		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		623		62258		-1		14493		1		-1		-1		1		14493		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		624		62363		-1		11386		1		-1		-1		1		11386		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		625		62470		-1		17452		1		-1		-1		1		17452		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		626		62560		-1		12428		1		-1		-1		1		12428		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		627		62676		-1		15603		1		-1		-1		1		15603		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		628		62775		-1		13023		1		-1		-1		1		13023		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		629		62873		-1		11794		1		-1		-1		1		11794		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		630		62980		-1		16367		1		-1		-1		1		16367		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		631		63080		-1		17050		1		-1		-1		1		17050		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		632		63171		-1		16435		1		-1		-1		1		16435		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		633		63274		-1		13062		1		-1		-1		1		13062		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		634		63368		-1		13413		1		-1		-1		1		13413		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		635		63463		-1		14672		1		-1		-1		1		14672		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		636		63551		-1		13591		1		-1		-1		1		13591		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		637		63646		-1		11397		1		-1		-1		1		11397		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		638		63760		-1		10913		1		-1		-1		1		10913		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		639		63881		-1		12881		1		-1		-1		1		12881		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		640		64005		-1		16296		1		-1		-1		1		16296		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		641		64104		-1		11042		1		-1		-1		1		11042		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		642		64221		-1		17387		1		-1		-1		1		17387		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		643		64323		-1		11911		1		-1		-1		1		11911		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		644		64442		-1		12448		1		-1		-1		1		12448		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		645		64536		-1		15615		1		-1		-1		1		15615		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		646		64628		-1		14103		4		-1		-1		4		14103		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		647		64725		-1		11810		1		-1		-1		1		11810		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		648		64819		-1		17762		1		-1		-1		1		17762		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		649		64919		-1		14946		1		-1		-1		1		14946		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		650		65019		-1		13133		1		-1		-1		1		13133		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		651		65126		-1		15138		1		-1		-1		1		15138		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		652		65234		-1		15472		1		-1		-1		1		15472		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		653		65329		-1		16716		1		-1		-1		1		16716		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		654		65428		-1		14488		1		-1		-1		1		14488		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		655		65519		-1		11611		1		-1		-1		1		11611		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		656		65613		-1		11136		1		-1		-1		1		11136		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		657		65710		-1		17943		1		-1		-1		1		17943		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		658		65818		-1		13226		1		-1		-1		1		13226		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		659		65918		-1		12368		1		-1		-1		1		12368		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		660		66010		-1		13720		1		-1		-1		1		13720		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		661		66108		-1		15346		1		-1		-1		1		15346		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		662		66205		-1		16608		1		-1		-1		1		16608		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		663		66305		-1		12799		1		-1		-1		1		12799		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		664		66406		-1		13970		1		-1		-1		1		13970		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		665		66507		-1		12659		1		-1		-1		1		12659		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		666		66620		-1		14561		1		-1		-1		1		14561		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		667		66715		-1		15913		1		-1		-1		1		15913		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		668		66815		-1		13422		1		-1		-1		1		13422		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		669		66911		-1		13458		1		-1		-1		1		13458		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		670		66994		-1		17081		1		-1		-1		1		17081		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		671		67081		-1		15111		1		-1		-1		1		15111		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		672		67180		-1		12054		1		-1		-1		1		12054		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		673		67265		-1		11643		1		-1		-1		1		11643		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		674		67368		-1		14097		1		-1		-1		1		14097		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		675		67462		-1		17437		1		-1		-1		1		17437		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		676		67558		-1		17886		1		-1		-1		1		17886		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		677		67666		-1		16915		1		-1		-1		1		16915		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		678		67768		-1		11944		1		-1		-1		1		11944		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		679		67861		-1		17976		1		-1		-1		1		17976		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		680		67959		-1		13227		1		-1		-1		1		13227		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		681		68058		-1		14578		1		-1		-1		1		14578		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		682		68143		-1		12650		1		-1		-1		1		12650		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		683		68260		-1		15807		1		-1		-1		1		15807		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		684		68367		-1		12920		4		-1		-1		4		12920		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		685		68471		-1		12699		1		-1		-1		1		12699		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		686		68595		-1		12843		1		-1		-1		1		12843		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		687		68699		-1		12499		1		-1		-1		1		12499		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		688		68803		-1		11652		1		-1		-1		1		11652		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		689		68901		-1		15954		1		-1		-1		1		15954		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		690		69000		-1		11918		1		-1		-1		1		11918		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		691		69091		-1		15950		1		-1		-1		1		15950		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		692		69188		-1		15681		1		-1		-1		1		15681		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		693		69293		-1		12602		1		-1		-1		1		12602		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		694		69384		-1		14356		1		-1		-1		1		14356		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		695		69496		-1		15459		4		-1		-1		4		15459		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		696		69618		-1		12175		1		-1		-1		1		12175		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		697		69713		-1		17990		1		-1		-1		1		17990		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		698		69804		-1		16379		1		-1		-1		1		16379		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		699		69897		-1		16997		4		-1		-1		4		16997		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		700		70013		-1		13232		1		-1		-1		1		13232		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		701		70125		-1		17141		1		-1		-1		1		17141		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		702		70221		-1		12219		1		-1		-1		1		12219		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		703		70310		-1		14965		1		-1		-1		1		14965		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		704		70403		-1		17941		1		-1		-1		1		17941		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		705		70516		-1		11094		1		-1		-1		1		11094		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		706		70622		-1		16123		1		-1		-1		1		16123		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		707		70712		-1		17025		1		-1		-1		1		17025		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		708		70800		-1		14624		1		-1		-1		1		14624		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		709		70898		-1		15113		1		-1		-1		1		15113		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		710		70998		-1		16554		4		-1		-1		4		16554		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		711		71095		-1		14795		1		-1		-1		1		14795		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		712		71188		-1		14705		1		-1		-1		1		14705		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		713		71275		-1		14949		1		-1		-1		1		14949		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		714		71380		-1		12058		1		-1		-1		1		12058		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		715		71474		-1		12621		1		-1		-1		1		12621		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		716		71577		-1		17057		1		-1		-1		1		17057		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		717		71672		-1		15854		1		-1		-1		1		15854		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		718		71786		-1		11521		1		-1		-1		1		11521		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		719		71887		-1		15107		1		-1		-1		1		15107		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		720		71983		-1		15084		1		-1		-1		1		15084		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		721		72076		-1		15456		1		-1		-1		1		15456		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		722		72185		-1		17689		1		-1		-1		1		17689		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		723		72296		-1		13100		1		-1		-1		1		13100		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		724		72392		-1		11663		1		-1		-1		1		11663		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		725		72493		-1		12427		1		-1		-1		1		12427		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		726		72602		-1		13302		1		-1		-1		1		13302		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		727		72711		-1		11180		1		-1		-1		1		11180		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		728		72818		-1		15919		1		-1		-1		1		15919		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		729		72919		-1		16579		1		-1		-1		1		16579		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		730		73033		-1		17592		1		-1		-1		1		17592		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		731		73131		-1		12959		1		-1		-1		1		12959		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		732		73213		-1		12921		1		-1		-1		1		12921		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		733		73320		-1		15859		1		-1		-1		1		15859		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		734		73417		-1		15465		1		-1		-1		1		15465		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		735		73533		-1		13312		1		-1		-1		1		13312		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		736		73641		-1		15980		1		-1		-1		1		15980		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		737		73738		-1		11589		1		-1		-1		1		11589		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		738		73844		-1		14279		1		-1		-1		1		14279		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		739		73940		-1		11872		1		-1		-1		1		11872		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		740		74024		-1		15042		1		-1		-1		1		15042		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		741		74121		-1		11857		1		-1		-1		1		11857		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		742		74235		-1		13389		1		-1		-1		1		13389		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		743		74341		-1		15901		1		-1		-1		1		15901		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		744		74460		-1		17553		1		-1		-1		1		17553		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		745		74565		-1		11664		1		-1		-1		1		11664		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		746		74670		-1		13104		1		-1		-1		1		13104		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		747		74754		-1		13072		1		-1		-1		1		13072		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		748		74858		-1		12664		1		-1		-1		1		12664		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		749		74966		-1		14743		4		-1		-1		4		14743		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		750		75072		-1		15121		1		-1		-1		1		15121		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		751		75154		-1		12799		1		-1		-1		1		12799		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		752		75250		-1		13830		1		-1		-1		1		13830		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		753		75347		-1		14960		4		-1		-1		4		14960		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		754		75438		-1		15503		1		-1		-1		1		15503		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		755		75538		-1		15944		1		-1		-1		1		15944		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		756		75615		-1		17600		1		-1		-1		1		17600		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		757		75719		-1		15097		1		-1		-1		1		15097		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		758		75810		-1		12211		1		-1		-1		1		12211		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		759		75901		-1		15352		1		-1		-1		1		15352		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		760		75998		-1		12730		1		-1		-1		1		12730		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		761		76108		-1		16325		1		-1		-1		1		16325		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		762		76221		-1		13047		1		-1		-1		1		13047		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		763		76311		-1		14437		1		-1		-1		1		14437		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		764		76412		-1		16340		1		-1		-1		1		16340		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		765		76510		-1		13731		1		-1		-1		1		13731		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		766		76605		-1		15836		1		-1		-1		1		15836		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		767		76708		-1		15267		1		-1		-1		1		15267		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		768		76805		-1		16217		1		-1		-1		1		16217		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		769		76906		-1		11887		1		-1		-1		1		11887		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		770		77022		-1		14505		4		-1		-1		4		14505		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		771		77119		-1		14474		1		-1		-1		1		14474		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		772		77221		-1		16059		1		-1		-1		1		16059		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		773		77326		-1		15024		1		-1		-1		1		15024		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		774		77428		-1		15502		1		-1		-1		1		15502		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		775		77498		-1		16200		1		-1		-1		1		16200		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		776		77587		-1		12810		1		-1		-1		1		12810		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		777		77687		-1		13326		1		-1		-1		1		13326		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		778		77778		-1		16815		1		-1		-1		1		16815		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		779		77887		-1		14031		1		-1		-1		1		14031		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		780		77983		-1		17709		1		-1		-1		1		17709		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		781		78075		-1		16204		1		-1		-1		1		16204		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		782		78172		-1		14802		1		-1		-1		1		14802		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		783		78254		-1		17551		1		-1		-1		1		17551		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		784		78341		-1		11219		1		-1		-1		1		11219		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		785		78436		-1		12607		1		-1		-1		1		12607		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		786		78548		-1		14339		1		-1		-1		1		14339		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		787		78642		-1		15455		1		-1		-1		1		15455		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		788		78754		-1		13729		1		-1		-1		1		13729		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		789		78848		-1		16043		1		-1		-1		1		16043		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		790		78939		-1		16268		1		-1		-1		1		16268		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		791		79049		-1		17515		1		-1		-1		1		17515		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		792		79148		-1		13418		1		-1		-1		1		13418		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		793		79244		-1		10986		1		-1		-1		1		10986		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		794		79347		-1		12109		1		-1		-1		1		12109		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		795		79453		-1		10867		1		-1		-1		1		10867		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		796		79559		-1		16758		1		-1		-1		1		16758		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		797		79651		-1		15437		1		-1		-1		1		15437		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		798		79758		-1		16543		4		-1		-1		4		16543		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		799		79866		-1		16923		1		-1		-1		1		16923		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		800		79971		-1		15886		1		-1		-1		1		15886		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		801		80077		-1		16858		1		-1		-1		1		16858		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		802		80187		-1		13834		1		-1		-1		1		13834		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		803		80286		-1		16859		1		-1		-1		1		16859		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		804		80374		-1		14213		1		-1		-1		1		14213		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		805		80467		-1		15184		1		-1		-1		1		15184		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		806		80552		-1		17866		1		-1		-1		1		17866		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		807		80645		-1		14199		1		-1		-1		1		14199		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		808		80739		-1		13572		1		-1		-1		1		13572		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		809		80831		-1		16187		1		-1		-1		1		16187		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		810		80922		-1		15348		4		-1		-1		4		15348		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		811		81021		-1		13618		1		-1		-1		1		13618		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		812		81122		-1		13714		1		-1		-1		1		13714		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		813		81232		-1		17736		1		-1		-1		1		17736		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		814		81343		-1		11119		1		-1		-1		1		11119		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		815		81454		-1		14643		1		-1		-1		1		14643		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		816		81566		-1		14056		1		-1		-1		1		14056		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		817		81646		-1		12216		1		-1		-1		1		12216		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		818		81751		-1		11189		1		-1		-1		1		11189		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		819		81844		-1		17006		1		-1		-1		1		17006		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		820		81945		-1		17998		1		-1		-1		1		17998		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		821		82027		-1		13172		1		-1		-1		1		13172		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		822		82118		-1		16925		1		-1		-1		1		16925		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		823		82223		-1		15009		1		-1		-1		1		15009		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		824		82313		-1		17772		1		-1		-1		1		17772		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		825		82422		-1		11510		1		-1		-1		1		11510		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		826		82534		-1		17375		1		-1		-1		1		17375		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		827		82637		-1		11446		1		-1		-1		1		11446		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		828		82761		-1		17107		1		-1		-1		1		17107		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		829		82859		-1		16623		1		-1		-1		1		16623		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		830		82974		-1		12335		1		-1		-1		1		12335		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		831		83079		-1		13296		1		-1		-1		1		13296		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		832		83172		-1		13615		1		-1		-1		1		13615		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		833		83278		-1		13290		1		-1		-1		1		13290		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		834		83374		-1		16150		1		-1		-1		1		16150		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		835		83471		-1		14273		1		-1		-1		1		14273		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		836		83578		-1		12699		4		-1		-1		4		12699		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		837		83679		-1		16298		1		-1		-1		1		16298		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		838		83775		-1		12001		1		-1		-1		1		12001		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		839		83893		-1		14156		1		-1		-1		1		14156		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		840		84013		-1		12710		1		-1		-1		1		12710		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		841		84107		-1		12039		1		-1		-1		1		12039		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		842		84198		-1		16845		4		-1		-1		4		16845		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		843		84311		-1		11106		1		-1		-1		1		11106		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		844		84429		-1		16848		1		-1		-1		1		16848		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		845		84522		-1		16710		1		-1		-1		1		16710		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		846		84621		-1		16608		1		-1		-1		1		16608		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		847		84723		-1		11935		1		-1		-1		1		11935		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		848		84836		-1		13741		1		-1		-1		1		13741		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		849		84923		-1		12194		1		-1		-1		1		12194		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		850		85018		-1		11528		1		-1		-1		1		11528		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		851		85126		-1		13425		1		-1		-1		1		13425		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		852		85217		-1		11296		1		-1		-1		1		11296		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		853		85324		-1		14636		1		-1		-1		1		14636		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		854		85421		-1		13409		1		-1		-1		1		13409		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		855		85542		-1		14367		1		-1		-1		1		14367		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		856		85635		-1		12996		1		-1		-1		1		12996		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		857		85744		-1		15089		1		-1		-1		1		15089		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		858		85837		-1		17075		1		-1		-1		1		17075		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		859		85936		-1		14309		1		-1		-1		1		14309		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		860		86031		-1		17203		1		-1		-1		1		17203		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		861		86125		-1		17322		1		-1		-1		1		17322		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		862		86229		-1		14657		1		-1		-1		1		14657		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		863		86325		-1		12264		1		-1		-1		1		12264		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		864		86418		-1		13525		1		-1		-1		1		13525		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		865		86509		-1		12682		1		-1		-1		1		12682		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		866		86617		-1		16284		1		-1		-1		1		16284		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		867		86691		-1		13401		1		-1		-1		1		13401		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		868		86777		-1		13936		1		-1		-1		1		13936		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		869		86870		-1		13948		1		-1		-1		1		13948		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		870		86983		-1		16022		1		-1		-1		1		16022		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		871		87089		-1		11616		1		-1		-1		1		11616		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		872		87178		-1		14480		1		-1		-1		1		14480		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		873		87278		-1		16089		1		-1		-1		1		16089		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		874		87388		-1		12607		1		-1		-1		1		12607		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		875		87489		-1		17469		1		-1		-1		1		17469		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		876		87577		-1		12467		1		-1		-1		1		12467		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		877		87673		-1		16802		1		-1		-1		1		16802		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		878		87766		-1		13938		1		-1		-1		1		13938		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		879		87864		-1		10931		1		-1		-1		1		10931		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		880		87961		-1		12973		1		-1		-1		1		12973		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		881		88066		-1		16720		1		-1		-1		1		16720		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		882		88164		-1		12076		1		-1		-1		1		12076		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		883		88257		-1		15923		1		-1		-1		1		15923		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		884		88344		-1		11706		1		-1		-1		1		11706		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		885		88465		-1		13655		1		-1		-1		1		13655		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		886		88578		-1		14743		4		-1		-1		4		14743		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		887		88655		-1		13962		1		-1		-1		1		13962		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		888		88752		-1		16019		1		-1		-1		1		16019		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		889		88835		-1		12300		1		-1		-1		1		12300		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		890		88930		-1		14104		1		-1		-1		1		14104		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		891		89033		-1		15015		1		-1		-1		1		15015		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		892		89129		-1		11710		1		-1		-1		1		11710		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		893		89216		-1		11484		1		-1		-1		1		11484		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		894		89308		-1		11351		1		-1		-1		1		11351		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		895		89405		-1		12015		1		-1		-1		1		12015		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		896		89496		-1		11702		1		-1		-1		1		11702		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		897		89582		-1		14789		1		-1		-1		1		14789		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		898		89662		-1		12399		1		-1		-1		1		12399		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		899		89764		-1		13021		4		-1		-1		4		13021		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		900		89870		-1		13208		1		-1		-1		1		13208		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		901		89978		-1		11199		1		-1		-1		1		11199		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		902		90060		-1		11965		1		-1		-1		1		11965		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		903		90168		-1		17651		1		-1		-1		1		17651		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		904		90274		-1		11335		1		-1		-1		1		11335		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		905		90384		-1		14167		1		-1		-1		1		14167		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		906		90488		-1		14554		1		-1		-1		1		14554		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		907		90603		-1		14203		1		-1		-1		1		14203		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		908		90703		-1		13741		1		-1		-1		1		13741		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		909		90803		-1		16714		4		-1		-1		4		16714		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		910		90899		-1		14203		1		-1		-1		1		14203		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		911		90988		-1		12549		1		-1		-1		1		12549		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		912		91094		-1		12459		1		-1		-1		1		12459		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		913		91181		-1		17621		1		-1		-1		1		17621		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		914		91279		-1		15726		1		-1		-1		1		15726		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		915		91397		-1		16616		1		-1		-1		1		16616		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		916		91501		-1		13692		1		-1		-1		1		13692		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		917		91612		-1		10860		1		-1		-1		1		10860		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		918		91693		-1		13937		1		-1		-1		1		13937		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		919		91794		-1		13106		1		-1		-1		1		13106		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		920		91900		-1		15422		1		-1		-1		1		15422		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		921		92015		-1		13988		1		-1		-1		1		13988		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		922		92122		-1		14595		1		-1		-1		1		14595		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		923		92222		-1		17107		1		-1		-1		1		17107		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		924		92344		-1		14675		1		-1		-1		1		14675		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		925		92430		-1		15000		1		-1		-1		1		15000		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		926		92530		-1		12765		1		-1		-1		1		12765		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		927		92629		-1		14647		1		-1		-1		1		14647		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		928		92728		-1		13037		1		-1		-1		1		13037		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		929		92826		-1		13223		1		-1		-1		1		13223		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		930		92920		-1		17877		1		-1		-1		1		17877		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		931		93019		-1		17626		1		-1		-1		1		17626		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		932		93111		-1		17564		1		-1		-1		1		17564		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		933		93215		-1		13954		1		-1		-1		1		13954		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		934		93317		-1		12082		1		-1		-1		1		12082		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		935		93425		-1		11051		1		-1		-1		1		11051		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		936		93538		-1		11759		1		-1		-1		1		11759		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		937		93641		-1		16249		1		-1		-1		1		16249		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		938		93741		-1		12731		1		-1		-1		1		12731		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		939		93853		-1		13684		1		-1		-1		1		13684		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		940		93943		-1		15343		1		-1		-1		1		15343		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		941		94045		-1		17591		1		-1		-1		1		17591		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		942		94144		-1		11220		1		-1		-1		1		11220		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		943		94234		-1		17084		4		-1		-1		4		17084		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		944		94322		-1		13466		1		-1		-1		1		13466		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		945		94410		-1		14626		1		-1		-1		1		14626		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		946		94506		-1		15946		1		-1		-1		1		15946		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		947		94593		-1		16277		1		-1		-1		1		16277		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		948		94688		-1		14854		1		-1		-1		1		14854		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		949		94791		-1		12850		1		-1		-1		1		12850		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		950		94870		-1		12540		1		-1		-1		1		12540		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		951		94982		-1		12428		1		-1		-1		1		12428		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		952		95067		-1		16146		1		-1		-1		1		16146		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		953		95179		-1		14478		1		-1		-1		1		14478		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		954		95295		-1		11789		1		-1		-1		1		11789		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		955		95386		-1		14697		1		-1		-1		1		14697		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		956		95482		-1		14269		1		-1		-1		1		14269		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		957		95596		-1		17302		1		-1		-1		1		17302		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		958		95688		-1		12678		1		-1		-1		1		12678		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		959		95794		-1		15114		1		-1		-1		1		15114		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		960		95909		-1		15915		1		-1		-1		1		15915		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		961		96030		-1		14907		1		-1		-1		1		14907		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		962		96131		-1		16981		1		-1		-1		1		16981		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		963		96228		-1		11105		1		-1		-1		1		11105		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		964		96328		-1		12462		1		-1		-1		1		12462		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		965		96400		-1		13578		4		-1		-1		4		13578		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		966		96497		-1		12768		1		-1		-1		1		12768		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		967		96590		-1		14302		1		-1		-1		1		14302		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		968		96693		-1		12386		1		-1		-1		1		12386		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		969		96800		-1		12203		4		-1		-1		4		12203		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		970		96910		-1		15459		1		-1		-1		1		15459		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		971		97007		-1		13794		1		-1		-1		1		13794		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		972		97092		-1		17058		1		-1		-1		1		17058		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		973		97194		-1		13853		1		-1		-1		1		13853		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		974		97304		-1		17056		1		-1		-1		1		17056		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		975		97388		-1		15995		4		-1		-1		4		15995		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		976		97495		-1		12723		1		-1		-1		1		12723		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		977		97576		-1		14892		1		-1		-1		1		14892		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		978		97679		-1		16129		1		-1		-1		1		16129		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		979		97791		-1		13661		1		-1		-1		1		13661		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		980		97871		-1		12175		1		-1		-1		1		12175		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		981		97967		-1		16019		1		-1		-1		1		16019		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		982		98060		-1		16590		1		-1		-1		1		16590		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		983		98179		-1		13063		1		-1		-1		1		13063		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		984		98264		-1		12783		1		-1		-1		1		12783		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		985		98369		-1		12707		1		-1		-1		1		12707		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		986		98471		-1		12577		1		-1		-1		1		12577		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		987		98567		-1		15168		1		-1		-1		1		15168		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		988		98660		-1		15081		1		-1		-1		1		15081		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		989		98760		-1		13201		1		-1		-1		1		13201		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		990		98863		-1		16863		1		-1		-1		1		16863		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		991		98969		-1		15681		1		-1		-1		1		15681		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		992		99057		-1		16099		1		-1		-1		1		16099		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		993		99166		-1		11723		1		-1		-1		1		11723		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		994		99259		-1		11760		1		-1		-1		1		11760		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		995		99361		-1		13778		1		-1		-1		1		13778		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		996		99469		-1		15969		1		-1		-1		1		15969		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		997		99562		-1		15223		1		-1		-1		1		15223		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		998		99668		-1		14018		1		-1		-1		1		14018		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		999		99771		-1		16888		1		-1		-1		1		16888		-1		-1		-1		-1		-1		-1		-1		-1		-1
+;IDMapping: swfID:jobID:taskID
+; 0:0:0, 1:1:0, 2:2:0, 3:3:0, 4:4:0, 5:5:0, 6:6:0, 7:7:0, 8:8:0, 9:9:0, 
+; 10:10:0, 11:11:0, 12:12:0, 13:13:0, 14:14:0, 15:15:0, 16:16:0, 17:17:0, 18:18:0, 19:19:0, 
+; 20:20:0, 21:21:0, 22:22:0, 23:23:0, 24:24:0, 25:25:0, 26:26:0, 27:27:0, 28:28:0, 29:29:0, 
+; 30:30:0, 31:31:0, 32:32:0, 33:33:0, 34:34:0, 35:35:0, 36:36:0, 37:37:0, 38:38:0, 39:39:0, 
+; 40:40:0, 41:41:0, 42:42:0, 43:43:0, 44:44:0, 45:45:0, 46:46:0, 47:47:0, 48:48:0, 49:49:0, 
+; 50:50:0, 51:51:0, 52:52:0, 53:53:0, 54:54:0, 55:55:0, 56:56:0, 57:57:0, 58:58:0, 59:59:0, 
+; 60:60:0, 61:61:0, 62:62:0, 63:63:0, 64:64:0, 65:65:0, 66:66:0, 67:67:0, 68:68:0, 69:69:0, 
+; 70:70:0, 71:71:0, 72:72:0, 73:73:0, 74:74:0, 75:75:0, 76:76:0, 77:77:0, 78:78:0, 79:79:0, 
+; 80:80:0, 81:81:0, 82:82:0, 83:83:0, 84:84:0, 85:85:0, 86:86:0, 87:87:0, 88:88:0, 89:89:0, 
+; 90:90:0, 91:91:0, 92:92:0, 93:93:0, 94:94:0, 95:95:0, 96:96:0, 97:97:0, 98:98:0, 99:99:0, 
+; 100:100:0, 101:101:0, 102:102:0, 103:103:0, 104:104:0, 105:105:0, 106:106:0, 107:107:0, 108:108:0, 109:109:0, 
+; 110:110:0, 111:111:0, 112:112:0, 113:113:0, 114:114:0, 115:115:0, 116:116:0, 117:117:0, 118:118:0, 119:119:0, 
+; 120:120:0, 121:121:0, 122:122:0, 123:123:0, 124:124:0, 125:125:0, 126:126:0, 127:127:0, 128:128:0, 129:129:0, 
+; 130:130:0, 131:131:0, 132:132:0, 133:133:0, 134:134:0, 135:135:0, 136:136:0, 137:137:0, 138:138:0, 139:139:0, 
+; 140:140:0, 141:141:0, 142:142:0, 143:143:0, 144:144:0, 145:145:0, 146:146:0, 147:147:0, 148:148:0, 149:149:0, 
+; 150:150:0, 151:151:0, 152:152:0, 153:153:0, 154:154:0, 155:155:0, 156:156:0, 157:157:0, 158:158:0, 159:159:0, 
+; 160:160:0, 161:161:0, 162:162:0, 163:163:0, 164:164:0, 165:165:0, 166:166:0, 167:167:0, 168:168:0, 169:169:0, 
+; 170:170:0, 171:171:0, 172:172:0, 173:173:0, 174:174:0, 175:175:0, 176:176:0, 177:177:0, 178:178:0, 179:179:0, 
+; 180:180:0, 181:181:0, 182:182:0, 183:183:0, 184:184:0, 185:185:0, 186:186:0, 187:187:0, 188:188:0, 189:189:0, 
+; 190:190:0, 191:191:0, 192:192:0, 193:193:0, 194:194:0, 195:195:0, 196:196:0, 197:197:0, 198:198:0, 199:199:0, 
+; 200:200:0, 201:201:0, 202:202:0, 203:203:0, 204:204:0, 205:205:0, 206:206:0, 207:207:0, 208:208:0, 209:209:0, 
+; 210:210:0, 211:211:0, 212:212:0, 213:213:0, 214:214:0, 215:215:0, 216:216:0, 217:217:0, 218:218:0, 219:219:0, 
+; 220:220:0, 221:221:0, 222:222:0, 223:223:0, 224:224:0, 225:225:0, 226:226:0, 227:227:0, 228:228:0, 229:229:0, 
+; 230:230:0, 231:231:0, 232:232:0, 233:233:0, 234:234:0, 235:235:0, 236:236:0, 237:237:0, 238:238:0, 239:239:0, 
+; 240:240:0, 241:241:0, 242:242:0, 243:243:0, 244:244:0, 245:245:0, 246:246:0, 247:247:0, 248:248:0, 249:249:0, 
+; 250:250:0, 251:251:0, 252:252:0, 253:253:0, 254:254:0, 255:255:0, 256:256:0, 257:257:0, 258:258:0, 259:259:0, 
+; 260:260:0, 261:261:0, 262:262:0, 263:263:0, 264:264:0, 265:265:0, 266:266:0, 267:267:0, 268:268:0, 269:269:0, 
+; 270:270:0, 271:271:0, 272:272:0, 273:273:0, 274:274:0, 275:275:0, 276:276:0, 277:277:0, 278:278:0, 279:279:0, 
+; 280:280:0, 281:281:0, 282:282:0, 283:283:0, 284:284:0, 285:285:0, 286:286:0, 287:287:0, 288:288:0, 289:289:0, 
+; 290:290:0, 291:291:0, 292:292:0, 293:293:0, 294:294:0, 295:295:0, 296:296:0, 297:297:0, 298:298:0, 299:299:0, 
+; 300:300:0, 301:301:0, 302:302:0, 303:303:0, 304:304:0, 305:305:0, 306:306:0, 307:307:0, 308:308:0, 309:309:0, 
+; 310:310:0, 311:311:0, 312:312:0, 313:313:0, 314:314:0, 315:315:0, 316:316:0, 317:317:0, 318:318:0, 319:319:0, 
+; 320:320:0, 321:321:0, 322:322:0, 323:323:0, 324:324:0, 325:325:0, 326:326:0, 327:327:0, 328:328:0, 329:329:0, 
+; 330:330:0, 331:331:0, 332:332:0, 333:333:0, 334:334:0, 335:335:0, 336:336:0, 337:337:0, 338:338:0, 339:339:0, 
+; 340:340:0, 341:341:0, 342:342:0, 343:343:0, 344:344:0, 345:345:0, 346:346:0, 347:347:0, 348:348:0, 349:349:0, 
+; 350:350:0, 351:351:0, 352:352:0, 353:353:0, 354:354:0, 355:355:0, 356:356:0, 357:357:0, 358:358:0, 359:359:0, 
+; 360:360:0, 361:361:0, 362:362:0, 363:363:0, 364:364:0, 365:365:0, 366:366:0, 367:367:0, 368:368:0, 369:369:0, 
+; 370:370:0, 371:371:0, 372:372:0, 373:373:0, 374:374:0, 375:375:0, 376:376:0, 377:377:0, 378:378:0, 379:379:0, 
+; 380:380:0, 381:381:0, 382:382:0, 383:383:0, 384:384:0, 385:385:0, 386:386:0, 387:387:0, 388:388:0, 389:389:0, 
+; 390:390:0, 391:391:0, 392:392:0, 393:393:0, 394:394:0, 395:395:0, 396:396:0, 397:397:0, 398:398:0, 399:399:0, 
+; 400:400:0, 401:401:0, 402:402:0, 403:403:0, 404:404:0, 405:405:0, 406:406:0, 407:407:0, 408:408:0, 409:409:0, 
+; 410:410:0, 411:411:0, 412:412:0, 413:413:0, 414:414:0, 415:415:0, 416:416:0, 417:417:0, 418:418:0, 419:419:0, 
+; 420:420:0, 421:421:0, 422:422:0, 423:423:0, 424:424:0, 425:425:0, 426:426:0, 427:427:0, 428:428:0, 429:429:0, 
+; 430:430:0, 431:431:0, 432:432:0, 433:433:0, 434:434:0, 435:435:0, 436:436:0, 437:437:0, 438:438:0, 439:439:0, 
+; 440:440:0, 441:441:0, 442:442:0, 443:443:0, 444:444:0, 445:445:0, 446:446:0, 447:447:0, 448:448:0, 449:449:0, 
+; 450:450:0, 451:451:0, 452:452:0, 453:453:0, 454:454:0, 455:455:0, 456:456:0, 457:457:0, 458:458:0, 459:459:0, 
+; 460:460:0, 461:461:0, 462:462:0, 463:463:0, 464:464:0, 465:465:0, 466:466:0, 467:467:0, 468:468:0, 469:469:0, 
+; 470:470:0, 471:471:0, 472:472:0, 473:473:0, 474:474:0, 475:475:0, 476:476:0, 477:477:0, 478:478:0, 479:479:0, 
+; 480:480:0, 481:481:0, 482:482:0, 483:483:0, 484:484:0, 485:485:0, 486:486:0, 487:487:0, 488:488:0, 489:489:0, 
+; 490:490:0, 491:491:0, 492:492:0, 493:493:0, 494:494:0, 495:495:0, 496:496:0, 497:497:0, 498:498:0, 499:499:0, 
+; 500:500:0, 501:501:0, 502:502:0, 503:503:0, 504:504:0, 505:505:0, 506:506:0, 507:507:0, 508:508:0, 509:509:0, 
+; 510:510:0, 511:511:0, 512:512:0, 513:513:0, 514:514:0, 515:515:0, 516:516:0, 517:517:0, 518:518:0, 519:519:0, 
+; 520:520:0, 521:521:0, 522:522:0, 523:523:0, 524:524:0, 525:525:0, 526:526:0, 527:527:0, 528:528:0, 529:529:0, 
+; 530:530:0, 531:531:0, 532:532:0, 533:533:0, 534:534:0, 535:535:0, 536:536:0, 537:537:0, 538:538:0, 539:539:0, 
+; 540:540:0, 541:541:0, 542:542:0, 543:543:0, 544:544:0, 545:545:0, 546:546:0, 547:547:0, 548:548:0, 549:549:0, 
+; 550:550:0, 551:551:0, 552:552:0, 553:553:0, 554:554:0, 555:555:0, 556:556:0, 557:557:0, 558:558:0, 559:559:0, 
+; 560:560:0, 561:561:0, 562:562:0, 563:563:0, 564:564:0, 565:565:0, 566:566:0, 567:567:0, 568:568:0, 569:569:0, 
+; 570:570:0, 571:571:0, 572:572:0, 573:573:0, 574:574:0, 575:575:0, 576:576:0, 577:577:0, 578:578:0, 579:579:0, 
+; 580:580:0, 581:581:0, 582:582:0, 583:583:0, 584:584:0, 585:585:0, 586:586:0, 587:587:0, 588:588:0, 589:589:0, 
+; 590:590:0, 591:591:0, 592:592:0, 593:593:0, 594:594:0, 595:595:0, 596:596:0, 597:597:0, 598:598:0, 599:599:0, 
+; 600:600:0, 601:601:0, 602:602:0, 603:603:0, 604:604:0, 605:605:0, 606:606:0, 607:607:0, 608:608:0, 609:609:0, 
+; 610:610:0, 611:611:0, 612:612:0, 613:613:0, 614:614:0, 615:615:0, 616:616:0, 617:617:0, 618:618:0, 619:619:0, 
+; 620:620:0, 621:621:0, 622:622:0, 623:623:0, 624:624:0, 625:625:0, 626:626:0, 627:627:0, 628:628:0, 629:629:0, 
+; 630:630:0, 631:631:0, 632:632:0, 633:633:0, 634:634:0, 635:635:0, 636:636:0, 637:637:0, 638:638:0, 639:639:0, 
+; 640:640:0, 641:641:0, 642:642:0, 643:643:0, 644:644:0, 645:645:0, 646:646:0, 647:647:0, 648:648:0, 649:649:0, 
+; 650:650:0, 651:651:0, 652:652:0, 653:653:0, 654:654:0, 655:655:0, 656:656:0, 657:657:0, 658:658:0, 659:659:0, 
+; 660:660:0, 661:661:0, 662:662:0, 663:663:0, 664:664:0, 665:665:0, 666:666:0, 667:667:0, 668:668:0, 669:669:0, 
+; 670:670:0, 671:671:0, 672:672:0, 673:673:0, 674:674:0, 675:675:0, 676:676:0, 677:677:0, 678:678:0, 679:679:0, 
+; 680:680:0, 681:681:0, 682:682:0, 683:683:0, 684:684:0, 685:685:0, 686:686:0, 687:687:0, 688:688:0, 689:689:0, 
+; 690:690:0, 691:691:0, 692:692:0, 693:693:0, 694:694:0, 695:695:0, 696:696:0, 697:697:0, 698:698:0, 699:699:0, 
+; 700:700:0, 701:701:0, 702:702:0, 703:703:0, 704:704:0, 705:705:0, 706:706:0, 707:707:0, 708:708:0, 709:709:0, 
+; 710:710:0, 711:711:0, 712:712:0, 713:713:0, 714:714:0, 715:715:0, 716:716:0, 717:717:0, 718:718:0, 719:719:0, 
+; 720:720:0, 721:721:0, 722:722:0, 723:723:0, 724:724:0, 725:725:0, 726:726:0, 727:727:0, 728:728:0, 729:729:0, 
+; 730:730:0, 731:731:0, 732:732:0, 733:733:0, 734:734:0, 735:735:0, 736:736:0, 737:737:0, 738:738:0, 739:739:0, 
+; 740:740:0, 741:741:0, 742:742:0, 743:743:0, 744:744:0, 745:745:0, 746:746:0, 747:747:0, 748:748:0, 749:749:0, 
+; 750:750:0, 751:751:0, 752:752:0, 753:753:0, 754:754:0, 755:755:0, 756:756:0, 757:757:0, 758:758:0, 759:759:0, 
+; 760:760:0, 761:761:0, 762:762:0, 763:763:0, 764:764:0, 765:765:0, 766:766:0, 767:767:0, 768:768:0, 769:769:0, 
+; 770:770:0, 771:771:0, 772:772:0, 773:773:0, 774:774:0, 775:775:0, 776:776:0, 777:777:0, 778:778:0, 779:779:0, 
+; 780:780:0, 781:781:0, 782:782:0, 783:783:0, 784:784:0, 785:785:0, 786:786:0, 787:787:0, 788:788:0, 789:789:0, 
+; 790:790:0, 791:791:0, 792:792:0, 793:793:0, 794:794:0, 795:795:0, 796:796:0, 797:797:0, 798:798:0, 799:799:0, 
+; 800:800:0, 801:801:0, 802:802:0, 803:803:0, 804:804:0, 805:805:0, 806:806:0, 807:807:0, 808:808:0, 809:809:0, 
+; 810:810:0, 811:811:0, 812:812:0, 813:813:0, 814:814:0, 815:815:0, 816:816:0, 817:817:0, 818:818:0, 819:819:0, 
+; 820:820:0, 821:821:0, 822:822:0, 823:823:0, 824:824:0, 825:825:0, 826:826:0, 827:827:0, 828:828:0, 829:829:0, 
+; 830:830:0, 831:831:0, 832:832:0, 833:833:0, 834:834:0, 835:835:0, 836:836:0, 837:837:0, 838:838:0, 839:839:0, 
+; 840:840:0, 841:841:0, 842:842:0, 843:843:0, 844:844:0, 845:845:0, 846:846:0, 847:847:0, 848:848:0, 849:849:0, 
+; 850:850:0, 851:851:0, 852:852:0, 853:853:0, 854:854:0, 855:855:0, 856:856:0, 857:857:0, 858:858:0, 859:859:0, 
+; 860:860:0, 861:861:0, 862:862:0, 863:863:0, 864:864:0, 865:865:0, 866:866:0, 867:867:0, 868:868:0, 869:869:0, 
+; 870:870:0, 871:871:0, 872:872:0, 873:873:0, 874:874:0, 875:875:0, 876:876:0, 877:877:0, 878:878:0, 879:879:0, 
+; 880:880:0, 881:881:0, 882:882:0, 883:883:0, 884:884:0, 885:885:0, 886:886:0, 887:887:0, 888:888:0, 889:889:0, 
+; 890:890:0, 891:891:0, 892:892:0, 893:893:0, 894:894:0, 895:895:0, 896:896:0, 897:897:0, 898:898:0, 899:899:0, 
+; 900:900:0, 901:901:0, 902:902:0, 903:903:0, 904:904:0, 905:905:0, 906:906:0, 907:907:0, 908:908:0, 909:909:0, 
+; 910:910:0, 911:911:0, 912:912:0, 913:913:0, 914:914:0, 915:915:0, 916:916:0, 917:917:0, 918:918:0, 919:919:0, 
+; 920:920:0, 921:921:0, 922:922:0, 923:923:0, 924:924:0, 925:925:0, 926:926:0, 927:927:0, 928:928:0, 929:929:0, 
+; 930:930:0, 931:931:0, 932:932:0, 933:933:0, 934:934:0, 935:935:0, 936:936:0, 937:937:0, 938:938:0, 939:939:0, 
+; 940:940:0, 941:941:0, 942:942:0, 943:943:0, 944:944:0, 945:945:0, 946:946:0, 947:947:0, 948:948:0, 949:949:0, 
+; 950:950:0, 951:951:0, 952:952:0, 953:953:0, 954:954:0, 955:955:0, 956:956:0, 957:957:0, 958:958:0, 959:959:0, 
+; 960:960:0, 961:961:0, 962:962:0, 963:963:0, 964:964:0, 965:965:0, 966:966:0, 967:967:0, 968:968:0, 969:969:0, 
+; 970:970:0, 971:971:0, 972:972:0, 973:973:0, 974:974:0, 975:975:0, 976:976:0, 977:977:0, 978:978:0, 979:979:0, 
+; 980:980:0, 981:981:0, 982:982:0, 983:983:0, 984:984:0, 985:985:0, 986:986:0, 987:987:0, 988:988:0, 989:989:0, 
+; 990:990:0, 991:991:0, 992:992:0, 993:993:0, 994:994:0, 995:995:0, 996:996:0, 997:997:0, 998:998:0, 999:999:0, 
+; 
+;IDMapping: end
Index: DCWoRMS/trunk/example/workgen/workload50/GeneratorConfig.xml
===================================================================
--- DCWoRMS/trunk/example/workgen/workload50/GeneratorConfig.xml	(revision 477)
+++ DCWoRMS/trunk/example/workgen/workload50/GeneratorConfig.xml	(revision 477)
@@ -0,0 +1,26 @@
+<tns:WorkloadConfiguration 
+	xmlns:tns="http://www.man.poznan.pl/WorkloadSchema" 
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ 
+  	<SimulationStartTime>2009-01-15T10:00:00</SimulationStartTime>
+ 
+	<JobCount avg="1000" distribution="constant"/>
+ 
+	<TaskCount avg="1" distribution="constant"/>
+ 
+	<TaskLength avg="14400" min="10800" max="18000" stdev="3600.0" distribution="normal"/>
+ 
+	<JobPackageLength avg="1.0" min="1.0" max="1.0" stdev="0.0" distribution="constant"/>
+ 
+	<JobInterval avg="50" min="0" max="100" stdev="30" distribution="poisson" seed="21"/>
+	
+	<ComputingResourceHostParameter metric="cpucount">
+		<value id="cpucnt">
+	  		<MultiDistribution>
+      			<dist avg="1" min="1" max="1" stdev="0" distribution="uniform">0.95</dist>
+     		 	<dist avg="4" min="4" max="4" stdev="0" distribution="uniform">0.05</dist>
+   			</MultiDistribution>
+   		</value>	
+	</ComputingResourceHostParameter>
+ 
+</tns:WorkloadConfiguration>
Index: DCWoRMS/trunk/example/workgen/workload50/workload.swf
===================================================================
--- DCWoRMS/trunk/example/workgen/workload50/workload.swf	(revision 477)
+++ DCWoRMS/trunk/example/workgen/workload50/workload.swf	(revision 477)
@@ -0,0 +1,1116 @@
+;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|
+;PUSpeed: 1
+;StartTime: Thu Jan 15 10:00:00 CET 2009
+		0		37		-1		14170		1		-1		-1		1		14170		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		1		82		-1		14936		4		-1		-1		4		14936		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		2		127		-1		12542		1		-1		-1		1		12542		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		3		180		-1		14197		1		-1		-1		1		14197		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		4		235		-1		14267		1		-1		-1		1		14267		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		5		279		-1		14966		1		-1		-1		1		14966		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		6		325		-1		16637		1		-1		-1		1		16637		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		7		380		-1		12931		1		-1		-1		1		12931		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		8		429		-1		14468		1		-1		-1		1		14468		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		9		477		-1		10832		1		-1		-1		1		10832		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		10		532		-1		11692		1		-1		-1		1		11692		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		11		573		-1		17853		1		-1		-1		1		17853		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		12		632		-1		11720		1		-1		-1		1		11720		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		13		689		-1		16937		1		-1		-1		1		16937		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		14		744		-1		13664		1		-1		-1		1		13664		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		15		791		-1		11098		1		-1		-1		1		11098		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		16		846		-1		15115		1		-1		-1		1		15115		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		17		900		-1		15847		1		-1		-1		1		15847		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		18		952		-1		11718		1		-1		-1		1		11718		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		19		1013		-1		15294		1		-1		-1		1		15294		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		20		1059		-1		15130		1		-1		-1		1		15130		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		21		1104		-1		11815		1		-1		-1		1		11815		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		22		1149		-1		12837		1		-1		-1		1		12837		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		23		1193		-1		14453		1		-1		-1		1		14453		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		24		1250		-1		16089		4		-1		-1		4		16089		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		25		1292		-1		17357		1		-1		-1		1		17357		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		26		1345		-1		13620		1		-1		-1		1		13620		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		27		1395		-1		14495		1		-1		-1		1		14495		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		28		1436		-1		15666		1		-1		-1		1		15666		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		29		1490		-1		14383		1		-1		-1		1		14383		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		30		1533		-1		12347		1		-1		-1		1		12347		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		31		1582		-1		13782		1		-1		-1		1		13782		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		32		1633		-1		15988		1		-1		-1		1		15988		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		33		1681		-1		13209		1		-1		-1		1		13209		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		34		1727		-1		11559		1		-1		-1		1		11559		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		35		1775		-1		17548		1		-1		-1		1		17548		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		36		1824		-1		17297		1		-1		-1		1		17297		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		37		1876		-1		15789		1		-1		-1		1		15789		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		38		1922		-1		13149		1		-1		-1		1		13149		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		39		1961		-1		17932		1		-1		-1		1		17932		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		40		2011		-1		16092		1		-1		-1		1		16092		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		41		2051		-1		12607		1		-1		-1		1		12607		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		42		2109		-1		13347		1		-1		-1		1		13347		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		43		2155		-1		13815		1		-1		-1		1		13815		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		44		2220		-1		13148		1		-1		-1		1		13148		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		45		2261		-1		16975		1		-1		-1		1		16975		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		46		2310		-1		13297		1		-1		-1		1		13297		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		47		2356		-1		14707		1		-1		-1		1		14707		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		48		2403		-1		14823		1		-1		-1		1		14823		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		49		2452		-1		15545		1		-1		-1		1		15545		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		50		2510		-1		15686		1		-1		-1		1		15686		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		51		2562		-1		17210		1		-1		-1		1		17210		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		52		2628		-1		14030		1		-1		-1		1		14030		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		53		2664		-1		14962		1		-1		-1		1		14962		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		54		2722		-1		15631		1		-1		-1		1		15631		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		55		2770		-1		12400		1		-1		-1		1		12400		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		56		2827		-1		15553		1		-1		-1		1		15553		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		57		2873		-1		14515		1		-1		-1		1		14515		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		58		2921		-1		13487		1		-1		-1		1		13487		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		59		2977		-1		14181		1		-1		-1		1		14181		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		60		3028		-1		14690		1		-1		-1		1		14690		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		61		3067		-1		14884		1		-1		-1		1		14884		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		62		3124		-1		14399		1		-1		-1		1		14399		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		63		3172		-1		15933		1		-1		-1		1		15933		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		64		3220		-1		12545		1		-1		-1		1		12545		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		65		3279		-1		11414		1		-1		-1		1		11414		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		66		3327		-1		14034		1		-1		-1		1		14034		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		67		3380		-1		13489		1		-1		-1		1		13489		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		68		3428		-1		13212		1		-1		-1		1		13212		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		69		3479		-1		13191		1		-1		-1		1		13191		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		70		3538		-1		14629		1		-1		-1		1		14629		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		71		3591		-1		11818		1		-1		-1		1		11818		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		72		3643		-1		11328		1		-1		-1		1		11328		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		73		3687		-1		15912		4		-1		-1		4		15912		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		74		3726		-1		16588		1		-1		-1		1		16588		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		75		3774		-1		12084		1		-1		-1		1		12084		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		76		3815		-1		14411		1		-1		-1		1		14411		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		77		3872		-1		14471		1		-1		-1		1		14471		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		78		3929		-1		13086		4		-1		-1		4		13086		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		79		3985		-1		13887		1		-1		-1		1		13887		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		80		4035		-1		14087		1		-1		-1		1		14087		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		81		4089		-1		15963		1		-1		-1		1		15963		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		82		4126		-1		15027		1		-1		-1		1		15027		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		83		4172		-1		15557		1		-1		-1		1		15557		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		84		4217		-1		11269		1		-1		-1		1		11269		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		85		4265		-1		16579		1		-1		-1		1		16579		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		86		4319		-1		17002		1		-1		-1		1		17002		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		87		4377		-1		13421		1		-1		-1		1		13421		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		88		4431		-1		13897		1		-1		-1		1		13897		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		89		4491		-1		15109		4		-1		-1		4		15109		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		90		4545		-1		12569		1		-1		-1		1		12569		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		91		4587		-1		11241		1		-1		-1		1		11241		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		92		4636		-1		17136		1		-1		-1		1		17136		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		93		4685		-1		12007		1		-1		-1		1		12007		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		94		4730		-1		17111		1		-1		-1		1		17111		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		95		4783		-1		14476		1		-1		-1		1		14476		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		96		4836		-1		13279		1		-1		-1		1		13279		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		97		4884		-1		15696		1		-1		-1		1		15696		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		98		4928		-1		14132		1		-1		-1		1		14132		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		99		4971		-1		15551		1		-1		-1		1		15551		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		100		5012		-1		12074		1		-1		-1		1		12074		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		101		5061		-1		12470		1		-1		-1		1		12470		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		102		5111		-1		15862		1		-1		-1		1		15862		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		103		5148		-1		15916		1		-1		-1		1		15916		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		104		5196		-1		17335		1		-1		-1		1		17335		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		105		5242		-1		13151		1		-1		-1		1		13151		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		106		5289		-1		14547		1		-1		-1		1		14547		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		107		5340		-1		17050		1		-1		-1		1		17050		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		108		5390		-1		17810		1		-1		-1		1		17810		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		109		5450		-1		12818		1		-1		-1		1		12818		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		110		5491		-1		12736		1		-1		-1		1		12736		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		111		5535		-1		15849		1		-1		-1		1		15849		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		112		5585		-1		13375		1		-1		-1		1		13375		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		113		5626		-1		12632		1		-1		-1		1		12632		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		114		5678		-1		13789		1		-1		-1		1		13789		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		115		5726		-1		12420		1		-1		-1		1		12420		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		116		5786		-1		17396		1		-1		-1		1		17396		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		117		5858		-1		12035		1		-1		-1		1		12035		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		118		5912		-1		11943		1		-1		-1		1		11943		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		119		5963		-1		15737		1		-1		-1		1		15737		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		120		6017		-1		17681		1		-1		-1		1		17681		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		121		6050		-1		15486		1		-1		-1		1		15486		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		122		6098		-1		14463		1		-1		-1		1		14463		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		123		6151		-1		16088		1		-1		-1		1		16088		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		124		6198		-1		17428		1		-1		-1		1		17428		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		125		6241		-1		17102		4		-1		-1		4		17102		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		126		6282		-1		15192		1		-1		-1		1		15192		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		127		6335		-1		13777		1		-1		-1		1		13777		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		128		6369		-1		16650		1		-1		-1		1		16650		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		129		6411		-1		12054		1		-1		-1		1		12054		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		130		6458		-1		17727		1		-1		-1		1		17727		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		131		6508		-1		13966		1		-1		-1		1		13966		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		132		6559		-1		14341		1		-1		-1		1		14341		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		133		6609		-1		16730		4		-1		-1		4		16730		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		134		6655		-1		11595		1		-1		-1		1		11595		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		135		6706		-1		14044		1		-1		-1		1		14044		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		136		6750		-1		16846		1		-1		-1		1		16846		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		137		6801		-1		13395		1		-1		-1		1		13395		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		138		6853		-1		16610		1		-1		-1		1		16610		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		139		6899		-1		13675		1		-1		-1		1		13675		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		140		6953		-1		14143		1		-1		-1		1		14143		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		141		6993		-1		12231		1		-1		-1		1		12231		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		142		7039		-1		10965		1		-1		-1		1		10965		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		143		7090		-1		12493		1		-1		-1		1		12493		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		144		7136		-1		11119		1		-1		-1		1		11119		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		145		7191		-1		16159		1		-1		-1		1		16159		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		146		7239		-1		13943		1		-1		-1		1		13943		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		147		7285		-1		16777		1		-1		-1		1		16777		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		148		7333		-1		17628		1		-1		-1		1		17628		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		149		7393		-1		14506		1		-1		-1		1		14506		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		150		7433		-1		12183		1		-1		-1		1		12183		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		151		7494		-1		17964		1		-1		-1		1		17964		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		152		7561		-1		12175		1		-1		-1		1		12175		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		153		7631		-1		14923		4		-1		-1		4		14923		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		154		7683		-1		11528		1		-1		-1		1		11528		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		155		7729		-1		14495		1		-1		-1		1		14495		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		156		7772		-1		17124		1		-1		-1		1		17124		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		157		7822		-1		14462		1		-1		-1		1		14462		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		158		7880		-1		11994		1		-1		-1		1		11994		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		159		7926		-1		11303		1		-1		-1		1		11303		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		160		7994		-1		16779		1		-1		-1		1		16779		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		161		8049		-1		13229		1		-1		-1		1		13229		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		162		8089		-1		11261		1		-1		-1		1		11261		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		163		8139		-1		11442		1		-1		-1		1		11442		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		164		8185		-1		12926		1		-1		-1		1		12926		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		165		8240		-1		13231		1		-1		-1		1		13231		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		166		8276		-1		12186		1		-1		-1		1		12186		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		167		8318		-1		12811		1		-1		-1		1		12811		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		168		8366		-1		14796		1		-1		-1		1		14796		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		169		8409		-1		12548		1		-1		-1		1		12548		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		170		8459		-1		16233		1		-1		-1		1		16233		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		171		8504		-1		15261		1		-1		-1		1		15261		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		172		8549		-1		11925		1		-1		-1		1		11925		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		173		8601		-1		14022		1		-1		-1		1		14022		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		174		8651		-1		11541		1		-1		-1		1		11541		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		175		8693		-1		11479		1		-1		-1		1		11479		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		176		8738		-1		12776		1		-1		-1		1		12776		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		177		8787		-1		11703		1		-1		-1		1		11703		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		178		8846		-1		11414		1		-1		-1		1		11414		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		179		8898		-1		17298		1		-1		-1		1		17298		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		180		8946		-1		15147		1		-1		-1		1		15147		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		181		9008		-1		11884		1		-1		-1		1		11884		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		182		9068		-1		13824		1		-1		-1		1		13824		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		183		9117		-1		15285		1		-1		-1		1		15285		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		184		9180		-1		12445		1		-1		-1		1		12445		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		185		9217		-1		14011		1		-1		-1		1		14011		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		186		9272		-1		14774		1		-1		-1		1		14774		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		187		9331		-1		13039		1		-1		-1		1		13039		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		188		9370		-1		16393		1		-1		-1		1		16393		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		189		9412		-1		13669		1		-1		-1		1		13669		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		190		9454		-1		15005		1		-1		-1		1		15005		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		191		9506		-1		10960		1		-1		-1		1		10960		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		192		9555		-1		14326		1		-1		-1		1		14326		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		193		9604		-1		12353		1		-1		-1		1		12353		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		194		9662		-1		17149		1		-1		-1		1		17149		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		195		9710		-1		14686		1		-1		-1		1		14686		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		196		9766		-1		13811		1		-1		-1		1		13811		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		197		9808		-1		14574		1		-1		-1		1		14574		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		198		9856		-1		14087		1		-1		-1		1		14087		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		199		9900		-1		16291		1		-1		-1		1		16291		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		200		9948		-1		13537		1		-1		-1		1		13537		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		201		10000		-1		17289		1		-1		-1		1		17289		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		202		10040		-1		12501		1		-1		-1		1		12501		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		203		10096		-1		17303		1		-1		-1		1		17303		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		204		10145		-1		16793		1		-1		-1		1		16793		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		205		10204		-1		16380		1		-1		-1		1		16380		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		206		10252		-1		16982		1		-1		-1		1		16982		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		207		10300		-1		12829		1		-1		-1		1		12829		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		208		10363		-1		10822		4		-1		-1		4		10822		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		209		10429		-1		14167		1		-1		-1		1		14167		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		210		10489		-1		15764		1		-1		-1		1		15764		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		211		10535		-1		11574		1		-1		-1		1		11574		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		212		10593		-1		16004		1		-1		-1		1		16004		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		213		10654		-1		11949		1		-1		-1		1		11949		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		214		10711		-1		15108		1		-1		-1		1		15108		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		215		10755		-1		12365		1		-1		-1		1		12365		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		216		10802		-1		15241		1		-1		-1		1		15241		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		217		10855		-1		14551		1		-1		-1		1		14551		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		218		10909		-1		12652		1		-1		-1		1		12652		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		219		10968		-1		11899		1		-1		-1		1		11899		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		220		11022		-1		11924		1		-1		-1		1		11924		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		221		11063		-1		15541		1		-1		-1		1		15541		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		222		11111		-1		15760		1		-1		-1		1		15760		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		223		11161		-1		13008		1		-1		-1		1		13008		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		224		11205		-1		16445		1		-1		-1		1		16445		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		225		11262		-1		13173		1		-1		-1		1		13173		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		226		11303		-1		16846		1		-1		-1		1		16846		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		227		11344		-1		15687		1		-1		-1		1		15687		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		228		11395		-1		16798		1		-1		-1		1		16798		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		229		11446		-1		15130		1		-1		-1		1		15130		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		230		11489		-1		13824		1		-1		-1		1		13824		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		231		11537		-1		14341		1		-1		-1		1		14341		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		232		11575		-1		11675		1		-1		-1		1		11675		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		233		11614		-1		15406		1		-1		-1		1		15406		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		234		11657		-1		17771		4		-1		-1		4		17771		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		235		11696		-1		11016		4		-1		-1		4		11016		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		236		11753		-1		13051		1		-1		-1		1		13051		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		237		11796		-1		17139		1		-1		-1		1		17139		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		238		11854		-1		13048		1		-1		-1		1		13048		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		239		11904		-1		14535		1		-1		-1		1		14535		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		240		11946		-1		12729		1		-1		-1		1		12729		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		241		12012		-1		11194		1		-1		-1		1		11194		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		242		12056		-1		14671		4		-1		-1		4		14671		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		243		12104		-1		14168		1		-1		-1		1		14168		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		244		12156		-1		11814		1		-1		-1		1		11814		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		245		12196		-1		16553		4		-1		-1		4		16553		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		246		12235		-1		17474		1		-1		-1		1		17474		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		247		12280		-1		13998		1		-1		-1		1		13998		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		248		12338		-1		16181		1		-1		-1		1		16181		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		249		12396		-1		15021		1		-1		-1		1		15021		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		250		12439		-1		12983		1		-1		-1		1		12983		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		251		12475		-1		12642		1		-1		-1		1		12642		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		252		12531		-1		16174		1		-1		-1		1		16174		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		253		12592		-1		12585		1		-1		-1		1		12585		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		254		12658		-1		14159		1		-1		-1		1		14159		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		255		12709		-1		17406		1		-1		-1		1		17406		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		256		12748		-1		14438		1		-1		-1		1		14438		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		257		12798		-1		15420		1		-1		-1		1		15420		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		258		12854		-1		16487		1		-1		-1		1		16487		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		259		12902		-1		15871		1		-1		-1		1		15871		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		260		12960		-1		15619		1		-1		-1		1		15619		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		261		13001		-1		12345		1		-1		-1		1		12345		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		262		13039		-1		12104		1		-1		-1		1		12104		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		263		13090		-1		16175		1		-1		-1		1		16175		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		264		13145		-1		14031		1		-1		-1		1		14031		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		265		13187		-1		13884		1		-1		-1		1		13884		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		266		13222		-1		16125		1		-1		-1		1		16125		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		267		13267		-1		11041		1		-1		-1		1		11041		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		268		13322		-1		11164		1		-1		-1		1		11164		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		269		13386		-1		14835		1		-1		-1		1		14835		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		270		13438		-1		16388		1		-1		-1		1		16388		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		271		13485		-1		12358		1		-1		-1		1		12358		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		272		13515		-1		13875		4		-1		-1		4		13875		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		273		13555		-1		12014		1		-1		-1		1		12014		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		274		13597		-1		14758		1		-1		-1		1		14758		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		275		13647		-1		16593		1		-1		-1		1		16593		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		276		13702		-1		10965		1		-1		-1		1		10965		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		277		13748		-1		15490		1		-1		-1		1		15490		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		278		13789		-1		11722		1		-1		-1		1		11722		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		279		13851		-1		13228		1		-1		-1		1		13228		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		280		13895		-1		12132		1		-1		-1		1		12132		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		281		13940		-1		14680		1		-1		-1		1		14680		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		282		13996		-1		10803		1		-1		-1		1		10803		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		283		14054		-1		11502		1		-1		-1		1		11502		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		284		14094		-1		12142		1		-1		-1		1		12142		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		285		14134		-1		11693		1		-1		-1		1		11693		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		286		14189		-1		13427		1		-1		-1		1		13427		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		287		14238		-1		16470		1		-1		-1		1		16470		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		288		14285		-1		11631		1		-1		-1		1		11631		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		289		14335		-1		16214		1		-1		-1		1		16214		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		290		14375		-1		16262		1		-1		-1		1		16262		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		291		14425		-1		17643		1		-1		-1		1		17643		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		292		14466		-1		12519		1		-1		-1		1		12519		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		293		14509		-1		14008		1		-1		-1		1		14008		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		294		14558		-1		15150		1		-1		-1		1		15150		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		295		14606		-1		12812		1		-1		-1		1		12812		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		296		14649		-1		13900		1		-1		-1		1		13900		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		297		14693		-1		16921		1		-1		-1		1		16921		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		298		14751		-1		13555		1		-1		-1		1		13555		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		299		14795		-1		11810		1		-1		-1		1		11810		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		300		14849		-1		12759		1		-1		-1		1		12759		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		301		14909		-1		14479		1		-1		-1		1		14479		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		302		14958		-1		16193		1		-1		-1		1		16193		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		303		15003		-1		16696		1		-1		-1		1		16696		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		304		15060		-1		15030		1		-1		-1		1		15030		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		305		15102		-1		14294		1		-1		-1		1		14294		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		306		15151		-1		11330		1		-1		-1		1		11330		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		307		15197		-1		17238		1		-1		-1		1		17238		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		308		15245		-1		11881		1		-1		-1		1		11881		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		309		15289		-1		13043		1		-1		-1		1		13043		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		310		15333		-1		16233		1		-1		-1		1		16233		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		311		15381		-1		15901		1		-1		-1		1		15901		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		312		15423		-1		14806		1		-1		-1		1		14806		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		313		15465		-1		13517		1		-1		-1		1		13517		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		314		15530		-1		14877		1		-1		-1		1		14877		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		315		15579		-1		12583		1		-1		-1		1		12583		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		316		15638		-1		12758		1		-1		-1		1		12758		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		317		15685		-1		15506		1		-1		-1		1		15506		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		318		15729		-1		15224		4		-1		-1		4		15224		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		319		15772		-1		14560		1		-1		-1		1		14560		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		320		15820		-1		15051		1		-1		-1		1		15051		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		321		15869		-1		15958		1		-1		-1		1		15958		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		322		15916		-1		15546		1		-1		-1		1		15546		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		323		15966		-1		14445		1		-1		-1		1		14445		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		324		16014		-1		10908		1		-1		-1		1		10908		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		325		16066		-1		13451		1		-1		-1		1		13451		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		326		16120		-1		16454		1		-1		-1		1		16454		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		327		16167		-1		14525		1		-1		-1		1		14525		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		328		16206		-1		11879		1		-1		-1		1		11879		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		329		16255		-1		11540		1		-1		-1		1		11540		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		330		16308		-1		17460		1		-1		-1		1		17460		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		331		16363		-1		14143		1		-1		-1		1		14143		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		332		16409		-1		13600		1		-1		-1		1		13600		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		333		16453		-1		15101		1		-1		-1		1		15101		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		334		16507		-1		17095		1		-1		-1		1		17095		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		335		16571		-1		13285		1		-1		-1		1		13285		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		336		16614		-1		12967		1		-1		-1		1		12967		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		337		16655		-1		13455		1		-1		-1		1		13455		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		338		16704		-1		15756		1		-1		-1		1		15756		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		339		16748		-1		16496		1		-1		-1		1		16496		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		340		16810		-1		12339		1		-1		-1		1		12339		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		341		16861		-1		15933		1		-1		-1		1		15933		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		342		16928		-1		14947		1		-1		-1		1		14947		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		343		16978		-1		13529		1		-1		-1		1		13529		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		344		17037		-1		14440		1		-1		-1		1		14440		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		345		17085		-1		13007		1		-1		-1		1		13007		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		346		17132		-1		15828		1		-1		-1		1		15828		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		347		17186		-1		15490		1		-1		-1		1		15490		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		348		17238		-1		11243		1		-1		-1		1		11243		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		349		17294		-1		11740		1		-1		-1		1		11740		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		350		17351		-1		12954		1		-1		-1		1		12954		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		351		17424		-1		15079		1		-1		-1		1		15079		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		352		17466		-1		11469		1		-1		-1		1		11469		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		353		17515		-1		11030		1		-1		-1		1		11030		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		354		17563		-1		16759		1		-1		-1		1		16759		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		355		17606		-1		16115		1		-1		-1		1		16115		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		356		17656		-1		16347		1		-1		-1		1		16347		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		357		17715		-1		10894		1		-1		-1		1		10894		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		358		17771		-1		12337		1		-1		-1		1		12337		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		359		17817		-1		11639		1		-1		-1		1		11639		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		360		17871		-1		15185		1		-1		-1		1		15185		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		361		17910		-1		14361		1		-1		-1		1		14361		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		362		17960		-1		16817		1		-1		-1		1		16817		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		363		18004		-1		12788		1		-1		-1		1		12788		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		364		18064		-1		13504		1		-1		-1		1		13504		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		365		18117		-1		14958		1		-1		-1		1		14958		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		366		18158		-1		12825		1		-1		-1		1		12825		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		367		18212		-1		13457		1		-1		-1		1		13457		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		368		18263		-1		15814		1		-1		-1		1		15814		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		369		18320		-1		11982		1		-1		-1		1		11982		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		370		18359		-1		17392		1		-1		-1		1		17392		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		371		18412		-1		10992		1		-1		-1		1		10992		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		372		18456		-1		12963		4		-1		-1		4		12963		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		373		18495		-1		17984		1		-1		-1		1		17984		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		374		18546		-1		15727		1		-1		-1		1		15727		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		375		18597		-1		13050		1		-1		-1		1		13050		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		376		18651		-1		11481		1		-1		-1		1		11481		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		377		18700		-1		13438		1		-1		-1		1		13438		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		378		18756		-1		15750		1		-1		-1		1		15750		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		379		18817		-1		15982		1		-1		-1		1		15982		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		380		18859		-1		11542		1		-1		-1		1		11542		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		381		18914		-1		15362		1		-1		-1		1		15362		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		382		18969		-1		12022		1		-1		-1		1		12022		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		383		19023		-1		17549		1		-1		-1		1		17549		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		384		19077		-1		14400		1		-1		-1		1		14400		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		385		19129		-1		11121		1		-1		-1		1		11121		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		386		19182		-1		17205		1		-1		-1		1		17205		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		387		19250		-1		12826		1		-1		-1		1		12826		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		388		19294		-1		10958		1		-1		-1		1		10958		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		389		19339		-1		11861		1		-1		-1		1		11861		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		390		19398		-1		11726		1		-1		-1		1		11726		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		391		19456		-1		14800		1		-1		-1		1		14800		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		392		19505		-1		10888		1		-1		-1		1		10888		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		393		19549		-1		15511		1		-1		-1		1		15511		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		394		19606		-1		16672		1		-1		-1		1		16672		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		395		19649		-1		16906		1		-1		-1		1		16906		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		396		19697		-1		13757		1		-1		-1		1		13757		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		397		19742		-1		10909		4		-1		-1		4		10909		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		398		19790		-1		15007		1		-1		-1		1		15007		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		399		19845		-1		14566		4		-1		-1		4		14566		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		400		19908		-1		12848		1		-1		-1		1		12848		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		401		19966		-1		14735		1		-1		-1		1		14735		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		402		20011		-1		16410		1		-1		-1		1		16410		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		403		20068		-1		15764		1		-1		-1		1		15764		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		404		20123		-1		13918		1		-1		-1		1		13918		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		405		20182		-1		12459		1		-1		-1		1		12459		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		406		20229		-1		15314		1		-1		-1		1		15314		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		407		20290		-1		15229		1		-1		-1		1		15229		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		408		20335		-1		17844		1		-1		-1		1		17844		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		409		20386		-1		14507		1		-1		-1		1		14507		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		410		20449		-1		14183		1		-1		-1		1		14183		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		411		20508		-1		11406		1		-1		-1		1		11406		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		412		20549		-1		12420		1		-1		-1		1		12420		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		413		20599		-1		17411		1		-1		-1		1		17411		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		414		20655		-1		14031		1		-1		-1		1		14031		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		415		20707		-1		14565		1		-1		-1		1		14565		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		416		20757		-1		14922		1		-1		-1		1		14922		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		417		20809		-1		13244		1		-1		-1		1		13244		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		418		20853		-1		12527		1		-1		-1		1		12527		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		419		20898		-1		15495		1		-1		-1		1		15495		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		420		20952		-1		14751		1		-1		-1		1		14751		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		421		21008		-1		11220		1		-1		-1		1		11220		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		422		21049		-1		10956		4		-1		-1		4		10956		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		423		21104		-1		11317		1		-1		-1		1		11317		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		424		21156		-1		16136		1		-1		-1		1		16136		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		425		21206		-1		16730		1		-1		-1		1		16730		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		426		21264		-1		17735		1		-1		-1		1		17735		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		427		21309		-1		17556		1		-1		-1		1		17556		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		428		21372		-1		12927		1		-1		-1		1		12927		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		429		21409		-1		16445		1		-1		-1		1		16445		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		430		21467		-1		16099		1		-1		-1		1		16099		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		431		21521		-1		13309		1		-1		-1		1		13309		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		432		21566		-1		14363		1		-1		-1		1		14363		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		433		21625		-1		11462		4		-1		-1		4		11462		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		434		21677		-1		17661		1		-1		-1		1		17661		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		435		21731		-1		11666		1		-1		-1		1		11666		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		436		21793		-1		11700		4		-1		-1		4		11700		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		437		21838		-1		16039		1		-1		-1		1		16039		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		438		21882		-1		11386		1		-1		-1		1		11386		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		439		21933		-1		17166		1		-1		-1		1		17166		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		440		21979		-1		12850		1		-1		-1		1		12850		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		441		22025		-1		17388		1		-1		-1		1		17388		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		442		22062		-1		14561		1		-1		-1		1		14561		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		443		22106		-1		11358		1		-1		-1		1		11358		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		444		22164		-1		15040		1		-1		-1		1		15040		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		445		22227		-1		13435		1		-1		-1		1		13435		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		446		22279		-1		10842		1		-1		-1		1		10842		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		447		22326		-1		13119		4		-1		-1		4		13119		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		448		22376		-1		15355		1		-1		-1		1		15355		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		449		22433		-1		11756		1		-1		-1		1		11756		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		450		22484		-1		17328		1		-1		-1		1		17328		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		451		22533		-1		16206		1		-1		-1		1		16206		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		452		22577		-1		14889		1		-1		-1		1		14889		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		453		22648		-1		16047		1		-1		-1		1		16047		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		454		22695		-1		11871		1		-1		-1		1		11871		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		455		22743		-1		16141		1		-1		-1		1		16141		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		456		22795		-1		16548		1		-1		-1		1		16548		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		457		22850		-1		13747		1		-1		-1		1		13747		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		458		22899		-1		13749		1		-1		-1		1		13749		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		459		22950		-1		16431		4		-1		-1		4		16431		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		460		23000		-1		16996		4		-1		-1		4		16996		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		461		23039		-1		14136		1		-1		-1		1		14136		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		462		23083		-1		11099		1		-1		-1		1		11099		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		463		23135		-1		13468		1		-1		-1		1		13468		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		464		23187		-1		13975		1		-1		-1		1		13975		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		465		23241		-1		16348		1		-1		-1		1		16348		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		466		23295		-1		13006		1		-1		-1		1		13006		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		467		23346		-1		13057		1		-1		-1		1		13057		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		468		23376		-1		11131		1		-1		-1		1		11131		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		469		23444		-1		11699		1		-1		-1		1		11699		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		470		23487		-1		13531		1		-1		-1		1		13531		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		471		23545		-1		12449		1		-1		-1		1		12449		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		472		23594		-1		16500		1		-1		-1		1		16500		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		473		23659		-1		13421		1		-1		-1		1		13421		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		474		23714		-1		15653		1		-1		-1		1		15653		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		475		23773		-1		14957		1		-1		-1		1		14957		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		476		23828		-1		14818		1		-1		-1		1		14818		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		477		23884		-1		13738		1		-1		-1		1		13738		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		478		23939		-1		15081		1		-1		-1		1		15081		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		479		24001		-1		11316		1		-1		-1		1		11316		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		480		24052		-1		15118		1		-1		-1		1		15118		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		481		24106		-1		12583		4		-1		-1		4		12583		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		482		24154		-1		12948		1		-1		-1		1		12948		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		483		24195		-1		15248		1		-1		-1		1		15248		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		484		24243		-1		17085		1		-1		-1		1		17085		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		485		24296		-1		15325		1		-1		-1		1		15325		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		486		24350		-1		15986		1		-1		-1		1		15986		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		487		24397		-1		11170		1		-1		-1		1		11170		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		488		24441		-1		15035		1		-1		-1		1		15035		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		489		24492		-1		14331		1		-1		-1		1		14331		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		490		24544		-1		15899		1		-1		-1		1		15899		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		491		24596		-1		14569		1		-1		-1		1		14569		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		492		24635		-1		12163		1		-1		-1		1		12163		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		493		24683		-1		15092		1		-1		-1		1		15092		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		494		24722		-1		11070		1		-1		-1		1		11070		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		495		24778		-1		16872		1		-1		-1		1		16872		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		496		24826		-1		11515		1		-1		-1		1		11515		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		497		24875		-1		14242		1		-1		-1		1		14242		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		498		24922		-1		17453		1		-1		-1		1		17453		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		499		24977		-1		11039		1		-1		-1		1		11039		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		500		25013		-1		16606		1		-1		-1		1		16606		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		501		25061		-1		16836		1		-1		-1		1		16836		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		502		25122		-1		17100		1		-1		-1		1		17100		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		503		25166		-1		17567		1		-1		-1		1		17567		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		504		25206		-1		17090		1		-1		-1		1		17090		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		505		25249		-1		13608		4		-1		-1		4		13608		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		506		25293		-1		14308		1		-1		-1		1		14308		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		507		25336		-1		12613		1		-1		-1		1		12613		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		508		25396		-1		16477		1		-1		-1		1		16477		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		509		25437		-1		15055		1		-1		-1		1		15055		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		510		25495		-1		16549		1		-1		-1		1		16549		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		511		25541		-1		15961		1		-1		-1		1		15961		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		512		25590		-1		13850		1		-1		-1		1		13850		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		513		25631		-1		13027		1		-1		-1		1		13027		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		514		25677		-1		13499		1		-1		-1		1		13499		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		515		25726		-1		13870		1		-1		-1		1		13870		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		516		25769		-1		14908		1		-1		-1		1		14908		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		517		25811		-1		13040		1		-1		-1		1		13040		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		518		25853		-1		17122		1		-1		-1		1		17122		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		519		25910		-1		14664		1		-1		-1		1		14664		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		520		25956		-1		11103		1		-1		-1		1		11103		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		521		26003		-1		12071		1		-1		-1		1		12071		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		522		26047		-1		15731		1		-1		-1		1		15731		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		523		26108		-1		14791		1		-1		-1		1		14791		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		524		26163		-1		13159		1		-1		-1		1		13159		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		525		26205		-1		16952		4		-1		-1		4		16952		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		526		26259		-1		15197		1		-1		-1		1		15197		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		527		26307		-1		12560		1		-1		-1		1		12560		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		528		26353		-1		12855		1		-1		-1		1		12855		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		529		26409		-1		11897		4		-1		-1		4		11897		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		530		26454		-1		14849		1		-1		-1		1		14849		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		531		26505		-1		14785		1		-1		-1		1		14785		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		532		26562		-1		11198		1		-1		-1		1		11198		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		533		26616		-1		13869		1		-1		-1		1		13869		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		534		26654		-1		12052		1		-1		-1		1		12052		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		535		26705		-1		16769		4		-1		-1		4		16769		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		536		26767		-1		17733		1		-1		-1		1		17733		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		537		26819		-1		14278		1		-1		-1		1		14278		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		538		26873		-1		14631		1		-1		-1		1		14631		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		539		26915		-1		17686		1		-1		-1		1		17686		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		540		26967		-1		17210		1		-1		-1		1		17210		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		541		27016		-1		14964		1		-1		-1		1		14964		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		542		27065		-1		14512		1		-1		-1		1		14512		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		543		27115		-1		14864		1		-1		-1		1		14864		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		544		27163		-1		17063		1		-1		-1		1		17063		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		545		27210		-1		11219		1		-1		-1		1		11219		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		546		27262		-1		15257		1		-1		-1		1		15257		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		547		27305		-1		12226		1		-1		-1		1		12226		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		548		27343		-1		13831		1		-1		-1		1		13831		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		549		27394		-1		12134		1		-1		-1		1		12134		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		550		27444		-1		13126		1		-1		-1		1		13126		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		551		27488		-1		11565		1		-1		-1		1		11565		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		552		27545		-1		15281		1		-1		-1		1		15281		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		553		27603		-1		12294		1		-1		-1		1		12294		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		554		27644		-1		12071		4		-1		-1		4		12071		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		555		27692		-1		14739		1		-1		-1		1		14739		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		556		27739		-1		17897		1		-1		-1		1		17897		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		557		27802		-1		13953		1		-1		-1		1		13953		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		558		27842		-1		13768		1		-1		-1		1		13768		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		559		27889		-1		12176		1		-1		-1		1		12176		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		560		27950		-1		12297		1		-1		-1		1		12297		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		561		28004		-1		14236		1		-1		-1		1		14236		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		562		28058		-1		16877		4		-1		-1		4		16877		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		563		28121		-1		14819		1		-1		-1		1		14819		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		564		28186		-1		11341		1		-1		-1		1		11341		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		565		28230		-1		15573		1		-1		-1		1		15573		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		566		28282		-1		12281		1		-1		-1		1		12281		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		567		28325		-1		14459		1		-1		-1		1		14459		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		568		28387		-1		16438		1		-1		-1		1		16438		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		569		28445		-1		17892		1		-1		-1		1		17892		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		570		28493		-1		17475		1		-1		-1		1		17475		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		571		28533		-1		16319		1		-1		-1		1		16319		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		572		28576		-1		16004		1		-1		-1		1		16004		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		573		28623		-1		15200		1		-1		-1		1		15200		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		574		28673		-1		11643		1		-1		-1		1		11643		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		575		28729		-1		15474		1		-1		-1		1		15474		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		576		28787		-1		13156		4		-1		-1		4		13156		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		577		28835		-1		12661		1		-1		-1		1		12661		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		578		28880		-1		17647		1		-1		-1		1		17647		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		579		28922		-1		17722		1		-1		-1		1		17722		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		580		28979		-1		13110		1		-1		-1		1		13110		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		581		29030		-1		13290		1		-1		-1		1		13290		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		582		29081		-1		14096		4		-1		-1		4		14096		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		583		29130		-1		15635		1		-1		-1		1		15635		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		584		29189		-1		12683		1		-1		-1		1		12683		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		585		29240		-1		15055		1		-1		-1		1		15055		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		586		29290		-1		11773		1		-1		-1		1		11773		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		587		29349		-1		17153		1		-1		-1		1		17153		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		588		29397		-1		15407		1		-1		-1		1		15407		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		589		29450		-1		13385		1		-1		-1		1		13385		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		590		29500		-1		14128		1		-1		-1		1		14128		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		591		29550		-1		12787		1		-1		-1		1		12787		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		592		29596		-1		17486		1		-1		-1		1		17486		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		593		29637		-1		13101		1		-1		-1		1		13101		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		594		29692		-1		16381		1		-1		-1		1		16381		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		595		29749		-1		12712		1		-1		-1		1		12712		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		596		29793		-1		14329		1		-1		-1		1		14329		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		597		29854		-1		14547		1		-1		-1		1		14547		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		598		29910		-1		16531		1		-1		-1		1		16531		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		599		29967		-1		14508		1		-1		-1		1		14508		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		600		30023		-1		14760		1		-1		-1		1		14760		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		601		30068		-1		11927		1		-1		-1		1		11927		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		602		30114		-1		11827		1		-1		-1		1		11827		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		603		30178		-1		15369		1		-1		-1		1		15369		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		604		30233		-1		17568		1		-1		-1		1		17568		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		605		30283		-1		12156		1		-1		-1		1		12156		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		606		30324		-1		14403		1		-1		-1		1		14403		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		607		30373		-1		16822		1		-1		-1		1		16822		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		608		30432		-1		12942		1		-1		-1		1		12942		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		609		30489		-1		11703		1		-1		-1		1		11703		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		610		30549		-1		11724		1		-1		-1		1		11724		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		611		30599		-1		16663		1		-1		-1		1		16663		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		612		30657		-1		14341		1		-1		-1		1		14341		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		613		30704		-1		14719		1		-1		-1		1		14719		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		614		30758		-1		16153		1		-1		-1		1		16153		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		615		30807		-1		14410		1		-1		-1		1		14410		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		616		30849		-1		13164		1		-1		-1		1		13164		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		617		30904		-1		14082		1		-1		-1		1		14082		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		618		30949		-1		11845		1		-1		-1		1		11845		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		619		30998		-1		17811		1		-1		-1		1		17811		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		620		31047		-1		11874		1		-1		-1		1		11874		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		621		31097		-1		12754		1		-1		-1		1		12754		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		622		31150		-1		13025		1		-1		-1		1		13025		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		623		31205		-1		11754		1		-1		-1		1		11754		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		624		31248		-1		12715		1		-1		-1		1		12715		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		625		31309		-1		13011		1		-1		-1		1		13011		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		626		31358		-1		12521		4		-1		-1		4		12521		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		627		31407		-1		13852		1		-1		-1		1		13852		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		628		31461		-1		13837		1		-1		-1		1		13837		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		629		31511		-1		17195		1		-1		-1		1		17195		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		630		31555		-1		13369		1		-1		-1		1		13369		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		631		31606		-1		13311		1		-1		-1		1		13311		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		632		31652		-1		14380		1		-1		-1		1		14380		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		633		31698		-1		14362		1		-1		-1		1		14362		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		634		31740		-1		11445		1		-1		-1		1		11445		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		635		31786		-1		17644		1		-1		-1		1		17644		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		636		31845		-1		16555		1		-1		-1		1		16555		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		637		31909		-1		15634		1		-1		-1		1		15634		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		638		31975		-1		16606		4		-1		-1		4		16606		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		639		32024		-1		14455		1		-1		-1		1		14455		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		640		32085		-1		15335		1		-1		-1		1		15335		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		641		32136		-1		13123		1		-1		-1		1		13123		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		642		32199		-1		13432		1		-1		-1		1		13432		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		643		32245		-1		14431		1		-1		-1		1		14431		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		644		32289		-1		12771		1		-1		-1		1		12771		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		645		32337		-1		11657		1		-1		-1		1		11657		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		646		32383		-1		10809		1		-1		-1		1		10809		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		647		32445		-1		14864		1		-1		-1		1		14864		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		648		32495		-1		16190		1		-1		-1		1		16190		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		649		32550		-1		14934		1		-1		-1		1		14934		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		650		32605		-1		14195		1		-1		-1		1		14195		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		651		32652		-1		17759		1		-1		-1		1		17759		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		652		32701		-1		15368		1		-1		-1		1		15368		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		653		32744		-1		16292		1		-1		-1		1		16292		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		654		32790		-1		16699		4		-1		-1		4		16699		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		655		32838		-1		14392		1		-1		-1		1		14392		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		656		32893		-1		17871		1		-1		-1		1		17871		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		657		32943		-1		16055		1		-1		-1		1		16055		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		658		32988		-1		10910		1		-1		-1		1		10910		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		659		33037		-1		12835		1		-1		-1		1		12835		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		660		33085		-1		12093		1		-1		-1		1		12093		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		661		33147		-1		13968		1		-1		-1		1		13968		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		662		33197		-1		12055		1		-1		-1		1		12055		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		663		33248		-1		16743		1		-1		-1		1		16743		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		664		33307		-1		16102		1		-1		-1		1		16102		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		665		33353		-1		12371		1		-1		-1		1		12371		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		666		33403		-1		16710		1		-1		-1		1		16710		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		667		33450		-1		13731		1		-1		-1		1		13731		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		668		33488		-1		14180		1		-1		-1		1		14180		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		669		33528		-1		14922		1		-1		-1		1		14922		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		670		33577		-1		15022		1		-1		-1		1		15022		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		671		33617		-1		10949		1		-1		-1		1		10949		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		672		33669		-1		15911		1		-1		-1		1		15911		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		673		33715		-1		14599		1		-1		-1		1		14599		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		674		33762		-1		12262		1		-1		-1		1		12262		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		675		33817		-1		17904		1		-1		-1		1		17904		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		676		33868		-1		10891		1		-1		-1		1		10891		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		677		33913		-1		12214		4		-1		-1		4		12214		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		678		33961		-1		13171		1		-1		-1		1		13171		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		679		34010		-1		15155		1		-1		-1		1		15155		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		680		34049		-1		14884		4		-1		-1		4		14884		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		681		34110		-1		16433		1		-1		-1		1		16433		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		682		34164		-1		12568		1		-1		-1		1		12568		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		683		34216		-1		11618		1		-1		-1		1		11618		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		684		34283		-1		14521		1		-1		-1		1		14521		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		685		34336		-1		15572		1		-1		-1		1		15572		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		686		34389		-1		13065		1		-1		-1		1		13065		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		687		34438		-1		14367		1		-1		-1		1		14367		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		688		34487		-1		15557		1		-1		-1		1		15557		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		689		34531		-1		11016		1		-1		-1		1		11016		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		690		34579		-1		13737		1		-1		-1		1		13737		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		691		34632		-1		12346		1		-1		-1		1		12346		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		692		34675		-1		16994		1		-1		-1		1		16994		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		693		34733		-1		13793		1		-1		-1		1		13793		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		694		34798		-1		11925		1		-1		-1		1		11925		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		695		34844		-1		12859		1		-1		-1		1		12859		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		696		34887		-1		15605		1		-1		-1		1		15605		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		697		34932		-1		13445		1		-1		-1		1		13445		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		698		34993		-1		12470		1		-1		-1		1		12470		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		699		35051		-1		13970		1		-1		-1		1		13970		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		700		35098		-1		13230		1		-1		-1		1		13230		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		701		35140		-1		13619		1		-1		-1		1		13619		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		702		35196		-1		15470		1		-1		-1		1		15470		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		703		35238		-1		13112		1		-1		-1		1		13112		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		704		35297		-1		15026		1		-1		-1		1		15026		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		705		35351		-1		13489		1		-1		-1		1		13489		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		706		35394		-1		11929		1		-1		-1		1		11929		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		707		35435		-1		11610		1		-1		-1		1		11610		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		708		35484		-1		15342		1		-1		-1		1		15342		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		709		35546		-1		14563		1		-1		-1		1		14563		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		710		35594		-1		12408		1		-1		-1		1		12408		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		711		35639		-1		11921		1		-1		-1		1		11921		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		712		35680		-1		12434		4		-1		-1		4		12434		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		713		35733		-1		14705		1		-1		-1		1		14705		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		714		35779		-1		15320		1		-1		-1		1		15320		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		715		35831		-1		15196		1		-1		-1		1		15196		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		716		35877		-1		13532		1		-1		-1		1		13532		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		717		35936		-1		16975		1		-1		-1		1		16975		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		718		35987		-1		13476		1		-1		-1		1		13476		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		719		36034		-1		12532		1		-1		-1		1		12532		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		720		36079		-1		15050		1		-1		-1		1		15050		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		721		36135		-1		12183		1		-1		-1		1		12183		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		722		36192		-1		10904		1		-1		-1		1		10904		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		723		36239		-1		12111		1		-1		-1		1		12111		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		724		36289		-1		17234		1		-1		-1		1		17234		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		725		36345		-1		13736		1		-1		-1		1		13736		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		726		36401		-1		17092		1		-1		-1		1		17092		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		727		36456		-1		12950		1		-1		-1		1		12950		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		728		36506		-1		15136		1		-1		-1		1		15136		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		729		36565		-1		16485		1		-1		-1		1		16485		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		730		36614		-1		15167		1		-1		-1		1		15167		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		731		36652		-1		13093		1		-1		-1		1		13093		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		732		36707		-1		12525		1		-1		-1		1		12525		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		733		36755		-1		12802		1		-1		-1		1		12802		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		734		36816		-1		12582		1		-1		-1		1		12582		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		735		36871		-1		13587		1		-1		-1		1		13587		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		736		36919		-1		11406		1		-1		-1		1		11406		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		737		36973		-1		11538		1		-1		-1		1		11538		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		738		37020		-1		15243		1		-1		-1		1		15243		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		739		37059		-1		11113		1		-1		-1		1		11113		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		740		37107		-1		12668		1		-1		-1		1		12668		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		741		37167		-1		11354		4		-1		-1		4		11354		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		742		37221		-1		13337		1		-1		-1		1		13337		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		743		37274		-1		11892		1		-1		-1		1		11892		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		744		37327		-1		13237		1		-1		-1		1		13237		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		745		37365		-1		11644		1		-1		-1		1		11644		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		746		37418		-1		11830		1		-1		-1		1		11830		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		747		37473		-1		12188		1		-1		-1		1		12188		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		748		37527		-1		17761		4		-1		-1		4		17761		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		749		37564		-1		14628		1		-1		-1		1		14628		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		750		37611		-1		15246		1		-1		-1		1		15246		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		751		37667		-1		16952		1		-1		-1		1		16952		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		752		37724		-1		11957		1		-1		-1		1		11957		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		753		37767		-1		16006		1		-1		-1		1		16006		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		754		37817		-1		17850		4		-1		-1		4		17850		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		755		37851		-1		13751		1		-1		-1		1		13751		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		756		37904		-1		12673		1		-1		-1		1		12673		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		757		37947		-1		11522		1		-1		-1		1		11522		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		758		37991		-1		10938		1		-1		-1		1		10938		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		759		38039		-1		17660		1		-1		-1		1		17660		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		760		38096		-1		14032		1		-1		-1		1		14032		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		761		38155		-1		15258		1		-1		-1		1		15258		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		762		38198		-1		12139		1		-1		-1		1		12139		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		763		38248		-1		14086		1		-1		-1		1		14086		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		764		38296		-1		14484		1		-1		-1		1		14484		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		765		38342		-1		11293		1		-1		-1		1		11293		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		766		38394		-1		17030		1		-1		-1		1		17030		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		767		38442		-1		12077		1		-1		-1		1		12077		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		768		38492		-1		11318		4		-1		-1		4		11318		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		769		38553		-1		13383		1		-1		-1		1		13383		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		770		38601		-1		15101		1		-1		-1		1		15101		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		771		38652		-1		17877		1		-1		-1		1		17877		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		772		38705		-1		17760		1		-1		-1		1		17760		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		773		38756		-1		14107		1		-1		-1		1		14107		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		774		38798		-1		13346		1		-1		-1		1		13346		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		775		38848		-1		11835		1		-1		-1		1		11835		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		776		38892		-1		15491		1		-1		-1		1		15491		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		777		38948		-1		15587		1		-1		-1		1		15587		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		778		38995		-1		13811		1		-1		-1		1		13811		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		779		39039		-1		13176		1		-1		-1		1		13176		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		780		39087		-1		11578		1		-1		-1		1		11578		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		781		39124		-1		17062		4		-1		-1		4		17062		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		782		39165		-1		14860		1		-1		-1		1		14860		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		783		39212		-1		14156		1		-1		-1		1		14156		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		784		39270		-1		15408		1		-1		-1		1		15408		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		785		39315		-1		17445		1		-1		-1		1		17445		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		786		39373		-1		14298		1		-1		-1		1		14298		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		787		39419		-1		12634		1		-1		-1		1		12634		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		788		39462		-1		12706		1		-1		-1		1		12706		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		789		39519		-1		14715		1		-1		-1		1		14715		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		790		39568		-1		14105		1		-1		-1		1		14105		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		791		39615		-1		14325		1		-1		-1		1		14325		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		792		39667		-1		11437		1		-1		-1		1		11437		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		793		39721		-1		11316		1		-1		-1		1		11316		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		794		39775		-1		11541		1		-1		-1		1		11541		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		795		39819		-1		11426		1		-1		-1		1		11426		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		796		39873		-1		17357		1		-1		-1		1		17357		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		797		39928		-1		12025		1		-1		-1		1		12025		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		798		39961		-1		14049		1		-1		-1		1		14049		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		799		40015		-1		14350		1		-1		-1		1		14350		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		800		40072		-1		16120		1		-1		-1		1		16120		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		801		40121		-1		12200		1		-1		-1		1		12200		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		802		40163		-1		13088		1		-1		-1		1		13088		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		803		40208		-1		14136		1		-1		-1		1		14136		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		804		40247		-1		15346		1		-1		-1		1		15346		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		805		40292		-1		11861		1		-1		-1		1		11861		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		806		40338		-1		10973		1		-1		-1		1		10973		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		807		40382		-1		11120		1		-1		-1		1		11120		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		808		40426		-1		16353		1		-1		-1		1		16353		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		809		40475		-1		13230		1		-1		-1		1		13230		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		810		40511		-1		16729		1		-1		-1		1		16729		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		811		40568		-1		13733		1		-1		-1		1		13733		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		812		40625		-1		14153		1		-1		-1		1		14153		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		813		40682		-1		16275		1		-1		-1		1		16275		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		814		40740		-1		17730		1		-1		-1		1		17730		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		815		40776		-1		12610		1		-1		-1		1		12610		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		816		40829		-1		14168		1		-1		-1		1		14168		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		817		40871		-1		13256		1		-1		-1		1		13256		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		818		40900		-1		13184		1		-1		-1		1		13184		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		819		40951		-1		11095		1		-1		-1		1		11095		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		820		40989		-1		15238		1		-1		-1		1		15238		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		821		41032		-1		17211		1		-1		-1		1		17211		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		822		41085		-1		17569		1		-1		-1		1		17569		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		823		41128		-1		15641		1		-1		-1		1		15641		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		824		41184		-1		16299		1		-1		-1		1		16299		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		825		41242		-1		11136		1		-1		-1		1		11136		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		826		41294		-1		16129		1		-1		-1		1		16129		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		827		41360		-1		15233		1		-1		-1		1		15233		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		828		41409		-1		11850		1		-1		-1		1		11850		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		829		41469		-1		12841		1		-1		-1		1		12841		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		830		41522		-1		15832		1		-1		-1		1		15832		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		831		41567		-1		13559		1		-1		-1		1		13559		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		832		41621		-1		15828		4		-1		-1		4		15828		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		833		41668		-1		13520		1		-1		-1		1		13520		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		834		41715		-1		14767		1		-1		-1		1		14767		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		835		41770		-1		14594		1		-1		-1		1		14594		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		836		41820		-1		15720		1		-1		-1		1		15720		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		837		41867		-1		14659		1		-1		-1		1		14659		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		838		41929		-1		11518		1		-1		-1		1		11518		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		839		41993		-1		16493		4		-1		-1		4		16493		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		840		42039		-1		12002		4		-1		-1		4		12002		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		841		42083		-1		12910		1		-1		-1		1		12910		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		842		42142		-1		15989		1		-1		-1		1		15989		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		843		42204		-1		16217		1		-1		-1		1		16217		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		844		42249		-1		15632		1		-1		-1		1		15632		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		845		42298		-1		15239		1		-1		-1		1		15239		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		846		42349		-1		13867		1		-1		-1		1		13867		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		847		42408		-1		12554		1		-1		-1		1		12554		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		848		42449		-1		14149		1		-1		-1		1		14149		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		849		42495		-1		15062		1		-1		-1		1		15062		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		850		42550		-1		15389		1		-1		-1		1		15389		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		851		42593		-1		17107		1		-1		-1		1		17107		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		852		42648		-1		13616		1		-1		-1		1		13616		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		853		42696		-1		13403		1		-1		-1		1		13403		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		854		42760		-1		15237		1		-1		-1		1		15237		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		855		42805		-1		14305		1		-1		-1		1		14305		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		856		42861		-1		14482		1		-1		-1		1		14482		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		857		42906		-1		13199		1		-1		-1		1		13199		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		858		42955		-1		14330		1		-1		-1		1		14330		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		859		43001		-1		12802		1		-1		-1		1		12802		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		860		43047		-1		15430		1		-1		-1		1		15430		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		861		43100		-1		17604		1		-1		-1		1		17604		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		862		43147		-1		17152		4		-1		-1		4		17152		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		863		43192		-1		14393		1		-1		-1		1		14393		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		864		43236		-1		13495		1		-1		-1		1		13495		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		865		43291		-1		11584		1		-1		-1		1		11584		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		866		43331		-1		14202		1		-1		-1		1		14202		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		867		43376		-1		11756		1		-1		-1		1		11756		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		868		43435		-1		16333		1		-1		-1		1		16333		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		869		43489		-1		13912		1		-1		-1		1		13912		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		870		43531		-1		12709		1		-1		-1		1		12709		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		871		43567		-1		16890		1		-1		-1		1		16890		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		872		43624		-1		12443		1		-1		-1		1		12443		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		873		43674		-1		13390		1		-1		-1		1		13390		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		874		43716		-1		11279		1		-1		-1		1		11279		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		875		43763		-1		13878		1		-1		-1		1		13878		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		876		43808		-1		14318		1		-1		-1		1		14318		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		877		43857		-1		16821		1		-1		-1		1		16821		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		878		43905		-1		15685		1		-1		-1		1		15685		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		879		43958		-1		16819		1		-1		-1		1		16819		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		880		44006		-1		11731		1		-1		-1		1		11731		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		881		44051		-1		16213		1		-1		-1		1		16213		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		882		44092		-1		16054		1		-1		-1		1		16054		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		883		44156		-1		17000		1		-1		-1		1		17000		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		884		44215		-1		15831		1		-1		-1		1		15831		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		885		44263		-1		16271		1		-1		-1		1		16271		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		886		44301		-1		14329		1		-1		-1		1		14329		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		887		44347		-1		12693		1		-1		-1		1		12693		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		888		44399		-1		17072		1		-1		-1		1		17072		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		889		44446		-1		14484		1		-1		-1		1		14484		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		890		44487		-1		11880		1		-1		-1		1		11880		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		891		44531		-1		12345		1		-1		-1		1		12345		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		892		44578		-1		14173		1		-1		-1		1		14173		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		893		44622		-1		14372		1		-1		-1		1		14372		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		894		44662		-1		12273		1		-1		-1		1		12273		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		895		44698		-1		11922		4		-1		-1		4		11922		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		896		44749		-1		15224		1		-1		-1		1		15224		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		897		44803		-1		16234		1		-1		-1		1		16234		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		898		44858		-1		12768		1		-1		-1		1		12768		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		899		44895		-1		15865		1		-1		-1		1		15865		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		900		44950		-1		11060		1		-1		-1		1		11060		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		901		45004		-1		12488		1		-1		-1		1		12488		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		902		45061		-1		12418		1		-1		-1		1		12418		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		903		45114		-1		14546		1		-1		-1		1		14546		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		904		45174		-1		14289		1		-1		-1		1		14289		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		905		45224		-1		16015		1		-1		-1		1		16015		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		906		45274		-1		16967		1		-1		-1		1		16967		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		907		45335		-1		16046		1		-1		-1		1		16046		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		908		45382		-1		12017		1		-1		-1		1		12017		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		909		45424		-1		16845		1		-1		-1		1		16845		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		910		45478		-1		12052		1		-1		-1		1		12052		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		911		45518		-1		12477		1		-1		-1		1		12477		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		912		45566		-1		11306		1		-1		-1		1		11306		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		913		45628		-1		15946		1		-1		-1		1		15946		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		914		45680		-1		14345		1		-1		-1		1		14345		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		915		45738		-1		14983		1		-1		-1		1		14983		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		916		45775		-1		12972		1		-1		-1		1		12972		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		917		45825		-1		17208		1		-1		-1		1		17208		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		918		45879		-1		14950		1		-1		-1		1		14950		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		919		45939		-1		17900		1		-1		-1		1		17900		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		920		45994		-1		14218		1		-1		-1		1		14218		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		921		46044		-1		13438		1		-1		-1		1		13438		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		922		46109		-1		14171		1		-1		-1		1		14171		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		923		46149		-1		16180		1		-1		-1		1		16180		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		924		46199		-1		14828		1		-1		-1		1		14828		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		925		46248		-1		14937		1		-1		-1		1		14937		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		926		46297		-1		13603		1		-1		-1		1		13603		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		927		46345		-1		17640		1		-1		-1		1		17640		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		928		46391		-1		13682		1		-1		-1		1		13682		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		929		46440		-1		15664		1		-1		-1		1		15664		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		930		46484		-1		13907		1		-1		-1		1		13907		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		931		46536		-1		11539		1		-1		-1		1		11539		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		932		46587		-1		14107		1		-1		-1		1		14107		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		933		46642		-1		11582		1		-1		-1		1		11582		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		934		46701		-1		15019		1		-1		-1		1		15019		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		935		46770		-1		12009		1		-1		-1		1		12009		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		936		46805		-1		13716		1		-1		-1		1		13716		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		937		46841		-1		13802		1		-1		-1		1		13802		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		938		46899		-1		17259		1		-1		-1		1		17259		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		939		46942		-1		17422		1		-1		-1		1		17422		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		940		46993		-1		14357		1		-1		-1		1		14357		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		941		47042		-1		11963		1		-1		-1		1		11963		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		942		47085		-1		11288		1		-1		-1		1		11288		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		943		47127		-1		13813		1		-1		-1		1		13813		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		944		47172		-1		17132		1		-1		-1		1		17132		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		945		47219		-1		15084		1		-1		-1		1		15084		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		946		47259		-1		14512		1		-1		-1		1		14512		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		947		47306		-1		16423		1		-1		-1		1		16423		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		948		47358		-1		15673		1		-1		-1		1		15673		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		949		47422		-1		15907		1		-1		-1		1		15907		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		950		47480		-1		13568		1		-1		-1		1		13568		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		951		47520		-1		14998		1		-1		-1		1		14998		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		952		47578		-1		15310		1		-1		-1		1		15310		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		953		47638		-1		10811		1		-1		-1		1		10811		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		954		47682		-1		15695		1		-1		-1		1		15695		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		955		47729		-1		14004		1		-1		-1		1		14004		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		956		47788		-1		11524		1		-1		-1		1		11524		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		957		47832		-1		13585		1		-1		-1		1		13585		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		958		47886		-1		16397		1		-1		-1		1		16397		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		959		47946		-1		12874		1		-1		-1		1		12874		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		960		48010		-1		14821		1		-1		-1		1		14821		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		961		48061		-1		14467		1		-1		-1		1		14467		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		962		48109		-1		13999		1		-1		-1		1		13999		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		963		48159		-1		17598		1		-1		-1		1		17598		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		964		48206		-1		15967		1		-1		-1		1		15967		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		965		48251		-1		15808		1		-1		-1		1		15808		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		966		48303		-1		13708		1		-1		-1		1		13708		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		967		48358		-1		16731		4		-1		-1		4		16731		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		968		48415		-1		16273		1		-1		-1		1		16273		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		969		48471		-1		16104		1		-1		-1		1		16104		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		970		48521		-1		16121		1		-1		-1		1		16121		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		971		48561		-1		14016		1		-1		-1		1		14016		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		972		48612		-1		11005		1		-1		-1		1		11005		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		973		48669		-1		14102		4		-1		-1		4		14102		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		974		48708		-1		12088		1		-1		-1		1		12088		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		975		48763		-1		14193		1		-1		-1		1		14193		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		976		48800		-1		16619		1		-1		-1		1		16619		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		977		48835		-1		12638		1		-1		-1		1		12638		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		978		48893		-1		14240		1		-1		-1		1		14240		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		979		48929		-1		15478		1		-1		-1		1		15478		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		980		48976		-1		13685		1		-1		-1		1		13685		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		981		49021		-1		12262		1		-1		-1		1		12262		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		982		49084		-1		15357		1		-1		-1		1		15357		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		983		49123		-1		11480		1		-1		-1		1		11480		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		984		49176		-1		13639		1		-1		-1		1		13639		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		985		49227		-1		16395		1		-1		-1		1		16395		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		986		49274		-1		12338		1		-1		-1		1		12338		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		987		49319		-1		16620		1		-1		-1		1		16620		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		988		49369		-1		11061		1		-1		-1		1		11061		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		989		49421		-1		14556		1		-1		-1		1		14556		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		990		49475		-1		14799		1		-1		-1		1		14799		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		991		49520		-1		14806		1		-1		-1		1		14806		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		992		49576		-1		16362		1		-1		-1		1		16362		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		993		49621		-1		13291		1		-1		-1		1		13291		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		994		49672		-1		17639		1		-1		-1		1		17639		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		995		49728		-1		14069		1		-1		-1		1		14069		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		996		49773		-1		16008		1		-1		-1		1		16008		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		997		49827		-1		17437		1		-1		-1		1		17437		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		998		49879		-1		13656		1		-1		-1		1		13656		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		999		49944		-1		12895		1		-1		-1		1		12895		-1		-1		-1		-1		-1		-1		-1		-1		-1
+;IDMapping: swfID:jobID:taskID
+; 0:0:0, 1:1:0, 2:2:0, 3:3:0, 4:4:0, 5:5:0, 6:6:0, 7:7:0, 8:8:0, 9:9:0, 
+; 10:10:0, 11:11:0, 12:12:0, 13:13:0, 14:14:0, 15:15:0, 16:16:0, 17:17:0, 18:18:0, 19:19:0, 
+; 20:20:0, 21:21:0, 22:22:0, 23:23:0, 24:24:0, 25:25:0, 26:26:0, 27:27:0, 28:28:0, 29:29:0, 
+; 30:30:0, 31:31:0, 32:32:0, 33:33:0, 34:34:0, 35:35:0, 36:36:0, 37:37:0, 38:38:0, 39:39:0, 
+; 40:40:0, 41:41:0, 42:42:0, 43:43:0, 44:44:0, 45:45:0, 46:46:0, 47:47:0, 48:48:0, 49:49:0, 
+; 50:50:0, 51:51:0, 52:52:0, 53:53:0, 54:54:0, 55:55:0, 56:56:0, 57:57:0, 58:58:0, 59:59:0, 
+; 60:60:0, 61:61:0, 62:62:0, 63:63:0, 64:64:0, 65:65:0, 66:66:0, 67:67:0, 68:68:0, 69:69:0, 
+; 70:70:0, 71:71:0, 72:72:0, 73:73:0, 74:74:0, 75:75:0, 76:76:0, 77:77:0, 78:78:0, 79:79:0, 
+; 80:80:0, 81:81:0, 82:82:0, 83:83:0, 84:84:0, 85:85:0, 86:86:0, 87:87:0, 88:88:0, 89:89:0, 
+; 90:90:0, 91:91:0, 92:92:0, 93:93:0, 94:94:0, 95:95:0, 96:96:0, 97:97:0, 98:98:0, 99:99:0, 
+; 100:100:0, 101:101:0, 102:102:0, 103:103:0, 104:104:0, 105:105:0, 106:106:0, 107:107:0, 108:108:0, 109:109:0, 
+; 110:110:0, 111:111:0, 112:112:0, 113:113:0, 114:114:0, 115:115:0, 116:116:0, 117:117:0, 118:118:0, 119:119:0, 
+; 120:120:0, 121:121:0, 122:122:0, 123:123:0, 124:124:0, 125:125:0, 126:126:0, 127:127:0, 128:128:0, 129:129:0, 
+; 130:130:0, 131:131:0, 132:132:0, 133:133:0, 134:134:0, 135:135:0, 136:136:0, 137:137:0, 138:138:0, 139:139:0, 
+; 140:140:0, 141:141:0, 142:142:0, 143:143:0, 144:144:0, 145:145:0, 146:146:0, 147:147:0, 148:148:0, 149:149:0, 
+; 150:150:0, 151:151:0, 152:152:0, 153:153:0, 154:154:0, 155:155:0, 156:156:0, 157:157:0, 158:158:0, 159:159:0, 
+; 160:160:0, 161:161:0, 162:162:0, 163:163:0, 164:164:0, 165:165:0, 166:166:0, 167:167:0, 168:168:0, 169:169:0, 
+; 170:170:0, 171:171:0, 172:172:0, 173:173:0, 174:174:0, 175:175:0, 176:176:0, 177:177:0, 178:178:0, 179:179:0, 
+; 180:180:0, 181:181:0, 182:182:0, 183:183:0, 184:184:0, 185:185:0, 186:186:0, 187:187:0, 188:188:0, 189:189:0, 
+; 190:190:0, 191:191:0, 192:192:0, 193:193:0, 194:194:0, 195:195:0, 196:196:0, 197:197:0, 198:198:0, 199:199:0, 
+; 200:200:0, 201:201:0, 202:202:0, 203:203:0, 204:204:0, 205:205:0, 206:206:0, 207:207:0, 208:208:0, 209:209:0, 
+; 210:210:0, 211:211:0, 212:212:0, 213:213:0, 214:214:0, 215:215:0, 216:216:0, 217:217:0, 218:218:0, 219:219:0, 
+; 220:220:0, 221:221:0, 222:222:0, 223:223:0, 224:224:0, 225:225:0, 226:226:0, 227:227:0, 228:228:0, 229:229:0, 
+; 230:230:0, 231:231:0, 232:232:0, 233:233:0, 234:234:0, 235:235:0, 236:236:0, 237:237:0, 238:238:0, 239:239:0, 
+; 240:240:0, 241:241:0, 242:242:0, 243:243:0, 244:244:0, 245:245:0, 246:246:0, 247:247:0, 248:248:0, 249:249:0, 
+; 250:250:0, 251:251:0, 252:252:0, 253:253:0, 254:254:0, 255:255:0, 256:256:0, 257:257:0, 258:258:0, 259:259:0, 
+; 260:260:0, 261:261:0, 262:262:0, 263:263:0, 264:264:0, 265:265:0, 266:266:0, 267:267:0, 268:268:0, 269:269:0, 
+; 270:270:0, 271:271:0, 272:272:0, 273:273:0, 274:274:0, 275:275:0, 276:276:0, 277:277:0, 278:278:0, 279:279:0, 
+; 280:280:0, 281:281:0, 282:282:0, 283:283:0, 284:284:0, 285:285:0, 286:286:0, 287:287:0, 288:288:0, 289:289:0, 
+; 290:290:0, 291:291:0, 292:292:0, 293:293:0, 294:294:0, 295:295:0, 296:296:0, 297:297:0, 298:298:0, 299:299:0, 
+; 300:300:0, 301:301:0, 302:302:0, 303:303:0, 304:304:0, 305:305:0, 306:306:0, 307:307:0, 308:308:0, 309:309:0, 
+; 310:310:0, 311:311:0, 312:312:0, 313:313:0, 314:314:0, 315:315:0, 316:316:0, 317:317:0, 318:318:0, 319:319:0, 
+; 320:320:0, 321:321:0, 322:322:0, 323:323:0, 324:324:0, 325:325:0, 326:326:0, 327:327:0, 328:328:0, 329:329:0, 
+; 330:330:0, 331:331:0, 332:332:0, 333:333:0, 334:334:0, 335:335:0, 336:336:0, 337:337:0, 338:338:0, 339:339:0, 
+; 340:340:0, 341:341:0, 342:342:0, 343:343:0, 344:344:0, 345:345:0, 346:346:0, 347:347:0, 348:348:0, 349:349:0, 
+; 350:350:0, 351:351:0, 352:352:0, 353:353:0, 354:354:0, 355:355:0, 356:356:0, 357:357:0, 358:358:0, 359:359:0, 
+; 360:360:0, 361:361:0, 362:362:0, 363:363:0, 364:364:0, 365:365:0, 366:366:0, 367:367:0, 368:368:0, 369:369:0, 
+; 370:370:0, 371:371:0, 372:372:0, 373:373:0, 374:374:0, 375:375:0, 376:376:0, 377:377:0, 378:378:0, 379:379:0, 
+; 380:380:0, 381:381:0, 382:382:0, 383:383:0, 384:384:0, 385:385:0, 386:386:0, 387:387:0, 388:388:0, 389:389:0, 
+; 390:390:0, 391:391:0, 392:392:0, 393:393:0, 394:394:0, 395:395:0, 396:396:0, 397:397:0, 398:398:0, 399:399:0, 
+; 400:400:0, 401:401:0, 402:402:0, 403:403:0, 404:404:0, 405:405:0, 406:406:0, 407:407:0, 408:408:0, 409:409:0, 
+; 410:410:0, 411:411:0, 412:412:0, 413:413:0, 414:414:0, 415:415:0, 416:416:0, 417:417:0, 418:418:0, 419:419:0, 
+; 420:420:0, 421:421:0, 422:422:0, 423:423:0, 424:424:0, 425:425:0, 426:426:0, 427:427:0, 428:428:0, 429:429:0, 
+; 430:430:0, 431:431:0, 432:432:0, 433:433:0, 434:434:0, 435:435:0, 436:436:0, 437:437:0, 438:438:0, 439:439:0, 
+; 440:440:0, 441:441:0, 442:442:0, 443:443:0, 444:444:0, 445:445:0, 446:446:0, 447:447:0, 448:448:0, 449:449:0, 
+; 450:450:0, 451:451:0, 452:452:0, 453:453:0, 454:454:0, 455:455:0, 456:456:0, 457:457:0, 458:458:0, 459:459:0, 
+; 460:460:0, 461:461:0, 462:462:0, 463:463:0, 464:464:0, 465:465:0, 466:466:0, 467:467:0, 468:468:0, 469:469:0, 
+; 470:470:0, 471:471:0, 472:472:0, 473:473:0, 474:474:0, 475:475:0, 476:476:0, 477:477:0, 478:478:0, 479:479:0, 
+; 480:480:0, 481:481:0, 482:482:0, 483:483:0, 484:484:0, 485:485:0, 486:486:0, 487:487:0, 488:488:0, 489:489:0, 
+; 490:490:0, 491:491:0, 492:492:0, 493:493:0, 494:494:0, 495:495:0, 496:496:0, 497:497:0, 498:498:0, 499:499:0, 
+; 500:500:0, 501:501:0, 502:502:0, 503:503:0, 504:504:0, 505:505:0, 506:506:0, 507:507:0, 508:508:0, 509:509:0, 
+; 510:510:0, 511:511:0, 512:512:0, 513:513:0, 514:514:0, 515:515:0, 516:516:0, 517:517:0, 518:518:0, 519:519:0, 
+; 520:520:0, 521:521:0, 522:522:0, 523:523:0, 524:524:0, 525:525:0, 526:526:0, 527:527:0, 528:528:0, 529:529:0, 
+; 530:530:0, 531:531:0, 532:532:0, 533:533:0, 534:534:0, 535:535:0, 536:536:0, 537:537:0, 538:538:0, 539:539:0, 
+; 540:540:0, 541:541:0, 542:542:0, 543:543:0, 544:544:0, 545:545:0, 546:546:0, 547:547:0, 548:548:0, 549:549:0, 
+; 550:550:0, 551:551:0, 552:552:0, 553:553:0, 554:554:0, 555:555:0, 556:556:0, 557:557:0, 558:558:0, 559:559:0, 
+; 560:560:0, 561:561:0, 562:562:0, 563:563:0, 564:564:0, 565:565:0, 566:566:0, 567:567:0, 568:568:0, 569:569:0, 
+; 570:570:0, 571:571:0, 572:572:0, 573:573:0, 574:574:0, 575:575:0, 576:576:0, 577:577:0, 578:578:0, 579:579:0, 
+; 580:580:0, 581:581:0, 582:582:0, 583:583:0, 584:584:0, 585:585:0, 586:586:0, 587:587:0, 588:588:0, 589:589:0, 
+; 590:590:0, 591:591:0, 592:592:0, 593:593:0, 594:594:0, 595:595:0, 596:596:0, 597:597:0, 598:598:0, 599:599:0, 
+; 600:600:0, 601:601:0, 602:602:0, 603:603:0, 604:604:0, 605:605:0, 606:606:0, 607:607:0, 608:608:0, 609:609:0, 
+; 610:610:0, 611:611:0, 612:612:0, 613:613:0, 614:614:0, 615:615:0, 616:616:0, 617:617:0, 618:618:0, 619:619:0, 
+; 620:620:0, 621:621:0, 622:622:0, 623:623:0, 624:624:0, 625:625:0, 626:626:0, 627:627:0, 628:628:0, 629:629:0, 
+; 630:630:0, 631:631:0, 632:632:0, 633:633:0, 634:634:0, 635:635:0, 636:636:0, 637:637:0, 638:638:0, 639:639:0, 
+; 640:640:0, 641:641:0, 642:642:0, 643:643:0, 644:644:0, 645:645:0, 646:646:0, 647:647:0, 648:648:0, 649:649:0, 
+; 650:650:0, 651:651:0, 652:652:0, 653:653:0, 654:654:0, 655:655:0, 656:656:0, 657:657:0, 658:658:0, 659:659:0, 
+; 660:660:0, 661:661:0, 662:662:0, 663:663:0, 664:664:0, 665:665:0, 666:666:0, 667:667:0, 668:668:0, 669:669:0, 
+; 670:670:0, 671:671:0, 672:672:0, 673:673:0, 674:674:0, 675:675:0, 676:676:0, 677:677:0, 678:678:0, 679:679:0, 
+; 680:680:0, 681:681:0, 682:682:0, 683:683:0, 684:684:0, 685:685:0, 686:686:0, 687:687:0, 688:688:0, 689:689:0, 
+; 690:690:0, 691:691:0, 692:692:0, 693:693:0, 694:694:0, 695:695:0, 696:696:0, 697:697:0, 698:698:0, 699:699:0, 
+; 700:700:0, 701:701:0, 702:702:0, 703:703:0, 704:704:0, 705:705:0, 706:706:0, 707:707:0, 708:708:0, 709:709:0, 
+; 710:710:0, 711:711:0, 712:712:0, 713:713:0, 714:714:0, 715:715:0, 716:716:0, 717:717:0, 718:718:0, 719:719:0, 
+; 720:720:0, 721:721:0, 722:722:0, 723:723:0, 724:724:0, 725:725:0, 726:726:0, 727:727:0, 728:728:0, 729:729:0, 
+; 730:730:0, 731:731:0, 732:732:0, 733:733:0, 734:734:0, 735:735:0, 736:736:0, 737:737:0, 738:738:0, 739:739:0, 
+; 740:740:0, 741:741:0, 742:742:0, 743:743:0, 744:744:0, 745:745:0, 746:746:0, 747:747:0, 748:748:0, 749:749:0, 
+; 750:750:0, 751:751:0, 752:752:0, 753:753:0, 754:754:0, 755:755:0, 756:756:0, 757:757:0, 758:758:0, 759:759:0, 
+; 760:760:0, 761:761:0, 762:762:0, 763:763:0, 764:764:0, 765:765:0, 766:766:0, 767:767:0, 768:768:0, 769:769:0, 
+; 770:770:0, 771:771:0, 772:772:0, 773:773:0, 774:774:0, 775:775:0, 776:776:0, 777:777:0, 778:778:0, 779:779:0, 
+; 780:780:0, 781:781:0, 782:782:0, 783:783:0, 784:784:0, 785:785:0, 786:786:0, 787:787:0, 788:788:0, 789:789:0, 
+; 790:790:0, 791:791:0, 792:792:0, 793:793:0, 794:794:0, 795:795:0, 796:796:0, 797:797:0, 798:798:0, 799:799:0, 
+; 800:800:0, 801:801:0, 802:802:0, 803:803:0, 804:804:0, 805:805:0, 806:806:0, 807:807:0, 808:808:0, 809:809:0, 
+; 810:810:0, 811:811:0, 812:812:0, 813:813:0, 814:814:0, 815:815:0, 816:816:0, 817:817:0, 818:818:0, 819:819:0, 
+; 820:820:0, 821:821:0, 822:822:0, 823:823:0, 824:824:0, 825:825:0, 826:826:0, 827:827:0, 828:828:0, 829:829:0, 
+; 830:830:0, 831:831:0, 832:832:0, 833:833:0, 834:834:0, 835:835:0, 836:836:0, 837:837:0, 838:838:0, 839:839:0, 
+; 840:840:0, 841:841:0, 842:842:0, 843:843:0, 844:844:0, 845:845:0, 846:846:0, 847:847:0, 848:848:0, 849:849:0, 
+; 850:850:0, 851:851:0, 852:852:0, 853:853:0, 854:854:0, 855:855:0, 856:856:0, 857:857:0, 858:858:0, 859:859:0, 
+; 860:860:0, 861:861:0, 862:862:0, 863:863:0, 864:864:0, 865:865:0, 866:866:0, 867:867:0, 868:868:0, 869:869:0, 
+; 870:870:0, 871:871:0, 872:872:0, 873:873:0, 874:874:0, 875:875:0, 876:876:0, 877:877:0, 878:878:0, 879:879:0, 
+; 880:880:0, 881:881:0, 882:882:0, 883:883:0, 884:884:0, 885:885:0, 886:886:0, 887:887:0, 888:888:0, 889:889:0, 
+; 890:890:0, 891:891:0, 892:892:0, 893:893:0, 894:894:0, 895:895:0, 896:896:0, 897:897:0, 898:898:0, 899:899:0, 
+; 900:900:0, 901:901:0, 902:902:0, 903:903:0, 904:904:0, 905:905:0, 906:906:0, 907:907:0, 908:908:0, 909:909:0, 
+; 910:910:0, 911:911:0, 912:912:0, 913:913:0, 914:914:0, 915:915:0, 916:916:0, 917:917:0, 918:918:0, 919:919:0, 
+; 920:920:0, 921:921:0, 922:922:0, 923:923:0, 924:924:0, 925:925:0, 926:926:0, 927:927:0, 928:928:0, 929:929:0, 
+; 930:930:0, 931:931:0, 932:932:0, 933:933:0, 934:934:0, 935:935:0, 936:936:0, 937:937:0, 938:938:0, 939:939:0, 
+; 940:940:0, 941:941:0, 942:942:0, 943:943:0, 944:944:0, 945:945:0, 946:946:0, 947:947:0, 948:948:0, 949:949:0, 
+; 950:950:0, 951:951:0, 952:952:0, 953:953:0, 954:954:0, 955:955:0, 956:956:0, 957:957:0, 958:958:0, 959:959:0, 
+; 960:960:0, 961:961:0, 962:962:0, 963:963:0, 964:964:0, 965:965:0, 966:966:0, 967:967:0, 968:968:0, 969:969:0, 
+; 970:970:0, 971:971:0, 972:972:0, 973:973:0, 974:974:0, 975:975:0, 976:976:0, 977:977:0, 978:978:0, 979:979:0, 
+; 980:980:0, 981:981:0, 982:982:0, 983:983:0, 984:984:0, 985:985:0, 986:986:0, 987:987:0, 988:988:0, 989:989:0, 
+; 990:990:0, 991:991:0, 992:992:0, 993:993:0, 994:994:0, 995:995:0, 996:996:0, 997:997:0, 998:998:0, 999:999:0, 
+; 
+;IDMapping: end
Index: DCWoRMS/trunk/example/workgen/workload70/GeneratorConfig.xml
===================================================================
--- DCWoRMS/trunk/example/workgen/workload70/GeneratorConfig.xml	(revision 477)
+++ DCWoRMS/trunk/example/workgen/workload70/GeneratorConfig.xml	(revision 477)
@@ -0,0 +1,26 @@
+<tns:WorkloadConfiguration 
+	xmlns:tns="http://www.man.poznan.pl/WorkloadSchema" 
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ 
+  	<SimulationStartTime>2009-01-15T10:00:00</SimulationStartTime>
+ 
+	<JobCount avg="1000" distribution="constant"/>
+ 
+	<TaskCount avg="1" distribution="constant"/>
+ 
+	<TaskLength avg="14400" min="10800" max="18000" stdev="3600.0" distribution="normal"/>
+ 
+	<JobPackageLength avg="1.0" min="1.0" max="1.0" stdev="0.0" distribution="constant"/>
+ 
+	<JobInterval avg="20" min="0" max="100" stdev="20" distribution="poisson" seed="21"/>
+	
+	<ComputingResourceHostParameter metric="cpucount">
+		<value id="cpucnt">
+	  		<MultiDistribution>
+      			<dist avg="1" min="1" max="1" stdev="0" distribution="uniform">0.95</dist>
+     		 	<dist avg="4" min="4" max="4" stdev="0" distribution="uniform">0.05</dist>
+   			</MultiDistribution>
+   		</value>	
+	</ComputingResourceHostParameter>
+ 
+</tns:WorkloadConfiguration>
Index: DCWoRMS/trunk/example/workgen/workload70/workload.swf
===================================================================
--- DCWoRMS/trunk/example/workgen/workload70/workload.swf	(revision 477)
+++ DCWoRMS/trunk/example/workgen/workload70/workload.swf	(revision 477)
@@ -0,0 +1,1116 @@
+;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|
+;PUSpeed: 1
+;StartTime: Thu Jan 15 10:00:00 CET 2009
+		0		19		-1		17130		1		-1		-1		1		17130		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		1		35		-1		14562		1		-1		-1		1		14562		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		2		51		-1		12617		1		-1		-1		1		12617		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		3		70		-1		11844		1		-1		-1		1		11844		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		4		92		-1		14707		1		-1		-1		1		14707		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		5		116		-1		12027		1		-1		-1		1		12027		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		6		132		-1		13072		1		-1		-1		1		13072		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		7		149		-1		12001		1		-1		-1		1		12001		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		8		172		-1		16920		1		-1		-1		1		16920		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		9		191		-1		16132		1		-1		-1		1		16132		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		10		210		-1		16803		1		-1		-1		1		16803		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		11		233		-1		16078		1		-1		-1		1		16078		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		12		247		-1		13120		1		-1		-1		1		13120		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		13		274		-1		16369		1		-1		-1		1		16369		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		14		299		-1		17078		1		-1		-1		1		17078		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		15		323		-1		11636		4		-1		-1		4		11636		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		16		340		-1		11115		1		-1		-1		1		11115		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		17		363		-1		16880		1		-1		-1		1		16880		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		18		386		-1		15685		1		-1		-1		1		15685		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		19		408		-1		17367		1		-1		-1		1		17367		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		20		428		-1		13192		1		-1		-1		1		13192		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		21		445		-1		14846		1		-1		-1		1		14846		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		22		464		-1		16325		1		-1		-1		1		16325		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		23		480		-1		12293		1		-1		-1		1		12293		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		24		496		-1		11291		1		-1		-1		1		11291		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		25		511		-1		15232		1		-1		-1		1		15232		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		26		536		-1		17723		1		-1		-1		1		17723		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		27		553		-1		15978		1		-1		-1		1		15978		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		28		567		-1		12785		1		-1		-1		1		12785		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		29		589		-1		14611		1		-1		-1		1		14611		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		30		609		-1		17608		1		-1		-1		1		17608		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		31		622		-1		17443		1		-1		-1		1		17443		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		32		645		-1		15219		1		-1		-1		1		15219		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		33		660		-1		14964		1		-1		-1		1		14964		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		34		683		-1		16653		1		-1		-1		1		16653		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		35		702		-1		17531		1		-1		-1		1		17531		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		36		722		-1		13593		1		-1		-1		1		13593		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		37		740		-1		13244		1		-1		-1		1		13244		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		38		758		-1		16129		1		-1		-1		1		16129		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		39		775		-1		13492		1		-1		-1		1		13492		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		40		793		-1		12861		1		-1		-1		1		12861		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		41		812		-1		15334		1		-1		-1		1		15334		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		42		833		-1		13085		1		-1		-1		1		13085		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		43		850		-1		14116		1		-1		-1		1		14116		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		44		862		-1		17664		1		-1		-1		1		17664		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		45		883		-1		13211		1		-1		-1		1		13211		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		46		896		-1		14994		1		-1		-1		1		14994		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		47		922		-1		11097		1		-1		-1		1		11097		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		48		939		-1		13815		1		-1		-1		1		13815		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		49		969		-1		12029		1		-1		-1		1		12029		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		50		983		-1		11855		1		-1		-1		1		11855		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		51		1002		-1		11202		1		-1		-1		1		11202		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		52		1019		-1		14112		1		-1		-1		1		14112		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		53		1036		-1		16518		1		-1		-1		1		16518		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		54		1055		-1		13074		1		-1		-1		1		13074		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		55		1080		-1		11934		1		-1		-1		1		11934		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		56		1099		-1		13323		1		-1		-1		1		13323		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		57		1120		-1		14177		1		-1		-1		1		14177		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		58		1130		-1		15139		1		-1		-1		1		15139		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		59		1157		-1		11562		1		-1		-1		1		11562		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		60		1175		-1		12055		1		-1		-1		1		12055		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		61		1200		-1		13485		1		-1		-1		1		13485		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		62		1217		-1		14035		1		-1		-1		1		14035		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		63		1235		-1		12102		1		-1		-1		1		12102		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		64		1259		-1		14765		1		-1		-1		1		14765		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		65		1280		-1		11895		1		-1		-1		1		11895		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		66		1292		-1		12310		1		-1		-1		1		12310		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		67		1318		-1		13103		1		-1		-1		1		13103		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		68		1336		-1		17831		4		-1		-1		4		17831		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		69		1355		-1		14259		4		-1		-1		4		14259		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		70		1382		-1		13054		1		-1		-1		1		13054		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		71		1388		-1		16600		4		-1		-1		4		16600		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		72		1407		-1		13944		1		-1		-1		1		13944		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		73		1429		-1		15196		1		-1		-1		1		15196		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		74		1447		-1		17252		1		-1		-1		1		17252		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		75		1468		-1		12150		1		-1		-1		1		12150		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		76		1494		-1		13393		1		-1		-1		1		13393		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		77		1516		-1		16239		1		-1		-1		1		16239		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		78		1538		-1		12242		1		-1		-1		1		12242		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		79		1553		-1		12434		1		-1		-1		1		12434		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		80		1565		-1		14424		1		-1		-1		1		14424		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		81		1583		-1		11772		1		-1		-1		1		11772		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		82		1597		-1		11395		1		-1		-1		1		11395		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		83		1623		-1		15215		1		-1		-1		1		15215		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		84		1648		-1		16251		1		-1		-1		1		16251		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		85		1672		-1		16125		1		-1		-1		1		16125		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		86		1692		-1		12962		1		-1		-1		1		12962		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		87		1715		-1		17240		1		-1		-1		1		17240		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		88		1734		-1		11238		1		-1		-1		1		11238		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		89		1751		-1		16624		1		-1		-1		1		16624		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		90		1767		-1		14051		1		-1		-1		1		14051		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		91		1785		-1		12557		1		-1		-1		1		12557		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		92		1807		-1		11632		1		-1		-1		1		11632		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		93		1833		-1		12232		1		-1		-1		1		12232		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		94		1856		-1		14571		1		-1		-1		1		14571		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		95		1883		-1		13320		1		-1		-1		1		13320		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		96		1906		-1		16118		1		-1		-1		1		16118		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		97		1920		-1		16713		1		-1		-1		1		16713		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		98		1939		-1		16270		1		-1		-1		1		16270		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		99		1958		-1		11988		1		-1		-1		1		11988		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		100		1975		-1		11022		1		-1		-1		1		11022		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		101		1997		-1		16534		4		-1		-1		4		16534		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		102		2019		-1		11989		1		-1		-1		1		11989		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		103		2037		-1		12164		1		-1		-1		1		12164		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		104		2053		-1		12218		1		-1		-1		1		12218		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		105		2068		-1		11825		1		-1		-1		1		11825		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		106		2082		-1		14706		1		-1		-1		1		14706		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		107		2101		-1		12710		1		-1		-1		1		12710		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		108		2121		-1		10932		1		-1		-1		1		10932		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		109		2140		-1		16091		1		-1		-1		1		16091		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		110		2159		-1		16133		1		-1		-1		1		16133		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		111		2176		-1		16202		1		-1		-1		1		16202		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		112		2194		-1		17424		1		-1		-1		1		17424		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		113		2215		-1		14707		1		-1		-1		1		14707		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		114		2235		-1		15320		1		-1		-1		1		15320		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		115		2262		-1		13450		1		-1		-1		1		13450		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		116		2275		-1		14319		1		-1		-1		1		14319		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		117		2294		-1		12859		1		-1		-1		1		12859		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		118		2310		-1		15480		1		-1		-1		1		15480		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		119		2330		-1		17243		1		-1		-1		1		17243		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		120		2344		-1		15005		1		-1		-1		1		15005		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		121		2365		-1		14121		1		-1		-1		1		14121		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		122		2383		-1		11649		1		-1		-1		1		11649		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		123		2410		-1		11783		1		-1		-1		1		11783		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		124		2444		-1		17713		1		-1		-1		1		17713		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		125		2467		-1		15009		1		-1		-1		1		15009		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		126		2488		-1		10860		1		-1		-1		1		10860		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		127		2511		-1		14934		1		-1		-1		1		14934		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		128		2533		-1		13890		1		-1		-1		1		13890		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		129		2552		-1		17744		1		-1		-1		1		17744		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		130		2574		-1		15491		1		-1		-1		1		15491		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		131		2592		-1		12104		1		-1		-1		1		12104		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		132		2607		-1		12138		1		-1		-1		1		12138		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		133		2621		-1		11304		1		-1		-1		1		11304		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		134		2643		-1		15013		1		-1		-1		1		15013		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		135		2664		-1		17679		4		-1		-1		4		17679		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		136		2677		-1		14155		1		-1		-1		1		14155		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		137		2698		-1		13347		1		-1		-1		1		13347		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		138		2718		-1		15043		1		-1		-1		1		15043		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		139		2739		-1		15564		1		-1		-1		1		15564		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		140		2759		-1		13186		1		-1		-1		1		13186		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		141		2776		-1		15636		1		-1		-1		1		15636		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		142		2797		-1		16626		1		-1		-1		1		16626		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		143		2813		-1		11884		1		-1		-1		1		11884		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		144		2834		-1		14791		1		-1		-1		1		14791		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		145		2855		-1		12465		1		-1		-1		1		12465		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		146		2872		-1		11702		1		-1		-1		1		11702		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		147		2895		-1		12934		1		-1		-1		1		12934		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		148		2908		-1		11005		1		-1		-1		1		11005		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		149		2925		-1		15202		1		-1		-1		1		15202		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		150		2946		-1		14730		1		-1		-1		1		14730		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		151		2963		-1		13948		1		-1		-1		1		13948		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		152		2986		-1		16878		1		-1		-1		1		16878		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		153		3004		-1		14377		1		-1		-1		1		14377		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		154		3021		-1		13775		1		-1		-1		1		13775		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		155		3039		-1		15778		1		-1		-1		1		15778		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		156		3067		-1		11052		1		-1		-1		1		11052		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		157		3080		-1		17123		1		-1		-1		1		17123		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		158		3100		-1		11812		1		-1		-1		1		11812		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		159		3131		-1		14846		1		-1		-1		1		14846		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		160		3164		-1		10921		1		-1		-1		1		10921		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		161		3185		-1		15747		1		-1		-1		1		15747		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		162		3202		-1		12862		1		-1		-1		1		12862		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		163		3217		-1		11457		1		-1		-1		1		11457		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		164		3237		-1		16125		1		-1		-1		1		16125		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		165		3262		-1		16060		1		-1		-1		1		16060		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		166		3276		-1		11915		1		-1		-1		1		11915		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		167		3293		-1		16370		1		-1		-1		1		16370		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		168		3325		-1		12414		1		-1		-1		1		12414		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		169		3349		-1		14332		1		-1		-1		1		14332		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		170		3369		-1		13085		1		-1		-1		1		13085		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		171		3386		-1		12304		1		-1		-1		1		12304		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		172		3409		-1		15246		1		-1		-1		1		15246		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		173		3429		-1		13021		1		-1		-1		1		13021		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		174		3443		-1		13328		1		-1		-1		1		13328		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		175		3458		-1		15291		1		-1		-1		1		15291		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		176		3478		-1		10956		1		-1		-1		1		10956		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		177		3494		-1		12029		1		-1		-1		1		12029		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		178		3510		-1		11448		1		-1		-1		1		11448		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		179		3531		-1		17959		1		-1		-1		1		17959		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		180		3551		-1		13837		1		-1		-1		1		13837		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		181		3565		-1		15670		1		-1		-1		1		15670		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		182		3584		-1		11251		1		-1		-1		1		11251		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		183		3612		-1		11793		1		-1		-1		1		11793		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		184		3633		-1		16622		1		-1		-1		1		16622		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		185		3651		-1		15283		1		-1		-1		1		15283		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		186		3671		-1		12260		1		-1		-1		1		12260		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		187		3698		-1		15529		1		-1		-1		1		15529		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		188		3717		-1		16431		1		-1		-1		1		16431		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		189		3736		-1		11639		1		-1		-1		1		11639		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		190		3761		-1		14893		1		-1		-1		1		14893		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		191		3788		-1		12390		1		-1		-1		1		12390		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		192		3800		-1		11219		1		-1		-1		1		11219		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		193		3814		-1		13179		1		-1		-1		1		13179		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		194		3828		-1		12478		1		-1		-1		1		12478		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		195		3850		-1		16621		1		-1		-1		1		16621		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		196		3869		-1		12176		1		-1		-1		1		12176		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		197		3888		-1		12145		1		-1		-1		1		12145		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		198		3914		-1		16347		1		-1		-1		1		16347		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		199		3933		-1		11779		1		-1		-1		1		11779		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		200		3957		-1		15511		1		-1		-1		1		15511		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		201		3971		-1		12917		1		-1		-1		1		12917		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		202		3989		-1		15357		1		-1		-1		1		15357		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		203		4004		-1		12991		1		-1		-1		1		12991		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		204		4022		-1		17714		4		-1		-1		4		17714		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		205		4043		-1		14101		1		-1		-1		1		14101		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		206		4056		-1		14335		1		-1		-1		1		14335		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		207		4080		-1		14385		1		-1		-1		1		14385		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		208		4099		-1		16137		1		-1		-1		1		16137		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		209		4125		-1		15056		1		-1		-1		1		15056		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		210		4143		-1		14953		1		-1		-1		1		14953		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		211		4161		-1		14210		1		-1		-1		1		14210		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		212		4189		-1		15963		1		-1		-1		1		15963		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		213		4206		-1		13378		1		-1		-1		1		13378		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		214		4232		-1		11153		1		-1		-1		1		11153		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		215		4252		-1		17663		1		-1		-1		1		17663		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		216		4277		-1		17800		1		-1		-1		1		17800		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		217		4292		-1		17275		1		-1		-1		1		17275		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		218		4310		-1		16980		1		-1		-1		1		16980		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		219		4332		-1		10932		1		-1		-1		1		10932		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		220		4355		-1		14927		1		-1		-1		1		14927		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		221		4381		-1		14016		4		-1		-1		4		14016		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		222		4404		-1		11204		1		-1		-1		1		11204		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		223		4418		-1		15746		1		-1		-1		1		15746		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		224		4443		-1		14921		1		-1		-1		1		14921		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		225		4461		-1		13227		1		-1		-1		1		13227		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		226		4484		-1		13344		1		-1		-1		1		13344		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		227		4504		-1		12835		1		-1		-1		1		12835		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		228		4519		-1		11984		1		-1		-1		1		11984		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		229		4544		-1		16086		1		-1		-1		1		16086		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		230		4557		-1		14801		1		-1		-1		1		14801		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		231		4574		-1		14509		1		-1		-1		1		14509		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		232		4603		-1		12993		1		-1		-1		1		12993		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		233		4624		-1		14080		1		-1		-1		1		14080		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		234		4645		-1		17554		1		-1		-1		1		17554		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		235		4660		-1		16046		1		-1		-1		1		16046		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		236		4678		-1		16345		1		-1		-1		1		16345		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		237		4689		-1		15220		1		-1		-1		1		15220		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		238		4701		-1		13912		4		-1		-1		4		13912		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		239		4716		-1		13350		1		-1		-1		1		13350		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		240		4734		-1		15714		1		-1		-1		1		15714		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		241		4759		-1		11047		1		-1		-1		1		11047		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		242		4774		-1		14274		1		-1		-1		1		14274		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		243		4799		-1		14016		1		-1		-1		1		14016		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		244		4819		-1		16179		1		-1		-1		1		16179		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		245		4843		-1		13131		1		-1		-1		1		13131		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		246		4859		-1		16523		4		-1		-1		4		16523		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		247		4877		-1		14772		1		-1		-1		1		14772		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		248		4898		-1		12098		1		-1		-1		1		12098		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		249		4911		-1		15984		1		-1		-1		1		15984		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		250		4923		-1		11238		1		-1		-1		1		11238		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		251		4940		-1		11616		1		-1		-1		1		11616		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		252		4965		-1		12841		1		-1		-1		1		12841		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		253		4979		-1		12480		1		-1		-1		1		12480		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		254		5004		-1		16361		1		-1		-1		1		16361		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		255		5019		-1		13821		1		-1		-1		1		13821		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		256		5029		-1		14818		1		-1		-1		1		14818		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		257		5053		-1		11499		1		-1		-1		1		11499		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		258		5074		-1		14868		1		-1		-1		1		14868		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		259		5102		-1		15858		1		-1		-1		1		15858		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		260		5133		-1		17477		1		-1		-1		1		17477		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		261		5154		-1		11532		1		-1		-1		1		11532		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		262		5174		-1		11804		1		-1		-1		1		11804		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		263		5198		-1		14216		1		-1		-1		1		14216		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		264		5217		-1		14145		1		-1		-1		1		14145		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		265		5242		-1		15348		4		-1		-1		4		15348		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		266		5259		-1		15506		1		-1		-1		1		15506		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		267		5271		-1		14796		1		-1		-1		1		14796		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		268		5292		-1		11429		1		-1		-1		1		11429		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		269		5316		-1		11618		1		-1		-1		1		11618		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		270		5339		-1		16333		1		-1		-1		1		16333		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		271		5355		-1		14147		1		-1		-1		1		14147		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		272		5378		-1		14994		1		-1		-1		1		14994		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		273		5407		-1		16810		1		-1		-1		1		16810		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		274		5428		-1		15259		1		-1		-1		1		15259		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		275		5446		-1		16170		1		-1		-1		1		16170		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		276		5469		-1		17615		1		-1		-1		1		17615		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		277		5482		-1		11505		1		-1		-1		1		11505		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		278		5496		-1		17627		1		-1		-1		1		17627		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		279		5516		-1		14705		1		-1		-1		1		14705		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		280		5540		-1		17456		1		-1		-1		1		17456		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		281		5557		-1		17764		1		-1		-1		1		17764		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		282		5571		-1		16086		1		-1		-1		1		16086		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		283		5591		-1		13337		1		-1		-1		1		13337		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		284		5607		-1		14208		1		-1		-1		1		14208		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		285		5624		-1		14971		1		-1		-1		1		14971		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		286		5648		-1		13229		1		-1		-1		1		13229		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		287		5675		-1		14878		4		-1		-1		4		14878		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		288		5688		-1		14687		1		-1		-1		1		14687		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		289		5701		-1		16557		1		-1		-1		1		16557		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		290		5725		-1		16554		1		-1		-1		1		16554		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		291		5744		-1		13131		1		-1		-1		1		13131		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		292		5762		-1		11359		1		-1		-1		1		11359		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		293		5782		-1		13412		1		-1		-1		1		13412		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		294		5795		-1		14539		1		-1		-1		1		14539		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		295		5815		-1		16027		1		-1		-1		1		16027		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		296		5829		-1		11853		1		-1		-1		1		11853		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		297		5844		-1		14812		1		-1		-1		1		14812		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		298		5863		-1		13333		1		-1		-1		1		13333		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		299		5881		-1		14905		1		-1		-1		1		14905		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		300		5896		-1		12729		1		-1		-1		1		12729		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		301		5911		-1		17667		1		-1		-1		1		17667		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		302		5936		-1		13778		1		-1		-1		1		13778		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		303		5952		-1		14030		1		-1		-1		1		14030		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		304		5975		-1		17435		1		-1		-1		1		17435		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		305		6003		-1		12007		4		-1		-1		4		12007		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		306		6022		-1		15331		4		-1		-1		4		15331		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		307		6038		-1		13371		1		-1		-1		1		13371		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		308		6063		-1		16872		1		-1		-1		1		16872		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		309		6088		-1		11603		1		-1		-1		1		11603		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		310		6105		-1		15625		1		-1		-1		1		15625		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		311		6123		-1		14421		1		-1		-1		1		14421		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		312		6139		-1		17312		1		-1		-1		1		17312		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		313		6154		-1		13415		1		-1		-1		1		13415		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		314		6172		-1		13130		1		-1		-1		1		13130		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		315		6186		-1		15060		1		-1		-1		1		15060		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		316		6200		-1		16564		1		-1		-1		1		16564		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		317		6230		-1		11474		1		-1		-1		1		11474		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		318		6249		-1		16060		1		-1		-1		1		16060		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		319		6275		-1		10907		1		-1		-1		1		10907		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		320		6293		-1		16029		1		-1		-1		1		16029		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		321		6309		-1		11583		1		-1		-1		1		11583		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		322		6324		-1		11170		1		-1		-1		1		11170		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		323		6343		-1		15179		1		-1		-1		1		15179		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		324		6362		-1		11623		1		-1		-1		1		11623		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		325		6380		-1		12248		1		-1		-1		1		12248		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		326		6400		-1		13254		1		-1		-1		1		13254		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		327		6418		-1		16032		1		-1		-1		1		16032		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		328		6439		-1		12112		1		-1		-1		1		12112		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		329		6462		-1		13201		1		-1		-1		1		13201		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		330		6480		-1		13166		1		-1		-1		1		13166		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		331		6492		-1		14184		1		-1		-1		1		14184		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		332		6511		-1		13542		1		-1		-1		1		13542		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		333		6533		-1		15368		1		-1		-1		1		15368		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		334		6557		-1		12493		1		-1		-1		1		12493		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		335		6574		-1		13422		1		-1		-1		1		13422		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		336		6590		-1		14728		1		-1		-1		1		14728		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		337		6613		-1		11292		1		-1		-1		1		11292		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		338		6642		-1		13807		1		-1		-1		1		13807		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		339		6657		-1		14021		4		-1		-1		4		14021		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		340		6671		-1		11024		1		-1		-1		1		11024		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		341		6690		-1		13853		1		-1		-1		1		13853		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		342		6706		-1		15413		1		-1		-1		1		15413		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		343		6726		-1		15165		1		-1		-1		1		15165		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		344		6747		-1		12840		1		-1		-1		1		12840		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		345		6756		-1		14233		4		-1		-1		4		14233		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		346		6776		-1		11300		1		-1		-1		1		11300		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		347		6802		-1		13684		4		-1		-1		4		13684		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		348		6820		-1		15598		1		-1		-1		1		15598		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		349		6838		-1		14494		1		-1		-1		1		14494		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		350		6861		-1		15743		1		-1		-1		1		15743		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		351		6883		-1		12264		1		-1		-1		1		12264		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		352		6902		-1		12962		1		-1		-1		1		12962		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		353		6919		-1		13007		1		-1		-1		1		13007		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		354		6954		-1		16127		1		-1		-1		1		16127		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		355		6968		-1		13389		1		-1		-1		1		13389		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		356		6987		-1		11152		1		-1		-1		1		11152		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		357		7006		-1		12579		1		-1		-1		1		12579		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		358		7021		-1		13128		1		-1		-1		1		13128		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		359		7041		-1		14933		1		-1		-1		1		14933		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		360		7067		-1		14066		1		-1		-1		1		14066		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		361		7091		-1		15102		1		-1		-1		1		15102		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		362		7108		-1		12996		1		-1		-1		1		12996		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		363		7148		-1		14090		1		-1		-1		1		14090		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		364		7171		-1		12586		1		-1		-1		1		12586		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		365		7183		-1		17073		4		-1		-1		4		17073		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		366		7203		-1		13731		1		-1		-1		1		13731		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		367		7219		-1		15206		1		-1		-1		1		15206		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		368		7247		-1		12594		1		-1		-1		1		12594		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		369		7269		-1		13085		1		-1		-1		1		13085		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		370		7282		-1		12253		1		-1		-1		1		12253		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		371		7305		-1		13930		1		-1		-1		1		13930		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		372		7326		-1		12418		1		-1		-1		1		12418		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		373		7352		-1		15652		4		-1		-1		4		15652		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		374		7364		-1		13326		1		-1		-1		1		13326		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		375		7386		-1		15356		1		-1		-1		1		15356		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		376		7402		-1		13614		4		-1		-1		4		13614		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		377		7414		-1		14214		1		-1		-1		1		14214		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		378		7435		-1		16623		1		-1		-1		1		16623		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		379		7456		-1		12193		1		-1		-1		1		12193		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		380		7479		-1		13114		1		-1		-1		1		13114		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		381		7506		-1		15827		1		-1		-1		1		15827		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		382		7525		-1		13231		1		-1		-1		1		13231		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		383		7549		-1		14424		1		-1		-1		1		14424		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		384		7577		-1		14133		1		-1		-1		1		14133		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		385		7591		-1		17300		4		-1		-1		4		17300		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		386		7615		-1		12954		4		-1		-1		4		12954		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		387		7638		-1		17297		1		-1		-1		1		17297		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		388		7661		-1		14461		1		-1		-1		1		14461		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		389		7683		-1		15933		1		-1		-1		1		15933		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		390		7704		-1		13355		1		-1		-1		1		13355		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		391		7726		-1		10954		1		-1		-1		1		10954		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		392		7758		-1		11621		1		-1		-1		1		11621		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		393		7774		-1		13362		1		-1		-1		1		13362		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		394		7791		-1		10921		1		-1		-1		1		10921		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		395		7818		-1		16248		1		-1		-1		1		16248		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		396		7827		-1		12450		1		-1		-1		1		12450		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		397		7850		-1		14176		1		-1		-1		1		14176		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		398		7876		-1		12109		1		-1		-1		1		12109		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		399		7895		-1		13765		1		-1		-1		1		13765		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		400		7911		-1		13840		1		-1		-1		1		13840		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		401		7937		-1		11418		1		-1		-1		1		11418		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		402		7952		-1		16152		1		-1		-1		1		16152		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		403		7970		-1		13804		1		-1		-1		1		13804		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		404		7986		-1		12372		1		-1		-1		1		12372		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		405		8004		-1		12788		1		-1		-1		1		12788		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		406		8028		-1		15307		1		-1		-1		1		15307		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		407		8055		-1		17076		1		-1		-1		1		17076		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		408		8071		-1		12776		1		-1		-1		1		12776		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		409		8096		-1		17185		1		-1		-1		1		17185		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		410		8119		-1		16620		1		-1		-1		1		16620		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		411		8146		-1		16719		1		-1		-1		1		16719		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		412		8163		-1		11477		1		-1		-1		1		11477		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		413		8183		-1		17840		1		-1		-1		1		17840		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		414		8199		-1		15299		1		-1		-1		1		15299		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		415		8220		-1		11181		1		-1		-1		1		11181		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		416		8249		-1		17165		1		-1		-1		1		17165		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		417		8276		-1		14990		1		-1		-1		1		14990		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		418		8290		-1		15975		1		-1		-1		1		15975		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		419		8310		-1		14621		1		-1		-1		1		14621		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		420		8334		-1		14728		1		-1		-1		1		14728		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		421		8356		-1		14191		1		-1		-1		1		14191		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		422		8377		-1		16279		1		-1		-1		1		16279		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		423		8398		-1		15530		1		-1		-1		1		15530		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		424		8414		-1		16425		1		-1		-1		1		16425		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		425		8430		-1		14835		1		-1		-1		1		14835		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		426		8453		-1		12250		1		-1		-1		1		12250		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		427		8477		-1		17118		1		-1		-1		1		17118		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		428		8491		-1		13236		1		-1		-1		1		13236		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		429		8515		-1		17570		1		-1		-1		1		17570		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		430		8536		-1		14888		1		-1		-1		1		14888		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		431		8556		-1		16757		1		-1		-1		1		16757		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		432		8582		-1		17910		1		-1		-1		1		17910		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		433		8599		-1		13741		1		-1		-1		1		13741		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		434		8628		-1		15376		1		-1		-1		1		15376		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		435		8647		-1		17857		4		-1		-1		4		17857		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		436		8672		-1		16850		1		-1		-1		1		16850		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		437		8690		-1		11359		1		-1		-1		1		11359		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		438		8713		-1		13960		1		-1		-1		1		13960		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		439		8729		-1		14034		1		-1		-1		1		14034		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		440		8754		-1		15765		1		-1		-1		1		15765		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		441		8773		-1		14821		1		-1		-1		1		14821		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		442		8794		-1		14029		1		-1		-1		1		14029		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		443		8817		-1		13885		1		-1		-1		1		13885		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		444		8837		-1		13480		1		-1		-1		1		13480		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		445		8853		-1		17375		1		-1		-1		1		17375		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		446		8869		-1		17171		4		-1		-1		4		17171		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		447		8890		-1		11316		1		-1		-1		1		11316		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		448		8907		-1		15064		1		-1		-1		1		15064		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		449		8924		-1		15613		1		-1		-1		1		15613		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		450		8943		-1		12077		1		-1		-1		1		12077		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		451		8959		-1		15473		1		-1		-1		1		15473		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		452		8984		-1		16507		1		-1		-1		1		16507		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		453		9013		-1		13060		1		-1		-1		1		13060		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		454		9034		-1		13656		1		-1		-1		1		13656		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		455		9051		-1		16898		1		-1		-1		1		16898		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		456		9071		-1		16197		1		-1		-1		1		16197		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		457		9097		-1		16474		1		-1		-1		1		16474		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		458		9118		-1		12251		1		-1		-1		1		12251		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		459		9137		-1		14484		4		-1		-1		4		14484		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		460		9153		-1		15118		1		-1		-1		1		15118		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		461		9187		-1		11104		1		-1		-1		1		11104		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		462		9204		-1		12729		1		-1		-1		1		12729		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		463		9222		-1		17341		1		-1		-1		1		17341		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		464		9244		-1		16306		1		-1		-1		1		16306		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		465		9267		-1		14449		1		-1		-1		1		14449		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		466		9286		-1		14833		1		-1		-1		1		14833		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		467		9307		-1		17507		1		-1		-1		1		17507		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		468		9327		-1		17940		1		-1		-1		1		17940		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		469		9339		-1		14987		1		-1		-1		1		14987		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		470		9355		-1		13921		1		-1		-1		1		13921		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		471		9376		-1		11126		1		-1		-1		1		11126		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		472		9397		-1		17357		1		-1		-1		1		17357		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		473		9420		-1		13430		1		-1		-1		1		13430		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		474		9443		-1		12956		1		-1		-1		1		12956		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		475		9464		-1		17514		1		-1		-1		1		17514		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		476		9487		-1		14140		1		-1		-1		1		14140		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		477		9519		-1		17045		1		-1		-1		1		17045		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		478		9534		-1		15920		1		-1		-1		1		15920		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		479		9559		-1		12022		1		-1		-1		1		12022		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		480		9578		-1		14427		1		-1		-1		1		14427		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		481		9597		-1		15190		1		-1		-1		1		15190		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		482		9627		-1		16122		1		-1		-1		1		16122		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		483		9650		-1		12501		1		-1		-1		1		12501		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		484		9677		-1		16628		1		-1		-1		1		16628		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		485		9700		-1		15771		1		-1		-1		1		15771		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		486		9724		-1		14299		1		-1		-1		1		14299		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		487		9747		-1		14174		1		-1		-1		1		14174		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		488		9767		-1		12583		1		-1		-1		1		12583		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		489		9788		-1		14335		1		-1		-1		1		14335		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		490		9811		-1		15604		1		-1		-1		1		15604		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		491		9830		-1		14640		1		-1		-1		1		14640		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		492		9843		-1		10800		1		-1		-1		1		10800		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		493		9862		-1		11407		1		-1		-1		1		11407		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		494		9884		-1		14955		1		-1		-1		1		14955		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		495		9907		-1		11550		1		-1		-1		1		11550		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		496		9925		-1		13987		1		-1		-1		1		13987		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		497		9941		-1		13843		1		-1		-1		1		13843		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		498		9962		-1		12282		1		-1		-1		1		12282		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		499		9984		-1		13551		1		-1		-1		1		13551		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		500		10005		-1		13940		1		-1		-1		1		13940		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		501		10017		-1		14239		1		-1		-1		1		14239		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		502		10035		-1		17755		4		-1		-1		4		17755		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		503		10053		-1		14136		1		-1		-1		1		14136		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		504		10077		-1		17869		1		-1		-1		1		17869		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		505		10096		-1		16045		4		-1		-1		4		16045		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		506		10115		-1		16210		1		-1		-1		1		16210		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		507		10133		-1		10982		1		-1		-1		1		10982		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		508		10157		-1		13935		1		-1		-1		1		13935		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		509		10167		-1		14844		1		-1		-1		1		14844		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		510		10185		-1		11761		1		-1		-1		1		11761		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		511		10205		-1		17950		1		-1		-1		1		17950		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		512		10221		-1		13204		1		-1		-1		1		13204		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		513		10238		-1		11761		1		-1		-1		1		11761		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		514		10253		-1		15644		1		-1		-1		1		15644		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		515		10269		-1		15600		1		-1		-1		1		15600		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		516		10284		-1		17942		1		-1		-1		1		17942		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		517		10312		-1		16140		1		-1		-1		1		16140		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		518		10326		-1		14832		1		-1		-1		1		14832		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		519		10351		-1		16838		1		-1		-1		1		16838		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		520		10368		-1		15122		1		-1		-1		1		15122		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		521		10387		-1		17214		1		-1		-1		1		17214		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		522		10401		-1		11412		1		-1		-1		1		11412		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		523		10418		-1		12126		1		-1		-1		1		12126		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		524		10437		-1		17577		1		-1		-1		1		17577		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		525		10452		-1		12045		1		-1		-1		1		12045		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		526		10479		-1		12109		1		-1		-1		1		12109		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		527		10493		-1		17654		1		-1		-1		1		17654		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		528		10509		-1		12987		1		-1		-1		1		12987		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		529		10535		-1		10936		4		-1		-1		4		10936		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		530		10552		-1		13226		1		-1		-1		1		13226		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		531		10569		-1		14930		1		-1		-1		1		14930		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		532		10585		-1		15334		1		-1		-1		1		15334		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		533		10605		-1		14396		1		-1		-1		1		14396		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		534		10628		-1		11950		1		-1		-1		1		11950		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		535		10642		-1		13324		1		-1		-1		1		13324		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		536		10665		-1		15322		1		-1		-1		1		15322		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		537		10683		-1		14076		1		-1		-1		1		14076		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		538		10700		-1		11608		1		-1		-1		1		11608		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		539		10724		-1		14458		1		-1		-1		1		14458		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		540		10740		-1		14838		4		-1		-1		4		14838		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		541		10761		-1		12306		1		-1		-1		1		12306		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		542		10786		-1		12093		1		-1		-1		1		12093		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		543		10809		-1		16368		1		-1		-1		1		16368		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		544		10821		-1		16179		1		-1		-1		1		16179		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		545		10842		-1		14139		1		-1		-1		1		14139		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		546		10862		-1		14122		1		-1		-1		1		14122		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		547		10884		-1		14006		1		-1		-1		1		14006		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		548		10907		-1		14563		4		-1		-1		4		14563		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		549		10921		-1		12891		1		-1		-1		1		12891		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		550		10942		-1		12815		1		-1		-1		1		12815		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		551		10961		-1		11672		1		-1		-1		1		11672		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		552		10980		-1		14429		1		-1		-1		1		14429		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		553		11000		-1		16595		1		-1		-1		1		16595		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		554		11018		-1		12835		1		-1		-1		1		12835		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		555		11036		-1		14658		1		-1		-1		1		14658		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		556		11057		-1		15638		1		-1		-1		1		15638		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		557		11075		-1		17868		1		-1		-1		1		17868		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		558		11090		-1		13646		1		-1		-1		1		13646		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		559		11117		-1		15452		1		-1		-1		1		15452		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		560		11128		-1		17685		1		-1		-1		1		17685		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		561		11148		-1		17087		1		-1		-1		1		17087		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		562		11168		-1		12134		1		-1		-1		1		12134		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		563		11183		-1		14919		1		-1		-1		1		14919		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		564		11209		-1		15100		1		-1		-1		1		15100		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		565		11235		-1		12274		1		-1		-1		1		12274		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		566		11257		-1		17519		1		-1		-1		1		17519		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		567		11271		-1		15501		1		-1		-1		1		15501		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		568		11281		-1		13118		1		-1		-1		1		13118		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		569		11300		-1		11167		1		-1		-1		1		11167		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		570		11317		-1		13249		1		-1		-1		1		13249		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		571		11330		-1		12828		1		-1		-1		1		12828		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		572		11348		-1		15558		1		-1		-1		1		15558		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		573		11376		-1		14031		1		-1		-1		1		14031		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		574		11401		-1		16229		1		-1		-1		1		16229		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		575		11424		-1		16486		1		-1		-1		1		16486		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		576		11453		-1		12069		1		-1		-1		1		12069		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		577		11483		-1		12670		1		-1		-1		1		12670		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		578		11498		-1		14601		1		-1		-1		1		14601		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		579		11519		-1		17560		1		-1		-1		1		17560		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		580		11534		-1		16517		1		-1		-1		1		16517		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		581		11554		-1		16156		1		-1		-1		1		16156		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		582		11579		-1		13334		1		-1		-1		1		13334		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		583		11597		-1		13759		1		-1		-1		1		13759		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		584		11610		-1		10926		1		-1		-1		1		10926		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		585		11625		-1		16877		1		-1		-1		1		16877		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		586		11643		-1		11105		1		-1		-1		1		11105		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		587		11662		-1		14495		1		-1		-1		1		14495		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		588		11682		-1		15731		1		-1		-1		1		15731		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		589		11706		-1		14044		1		-1		-1		1		14044		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		590		11731		-1		14938		1		-1		-1		1		14938		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		591		11749		-1		14777		1		-1		-1		1		14777		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		592		11765		-1		17039		1		-1		-1		1		17039		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		593		11780		-1		14309		1		-1		-1		1		14309		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		594		11800		-1		15354		1		-1		-1		1		15354		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		595		11820		-1		12074		1		-1		-1		1		12074		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		596		11839		-1		14292		1		-1		-1		1		14292		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		597		11865		-1		13661		1		-1		-1		1		13661		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		598		11885		-1		14511		1		-1		-1		1		14511		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		599		11905		-1		14089		1		-1		-1		1		14089		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		600		11932		-1		12948		1		-1		-1		1		12948		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		601		11951		-1		12378		1		-1		-1		1		12378		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		602		11973		-1		13318		1		-1		-1		1		13318		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		603		11993		-1		12221		1		-1		-1		1		12221		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		604		12013		-1		13894		1		-1		-1		1		13894		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		605		12030		-1		14445		1		-1		-1		1		14445		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		606		12043		-1		15347		4		-1		-1		4		15347		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		607		12061		-1		13550		1		-1		-1		1		13550		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		608		12084		-1		12420		1		-1		-1		1		12420		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		609		12110		-1		12974		1		-1		-1		1		12974		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		610		12126		-1		12728		1		-1		-1		1		12728		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		611		12146		-1		15861		1		-1		-1		1		15861		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		612		12170		-1		14738		1		-1		-1		1		14738		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		613		12196		-1		13397		1		-1		-1		1		13397		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		614		12220		-1		17484		1		-1		-1		1		17484		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		615		12237		-1		13688		1		-1		-1		1		13688		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		616		12254		-1		15954		1		-1		-1		1		15954		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		617		12283		-1		13376		1		-1		-1		1		13376		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		618		12306		-1		11102		1		-1		-1		1		11102		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		619		12326		-1		16498		1		-1		-1		1		16498		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		620		12340		-1		14674		1		-1		-1		1		14674		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		621		12359		-1		17284		1		-1		-1		1		17284		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		622		12386		-1		13394		1		-1		-1		1		13394		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		623		12411		-1		16061		1		-1		-1		1		16061		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		624		12439		-1		13356		1		-1		-1		1		13356		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		625		12459		-1		11408		1		-1		-1		1		11408		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		626		12484		-1		17882		1		-1		-1		1		17882		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		627		12508		-1		15092		1		-1		-1		1		15092		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		628		12525		-1		16485		1		-1		-1		1		16485		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		629		12544		-1		17762		1		-1		-1		1		17762		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		630		12567		-1		14141		1		-1		-1		1		14141		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		631		12586		-1		15739		1		-1		-1		1		15739		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		632		12602		-1		12994		1		-1		-1		1		12994		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		633		12625		-1		14933		1		-1		-1		1		14933		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		634		12642		-1		14411		1		-1		-1		1		14411		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		635		12661		-1		15869		1		-1		-1		1		15869		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		636		12680		-1		14987		1		-1		-1		1		14987		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		637		12700		-1		13366		1		-1		-1		1		13366		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		638		12722		-1		14094		1		-1		-1		1		14094		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		639		12745		-1		14604		1		-1		-1		1		14604		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		640		12760		-1		16523		1		-1		-1		1		16523		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		641		12785		-1		11290		1		-1		-1		1		11290		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		642		12805		-1		13612		1		-1		-1		1		13612		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		643		12824		-1		13178		1		-1		-1		1		13178		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		644		12843		-1		17196		1		-1		-1		1		17196		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		645		12866		-1		14820		1		-1		-1		1		14820		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		646		12886		-1		12730		1		-1		-1		1		12730		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		647		12901		-1		16332		1		-1		-1		1		16332		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		648		12922		-1		10824		1		-1		-1		1		10824		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		649		12939		-1		14708		1		-1		-1		1		14708		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		650		12956		-1		15661		1		-1		-1		1		15661		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		651		12970		-1		17605		1		-1		-1		1		17605		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		652		12987		-1		17623		1		-1		-1		1		17623		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		653		13013		-1		16540		1		-1		-1		1		16540		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		654		13043		-1		15430		1		-1		-1		1		15430		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		655		13074		-1		16471		1		-1		-1		1		16471		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		656		13093		-1		13530		1		-1		-1		1		13530		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		657		13113		-1		16004		1		-1		-1		1		16004		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		658		13134		-1		16179		1		-1		-1		1		16179		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		659		13163		-1		16619		1		-1		-1		1		16619		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		660		13180		-1		15229		1		-1		-1		1		15229		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		661		13196		-1		13376		1		-1		-1		1		13376		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		662		13214		-1		15740		1		-1		-1		1		15740		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		663		13231		-1		15547		1		-1		-1		1		15547		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		664		13251		-1		13356		4		-1		-1		4		13356		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		665		13271		-1		13616		1		-1		-1		1		13616		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		666		13294		-1		17342		1		-1		-1		1		17342		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		667		13317		-1		14775		1		-1		-1		1		14775		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		668		13335		-1		14653		1		-1		-1		1		14653		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		669		13354		-1		16398		1		-1		-1		1		16398		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		670		13369		-1		11565		1		-1		-1		1		11565		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		671		13386		-1		11208		1		-1		-1		1		11208		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		672		13405		-1		10902		1		-1		-1		1		10902		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		673		13429		-1		14949		1		-1		-1		1		14949		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		674		13449		-1		14243		1		-1		-1		1		14243		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		675		13465		-1		13064		1		-1		-1		1		13064		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		676		13484		-1		16342		1		-1		-1		1		16342		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		677		13502		-1		15557		1		-1		-1		1		15557		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		678		13522		-1		14035		1		-1		-1		1		14035		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		679		13542		-1		14342		1		-1		-1		1		14342		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		680		13562		-1		14458		1		-1		-1		1		14458		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		681		13588		-1		17329		1		-1		-1		1		17329		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		682		13605		-1		12940		1		-1		-1		1		12940		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		683		13625		-1		13667		1		-1		-1		1		13667		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		684		13643		-1		11797		1		-1		-1		1		11797		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		685		13654		-1		16225		1		-1		-1		1		16225		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		686		13667		-1		15655		1		-1		-1		1		15655		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		687		13686		-1		13812		1		-1		-1		1		13812		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		688		13699		-1		13732		1		-1		-1		1		13732		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		689		13720		-1		14409		1		-1		-1		1		14409		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		690		13737		-1		14809		1		-1		-1		1		14809		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		691		13754		-1		15765		1		-1		-1		1		15765		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		692		13778		-1		13690		1		-1		-1		1		13690		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		693		13805		-1		17769		1		-1		-1		1		17769		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		694		13821		-1		10921		1		-1		-1		1		10921		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		695		13840		-1		12590		1		-1		-1		1		12590		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		696		13859		-1		12386		1		-1		-1		1		12386		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		697		13871		-1		16988		1		-1		-1		1		16988		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		698		13891		-1		12586		1		-1		-1		1		12586		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		699		13914		-1		12006		1		-1		-1		1		12006		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		700		13935		-1		15204		1		-1		-1		1		15204		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		701		13966		-1		14098		1		-1		-1		1		14098		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		702		13988		-1		12070		1		-1		-1		1		12070		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		703		14010		-1		16481		1		-1		-1		1		16481		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		704		14029		-1		12848		1		-1		-1		1		12848		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		705		14048		-1		11510		1		-1		-1		1		11510		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		706		14063		-1		11614		1		-1		-1		1		11614		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		707		14081		-1		11452		1		-1		-1		1		11452		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		708		14103		-1		15245		1		-1		-1		1		15245		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		709		14118		-1		12235		1		-1		-1		1		12235		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		710		14144		-1		12356		1		-1		-1		1		12356		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		711		14174		-1		17485		1		-1		-1		1		17485		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		712		14191		-1		15867		1		-1		-1		1		15867		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		713		14206		-1		12087		1		-1		-1		1		12087		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		714		14225		-1		13353		1		-1		-1		1		13353		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		715		14241		-1		15636		1		-1		-1		1		15636		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		716		14261		-1		16408		1		-1		-1		1		16408		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		717		14287		-1		12020		1		-1		-1		1		12020		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		718		14305		-1		15594		1		-1		-1		1		15594		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		719		14318		-1		17268		1		-1		-1		1		17268		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		720		14330		-1		15395		1		-1		-1		1		15395		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		721		14353		-1		15137		1		-1		-1		1		15137		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		722		14368		-1		14354		1		-1		-1		1		14354		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		723		14382		-1		13082		1		-1		-1		1		13082		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		724		14401		-1		13342		1		-1		-1		1		13342		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		725		14421		-1		16044		4		-1		-1		4		16044		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		726		14439		-1		14152		1		-1		-1		1		14152		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		727		14455		-1		14960		1		-1		-1		1		14960		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		728		14469		-1		11320		4		-1		-1		4		11320		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		729		14491		-1		14709		1		-1		-1		1		14709		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		730		14508		-1		13153		1		-1		-1		1		13153		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		731		14529		-1		16171		1		-1		-1		1		16171		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		732		14546		-1		11459		1		-1		-1		1		11459		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		733		14573		-1		14523		1		-1		-1		1		14523		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		734		14594		-1		14362		1		-1		-1		1		14362		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		735		14612		-1		16715		1		-1		-1		1		16715		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		736		14628		-1		17812		1		-1		-1		1		17812		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		737		14652		-1		10840		1		-1		-1		1		10840		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		738		14677		-1		15494		1		-1		-1		1		15494		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		739		14694		-1		11132		1		-1		-1		1		11132		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		740		14712		-1		15824		1		-1		-1		1		15824		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		741		14732		-1		15370		1		-1		-1		1		15370		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		742		14756		-1		14886		1		-1		-1		1		14886		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		743		14780		-1		12741		1		-1		-1		1		12741		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		744		14803		-1		16619		1		-1		-1		1		16619		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		745		14823		-1		15276		1		-1		-1		1		15276		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		746		14849		-1		14533		1		-1		-1		1		14533		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		747		14868		-1		16814		1		-1		-1		1		16814		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		748		14879		-1		13675		1		-1		-1		1		13675		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		749		14904		-1		11668		1		-1		-1		1		11668		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		750		14922		-1		15621		1		-1		-1		1		15621		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		751		14950		-1		16164		1		-1		-1		1		16164		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		752		14974		-1		14002		1		-1		-1		1		14002		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		753		14992		-1		12057		1		-1		-1		1		12057		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		754		15015		-1		12879		4		-1		-1		4		12879		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		755		15032		-1		13190		1		-1		-1		1		13190		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		756		15044		-1		11396		1		-1		-1		1		11396		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		757		15062		-1		13792		1		-1		-1		1		13792		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		758		15090		-1		12896		1		-1		-1		1		12896		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		759		15113		-1		16792		1		-1		-1		1		16792		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		760		15136		-1		12182		1		-1		-1		1		12182		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		761		15158		-1		16709		1		-1		-1		1		16709		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		762		15169		-1		16840		1		-1		-1		1		16840		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		763		15191		-1		15933		1		-1		-1		1		15933		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		764		15215		-1		14491		1		-1		-1		1		14491		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		765		15238		-1		12603		1		-1		-1		1		12603		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		766		15257		-1		17237		1		-1		-1		1		17237		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		767		15275		-1		13898		1		-1		-1		1		13898		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		768		15299		-1		14276		1		-1		-1		1		14276		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		769		15325		-1		15687		4		-1		-1		4		15687		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		770		15340		-1		11812		1		-1		-1		1		11812		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		771		15358		-1		14022		1		-1		-1		1		14022		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		772		15378		-1		10879		1		-1		-1		1		10879		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		773		15400		-1		15052		1		-1		-1		1		15052		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		774		15422		-1		15644		1		-1		-1		1		15644		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		775		15437		-1		14762		1		-1		-1		1		14762		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		776		15452		-1		11912		1		-1		-1		1		11912		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		777		15470		-1		14496		1		-1		-1		1		14496		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		778		15495		-1		12225		1		-1		-1		1		12225		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		779		15522		-1		16662		1		-1		-1		1		16662		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		780		15537		-1		13643		1		-1		-1		1		13643		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		781		15558		-1		15999		1		-1		-1		1		15999		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		782		15576		-1		13350		1		-1		-1		1		13350		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		783		15593		-1		13816		1		-1		-1		1		13816		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		784		15614		-1		15891		1		-1		-1		1		15891		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		785		15632		-1		14391		1		-1		-1		1		14391		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		786		15652		-1		14254		1		-1		-1		1		14254		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		787		15677		-1		14662		1		-1		-1		1		14662		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		788		15705		-1		16726		1		-1		-1		1		16726		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		789		15723		-1		14860		1		-1		-1		1		14860		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		790		15744		-1		16318		1		-1		-1		1		16318		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		791		15767		-1		14336		1		-1		-1		1		14336		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		792		15788		-1		11620		1		-1		-1		1		11620		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		793		15811		-1		16514		1		-1		-1		1		16514		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		794		15834		-1		15254		1		-1		-1		1		15254		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		795		15858		-1		13957		1		-1		-1		1		13957		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		796		15876		-1		14649		1		-1		-1		1		14649		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		797		15892		-1		16917		1		-1		-1		1		16917		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		798		15910		-1		16449		1		-1		-1		1		16449		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		799		15929		-1		14530		1		-1		-1		1		14530		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		800		15942		-1		13467		1		-1		-1		1		13467		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		801		15959		-1		14769		1		-1		-1		1		14769		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		802		15985		-1		12225		1		-1		-1		1		12225		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		803		16001		-1		17934		1		-1		-1		1		17934		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		804		16027		-1		13241		1		-1		-1		1		13241		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		805		16044		-1		11709		1		-1		-1		1		11709		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		806		16059		-1		15930		1		-1		-1		1		15930		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		807		16084		-1		12956		1		-1		-1		1		12956		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		808		16103		-1		15191		1		-1		-1		1		15191		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		809		16121		-1		13153		1		-1		-1		1		13153		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		810		16142		-1		11981		1		-1		-1		1		11981		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		811		16165		-1		16582		1		-1		-1		1		16582		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		812		16188		-1		12814		1		-1		-1		1		12814		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		813		16204		-1		11881		1		-1		-1		1		11881		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		814		16227		-1		16345		1		-1		-1		1		16345		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		815		16251		-1		12992		1		-1		-1		1		12992		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		816		16273		-1		16126		1		-1		-1		1		16126		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		817		16296		-1		14129		1		-1		-1		1		14129		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		818		16322		-1		15919		1		-1		-1		1		15919		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		819		16341		-1		16039		1		-1		-1		1		16039		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		820		16355		-1		13716		1		-1		-1		1		13716		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		821		16371		-1		11354		1		-1		-1		1		11354		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		822		16383		-1		14187		1		-1		-1		1		14187		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		823		16399		-1		14435		1		-1		-1		1		14435		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		824		16416		-1		14625		1		-1		-1		1		14625		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		825		16432		-1		17847		1		-1		-1		1		17847		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		826		16447		-1		12261		1		-1		-1		1		12261		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		827		16466		-1		14162		1		-1		-1		1		14162		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		828		16486		-1		16228		1		-1		-1		1		16228		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		829		16511		-1		11558		1		-1		-1		1		11558		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		830		16536		-1		16623		1		-1		-1		1		16623		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		831		16554		-1		15424		4		-1		-1		4		15424		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		832		16579		-1		16990		1		-1		-1		1		16990		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		833		16605		-1		13924		1		-1		-1		1		13924		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		834		16615		-1		13264		1		-1		-1		1		13264		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		835		16637		-1		11760		1		-1		-1		1		11760		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		836		16653		-1		12594		1		-1		-1		1		12594		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		837		16674		-1		15071		1		-1		-1		1		15071		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		838		16685		-1		12622		1		-1		-1		1		12622		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		839		16700		-1		16416		1		-1		-1		1		16416		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		840		16722		-1		17524		1		-1		-1		1		17524		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		841		16737		-1		16777		1		-1		-1		1		16777		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		842		16761		-1		15883		1		-1		-1		1		15883		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		843		16786		-1		13633		1		-1		-1		1		13633		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		844		16805		-1		15174		1		-1		-1		1		15174		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		845		16827		-1		11321		1		-1		-1		1		11321		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		846		16858		-1		13521		1		-1		-1		1		13521		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		847		16877		-1		16716		1		-1		-1		1		16716		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		848		16905		-1		14301		1		-1		-1		1		14301		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		849		16927		-1		14784		1		-1		-1		1		14784		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		850		16944		-1		16297		1		-1		-1		1		16297		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		851		16969		-1		12340		1		-1		-1		1		12340		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		852		16987		-1		15284		1		-1		-1		1		15284		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		853		17005		-1		11019		1		-1		-1		1		11019		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		854		17028		-1		14419		1		-1		-1		1		14419		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		855		17048		-1		13849		1		-1		-1		1		13849		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		856		17066		-1		15389		1		-1		-1		1		15389		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		857		17086		-1		17085		1		-1		-1		1		17085		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		858		17115		-1		14238		1		-1		-1		1		14238		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		859		17132		-1		11416		1		-1		-1		1		11416		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		860		17147		-1		14644		1		-1		-1		1		14644		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		861		17173		-1		11941		1		-1		-1		1		11941		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		862		17193		-1		13695		1		-1		-1		1		13695		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		863		17209		-1		11449		1		-1		-1		1		11449		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		864		17228		-1		13342		1		-1		-1		1		13342		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		865		17249		-1		14903		1		-1		-1		1		14903		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		866		17276		-1		17339		1		-1		-1		1		17339		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		867		17290		-1		17401		1		-1		-1		1		17401		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		868		17307		-1		16932		1		-1		-1		1		16932		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		869		17331		-1		13211		1		-1		-1		1		13211		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		870		17346		-1		13591		1		-1		-1		1		13591		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		871		17369		-1		12287		1		-1		-1		1		12287		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		872		17387		-1		11678		1		-1		-1		1		11678		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		873		17404		-1		15963		1		-1		-1		1		15963		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		874		17428		-1		16508		1		-1		-1		1		16508		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		875		17444		-1		13159		1		-1		-1		1		13159		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		876		17463		-1		17820		1		-1		-1		1		17820		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		877		17480		-1		11949		1		-1		-1		1		11949		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		878		17497		-1		17271		1		-1		-1		1		17271		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		879		17519		-1		11725		1		-1		-1		1		11725		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		880		17537		-1		13391		1		-1		-1		1		13391		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		881		17553		-1		12940		1		-1		-1		1		12940		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		882		17568		-1		17205		1		-1		-1		1		17205		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		883		17592		-1		15576		1		-1		-1		1		15576		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		884		17600		-1		12002		1		-1		-1		1		12002		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		885		17613		-1		14426		1		-1		-1		1		14426		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		886		17629		-1		14970		1		-1		-1		1		14970		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		887		17656		-1		13250		1		-1		-1		1		13250		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		888		17679		-1		10812		1		-1		-1		1		10812		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		889		17693		-1		16137		1		-1		-1		1		16137		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		890		17713		-1		14464		1		-1		-1		1		14464		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		891		17738		-1		12942		1		-1		-1		1		12942		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		892		17758		-1		16242		1		-1		-1		1		16242		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		893		17772		-1		13334		1		-1		-1		1		13334		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		894		17789		-1		12767		1		-1		-1		1		12767		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		895		17805		-1		13909		1		-1		-1		1		13909		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		896		17824		-1		16296		1		-1		-1		1		16296		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		897		17842		-1		13089		1		-1		-1		1		13089		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		898		17864		-1		17913		1		-1		-1		1		17913		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		899		17882		-1		13538		1		-1		-1		1		13538		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		900		17898		-1		17440		1		-1		-1		1		17440		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		901		17911		-1		15792		1		-1		-1		1		15792		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		902		17941		-1		12610		1		-1		-1		1		12610		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		903		17968		-1		15921		1		-1		-1		1		15921		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		904		17986		-1		15926		1		-1		-1		1		15926		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		905		17997		-1		12304		1		-1		-1		1		12304		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		906		18014		-1		16012		1		-1		-1		1		16012		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		907		18036		-1		11032		1		-1		-1		1		11032		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		908		18054		-1		17750		1		-1		-1		1		17750		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		909		18067		-1		13057		1		-1		-1		1		13057		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		910		18083		-1		14577		1		-1		-1		1		14577		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		911		18101		-1		12355		1		-1		-1		1		12355		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		912		18116		-1		13989		1		-1		-1		1		13989		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		913		18129		-1		14283		1		-1		-1		1		14283		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		914		18139		-1		17223		1		-1		-1		1		17223		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		915		18160		-1		15022		1		-1		-1		1		15022		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		916		18183		-1		15954		1		-1		-1		1		15954		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		917		18207		-1		14461		1		-1		-1		1		14461		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		918		18226		-1		13474		1		-1		-1		1		13474		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		919		18250		-1		12307		1		-1		-1		1		12307		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		920		18273		-1		14818		1		-1		-1		1		14818		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		921		18298		-1		15732		1		-1		-1		1		15732		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		922		18320		-1		12821		1		-1		-1		1		12821		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		923		18348		-1		12166		1		-1		-1		1		12166		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		924		18368		-1		11694		1		-1		-1		1		11694		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		925		18388		-1		16577		1		-1		-1		1		16577		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		926		18413		-1		11301		1		-1		-1		1		11301		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		927		18439		-1		17056		1		-1		-1		1		17056		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		928		18460		-1		12823		1		-1		-1		1		12823		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		929		18494		-1		12549		1		-1		-1		1		12549		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		930		18508		-1		16686		1		-1		-1		1		16686		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		931		18531		-1		14507		1		-1		-1		1		14507		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		932		18544		-1		16278		1		-1		-1		1		16278		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		933		18563		-1		16495		1		-1		-1		1		16495		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		934		18583		-1		10827		1		-1		-1		1		10827		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		935		18605		-1		13090		1		-1		-1		1		13090		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		936		18631		-1		11617		1		-1		-1		1		11617		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		937		18650		-1		16730		1		-1		-1		1		16730		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		938		18670		-1		17570		1		-1		-1		1		17570		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		939		18693		-1		14798		1		-1		-1		1		14798		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		940		18718		-1		14141		1		-1		-1		1		14141		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		941		18739		-1		14196		1		-1		-1		1		14196		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		942		18762		-1		11476		1		-1		-1		1		11476		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		943		18782		-1		16027		1		-1		-1		1		16027		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		944		18812		-1		14237		1		-1		-1		1		14237		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		945		18825		-1		11316		1		-1		-1		1		11316		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		946		18845		-1		12857		1		-1		-1		1		12857		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		947		18864		-1		12546		1		-1		-1		1		12546		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		948		18883		-1		11362		1		-1		-1		1		11362		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		949		18901		-1		12011		1		-1		-1		1		12011		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		950		18918		-1		14236		1		-1		-1		1		14236		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		951		18937		-1		16611		1		-1		-1		1		16611		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		952		18953		-1		13235		1		-1		-1		1		13235		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		953		18975		-1		13994		1		-1		-1		1		13994		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		954		18996		-1		16833		1		-1		-1		1		16833		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		955		19020		-1		14758		1		-1		-1		1		14758		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		956		19046		-1		16372		1		-1		-1		1		16372		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		957		19067		-1		13765		1		-1		-1		1		13765		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		958		19087		-1		16458		1		-1		-1		1		16458		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		959		19113		-1		15548		1		-1		-1		1		15548		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		960		19128		-1		14483		1		-1		-1		1		14483		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		961		19149		-1		14535		1		-1		-1		1		14535		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		962		19168		-1		10808		1		-1		-1		1		10808		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		963		19183		-1		10896		1		-1		-1		1		10896		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		964		19197		-1		17691		1		-1		-1		1		17691		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		965		19213		-1		15217		1		-1		-1		1		15217		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		966		19230		-1		15625		1		-1		-1		1		15625		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		967		19243		-1		16400		1		-1		-1		1		16400		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		968		19260		-1		15974		1		-1		-1		1		15974		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		969		19281		-1		14646		1		-1		-1		1		14646		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		970		19291		-1		16277		1		-1		-1		1		16277		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		971		19318		-1		14896		1		-1		-1		1		14896		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		972		19331		-1		16229		1		-1		-1		1		16229		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		973		19357		-1		16275		1		-1		-1		1		16275		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		974		19385		-1		14851		1		-1		-1		1		14851		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		975		19400		-1		15755		1		-1		-1		1		15755		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		976		19418		-1		15244		1		-1		-1		1		15244		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		977		19445		-1		17595		1		-1		-1		1		17595		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		978		19461		-1		11929		1		-1		-1		1		11929		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		979		19484		-1		17983		1		-1		-1		1		17983		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		980		19512		-1		14660		1		-1		-1		1		14660		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		981		19533		-1		13748		1		-1		-1		1		13748		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		982		19551		-1		17405		1		-1		-1		1		17405		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		983		19571		-1		16802		1		-1		-1		1		16802		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		984		19594		-1		10952		1		-1		-1		1		10952		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		985		19612		-1		13942		1		-1		-1		1		13942		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		986		19628		-1		13400		1		-1		-1		1		13400		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		987		19649		-1		13214		1		-1		-1		1		13214		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		988		19672		-1		17111		1		-1		-1		1		17111		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		989		19698		-1		11386		1		-1		-1		1		11386		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		990		19722		-1		14048		1		-1		-1		1		14048		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		991		19742		-1		13993		1		-1		-1		1		13993		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		992		19755		-1		16359		1		-1		-1		1		16359		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		993		19776		-1		11220		1		-1		-1		1		11220		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		994		19802		-1		17346		1		-1		-1		1		17346		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		995		19814		-1		11953		1		-1		-1		1		11953		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		996		19837		-1		15333		1		-1		-1		1		15333		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		997		19856		-1		13428		1		-1		-1		1		13428		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		998		19877		-1		10907		1		-1		-1		1		10907		-1		-1		-1		-1		-1		-1		-1		-1		-1
+		999		19904		-1		11224		1		-1		-1		1		11224		-1		-1		-1		-1		-1		-1		-1		-1		-1
+;IDMapping: swfID:jobID:taskID
+; 0:0:0, 1:1:0, 2:2:0, 3:3:0, 4:4:0, 5:5:0, 6:6:0, 7:7:0, 8:8:0, 9:9:0, 
+; 10:10:0, 11:11:0, 12:12:0, 13:13:0, 14:14:0, 15:15:0, 16:16:0, 17:17:0, 18:18:0, 19:19:0, 
+; 20:20:0, 21:21:0, 22:22:0, 23:23:0, 24:24:0, 25:25:0, 26:26:0, 27:27:0, 28:28:0, 29:29:0, 
+; 30:30:0, 31:31:0, 32:32:0, 33:33:0, 34:34:0, 35:35:0, 36:36:0, 37:37:0, 38:38:0, 39:39:0, 
+; 40:40:0, 41:41:0, 42:42:0, 43:43:0, 44:44:0, 45:45:0, 46:46:0, 47:47:0, 48:48:0, 49:49:0, 
+; 50:50:0, 51:51:0, 52:52:0, 53:53:0, 54:54:0, 55:55:0, 56:56:0, 57:57:0, 58:58:0, 59:59:0, 
+; 60:60:0, 61:61:0, 62:62:0, 63:63:0, 64:64:0, 65:65:0, 66:66:0, 67:67:0, 68:68:0, 69:69:0, 
+; 70:70:0, 71:71:0, 72:72:0, 73:73:0, 74:74:0, 75:75:0, 76:76:0, 77:77:0, 78:78:0, 79:79:0, 
+; 80:80:0, 81:81:0, 82:82:0, 83:83:0, 84:84:0, 85:85:0, 86:86:0, 87:87:0, 88:88:0, 89:89:0, 
+; 90:90:0, 91:91:0, 92:92:0, 93:93:0, 94:94:0, 95:95:0, 96:96:0, 97:97:0, 98:98:0, 99:99:0, 
+; 100:100:0, 101:101:0, 102:102:0, 103:103:0, 104:104:0, 105:105:0, 106:106:0, 107:107:0, 108:108:0, 109:109:0, 
+; 110:110:0, 111:111:0, 112:112:0, 113:113:0, 114:114:0, 115:115:0, 116:116:0, 117:117:0, 118:118:0, 119:119:0, 
+; 120:120:0, 121:121:0, 122:122:0, 123:123:0, 124:124:0, 125:125:0, 126:126:0, 127:127:0, 128:128:0, 129:129:0, 
+; 130:130:0, 131:131:0, 132:132:0, 133:133:0, 134:134:0, 135:135:0, 136:136:0, 137:137:0, 138:138:0, 139:139:0, 
+; 140:140:0, 141:141:0, 142:142:0, 143:143:0, 144:144:0, 145:145:0, 146:146:0, 147:147:0, 148:148:0, 149:149:0, 
+; 150:150:0, 151:151:0, 152:152:0, 153:153:0, 154:154:0, 155:155:0, 156:156:0, 157:157:0, 158:158:0, 159:159:0, 
+; 160:160:0, 161:161:0, 162:162:0, 163:163:0, 164:164:0, 165:165:0, 166:166:0, 167:167:0, 168:168:0, 169:169:0, 
+; 170:170:0, 171:171:0, 172:172:0, 173:173:0, 174:174:0, 175:175:0, 176:176:0, 177:177:0, 178:178:0, 179:179:0, 
+; 180:180:0, 181:181:0, 182:182:0, 183:183:0, 184:184:0, 185:185:0, 186:186:0, 187:187:0, 188:188:0, 189:189:0, 
+; 190:190:0, 191:191:0, 192:192:0, 193:193:0, 194:194:0, 195:195:0, 196:196:0, 197:197:0, 198:198:0, 199:199:0, 
+; 200:200:0, 201:201:0, 202:202:0, 203:203:0, 204:204:0, 205:205:0, 206:206:0, 207:207:0, 208:208:0, 209:209:0, 
+; 210:210:0, 211:211:0, 212:212:0, 213:213:0, 214:214:0, 215:215:0, 216:216:0, 217:217:0, 218:218:0, 219:219:0, 
+; 220:220:0, 221:221:0, 222:222:0, 223:223:0, 224:224:0, 225:225:0, 226:226:0, 227:227:0, 228:228:0, 229:229:0, 
+; 230:230:0, 231:231:0, 232:232:0, 233:233:0, 234:234:0, 235:235:0, 236:236:0, 237:237:0, 238:238:0, 239:239:0, 
+; 240:240:0, 241:241:0, 242:242:0, 243:243:0, 244:244:0, 245:245:0, 246:246:0, 247:247:0, 248:248:0, 249:249:0, 
+; 250:250:0, 251:251:0, 252:252:0, 253:253:0, 254:254:0, 255:255:0, 256:256:0, 257:257:0, 258:258:0, 259:259:0, 
+; 260:260:0, 261:261:0, 262:262:0, 263:263:0, 264:264:0, 265:265:0, 266:266:0, 267:267:0, 268:268:0, 269:269:0, 
+; 270:270:0, 271:271:0, 272:272:0, 273:273:0, 274:274:0, 275:275:0, 276:276:0, 277:277:0, 278:278:0, 279:279:0, 
+; 280:280:0, 281:281:0, 282:282:0, 283:283:0, 284:284:0, 285:285:0, 286:286:0, 287:287:0, 288:288:0, 289:289:0, 
+; 290:290:0, 291:291:0, 292:292:0, 293:293:0, 294:294:0, 295:295:0, 296:296:0, 297:297:0, 298:298:0, 299:299:0, 
+; 300:300:0, 301:301:0, 302:302:0, 303:303:0, 304:304:0, 305:305:0, 306:306:0, 307:307:0, 308:308:0, 309:309:0, 
+; 310:310:0, 311:311:0, 312:312:0, 313:313:0, 314:314:0, 315:315:0, 316:316:0, 317:317:0, 318:318:0, 319:319:0, 
+; 320:320:0, 321:321:0, 322:322:0, 323:323:0, 324:324:0, 325:325:0, 326:326:0, 327:327:0, 328:328:0, 329:329:0, 
+; 330:330:0, 331:331:0, 332:332:0, 333:333:0, 334:334:0, 335:335:0, 336:336:0, 337:337:0, 338:338:0, 339:339:0, 
+; 340:340:0, 341:341:0, 342:342:0, 343:343:0, 344:344:0, 345:345:0, 346:346:0, 347:347:0, 348:348:0, 349:349:0, 
+; 350:350:0, 351:351:0, 352:352:0, 353:353:0, 354:354:0, 355:355:0, 356:356:0, 357:357:0, 358:358:0, 359:359:0, 
+; 360:360:0, 361:361:0, 362:362:0, 363:363:0, 364:364:0, 365:365:0, 366:366:0, 367:367:0, 368:368:0, 369:369:0, 
+; 370:370:0, 371:371:0, 372:372:0, 373:373:0, 374:374:0, 375:375:0, 376:376:0, 377:377:0, 378:378:0, 379:379:0, 
+; 380:380:0, 381:381:0, 382:382:0, 383:383:0, 384:384:0, 385:385:0, 386:386:0, 387:387:0, 388:388:0, 389:389:0, 
+; 390:390:0, 391:391:0, 392:392:0, 393:393:0, 394:394:0, 395:395:0, 396:396:0, 397:397:0, 398:398:0, 399:399:0, 
+; 400:400:0, 401:401:0, 402:402:0, 403:403:0, 404:404:0, 405:405:0, 406:406:0, 407:407:0, 408:408:0, 409:409:0, 
+; 410:410:0, 411:411:0, 412:412:0, 413:413:0, 414:414:0, 415:415:0, 416:416:0, 417:417:0, 418:418:0, 419:419:0, 
+; 420:420:0, 421:421:0, 422:422:0, 423:423:0, 424:424:0, 425:425:0, 426:426:0, 427:427:0, 428:428:0, 429:429:0, 
+; 430:430:0, 431:431:0, 432:432:0, 433:433:0, 434:434:0, 435:435:0, 436:436:0, 437:437:0, 438:438:0, 439:439:0, 
+; 440:440:0, 441:441:0, 442:442:0, 443:443:0, 444:444:0, 445:445:0, 446:446:0, 447:447:0, 448:448:0, 449:449:0, 
+; 450:450:0, 451:451:0, 452:452:0, 453:453:0, 454:454:0, 455:455:0, 456:456:0, 457:457:0, 458:458:0, 459:459:0, 
+; 460:460:0, 461:461:0, 462:462:0, 463:463:0, 464:464:0, 465:465:0, 466:466:0, 467:467:0, 468:468:0, 469:469:0, 
+; 470:470:0, 471:471:0, 472:472:0, 473:473:0, 474:474:0, 475:475:0, 476:476:0, 477:477:0, 478:478:0, 479:479:0, 
+; 480:480:0, 481:481:0, 482:482:0, 483:483:0, 484:484:0, 485:485:0, 486:486:0, 487:487:0, 488:488:0, 489:489:0, 
+; 490:490:0, 491:491:0, 492:492:0, 493:493:0, 494:494:0, 495:495:0, 496:496:0, 497:497:0, 498:498:0, 499:499:0, 
+; 500:500:0, 501:501:0, 502:502:0, 503:503:0, 504:504:0, 505:505:0, 506:506:0, 507:507:0, 508:508:0, 509:509:0, 
+; 510:510:0, 511:511:0, 512:512:0, 513:513:0, 514:514:0, 515:515:0, 516:516:0, 517:517:0, 518:518:0, 519:519:0, 
+; 520:520:0, 521:521:0, 522:522:0, 523:523:0, 524:524:0, 525:525:0, 526:526:0, 527:527:0, 528:528:0, 529:529:0, 
+; 530:530:0, 531:531:0, 532:532:0, 533:533:0, 534:534:0, 535:535:0, 536:536:0, 537:537:0, 538:538:0, 539:539:0, 
+; 540:540:0, 541:541:0, 542:542:0, 543:543:0, 544:544:0, 545:545:0, 546:546:0, 547:547:0, 548:548:0, 549:549:0, 
+; 550:550:0, 551:551:0, 552:552:0, 553:553:0, 554:554:0, 555:555:0, 556:556:0, 557:557:0, 558:558:0, 559:559:0, 
+; 560:560:0, 561:561:0, 562:562:0, 563:563:0, 564:564:0, 565:565:0, 566:566:0, 567:567:0, 568:568:0, 569:569:0, 
+; 570:570:0, 571:571:0, 572:572:0, 573:573:0, 574:574:0, 575:575:0, 576:576:0, 577:577:0, 578:578:0, 579:579:0, 
+; 580:580:0, 581:581:0, 582:582:0, 583:583:0, 584:584:0, 585:585:0, 586:586:0, 587:587:0, 588:588:0, 589:589:0, 
+; 590:590:0, 591:591:0, 592:592:0, 593:593:0, 594:594:0, 595:595:0, 596:596:0, 597:597:0, 598:598:0, 599:599:0, 
+; 600:600:0, 601:601:0, 602:602:0, 603:603:0, 604:604:0, 605:605:0, 606:606:0, 607:607:0, 608:608:0, 609:609:0, 
+; 610:610:0, 611:611:0, 612:612:0, 613:613:0, 614:614:0, 615:615:0, 616:616:0, 617:617:0, 618:618:0, 619:619:0, 
+; 620:620:0, 621:621:0, 622:622:0, 623:623:0, 624:624:0, 625:625:0, 626:626:0, 627:627:0, 628:628:0, 629:629:0, 
+; 630:630:0, 631:631:0, 632:632:0, 633:633:0, 634:634:0, 635:635:0, 636:636:0, 637:637:0, 638:638:0, 639:639:0, 
+; 640:640:0, 641:641:0, 642:642:0, 643:643:0, 644:644:0, 645:645:0, 646:646:0, 647:647:0, 648:648:0, 649:649:0, 
+; 650:650:0, 651:651:0, 652:652:0, 653:653:0, 654:654:0, 655:655:0, 656:656:0, 657:657:0, 658:658:0, 659:659:0, 
+; 660:660:0, 661:661:0, 662:662:0, 663:663:0, 664:664:0, 665:665:0, 666:666:0, 667:667:0, 668:668:0, 669:669:0, 
+; 670:670:0, 671:671:0, 672:672:0, 673:673:0, 674:674:0, 675:675:0, 676:676:0, 677:677:0, 678:678:0, 679:679:0, 
+; 680:680:0, 681:681:0, 682:682:0, 683:683:0, 684:684:0, 685:685:0, 686:686:0, 687:687:0, 688:688:0, 689:689:0, 
+; 690:690:0, 691:691:0, 692:692:0, 693:693:0, 694:694:0, 695:695:0, 696:696:0, 697:697:0, 698:698:0, 699:699:0, 
+; 700:700:0, 701:701:0, 702:702:0, 703:703:0, 704:704:0, 705:705:0, 706:706:0, 707:707:0, 708:708:0, 709:709:0, 
+; 710:710:0, 711:711:0, 712:712:0, 713:713:0, 714:714:0, 715:715:0, 716:716:0, 717:717:0, 718:718:0, 719:719:0, 
+; 720:720:0, 721:721:0, 722:722:0, 723:723:0, 724:724:0, 725:725:0, 726:726:0, 727:727:0, 728:728:0, 729:729:0, 
+; 730:730:0, 731:731:0, 732:732:0, 733:733:0, 734:734:0, 735:735:0, 736:736:0, 737:737:0, 738:738:0, 739:739:0, 
+; 740:740:0, 741:741:0, 742:742:0, 743:743:0, 744:744:0, 745:745:0, 746:746:0, 747:747:0, 748:748:0, 749:749:0, 
+; 750:750:0, 751:751:0, 752:752:0, 753:753:0, 754:754:0, 755:755:0, 756:756:0, 757:757:0, 758:758:0, 759:759:0, 
+; 760:760:0, 761:761:0, 762:762:0, 763:763:0, 764:764:0, 765:765:0, 766:766:0, 767:767:0, 768:768:0, 769:769:0, 
+; 770:770:0, 771:771:0, 772:772:0, 773:773:0, 774:774:0, 775:775:0, 776:776:0, 777:777:0, 778:778:0, 779:779:0, 
+; 780:780:0, 781:781:0, 782:782:0, 783:783:0, 784:784:0, 785:785:0, 786:786:0, 787:787:0, 788:788:0, 789:789:0, 
+; 790:790:0, 791:791:0, 792:792:0, 793:793:0, 794:794:0, 795:795:0, 796:796:0, 797:797:0, 798:798:0, 799:799:0, 
+; 800:800:0, 801:801:0, 802:802:0, 803:803:0, 804:804:0, 805:805:0, 806:806:0, 807:807:0, 808:808:0, 809:809:0, 
+; 810:810:0, 811:811:0, 812:812:0, 813:813:0, 814:814:0, 815:815:0, 816:816:0, 817:817:0, 818:818:0, 819:819:0, 
+; 820:820:0, 821:821:0, 822:822:0, 823:823:0, 824:824:0, 825:825:0, 826:826:0, 827:827:0, 828:828:0, 829:829:0, 
+; 830:830:0, 831:831:0, 832:832:0, 833:833:0, 834:834:0, 835:835:0, 836:836:0, 837:837:0, 838:838:0, 839:839:0, 
+; 840:840:0, 841:841:0, 842:842:0, 843:843:0, 844:844:0, 845:845:0, 846:846:0, 847:847:0, 848:848:0, 849:849:0, 
+; 850:850:0, 851:851:0, 852:852:0, 853:853:0, 854:854:0, 855:855:0, 856:856:0, 857:857:0, 858:858:0, 859:859:0, 
+; 860:860:0, 861:861:0, 862:862:0, 863:863:0, 864:864:0, 865:865:0, 866:866:0, 867:867:0, 868:868:0, 869:869:0, 
+; 870:870:0, 871:871:0, 872:872:0, 873:873:0, 874:874:0, 875:875:0, 876:876:0, 877:877:0, 878:878:0, 879:879:0, 
+; 880:880:0, 881:881:0, 882:882:0, 883:883:0, 884:884:0, 885:885:0, 886:886:0, 887:887:0, 888:888:0, 889:889:0, 
+; 890:890:0, 891:891:0, 892:892:0, 893:893:0, 894:894:0, 895:895:0, 896:896:0, 897:897:0, 898:898:0, 899:899:0, 
+; 900:900:0, 901:901:0, 902:902:0, 903:903:0, 904:904:0, 905:905:0, 906:906:0, 907:907:0, 908:908:0, 909:909:0, 
+; 910:910:0, 911:911:0, 912:912:0, 913:913:0, 914:914:0, 915:915:0, 916:916:0, 917:917:0, 918:918:0, 919:919:0, 
+; 920:920:0, 921:921:0, 922:922:0, 923:923:0, 924:924:0, 925:925:0, 926:926:0, 927:927:0, 928:928:0, 929:929:0, 
+; 930:930:0, 931:931:0, 932:932:0, 933:933:0, 934:934:0, 935:935:0, 936:936:0, 937:937:0, 938:938:0, 939:939:0, 
+; 940:940:0, 941:941:0, 942:942:0, 943:943:0, 944:944:0, 945:945:0, 946:946:0, 947:947:0, 948:948:0, 949:949:0, 
+; 950:950:0, 951:951:0, 952:952:0, 953:953:0, 954:954:0, 955:955:0, 956:956:0, 957:957:0, 958:958:0, 959:959:0, 
+; 960:960:0, 961:961:0, 962:962:0, 963:963:0, 964:964:0, 965:965:0, 966:966:0, 967:967:0, 968:968:0, 969:969:0, 
+; 970:970:0, 971:971:0, 972:972:0, 973:973:0, 974:974:0, 975:975:0, 976:976:0, 977:977:0, 978:978:0, 979:979:0, 
+; 980:980:0, 981:981:0, 982:982:0, 983:983:0, 984:984:0, 985:985:0, 986:986:0, 987:987:0, 988:988:0, 989:989:0, 
+; 990:990:0, 991:991:0, 992:992:0, 993:993:0, 994:994:0, 995:995:0, 996:996:0, 997:997:0, 998:998:0, 999:999:0, 
+; 
+;IDMapping: end
Index: DCWoRMS/trunk/example/workgen/GeneratorConfig.xml
===================================================================
--- DCWoRMS/trunk/example/workgen/GeneratorConfig.xml	(revision 477)
+++ DCWoRMS/trunk/example/workgen/GeneratorConfig.xml	(revision 477)
@@ -0,0 +1,32 @@
+<tns:WorkloadConfiguration 
+	xmlns:tns="http://www.man.poznan.pl/WorkloadSchema" 
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ 
+  	<SimulationStartTime>2009-01-15T10:00:00</SimulationStartTime>
+ 
+	<JobCount avg="1000" distribution="constant"/>
+ 
+	<TaskCount avg="1" distribution="constant"/>
+ 
+	<TaskLength avg="14400" min="10800" max="18000" stdev="3600.0" distribution="normal"/>
+ 
+	<JobPackageLength avg="1.0" min="1.0" max="1.0" stdev="0.0" distribution="constant"/>
+ 
+	<JobInterval avg="50" min="0" max="100" stdev="30" distribution="poisson" seed="21"/>
+	
+	<ComputingResourceHostParameter metric="cpucount">
+		<value id="cpucnt">
+	  		<MultiDistribution>
+      			<dist avg="1" min="1" max="1" stdev="0" distribution="uniform">0.95</dist>
+     		 	<dist avg="4" min="4" max="4" stdev="0" distribution="uniform">0.05</dist>
+   			</MultiDistribution>
+   		</value>	
+	</ComputingResourceHostParameter>
+ 
+ 	<ComputingResourceHostParameter metric="memory">
+		<value id="memory" refElementId="cpucnt"  expr="x*1024"/>
+	</ComputingResourceHostParameter>
+	 
+</tns:WorkloadConfiguration>
+
+
Index: DCWoRMS/trunk/example/workgen/RunWorkloadGenerator.java
===================================================================
--- DCWoRMS/trunk/example/workgen/RunWorkloadGenerator.java	(revision 477)
+++ DCWoRMS/trunk/example/workgen/RunWorkloadGenerator.java	(revision 477)
@@ -0,0 +1,20 @@
+package workgen;
+
+import simulator.workload.generator.WorkloadGenerator;
+
+
+public class RunWorkloadGenerator {
+	
+	public static void main(String args[]){
+		RunWorkloadGenerator runner = new RunWorkloadGenerator();
+		runner.run();
+	}
+	
+	public void run(){
+		String args[] = {
+				"example/workgen/generator.properties"
+				};
+		WorkloadGenerator.main(args);
+	}
+
+}
Index: DCWoRMS/trunk/example/workgen/HostParameters.xml
===================================================================
--- DCWoRMS/trunk/example/workgen/HostParameters.xml	(revision 477)
+++ DCWoRMS/trunk/example/workgen/HostParameters.xml	(revision 477)
@@ -0,0 +1,18 @@
+<hostParameters xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+xsi:noNamespaceSchemaLocation="/Users/marcin/workspace/brain/symulator/gssim_current/simulator/schemas/grms3/GrmsHostParametersSchema.xsd">
+	<resources>
+		<computingResource  resourceId="compRes1">
+			<machineParameters>
+				<hostParameter name="cpucount">
+					<paramValue>1</paramValue>
+				</hostParameter>
+				<hostParameter name="cpuspeed">
+					<paramValue>1</paramValue>
+				</hostParameter>
+				<otherParameter name="reservation">
+					<paramValue>false</paramValue>
+				</otherParameter>
+			</machineParameters>
+		</computingResource>
+	</resources>
+</hostParameters>
Index: DCWoRMS/trunk/example/workgen/generator.properties
===================================================================
--- DCWoRMS/trunk/example/workgen/generator.properties	(revision 477)
+++ DCWoRMS/trunk/example/workgen/generator.properties	(revision 477)
@@ -0,0 +1,5 @@
+resdesc=example/workgen/HostParameters.xml
+createscenario.tasksdesc=example/workgen/GeneratorConfig.xml
+createscenario.outputfolder=example/workgen/workload
+createscenario.workloadfilename=workload.swf
+createscenario.overwrite_files=true
Index: DCWoRMS/trunk/example/workgen/workload0/workload.swf
===================================================================
--- DCWoRMS/trunk/example/workgen/workload0/workload.swf	(revision 477)
+++ DCWoRMS/trunk/example/workgen/workload0/workload.swf	(revision 477)
@@ -0,0 +1,15 @@
+;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|
+;PUSpeed: 1
+;StartTime: Thu Jan 15 10:00:00 CET 2009
+		0		37		-1		1		1		-1		-1		1		1		-1		-1		-1		-1		-1		-1		-1		-1		-1	
+		999		65088		-1		1		1		-1		-1		1		1		-1		-1		-1		-1		-1		-1		-1		-1		-1
Index: DCWoRMS/trunk/example/experiment1_result/Stats_Simulation 1_Simulation.txt
===================================================================
--- DCWoRMS/trunk/example/experiment1_result/Stats_Simulation 1_Simulation.txt	(revision 477)
+++ DCWoRMS/trunk/example/experiment1_result/Stats_Simulation 1_Simulation.txt	(revision 477)
@@ -0,0 +1,15 @@
+Resource name;mean;stdev;variance;minimum;maximum;sum;count;
+Delayed tasks;0;0;0;0;0;0;1;
+Failed requests (tasks);0;0;0;0;0;0;1;
+Makespan;57,600;0;0;57,600;57,600;57,600;1;
+Resources queue length;1;0;0;1;1;1;1;
+Resources total load;0.49;0;0;0.49;0.49;0.49;1;
+Resources reservation load;?;?;?;?;?;?;0;
+Energy usage;?;?;?;?;?;?;0;
+Task completion time;24,923.077;19,435.976;377,757,159.763;7,200;57,600;324,000;13;
+Task execution time;13,015.385;7,274.174;52,913,609.467;7,200;28,800;169,200;13;
+Task start time;1,384.615;2,656.153;7,055,147.929;0;7,200;18,000;13;
+Task flow time;14,400;8,704.376;75,766,153.846;7,200;36,000;187,200;13;
+Task waiting time;1,384.615;2,656.153;7,055,147.929;0;7,200;18,000;13;
+Task lateness;0;0;0;0;0;0;13;
+Task tardiness;0;0;0;0;0;0;13;
Index: DCWoRMS/trunk/example/experiment1_result/Stats_Simulation 1_Tasks.txt
===================================================================
--- DCWoRMS/trunk/example/experiment1_result/Stats_Simulation 1_Tasks.txt	(revision 477)
+++ DCWoRMS/trunk/example/experiment1_result/Stats_Simulation 1_Tasks.txt	(revision 477)
@@ -0,0 +1,14 @@
+JobID;TaskID;UserDN;ResName;CpuCnt;ExecStartDate;ExecFinishDate;ExecEndDate;GB_SubDate;LB_SubDate;CompletionTime;ExecStartTime;ExecutionTime;ReadyTime;StartTime;FlowTime;WaitingTime;GQ_WaitingTime;Lateness;Tardiness;ReservStartDate;ReservFinishDate;ProcessorName;Energy;
+1;1;-1;ManagementSystem@cluster;1;1225666800;1225674000;1225674000;1225666800;1225666800;7200;0;7200;0;0;7200;0;0;0;0;0;0;[Processor_0];
+2;2;-1;ManagementSystem@cluster;1;1225666800;1225674000;1225674000;1225666800;1225666800;7200;0;7200;0;0;7200;0;0;0;0;0;0;[Processor_1];
+3;3;-1;ManagementSystem@cluster;1;1225666800;1225674000;1225674000;1225666800;1225666800;7200;0;7200;0;0;7200;0;0;0;0;0;0;[Processor_2];
+4;4;-1;ManagementSystem@cluster;1;1225666800;1225674000;1225674000;1225666800;1225666800;7200;0;7200;0;0;7200;0;0;0;0;0;0;[Processor_3];
+5;5;-1;ManagementSystem@cluster;1;1225666800;1225674000;1225674000;1225666800;1225666800;7200;0;7200;0;0;7200;0;0;0;0;0;0;[Processor_4];
+6;6;-1;ManagementSystem@cluster;1;1225666800;1225677600;1225677600;1225666800;1225666800;10800;0;10800;0;0;10800;0;0;0;0;0;0;[Processor_5];
+7;7;-1;ManagementSystem@cluster;1;1225674000;1225688400;1225688400;1225666800;1225666800;21600;7200;14400;0;7200;21600;7200;0;0;0;0;0;[Processor_0];
+8;8;-1;ManagementSystem@cluster;1;1225674000;1225702800;1225702800;1225666800;1225666800;36000;7200;28800;0;7200;36000;7200;0;0;0;0;0;[Processor_1];
+9;9;-1;ManagementSystem@cluster;1;1225674000;1225681200;1225681200;1225670400;1225670400;14400;7200;7200;3600;3600;10800;3600;0;0;0;0;0;[Processor_2];
+10;10;-1;ManagementSystem@cluster;1;1225688400;1225710000;1225710000;1225688400;1225688400;43200;21600;21600;21600;0;21600;0;0;0;0;0;0;[Processor_0];
+11;11;-1;ManagementSystem@cluster;1;1225692000;1225717200;1225717200;1225692000;1225692000;50400;25200;25200;25200;0;25200;0;0;0;0;0;0;[Processor_2];
+12;12;-1;ManagementSystem@cluster;1;1225706400;1225720800;1225720800;1225706400;1225706400;54000;39600;14400;39600;0;14400;0;0;0;0;0;0;[Processor_1];
+13;13;-1;ManagementSystem@cluster;1;1225713600;1225724400;1225724400;1225713600;1225713600;57600;46800;10800;46800;0;10800;0;0;0;0;0;0;[Processor_0];
Index: DCWoRMS/trunk/example/experiment1_result/Stats_Simulation 1_Energy.txt
===================================================================
--- DCWoRMS/trunk/example/experiment1_result/Stats_Simulation 1_Energy.txt	(revision 477)
+++ DCWoRMS/trunk/example/experiment1_result/Stats_Simulation 1_Energy.txt	(revision 477)
@@ -0,0 +1,7 @@
+resourceName;timestamp;usage;
+
+
+
+
+
+
Index: DCWoRMS/trunk/example/experiment1_result/experiment.properties
===================================================================
--- DCWoRMS/trunk/example/experiment1_result/experiment.properties	(revision 477)
+++ DCWoRMS/trunk/example/experiment1_result/experiment.properties	(revision 477)
@@ -0,0 +1,24 @@
+# Use single *.swf file as workload description.
+
+# Path to xml file which describes resource characteristics.
+resdesc=example/experiment1/resources.xml
+
+
+# and swf file, which name is declared by readscenario.workloadfilename parameter.
+# Swf file must be placed in readscenario.inputfolder directory.  
+readscenario.workloadfilename=example/experiment1/workload.swf
+
+# Choose if files with task processing history should be created.  
+printhistory=true
+
+# Choose directory where all result files should be placed.
+stats.outputfolder=../experiment1_result
+
+
+creatediagrams.gantt=true
+creatediagrams.utilization=true
+creatediagrams.energyusage=true
+
+creatediagrams.tasks=true
+creatediagrams.taskswaitingtime=true
+creatediagrams.reservations=true
Index: DCWoRMS/trunk/example/experiment1_result/Stats_Simulation 1_Jobs.txt
===================================================================
--- DCWoRMS/trunk/example/experiment1_result/Stats_Simulation 1_Jobs.txt	(revision 477)
+++ DCWoRMS/trunk/example/experiment1_result/Stats_Simulation 1_Jobs.txt	(revision 477)
@@ -0,0 +1,14 @@
+jobID;meanTaskCompletionTime;meanTaskExecutionTime;meanTaskStartTime;meanTaskFlowTime;meanTaskWaitingTime;meanTaskGQ_WaitingTime;lateness;tardiness;makespan;
+1;7,200;7,200;0;7,200;0;0;0;0;7,200;
+2;7,200;7,200;0;7,200;0;0;0;0;7,200;
+3;7,200;7,200;0;7,200;0;0;0;0;7,200;
+4;7,200;7,200;0;7,200;0;0;0;0;7,200;
+5;7,200;7,200;0;7,200;0;0;0;0;7,200;
+6;10,800;10,800;0;10,800;0;0;0;0;10,800;
+7;21,600;14,400;7,200;21,600;7,200;0;0;0;21,600;
+8;36,000;28,800;7,200;36,000;7,200;0;0;0;36,000;
+9;14,400;7,200;3,600;10,800;3,600;0;0;0;14,400;
+10;43,200;21,600;0;21,600;0;0;0;0;43,200;
+11;50,400;25,200;0;25,200;0;0;0;0;50,400;
+12;54,000;14,400;0;14,400;0;0;0;0;54,000;
+13;57,600;10,800;0;10,800;0;0;0;0;57,600;
Index: DCWoRMS/trunk/example/experiment1_result/Stats_Simulation 1_ResourceUtilization.txt
===================================================================
--- DCWoRMS/trunk/example/experiment1_result/Stats_Simulation 1_ResourceUtilization.txt	(revision 477)
+++ DCWoRMS/trunk/example/experiment1_result/Stats_Simulation 1_ResourceUtilization.txt	(revision 477)
@@ -0,0 +1,35 @@
+resourceName;timestamp;usage;
+Processor_0;1225666800000;1;
+Processor_0;1225674000000;1;
+Processor_0;1225688400000;1;
+Processor_0;1225710000000;0;
+Processor_0;1225713600000;1;
+Processor_0;1225724400000;0;
+mean: 0.9375
+
+Processor_1;1225666800000;1;
+Processor_1;1225674000000;1;
+Processor_1;1225702800000;0;
+Processor_1;1225706400000;1;
+Processor_1;1225720800000;0;
+mean: 0.875
+
+Processor_2;1225666800000;1;
+Processor_2;1225674000000;1;
+Processor_2;1225681200000;0;
+Processor_2;1225692000000;1;
+Processor_2;1225717200000;0;
+mean: 0.6875
+
+Processor_3;1225666800000;1;
+Processor_3;1225674000000;0;
+mean: 0.125
+
+Processor_4;1225666800000;1;
+Processor_4;1225674000000;0;
+mean: 0.125
+
+Processor_5;1225666800000;1;
+Processor_5;1225677600000;0;
+mean: 0.1875
+
Index: DCWoRMS/trunk/example/tomekp/experiment1_result/sim_report
===================================================================
--- DCWoRMS/trunk/example/tomekp/experiment1_result/sim_report	(revision 477)
+++ DCWoRMS/trunk/example/tomekp/experiment1_result/sim_report	(revision 477)
@@ -0,0 +1,89 @@
+############################################################
+#                                                          #
+#                    SIMULATION REPORT                     #
+#                                                          #
+############################################################
+
+Version: SimJava 2.0
+
+Simulation date:         September 14, 2012
+Simulation start time:   2:32:57 PM CEST
+Simulation end time:     2:32:57 PM CEST
+
+############################################################
+#            Overall simulation run information            #
+############################################################
+
+Total simulated time:    57600.0
+Total transient time:    0.0
+Total steady state time: 57600.0
+Transient condition:     None
+Termination condition:   None
+Output analysis method:  None
+
+############################################################
+#               Simulation run measurements                #
+############################################################
+
+---------------- ManagementSystem@cluster1 -----------------
+
+- Throughput
+
+Sample mean:          0.0
+Event count:          0
+
+- Resource's utilization
+
+Sample mean:          0.0
+Sample variance:      0.0
+Sample std deviation: 0.0
+Maximum:              0.0
+Minimum:              0.0
+
+- Mean queue task count_0
+
+Sample mean:          0.8125
+Sample variance:      0.15234375
+Sample std deviation: 0.3903123748998999
+Maximum:              1.0
+Minimum:              0.0
+
+- Paused tasks list length
+
+Sample mean:          0.0
+Sample variance:      0.0
+Sample std deviation: 0.0
+Maximum:              0.0
+Minimum:              0.0
+
+----------------------- BROKER@grid ------------------------
+
+- Throughput
+
+Sample mean:          0.0
+Event count:          0
+
+- Resource's utilization
+
+Sample mean:          0.0
+Sample variance:      0.0
+Sample std deviation: 0.0
+Maximum:              0.0
+Minimum:              0.0
+
+- Mean queue task count_0
+
+Sample mean:          0.8125
+Sample variance:      0.15234375
+Sample std deviation: 0.3903123748998999
+Maximum:              1.0
+Minimum:              0.0
+
+- Paused tasks list length
+
+Sample mean:          0.0
+Sample variance:      0.0
+Sample std deviation: 0.0
+Maximum:              0.0
+Minimum:              0.0
+
Index: DCWoRMS/trunk/example/tomekp/experiment1_result/sim_trace
===================================================================
--- DCWoRMS/trunk/example/tomekp/experiment1_result/sim_trace	(revision 477)
+++ DCWoRMS/trunk/example/tomekp/experiment1_result/sim_trace	(revision 477)
@@ -0,0 +1,426 @@
+u: GridSimShutdown at 0.0: waiting for an event
+u: GridStatistics at 0.0: waiting for an event
+u: GridInformationService at 0.0: waiting for an event
+u: Input_GridInformationService at 0.0: waiting for an event
+u: Output_GridInformationService at 0.0: waiting for an event
+u: ManagementSystem@cluster1 at 0.0: waiting for an event
+u: Input_ManagementSystem@cluster1 at 0.0: waiting for an event
+u: Output_ManagementSystem@cluster1 at 0.0: waiting for an event
+u: BROKER@grid at 0.0: waiting for an event
+u: Input_BROKER@grid at 0.0: waiting for an event
+u: Output_BROKER@grid at 0.0: waiting for an event
+u: Input_Users at 0.0: waiting for an event
+u: Output_Users at 0.0: waiting for an event
+u: Users at 0.0: scheduling event type 21 for BROKER@grid with delay 0.0
+u: Users at 0.0: scheduling event type 21 for BROKER@grid with delay 7200.0
+u: Users at 0.0: scheduling event type 21 for BROKER@grid with delay 7200.0
+u: Users at 0.0: scheduling event type 21 for BROKER@grid with delay 7200.0
+u: Users at 0.0: scheduling event type 21 for BROKER@grid with delay 7200.0
+u: Users at 0.0: scheduling event type 21 for BROKER@grid with delay 7200.0
+u: Users at 0.0: scheduling event type 21 for BROKER@grid with delay 7200.0
+u: Users at 0.0: scheduling event type 21 for BROKER@grid with delay 7200.0
+u: Users at 0.0: scheduling event type 21 for BROKER@grid with delay 7200.0
+u: Users at 0.0: scheduling event type 21 for BROKER@grid with delay 21600.0
+u: Users at 0.0: scheduling event type 21 for BROKER@grid with delay 25200.0
+u: Users at 0.0: scheduling event type 21 for BROKER@grid with delay 39600.0
+u: Users at 0.0: scheduling event type 21 for BROKER@grid with delay 46800.0
+u: Users at 0.0: waiting for an event
+u: BROKER@grid at 0.0: scheduling event type 604 for ManagementSystem@cluster1 with delay 0.0
+u: BROKER@grid at 0.0: waiting for an event
+u: ManagementSystem@cluster1 at 0.0: scheduling event type 605 for BROKER@grid with delay 0.0
+u: ManagementSystem@cluster1 at 0.0: waiting for an event
+u: BROKER@grid at 0.0: scheduling event type 21 for Output_BROKER@grid with delay 0.0
+u: BROKER@grid at 0.0: waiting for an event
+u: Output_BROKER@grid at 0.0: scheduling event type 21 for Input_ManagementSystem@cluster1 with delay 0.0
+u: Output_BROKER@grid at 0.0: start processing
+u: Input_ManagementSystem@cluster1 at 0.0: start processing
+u: Output_BROKER@grid at 0.0: waiting for an event
+u: Input_ManagementSystem@cluster1 at 0.0: scheduling event type 21 for ManagementSystem@cluster1 with delay 0.0
+u: Input_ManagementSystem@cluster1 at 0.0: waiting for an event
+u: ManagementSystem@cluster1 at 0.0: scheduling event type 602 for ManagementSystem@cluster1 with delay 0.0
+u: ManagementSystem@cluster1 at 0.0: waiting for an event
+u: ManagementSystem@cluster1 at 0.0: scheduling event type 603 for ManagementSystem@cluster1 with delay 7200.0
+u: ManagementSystem@cluster1 at 0.0: scheduling event type 606 for ManagementSystem@cluster1 with delay 7200.0
+u: ManagementSystem@cluster1 at 0.0: waiting for an event
+u: ManagementSystem@cluster1 at 7200.0: no event cancelled
+u: ManagementSystem@cluster1 at 7200.0: scheduling event type 20 for Output_ManagementSystem@cluster1 with delay 0.0
+u: ManagementSystem@cluster1 at 7200.0: selected event type 606 (event time was 7200.0)
+u: ManagementSystem@cluster1 at 7200.0: waiting for an event
+u: BROKER@grid at 7200.0: scheduling event type 604 for ManagementSystem@cluster1 with delay 0.0
+u: BROKER@grid at 7200.0: waiting for an event
+u: Output_ManagementSystem@cluster1 at 7200.0: scheduling event type 20 for Input_BROKER@grid with delay 0.0
+u: Output_ManagementSystem@cluster1 at 7200.0: start processing
+u: ManagementSystem@cluster1 at 7200.0: scheduling event type 605 for BROKER@grid with delay 0.0
+u: ManagementSystem@cluster1 at 7200.0: waiting for an event
+u: Output_ManagementSystem@cluster1 at 7200.0: waiting for an event
+u: Input_BROKER@grid at 7200.0: start processing
+u: BROKER@grid at 7200.0: scheduling event type 21 for Output_BROKER@grid with delay 0.0
+u: BROKER@grid at 7200.0: selected event type 21 (event time was 7200.0)
+u: BROKER@grid at 7200.0: scheduling event type 604 for ManagementSystem@cluster1 with delay 0.0
+u: BROKER@grid at 7200.0: waiting for an event
+u: Input_BROKER@grid at 7200.0: scheduling event type 20 for BROKER@grid with delay 0.0
+u: Input_BROKER@grid at 7200.0: waiting for an event
+u: Output_BROKER@grid at 7200.0: scheduling event type 21 for Input_ManagementSystem@cluster1 with delay 0.0
+u: Output_BROKER@grid at 7200.0: start processing
+u: ManagementSystem@cluster1 at 7200.0: scheduling event type 605 for BROKER@grid with delay 0.0
+u: ManagementSystem@cluster1 at 7200.0: waiting for an event
+u: Input_ManagementSystem@cluster1 at 7200.0: start processing
+u: Output_BROKER@grid at 7200.0: waiting for an event
+u: BROKER@grid at 7200.0: scheduling event type 21 for Output_BROKER@grid with delay 0.0
+u: BROKER@grid at 7200.0: selected event type 21 (event time was 7200.0)
+u: BROKER@grid at 7200.0: scheduling event type 604 for ManagementSystem@cluster1 with delay 0.0
+u: BROKER@grid at 7200.0: waiting for an event
+u: Input_ManagementSystem@cluster1 at 7200.0: scheduling event type 21 for ManagementSystem@cluster1 with delay 0.0
+u: Output_BROKER@grid at 7200.0: scheduling event type 21 for Input_ManagementSystem@cluster1 with delay 0.0
+u: Output_BROKER@grid at 7200.0: start processing
+u: Input_ManagementSystem@cluster1 at 7200.0: waiting for an event
+u: ManagementSystem@cluster1 at 7200.0: scheduling event type 605 for BROKER@grid with delay 0.0
+u: ManagementSystem@cluster1 at 7200.0: waiting for an event
+u: Input_ManagementSystem@cluster1 at 7200.0: start processing
+u: Output_BROKER@grid at 7200.0: waiting for an event
+u: ManagementSystem@cluster1 at 7200.0: scheduling event type 602 for ManagementSystem@cluster1 with delay 0.0
+u: ManagementSystem@cluster1 at 7200.0: waiting for an event
+u: BROKER@grid at 7200.0: scheduling event type 21 for Output_BROKER@grid with delay 0.0
+u: BROKER@grid at 7200.0: selected event type 21 (event time was 7200.0)
+u: BROKER@grid at 7200.0: scheduling event type 604 for ManagementSystem@cluster1 with delay 0.0
+u: BROKER@grid at 7200.0: waiting for an event
+u: Input_ManagementSystem@cluster1 at 7200.0: scheduling event type 21 for ManagementSystem@cluster1 with delay 0.0
+u: Input_ManagementSystem@cluster1 at 7200.0: waiting for an event
+u: Output_BROKER@grid at 7200.0: scheduling event type 21 for Input_ManagementSystem@cluster1 with delay 0.0
+u: Output_BROKER@grid at 7200.0: start processing
+u: ManagementSystem@cluster1 at 7200.0: scheduling event type 603 for ManagementSystem@cluster1 with delay 7200.0
+u: ManagementSystem@cluster1 at 7200.0: scheduling event type 606 for ManagementSystem@cluster1 with delay 7200.0
+u: ManagementSystem@cluster1 at 7200.0: selected event type 604 (event time was 7200.0)
+u: ManagementSystem@cluster1 at 7200.0: scheduling event type 605 for BROKER@grid with delay 0.0
+u: ManagementSystem@cluster1 at 7200.0: waiting for an event
+u: Input_ManagementSystem@cluster1 at 7200.0: start processing
+u: Output_BROKER@grid at 7200.0: waiting for an event
+u: ManagementSystem@cluster1 at 7200.0: scheduling event type 602 for ManagementSystem@cluster1 with delay 0.0
+u: ManagementSystem@cluster1 at 7200.0: waiting for an event
+u: BROKER@grid at 7200.0: scheduling event type 21 for Output_BROKER@grid with delay 0.0
+u: BROKER@grid at 7200.0: selected event type 21 (event time was 7200.0)
+u: BROKER@grid at 7200.0: scheduling event type 604 for ManagementSystem@cluster1 with delay 0.0
+u: BROKER@grid at 7200.0: waiting for an event
+u: Input_ManagementSystem@cluster1 at 7200.0: scheduling event type 21 for ManagementSystem@cluster1 with delay 0.0
+u: Input_ManagementSystem@cluster1 at 7200.0: waiting for an event
+u: Output_BROKER@grid at 7200.0: scheduling event type 21 for Input_ManagementSystem@cluster1 with delay 0.0
+u: Output_BROKER@grid at 7200.0: start processing
+u: ManagementSystem@cluster1 at 7200.0: scheduling event type 603 for ManagementSystem@cluster1 with delay 7200.0
+u: ManagementSystem@cluster1 at 7200.0: scheduling event type 606 for ManagementSystem@cluster1 with delay 7200.0
+u: ManagementSystem@cluster1 at 7200.0: selected event type 604 (event time was 7200.0)
+u: ManagementSystem@cluster1 at 7200.0: scheduling event type 605 for BROKER@grid with delay 0.0
+u: ManagementSystem@cluster1 at 7200.0: waiting for an event
+u: Input_ManagementSystem@cluster1 at 7200.0: start processing
+u: Output_BROKER@grid at 7200.0: waiting for an event
+u: ManagementSystem@cluster1 at 7200.0: scheduling event type 602 for ManagementSystem@cluster1 with delay 0.0
+u: ManagementSystem@cluster1 at 7200.0: waiting for an event
+u: BROKER@grid at 7200.0: scheduling event type 21 for Output_BROKER@grid with delay 0.0
+u: BROKER@grid at 7200.0: selected event type 21 (event time was 7200.0)
+u: BROKER@grid at 7200.0: scheduling event type 604 for ManagementSystem@cluster1 with delay 0.0
+u: BROKER@grid at 7200.0: waiting for an event
+u: Input_ManagementSystem@cluster1 at 7200.0: scheduling event type 21 for ManagementSystem@cluster1 with delay 0.0
+u: Input_ManagementSystem@cluster1 at 7200.0: waiting for an event
+u: Output_BROKER@grid at 7200.0: scheduling event type 21 for Input_ManagementSystem@cluster1 with delay 0.0
+u: Output_BROKER@grid at 7200.0: start processing
+u: ManagementSystem@cluster1 at 7200.0: scheduling event type 603 for ManagementSystem@cluster1 with delay 7200.0
+u: ManagementSystem@cluster1 at 7200.0: scheduling event type 606 for ManagementSystem@cluster1 with delay 7200.0
+u: ManagementSystem@cluster1 at 7200.0: selected event type 604 (event time was 7200.0)
+u: ManagementSystem@cluster1 at 7200.0: scheduling event type 605 for BROKER@grid with delay 0.0
+u: ManagementSystem@cluster1 at 7200.0: waiting for an event
+u: Output_BROKER@grid at 7200.0: waiting for an event
+u: Input_ManagementSystem@cluster1 at 7200.0: start processing
+u: BROKER@grid at 7200.0: scheduling event type 21 for Output_BROKER@grid with delay 0.0
+u: ManagementSystem@cluster1 at 7200.0: scheduling event type 602 for ManagementSystem@cluster1 with delay 0.0
+u: ManagementSystem@cluster1 at 7200.0: waiting for an event
+u: BROKER@grid at 7200.0: selected event type 21 (event time was 7200.0)
+u: BROKER@grid at 7200.0: scheduling event type 604 for ManagementSystem@cluster1 with delay 0.0
+u: BROKER@grid at 7200.0: waiting for an event
+u: Input_ManagementSystem@cluster1 at 7200.0: scheduling event type 21 for ManagementSystem@cluster1 with delay 0.0
+u: Input_ManagementSystem@cluster1 at 7200.0: waiting for an event
+u: Output_BROKER@grid at 7200.0: scheduling event type 21 for Input_ManagementSystem@cluster1 with delay 0.0
+u: Output_BROKER@grid at 7200.0: start processing
+u: ManagementSystem@cluster1 at 7200.0: scheduling event type 603 for ManagementSystem@cluster1 with delay 7200.0
+u: ManagementSystem@cluster1 at 7200.0: scheduling event type 606 for ManagementSystem@cluster1 with delay 7200.0
+u: ManagementSystem@cluster1 at 7200.0: selected event type 604 (event time was 7200.0)
+u: ManagementSystem@cluster1 at 7200.0: scheduling event type 605 for BROKER@grid with delay 0.0
+u: ManagementSystem@cluster1 at 7200.0: waiting for an event
+u: Output_BROKER@grid at 7200.0: waiting for an event
+u: Input_ManagementSystem@cluster1 at 7200.0: start processing
+u: BROKER@grid at 7200.0: scheduling event type 21 for Output_BROKER@grid with delay 0.0
+u: BROKER@grid at 7200.0: selected event type 21 (event time was 7200.0)
+u: ManagementSystem@cluster1 at 7200.0: scheduling event type 602 for ManagementSystem@cluster1 with delay 0.0
+u: ManagementSystem@cluster1 at 7200.0: waiting for an event
+u: BROKER@grid at 7200.0: scheduling event type 604 for ManagementSystem@cluster1 with delay 0.0
+u: BROKER@grid at 7200.0: waiting for an event
+u: Input_ManagementSystem@cluster1 at 7200.0: scheduling event type 21 for ManagementSystem@cluster1 with delay 0.0
+u: Input_ManagementSystem@cluster1 at 7200.0: waiting for an event
+u: Output_BROKER@grid at 7200.0: scheduling event type 21 for Input_ManagementSystem@cluster1 with delay 0.0
+u: Output_BROKER@grid at 7200.0: start processing
+u: ManagementSystem@cluster1 at 7200.0: scheduling event type 603 for ManagementSystem@cluster1 with delay 10800.0
+u: ManagementSystem@cluster1 at 7200.0: scheduling event type 606 for ManagementSystem@cluster1 with delay 10800.0
+u: ManagementSystem@cluster1 at 7200.0: selected event type 604 (event time was 7200.0)
+u: ManagementSystem@cluster1 at 7200.0: scheduling event type 605 for BROKER@grid with delay 0.0
+u: ManagementSystem@cluster1 at 7200.0: waiting for an event
+u: Input_ManagementSystem@cluster1 at 7200.0: start processing
+u: Output_BROKER@grid at 7200.0: waiting for an event
+u: ManagementSystem@cluster1 at 7200.0: scheduling event type 602 for ManagementSystem@cluster1 with delay 0.0
+u: ManagementSystem@cluster1 at 7200.0: waiting for an event
+u: BROKER@grid at 7200.0: scheduling event type 21 for Output_BROKER@grid with delay 0.0
+u: BROKER@grid at 7200.0: selected event type 20 (event time was 7200.0)
+u: BROKER@grid at 7200.0: scheduling event type 20 for Users with delay 0.0
+u: BROKER@grid at 7200.0: waiting for an event
+u: Input_ManagementSystem@cluster1 at 7200.0: scheduling event type 21 for ManagementSystem@cluster1 with delay 0.0
+u: Input_ManagementSystem@cluster1 at 7200.0: waiting for an event
+u: Output_BROKER@grid at 7200.0: scheduling event type 21 for Input_ManagementSystem@cluster1 with delay 0.0
+u: Output_BROKER@grid at 7200.0: start processing
+u: Users at 7200.0: waiting for an event
+u: ManagementSystem@cluster1 at 7200.0: scheduling event type 603 for ManagementSystem@cluster1 with delay 14400.0
+u: ManagementSystem@cluster1 at 7200.0: scheduling event type 606 for ManagementSystem@cluster1 with delay 14400.0
+u: ManagementSystem@cluster1 at 7200.0: waiting for an event
+u: Output_BROKER@grid at 7200.0: waiting for an event
+u: Input_ManagementSystem@cluster1 at 7200.0: start processing
+u: ManagementSystem@cluster1 at 7200.0: scheduling event type 602 for ManagementSystem@cluster1 with delay 0.0
+u: ManagementSystem@cluster1 at 7200.0: waiting for an event
+u: Input_ManagementSystem@cluster1 at 7200.0: scheduling event type 21 for ManagementSystem@cluster1 with delay 0.0
+u: Input_ManagementSystem@cluster1 at 7200.0: waiting for an event
+u: ManagementSystem@cluster1 at 7200.0: scheduling event type 603 for ManagementSystem@cluster1 with delay 28800.0
+u: ManagementSystem@cluster1 at 7200.0: scheduling event type 606 for ManagementSystem@cluster1 with delay 28800.0
+u: ManagementSystem@cluster1 at 7200.0: waiting for an event
+u: ManagementSystem@cluster1 at 7200.0: scheduling event type 602 for ManagementSystem@cluster1 with delay 0.0
+u: ManagementSystem@cluster1 at 7200.0: waiting for an event
+u: ManagementSystem@cluster1 at 7200.0: scheduling event type 603 for ManagementSystem@cluster1 with delay 7200.0
+u: ManagementSystem@cluster1 at 7200.0: scheduling event type 606 for ManagementSystem@cluster1 with delay 7200.0
+u: ManagementSystem@cluster1 at 7200.0: waiting for an event
+u: ManagementSystem@cluster1 at 14400.0: no event cancelled
+u: ManagementSystem@cluster1 at 14400.0: scheduling event type 20 for Output_ManagementSystem@cluster1 with delay 0.0
+u: ManagementSystem@cluster1 at 14400.0: selected event type 606 (event time was 14400.0)
+u: ManagementSystem@cluster1 at 14400.0: selected event type 603 (event time was 14400.0)
+u: ManagementSystem@cluster1 at 14400.0: no event cancelled
+u: ManagementSystem@cluster1 at 14400.0: scheduling event type 20 for Output_ManagementSystem@cluster1 with delay 0.0
+u: ManagementSystem@cluster1 at 14400.0: selected event type 606 (event time was 14400.0)
+u: ManagementSystem@cluster1 at 14400.0: selected event type 603 (event time was 14400.0)
+u: ManagementSystem@cluster1 at 14400.0: no event cancelled
+u: ManagementSystem@cluster1 at 14400.0: scheduling event type 20 for Output_ManagementSystem@cluster1 with delay 0.0
+u: ManagementSystem@cluster1 at 14400.0: selected event type 606 (event time was 14400.0)
+u: ManagementSystem@cluster1 at 14400.0: selected event type 603 (event time was 14400.0)
+u: ManagementSystem@cluster1 at 14400.0: no event cancelled
+u: ManagementSystem@cluster1 at 14400.0: scheduling event type 20 for Output_ManagementSystem@cluster1 with delay 0.0
+u: ManagementSystem@cluster1 at 14400.0: selected event type 606 (event time was 14400.0)
+u: ManagementSystem@cluster1 at 14400.0: selected event type 603 (event time was 14400.0)
+u: ManagementSystem@cluster1 at 14400.0: no event cancelled
+u: ManagementSystem@cluster1 at 14400.0: scheduling event type 20 for Output_ManagementSystem@cluster1 with delay 0.0
+u: ManagementSystem@cluster1 at 14400.0: selected event type 606 (event time was 14400.0)
+u: ManagementSystem@cluster1 at 14400.0: waiting for an event
+u: Output_ManagementSystem@cluster1 at 14400.0: scheduling event type 20 for Input_BROKER@grid with delay 0.0
+u: Output_ManagementSystem@cluster1 at 14400.0: start processing
+u: Input_BROKER@grid at 14400.0: start processing
+u: Output_ManagementSystem@cluster1 at 14400.0: selected event type 20 (event time was 14400.0)
+u: Output_ManagementSystem@cluster1 at 14400.0: scheduling event type 20 for Input_BROKER@grid with delay 0.0
+u: Output_ManagementSystem@cluster1 at 14400.0: start processing
+u: Input_BROKER@grid at 14400.0: scheduling event type 20 for BROKER@grid with delay 0.0
+u: Input_BROKER@grid at 14400.0: selected event type 20 (event time was 14400.0)
+u: Input_BROKER@grid at 14400.0: start processing
+u: Output_ManagementSystem@cluster1 at 14400.0: selected event type 20 (event time was 14400.0)
+u: Output_ManagementSystem@cluster1 at 14400.0: scheduling event type 20 for Input_BROKER@grid with delay 0.0
+u: Output_ManagementSystem@cluster1 at 14400.0: start processing
+u: Input_BROKER@grid at 14400.0: scheduling event type 20 for BROKER@grid with delay 0.0
+u: Input_BROKER@grid at 14400.0: selected event type 20 (event time was 14400.0)
+u: Input_BROKER@grid at 14400.0: start processing
+u: Output_ManagementSystem@cluster1 at 14400.0: selected event type 20 (event time was 14400.0)
+u: Output_ManagementSystem@cluster1 at 14400.0: scheduling event type 20 for Input_BROKER@grid with delay 0.0
+u: Output_ManagementSystem@cluster1 at 14400.0: start processing
+u: BROKER@grid at 14400.0: scheduling event type 20 for Users with delay 0.0
+u: BROKER@grid at 14400.0: waiting for an event
+u: Input_BROKER@grid at 14400.0: scheduling event type 20 for BROKER@grid with delay 0.0
+u: Input_BROKER@grid at 14400.0: selected event type 20 (event time was 14400.0)
+u: Input_BROKER@grid at 14400.0: start processing
+u: Output_ManagementSystem@cluster1 at 14400.0: selected event type 20 (event time was 14400.0)
+u: Output_ManagementSystem@cluster1 at 14400.0: scheduling event type 20 for Input_BROKER@grid with delay 0.0
+u: Output_ManagementSystem@cluster1 at 14400.0: start processing
+u: BROKER@grid at 14400.0: scheduling event type 20 for Users with delay 0.0
+u: BROKER@grid at 14400.0: waiting for an event
+u: Users at 14400.0: waiting for an event
+u: Input_BROKER@grid at 14400.0: scheduling event type 20 for BROKER@grid with delay 0.0
+u: Input_BROKER@grid at 14400.0: selected event type 20 (event time was 14400.0)
+u: Input_BROKER@grid at 14400.0: start processing
+u: Output_ManagementSystem@cluster1 at 14400.0: waiting for an event
+u: Users at 14400.0: waiting for an event
+u: BROKER@grid at 14400.0: scheduling event type 20 for Users with delay 0.0
+u: BROKER@grid at 14400.0: waiting for an event
+u: Input_BROKER@grid at 14400.0: scheduling event type 20 for BROKER@grid with delay 0.0
+u: Input_BROKER@grid at 14400.0: waiting for an event
+u: Users at 14400.0: waiting for an event
+u: BROKER@grid at 14400.0: scheduling event type 20 for Users with delay 0.0
+u: BROKER@grid at 14400.0: waiting for an event
+u: Users at 14400.0: waiting for an event
+u: BROKER@grid at 14400.0: scheduling event type 20 for Users with delay 0.0
+u: BROKER@grid at 14400.0: waiting for an event
+u: Users at 14400.0: waiting for an event
+u: ManagementSystem@cluster1 at 18000.0: no event cancelled
+u: ManagementSystem@cluster1 at 18000.0: scheduling event type 20 for Output_ManagementSystem@cluster1 with delay 0.0
+u: ManagementSystem@cluster1 at 18000.0: selected event type 606 (event time was 18000.0)
+u: ManagementSystem@cluster1 at 18000.0: waiting for an event
+u: Output_ManagementSystem@cluster1 at 18000.0: scheduling event type 20 for Input_BROKER@grid with delay 0.0
+u: Output_ManagementSystem@cluster1 at 18000.0: start processing
+u: Input_BROKER@grid at 18000.0: start processing
+u: Output_ManagementSystem@cluster1 at 18000.0: waiting for an event
+u: Input_BROKER@grid at 18000.0: scheduling event type 20 for BROKER@grid with delay 0.0
+u: Input_BROKER@grid at 18000.0: waiting for an event
+u: BROKER@grid at 18000.0: scheduling event type 20 for Users with delay 0.0
+u: BROKER@grid at 18000.0: waiting for an event
+u: Users at 18000.0: waiting for an event
+u: BROKER@grid at 21600.0: scheduling event type 604 for ManagementSystem@cluster1 with delay 0.0
+u: BROKER@grid at 21600.0: waiting for an event
+u: ManagementSystem@cluster1 at 21600.0: no event cancelled
+u: ManagementSystem@cluster1 at 21600.0: scheduling event type 20 for Output_ManagementSystem@cluster1 with delay 0.0
+u: ManagementSystem@cluster1 at 21600.0: selected event type 606 (event time was 21600.0)
+u: ManagementSystem@cluster1 at 21600.0: waiting for an event
+u: Output_ManagementSystem@cluster1 at 21600.0: scheduling event type 20 for Input_BROKER@grid with delay 0.0
+u: Output_ManagementSystem@cluster1 at 21600.0: start processing
+u: ManagementSystem@cluster1 at 21600.0: scheduling event type 605 for BROKER@grid with delay 0.0
+u: ManagementSystem@cluster1 at 21600.0: waiting for an event
+u: Input_BROKER@grid at 21600.0: start processing
+u: Output_ManagementSystem@cluster1 at 21600.0: waiting for an event
+u: BROKER@grid at 21600.0: scheduling event type 21 for Output_BROKER@grid with delay 0.0
+u: BROKER@grid at 21600.0: waiting for an event
+u: Input_BROKER@grid at 21600.0: scheduling event type 20 for BROKER@grid with delay 0.0
+u: Input_BROKER@grid at 21600.0: waiting for an event
+u: Output_BROKER@grid at 21600.0: scheduling event type 21 for Input_ManagementSystem@cluster1 with delay 0.0
+u: Output_BROKER@grid at 21600.0: start processing
+u: Input_ManagementSystem@cluster1 at 21600.0: start processing
+u: Output_BROKER@grid at 21600.0: waiting for an event
+u: BROKER@grid at 21600.0: scheduling event type 20 for Users with delay 0.0
+u: BROKER@grid at 21600.0: waiting for an event
+u: Input_ManagementSystem@cluster1 at 21600.0: scheduling event type 21 for ManagementSystem@cluster1 with delay 0.0
+u: Input_ManagementSystem@cluster1 at 21600.0: waiting for an event
+u: Users at 21600.0: waiting for an event
+u: ManagementSystem@cluster1 at 21600.0: scheduling event type 602 for ManagementSystem@cluster1 with delay 0.0
+u: ManagementSystem@cluster1 at 21600.0: waiting for an event
+u: ManagementSystem@cluster1 at 21600.0: scheduling event type 603 for ManagementSystem@cluster1 with delay 21600.0
+u: ManagementSystem@cluster1 at 21600.0: scheduling event type 606 for ManagementSystem@cluster1 with delay 21600.0
+u: ManagementSystem@cluster1 at 21600.0: waiting for an event
+u: BROKER@grid at 25200.0: scheduling event type 604 for ManagementSystem@cluster1 with delay 0.0
+u: BROKER@grid at 25200.0: waiting for an event
+u: ManagementSystem@cluster1 at 25200.0: scheduling event type 605 for BROKER@grid with delay 0.0
+u: ManagementSystem@cluster1 at 25200.0: waiting for an event
+u: BROKER@grid at 25200.0: scheduling event type 21 for Output_BROKER@grid with delay 0.0
+u: BROKER@grid at 25200.0: waiting for an event
+u: Output_BROKER@grid at 25200.0: scheduling event type 21 for Input_ManagementSystem@cluster1 with delay 0.0
+u: Output_BROKER@grid at 25200.0: start processing
+u: Input_ManagementSystem@cluster1 at 25200.0: start processing
+u: Output_BROKER@grid at 25200.0: waiting for an event
+u: Input_ManagementSystem@cluster1 at 25200.0: scheduling event type 21 for ManagementSystem@cluster1 with delay 0.0
+u: Input_ManagementSystem@cluster1 at 25200.0: waiting for an event
+u: ManagementSystem@cluster1 at 25200.0: scheduling event type 602 for ManagementSystem@cluster1 with delay 0.0
+u: ManagementSystem@cluster1 at 25200.0: waiting for an event
+u: ManagementSystem@cluster1 at 25200.0: scheduling event type 603 for ManagementSystem@cluster1 with delay 25200.0
+u: ManagementSystem@cluster1 at 25200.0: scheduling event type 606 for ManagementSystem@cluster1 with delay 25200.0
+u: ManagementSystem@cluster1 at 25200.0: waiting for an event
+u: ManagementSystem@cluster1 at 36000.0: no event cancelled
+u: ManagementSystem@cluster1 at 36000.0: scheduling event type 20 for Output_ManagementSystem@cluster1 with delay 0.0
+u: ManagementSystem@cluster1 at 36000.0: selected event type 606 (event time was 36000.0)
+u: ManagementSystem@cluster1 at 36000.0: waiting for an event
+u: Output_ManagementSystem@cluster1 at 36000.0: scheduling event type 20 for Input_BROKER@grid with delay 0.0
+u: Output_ManagementSystem@cluster1 at 36000.0: start processing
+u: Output_ManagementSystem@cluster1 at 36000.0: waiting for an event
+u: Input_BROKER@grid at 36000.0: start processing
+u: Input_BROKER@grid at 36000.0: scheduling event type 20 for BROKER@grid with delay 0.0
+u: Input_BROKER@grid at 36000.0: waiting for an event
+u: BROKER@grid at 36000.0: scheduling event type 20 for Users with delay 0.0
+u: BROKER@grid at 36000.0: waiting for an event
+u: Users at 36000.0: waiting for an event
+u: BROKER@grid at 39600.0: scheduling event type 604 for ManagementSystem@cluster1 with delay 0.0
+u: BROKER@grid at 39600.0: waiting for an event
+u: ManagementSystem@cluster1 at 39600.0: scheduling event type 605 for BROKER@grid with delay 0.0
+u: ManagementSystem@cluster1 at 39600.0: waiting for an event
+u: BROKER@grid at 39600.0: scheduling event type 21 for Output_BROKER@grid with delay 0.0
+u: BROKER@grid at 39600.0: waiting for an event
+u: Output_BROKER@grid at 39600.0: scheduling event type 21 for Input_ManagementSystem@cluster1 with delay 0.0
+u: Output_BROKER@grid at 39600.0: start processing
+u: Input_ManagementSystem@cluster1 at 39600.0: start processing
+u: Output_BROKER@grid at 39600.0: waiting for an event
+u: Input_ManagementSystem@cluster1 at 39600.0: scheduling event type 21 for ManagementSystem@cluster1 with delay 0.0
+u: Input_ManagementSystem@cluster1 at 39600.0: waiting for an event
+u: ManagementSystem@cluster1 at 39600.0: scheduling event type 602 for ManagementSystem@cluster1 with delay 0.0
+u: ManagementSystem@cluster1 at 39600.0: waiting for an event
+u: ManagementSystem@cluster1 at 39600.0: scheduling event type 603 for ManagementSystem@cluster1 with delay 14400.0
+u: ManagementSystem@cluster1 at 39600.0: scheduling event type 606 for ManagementSystem@cluster1 with delay 14400.0
+u: ManagementSystem@cluster1 at 39600.0: waiting for an event
+u: ManagementSystem@cluster1 at 43200.0: no event cancelled
+u: ManagementSystem@cluster1 at 43200.0: scheduling event type 20 for Output_ManagementSystem@cluster1 with delay 0.0
+u: ManagementSystem@cluster1 at 43200.0: selected event type 606 (event time was 43200.0)
+u: ManagementSystem@cluster1 at 43200.0: waiting for an event
+u: Output_ManagementSystem@cluster1 at 43200.0: scheduling event type 20 for Input_BROKER@grid with delay 0.0
+u: Output_ManagementSystem@cluster1 at 43200.0: start processing
+u: Output_ManagementSystem@cluster1 at 43200.0: waiting for an event
+u: Input_BROKER@grid at 43200.0: start processing
+u: Input_BROKER@grid at 43200.0: scheduling event type 20 for BROKER@grid with delay 0.0
+u: Input_BROKER@grid at 43200.0: waiting for an event
+u: BROKER@grid at 43200.0: scheduling event type 20 for Users with delay 0.0
+u: BROKER@grid at 43200.0: waiting for an event
+u: Users at 43200.0: waiting for an event
+u: BROKER@grid at 46800.0: scheduling event type 604 for ManagementSystem@cluster1 with delay 0.0
+u: BROKER@grid at 46800.0: waiting for an event
+u: ManagementSystem@cluster1 at 46800.0: scheduling event type 605 for BROKER@grid with delay 0.0
+u: ManagementSystem@cluster1 at 46800.0: waiting for an event
+u: BROKER@grid at 46800.0: scheduling event type 21 for Output_BROKER@grid with delay 0.0
+u: BROKER@grid at 46800.0: waiting for an event
+u: Output_BROKER@grid at 46800.0: scheduling event type 21 for Input_ManagementSystem@cluster1 with delay 0.0
+u: Output_BROKER@grid at 46800.0: start processing
+u: Input_ManagementSystem@cluster1 at 46800.0: start processing
+u: Output_BROKER@grid at 46800.0: waiting for an event
+u: Input_ManagementSystem@cluster1 at 46800.0: scheduling event type 21 for ManagementSystem@cluster1 with delay 0.0
+u: Input_ManagementSystem@cluster1 at 46800.0: waiting for an event
+u: ManagementSystem@cluster1 at 46800.0: scheduling event type 602 for ManagementSystem@cluster1 with delay 0.0
+u: ManagementSystem@cluster1 at 46800.0: waiting for an event
+u: ManagementSystem@cluster1 at 46800.0: scheduling event type 603 for ManagementSystem@cluster1 with delay 10800.0
+u: ManagementSystem@cluster1 at 46800.0: scheduling event type 606 for ManagementSystem@cluster1 with delay 10800.0
+u: ManagementSystem@cluster1 at 46800.0: waiting for an event
+u: ManagementSystem@cluster1 at 50400.0: no event cancelled
+u: ManagementSystem@cluster1 at 50400.0: scheduling event type 20 for Output_ManagementSystem@cluster1 with delay 0.0
+u: ManagementSystem@cluster1 at 50400.0: selected event type 606 (event time was 50400.0)
+u: ManagementSystem@cluster1 at 50400.0: waiting for an event
+u: Output_ManagementSystem@cluster1 at 50400.0: scheduling event type 20 for Input_BROKER@grid with delay 0.0
+u: Output_ManagementSystem@cluster1 at 50400.0: start processing
+u: Output_ManagementSystem@cluster1 at 50400.0: waiting for an event
+u: Input_BROKER@grid at 50400.0: start processing
+u: Input_BROKER@grid at 50400.0: scheduling event type 20 for BROKER@grid with delay 0.0
+u: Input_BROKER@grid at 50400.0: waiting for an event
+u: BROKER@grid at 50400.0: scheduling event type 20 for Users with delay 0.0
+u: BROKER@grid at 50400.0: waiting for an event
+u: Users at 50400.0: waiting for an event
+u: ManagementSystem@cluster1 at 54000.0: no event cancelled
+u: ManagementSystem@cluster1 at 54000.0: scheduling event type 20 for Output_ManagementSystem@cluster1 with delay 0.0
+u: ManagementSystem@cluster1 at 54000.0: selected event type 606 (event time was 54000.0)
+u: ManagementSystem@cluster1 at 54000.0: waiting for an event
+u: Output_ManagementSystem@cluster1 at 54000.0: scheduling event type 20 for Input_BROKER@grid with delay 0.0
+u: Output_ManagementSystem@cluster1 at 54000.0: start processing
+u: Output_ManagementSystem@cluster1 at 54000.0: waiting for an event
+u: Input_BROKER@grid at 54000.0: start processing
+u: Input_BROKER@grid at 54000.0: scheduling event type 20 for BROKER@grid with delay 0.0
+u: Input_BROKER@grid at 54000.0: waiting for an event
+u: BROKER@grid at 54000.0: scheduling event type 20 for Users with delay 0.0
+u: BROKER@grid at 54000.0: waiting for an event
+u: Users at 54000.0: waiting for an event
+u: ManagementSystem@cluster1 at 57600.0: no event cancelled
+u: ManagementSystem@cluster1 at 57600.0: scheduling event type 20 for Output_ManagementSystem@cluster1 with delay 0.0
+u: ManagementSystem@cluster1 at 57600.0: selected event type 606 (event time was 57600.0)
+u: ManagementSystem@cluster1 at 57600.0: waiting for an event
+u: Output_ManagementSystem@cluster1 at 57600.0: scheduling event type 20 for Input_BROKER@grid with delay 0.0
+u: Output_ManagementSystem@cluster1 at 57600.0: start processing
+u: Output_ManagementSystem@cluster1 at 57600.0: waiting for an event
+u: Input_BROKER@grid at 57600.0: start processing
+u: Input_BROKER@grid at 57600.0: scheduling event type 20 for BROKER@grid with delay 0.0
+u: Input_BROKER@grid at 57600.0: waiting for an event
+u: BROKER@grid at 57600.0: scheduling event type 20 for Users with delay 0.0
+u: BROKER@grid at 57600.0: waiting for an event
+u: Users at 57600.0: scheduling event type -1 for GridStatistics with delay 0.0
+u: Users at 57600.0: scheduling event type -1 for Input_Users with delay 0.0
+u: Users at 57600.0: scheduling event type -1 for Output_Users with delay 0.0
+u: Users at 57600.0: scheduling event type -1 for GridSimShutdown with delay 0.0
+u: GridSimShutdown at 57600.0: scheduling event type -1 for GridInformationService with delay 0.0
+u: GridSimShutdown at 57600.0: scheduling event type -1 for GridStatistics with delay 0.0
+u: GridInformationService at 57600.0: scheduling event type -1 for ManagementSystem@cluster1 with delay 0.0
+u: GridInformationService at 57600.0: scheduling event type -1 for BROKER@grid with delay 0.0
+u: GridInformationService at 57600.0: scheduling event type -1 for Input_GridInformationService with delay 0.0
+u: GridInformationService at 57600.0: scheduling event type -1 for Output_GridInformationService with delay 0.0
Index: DCWoRMS/trunk/example/tomekp/experiment1_result/experiment.properties
===================================================================
--- DCWoRMS/trunk/example/tomekp/experiment1_result/experiment.properties	(revision 477)
+++ DCWoRMS/trunk/example/tomekp/experiment1_result/experiment.properties	(revision 477)
@@ -0,0 +1,32 @@
+# Use single *.swf file as workload description.
+# Computing environment consists of two computing resources.
+# Plugin implementation and resources does not support reservation scheduling model.
+
+# Grid plugin implements simple round robin algorithm
+gridschedulingpluginname=example.gridplugin.GridFCFSRoundRobinPlugin
+
+# Local plugin starts task execution in FCFS order
+localallocpolicypluginname=example.localplugin.FCFSRandomClusterLocalPlugin
+
+# Linear model of cpu processing power is used for task execution time estimations. 
+exectimeestimationpluginname=example.timeestimation.ExecTimeEstimationPlugin
+
+# Path to xml file which describes resource characteristics.
+resdesc=example/workload/HostParameters.xml
+
+
+#readscenario.inputfolder=example/tomekp/experiment1/
+# and swf file, which name is declared by readscenario.workloadfilename parameter.
+# Swf file must be placed in readscenario.inputfolder directory.  
+readscenario.workloadfilename=example/tomekp/experiment1/workload.swf
+
+# Choose if files with task processing history should be created.  
+printhistory=true
+
+# Choose directory where all result files should be placed.
+stats.outputfolder=../experiment1_result
+
+envdesc=example/tomekp/experiment1/ResourceDescription.properties
+
+creatediagrams.processors=true
+creatediagrams.taskswaitingtime=false
Index: DCWoRMS/trunk/example/tomekp/experiment1/RunExperiment.java
===================================================================
--- DCWoRMS/trunk/example/tomekp/experiment1/RunExperiment.java	(revision 477)
+++ DCWoRMS/trunk/example/tomekp/experiment1/RunExperiment.java	(revision 477)
@@ -0,0 +1,19 @@
+package tomekp.experiment1;
+import simulator.DataCenterWorkloadSimulator;
+
+
+public class RunExperiment {
+	
+	public static void main(String args[]){
+		RunExperiment runner = new RunExperiment();
+		runner.run();
+	}
+	
+	public void run(){
+		String args[] = {
+				"example/tomekp/experiment1/experiment1.properties"
+				};
+		DataCenterWorkloadSimulator.main(args);
+	}
+
+}
Index: DCWoRMS/trunk/example/tomekp/experiment1/ResourceDescription.properties
===================================================================
--- DCWoRMS/trunk/example/tomekp/experiment1/ResourceDescription.properties	(revision 477)
+++ DCWoRMS/trunk/example/tomekp/experiment1/ResourceDescription.properties	(revision 477)
@@ -0,0 +1,26 @@
+
+firstLayer=COMPUTING_GRID
+
+secondLayer=DATA_CENTER
+
+thirdLayer=COMPUTING_NODE
+
+fourthLayer=CPU
+
+
+
+grids=1
+
+dataCenters=1
+
+nodes=6
+
+cpus=1
+
+
+
+modelA=2
+
+modelB=2
+
+modelC=2
Index: DCWoRMS/trunk/example/tomekp/experiment1/SDSC-SP2-0-1000.swf
===================================================================
--- DCWoRMS/trunk/example/tomekp/experiment1/SDSC-SP2-0-1000.swf	(revision 477)
+++ DCWoRMS/trunk/example/tomekp/experiment1/SDSC-SP2-0-1000.swf	(revision 477)
@@ -0,0 +1,988 @@
+       1        0 864895     -1   -1     -1    -1   64  43200    -1  5   3  74 12894  4 -1 -1 -1
+    2   316932 377351     -1   -1     -1    -1   32  64800    -1  5 119  76 17838  4 -1 -1 -1
+    3   318935 375363     -1   -1     -1    -1   32  64800    -1  5 119  76 17841  4 -1 -1 -1
+    4   399264  22885 172830    5 171477    -1    5 172800    -1  5 199  86 17974  3 -1 -1 -1
+    5   427130    794 172829    5 171417    -1    5 172800    -1  5 199  86 18008  3 -1 -1 -1
+    6   494829   1003 172832    5 171439    -1    5 172800    -1  5 199  86 18084  3 -1 -1 -1
+    7   495154  15075 172831    5 170993    -1    5 172800    -1  5 199  86 18087  3 -1 -1 -1
+    8   506793  63437  35968   11   3240    -1   11  36000    -1  5 160  75 18107  3 -1 -1 -1
+    9   522378 252236  11872   63   2352    -1   63  43200    -1  1 131  20 18123  4 -1 -1 -1
+   10   559483      2  59965    4  57145    -1    4  64500    -1  1 162  75 18135  4 -1 -1 -1
+   11   566129      5  28826    1  27758    -1    1  28800    -1  5 153  75 18180  3 -1 -1 -1
+   12   566290    532  26171    1  24666    -1    1  28800    -1  1 153  75 18184  3 -1 -1 -1
+   13   567314  15757   8071    8   7334    -1    8  64800    -1  1 150   6 13592  4 -1 -1 -1
+   14   571164  21568  64832   32  44134    -1   32  64800    -1  5   6   6 13602  3 -1 -1 -1
+   15   574294   4647  64384    7  58033    -1    7  64800    -1  1 151  75 13607  3 -1 -1 -1
+   16   576100      6  19000    1  18830    -1    1  43200    -1  1 152  75 13610  3 -1 -1 -1
+   17   577685   3793 118561    5 117278    -1    5 172800    -1  1 199  86 18261  3 -1 -1 -1
+   18   578846      8  24861    1  23875    -1    1  28800    -1  1 153  75 13613  3 -1 -1 -1
+   19   580157  20861     -1   -1     -1    -1   38   6900    -1  5 189  75 18288  5 -1 -1 -1
+   20   581034   2038  10979    1  10894    -1    1  18000    -1  1 154  75 13634  4 -1 -1 -1
+   21   581434   2139  16674   11  16258    -1   11  36000    -1  1 160  75 18301  3 -1 -1 -1
+   22   582841   1199   8385   32   1536    -1   32  14400    -1  1 150   6 13641  2 -1 -1 -1
+   23   583532  21288  16793   11  16264    -1   11  36000    -1  1 160  75 18305  3 -1 -1 -1
+   24   584165  16591   3634   24   3504    -1   24   3600    -1  5 133  50 13646  3 -1 -1 -1
+   25   584785   4129   1229    2   1089    -1    2   1200    -1  5  34   7 13651  3 -1 -1 -1
+   26   584801  10510   2207   16   1195    -1   16   3600    -1  1   7   7 234  3 -1 -1 -1
+   27   584826   6324     40    8   7.38    -1    8   1200    -1  1  34   7 13662  3 -1 -1 -1
+   28   584832   6361    311    8 259.00    -1    8   2400    -1  1  34   7 13665  3 -1 -1 -1
+   29   584838   6677   1228    8   1157    -1    8   1200    -1  5  34   7 13668  3 -1 -1 -1
+   30   584875  10119     47   16   6.00    -1   16   1200    -1  1  34   7 13671  3 -1 -1 -1
+   31   584919  10126    213   16 156.94    -1   16   1200    -1  1  34   7 13674  3 -1 -1 -1
+   32   584928  10338     40   16   1.25    -1   16   1200    -1  1  34   7 13677  3 -1 -1 -1
+   33   585786   3129  51164    1  50753    -1    1  64800    -1  1 155  75 13680  3 -1 -1 -1
+   34   586496   2458   1970    2   1902    -1    2   7200    -1  1 161  75 18312  3 -1 -1 -1
+   35   588559    686  58046    4  57552    -1    4  64800    -1  1 156  75 13688  3 -1 -1 -1
+   36   588873  16880  14805   11  14385    -1   11  36000    -1  1 160  75 18316  3 -1 -1 -1
+   37   589428     10     28    2     -1    -1    2  36000    -1  5 157   1 13691  2 -1 -1 -1
+   38   589449     22    275    1  15.00    -1    1   2400    -1  1 158  73 13694  3 -1 -1 -1
+   39   589503    396   3708    2     -1    -1    2  36000    -1  5 157   1 13697  2 -1 -1 -1
+   40   589535     11   3625    1     -1    -1    1  36000    -1  1 157   1 13700  2 -1 -1 -1
+   41   590405  13993     54   32   4.84    -1   32   1200    -1  1  34   7 13703  3 -1 -1 -1
+   42   590414  14049     45   32   1.38    -1   32   1200    -1  1  34   7 13706  3 -1 -1 -1
+   43   590419  14099    292   32 215.47    -1   32   1200    -1  1  34   7 13709  3 -1 -1 -1
+   44   590427  85075     42   64   0.25    -1   64   1200    -1  5  34   7 13712  3 -1 -1 -1
+   45   590434  85120    155   64  57.12    -1   64   1200    -1  1  34   7 13715  3 -1 -1 -1
+   46   590439  85278     66   64   1.42    -1   64   1200    -1  1  34   7 13718  3 -1 -1 -1
+   47   590470      5     64    1     -1    -1    1  36000    -1  5 157   1 18320  2 -1 -1 -1
+   48   590531      9     34    1     -1    -1    1  36000    -1  1 157   1 18324  2 -1 -1 -1
+   49   590978     10    252    2 214.00    -1    2    900    -1  1 159  75 13721  1 -1 -1 -1
+   50   591090     87     -1   -1     -1    -1    8  36000    -1  5 173  75 14298  4 -1 -1 -1
+   51   591120      7  11298    2 686.00    -1    2  50400    -1  1 173  75 14298  4 -1 -1 -1
+   52   591442      8  16440    1  15992    -1    1  28800    -1  1 153  75 18333  3 -1 -1 -1
+   53   591612    820    293    2 257.50    -1    2    900    -1  1 159  75 13724  1 -1 -1 -1
+   54   593508      3    257    2 217.50    -1    2    900    -1  1 159  75 13727  1 -1 -1 -1
+   55   595008      4    216    2 177.00    -1    2    900    -1  1 159  75 13730  1 -1 -1 -1
+   56   595228      9     32    2   2.50    -1    2    300    -1  1 159  75 13733  1 -1 -1 -1
+   57   595239     10  24866    1  23861    -1    1  28800    -1  1 153  75 13736  4 -1 -1 -1
+   58   595276      2     34    4   3.25    -1    4    300    -1  1 159  75 13739  1 -1 -1 -1
+   59   595584      5  26228    1  24818    -1    1  28800    -1  1 153  75 13742  3 -1 -1 -1
+   60   595641      1    213    2 178.50    -1    2    900    -1  1 159  75 13745  1 -1 -1 -1
+   61   596042      5    214    2 179.50    -1    2    900    -1  1 159  75 13748  1 -1 -1 -1
+   62   596561      8    212    2 179.00    -1    2    900    -1  1 159  75 13751  1 -1 -1 -1
+   63   597048     11    276    1  14.00    -1    1   2400    -1  1 158  73 13754  3 -1 -1 -1
+   64   597139    389    144    4 109.75    -1    4    900    -1  1 159  75 13757  1 -1 -1 -1
+   65   597147    382    106    8  71.50    -1    8   7200    -1  1 159  75 13760  1 -1 -1 -1
+   66   597497      9    314    1 274.00    -1    1    900    -1  1 159  75 13763  1 -1 -1 -1
+   67   597928   6889    925   16 876.81    -1   16   3600    -1  1 159  75 13766  3 -1 -1 -1
+   68   597955  23662    689   32 631.00    -1   32   1800    -1  1 159  75 13769  3 -1 -1 -1
+   69   598080      3    203    8 167.25    -1    8   3600    -1  1 159  75 13772  1 -1 -1 -1
+   70   598354      6    274    4 235.50    -1    4    900    -1  1 159  75 13775  1 -1 -1 -1
+   71   598608      8    412    2 366.50    -1    2    900    -1  1 159  75 13778  1 -1 -1 -1
+   72   598823      7    691    1 600.00    -1    1    900    -1  1 159  75 13781  1 -1 -1 -1
+   73   599263      4   1716    8   1545    -1    8   6000    -1  1 159  75 13784  1 -1 -1 -1
+   74   600209   4609  16792   11  16215    -1   11  36000    -1  1 160  75 13787  3 -1 -1 -1
+   75   601024     93     -1   -1     -1    -1   38   6900    -1  5 189  75 18336  5 -1 -1 -1
+   76   601123  57528     -1   -1     -1    -1   38  64500    -1  5 189  75 18340  5 -1 -1 -1
+   77   606843  68951  24257   63  23997    -1   63  43200    -1  1  24  22 13790  3 -1 -1 -1
+   78   608347 107242  57648   63   2930    -1   63  57600    -1  5  24  22 13793  3 -1 -1 -1
+   79   613890     12     -1   -1     -1    -1   64  54000    -1  5   3  74 13796  2 -1 -1 -1
+   80   613917  86619     95   64  19.22    -1   64   3600    -1  1   3  74 13799  3 -1 -1 -1
+   81   614987      2    336   16  18.25    -1   16   1800    -1  1 147  73 13802  3 -1 -1 -1
+   82   615362     10    277    1  14.00    -1    1   1800    -1  1 147  73 13805  3 -1 -1 -1
+   83   617472     11    257   16 107.88    -1   16   1800    -1  1 147  73 13808  3 -1 -1 -1
+   84   617477   4833    343   32 146.66    -1   32   1800    -1  1 147  73 13811  3 -1 -1 -1
+   85   617482  83162    387   64 166.80    -1   64   2700    -1  1 147  73 13814  3 -1 -1 -1
+   87   617729     21    182   16  42.12    -1   16   1800    -1  1 147  73 13820  3 -1 -1 -1
+   88   617737   4924    216   32  55.06    -1   32   1800    -1  1 147  73 13823  3 -1 -1 -1
+   89   617741  26970     -1   -1     -1    -1   64   2700    -1  5 147  73 13826  3 -1 -1 -1
+   90   617748  83296    263   64  62.39    -1   64   2700    -1  1 147  73 13829  3 -1 -1 -1
+   92   617914     28    165   16  24.25    -1   16   1800    -1  1 147  73 13835  3 -1 -1 -1
+   93   617917   4969    180   32  24.75    -1   32   1800    -1  1 147  73 13837  3 -1 -1 -1
+   94   617923  83393    199   64  24.52    -1   64   2700    -1  1 147  73 13840  3 -1 -1 -1
+   96   618202      7    353   16  28.25    -1   16   1800    -1  1 147  73 13846  3 -1 -1 -1
+   97   618628      8    174   16  19.56    -1   16   1800    -1  1 147  73 13849  3 -1 -1 -1
+   98   618949      7    161   16  19.38    -1   16   1800    -1  1 147  73 13852  3 -1 -1 -1
+   99   619684     93  19199    4  18219    -1    4  64500    -1  1 162  75 18344  4 -1 -1 -1
+  100   619766     10     37    8   3.38    -1    8  64800    -1  5 162  75 18347  2 -1 -1 -1
+  101   619804      6     24    1     -1    -1    1   1800    -1  1 147  73 13855  3 -1 -1 -1
+  102   620527  18793  35969   11   3.55    -1   11  36000    -1  5 160  75 13858  3 -1 -1 -1
+  103   621578  17802  35968   11   3213    -1   11  36000    -1  5 160  75 18350  3 -1 -1 -1
+  104   621582  17739  35969   11   3.73    -1   11  36000    -1  5 160  75 13861  3 -1 -1 -1
+  105   638224  37333   8027    8   7338    -1    8  64800    -1  1 150   6 13592  4 -1 -1 -1
+  106   639157    845  18855    4  17851    -1    4  64500    -1  1 162  75 18353  4 -1 -1 -1
+  107   639295     14     -1   -1     -1    -1    4  64500    -1  5 162  75 18355  4 -1 -1 -1
+  108   639316      3     58   13   5.08    -1   13  64800    -1  5 162  75 18358  2 -1 -1 -1
+  109   639459      7     60   16   9.38    -1   16  64800    -1  5 162  75 18361  2 -1 -1 -1
+  110   639523      7     62   19   6.00    -1   19  64800    -1  5 162  75 18364  2 -1 -1 -1
+  111   639759      7     61    3  21.33    -1    3  64800    -1  5 162  75 18366  2 -1 -1 -1
+  112   639907    130     -1   -1     -1    -1  110    600    -1  5 162  75 18369  2 -1 -1 -1
+  113   639994      6     41    8   6.38    -1    8  64800    -1  5 162  75 18373  1 -1 -1 -1
+  114   639995      6     45    8   8.12    -1    8  64800    -1  5 162  75 18377  1 -1 -1 -1
+  115   644835      4    179   16  20.12    -1   16   1800    -1  1 147  73 18381  3 -1 -1 -1
+  116   645249      4    155   16  18.94    -1   16   1800    -1  1 147  73 18385  3 -1 -1 -1
+  117   645444      1    313   16  15.69    -1   16   1800    -1  1 147  73 18388  3 -1 -1 -1
+  118   645540      2  35621    1  34803    -1    1  57600    -1  1 153  75 13866  4 -1 -1 -1
+  119   645808      3  48803    1  46863    -1    1  57600    -1  1 153  75 13869  3 -1 -1 -1
+  120   645978      3  23055    1  21935    -1    1  57600    -1  1 153  75 13872  4 -1 -1 -1
+  121   646088     11    332   16  15.88    -1   16   1800    -1  1 147  73 18392  3 -1 -1 -1
+  122   646393      5  54148    1  51173    -1    1  57600    -1  1 153  75 13875  4 -1 -1 -1
+  123   646521      5    110   16   0.25    -1   16   1800    -1  5 147  73 18396  3 -1 -1 -1
+  124   647272      9    359   16  17.56    -1   16   1800    -1  1 147  73 18400  3 -1 -1 -1
+  125   647739     11    303   27  16.37    -1   27   1800    -1  1 147  73 18404  3 -1 -1 -1
+  126   648093      9    370   27  19.19    -1   27   1800    -1  1 147  73 18407  3 -1 -1 -1
+  127   648486     10    344   27  18.56    -1   27   1800    -1  1 147  73 18411  3 -1 -1 -1
+  128   649148      7    336   27  18.07    -1   27   1800    -1  1 147  73 18415  3 -1 -1 -1
+  129   649620      4    328   27  16.52    -1   27   1800    -1  1 147  73 18419  3 -1 -1 -1
+  130   650241      4    332   27  18.04    -1   27   1800    -1  1 147  73 18423  3 -1 -1 -1
+  131   650849      2    373   16  19.75    -1   16   1800    -1  1 147  73 18426  3 -1 -1 -1
+  132   651272      8    337   27  17.33    -1   27   1800    -1  1 147  73 13878  3 -1 -1 -1
+  133   651683      3    326   27  18.33    -1   27   1800    -1  1 147  73 13881  3 -1 -1 -1
+  134   652035      4    331   16  17.06    -1   16   1800    -1  1 147  73 13884  3 -1 -1 -1
+  135   652231   9006  14769   11  14279    -1   11  36000    -1  1 160  75 13887  3 -1 -1 -1
+  136   652517      2    315   16  16.00    -1   16   1800    -1  1 147  73 13890  3 -1 -1 -1
+  137   653274     11    302   27  17.19    -1   27   1800    -1  1 147  73 13893  3 -1 -1 -1
+  138   653562   5079  14390    1  14200    -1    1  18000    -1  1 154  75 13896  4 -1 -1 -1
+  139   653617     10    307   16  16.94    -1   16   1800    -1  1 147  73 18429  3 -1 -1 -1
+  140   658633      6   2548   38   2366    -1   38  64500    -1  1 189  75 18433  2 -1 -1 -1
+  141   658981  88138    287   32 180.19    -1   32  64800    -1  1 163  75 18437  3 -1 -1 -1
+  142   661229      5   3806   50   3551    -1   50  64500    -1  5 189  75 18441  2 -1 -1 -1
+  143   662796   2247  64827    4  64133    -1    4  64800    -1  5 156  75 13899  3 -1 -1 -1
+  145   664898     10  58075    1  57610    -1    1  64800    -1  1 155  75 13902  3 -1 -1 -1
+  146   665386      8    302   16  16.56    -1   16   1800    -1  1 147  73 13905  3 -1 -1 -1
+  147   667115      2    309   16  16.88    -1   16   1800    -1  1 147  73 13908  3 -1 -1 -1
+  148   667886      8    277    1  15.00    -1    1   2400    -1  1 158  73 13911  3 -1 -1 -1
+  149   668596     10    715    1  17.00    -1    1   2400    -1  1 158  73 13914  3 -1 -1 -1
+  150   668645      4    416   16  19.31    -1   16   1800    -1  1 147  73 13917  3 -1 -1 -1
+  151   669401      6    336   16  17.94    -1   16   1800    -1  1 147  73 13920  3 -1 -1 -1
+  152   669446      4    182   16  19.56    -1   16   1800    -1  1 147  73 13923  3 -1 -1 -1
+  153   669599     45    842   32  42.09    -1   32   2400    -1  1 158  73 13926  3 -1 -1 -1
+  154   670019     10    167   16  19.19    -1   16   1800    -1  1 147  73 13929  3 -1 -1 -1
+  155   670042    158    301   16  16.56    -1   16   1800    -1  1 147  73 13932  3 -1 -1 -1
+  156   670636      7    330   32  17.69    -1   32   2400    -1  1 158  73 13935  3 -1 -1 -1
+  157   671461     11    855   32  47.69    -1   32   2400    -1  1 158  73 13938  3 -1 -1 -1
+  158   672327      9    319   16  25.44    -1   16   1800    -1  1 147  73 13941  3 -1 -1 -1
+  159   672431     12    340   32  16.81    -1   32   2400    -1  1 158  73 13944  3 -1 -1 -1
+  160   672948      8    797   32  40.88    -1   32   2400    -1  1 158  73 13947  3 -1 -1 -1
+  161   673296      3    379   16  27.75    -1   16   1800    -1  1 147  73 13950  3 -1 -1 -1
+  162   673798     96     -1   -1     -1    -1   16   1800    -1  5 147  73 13953  3 -1 -1 -1
+  163   673864  26203    331   32  17.56    -1   32   2400    -1  1 158  73 13956  3 -1 -1 -1
+  164   673907   1598     38   16     -1    -1   16   1800    -1  5 147  73 13959  3 -1 -1 -1
+  165   674530   1772     -1   -1     -1    -1   48   1800    -1  5 133  50 18452  3 -1 -1 -1
+  166   674689   1613     -1   -1     -1    -1   24   4800    -1  5 133  50 18456  3 -1 -1 -1
+  167   674883      1    396    2 295.50    -1    2   1800    -1  1 161  75 13962  3 -1 -1 -1
+  168   675761     11     37    2   1.00    -1    2    600    -1  1   3  74 18460  4 -1 -1 -1
+  169   675846      3     38    4   2.75    -1    4    600    -1  1   3  74 18464  4 -1 -1 -1
+  170   675975      2  14696   11  14258    -1   11  36000    -1  1 160  75 18468  3 -1 -1 -1
+  172   676178      3     47    4  10.25    -1    4    600    -1  1   3  74 18475  4 -1 -1 -1
+  173   676289     10   3911   15   3749    -1   15   9000    -1  1 133  50 18479  3 -1 -1 -1
+  174   676578   6493     48    4  10.00    -1    4    600    -1  1   3  74 18483  4 -1 -1 -1
+  175   678396   1824  11121   15  10917    -1   15  18000    -1  1 133  50 18487  3 -1 -1 -1
+  176   680929  10423  18334   15  18058    -1   15  21600    -1  1 133  50 18490  3 -1 -1 -1
+  177   688262      2  14154    2  13834    -1    2  28500    -1  1 162  75 13965  4 -1 -1 -1
+  178   688508     11  15439    1  15320    -1    1  18000    -1  1 154  75 13968  4 -1 -1 -1
+  179   688521     10  60794    4  57950    -1    4  64500    -1  1 162  75 13971  4 -1 -1 -1
+  180   690642     41   9665   11   9426    -1   11  36000    -1  1 160  75 13974  3 -1 -1 -1
+  181   694333   5731    465   32 402.84    -1   32  64800    -1  1 119  76 13977  2 -1 -1 -1
+  182   694413  50715   1987   32   1916    -1   32  64800    -1  1 119  76 13980  3 -1 -1 -1
+  183   700318      4  10210   11   9976    -1   11  36000    -1  1 160  75 18494  3 -1 -1 -1
+  184   700639  46776    911   32 851.75    -1   32  64800    -1  1 119  76 18498  3 -1 -1 -1
+  185   702943     10    129    2  97.00    -1    2   1800    -1  5 161  75 18501  3 -1 -1 -1
+  186   703160      6     59    2  21.00    -1    2   1800    -1  1 161  75 18501  3 -1 -1 -1
+  187   703445      8    223   64 147.69    -1   64   3600    -1  1   3  74 13983  4 -1 -1 -1
+  188   704670      2    341    1  17.00    -1    1   3600    -1  1 158  73 13986  3 -1 -1 -1
+  189   705671      9    266    1  14.00    -1    1   3600    -1  1 158  73 13989  3 -1 -1 -1
+  190   710503      3   1661   11   1524    -1   11  36000    -1  1 160  75 13991  3 -1 -1 -1
+  191   712143     13   1662   11   1530    -1   11  36000    -1  1 160  75 18506  3 -1 -1 -1
+  192   713788      2   1668   11   1533    -1   11  36000    -1  1 160  75 13993  3 -1 -1 -1
+  193   715427      2   1740   11   1587    -1   11  36000    -1  1 160  75 13996  3 -1 -1 -1
+  194   724251      8    160   16  19.44    -1   16   1800    -1  1 147  73 13998  3 -1 -1 -1
+  195   724630     10    173   32  19.38    -1   32   1800    -1  1 147  73 14000  3 -1 -1 -1
+  196   724939     10    323   16  16.50    -1   16   1800    -1  1 147  73 14003  3 -1 -1 -1
+  197   725561      3    359   16  30.81    -1   16   1800    -1  1 147  73 14006  3 -1 -1 -1
+  198   726021      9    335   16  28.56    -1   16   1800    -1  1 147  73 14008  3 -1 -1 -1
+  199   726531      8    380   32  18.97    -1   32   1800    -1  1 147  73 14011  3 -1 -1 -1
+  200   727021      7    176   16  20.75    -1   16   1800    -1  1 147  73 14014  3 -1 -1 -1
+  201   727528      8    687    8 596.00    -1    8  64800    -1  5 150   6 13592  4 -1 -1 -1
+  202   728987      2    651    8 563.25    -1    8  64800    -1  5 150   6 13592  4 -1 -1 -1
+  203   729694      3     59    8  21.75    -1    8  64800    -1  5 150   6 13592  4 -1 -1 -1
+  204   729746     16    163    8 104.50    -1    8  64800    -1  5 150   6 13592  4 -1 -1 -1
+  205   730567      9    497    8 359.88    -1    8  64800    -1  5 150   6 13592  4 -1 -1 -1
+  206   731943     12   9503    8   7655    -1    8  64800    -1  1 150   6 13592  4 -1 -1 -1
+  207   735775      2  11576    1  11259    -1    1  57600    -1  1 153  75 14029  4 -1 -1 -1
+  209   736042     11  12358    1  11771    -1    1  57600    -1  1 153  75 14035  4 -1 -1 -1
+  210   736252      3  11294    1  10709    -1    1  57600    -1  1 153  75 14038  4 -1 -1 -1
+  211   736570      2  57621    1  57214    -1    1  57600    -1  5 153  75 14041  4 -1 -1 -1
+  212   737565      2  16057    1  15941    -1    1  18000    -1  1 154  75 14044  4 -1 -1 -1
+  213   742701      7     46    4  11.75    -1    4    600    -1  1   3  74 14047  4 -1 -1 -1
+  214   743081      9     50    4  18.25    -1    4    600    -1  1   3  74 14049  4 -1 -1 -1
+  215   743261     10     49    4  17.75    -1    4    600    -1  1   3  74 14052  4 -1 -1 -1
+  216   743392      6     49    4  17.25    -1    4    600    -1  1   3  74 14055  4 -1 -1 -1
+  217   743486      8     50    4  18.25    -1    4    600    -1  1   3  74 14058  4 -1 -1 -1
+  218   743663      1     56    4  15.25    -1    4    600    -1  1   3  74 14061  4 -1 -1 -1
+  219   743706  30232    667   64 592.22    -1   64   3600    -1  1   3  74 14064  4 -1 -1 -1
+  220   743790      2     57    4  15.25    -1    4    600    -1  1   3  74 14066  4 -1 -1 -1
+  221   744023      3     97    4  51.50    -1    4    600    -1  1   3  74 14068  4 -1 -1 -1
+  222   744252      7    100    4  51.25    -1    4    600    -1  1   3  74 14070  4 -1 -1 -1
+  223   744749      8     31    2   1.00    -1    2   1800    -1  1 161  75 13962  3 -1 -1 -1
+  224   745118  28131    673   64 597.78    -1   64   1800    -1  1   3  74 14073  2 -1 -1 -1
+  225   749690      8   9532    8   7652    -1    8  64800    -1  1 150   6 13592  4 -1 -1 -1
+  226   750402      5  58084    4  57466    -1    4  64800    -1  1 156  75 14076  3 -1 -1 -1
+  227   750719      5    423    2 326.50    -1    2   1800    -1  1 161  75 14093  3 -1 -1 -1
+  228   767070      5    289   32 180.59    -1   32  64800    -1  1 163  75 14078  3 -1 -1 -1
+  229   767401      3    798   32 542.75    -1   32  64800    -1  1 163  75 14081  3 -1 -1 -1
+  230   768967      3    427   32 291.47    -1   32  64800    -1  1 163  75 18510  3 -1 -1 -1
+  231   769671      8    788   32 528.00    -1   32  64800    -1  1 163  75 14084  3 -1 -1 -1
+  232   769963      4     64    4  17.25    -1    4   3600    -1  1 197  84 18520  1 -1 -1 -1
+  233   770574      7    426   32 291.62    -1   32  64800    -1  1 163  75 18524  3 -1 -1 -1
+  234   771302     11  64835   32  19918    -1   32  64800    -1  5 163  75 14087  3 -1 -1 -1
+  235   776280 138493  29058   63  28355    -1   63  57600    -1  5  24  22 14090  3 -1 -1 -1
+  236   781770      3    375    2 293.50    -1    2    900    -1  1 161  75 14093  3 -1 -1 -1
+  237   783245      7     32    8   0.50    -1    8  21600    -1  1 161  75 14096  3 -1 -1 -1
+  238   783624      9    304    8  44.75    -1    8  21600    -1  5 161  75 14099  3 -1 -1 -1
+  239   784168      7  21629    8 526.50    -1    8  21600    -1  5 161  75 14099  3 -1 -1 -1
+  240   784765      5   1226    1   1149    -1    1  18000    -1  1 154  75 14103  4 -1 -1 -1
+  241   789290      2    167    1   6.00    -1    1  57600    -1  1 153  75 14106  3 -1 -1 -1
+  242   789404      6    186    1   9.00    -1    1  57600    -1  1 153  75 14109  3 -1 -1 -1
+  243   789496     10    200    1  11.00    -1    1  57600    -1  1 153  75 14111  3 -1 -1 -1
+  244   789914      6    188    1  10.00    -1    1  57600    -1  1 153  75 14114  3 -1 -1 -1
+  245   790054      5    163    1   6.00    -1    1  57600    -1  1 153  75 14117  3 -1 -1 -1
+  246   790101     12    197    1  10.00    -1    1  57600    -1  1 153  75 14120  3 -1 -1 -1
+  247   807488      4   8023    8   7332    -1    8  64800    -1  1 150   6 13592  4 -1 -1 -1
+  248   808329      9     43    4   5.00    -1    4    900    -1  1 147  73 14125  3 -1 -1 -1
+  249   816636     12    343   32  27.47    -1   32   1800    -1  1 147  73 14128  3 -1 -1 -1
+  250   817954      1     51    2  12.50    -1    2  64800    -1  1   4   4 14131  3 -1 -1 -1
+  251   818634     12    113   32   7.78    -1   32   1800    -1  1 147  73 14133  3 -1 -1 -1
+  252   818881     11    113   32   7.84    -1   32   1800    -1  1 147  73 14136  3 -1 -1 -1
+  253   819048      6    359   32  28.34    -1   32   1800    -1  1 147  73 14139  3 -1 -1 -1
+  254   821433      5  57498    4  56838    -1    4  64800    -1  1 156  75 14142  3 -1 -1 -1
+  255   821568     10    205    2 154.50    -1    2    600    -1  1 164  75 14145  2 -1 -1 -1
+  256   821574      3    205    2 153.50    -1    2    600    -1  1 164  75 14148  1 -1 -1 -1
+  257   822311     11     23    1     -1    -1    1   1800    -1  1 147  73 18531  3 -1 -1 -1
+  258   822371      5    112   32   0.28    -1   32   1800    -1  5 147  73 18535  3 -1 -1 -1
+  259   822557      1     87   32   0.31    -1   32   1800    -1  5 147  73 18539  3 -1 -1 -1
+  260   822685      1     55   32   3.16    -1   32   3600    -1  1 133  50 18543  3 -1 -1 -1
+  261   822821      5   2179   32   2097    -1   32   3600    -1  1 133  50 18546  3 -1 -1 -1
+  262   822831      8     46   32   1.41    -1   32   1800    -1  1 147  73 18549  3 -1 -1 -1
+  263   823038      2     74   32   4.44    -1   32   1800    -1  5 147  73 18552  3 -1 -1 -1
+  264   823115      2    381   32  29.12    -1   32   1800    -1  1 147  73 18556  3 -1 -1 -1
+  265   823571      3    358   32  27.84    -1   32   1800    -1  1 147  73 18559  3 -1 -1 -1
+  266   824528     10  95061    8  11058    -1    8  64800    -1  5 150   6 13592  4 -1 -1 -1
+  267   825285      4  20332    1  20103    -1    1  57600    -1  5 153  75 18563  3 -1 -1 -1
+  268   825643      6   1336   32   1268    -1   32   3600    -1  1 133  50 18567  3 -1 -1 -1
+  269   825930      5    113    1   6.00    -1    1  57600    -1  1 153  75 18571  3 -1 -1 -1
+  270   825952      5   1492    1   1249    -1    1  21600    -1  5 153  75 18575  3 -1 -1 -1
+  271   825971     82    130    1  11.00    -1    1  57600    -1  1 153  75 18578  3 -1 -1 -1
+  272   827065      3   3383   32   3307    -1   32   3600    -1  1 133  50 18582  3 -1 -1 -1
+  273   827246      3    111    1  57.00    -1    1  57600    -1  5 153  75 18586  3 -1 -1 -1
+  274   827378      9  37309    1  36497    -1    1  57600    -1  1 153  75 18590  3 -1 -1 -1
+  275   827522      4    125    1   9.00    -1    1  57600    -1  1 153  75 18594  3 -1 -1 -1
+  276   827775      5   5975    1   5688    -1    1  57600    -1  1 153  75 18598  3 -1 -1 -1
+  277   827833   1175   4572    1   4275    -1    1  57600    -1  1 153  75 18602  3 -1 -1 -1
+  278   828709      2    314    4 233.25    -1    4   7200    -1  5 161  75 14099  3 -1 -1 -1
+  279   829129      6   2091    4 189.75    -1    4  21600    -1  5 161  75 14099  3 -1 -1 -1
+  280   829950     15     -1   -1     -1    -1   32   3600    -1  5 133  50 18612  3 -1 -1 -1
+  281   829971    489    112   48  27.08    -1   48   1800    -1  1 133  50 18615  3 -1 -1 -1
+  282   830638      4   1839   48   1714    -1   48   1800    -1  5 133  50 18619  3 -1 -1 -1
+  283   831299     10    104    4  34.75    -1    4   3600    -1  1 161  75 14099  3 -1 -1 -1
+  284   831662      8  15878    4   1053    -1    4  21600    -1  5 161  75 14099  3 -1 -1 -1
+  285   832355   4326    100   64  24.59    -1   64   2400    -1  1  34   7 14153  3 -1 -1 -1
+  286   832384    106     54   32   1.34    -1   32   2400    -1  1  34   7 14155  3 -1 -1 -1
+  287   832471     85     37   48   0.29    -1   48   3600    -1  5 133  50 18629  3 -1 -1 -1
+  288   832474     19     40   16   1.25    -1   16   2400    -1  1  34   7 14157  3 -1 -1 -1
+  289   832503      9   1479    8   1393    -1    8   3000    -1  1  34   7 14159  3 -1 -1 -1
+  290   832535     20     32    4   1.25    -1    4   3000    -1  1  34   7 14162  3 -1 -1 -1
+  291   832558     39   4073   48   3906    -1   48   5400    -1  1 133  50 18633  3 -1 -1 -1
+  292   832565      4   2068    2   2015    -1    2   3000    -1  1  34   7 14165  3 -1 -1 -1
+  293   832619     13     -1   -1     -1    -1   44   5400    -1  5 133  50 18637  3 -1 -1 -1
+  294   832711   3148     43   16   5.81    -1   16   1200    -1  1  34   7 14167  3 -1 -1 -1
+  295   832737   3176    211   16 156.75    -1   16   1200    -1  1  34   7 14169  3 -1 -1 -1
+  296   832759   3367     38   16   1.25    -1   16   2400    -1  1  34   7 14171  3 -1 -1 -1
+  297   832808      3     47    2  14.50    -1    2   1200    -1  1  34   7 14173  3 -1 -1 -1
+  298   832835      8   2070    2   2020    -1    2   3000    -1  1  34   7 14176  3 -1 -1 -1
+  299   832863    724     46    4  10.25    -1    4   1200    -1  1  34   7 14179  3 -1 -1 -1
+  300   832884    756     32    4   1.25    -1    4   3000    -1  1  34   7 14181  3 -1 -1 -1
+  301   832925   1077     47    8   7.25    -1    8   1200    -1  1  34   7 14183  3 -1 -1 -1
+  302   832947   1108    312    8 258.62    -1    8   2400    -1  1  34   7 14185  3 -1 -1 -1
+  303   832983   1392   1473    8   1392    -1    8   3000    -1  1  34   7 14187  3 -1 -1 -1
+  304   833122   3039     50   32   1.50    -1   32   2400    -1  1  34   7 14189  3 -1 -1 -1
+  305   833290   3503     91   64   4.72    -1   64   1200    -1  1  34   7 14191  3 -1 -1 -1
+  306   833341   2873     50   32   4.94    -1   32   1200    -1  1  34   7 14193  3 -1 -1 -1
+  307   833366   2903    331   32 217.56    -1   32   1200    -1  1  34   7 14195  3 -1 -1 -1
+  308   833504  14018    959    4 876.00    -1    4  21600    -1  5 161  75 18641  3 -1 -1 -1
+  309   836703     49     -1   -1     -1    -1   48   7200    -1  5 133  50 18645  3 -1 -1 -1
+  310   836740      8     65   32   0.38    -1   32  14400    -1  5 133  50 18649  3 -1 -1 -1
+  311   836814      2  12402   32  12023    -1   32  14400    -1  1 133  50 18653  3 -1 -1 -1
+  312   837305      5    124    2  65.00    -1    2   1200    -1  1  34   7 14197  3 -1 -1 -1
+  313   837319      2    104    2     -1    -1    2   1200    -1  5  34   7 14199  3 -1 -1 -1
+  314   837359      5    106    2     -1    -1    2   1200    -1  5  34   7 14201  3 -1 -1 -1
+  315   837373      2     64    4  31.75    -1    4   1200    -1  1  34   7 14203  3 -1 -1 -1
+  316   837384      3    105    4   0.25    -1    4   1200    -1  5  34   7 14206  3 -1 -1 -1
+  317   837389      9    106    4     -1    -1    4   1200    -1  5  34   7 14208  3 -1 -1 -1
+  318   839360      6    103    2  63.50    -1    2   1200    -1  1  34   7 14210  3 -1 -1 -1
+  319   839368      9     62    4  31.25    -1    4   1200    -1  1  34   7 14212  3 -1 -1 -1
+  320   839463     10     55    8  18.38    -1    8   1200    -1  1  34   7 14214  3 -1 -1 -1
+  321   839468      6    497    8 244.25    -1    8   1200    -1  1  34   7 14216  3 -1 -1 -1
+  322   839473      2    107    8   0.12    -1    8   1200    -1  5  34   7 14218  3 -1 -1 -1
+  323   839498     10     47   16   9.75    -1   16   1200    -1  1  34   7 14220  2 -1 -1 -1
+  324   839503      6    165   16 123.62    -1   16   1200    -1  1  34   7 14222  3 -1 -1 -1
+  325   839509     22    112   16   0.25    -1   16   1200    -1  5  34   7 14225  3 -1 -1 -1
+  326   839546    104     54   32   6.03    -1   32   1200    -1  1  34   7 14227  3 -1 -1 -1
+  327   839554    160    122   32  64.38    -1   32   1200    -1  1  34   7 14229  3 -1 -1 -1
+  328   839562    281   2136   32 382.50    -1   32   2400    -1  1  34   7 14232  3 -1 -1 -1
+  329   839576   4602     90   64   3.98    -1   64   1200    -1  1  34   7 14235  3 -1 -1 -1
+  330   839582   4701    114   64  34.58    -1   64   1200    -1  1  34   7 14238  3 -1 -1 -1
+  331   839587   4821    269   64 169.11    -1   64   1200    -1  1  34   7 14241  3 -1 -1 -1
+  332   840194     10     47    4  10.25    -1    4   1200    -1  1  34   7 14244  3 -1 -1 -1
+  333   840240      8     38    4   1.00    -1    4   3000    -1  1  34   7 14247  3 -1 -1 -1
+  334   840270     10     44   16   5.81    -1   16   1200    -1  1  34   7 14250  3 -1 -1 -1
+  335   840299      4    212   16 156.75    -1   16   3000    -1  1  34   7 14253  3 -1 -1 -1
+  336   840332      4     60   16   1.25    -1   16   3600    -1  1  34   7 14256  3 -1 -1 -1
+  337   840381    142     47   32   1.34    -1   32   3000    -1  1  34   7 14259  3 -1 -1 -1
+  338   840617      2     88    2  56.50    -1    2   1200    -1  1  34   7 14262  3 -1 -1 -1
+  339   841203     10     62    4  31.50    -1    4   1200    -1  1  34   7 14265  3 -1 -1 -1
+  340   841621      6   2541   32 390.12    -1   32   3600    -1  1  34   7 14268  3 -1 -1 -1
+  341   842026   2659     72   64   4.59    -1   64   1200    -1  1  34   7 14271  3 -1 -1 -1
+  342   842056   2711    154   64  57.48    -1   64   1200    -1  1  34   7 14274  3 -1 -1 -1
+  343   842086   2848     70   64   1.47    -1   64   3000    -1  1  34   7 14277  3 -1 -1 -1
+  344   843552 132215   2337   32   2234    -1   32  64800    -1  1 163  75 14280  3 -1 -1 -1
+  345   843673     10     62    8  18.38    -1    8   1200    -1  1  34   7 14283  3 -1 -1 -1
+  346   845024      7  37996    1  36784    -1    1  57600    -1  1 153  75 14286  3 -1 -1 -1
+  347   845045    581  16542    1  15774    -1    1  57600    -1  1 153  75 14289  3 -1 -1 -1
+  348   845627   1896  10132    1   9976    -1    1  57600    -1  5 153  75 18655  3 -1 -1 -1
+  349   846197     12     46   16   9.75    -1   16   1200    -1  1  34   7 14292  2 -1 -1 -1
+  350   846218     12    166   16 123.75    -1   16   1200    -1  1  34   7 14295  3 -1 -1 -1
+  351   848867     11     47   32   1.75    -1   32   3600    -1  1 133  50 18658  3 -1 -1 -1
+  352   849016     11   3635   32   3551    -1   32   3600    -1  5 133  50 18662  3 -1 -1 -1
+  353   849450     12    452    8 399.62    -1    8   7200    -1  1 127  75 14298  3 -1 -1 -1
+  354   850353 127754  43248   63   8547    -1   63  43200    -1  5 131  20 18666  4 -1 -1 -1
+  355   852708      4     95   48  33.31    -1   48   5400    -1  1 133  50 18670  3 -1 -1 -1
+  356   852801     17   1449   48   1374    -1   48   5400    -1  5 133  50 18674  3 -1 -1 -1
+  357   854322      6     59   48   2.77    -1   48   3600    -1  1 133  50 18678  3 -1 -1 -1
+  358   854453      4  65143   48   2088    -1   48   3600    -1  5 133  50 18682  3 -1 -1 -1
+  359   855869  55282     -1   -1     -1    -1   64   5400    -1  5 133  50 18686  3 -1 -1 -1
+  360   857145      6    256    1 217.00    -1    1    900    -1  1 159  75 14301  1 -1 -1 -1
+  361   857230      6    182    2 147.50    -1    2    900    -1  1 159  75 14304  1 -1 -1 -1
+  362   857593      3    181    2 148.50    -1    2    900    -1  1 159  75 14307  1 -1 -1 -1
+  363   857696   2962  38541    1  36520    -1    1  57600    -1  1 153  75 18690  3 -1 -1 -1
+  364   857877   2781     24    1     -1    -1    1   3600    -1  1 166  75 14312  3 -1 -1 -1
+  365   858162   2498  13584    1  13476    -1    1  18000    -1  1 154  75 14315  4 -1 -1 -1
+  366   860654      4    105   43  54.65    -1   43  64800    -1  1  41  30 14318  2 -1 -1 -1
+  367   861020      1    199   43 146.47    -1   43  64800    -1  1  41  30 14321  2 -1 -1 -1
+  368   861521     10    110   43  60.07    -1   43  64800    -1  1  41  30 14324  2 -1 -1 -1
+  369   862186      3    115   43  60.28    -1   43  64800    -1  1  41  30 14327  2 -1 -1 -1
+  370   872655     10   1091   32 194.41    -1   32  10800    -1  1 150   6 13641  2 -1 -1 -1
+  371   872900     10  39487    1  37945    -1    1  57600    -1  5 153  75 14330  3 -1 -1 -1
+  372   880898     10   1603   32   1513    -1   32   3600    -1  1 163  75 18694  2 -1 -1 -1
+  373   886751  27938  57958    8  54476    -1    8  64800    -1  5 150   6 13592  4 -1 -1 -1
+  374   906748     83     -1   -1     -1    -1    8   3600    -1  5 167  73 14334  3 -1 -1 -1
+  375   906839     28     -1   -1     -1    -1    8    600    -1  5 167  73 14334  5 -1 -1 -1
+  376   906857     17     -1   -1     -1    -1   64   5400    -1  5 133  50 18698  3 -1 -1 -1
+  377   906884    183     -1   -1     -1    -1    8    600    -1  5 167  73 14334  2 -1 -1 -1
+  378   911140    645     -1   -1     -1    -1   64   9000    -1  5 133  50 14341  3 -1 -1 -1
+  379   911465      2    202    2 156.00    -1    2    600    -1  1 164  75 14344  2 -1 -1 -1
+  380   911555      2    232    2 174.00    -1    2    600    -1  1 164  75 14347  2 -1 -1 -1
+  381   911696     27     -1   -1     -1    -1   48   9000    -1  5 133  50 14350  3 -1 -1 -1
+  382   911751   4547     -1   -1     -1    -1   36   9000    -1  5 133  50 14352  3 -1 -1 -1
+  383   911937   2750  34440    1  33061    -1    1  57600    -1  1 153  75 18702  3 -1 -1 -1
+  384   912128   2561  16070    1  15944    -1    1  18000    -1  1 154  75 18706  4 -1 -1 -1
+  385   912141   2546  49143    1  46451    -1    1  57600    -1  1 153  75 18710  3 -1 -1 -1
+  386   912284   2402  64828    4  64210    -1    4  64800    -1  5 156  75 14355  3 -1 -1 -1
+  387   912390   2298    146    1  10.00    -1    1  57600    -1  1 153  75 18714  3 -1 -1 -1
+  388   915785      5     24    1     -1    -1    1  17400    -1  1 166  75 14358  3 -1 -1 -1
+  389   916285     10   9171   22   8993    -1   22  12600    -1  1 133  50 14361  3 -1 -1 -1
+  390   919428  13155     -1   -1     -1    -1   43  64800    -1  5  41  30 14370  2 -1 -1 -1
+  391   919629  24210     72   32   5.94    -1   32   1200    -1  1  34   7 14373  3 -1 -1 -1
+  392   919650  24193    112   32  63.62    -1   32   1200    -1  1  34   7 14376  3 -1 -1 -1
+  393   919680  24557     70   64   3.86    -1   64   1200    -1  1  34   7 14379  3 -1 -1 -1
+  394   919695  24693    101   64  34.16    -1   64   1200    -1  1  34   7 14382  3 -1 -1 -1
+  395   919715  24786    244   64 167.62    -1   64   1200    -1  1  34   7 14385  3 -1 -1 -1
+  396   919764   5709    607   23 562.87    -1   23  64800    -1  1  41  30 14388  2 -1 -1 -1
+  397   920266     10    628    2 534.50    -1    2   7200    -1  5  15  75 14391  3 -1 -1 -1
+  398   920556   5532     36   16   0.44    -1   16   1200    -1  1  34   7 14394  3 -1 -1 -1
+  399   920614   5518     59   16  22.25    -1   16   1200    -1  1  34   7 14396  3 -1 -1 -1
+  400   920669   5529    127   16  87.62    -1   16   1200    -1  1  34   7 14399  3 -1 -1 -1
+  401   920727      3     32    8   0.50    -1    8   1200    -1  1  34   7 14402  3 -1 -1 -1
+  402   920778      6    105    8   0.12    -1    8   1200    -1  5  34   7 14404  3 -1 -1 -1
+  403   920954     11    746    2 641.50    -1    2   7200    -1  1  15  75 14407  3 -1 -1 -1
+  404   921088      4    105    8   0.12    -1    8   1200    -1  5  34   7 14410  3 -1 -1 -1
+  405   921151      6     51    4  21.00    -1    4   1200    -1  1  34   7 14413  3 -1 -1 -1
+  406   921191      9    103    4   0.25    -1    4   1200    -1  5  34   7 14416  3 -1 -1 -1
+  407   921235      8    104    4   0.25    -1    4   1200    -1  5  34   7 14419  3 -1 -1 -1
+  408   921301      6     70    2  39.50    -1    2   1200    -1  1  34   7 14422  3 -1 -1 -1
+  409   921340     10    105    2     -1    -1    2   1200    -1  5  34   7 14425  3 -1 -1 -1
+  410   921391      2    104    2     -1    -1    2   1200    -1  5  34   7 14428  3 -1 -1 -1
+  411   921705      6     31    8   0.38    -1    8   1200    -1  1  34   7 14431  3 -1 -1 -1
+  412   921724      9     51    4  21.00    -1    4   1200    -1  1  34   7 14434  3 -1 -1 -1
+  413   921747      8     69    2  38.50    -1    2   1200    -1  1  34   7 14437  3 -1 -1 -1
+  414   921939      7     43    8  10.88    -1    8   1200    -1  1  34   7 14440  3 -1 -1 -1
+  415   922156  21761     48   32   3.75    -1   32   1200    -1  1  34   7 14443  3 -1 -1 -1
+  416   922213  21752     44   32   0.47    -1   32   1200    -1  1  34   7 14446  3 -1 -1 -1
+  417   922221     11  49867    8  48627    -1    8  54000    -1  1 173  75 14298  4 -1 -1 -1
+  418   922247  21726     96   32  45.28    -1   32   1200    -1  1  34   7 14449  3 -1 -1 -1
+  419   922339   3751     36    8   1.12    -1    8  57600    -1  1  90  75 18720  3 -1 -1 -1
+  420   923540      4     61    2  18.50    -1    2   7200    -1  5  15  75 14452  3 -1 -1 -1
+  421   923597     11     77    2  28.00    -1    2   7200    -1  5  15  75 14455  3 -1 -1 -1
+  422   923901      4     38    4   4.75    -1    4    300    -1  1  35   7 14457  3 -1 -1 -1
+  423   924076     10  38648    1  37293    -1    1  57600    -1  1 153  75 18724  3 -1 -1 -1
+  424   924664   1470    105    8   0.12    -1    8  43200    -1  5  90  75 18727  3 -1 -1 -1
+  425   925236  18781     87   32   2.69    -1   32  14400    -1  1 133  50 14459  3 -1 -1 -1
+  426   926297      8  44927    8  44543    -1    8  57600    -1  1  90  75 18731  3 -1 -1 -1
+  427   926370     10    106    8   0.12    -1    8  43200    -1  5  90  75 18734  3 -1 -1 -1
+  428   926593     10  24887    8  24624    -1    8  43200    -1  1  90  75 18738  3 -1 -1 -1
+  429   927444      5     24    1     -1    -1    1  17400    -1  1 166  75 18740  3 -1 -1 -1
+  430   927848  16261    108   16   0.25    -1   16  17400    -1  5 166  75 18744  3 -1 -1 -1
+  431   931074 869430  10871   63   1891    -1   63  43200    -1  1 131  20 18748  4 -1 -1 -1
+  432   931335   1337     -1   -1     -1    -1   23  64800    -1  5  41  30 14461  2 -1 -1 -1
+  433   932068    494     -1   -1     -1    -1   23  64800    -1  5  41  30 14464  3 -1 -1 -1
+  434   932665      9    225    2 114.00    -1    2   7200    -1  5  15  75 14467  3 -1 -1 -1
+  435   933127     14     -1   -1     -1    -1   23  64800    -1  5  41  30 14469  3 -1 -1 -1
+  436   933174   1244     -1   -1     -1    -1   23  64800    -1  5  41  30 14471  2 -1 -1 -1
+  437   933923     10  14132    1  14003    -1    1  18000    -1  1 154  75 14474  4 -1 -1 -1
+  438   934641      1     43    8  10.88    -1    8   1800    -1  1  34   7 14477  3 -1 -1 -1
+  439   934669   9404     37   16   0.44    -1   16   1800    -1  1  34   7 14480  3 -1 -1 -1
+  440   934693   9381     59   16  22.25    -1   16   1200    -1  1  34   7 14483  3 -1 -1 -1
+  441   934709   9398    127   16  87.69    -1   16   1200    -1  1  34   7 14485  3 -1 -1 -1
+  442   939356  13281   3647   64 691.47    -1   64   3600    -1  5  62  79 18752  3 -1 -1 -1
+  443   942517      7    224    2 116.00    -1    2   7200    -1  5  15  75 14488  3 -1 -1 -1
+  444   942561     82     -1   -1     -1    -1   43  64800    -1  5  41  30 14490  2 -1 -1 -1
+  445   942670  33101    161   43 105.56    -1   43  64800    -1  1  41  30 14493  3 -1 -1 -1
+  446   943681 378460  64848   63  64378    -1   63  64800    -1  5  24  22 18756  3 -1 -1 -1
+  447   944051     10     62    2  14.00    -1    2   7200    -1  5  15  75 14496  3 -1 -1 -1
+  448   944262     53     67   63   0.38    -1   63  57600    -1  1  24  22 18760  2 -1 -1 -1
+  449   944613    143   6075   63   5863    -1   63  57600    -1  5  24  22 18764  2 -1 -1 -1
+  450   945431   5411   4115   16   2901    -1   16  17400    -1  1 166  75 14499  3 -1 -1 -1
+  451   945664      3  45728    1  45388    -1    1  64800    -1  1 155  75 18768  3 -1 -1 -1
+  452   946498      5    550    8 244.12    -1    8   1200    -1  1  34   7 14501  3 -1 -1 -1
+  453   946546   5852     75   64   0.53    -1   64   1200    -1  1  34   7 14503  3 -1 -1 -1
+  454   946585   5899     66   64   0.53    -1   64   1200    -1  1  34   7 14505  3 -1 -1 -1
+  455   946620   5941     65   64   0.52    -1   64   1200    -1  1  34   7 14507  3 -1 -1 -1
+  456   946643   4855     50   32   3.66    -1   32   1200    -1  1  34   7 14510  3 -1 -1 -1
+  457   946672   4881     43   32   0.50    -1   32   1200    -1  1  34   7 14512  3 -1 -1 -1
+  458   947039   4564     92   32  45.28    -1   32   1200    -1  1  34   7 14515  3 -1 -1 -1
+  459   950786     53   1557   32 291.34    -1   32  10800    -1  1 150   6 13641  2 -1 -1 -1
+  460   951728   3234  49584    8  49123    -1    8  50400    -1  1  90  75 18772  3 -1 -1 -1
+  461   952787   3507   1597   32 295.06    -1   32  10800    -1  1 150   6 13641  2 -1 -1 -1
+  462   953772   3343     -1   -1     -1    -1   63  57600    -1  5  24  22 18776  2 -1 -1 -1
+  463   971478      4   2787   32   2579    -1   32   7200    -1  1 163  75 18780  2 -1 -1 -1
+  464   971722   4050  64830    8  60981    -1    8  64800    -1  5 150   6 13592  4 -1 -1 -1
+  465   978080      5     30    4   0.25    -1    4    300    -1  1  94  53 18784  1 -1 -1 -1
+  466   978324      6     30    4   0.25    -1    4    300    -1  1  94  53 18788  1 -1 -1 -1
+  467   978410      6     30    4   0.25    -1    4    300    -1  1  94  53 18792  1 -1 -1 -1
+  468   978593      4     30    4   0.25    -1    4    300    -1  1  94  53 18795  1 -1 -1 -1
+  469   981872      8     30    4   0.25    -1    4    300    -1  1  94  53 18799  1 -1 -1 -1
+  470   982104     10     33    4   2.50    -1    4    300    -1  1  94  53 18803  1 -1 -1 -1
+  471   990314      3     29    4   0.25    -1    4    300    -1  1  94  53 18807  1 -1 -1 -1
+  472   990429      5     30    4   0.25    -1    4    300    -1  1  94  53 18811  1 -1 -1 -1
+  473   990508      1     30    4   0.25    -1    4    300    -1  1  94  53 18815  1 -1 -1 -1
+  474   990698      3     29    4   0.25    -1    4    300    -1  1  94  53 18819  1 -1 -1 -1
+  475   990856      5     30    4   0.25    -1    4    300    -1  1  94  53 18823  1 -1 -1 -1
+  476   990929      7     31    4   0.25    -1    4    300    -1  1  94  53 18827  1 -1 -1 -1
+  477   991026      7     29    4   0.25    -1    4    300    -1  1  94  53 18831  1 -1 -1 -1
+  478   991228      7     31    4   0.25    -1    4    300    -1  1  94  53 18835  1 -1 -1 -1
+  479   991258     10     29    4   0.25    -1    4    300    -1  1  94  53 18839  1 -1 -1 -1
+  480   992559      5  15421    1  15284    -1    1  18000    -1  1 154  75 18843  4 -1 -1 -1
+  481   993299      9  14436   32  14224    -1   32  14400    -1  5 133  50 14521  3 -1 -1 -1
+  482   993319  44595  25922    8  24265    -1    8  64800    -1  5 150   6 13592  4 -1 -1 -1
+  483   993407  10460     -1   -1     -1    -1   32  10800    -1  5 150   6 13641  2 -1 -1 -1
+  484   996045      5  43197    1  41724    -1    1  57600    -1  1 153  75 18847  3 -1 -1 -1
+  485   996238      3  53694    1  50739    -1    1  57600    -1  1 153  75 18851  3 -1 -1 -1
+  486   996620      3  33534    1  32358    -1    1  57600    -1  1 153  75 18854  3 -1 -1 -1
+  487   998538   6014  57305    4  56820    -1    4  64800    -1  1 156  75 14526  3 -1 -1 -1
+  488   999237  13136  13453   32  13303    -1   32  64800    -1  1 171  75 18858  2 -1 -1 -1
+  489  1000998  23183  14731   11  14327    -1   11  36000    -1  1 160  75 14529  3 -1 -1 -1
+  490  1001018  23164  16712   11  16193    -1   11  36000    -1  1 160  75 14532  3 -1 -1 -1
+  491  1001024  24853  16774   11  16269    -1   11  36000    -1  1 160  75 14535  3 -1 -1 -1
+  492  1001077  24801    541   11 183.45    -1   11  36000    -1  1 160  75 14538  3 -1 -1 -1
+  493  1001582   2970   1014    1 972.00    -1    1  14400    -1  1 152  75 14541  3 -1 -1 -1
+  494  1002974   1579  44754    1  44420    -1    1  64800    -1  1 155  75 18862  3 -1 -1 -1
+  495  1006298     21     -1   -1     -1    -1   32   7200    -1  5 163  75 14544  3 -1 -1 -1
+  496  1006344   1411   2963   32   2277    -1   32  10800    -1  1 163  75 14546  2 -1 -1 -1
+  497  1006600      2     68    3  38.33    -1    3    900    -1  1 147  73 18866  3 -1 -1 -1
+  498  1006884      4     74    3  45.00    -1    3    900    -1  1 147  73 18870  3 -1 -1 -1
+  499  1007209  20375     51   16   0.25    -1   16  17400    -1  5  32  75 18874  3 -1 -1 -1
+  500  1007513      9  38342    1  36462    -1    1  57600    -1  1 153  75 14549  3 -1 -1 -1
+  501  1007626   3103   1638   32 294.69    -1   32  10800    -1  1 150   6 13641  2 -1 -1 -1
+  502  1008336      2     67    3  36.67    -1    3    900    -1  1 147  73 18878  3 -1 -1 -1
+  503  1008438      7     72    3  43.00    -1    3    900    -1  1 147  73 18882  3 -1 -1 -1
+  504  1008697  12825     -1   -1     -1    -1   32   3600    -1  5 133  50 14554  3 -1 -1 -1
+  505  1009720      5  12979    1  12861    -1    1  18000    -1  1 154  75 14557  4 -1 -1 -1
+  506  1010326  17158     82   43  26.19    -1   43  64800    -1  1  41  30 14560  3 -1 -1 -1
+  507  1011364      1     94    1  58.00    -1    1  64800    -1  5 152  75 14563  3 -1 -1 -1
+  508  1011421     40  30109    2  28207    -1    2  64800    -1  1  42  75 14566  3 -1 -1 -1
+  509  1011456  11522  57340    1  35591    -1    1  64800    -1  1 152  75 14569  3 -1 -1 -1
+  510  1011757   9611     68    3  38.00    -1    3    900    -1  1 147  73 18886  3 -1 -1 -1
+  511  1012707   3701     -1   -1     -1    -1    2   1200    -1  5  15  75 14572  3 -1 -1 -1
+  512  1013279   8090   1596   32 290.66    -1   32  10800    -1  1 150   6 13641  2 -1 -1 -1
+  513  1016083   5283    227    2 183.00    -1    2    900    -1  1 159  75 18890  1 -1 -1 -1
+  514  1018145   4832   2892   32   2686    -1   32  10800    -1  1 163  75 14576  2 -1 -1 -1
+  515  1021510      7   2657   26   2539    -1   26   3600    -1  1 133  50 14578  3 -1 -1 -1
+  516  1021557      4     69    3  38.00    -1    3    900    -1  1 147  73 18893  3 -1 -1 -1
+  517  1021683      7     65    3  36.00    -1    3    900    -1  1 147  73 18896  3 -1 -1 -1
+  518  1021699      2    314    1 272.00    -1    1    900    -1  1 159  75 14581  1 -1 -1 -1
+  519  1022379      1     65    3  35.00    -1    3    900    -1  1 147  73 18899  3 -1 -1 -1
+  520  1022750      2    187    2 148.00    -1    2    900    -1  1 159  75 14584  1 -1 -1 -1
+  521  1022947      7     39    2     -1    -1    2    900    -1  1 159  75 14587  1 -1 -1 -1
+  522  1023046      8   2745    1   2685    -1    1  18000    -1  1 154  75 14590  4 -1 -1 -1
+  523  1023132   2705   1623   32 291.16    -1   32  10800    -1  1 150   6 13641  2 -1 -1 -1
+  524  1023155      7    216    2 181.50    -1    2    900    -1  1 159  75 14595  1 -1 -1 -1
+  525  1023831    384  45617    8  45158    -1    8  57600    -1  1  90  75 18901  3 -1 -1 -1
+  526  1023982      8    216    2 180.50    -1    2    900    -1  1 159  75 14598  1 -1 -1 -1
+  527  1024020   2402  50428    8  49861    -1    8  50400    -1  5  90  75 18905  3 -1 -1 -1
+  528  1025196   1225   4936    2 566.00    -1    2  14400    -1  5 161  75 14099  3 -1 -1 -1
+  529  1025397  24414    757   64 682.66    -1   64   3600    -1  1 159  75 14603  3 -1 -1 -1
+  530  1025795  24779    127   64   0.30    -1   64   1200    -1  5  34   7 14606  3 -1 -1 -1
+  531  1025810  24893    130   64   0.28    -1   64   1200    -1  5  34   7 14609  3 -1 -1 -1
+  532  1025824  25019    134   64   0.30    -1   64   1200    -1  5  34   7 14612  3 -1 -1 -1
+  533  1025854  25128  24983   32  24761    -1   32  64800    -1  1 119  76 14615  3 -1 -1 -1
+  534  1026315      9    363    2 327.50    -1    2    900    -1  1 159  75 14618  1 -1 -1 -1
+  535  1026344      2    149    8 110.50    -1    8   3600    -1  1 159  75 14621  1 -1 -1 -1
+  536  1026387  11526  11889   11  11468    -1   11  36000    -1  1 160  75 18909  3 -1 -1 -1
+  537  1026761      7    227    4 187.25    -1    4    900    -1  1 159  75 14624  1 -1 -1 -1
+  538  1027017    566   3634   24   3542    -1   24   3600    -1  5 133  50 14627  3 -1 -1 -1
+  539  1027423 199474   3655   64 691.91    -1   64   3600    -1  5  62  79 18913  3 -1 -1 -1
+  540  1027706      7    130    8  96.75    -1    8   3600    -1  1 159  75 14630  1 -1 -1 -1
+  541  1027716      8    194    4 161.00    -1    4    900    -1  1 159  75 14633  1 -1 -1 -1
+  542  1027720      5    321    2 287.50    -1    2    900    -1  1 159  75 14636  1 -1 -1 -1
+  543  1029051  24713    144   43  80.00    -1   43  64800    -1  1  41  30 14639  3 -1 -1 -1
+  544  1029268      7    294    4 254.00    -1    4   1200    -1  1  34   7 14642  3 -1 -1 -1
+  545  1029276     10   1228    4   1171    -1    4   1200    -1  5  34   7 14645  3 -1 -1 -1
+  546  1029285      2   1228    4   1180    -1    4   1200    -1  5  34   7 14648  3 -1 -1 -1
+  547  1029320     11    527    2 488.00    -1    2   1200    -1  1  34   7 14651  3 -1 -1 -1
+  548  1029353     10   1228    2   1182    -1    2   1200    -1  5  34   7 14654  3 -1 -1 -1
+  549  1029383      2    106    2     -1    -1    2   1200    -1  5  34   7 14657  3 -1 -1 -1
+  550  1029422    155    187    8 139.62    -1    8   1200    -1  1  34   7 14660  3 -1 -1 -1
+  551  1029461    309    643    8 569.00    -1    8   1200    -1  1  34   7 14663  3 -1 -1 -1
+  552  1029545    875   1227    8   1147    -1    8   1200    -1  5  34   7 14666  3 -1 -1 -1
+  553  1029767     99    700    1 268.00    -1    1   1800    -1  5 153  75 14669  3 -1 -1 -1
+  554  1029875   1356   9120   24   8890    -1   24  12600    -1  1 133  50 14672  3 -1 -1 -1
+  555  1029921   1728    131   16  80.25    -1   16   1200    -1  1  34   7 14675  3 -1 -1 -1
+  556  1029953   1837    370   16 297.50    -1   16   1200    -1  1  34   7 14678  3 -1 -1 -1
+  557  1030024   2146   1230   16   1110    -1   16   1200    -1  5  34   7 14681  3 -1 -1 -1
+  558  1030292 502443     -1   -1     -1    -1   63  57600    -1  5  24  22 18917  3 -1 -1 -1
+  559  1030452     11  43101    1  41346    -1    1  57600    -1  1 153  75 18921  3 -1 -1 -1
+  560  1031510      9   8945    1   8867    -1    1  18000    -1  1 154  75 18925  4 -1 -1 -1
+  561  1037903   2708   1021   32 182.12    -1   32  10800    -1  1 150   6 13641  2 -1 -1 -1
+  562  1038881     42  14831   11  14316    -1   11  36000    -1  1 160  75 18929  3 -1 -1 -1
+  563  1039011  31791  64681   13  59925    -1   13  64800    -1  1 151  75 18931  3 -1 -1 -1
+  564  1040863  13050  16844   11  16201    -1   11  36000    -1  1 160  75 14686  3 -1 -1 -1
+  565  1042339     10  37354    1  35957    -1    1  58200    -1  1 153  75 14689  3 -1 -1 -1
+  566  1042620  11294  16880   11  16242    -1   11  36000    -1  1 160  75 14692  3 -1 -1 -1
+  567  1049771   4145  14912   11  14325    -1   11  36000    -1  1 160  75 14695  3 -1 -1 -1
+  568  1051747      9     49   32   1.53    -1   32    300    -1  1 158  73 14698  3 -1 -1 -1
+  569  1052979      6     32    2   2.00    -1    2    300    -1  1 158  73 14701  3 -1 -1 -1
+  570  1053155     11     32    5   1.20    -1    5    300    -1  1 158  73 14704  3 -1 -1 -1
+  571  1053370      9     45   32   2.31    -1   32    300    -1  1 158  73 14707  3 -1 -1 -1
+  572  1053645     11     46   32   2.25    -1   32    300    -1  1 158  73 14710  3 -1 -1 -1
+  573  1053723  24106  14911   11  14382    -1   11  36000    -1  1 160  75 18934  3 -1 -1 -1
+  574  1053953   3057     -1   -1     -1    -1   32    300    -1  5 158  73 14713  3 -1 -1 -1
+  575  1055143      2    106    3     -1    -1    3    900    -1  5 158  73 14716  3 -1 -1 -1
+  576  1055389     12     72    3  41.67    -1    3    900    -1  1 158  73 14719  3 -1 -1 -1
+  577  1057064     10     38   16   2.19    -1   16    300    -1  1 158  73 14722  3 -1 -1 -1
+  578  1057253  30038     81   64   2.42    -1   64    300    -1  1 158  73 14725  3 -1 -1 -1
+  579  1057333  30048     73   64   2.25    -1   64    300    -1  1 158  73 14728  3 -1 -1 -1
+  580  1057969  18006   2969   32   2279    -1   32   7200    -1  1 163  75 14731  3 -1 -1 -1
+  581  1059825      2    360    8 144.62    -1    8  64800    -1  1 150   6 13592  4 -1 -1 -1
+  582  1061231     10    336    8 143.75    -1    8  64800    -1  1 150   6 13592  4 -1 -1 -1
+  583  1061247   7590  13005   32  12823    -1   32  64800    -1  1 171  75 14738  2 -1 -1 -1
+  584  1061885   6955    386    8 145.88    -1    8  64800    -1  1 150   6 13592  4 -1 -1 -1
+  585  1068797   1040  14867   11  14330    -1   11  36000    -1  1 160  75 14743  3 -1 -1 -1
+  586  1069383      8    337    8 143.62    -1    8  64800    -1  1 150   6 13592  4 -1 -1 -1
+  587  1070476  35138  44837    8  34793    -1    8  64800    -1  5 150   6 13592  4 -1 -1 -1
+  588  1070725     33  16746   11  16175    -1   11  36000    -1  1 160  75 14750  3 -1 -1 -1
+  589  1070763  17169  16654   11  16211    -1   11  36000    -1  1 160  75 18937  3 -1 -1 -1
+  590  1073175  58079     -1   -1     -1    -1   64   2700    -1  5 147  73 18941  3 -1 -1 -1
+  591  1073195  58059     -1   -1     -1    -1   64   2700    -1  5 147  73 18945  3 -1 -1 -1
+  592  1077428      8    388   10  30.30    -1   10   1800    -1  1 147  73 18949  3 -1 -1 -1
+  593  1077698   1253    734   32 126.41    -1   32  10800    -1  1 150   6 13641  2 -1 -1 -1
+  594  1077982     19     -1   -1     -1    -1   10   1800    -1  5 147  73 18953  3 -1 -1 -1
+  595  1078041   1652    376   10  27.50    -1   10   1800    -1  1 147  73 18957  3 -1 -1 -1
+  596  1078979  18883  45411    8  44999    -1    8  57600    -1  1  90  75 18961  3 -1 -1 -1
+  597  1079751      6   2157   24   1992    -1   24  21600    -1  5 133  50 14755  3 -1 -1 -1
+  598  1080326      5  25227    8  24851    -1    8  25200    -1  5  90  75 18965  3 -1 -1 -1
+  599  1081651     11   5179    1   5069    -1    1   7200    -1  1 172  77 14758  4 -1 -1 -1
+  600  1081809     41    325   10  26.80    -1   10   1800    -1  1 147  73 18969  3 -1 -1 -1
+  601  1081821     12  40553    1  38356    -1    1  57600    -1  1 153  75 18973  3 -1 -1 -1
+  602  1081871     49    109   26   3.23    -1   26   9000    -1  1 133  50 14761  3 -1 -1 -1
+  603  1082044      5     83   26   2.69    -1   26   9000    -1  1 133  50 14764  3 -1 -1 -1
+  604  1082114     10  34281    1  32828    -1    1  57600    -1  1 153  75 18977  3 -1 -1 -1
+  605  1082147     10     61   26   2.69    -1   26   9000    -1  1 133  50 14767  3 -1 -1 -1
+  606  1082294      3    358   32  28.12    -1   32   1800    -1  1 147  73 18981  3 -1 -1 -1
+  607  1082315      3     93   26   3.23    -1   26   9000    -1  1 133  50 14770  3 -1 -1 -1
+  608  1082365     50  58227    1  55249    -1    1  58200    -1  5 153  75 18984  3 -1 -1 -1
+  609  1082669      2    378   32  29.56    -1   32   1800    -1  5 147  73 18987  3 -1 -1 -1
+  610  1082851    200     56   26   2.54    -1   26   9000    -1  1 133  50 14773  3 -1 -1 -1
+  611  1083035     19   4225   26   4125    -1   26   9000    -1  1 133  50 14776  3 -1 -1 -1
+  612  1083041     13  36626    1  35370    -1    1  36600    -1  5 153  75 18990  3 -1 -1 -1
+  613  1083108    982     -1   -1     -1    -1   32   1800    -1  5 147  73 18994  3 -1 -1 -1
+  614  1083185      9   7671    1   7595    -1    1  18000    -1  1 154  75 14779  4 -1 -1 -1
+  615  1084110      6    349   29  28.14    -1   29   1800    -1  1 147  73 18998  3 -1 -1 -1
+  616  1084673   2789  14847   11  14316    -1   11  36000    -1  1 160  75 14782  3 -1 -1 -1
+  617  1085603      2     71    3  36.33    -1    3    900    -1  1 147  73 14785  3 -1 -1 -1
+  618  1086559     21     -1   -1     -1    -1   16  17400    -1  5  32  75 19002  3 -1 -1 -1
+  619  1086674    792    110   16   0.25    -1   16  17400    -1  5  32  75 19006  3 -1 -1 -1
+  620  1087318    147    872   40 788.15    -1   40  18000    -1  5 133  50 14788  3 -1 -1 -1
+  621  1087473  62955  17091   11  16327    -1   11  36000    -1  1 160  75 19010  3 -1 -1 -1
+  622  1087809      6  17499   16   0.12    -1   16  17400    -1  5  32  75 19014  3 -1 -1 -1
+  623  1087926    415   1110   32 198.50    -1   32  10800    -1  1 150   6 13641  2 -1 -1 -1
+  624  1088050   1485  23100    1  22903    -1    1  64800    -1  1 155  75 19017  3 -1 -1 -1
+  625  1088289   1170     67   40   2.83    -1   40  18000    -1  1 133  50 14793  3 -1 -1 -1
+  626  1089288   7164   1444    4 134.75    -1    4  28800    -1  5 161  75 14099  3 -1 -1 -1
+  627  1090686      3  13523   39  13342    -1   39  18000    -1  1 133  50 14796  3 -1 -1 -1
+  628  1090719     12     -1   -1     -1    -1   32  18000    -1  5 133  50 14799  3 -1 -1 -1
+  629  1091323 139241    755   64 682.30    -1   64   3600    -1  1 159  75 19023  3 -1 -1 -1
+  630  1092118    626    528    2 486.50    -1    2   1200    -1  1  34   7 14802  3 -1 -1 -1
+  631  1092145    600   1828    2   1767    -1    2   1800    -1  5  34   7 14805  3 -1 -1 -1
+  632  1092177    569    298    4 253.75    -1    4   1200    -1  1  34   7 14808  3 -1 -1 -1
+  633  1092200    547   1290    4   1226    -1    4   2400    -1  1  34   7 14813  3 -1 -1 -1
+  634  1092227    828   2428    4   2363    -1    4   2400    -1  5  34   7 14816  3 -1 -1 -1
+  635  1092248   2335    186    8 139.62    -1    8   1200    -1  1  34   7 14819  3 -1 -1 -1
+  636  1092270   2505    644    8 570.88    -1    8   1200    -1  1  34   7 14822  3 -1 -1 -1
+  637  1092292   3130   2430    8   2295    -1    8   2400    -1  5  34   7 14825  3 -1 -1 -1
+  638  1092316  13005    130   16  80.19    -1   16   1200    -1  1  34   7 14828  3 -1 -1 -1
+  639  1092334  13127    369   16 296.44    -1   16   1200    -1  1  34   7 14831  3 -1 -1 -1
+  640  1092371  13123   1499   16   1360    -1   16   2400    -1  1  34   7 14834  3 -1 -1 -1
+  641  1092617  13224  39802   32  13917    -1   32  64800    -1  5 163  75 14837  3 -1 -1 -1
+  642  1092709  57720  14972   11  14405    -1   11  36000    -1  1 160  75 19027  3 -1 -1 -1
+  643  1093742      3     34    1   4.00    -1    1    300    -1  1 173  75 14840  4 -1 -1 -1
+  644  1094694    793    959    1 865.00    -1    1   7200    -1  1 152  75 14843  3 -1 -1 -1
+  645  1094887 499257  62956   32  62490    -1   32  64800    -1  1 119  76 19031  3 -1 -1 -1
+  646  1098228      6   2306    2   2250    -1    2   3000    -1  1  34   7 14845  3 -1 -1 -1
+  647  1098228      7     24    1     -1    -1    1   7200    -1  1 152  75 14848  3 -1 -1 -1
+  648  1098329      2     30    1   2.00    -1    1   7200    -1  1 152  75 14851  3 -1 -1 -1
+  649  1098383   5838   5288    4   5180    -1    4   6000    -1  1  34   7 14854  3 -1 -1 -1
+  650  1098455   5768   2798    8   2651    -1    8   6000    -1  1  34   7 14857  3 -1 -1 -1
+  651  1098498  12374    106   32  50.66    -1   32   1200    -1  1  34   7 14860  3 -1 -1 -1
+  652  1098510  12471  61020   32  47440    -1   32  64800    -1  5   6   6 13602  3 -1 -1 -1
+  653  1098542  36943    244   32 169.72    -1   32   1200    -1  1  34   7 14865  3 -1 -1 -1
+  654  1098935     11   5111    1   5058    -1    1   7200    -1  1 172  77 14868  4 -1 -1 -1
+  655  1098949      9   5105    1   5052    -1    1   7200    -1  1 172  77 14871  4 -1 -1 -1
+  656  1098957   1588   5104    1   5054    -1    1   7200    -1  1 172  77 14874  4 -1 -1 -1
+  657  1098973   3342   5102    1   5049    -1    1   7200    -1  1 172  77 14877  4 -1 -1 -1
+  658  1098983   3333   5111    1   5055    -1    1   7200    -1  1 172  77 14880  4 -1 -1 -1
+  659  1098995   3321   5108    1   5053    -1    1   7200    -1  1 172  77 14883  4 -1 -1 -1
+  660  1099008   5050   5114    1   5062    -1    1   7200    -1  1 172  77 14886  4 -1 -1 -1
+  661  1099019   5050   5120    1   5063    -1    1   7200    -1  1 172  77 14889  4 -1 -1 -1
+  662  1099028   5196   5124    1   5068    -1    1   7200    -1  1 172  77 14892  4 -1 -1 -1
+  663  1099046   5179   5128    1   5049    -1    1   7200    -1  1 172  77 14895  4 -1 -1 -1
+  664  1099071   5155   5115    1   5071    -1    1   7200    -1  1 172  77 14898  4 -1 -1 -1
+  665  1099080   6578   5111    1   5062    -1    1   7200    -1  1 172  77 14901  4 -1 -1 -1
+  666  1099089  10088   5118    1   5068    -1    1   7200    -1  1 172  77 14904  4 -1 -1 -1
+  667  1099098  10101   5127    1   5077    -1    1   7200    -1  1 172  77 14907  4 -1 -1 -1
+  668  1099107  10242   5118    1   5064    -1    1   7200    -1  1 172  77 14910  4 -1 -1 -1
+  669  1099116  10234   5114    1   5057    -1    1   7200    -1  1 172  77 14913  4 -1 -1 -1
+  670  1099126  10236   5122    1   5070    -1    1   7200    -1  1 172  77 14916  4 -1 -1 -1
+  671  1099132  11698   5114    1   5065    -1    1   7200    -1  1 172  77 14919  4 -1 -1 -1
+  672  1099147  13609   5121    1   5064    -1    1   7200    -1  1 172  77 14922  4 -1 -1 -1
+  673  1099541  14947   5121    1   5071    -1    1   7200    -1  1 172  77 14925  4 -1 -1 -1
+  674  1099868    676   7231    1   4344    -1    1   7200    -1  5 152  75 14928  3 -1 -1 -1
+  675  1100795 103888    120   64  33.22    -1   64   1200    -1  1  34   7 14931  3 -1 -1 -1
+  676  1100835 103977    195   64 102.03    -1   64   1200    -1  1  34   7 14934  3 -1 -1 -1
+  677  1100905  34837    830   32 710.81    -1   32   3000    -1  1  34   7 14937  3 -1 -1 -1
+  678  1100937 104079    514   64 383.36    -1   64   3000    -1  1  34   7 14940  3 -1 -1 -1
+  679  1101366   2853   1269   32 237.25    -1   32  10800    -1  1 150   6 13641  2 -1 -1 -1
+  680  1102277   2315  14716   11  14259    -1   11  36000    -1  1 160  75 14945  3 -1 -1 -1
+  681  1103064 102479   1427   43   1365    -1   43  64800    -1  1  41  30 14948  3 -1 -1 -1
+  682  1103490  12458   5118    1   5067    -1    1   7200    -1  1 172  77 14951  4 -1 -1 -1
+  683  1103502  12905   5120    1   5055    -1    1   7200    -1  1 172  77 14954  4 -1 -1 -1
+  684  1103513  15848   5125    1   5071    -1    1   7200    -1  1 172  77 14957  4 -1 -1 -1
+  685  1103521  15840   5123    1   5067    -1    1   7200    -1  1 172  77 14960  4 -1 -1 -1
+  686  1104260  32321   5021   24   4936    -1   24   7200    -1  1 133  50 14963  3 -1 -1 -1
+  687  1104555  45902  17074   11  16345    -1   11  36000    -1  1 160  75 19035  3 -1 -1 -1
+  688  1105075    421    107    8   0.12    -1    8   3600    -1  5  90  75 19039  3 -1 -1 -1
+  689  1105805    973     -1   -1     -1    -1   16  39000    -1  5  32  75 19043  3 -1 -1 -1
+  690  1106150    473     -1   -1     -1    -1    2   1200    -1  5  42  75 14967  5 -1 -1 -1
+  691  1106173  13189   5120    1   5064    -1    1   7200    -1  1 172  77 14970  4 -1 -1 -1
+  692  1106181   3332   1304   32 236.06    -1   32  10800    -1  1 150   6 13641  2 -1 -1 -1
+  693  1106202  13418   5115    1   5066    -1    1   7200    -1  1 172  77 14975  4 -1 -1 -1
+  694  1106212  13474   5119    1   5064    -1    1   7200    -1  1 172  77 14978  4 -1 -1 -1
+  695  1106221  13680   5117    1   5068    -1    1   7200    -1  1 172  77 14981  4 -1 -1 -1
+  696  1106231  13671   5113    1   5068    -1    1   7200    -1  1 172  77 14984  4 -1 -1 -1
+  697  1106798  34813  39099   16   0.12    -1   16  39000    -1  5  32  75 14987  3 -1 -1 -1
+  698  1108440  13998     33    8   1.25    -1    8   3600    -1  1  90  75 19046  3 -1 -1 -1
+  699  1109426  10477   5118    1   5065    -1    1   7200    -1  1 172  77 14990  4 -1 -1 -1
+  700  1109434  11410   5128    1   5080    -1    1   7200    -1  1 172  77 14993  4 -1 -1 -1
+  701  1109447  11622   5125    1   5077    -1    1   7200    -1  1 172  77 14996  4 -1 -1 -1
+  702  1109454  12075   5115    1   5070    -1    1   7200    -1  1 172  77 14999  4 -1 -1 -1
+  703  1109462  12932   5126    1   5070    -1    1   7200    -1  1 172  77 15002  4 -1 -1 -1
+  704  1109469  13013   5136    1   5081    -1    1   7200    -1  1 172  77 15005  4 -1 -1 -1
+  705  1109478  13005   5134    1   5078    -1    1   7200    -1  1 172  77 15008  4 -1 -1 -1
+  706  1109487  12997   5144    1   5089    -1    1   7200    -1  1 172  77 15011  4 -1 -1 -1
+  707  1109494  12991   5124    1   5069    -1    1   7200    -1  1 172  77 15014  4 -1 -1 -1
+  708  1109504  12982   5120    1   5066    -1    1   7200    -1  1 172  77 15017  4 -1 -1 -1
+  709  1109729   1099     35    4   3.00    -1    4    300    -1  1  94  53 19050  1 -1 -1 -1
+  710  1110822   3759   5315    4   5184    -1    4   6000    -1  1  34   7 15020  3 -1 -1 -1
+  711  1110839   8792   2796    8   2651    -1    8   6000    -1  1  34   7 15023  3 -1 -1 -1
+  712  1110872  16979   1498   16   1360    -1   16   2400    -1  1  34   7 15026  3 -1 -1 -1
+  713  1111960   2506     65    3  33.67    -1    3    900    -1  1 147  73 19053  3 -1 -1 -1
+  714  1113407   1131     35    4   3.75    -1    4    300    -1  1  94  53 19057  1 -1 -1 -1
+  715  1114865     95     -1   -1     -1    -1   16   1200    -1  5  34   7 15029  3 -1 -1 -1
+  716  1115016  15297    106   16  19.94    -1   16   1200    -1  1  34   7 15032  3 -1 -1 -1
+  717  1115045  15386     48   16   6.75    -1   16   1200    -1  1  34   7 15035  3 -1 -1 -1
+  718  1115078  15407    107   16   0.25    -1   16   1200    -1  5  34   7 15038  3 -1 -1 -1
+  719  1115454   3862     39    3   5.00    -1    3    900    -1  1 147  73 15041  3 -1 -1 -1
+  720  1116449   2910    267    8  30.12    -1    8   7200    -1  5 163  75 15044  2 -1 -1 -1
+  721  1116616   1268  35205    1  33808    -1    1  57600    -1  1 153  75 15047  3 -1 -1 -1
+  722  1117443   1872     39    4   3.75    -1    4    300    -1  1  94  53 19060  1 -1 -1 -1
+  723  1118202  23412     38   16   0.56    -1   16  17400    -1  1 166  75 19063  3 -1 -1 -1
+  724  1119623    260     -1   -1     -1    -1    3    900    -1  5 147  73 15050  3 -1 -1 -1
+  725  1119812     88    941    1 903.00    -1    1   7200    -1  1 163  75 15053  2 -1 -1 -1
+  726  1119919   2562     74    3  44.00    -1    3    900    -1  1 147  73 19067  3 -1 -1 -1
+  727  1123041     12     62    3  32.67    -1    3    900    -1  1 147  73 15056  3 -1 -1 -1
+  728  1123760      9     68    3  37.33    -1    3    900    -1  1 147  73 15059  3 -1 -1 -1
+  729  1123940      2     67    3  37.67    -1    3    900    -1  1 147  73 15062  3 -1 -1 -1
+  730  1124295     10     36    3   5.67    -1    3    900    -1  1 147  73 15065  3 -1 -1 -1
+  731  1124656      3     35    3   5.67    -1    3    900    -1  1 147  73 15068  3 -1 -1 -1
+  732  1124719      5     35    3   5.67    -1    3    900    -1  1 147  73 15071  3 -1 -1 -1
+  733  1125120     15  22439    1  22269    -1    1  64800    -1  1 155  75 15074  3 -1 -1 -1
+  734  1125470      6    944    4 906.00    -1    4   3600    -1  1 163  75 15077  2 -1 -1 -1
+  735  1126892      1    947    8 906.25    -1    8   3600    -1  1 163  75 15080  2 -1 -1 -1
+  736  1128678    679    953   16 907.25    -1   16   3600    -1  1 163  75 15083  2 -1 -1 -1
+  737  1129572   7011  58228    1  55065    -1    1  58200    -1  5 153  75 15086  3 -1 -1 -1
+  738  1130669      8     35    3   5.67    -1    3    900    -1  1 147  73 15089  3 -1 -1 -1
+  739  1131469      3    236   16  87.94    -1   16   1800    -1  1 147  73 15092  3 -1 -1 -1
+  740  1131473  14177    267   32 118.88    -1   32   1800    -1  1 147  73 15095  3 -1 -1 -1
+  741  1131477  94230    318   64 141.94    -1   64   2700    -1  1 147  73 15098  3 -1 -1 -1
+  743  1131596    121    165   16  38.69    -1   16   1800    -1  1 147  73 15104  3 -1 -1 -1
+  744  1131601  14326    186   32  49.38    -1   32   1800    -1  1 147  73 15107  3 -1 -1 -1
+  745  1131603  94435    226   64  63.95    -1   64   2700    -1  1 147  73 15110  3 -1 -1 -1
+  747  1131672    216    157   16  32.00    -1   16   1800    -1  1 147  73 15116  3 -1 -1 -1
+  748  1131677  14443    172   32  37.53    -1   32   1800    -1  1 147  73 15119  3 -1 -1 -1
+  749  1131679  94594    220   64  60.11    -1   64   2700    -1  1 147  73 15122  3 -1 -1 -1
+  751  1138102      9     46    6   2.00    -1    6   3600    -1  1 196  83 19071  5 -1 -1 -1
+  752  1138281     11    721    6 675.17    -1    6   3600    -1  1 196  83 19074  5 -1 -1 -1
+  753  1139566     10    712    6 665.50    -1    6   3600    -1  1 196  83 19078  5 -1 -1 -1
+  754  1143733      9    381    6 335.33    -1    6   3600    -1  1 196  83 19082  5 -1 -1 -1
+  755  1146078 448076  64835   32  36619    -1   32  64800    -1  5 163  75 19086  3 -1 -1 -1
+  756  1150460  36420  38818    8  36089    -1    8  64800    -1  1 150   6 13592  4 -1 -1 -1
+  757  1160351      2    323   29  54.76    -1   29   1800    -1  1 147  73 19089  3 -1 -1 -1
+  758  1162115      6     59   32   2.78    -1   32  64800    -1  1 171  75 19093  2 -1 -1 -1
+  759  1162275      5  24025   32  23833    -1   32  64800    -1  1 171  75 19097  2 -1 -1 -1
+  760  1164039   1367     36    2   3.50    -1    2   1800    -1  1 147  73 19101  3 -1 -1 -1
+  761  1165370   6671  14825   11  14336    -1   11  36000    -1  1 160  75 19105  3 -1 -1 -1
+  762  1165714     10  57867    4  57329    -1    4  64800    -1  1 156  75 15129  3 -1 -1 -1
+  763  1165786      2     36    2   3.00    -1    2   1800    -1  1 147  73 19109  3 -1 -1 -1
+  764  1165853     10     37    2   5.00    -1    2   1800    -1  1 147  73 19113  3 -1 -1 -1
+  765  1165981     10     37    2   5.00    -1    2   1800    -1  1 147  73 19117  3 -1 -1 -1
+  766  1166117      2     33    2   3.50    -1    2   1800    -1  1 147  73 19121  3 -1 -1 -1
+  767  1166149      2     37    2   3.00    -1    2   1800    -1  1 147  73 19125  3 -1 -1 -1
+  768  1166426      1     36    3   5.67    -1    3    900    -1  1 147  73 19129  3 -1 -1 -1
+  769  1166504      9     32    4   1.75    -1    4    900    -1  1 147  73 19133  3 -1 -1 -1
+  770  1166555      1     31    4   1.75    -1    4    900    -1  1 147  73 19137  3 -1 -1 -1
+  771  1166608      2     35    3   5.67    -1    3    900    -1  1 147  73 19141  3 -1 -1 -1
+  772  1166700      6     36    3   5.67    -1    3    900    -1  1 147  73 19145  3 -1 -1 -1
+  773  1167488  18823  16789   11  16240    -1   11  36000    -1  1 160  75 19149  3 -1 -1 -1
+  774  1167500     33  16969   11  16450    -1   11  36000    -1  1 160  75 15132  3 -1 -1 -1
+  775  1167922   1242     -1   -1     -1    -1   19  16200    -1  5 133  50 15135  3 -1 -1 -1
+  776  1169142     13   3282   19   3146    -1   19   5400    -1  1 133  50 15138  3 -1 -1 -1
+  777  1169718   2288   1220    1 348.00    -1    1   7200    -1  5 152  75 15141  3 -1 -1 -1
+  778  1169820   1974     -1   -1     -1    -1   19   5400    -1  5 133  50 15144  3 -1 -1 -1
+  779  1171775     58     -1   -1     -1    -1   19   7800    -1  5 133  50 15147  3 -1 -1 -1
+  780  1171819    188     57   18   0.50    -1   18   7800    -1  5 133  50 15150  3 -1 -1 -1
+  781  1171853    155  43828    1  41343    -1    1  43800    -1  5 153  75 19153  3 -1 -1 -1
+  782  1172126    314   4704   32   4580    -1   32   5400    -1  1 133  50 15153  3 -1 -1 -1
+  783  1172505     10     -1   -1     -1    -1   32   5400    -1  5 133  50 15156  3 -1 -1 -1
+  784  1172784      7     35    2   3.50    -1    2   1800    -1  1 147  73 19157  3 -1 -1 -1
+  785  1173250     13     -1    1     -1    -1    1   7200    -1  5 152  75 15159  3 -1 -1 -1
+  786  1173562   1856  37434    1  35810    -1    1  57600    -1  1 153  75 19160  3 -1 -1 -1
+  787  1174112   1305  43830    1  41435    -1    1  43800    -1  5 153  75 19164  3 -1 -1 -1
+  788  1174945    473     33    1     -1    -1    1  17400    -1  1 166  75 19167  3 -1 -1 -1
+  789  1175640     12   4399    1 585.00    -1    1   7200    -1  1 152  75 15162  3 -1 -1 -1
+  790  1175753      5     30    1     -1    -1    1  17400    -1  1 166  75 15165  3 -1 -1 -1
+  791  1175755   5107  45398    8  44956    -1    8  57600    -1  1  90  75 19170  3 -1 -1 -1
+  792  1176135   1015     66    8  28.00    -1    8   3600    -1  1  90  75 19173  3 -1 -1 -1
+  793  1176271      7     33    2   3.50    -1    2   1800    -1  1 147  73 19176  3 -1 -1 -1
+  794  1176492      9     42    2  11.00    -1    2   1800    -1  1 147  73 19179  3 -1 -1 -1
+  795  1176510    641   3693   13   3127    -1   13  14400    -1  1 151  75 19182  3 -1 -1 -1
+  796  1177227   3623     36   28   0.32    -1   28  18000    -1  5 133  50 15168  3 -1 -1 -1
+  797  1177414      2   1728    8   1683    -1    8   3600    -1  1  90  75 19186  3 -1 -1 -1
+  798  1177423      5    186    1 152.00    -1    1  17400    -1  5 166  75 19190  3 -1 -1 -1
+  799  1177776      3   3951   15   3794    -1   15   5400    -1  1 133  50 15171  3 -1 -1 -1
+  800  1177985   1164     29    1     -1    -1    1  17400    -1  1 166  75 15174  3 -1 -1 -1
+  801  1179439      8     28    1     -1    -1    1  17400    -1  1 166  75 15177  3 -1 -1 -1
+  802  1179510   7069  50427    8  49977    -1    8  50400    -1  5  90  75 19194  3 -1 -1 -1
+  803  1179790      7    127    1  96.00    -1    1  17400    -1  5 166  75 15180  3 -1 -1 -1
+  804  1180990   1054     -1   -1     -1    -1   40  10800    -1  5 133  50 15183  3 -1 -1 -1
+  805  1181146   5164    263    8 224.75    -1    8  64800    -1  5 103  50 15186  3 -1 -1 -1
+  806  1181202      6     36    1   5.00    -1    1    300    -1  1 173  75 14840  4 -1 -1 -1
+  807  1181253      9   1166   13 862.15    -1   13  14400    -1  1 151  75 19198  3 -1 -1 -1
+  808  1181527     11     84    1  49.00    -1    1    300    -1  1 173  75 14840  4 -1 -1 -1
+  809  1182022      6  11491   32  11279    -1   32  12600    -1  1 133  50 15193  3 -1 -1 -1
+  810  1184471  22053  35969   11   3196    -1   11  36000    -1  5 160  75 19202  3 -1 -1 -1
+  811  1185179     12     51    8  12.25    -1    8   1200    -1  1  34   7 15196  3 -1 -1 -1
+  812  1185270      6    117   16  20.19    -1   16   1200    -1  1  34   7 15199  3 -1 -1 -1
+  813  1185311      9     51    4  19.00    -1    4   1200    -1  1  34   7 15202  3 -1 -1 -1
+  814  1185396     10     69    8  30.75    -1    8   1200    -1  1  34   7 15205  3 -1 -1 -1
+  815  1185442      7     90    4  57.00    -1    4   1200    -1  1  34   7 15208  3 -1 -1 -1
+  816  1185595      3    184    2  36.50    -1    2   1200    -1  1  34   7 15211  3 -1 -1 -1
+  817  1185624      7     36    2   4.50    -1    2   1200    -1  1  34   7 15214  3 -1 -1 -1
+  818  1185649      4     49    4  19.00    -1    4   1200    -1  1  34   7 15217  3 -1 -1 -1
+  819  1185656      8    324    1 275.00    -1    1    900    -1  1 159  75 15220  1 -1 -1 -1
+  820  1185669      7     46    8  12.12    -1    8   1200    -1  1  34   7 15223  3 -1 -1 -1
+  821  1185703     27     61   16   7.31    -1   16   1200    -1  1  34   7 15226  3 -1 -1 -1
+  822  1185724     71    120   16  20.62    -1   16   1200    -1  1  34   7 15229  3 -1 -1 -1
+  823  1185752    173     66    8  29.62    -1    8   1200    -1  1  34   7 15232  3 -1 -1 -1
+  824  1185807    507     65   32   5.22    -1   32   1200    -1  1  34   7 15235  3 -1 -1 -1
+  825  1185907    588    111   32  13.31    -1   32   1200    -1  1  34   7 15238  3 -1 -1 -1
+  826  1185915      9     35    4   2.50    -1    4    480    -1  1  27   7 15241  2 -1 -1 -1
+  827  1185942    669    317   32  67.16    -1   32   1200    -1  1  34   7 15244  3 -1 -1 -1
+  828  1186005      6    106    8  70.88    -1    8   3600    -1  1 159  75 15247  1 -1 -1 -1
+  829  1186331     57     98    8  64.88    -1    8   3600    -1  1 159  75 15250  1 -1 -1 -1
+  830  1186331      3     90    4  56.75    -1    4   1200    -1  1  34   7 15253  3 -1 -1 -1
+  831  1186496     11   1237    2 592.00    -1    2   1200    -1  5  34   7 15256  3 -1 -1 -1
+  832  1186515      4    159    2  35.50    -1    2   1200    -1  1  34   7 15259  3 -1 -1 -1
+  833  1186587  17822     97   64   4.12    -1   64   1200    -1  1  34   7 15262  2 -1 -1 -1
+  834  1186676  17840    157   64  10.30    -1   64   1200    -1  1  34   7 15265  2 -1 -1 -1
+  835  1186835  64880  14888   11  14312    -1   11  36000    -1  1 160  75 19206  3 -1 -1 -1
+  836  1186845     33    132    4  94.25    -1    4    900    -1  1 159  75 15268  1 -1 -1 -1
+  837  1186863     16    191    2 150.00    -1    2    900    -1  1 159  75 15271  1 -1 -1 -1
+  838  1186890     44    830   32 711.56    -1   32   1200    -1  1  34   7 15274  3 -1 -1 -1
+  839  1186907   4182  12328   13  10840    -1   13  14400    -1  1 151  75 19210  3 -1 -1 -1
+  840  1186910    862    245   32 170.38    -1   32   1200    -1  1  34   7 15277  3 -1 -1 -1
+  841  1186932   1096    106   32  50.56    -1   32   1200    -1  1  34   7 15280  3 -1 -1 -1
+  842  1187244     10   1285    4   1227    -1    4   2400    -1  1  34   7 15283  3 -1 -1 -1
+  843  1187474      4    181    2 147.50    -1    2    900    -1  1 159  75 15286  1 -1 -1 -1
+  844  1187676  64035  64838   32  44627    -1   32  64800    -1  5   6   6 13602  3 -1 -1 -1
+  845  1188120      5    264    4 217.00    -1    4    900    -1  1 159  75 15291  1 -1 -1 -1
+  846  1188330     10     37    4   2.25    -1    4    480    -1  1  27   7 15294  2 -1 -1 -1
+  847  1188345      6    643    1 550.00    -1    1    900    -1  1 159  75 15297  1 -1 -1 -1
+  848  1188536      7    734    8 695.75    -1    8   2400    -1  1 103  50 15300  3 -1 -1 -1
+  849  1188633      7   1371   23   1322    -1   23   3600    -1  1  41  30 19214  3 -1 -1 -1
+  850  1188820      2    384    2 338.50    -1    2    900    -1  1 159  75 15303  1 -1 -1 -1
+  851  1188930     10   5747    1   5467    -1    1  17400    -1  5 166  75 19218  3 -1 -1 -1
+  852  1189261      8    201    8 162.50    -1    8   3600    -1  1 159  75 15306  1 -1 -1 -1
+  853  1189491      2  61229    7  58519    -1    7  61200    -1  5 173  75 15698  4 -1 -1 -1
+  854  1189678    146     30    4   0.25    -1    4  64500    -1  1 162  75 19225  4 -1 -1 -1
+  855  1189816      7     31    5   0.20    -1    5  64800    -1  5 162  75 19229  1 -1 -1 -1
+  856  1190004      2    106    8   0.12    -1    8   1800    -1  5 103  50 15309  3 -1 -1 -1
+  857  1190223     11   1748    8   1668    -1    8   1800    -1  5 103  50 15312  3 -1 -1 -1
+  858  1191082      6     32    5   0.40    -1    5  64800    -1  1 162  75 19232  1 -1 -1 -1
+  859  1191981      6    196    8 158.88    -1    8   3600    -1  1 159  75 15315  1 -1 -1 -1
+  860  1192027      3   1317    8   1273    -1    8   1800    -1  1 103  50 15318  3 -1 -1 -1
+  861  1192823    707   4391   24   4301    -1   24   7200    -1  1 133  50 15321  3 -1 -1 -1
+  862  1193306     10     32    2   2.00    -1    2    300    -1  1 158  73 15324  3 -1 -1 -1
+  863  1193857     14     47    3   5.67    -1    3    900    -1  1 158  73 15327  3 -1 -1 -1
+  864  1194390   3535     47   32   2.62    -1   32    300    -1  1 158  73 15330  3 -1 -1 -1
+  865  1194457      7    249    8 163.88    -1    8   3600    -1  1 159  75 15333  1 -1 -1 -1
+  866  1194732    857    615    4 576.00    -1    4  17400    -1  1 166  75 15336  3 -1 -1 -1
+  867  1194826      9    242    8 164.62    -1    8   3600    -1  1 159  75 15338  1 -1 -1 -1
+  868  1194883   3097     64   32   5.25    -1   32   1200    -1  1  34   7 15341  3 -1 -1 -1
+  869  1194902   3149    104   32  13.12    -1   32   1200    -1  1  34   7 15344  3 -1 -1 -1
+  870  1194922   3249    307   32  66.75    -1   32   1200    -1  1  34   7 15347  3 -1 -1 -1
+  871  1195007  31495    382   64  43.06    -1   64   1200    -1  1  34   7 15350  3 -1 -1 -1
+  872  1195166     11    383    2 338.00    -1    2    900    -1  1 159  75 15353  1 -1 -1 -1
+  873  1195519     10    604    4 341.00    -1    4   1200    -1  1  34   7 15356  3 -1 -1 -1
+  874  1195574      4     37    4   4.75    -1    4   1200    -1  5  34   7 15359  3 -1 -1 -1
+  875  1195605      6    106    4     -1    -1    4   1200    -1  5  34   7 15362  3 -1 -1 -1
+  876  1195628      5    107    4     -1    -1    4   1200    -1  5  34   7 15365  3 -1 -1 -1
+  877  1195647      9    588    9 178.78    -1    9   1200    -1  1  34   7 15368  3 -1 -1 -1
+  878  1195663     78   1114    9 631.11    -1    9   1200    -1  1  34   7 15371  3 -1 -1 -1
+  879  1195776    360    583    4 338.75    -1    4   1200    -1  1  34   7 15374  3 -1 -1 -1
+  880  1195963   7142  58399    8  57910    -1    8  64800    -1  1 103  50 15377  3 -1 -1 -1
+  881  1198020   1053     -1   -1     -1    -1   19   7800    -1  5 133  50 15380  3 -1 -1 -1
+  882  1198783      5  60364    1  57562    -1    1  61800    -1  1 153  75 15383  3 -1 -1 -1
+  883  1199058      8   4242   48   4135    -1   48   4200    -1  5 133  50 15386  3 -1 -1 -1
+  884  1199079   4241    107    9   0.22    -1    9   1200    -1  5  34   7 15389  3 -1 -1 -1
+  885  1199111   4210    597    9 179.00    -1    9   1200    -1  1  34   7 15392  3 -1 -1 -1
+  886  1199153   4169   1082    9 631.33    -1    9   1200    -1  1  34   7 15395  3 -1 -1 -1
+  887  1199180   4143    592   16 118.38    -1   16   1200    -1  1  34   7 15398  3 -1 -1 -1
+  888  1199212   6334    854   16 380.81    -1   16   1200    -1  1  34   7 15401  3 -1 -1 -1
+  889  1199236   7168    108   16   0.25    -1   16   1200    -1  5  34   7 15404  3 -1 -1 -1
+  890  1199434     75     -1   -1     -1    -1   43   1800    -1  5  41  30 19236  3 -1 -1 -1
+  891  1199475   3631    617    4 574.50    -1    4  17400    -1  1 166  75 19240  3 -1 -1 -1
+  892  1201360   5621  13696   32  13503    -1   32  14400    -1  1 133  50 15407  3 -1 -1 -1
+  893  1203069   3453  17028   11  16258    -1   11  36000    -1  1 160  75 15410  3 -1 -1 -1
+  894  1206743  44971  64834   13  62621    -1   13  64800    -1  5 151  75 15413  3 -1 -1 -1
+  895  1214335      4    108    2     -1    -1    2   3300    -1  5 162  75 19244  4 -1 -1 -1
+  896  1214516      4     31    4   0.25    -1    4  64500    -1  1 162  75 19247  4 -1 -1 -1
+  897  1214542     16    105    2     -1    -1    2   3300    -1  5 162  75 19251  4 -1 -1 -1
+  898  1214627      6    106    2     -1    -1    2   3300    -1  5 162  75 19255  4 -1 -1 -1
+  899  1214896      3    105    2     -1    -1    2   3300    -1  5 162  75 19258  4 -1 -1 -1
+  900  1215091     11    104    2     -1    -1    2   3300    -1  5 162  75 19262  4 -1 -1 -1
+  901  1215306      8    104    2     -1    -1    2    300    -1  5 162  75 19265  4 -1 -1 -1
+  902  1215560      9    104    2     -1    -1    2    300    -1  5 162  75 19268  4 -1 -1 -1
+  903  1215652      2    105    2     -1    -1    2    300    -1  5 162  75 19272  4 -1 -1 -1
+  904  1216062      6  34315    4  32818    -1    4  64500    -1  1 162  75 19275  4 -1 -1 -1
+  905  1217705      5     35    2   3.50    -1    2    300    -1  1 158  73 15416  3 -1 -1 -1
+  906  1218193      5     33    2   3.50    -1    2   1800    -1  1 147  73 15419  3 -1 -1 -1
+  907  1218233      9     32    2   3.50    -1    2   1800    -1  1 147  73 15422  3 -1 -1 -1
+  908  1218280      5     41    2  11.00    -1    2   1800    -1  1 147  73 15425  3 -1 -1 -1
+  909  1218395      7     32    2   2.50    -1    2   1800    -1  1 147  73 15428  3 -1 -1 -1
+  910  1223518  28198  16934   11  16244    -1   11  36000    -1  1 160  75 19279  3 -1 -1 -1
+  911  1236581  45682  39585    8  37262    -1    8  64800    -1  5 150   6 13592  4 -1 -1 -1
+  912  1241761      4    227   64  64.67    -1   64   2700    -1  1 147  73 15433  3 -1 -1 -1
+  913  1241767    233    191   64  34.14    -1   64   2700    -1  1 147  73 15436  3 -1 -1 -1
+  914  1241773    426    188   64  34.64    -1   64   2700    -1  1 147  73 15439  3 -1 -1 -1
+  915  1241779    618    191   64  33.89    -1   64   2700    -1  1 147  73 15442  3 -1 -1 -1
+  916  1241786    810    190   64  31.97    -1   64   2700    -1  1 147  73 15445  3 -1 -1 -1
+  917  1241792   1008    198   64  43.17    -1   64   2700    -1  1 147  73 15448  3 -1 -1 -1
+  918  1241799   1209    216   64  54.19    -1   64   2700    -1  1 147  73 15450  3 -1 -1 -1
+  919  1242333    899    211   64  45.41    -1   64   2700    -1  1 147  73 15453  3 -1 -1 -1
+  921  1244297      9    208   16  75.88    -1   16   1800    -1  1 147  73 19282  3 -1 -1 -1
+  922  1244309      9    207   32  68.91    -1   32   1800    -1  1 147  73 19285  3 -1 -1 -1
+  923  1249490      8  45633    1  43894    -1    1  57600    -1  1 153  75 15458  3 -1 -1 -1
+  924  1250024      3  18787    1  17642    -1    1  43800    -1  1 153  75 15461  3 -1 -1 -1
+  925  1250313     75  46380    1  43824    -1    1  47400    -1  1 153  75 15464  3 -1 -1 -1
+  926  1253016     12    246   32 102.12    -1   32   1800    -1  1 147  73 19288  3 -1 -1 -1
+  927  1253601      8    242   32 101.72    -1   32   1800    -1  1 147  73 19291  3 -1 -1 -1
+  928  1254296      2    182   32  10.41    -1   32   1800    -1  5 147  73 19294  3 -1 -1 -1
+  929  1254443     42    359   32  82.28    -1   32   1800    -1  1 147  73 19298  3 -1 -1 -1
+  930  1260740      3    218   16  77.94    -1   16   1800    -1  1 147  73 15467  3 -1 -1 -1
+  931  1264171     11  50429    8  50029    -1    8  50400    -1  5  90  75 19302  3 -1 -1 -1
+  932  1266572     10  14848   11  14351    -1   11  36000    -1  1 160  75 15469  3 -1 -1 -1
+  933  1266906      5   3628    8   3565    -1    8   3600    -1  5  90  75 19306  3 -1 -1 -1
+  934  1267827      4   3629    8   3564    -1    8   3600    -1  5  90  75 19310  3 -1 -1 -1
+  935  1268619      6  16775   11  16218    -1   11  36000    -1  1 160  75 19314  3 -1 -1 -1
+  936  1273325     12   4207   32   4108    -1   32   7200    -1  1 133  50 15472  3 -1 -1 -1
+  937  1275715   1838   5903   32   5794    -1   32   7200    -1  1 133  50 15475  3 -1 -1 -1
+  938  1276632   5588  58122    4  57664    -1    4  64800    -1  1 156  75 15478  3 -1 -1 -1
+  939  1281337   9149     -1   -1     -1    -1   43   1800    -1  5  41  30 19317  3 -1 -1 -1
+  940  1282082  14464  63458    4  60424    -1    4  64500    -1  1 162  75 15481  4 -1 -1 -1
+  941  1282217      2     37   10   0.30    -1   10  64800    -1  5 162  75 15483  2 -1 -1 -1
+  942  1282336      2     76    1  43.00    -1    1  64800    -1  5 162  75 15486  2 -1 -1 -1
+  943  1283598      4  13721   32  13512    -1   32  14400    -1  1 133  50 15489  3 -1 -1 -1
+  944  1287837     21     -1   -1     -1    -1   32   7200    -1  5 133  50 15492  3 -1 -1 -1
+  945  1290496   6879     47   43   0.40    -1   43   1800    -1  1  41  30 19320  3 -1 -1 -1
+  946  1296537      9     37   10   0.30    -1   10  64800    -1  5 162  75 15495  2 -1 -1 -1
+  947  1296811     10     30   13   0.23    -1   13   1800    -1  5  41  30 15498  2 -1 -1 -1
+  948  1296851      3     33   13   0.38    -1   13   1800    -1  1  41  30 15501  3 -1 -1 -1
+  949  1297320     10     33   13   0.38    -1   13   1800    -1  1  41  30 15504  3 -1 -1 -1
+  950  1298037      3   5715   32   5630    -1   32   7200    -1  1 133  50 15507  3 -1 -1 -1
+  951  1301045      5    608   11 281.55    -1   11  36000    -1  1 160  75 15510  3 -1 -1 -1
+  952  1301197  20665  16101    4  15974    -1    4  64800    -1  1 155  75 15513  3 -1 -1 -1
+  953  1301626     38  16721   11  16209    -1   11  36000    -1  1 160  75 19323  3 -1 -1 -1
+  954  1304453 922561     -1   -1     -1    -1   63  43200    -1  5 131  20 19326  4 -1 -1 -1
+  955  1316948   5188  61227    8  60763    -1    8  61200    -1  5 103  50 15516  3 -1 -1 -1
+  956  1318354   3783  16788   11  16230    -1   11  36000    -1  1 160  75 15519  3 -1 -1 -1
+  957  1322044     94   5310    8   4956    -1    8  64800    -1  5 150   6 13592  3 -1 -1 -1
+  958  1328141      2  35961    8  34382    -1    8  64800    -1  1 150   6 13592  3 -1 -1 -1
+  959  1335593 434909     -1   -1     -1    -1   32  64800    -1  5   6   6 13602  3 -1 -1 -1
+  960  1338894      3  16745   11  16210    -1   11  36000    -1  1 160  75 15526  3 -1 -1 -1
+  961  1343751     11    221    1   6.00    -1    1  43800    -1  1 153  75 15529  3 -1 -1 -1
+  962  1343972      2  47429    1  45193    -1    1  47400    -1  5 153  75 15532  3 -1 -1 -1
+  963  1344047     12  50416    1  47847    -1    1  61800    -1  1 153  75 15535  3 -1 -1 -1
+  964  1348333      2    189   16  49.50    -1   16   1800    -1  1 147  73 15538  3 -1 -1 -1
+  965  1348337  11670    228   32  82.28    -1   32   1800    -1  1 147  73 15541  3 -1 -1 -1
+  966  1348342  38685    259   64 100.75    -1   64   2700    -1  1 147  73 15544  3 -1 -1 -1
+  968  1355611   4633  16764   11  16227    -1   11  36000    -1  1 160  75 15550  3 -1 -1 -1
+  969  1357094      6     52    2  22.00    -1    2    900    -1  1 177  73 15553  3 -1 -1 -1
+  970  1357255      4     44    2  13.50    -1    2    900    -1  1 177  73 15556  3 -1 -1 -1
+  971  1357313     11     51    2  22.00    -1    2    900    -1  1 177  73 15559  3 -1 -1 -1
+  972  1358513      4     52    2  21.50    -1    2    900    -1  1 177  73 15562  3 -1 -1 -1
+  973  1359991      5     51    2  22.00    -1    2    900    -1  1 147  73 19333  3 -1 -1 -1
+  974  1360119      6     43    2  13.50    -1    2    900    -1  1 147  73 19337  3 -1 -1 -1
+  975  1360215     35  60629    4  57910    -1    4  64500    -1  1 162  75 19341  4 -1 -1 -1
+  976  1360286     18     -1   -1     -1    -1   50   1200    -1  5 162  75 19345  2 -1 -1 -1
+  977  1364782      4  57881    4  57430    -1    4  64800    -1  1 156  75 15565  3 -1 -1 -1
+  979  1370752      9   1289    2   1245    -1    2  14400    -1  1 161  75 15568  3 -1 -1 -1
+  980  1371174     11  62597   13  61157    -1   13  64800    -1  1 151  75 19353  3 -1 -1 -1
+  981  1372308      7     33    8   0.50    -1    8  36000    -1  5 161  75 19357  3 -1 -1 -1
+  982  1372419      8   9622    8   9243    -1    8  36000    -1  1 161  75 15568  3 -1 -1 -1
+  983  1374009      6    261    2 194.00    -1    2    600    -1  5  15  75 15571  3 -1 -1 -1
+  984  1374334      9    287    1 254.00    -1    1    600    -1  5  15  75 15574  3 -1 -1 -1
+  985  1374823      7     53    1  24.00    -1    1    600    -1  1  15  75 15577  3 -1 -1 -1
+  986  1375515      2     53    1  24.00    -1    1    600    -1  1  15  75 15580  3 -1 -1 -1
+  987  1376235     11    312    1 279.00    -1    1    600    -1  5  15  75 15583  3 -1 -1 -1
+  988  1376971      5     70    1  41.00    -1    1    600    -1  1  15  75 15586  3 -1 -1 -1
+  989  1377968      2     57    1  24.00    -1    1    600    -1  1  15  75 15589  3 -1 -1 -1
+  990  1378580      3     54    1  24.00    -1    1    600    -1  1  15  75 15592  3 -1 -1 -1
+  991  1379286      5     56    1  26.00    -1    1    600    -1  1  15  75 15595  3 -1 -1 -1
+  992  1381058      8     56    1  26.00    -1    1    600    -1  1  15  75 15598  3 -1 -1 -1
+  993  1381200      4    290    1 259.00    -1    1    600    -1  1  15  75 15601  3 -1 -1 -1
+  994  1391005   7246  46540    8  46182    -1    8  64800    -1  1 103  50 15604  3 -1 -1 -1
+  995  1395272      5   1753    2   1689    -1    2  14400    -1  1 161  75 19364  3 -1 -1 -1
+  996  1398233      6     32    6   0.33    -1    6   3600    -1  5 196  83 19367  5 -1 -1 -1
+  997  1398371      7   1459    6   1408    -1    6   3600    -1  1 196  83 19370  5 -1 -1 -1
+  998  1400018      7    458    6 412.67    -1    6   3600    -1  1 196  83 19374  5 -1 -1 -1
+  999  1400760      5    542    6 497.50    -1    6   3600    -1  1 196  83 19378  5 -1 -1 -1
+ 1000  1402264      1     64   12   2.25    -1   12   3600    -1  1 196  83 19382  5 -1 -1 -1
Index: DCWoRMS/trunk/example/tomekp/experiment1/tomExp.xml
===================================================================
--- DCWoRMS/trunk/example/tomekp/experiment1/tomExp.xml	(revision 477)
+++ DCWoRMS/trunk/example/tomekp/experiment1/tomExp.xml	(revision 477)
@@ -0,0 +1,381 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<environment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+	xsi:noNamespaceSchemaLocation="../XSSimResSchema.xsd">
+	
+	<!-- Opis dla data center z uwzglednieniem aspektow energetycznych -->
+	<resources>
+		<computingResource class="DataCenter" name="compRes1">
+								<resourceUnit class="krasnoludek">
+						<amount>7</amount>
+				</resourceUnit>
+		<computingResource class="Rack">
+						<resourceUnit class="storage">
+						<amount>1000000</amount>
+				</resourceUnit>
+			<computingResource class="ComputingNode" count="2">
+				<resourceUnit class="memory">
+						<amount>12288</amount>
+				</resourceUnit>
+				<parameter name="category">
+						<value>A</value>
+				</parameter>
+				<profile>
+					<powerProfile>
+						<energyEstimationPlugin>
+							<name>example.energy.ComputingNodeEnergyEstimationPlugin</name>
+						</energyEstimationPlugin>	
+						<powerStates>
+							<powerState>
+								<name>ON</name>
+								<powerUsage>750</powerUsage>
+							</powerState>
+							<powerState>
+								<name>OFF</name>
+								<powerUsage>0</powerUsage>
+							</powerState>
+						</powerStates>				
+					</powerProfile>
+				</profile>
+
+				<computingResource class="Processor" count="4">
+					<parameter name="speed">
+						<value>1</value>
+					</parameter>
+					<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">3000</value>
+								</property>		
+								<property name="voltage">
+									<value unit="V">0</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`">2660</value>
+								</property>		
+								<property name="voltage">
+									<value unit="V">0</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`">2330</value>
+								</property>		
+								<property name="voltage">
+									<value unit="V">0</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`">2000</value>
+								</property>		
+								<property name="voltage">
+									<value unit="V">0</value>
+								</property>
+								<property name="powerUsage">
+									<value unit="W">330</value>
+								</property>						
+							</parameter>								
+						</powerProfile>
+					</profile>
+				</computingResource>
+			</computingResource>	
+			<computingResource class="ComputingNode" count="2">
+				<resourceUnit class="memory">
+						<amount>12288</amount>
+				</resourceUnit>
+				<parameter name="category">
+					<value>B</value>
+				</parameter>
+				<profile>
+					<powerProfile>
+						<energyEstimationPlugin>
+							<name>example.energy.ComputingNodeEnergyEstimationPlugin</name>
+						</energyEstimationPlugin>	
+						<powerStates>
+							<powerState>
+								<name>ON</name>
+								<powerUsage>750</powerUsage>
+							</powerState>
+							<powerState>
+								<name>OFF</name>
+								<powerUsage>0</powerUsage>
+							</powerState>
+						</powerStates>				
+					</powerProfile>
+				</profile>
+
+				<computingResource class="Processor" count="4">
+					<parameter name="speed">
+						<value>1</value>
+					</parameter>
+					<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">3000</value>
+								</property>		
+								<property name="voltage">
+									<value unit="V">0</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`">2660</value>
+								</property>		
+								<property name="voltage">
+									<value unit="V">0</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`">2330</value>
+								</property>		
+								<property name="voltage">
+									<value unit="V">0</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`">2000</value>
+								</property>		
+								<property name="voltage">
+									<value unit="V">0</value>
+								</property>
+								<property name="powerUsage">
+									<value unit="W">330</value>
+								</property>						
+							</parameter>								
+						</powerProfile>
+					</profile>
+				</computingResource>
+			</computingResource>	
+			<computingResource class="ComputingNode" count="2">
+				<resourceUnit class="memory">
+					<amount>12288</amount>
+				</resourceUnit>
+				<parameter name="category">
+					<value>C</value>
+				</parameter>
+				<profile>
+					<powerProfile>
+						<energyEstimationPlugin>
+							<name>example.energy.ComputingNodeEnergyEstimationPlugin</name>
+						</energyEstimationPlugin>	
+						<powerStates>
+							<powerState>
+								<name>ON</name>
+								<powerUsage>750</powerUsage>
+							</powerState>
+							<powerState>
+								<name>OFF</name>
+								<powerUsage>0</powerUsage>
+							</powerState>
+						</powerStates>				
+					</powerProfile>
+				</profile>
+
+				<computingResource class="Processor" count="4">
+					<parameter name="speed">
+						<value>1</value>
+					</parameter>
+					<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">3000</value>
+								</property>		
+								<property name="voltage">
+									<value unit="V">0</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`">2660</value>
+								</property>		
+								<property name="voltage">
+									<value unit="V">0</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`">2330</value>
+								</property>		
+								<property name="voltage">
+									<value unit="V">0</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`">2000</value>
+								</property>		
+								<property name="voltage">
+									<value unit="V">0</value>
+								</property>
+								<property name="powerUsage">
+									<value unit="W">330</value>
+								</property>						
+							</parameter>								
+						</powerProfile>
+					</profile>
+				</computingResource>
+			</computingResource>	
+			</computingResource>
+		</computingResource>
+		<scheduler class="Cluster" name="cluster1">
+			<schedulingPlugin>
+				<name>example.localplugin.FCFSRandomClusterLocalPlugin</name>
+				<!--  
+				<frequency>3600</frequency>
+				-->
+			</schedulingPlugin>		
+				<managedComputingResources include="false">
+					<resourceName>Rack_0</resourceName>
+				</managedComputingResources>
+		</scheduler>	
+	</resources>
+	
+	<!--  
+	<templates>
+		<computingResourceTemplate class="Processor" name="modelProcessorA">
+			<profile>
+				<powerProfile>
+					<energyEstimationPlugin>
+						<name>CPUEnergyEstimationPlugin</name>
+					</energyEstimationPlugin>
+					<parameter name="pState">
+						<property name="name">
+							<value>P0</value>
+						</property>	
+						<property name="frequency">
+							<value unit="Hz">3000</value>
+						</property>		
+						<property name="voltage">
+							<value unit="V">0</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`">2660</value>
+						</property>		
+						<property name="voltage">
+							<value unit="V">0</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`">2330</value>
+						</property>		
+						<property name="voltage">
+							<value unit="V">0</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`">2000</value>
+						</property>		
+						<property name="voltage">
+							<value unit="V">0</value>
+						</property>
+						<property name="powerUsage">
+							<value unit="W">330</value>
+						</property>						
+					</parameter>							
+				</powerProfile>
+			</profile>
+		</computingResourceTemplate>
+	</templates>
+	-->
+</environment>
Index: DCWoRMS/trunk/example/tomekp/experiment1/PerfTest.java
===================================================================
--- DCWoRMS/trunk/example/tomekp/experiment1/PerfTest.java	(revision 477)
+++ DCWoRMS/trunk/example/tomekp/experiment1/PerfTest.java	(revision 477)
@@ -0,0 +1,93 @@
+package tomekp.experiment1;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+import org.apache.commons.lang.ArrayUtils;
+
+public class PerfTest {
+
+	/**
+	 * @param args
+	 */
+	public static void main(String[] args) {
+		// TODO Auto-generated method stub
+
+		List<String> list1 = null;
+		List<String> list2 = new ArrayList<String>();
+		list2.addAll(list1);
+		long sm1 = System.currentTimeMillis();
+		for(int i =0;i < 10000000;i++){
+			HashMap hm = new HashMap(1);
+			hm.put(1, 1);
+		}
+		long em1  = System.currentTimeMillis();
+		System.out.println("map1:" + (em1 -sm1 ));
+		
+		long sm2 = System.currentTimeMillis();
+		for(int i =0;i < 10000000;i++){
+			HashMap hm = new HashMap(2);
+			hm.put(1, 1);
+		}
+		long em2  = System.currentTimeMillis();
+		System.out.println("map1:" + (em2 -sm2 ));
+		
+		int boundary = 1000;
+		System.out.println("a");
+		List<String> list = new ArrayList<String>();
+		for(int i = 0;i < boundary;i++){
+			list.add("a"+i);
+		}
+		
+		/*System.out.println("b");
+		String longString = new String();
+		for(int i = 0;i < boundary ;i++){
+			longString = longString.concat("a"+i+"_");
+		}*/
+		
+		System.out.println("c");
+		
+		long s = System.currentTimeMillis();
+		String[] array = list.toArray(new String[list.size()]);
+		long e = System.currentTimeMillis();
+		System.out.println("transform: " + (e-s));
+		
+		long s1 = System.currentTimeMillis();
+		for(int i = 0;i < boundary ;i++){
+			if(list.contains("a"+i)){
+				//System.out.println("ok1");
+			}
+		}
+		long e1 = System.currentTimeMillis();
+		System.out.println("list: " + (e1-s1));
+
+		/*long s2 = System.currentTimeMillis();
+		for(int i = 0;i < boundary; i++){
+			if(longString.contains("a"+i)){
+				//System.out.println("ok2");
+			}
+		}
+		long e2 = System.currentTimeMillis();
+		System.out.println("string:" + (e2-s2));
+		*/
+		
+		long s3 = System.currentTimeMillis();
+		for(int i = 0;i < boundary; i++){
+			if(array[i].equals("a"+i)){
+				//System.out.println("ok3");
+				//System.out.println(array[i]);
+			}
+		}
+		long e3 = System.currentTimeMillis();
+		System.out.println("array:" + (e3-s3));
+		
+		
+		long s5 = System.currentTimeMillis();
+		ArrayUtils.contains(list.toArray(new String[list.size()]), new String("a"+1000));
+		long e5 = System.currentTimeMillis();
+		System.out.println("array:" + (e5-s5));
+	}
+
+}
+
Index: DCWoRMS/trunk/example/tomekp/experiment1/experiment1.properties
===================================================================
--- DCWoRMS/trunk/example/tomekp/experiment1/experiment1.properties	(revision 477)
+++ DCWoRMS/trunk/example/tomekp/experiment1/experiment1.properties	(revision 477)
@@ -0,0 +1,32 @@
+# Use single *.swf file as workload description.
+# Computing environment consists of two computing resources.
+# Plugin implementation and resources does not support reservation scheduling model.
+
+# Grid plugin implements simple round robin algorithm
+gridschedulingpluginname=example.gridplugin.GridFCFSRoundRobinPlugin
+
+# Local plugin starts task execution in FCFS order
+localallocpolicypluginname=example.localplugin.FCFSRandomClusterLocalPlugin
+
+# Linear model of cpu processing power is used for task execution time estimations. 
+exectimeestimationpluginname=example.timeestimation.ExecTimeEstimationPlugin
+
+# Path to xml file which describes resource characteristics.
+resdesc=example/workload/HostParameters.xml
+
+
+#readscenario.inputfolder=example/tomekp/experiment1/
+# and swf file, which name is declared by readscenario.workloadfilename parameter.
+# Swf file must be placed in readscenario.inputfolder directory.  
+readscenario.workloadfilename=example/tomekp/experiment1/workload.swf
+
+# Choose if files with task processing history should be created.  
+printhistory=true
+
+# Choose directory where all result files should be placed.
+stats.outputfolder=../experiment1_result
+
+envdesc=example/tomekp/experiment1/ResourceDescription.properties
+
+creatediagrams.processors=true
+creatediagrams.taskswaitingtime=false
Index: DCWoRMS/trunk/example/tomekp/experiment1/tomExp2.xml
===================================================================
--- DCWoRMS/trunk/example/tomekp/experiment1/tomExp2.xml	(revision 477)
+++ DCWoRMS/trunk/example/tomekp/experiment1/tomExp2.xml	(revision 477)
@@ -0,0 +1,380 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<environment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+	xsi:noNamespaceSchemaLocation="../XSSimResSchema.xsd">
+	
+	<!-- Opis dla data center z uwzglednieniem aspektow energetycznych -->
+	<resources>
+		<computingResource class="DataCenter" name="compRes1">
+		<computingResource class="Rack" name="rack1">
+			<computingResource class="ComputingNode" count="2">
+				<resourceUnit class="memory">
+						<amount>12288</amount>
+				</resourceUnit>
+				<parameter name="category">
+						<value>A</value>
+				</parameter>
+				<profile>
+					<powerProfile>
+						<energyEstimationPlugin>
+							<name>example.energy.ComputingNodeEnergyEstimationPlugin</name>
+						</energyEstimationPlugin>	
+						<powerStates>
+							<powerState>
+								<name>ON</name>
+								<powerUsage>750</powerUsage>
+							</powerState>
+							<powerState>
+								<name>OFF</name>
+								<powerUsage>0</powerUsage>
+							</powerState>
+						</powerStates>				
+					</powerProfile>
+				</profile>
+
+				<computingResource class="Processor" count="4">
+					<parameter name="speed">
+						<value>1</value>
+					</parameter>
+					<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">3000</value>
+								</property>		
+								<property name="voltage">
+									<value unit="V">0</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`">2660</value>
+								</property>		
+								<property name="voltage">
+									<value unit="V">0</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`">2330</value>
+								</property>		
+								<property name="voltage">
+									<value unit="V">0</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`">2000</value>
+								</property>		
+								<property name="voltage">
+									<value unit="V">0</value>
+								</property>
+								<property name="powerUsage">
+									<value unit="W">330</value>
+								</property>						
+							</parameter>								
+						</powerProfile>
+					</profile>
+				</computingResource>
+			</computingResource>	
+			<computingResource class="ComputingNode" count="2">
+				<resourceUnit class="memory">
+						<amount>12288</amount>
+				</resourceUnit>
+				<parameter name="category">
+					<value>B</value>
+				</parameter>
+				<profile>
+					<powerProfile>
+						<energyEstimationPlugin>
+							<name>example.energy.ComputingNodeEnergyEstimationPlugin</name>
+						</energyEstimationPlugin>	
+						<powerStates>
+							<powerState>
+								<name>ON</name>
+								<powerUsage>750</powerUsage>
+							</powerState>
+							<powerState>
+								<name>OFF</name>
+								<powerUsage>0</powerUsage>
+							</powerState>
+						</powerStates>				
+					</powerProfile>
+				</profile>
+
+				<computingResource class="Processor" count="4">
+					<parameter name="speed">
+						<value>1</value>
+					</parameter>
+					<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">3000</value>
+								</property>		
+								<property name="voltage">
+									<value unit="V">0</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`">2660</value>
+								</property>		
+								<property name="voltage">
+									<value unit="V">0</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`">2330</value>
+								</property>		
+								<property name="voltage">
+									<value unit="V">0</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`">2000</value>
+								</property>		
+								<property name="voltage">
+									<value unit="V">0</value>
+								</property>
+								<property name="powerUsage">
+									<value unit="W">330</value>
+								</property>						
+							</parameter>								
+						</powerProfile>
+					</profile>
+				</computingResource>
+			</computingResource>	
+			<computingResource class="ComputingNode" count="2">
+				<resourceUnit class="memory">
+					<amount>12288</amount>
+				</resourceUnit>
+				<parameter name="category">
+					<value>C</value>
+				</parameter>
+				<profile>
+					<powerProfile>
+						<energyEstimationPlugin>
+							<name>example.energy.ComputingNodeEnergyEstimationPlugin</name>
+						</energyEstimationPlugin>	
+						<powerStates>
+							<powerState>
+								<name>ON</name>
+								<powerUsage>750</powerUsage>
+							</powerState>
+							<powerState>
+								<name>OFF</name>
+								<powerUsage>0</powerUsage>
+							</powerState>
+						</powerStates>				
+					</powerProfile>
+				</profile>
+
+				<computingResource class="Processor" count="4">
+					<parameter name="speed">
+						<value>1</value>
+					</parameter>
+					<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">3000</value>
+								</property>		
+								<property name="voltage">
+									<value unit="V">0</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`">2660</value>
+								</property>		
+								<property name="voltage">
+									<value unit="V">0</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`">2330</value>
+								</property>		
+								<property name="voltage">
+									<value unit="V">0</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`">2000</value>
+								</property>		
+								<property name="voltage">
+									<value unit="V">0</value>
+								</property>
+								<property name="powerUsage">
+									<value unit="W">330</value>
+								</property>						
+							</parameter>								
+						</powerProfile>
+					</profile>
+				</computingResource>
+			</computingResource>	
+		</computingResource>
+		</computingResource>
+		<scheduler class="Cluster" name="rackCluster1">
+			<schedulingPlugin>
+				<name>example.localplugin.RackLocalPlugin</name>
+			</schedulingPlugin>		
+			<managedComputingResources include="false">
+				<resourceName>compRes1</resourceName>
+			</managedComputingResources>
+			<scheduler class="Cluster" name="cluster1">
+				<schedulingPlugin>
+					<name>example.localplugin.FCFSRandomClusterLocalPlugin</name>
+				</schedulingPlugin>		
+				<managedComputingResources include="false">
+					<resourceName>rack1</resourceName>
+				</managedComputingResources>
+			</scheduler>	
+		</scheduler>	
+	</resources>
+	
+	<!--  
+	<templates>
+		<computingResourceTemplate class="Processor" name="modelProcessorA">
+			<profile>
+				<powerProfile>
+					<energyEstimationPlugin>
+						<name>CPUEnergyEstimationPlugin</name>
+					</energyEstimationPlugin>
+					<parameter name="pState">
+						<property name="name">
+							<value>P0</value>
+						</property>	
+						<property name="frequency">
+							<value unit="Hz">3000</value>
+						</property>		
+						<property name="voltage">
+							<value unit="V">0</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`">2660</value>
+						</property>		
+						<property name="voltage">
+							<value unit="V">0</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`">2330</value>
+						</property>		
+						<property name="voltage">
+							<value unit="V">0</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`">2000</value>
+						</property>		
+						<property name="voltage">
+							<value unit="V">0</value>
+						</property>
+						<property name="powerUsage">
+							<value unit="W">330</value>
+						</property>						
+					</parameter>							
+				</powerProfile>
+			</profile>
+		</computingResourceTemplate>
+	</templates>
+	-->
+</environment>
Index: DCWoRMS/trunk/example/tomekp/experiment1/tomExp3.xml
===================================================================
--- DCWoRMS/trunk/example/tomekp/experiment1/tomExp3.xml	(revision 477)
+++ DCWoRMS/trunk/example/tomekp/experiment1/tomExp3.xml	(revision 477)
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<environment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+	xsi:noNamespaceSchemaLocation="../XSSimResSchema.xsd">
+	
+	<!-- Opis dla data center z uwzglednieniem aspektow energetycznych -->
+	<resources>
+		<computingResource class="DataCenter" name="compRes1">
+			<resourceUnit class="krasnoludek">
+				<amount>7</amount>
+			</resourceUnit>
+			<computingResource class="Rack">
+						<resourceUnit class="storage">
+						<amount>1000000</amount>
+				</resourceUnit>
+			<computingResource class="ComputingNode">
+				<resourceUnit class="memory">
+						<amount>12288</amount>
+				</resourceUnit>
+				<resourceUnit class="cpu">
+					<amount>12</amount>
+				</resourceUnit>
+				<parameter name="category">
+						<value>A</value>
+				</parameter>
+				<profile>
+					<powerProfile>
+						<energyEstimationPlugin>
+							<name>example.energy.ComputingNodeEnergyEstimationPlugin</name>
+						</energyEstimationPlugin>	
+						<powerStates>
+							<powerState>
+								<name>ON</name>
+								<powerUsage>750</powerUsage>
+							</powerState>
+							<powerState>
+								<name>OFF</name>
+								<powerUsage>0</powerUsage>
+							</powerState>
+						</powerStates>				
+					</powerProfile>
+				</profile>
+			</computingResource>	
+
+			</computingResource>
+		</computingResource>
+		<scheduler class="Cluster" name="cluster1">
+			<schedulingPlugin>
+				<name>example.localplugin.RackLocalPlugin</name>
+
+			</schedulingPlugin>		
+				<managedComputingResources include="false">
+					<resourceName>Rack_0</resourceName>
+			</managedComputingResources>
+			<scheduler class="Cluster" name="clusterNode1">
+				<schedulingPlugin>
+					<name>example.localplugin.FCFSRandomClusterLocalPlugin</name>
+	
+				</schedulingPlugin>		
+				<managedComputingResources include="false">
+					<resourceName>ComputingNode_0</resourceName>
+				</managedComputingResources>
+		</scheduler>	
+		</scheduler>	
+	</resources>
+
+</environment>
Index: DCWoRMS/trunk/example/tomekp/experiment1/workload.swf
===================================================================
--- DCWoRMS/trunk/example/tomekp/experiment1/workload.swf	(revision 477)
+++ DCWoRMS/trunk/example/tomekp/experiment1/workload.swf	(revision 477)
@@ -0,0 +1,30 @@
+;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		7200	1		-1		-1		1		-1		-1		-1		-1		-1		1		1		1		-1		-1
+		2			7200			-1		7200	1		-1		-1		1		-1		-1		-1		-1		-1		1		1		1		-1		-1
+		3			7200			-1		7200	1		-1		-1		1		-1		-1		-1		-1		-1		1		1		1		-1		-1
+		4			7200			-1		7200	1		-1		-1		1		-1		-1		-1		-1		-1		1		1		1		-1		-1
+ 		5			7200			-1		7200	1		-1		-1		1		-1		-1		-1		-1		-1		1		1		1		-1		-1
+ 		6			7200			-1		10800	1		-1		-1		1		-1		-1		-1		-1		-1		1		1		1		-1		-1
+; -----------
+		7			7200			-1		14400	1		-1		-1		1		-1		-1		-1		-1		-1		1		1		1		-1		-1
+		8			7200			-1		28800	1		-1		-1		1		-1		-1		-1		-1		-1		1		1		1		-1		-1
+		9			7200		-1		7200	1		-1		-1		1		-1		-1		-1		-1		-1		1		1		1		-1		-1
+		10			21600		-1		21600	1		-1		-1		1		-1		-1		-1		-1		-1		1		1		1		-1		-1
+ 		11			25200		-1		25200	1		-1		-1		1		-1		-1		-1		-1		-1		1		1		1		-1		-1
+ 		12			39600		-1		14400	1		-1		-1		1		-1		-1		-1		-1		-1		1		1		1		-1		-1
+  		13			46800		-1		10800	1		-1		-1		1		-1		-1		-1		-1		-1		1		1		1		-1		-1
+ 		
Index: DCWoRMS/trunk/example/tomekp/experiment2/experiment2.properties
===================================================================
--- DCWoRMS/trunk/example/tomekp/experiment2/experiment2.properties	(revision 477)
+++ DCWoRMS/trunk/example/tomekp/experiment2/experiment2.properties	(revision 477)
@@ -0,0 +1,31 @@
+# Use single *.swf file as workload description.
+# Computing environment consists of two computing resources.
+# Plugin implementation and resources does not support reservation scheduling model.
+
+# Grid plugin implements simple round robin algorithm
+gridschedulingpluginname=example.gridplugin.GridFCFSRoundRobinPlugin
+
+# Local plugin starts task execution in FCFS order
+localallocpolicypluginname=example.localplugin.FCFSEnergyAwareClusterLocalPlugin
+
+# Linear model of cpu processing power is used for task execution time estimations. 
+exectimeestimationpluginname=example.timeestimation.ExecTimeEstimationPlugin
+
+# Path to xml file which describes resource characteristics.
+resdesc=example/workload/HostParameters.xml
+
+
+# and swf file, which name is declared by readscenario.workloadfilename parameter.
+# Swf file must be placed in readscenario.inputfolder directory.  
+readscenario.workloadfilename=example/tomekp/experiment2/workload.swf
+
+# Choose if files with task processing history should be created.  
+printhistory=true
+
+# Choose directory where all result files should be placed.
+stats.outputfolder=../experiment2_result
+
+envdesc=example/tomekp/experiment2/ResourceDescription.properties
+
+creatediagrams.processors=false
+creatediagrams.taskswaitingtime=false
Index: DCWoRMS/trunk/example/tomekp/experiment2/workload.swf
===================================================================
--- DCWoRMS/trunk/example/tomekp/experiment2/workload.swf	(revision 477)
+++ DCWoRMS/trunk/example/tomekp/experiment2/workload.swf	(revision 477)
@@ -0,0 +1,30 @@
+;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		7200	1		-1		-1		1		-1		-1		-1		-1		-1		1		1		1		-1		-1
+		2			0			-1		7200	1		-1		-1		1		-1		-1		-1		-1		-1		1		1		1		-1		-1
+		3			0			-1		7200	1		-1		-1		1		-1		-1		-1		-1		-1		1		1		1		-1		-1
+		4			0			-1		7200	1		-1		-1		1		-1		-1		-1		-1		-1		1		1		1		-1		-1
+ 		5			0			-1		7200	1		-1		-1		1		-1		-1		-1		-1		-1		1		1		1		-1		-1
+ 		6			0			-1		10800	1		-1		-1		1		-1		-1		-1		-1		-1		1		1		1		-1		-1
+; -----------
+		7			0			-1		14400	1		-1		-1		1		-1		-1		-1		-1		-1		1		1		1		-1		-1
+		8			1			-1		28800	1		-1		-1		1		-1		-1		-1		-1		-1		1		1		1		-1		-1
+		9			3600		-1		7200	1		-1		-1		1		-1		-1		-1		-1		-1		1		1		1		-1		-1
+		10			21600		-1		21600	1		-1		-1		1		-1		-1		-1		-1		-1		1		1		1		-1		-1
+ 		11			25200		-1		25200	1		-1		-1		1		-1		-1		-1		-1		-1		1		1		1		-1		-1
+ 		12			39600		-1		14400	1		-1		-1		1		-1		-1		-1		-1		-1		1		1		1		-1		-1
+  		13			46800		-1		10800	1		-1		-1		1		-1		-1		-1		-1		-1		1		1		1		-1		-1
+ 		
Index: DCWoRMS/trunk/example/tomekp/experiment2/RunExperiment.java
===================================================================
--- DCWoRMS/trunk/example/tomekp/experiment2/RunExperiment.java	(revision 477)
+++ DCWoRMS/trunk/example/tomekp/experiment2/RunExperiment.java	(revision 477)
@@ -0,0 +1,19 @@
+package tomekp.experiment2;
+import simulator.DataCenterWorkloadSimulator;
+
+
+public class RunExperiment {
+	
+	public static void main(String args[]){
+		RunExperiment runner = new RunExperiment();
+		runner.run();
+	}
+	
+	public void run(){
+		String args[] = {
+				"example/tomekp/experiment2/experiment2.properties"
+				};
+		DataCenterWorkloadSimulator.main(args);
+	}
+
+}
Index: DCWoRMS/trunk/example/tomekp/experiment2/ResourceDescription.properties
===================================================================
--- DCWoRMS/trunk/example/tomekp/experiment2/ResourceDescription.properties	(revision 477)
+++ DCWoRMS/trunk/example/tomekp/experiment2/ResourceDescription.properties	(revision 477)
@@ -0,0 +1,25 @@
+
+firstLayer=COMPUTING_GRID
+
+secondLayer=DATA_CENTER
+
+thirdLayer=COMPUTING_NODE
+
+fourthLayer=CPU
+
+
+
+grids=1
+
+dataCenters=1
+
+nodes=6
+
+cpus=1
+
+
+modelA=2
+
+modelB=2
+
+modelC=2
Index: DCWoRMS/trunk/example/tomekp/experiment3/experiment3.properties
===================================================================
--- DCWoRMS/trunk/example/tomekp/experiment3/experiment3.properties	(revision 477)
+++ DCWoRMS/trunk/example/tomekp/experiment3/experiment3.properties	(revision 477)
@@ -0,0 +1,31 @@
+# Use single *.swf file as workload description.
+# Computing environment consists of two computing resources.
+# Plugin implementation and resources does not support reservation scheduling model.
+
+# Grid plugin implements simple round robin algorithm
+gridschedulingpluginname=example.gridplugin.GridFCFSRoundRobinPlugin
+
+# Local plugin starts task execution in FCFS order
+localallocpolicypluginname=example.localplugin.FCFSNodePowerManagementClusterLocalPlugin
+
+# Linear model of cpu processing power is used for task execution time estimations. 
+exectimeestimationpluginname=example.timeestimation.ExecTimeEstimationPlugin
+
+# Path to xml file which describes resource characteristics.
+resdesc=example/workload/HostParameters.xml
+
+
+# and swf file, which name is declared by readscenario.workloadfilename parameter.
+# Swf file must be placed in readscenario.inputfolder directory.  
+readscenario.workloadfilename=example/tomekp/experiment3/workload.swf
+
+# Choose if files with task processing history should be created.  
+printhistory=true
+
+# Choose directory where all result files should be placed.
+stats.outputfolder=../experiment3_result
+
+envdesc=example/tomekp/experiment3/ResourceDescription.properties
+
+creatediagrams.processors=false
+creatediagrams.taskswaitingtime=false
Index: DCWoRMS/trunk/example/tomekp/experiment3/workload.swf
===================================================================
--- DCWoRMS/trunk/example/tomekp/experiment3/workload.swf	(revision 477)
+++ DCWoRMS/trunk/example/tomekp/experiment3/workload.swf	(revision 477)
@@ -0,0 +1,30 @@
+;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		7200	1		-1		-1		1		-1		-1		-1		-1		-1		1		1		1		-1		-1
+		2			0			-1		7200	1		-1		-1		1		-1		-1		-1		-1		-1		1		1		1		-1		-1
+		3			0			-1		7200	1		-1		-1		1		-1		-1		-1		-1		-1		1		1		1		-1		-1
+		4			0			-1		7200	1		-1		-1		1		-1		-1		-1		-1		-1		1		1		1		-1		-1
+ 		5			0			-1		7200	1		-1		-1		1		-1		-1		-1		-1		-1		1		1		1		-1		-1
+ 		6			0			-1		10800	1		-1		-1		1		-1		-1		-1		-1		-1		1		1		1		-1		-1
+; -----------
+		7			0			-1		14400	1		-1		-1		1		-1		-1		-1		-1		-1		1		1		1		-1		-1
+		8			1			-1		28800	1		-1		-1		1		-1		-1		-1		-1		-1		1		1		1		-1		-1
+		9			3600		-1		7200	1		-1		-1		1		-1		-1		-1		-1		-1		1		1		1		-1		-1
+		10			21600		-1		21600	1		-1		-1		1		-1		-1		-1		-1		-1		1		1		1		-1		-1
+ 		11			25200		-1		25200	1		-1		-1		1		-1		-1		-1		-1		-1		1		1		1		-1		-1
+ 		12			39600		-1		14400	1		-1		-1		1		-1		-1		-1		-1		-1		1		1		1		-1		-1
+  		13			46800		-1		10800	1		-1		-1		1		-1		-1		-1		-1		-1		1		1		1		-1		-1
+ 		
Index: DCWoRMS/trunk/example/tomekp/experiment3/RunExperiment.java
===================================================================
--- DCWoRMS/trunk/example/tomekp/experiment3/RunExperiment.java	(revision 477)
+++ DCWoRMS/trunk/example/tomekp/experiment3/RunExperiment.java	(revision 477)
@@ -0,0 +1,19 @@
+package tomekp.experiment3;
+import simulator.DataCenterWorkloadSimulator;
+
+
+public class RunExperiment {
+	
+	public static void main(String args[]){
+		RunExperiment runner = new RunExperiment();
+		runner.run();
+	}
+	
+	public void run(){
+		String args[] = {
+				"example/tomekp/experiment3/experiment3.properties"
+				};
+		DataCenterWorkloadSimulator.main(args);
+	}
+
+}
Index: DCWoRMS/trunk/example/tomekp/experiment3/ResourceDescription.properties
===================================================================
--- DCWoRMS/trunk/example/tomekp/experiment3/ResourceDescription.properties	(revision 477)
+++ DCWoRMS/trunk/example/tomekp/experiment3/ResourceDescription.properties	(revision 477)
@@ -0,0 +1,25 @@
+
+firstLayer=COMPUTING_GRID
+
+secondLayer=DATA_CENTER
+
+thirdLayer=COMPUTING_NODE
+
+fourthLayer=CPU
+
+
+
+grids=1
+
+dataCenters=1
+
+nodes=6
+
+cpus=1
+
+
+modelA=2
+
+modelB=2
+
+modelC=2
Index: DCWoRMS/trunk/example/tomekp/experiment4/experiment4.properties
===================================================================
--- DCWoRMS/trunk/example/tomekp/experiment4/experiment4.properties	(revision 477)
+++ DCWoRMS/trunk/example/tomekp/experiment4/experiment4.properties	(revision 477)
@@ -0,0 +1,31 @@
+# Use single *.swf file as workload description.
+# Computing environment consists of two computing resources.
+# Plugin implementation and resources does not support reservation scheduling model.
+
+# Grid plugin implements simple round robin algorithm
+gridschedulingpluginname=example.gridplugin.GridFCFSRoundRobinPlugin
+
+# Local plugin starts task execution in FCFS order
+localallocpolicypluginname=example.localplugin.FCFSCPUFreqScalingClusterLocalPlugin
+
+# Linear model of cpu processing power is used for task execution time estimations. 
+exectimeestimationpluginname=example.timeestimation.ExecTimeEstimationPlugin
+
+# Path to xml file which describes resource characteristics.
+resdesc=example/workload/HostParameters.xml
+
+
+# and swf file, which name is declared by readscenario.workloadfilename parameter.
+# Swf file must be placed in readscenario.inputfolder directory.  
+readscenario.workloadfilename=example/tomekp/experiment4/workload.swf
+
+# Choose if files with task processing history should be created.  
+printhistory=true
+
+# Choose directory where all result files should be placed.
+stats.outputfolder=../experiment4_result
+
+envdesc=example/tomekp/experiment4/ResourceDescription.properties
+
+creatediagrams.processors=false
+creatediagrams.taskswaitingtime=false
Index: DCWoRMS/trunk/example/tomekp/experiment4/workload.swf
===================================================================
--- DCWoRMS/trunk/example/tomekp/experiment4/workload.swf	(revision 477)
+++ DCWoRMS/trunk/example/tomekp/experiment4/workload.swf	(revision 477)
@@ -0,0 +1,30 @@
+;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		7200	1		-1		-1		1		-1		-1		-1		-1		-1		1		1		1		-1		-1
+		2			0			-1		7200	1		-1		-1		1		-1		-1		-1		-1		-1		1		1		1		-1		-1
+		3			0			-1		7200	1		-1		-1		1		-1		-1		-1		-1		-1		1		1		1		-1		-1
+		4			0			-1		7200	1		-1		-1		1		-1		-1		-1		-1		-1		1		1		1		-1		-1
+ 		5			0			-1		7200	1		-1		-1		1		-1		-1		-1		-1		-1		1		1		1		-1		-1
+ 		6			0			-1		10800	1		-1		-1		1		-1		-1		-1		-1		-1		1		1		1		-1		-1
+; -----------
+		7			0			-1		14400	1		-1		-1		1		-1		-1		-1		-1		-1		1		1		1		-1		-1
+		8			1			-1		28800	1		-1		-1		1		-1		-1		-1		-1		-1		1		1		1		-1		-1
+		9			3600		-1		7200	1		-1		-1		1		-1		-1		-1		-1		-1		1		1		1		-1		-1
+		10			21600		-1		21600	1		-1		-1		1		-1		-1		-1		-1		-1		1		1		1		-1		-1
+ 		11			25200		-1		25200	1		-1		-1		1		-1		-1		-1		-1		-1		1		1		1		-1		-1
+ 		12			39600		-1		14400	1		-1		-1		1		-1		-1		-1		-1		-1		1		1		1		-1		-1
+  		13			46800		-1		10800	1		-1		-1		1		-1		-1		-1		-1		-1		1		1		1		-1		-1
+ 		
Index: DCWoRMS/trunk/example/tomekp/experiment4/RunExperiment.java
===================================================================
--- DCWoRMS/trunk/example/tomekp/experiment4/RunExperiment.java	(revision 477)
+++ DCWoRMS/trunk/example/tomekp/experiment4/RunExperiment.java	(revision 477)
@@ -0,0 +1,19 @@
+package tomekp.experiment4;
+import simulator.DataCenterWorkloadSimulator;
+
+
+public class RunExperiment {
+	
+	public static void main(String args[]){
+		RunExperiment runner = new RunExperiment();
+		runner.run();
+	}
+	
+	public void run(){
+		String args[] = {
+				"example/tomekp/experiment4/experiment4.properties"
+				};
+		DataCenterWorkloadSimulator.main(args);
+	}
+
+}
Index: DCWoRMS/trunk/example/tomekp/experiment4/ResourceDescription.properties
===================================================================
--- DCWoRMS/trunk/example/tomekp/experiment4/ResourceDescription.properties	(revision 477)
+++ DCWoRMS/trunk/example/tomekp/experiment4/ResourceDescription.properties	(revision 477)
@@ -0,0 +1,25 @@
+
+firstLayer=COMPUTING_GRID
+
+secondLayer=DATA_CENTER
+
+thirdLayer=COMPUTING_NODE
+
+fourthLayer=CPU
+
+
+
+grids=1
+
+dataCenters=1
+
+nodes=6
+
+cpus=1
+
+
+modelA=2
+
+modelB=2
+
+modelC=2
Index: DCWoRMS/trunk/example/tomekp/experiment5/ResourceDescription.properties
===================================================================
--- DCWoRMS/trunk/example/tomekp/experiment5/ResourceDescription.properties	(revision 477)
+++ DCWoRMS/trunk/example/tomekp/experiment5/ResourceDescription.properties	(revision 477)
@@ -0,0 +1,25 @@
+
+firstLayer=COMPUTING_GRID
+
+secondLayer=DATA_CENTER
+
+thirdLayer=COMPUTING_NODE
+
+fourthLayer=CPU
+
+
+
+grids=1
+
+dataCenters=1
+
+nodes=2
+
+cpus=3
+
+
+modelA=2
+
+modelB=2
+
+modelC=2
Index: DCWoRMS/trunk/example/tomekp/experiment5/experiment5.properties
===================================================================
--- DCWoRMS/trunk/example/tomekp/experiment5/experiment5.properties	(revision 477)
+++ DCWoRMS/trunk/example/tomekp/experiment5/experiment5.properties	(revision 477)
@@ -0,0 +1,31 @@
+# Use single *.swf file as workload description.
+# Computing environment consists of two computing resources.
+# Plugin implementation and resources does not support reservation scheduling model.
+
+# Grid plugin implements simple round robin algorithm
+gridschedulingpluginname=example.gridplugin.GridFCFSRoundRobinPlugin
+
+# Local plugin starts task execution in FCFS order
+localallocpolicypluginname=example.localplugin.FCFSConsolidationClusterLocalPlugin
+
+# Linear model of cpu processing power is used for task execution time estimations. 
+exectimeestimationpluginname=example.timeestimation.ExecTimeEstimationPlugin
+
+# Path to xml file which describes resource characteristics.
+resdesc=example/workload/HostParameters.xml
+
+
+# and swf file, which name is declared by readscenario.workloadfilename parameter.
+# Swf file must be placed in readscenario.inputfolder directory.  
+readscenario.workloadfilename=example/tomekp/experiment5/workload.swf
+
+# Choose if files with task processing history should be created.  
+printhistory=true
+
+# Choose directory where all result files should be placed.
+stats.outputfolder=../experiment5_result
+
+envdesc=example/tomekp/experiment5/ResourceDescription.properties
+
+creatediagrams.processors=false
+creatediagrams.taskswaitingtime=false
Index: DCWoRMS/trunk/example/tomekp/experiment5/workload.swf
===================================================================
--- DCWoRMS/trunk/example/tomekp/experiment5/workload.swf	(revision 477)
+++ DCWoRMS/trunk/example/tomekp/experiment5/workload.swf	(revision 477)
@@ -0,0 +1,30 @@
+;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		7200	1		-1		-1		1		-1		4096		-1		-1		-1		1		1		1		-1		-1
+		2			0			-1		7200	1		-1		-1		1		-1		4096		-1		-1		-1		1		1		1		-1		-1
+		3			0			-1		7200	1		-1		-1		1		-1		4096		-1		-1		-1		1		1		1		-1		-1
+		4			0			-1		7200	1		-1		-1		1		-1		4096		-1		-1		-1		1		1		1		-1		-1
+ 		5			0			-1		7200	1		-1		-1		1		-1		4096		-1		-1		-1		1		1		1		-1		-1
+ 		6			0			-1		10800	1		-1		-1		1		-1		4096		-1		-1		-1		1		1		1		-1		-1
+; -----------
+		7			0			-1		14400	1		-1		-1		1		-1		4096		-1		-1		-1		1		1		1		-1		-1
+		8			0			-1		28800	1		-1		-1		1		-1		4096		-1		-1		-1		1		1		1		-1		-1
+		9			3600		-1		7200	1		-1		-1		1		-1		4096		-1		-1		-1		1		1		1		-1		-1
+		10			21600		-1		21600	1		-1		-1		1		-1		4096		-1		-1		-1		1		1		1		-1		-1
+ 		11			25200		-1		25200	1		-1		-1		1		-1		4096		-1		-1		-1		1		1		1		-1		-1
+ 		12			39600		-1		14400	1		-1		-1		1		-1		4096		-1		-1		-1		1		1		1		-1		-1
+  		13			46800		-1		10800	1		-1		-1		1		-1		4096		-1		-1		-1		1		1		1		-1		-1
+ 		
Index: DCWoRMS/trunk/example/tomekp/experiment5/RunExperiment.java
===================================================================
--- DCWoRMS/trunk/example/tomekp/experiment5/RunExperiment.java	(revision 477)
+++ DCWoRMS/trunk/example/tomekp/experiment5/RunExperiment.java	(revision 477)
@@ -0,0 +1,19 @@
+package tomekp.experiment5;
+import simulator.DataCenterWorkloadSimulator;
+
+
+public class RunExperiment {
+	
+	public static void main(String args[]){
+		RunExperiment runner = new RunExperiment();
+		runner.run();
+	}
+	
+	public void run(){
+		String args[] = {
+				"example/tomekp/experiment5/experiment5.properties"
+				};
+		DataCenterWorkloadSimulator.main(args);
+	}
+
+}
Index: DCWoRMS/trunk/example/experiment2_result/Stats_Simulation 1_Energy.txt
===================================================================
--- DCWoRMS/trunk/example/experiment2_result/Stats_Simulation 1_Energy.txt	(revision 477)
+++ DCWoRMS/trunk/example/experiment2_result/Stats_Simulation 1_Energy.txt	(revision 477)
@@ -0,0 +1,37 @@
+resourceName;timestamp;usage;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: DCWoRMS/trunk/example/experiment2_result/experiment.properties
===================================================================
--- DCWoRMS/trunk/example/experiment2_result/experiment.properties	(revision 477)
+++ DCWoRMS/trunk/example/experiment2_result/experiment.properties	(revision 477)
@@ -0,0 +1,20 @@
+# Use single *.swf file as workload description.
+
+# Path to xml file which describes resource characteristics.
+resdesc=example/experiment2/resources.xml
+
+
+# and swf file, which name is declared by readscenario.workloadfilename parameter.
+# Swf file must be placed in readscenario.inputfolder directory.  
+readscenario.workloadfilename=example/experiment2/workload.swf
+
+# Choose if files with task processing history should be created.  
+printhistory=true
+
+# Choose directory where all result files should be placed.
+stats.outputfolder=../experiment2_result
+
+
+creatediagrams.gantt=true
+creatediagrams.utilization=true
+creatediagrams.taskswaitingtime=false
Index: DCWoRMS/trunk/example/experiment2_result/Stats_Simulation 1_Jobs.txt
===================================================================
--- DCWoRMS/trunk/example/experiment2_result/Stats_Simulation 1_Jobs.txt	(revision 477)
+++ DCWoRMS/trunk/example/experiment2_result/Stats_Simulation 1_Jobs.txt	(revision 477)
@@ -0,0 +1,14 @@
+jobID;meanTaskCompletionTime;meanTaskExecutionTime;meanTaskStartTime;meanTaskFlowTime;meanTaskWaitingTime;meanTaskGQ_WaitingTime;lateness;tardiness;makespan;
+1;7,200;7,200;0;7,200;0;0;0;0;7,200;
+2;7,200;7,200;0;7,200;0;0;0;0;7,200;
+3;7,200;7,200;0;7,200;0;0;0;0;7,200;
+4;7,200;7,200;0;7,200;0;0;0;0;7,200;
+5;7,200;7,200;0;7,200;0;0;0;0;7,200;
+6;5,400;5,400;0;5,400;0;0;0;0;5,400;
+7;7,200;7,200;0;7,200;0;0;0;0;7,200;
+8;14,400;14,400;0;14,400;0;0;0;0;14,400;
+9;10,800;7,200;0;7,200;0;0;0;0;10,800;
+10;32,400;10,800;0;10,800;0;0;0;0;32,400;
+11;37,800;12,600;0;12,600;0;0;0;0;37,800;
+12;46,800;7,200;0;7,200;0;0;0;0;46,800;
+13;52,200;5,400;0;5,400;0;0;0;0;52,200;
Index: DCWoRMS/trunk/example/experiment2_result/Stats_Simulation 1_ResourceUtilization.txt
===================================================================
--- DCWoRMS/trunk/example/experiment2_result/Stats_Simulation 1_ResourceUtilization.txt	(revision 477)
+++ DCWoRMS/trunk/example/experiment2_result/Stats_Simulation 1_ResourceUtilization.txt	(revision 477)
@@ -0,0 +1,103 @@
+resourceName;timestamp;usage;
+ComputingNode_0;1225666800000;1;
+ComputingNode_0;1225674000000;0;
+mean: 0.06896551724137931
+
+ComputingNode_1;1225666800000;1;
+ComputingNode_1;1225674000000;0;
+mean: 0.06896551724137931
+
+ComputingNode_2;1225666800000;1;
+ComputingNode_2;1225674000000;0;
+mean: 0.06896551724137931
+
+ComputingNode_3;1225666800000;1;
+ComputingNode_3;1225674000000;0;
+mean: 0.06896551724137931
+
+ComputingNode_4;1225666800000;1;
+ComputingNode_4;1225674000000;0;
+mean: 0.06896551724137931
+
+ComputingNode_5;1225670400000;1;
+ComputingNode_5;1225677600000;0;
+mean: 0.06896551724137931
+
+
+
+ComputingNode_8;1225666800000;2;
+ComputingNode_8;1225672200000;1;
+ComputingNode_8;1225674000000;0;
+ComputingNode_8;1225688400000;1;
+ComputingNode_8;1225699200000;0;
+ComputingNode_8;1225706400000;1;
+ComputingNode_8;1225713600000;1;
+ComputingNode_8;1225719000000;0;
+mean: 0.3448275862068966
+
+ComputingNode_9;1225666800000;1;
+ComputingNode_9;1225681200000;0;
+ComputingNode_9;1225692000000;1;
+ComputingNode_9;1225704600000;0;
+mean: 0.25862068965517243
+
+
+
+Processor_0;1225666800000;1;
+Processor_0;1225674000000;0;
+mean: 0.13793103448275862
+
+
+Processor_2;1225666800000;1;
+Processor_2;1225674000000;0;
+mean: 0.13793103448275862
+
+
+Processor_4;1225666800000;1;
+Processor_4;1225674000000;0;
+mean: 0.13793103448275862
+
+
+Processor_6;1225666800000;1;
+Processor_6;1225674000000;0;
+mean: 0.13793103448275862
+
+
+Processor_8;1225666800000;1;
+Processor_8;1225674000000;0;
+mean: 0.13793103448275862
+
+
+Processor_10;1225670400000;1;
+Processor_10;1225677600000;0;
+mean: 0.13793103448275862
+
+
+
+
+
+
+Processor_16;1225666800000;1;
+Processor_16;1225672200000;0;
+Processor_16;1225688400000;1;
+Processor_16;1225699200000;0;
+Processor_16;1225706400000;1;
+Processor_16;1225713600000;1;
+Processor_16;1225719000000;0;
+mean: 0.5517241379310345
+
+Processor_17;1225666800000;1;
+Processor_17;1225674000000;0;
+mean: 0.13793103448275862
+
+Processor_18;1225666800000;1;
+Processor_18;1225681200000;0;
+Processor_18;1225692000000;1;
+Processor_18;1225704600000;0;
+mean: 0.5172413793103449
+
+
+
+
+
+
Index: DCWoRMS/trunk/example/experiment2_result/Stats_Simulation 1_Simulation.txt
===================================================================
--- DCWoRMS/trunk/example/experiment2_result/Stats_Simulation 1_Simulation.txt	(revision 477)
+++ DCWoRMS/trunk/example/experiment2_result/Stats_Simulation 1_Simulation.txt	(revision 477)
@@ -0,0 +1,15 @@
+Resource name;mean;stdev;variance;minimum;maximum;sum;count;
+Delayed tasks;0;0;0;0;0;0;1;
+Failed requests (tasks);0;0;0;0;0;0;1;
+Makespan;52,200;0;0;52,200;52,200;52,200;1;
+Resources queue length;0.897;0;0;0.897;0.897;0.897;1;
+Resources total load;0.085;0;0;0.085;0.085;0.085;1;
+Resources reservation load;?;?;?;?;?;?;0;
+Energy usage;?;?;?;?;?;?;0;
+Task completion time;18,692.308;16,444.895;270,434,556.213;5,400;52,200;243,000;13;
+Task execution time;8,169.231;2,605.138;6,786,745.562;5,400;14,400;106,200;13;
+Task start time;0;0;0;0;0;0;13;
+Task flow time;8,169.231;2,605.138;6,786,745.562;5,400;14,400;106,200;13;
+Task waiting time;0;0;0;0;0;0;13;
+Task lateness;0;0;0;0;0;0;13;
+Task tardiness;0;0;0;0;0;0;13;
Index: DCWoRMS/trunk/example/experiment2_result/Stats_Simulation 1_Tasks.txt
===================================================================
--- DCWoRMS/trunk/example/experiment2_result/Stats_Simulation 1_Tasks.txt	(revision 477)
+++ DCWoRMS/trunk/example/experiment2_result/Stats_Simulation 1_Tasks.txt	(revision 477)
@@ -0,0 +1,14 @@
+JobID;TaskID;UserDN;ResName;CpuCnt;ExecStartDate;ExecFinishDate;ExecEndDate;GB_SubDate;LB_SubDate;CompletionTime;ExecStartTime;ExecutionTime;ReadyTime;StartTime;FlowTime;WaitingTime;GQ_WaitingTime;Lateness;Tardiness;ReservStartDate;ReservFinishDate;ProcessorName;Energy;
+1;1;-1;ManagementSystem@cluster;1;1225666800;1225674000;1225674000;1225666800;1225666800;7200;0;7200;0;0;7200;0;0;0;0;0;0;[Processor_0];
+2;2;-1;ManagementSystem@cluster;1;1225666800;1225674000;1225674000;1225666800;1225666800;7200;0;7200;0;0;7200;0;0;0;0;0;0;[Processor_2];
+3;3;-1;ManagementSystem@cluster;1;1225666800;1225674000;1225674000;1225666800;1225666800;7200;0;7200;0;0;7200;0;0;0;0;0;0;[Processor_4];
+4;4;-1;ManagementSystem@cluster;1;1225666800;1225674000;1225674000;1225666800;1225666800;7200;0;7200;0;0;7200;0;0;0;0;0;0;[Processor_6];
+5;5;-1;ManagementSystem@cluster;1;1225666800;1225674000;1225674000;1225666800;1225666800;7200;0;7200;0;0;7200;0;0;0;0;0;0;[Processor_8];
+6;6;-1;ManagementSystem@cluster;1;1225666800;1225672200;1225672200;1225666800;1225666800;5400;0;5400;0;0;5400;0;0;0;0;0;0;[Processor_16];
+7;7;-1;ManagementSystem@cluster;1;1225666800;1225674000;1225674000;1225666800;1225666800;7200;0;7200;0;0;7200;0;0;0;0;0;0;[Processor_17];
+8;8;-1;ManagementSystem@cluster;1;1225666800;1225681200;1225681200;1225666800;1225666800;14400;0;14400;0;0;14400;0;0;0;0;0;0;[Processor_18];
+9;9;-1;ManagementSystem@cluster;1;1225670400;1225677600;1225677600;1225670400;1225670400;10800;3600;7200;3600;0;7200;0;0;0;0;0;0;[Processor_10];
+10;10;-1;ManagementSystem@cluster;1;1225688400;1225699200;1225699200;1225688400;1225688400;32400;21600;10800;21600;0;10800;0;0;0;0;0;0;[Processor_16];
+11;11;-1;ManagementSystem@cluster;1;1225692000;1225704600;1225704600;1225692000;1225692000;37800;25200;12600;25200;0;12600;0;0;0;0;0;0;[Processor_18];
+12;12;-1;ManagementSystem@cluster;1;1225706400;1225713600;1225713600;1225706400;1225706400;46800;39600;7200;39600;0;7200;0;0;0;0;0;0;[Processor_16];
+13;13;-1;ManagementSystem@cluster;1;1225713600;1225719000;1225719000;1225713600;1225713600;52200;46800;5400;46800;0;5400;0;0;0;0;0;0;[Processor_16];
Index: DCWoRMS/trunk/properties/variables.properties
===================================================================
--- DCWoRMS/trunk/properties/variables.properties	(revision 477)
+++ DCWoRMS/trunk/properties/variables.properties	(revision 477)
@@ -0,0 +1,11 @@
+RESOURCES_PATH=properties/ARresources128.xml
+WORKLOAD_FILENAME=workload.swf
+EXP_PATH=experiments/generated
+
+# It replaces EXP_PATH during generating resource files based experiments
+RES_EXP_PATH=experiments/generated_resources
+
+GENERATOR_XML_FILE=properties/generator.xml
+DIGIT_JOB_TEMPLATE=QcgJob_0
+NUMBER_JOB_TEMPLATE=QcgJob_
+JOB_EXTENSION=.xml
Index: DCWoRMS/trunk/properties/resources_template.xml
===================================================================
--- DCWoRMS/trunk/properties/resources_template.xml	(revision 477)
+++ DCWoRMS/trunk/properties/resources_template.xml	(revision 477)
@@ -0,0 +1,5 @@
+<hostParameters xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+xsi:noNamespaceSchemaLocation="/Users/marcin/workspace/brain/symulator/gssim_current/simulator/schemas/grms3/GrmsHostParametersSchema.xsd">
+	<resources>
+RESOURCES_DETAILS	</resources>
+</hostParameters>
Index: DCWoRMS/trunk/properties/resource_template.part
===================================================================
--- DCWoRMS/trunk/properties/resource_template.part	(revision 477)
+++ DCWoRMS/trunk/properties/resource_template.part	(revision 477)
@@ -0,0 +1,13 @@
+		<computingResource  resourceId="RESOURCE_ID">
+			<machineParameters>
+				<hostParameter name="cpucount">
+					<paramValue>128</paramValue>
+				</hostParameter>
+				<hostParameter name="cpuspeed">
+					<paramValue>1</paramValue>
+				</hostParameter>
+				<otherParameter name="reservation">
+					<paramValue>true</paramValue>
+				</otherParameter>
+			</machineParameters>
+		</computingResource>
Index: DCWoRMS/trunk/properties/log4j.properties
===================================================================
--- DCWoRMS/trunk/properties/log4j.properties	(revision 477)
+++ DCWoRMS/trunk/properties/log4j.properties	(revision 477)
@@ -0,0 +1,31 @@
+
+log4j.rootLogger=TRACE, T1
+log4j.logger.gridsim=TRACE, F1, A1
+log4j.logger.qcg=TRACE, F1, A1
+log4j.logger.gssim=TRACE, F1, A1
+log4j.logger.schedframe=TRACE, F1, A1
+log4j.logger.simulator=TRACE, F1, A1
+log4j.logger.test=TRACE, F1, A1
+log4j.logger.example=TRACE, F1, A1
+log4j.logger.org.joda.time.VCMilisProvider=TRACE, F1, A1
+log4j.logger.org.joda.time.DateTimeUtilsExt=TRACE, F1, A1
+
+#log4j.logger.org.apache.axis=TRACE, T1
+#log4j.logger.org.globus=TRACE, T1
+#log4j.logger.qcg.services.smoa=TRACE, T1
+
+log4j.appender.A1=org.apache.log4j.ConsoleAppender
+log4j.appender.A1.layout=org.apache.log4j.PatternLayout
+log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
+
+log4j.appender.F1=org.apache.log4j.FileAppender
+log4j.appender.F1.file=gssim.log
+log4j.appender.F1.append=false
+log4j.appender.F1.layout=org.apache.log4j.PatternLayout
+log4j.appender.F1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
+
+log4j.appender.T1=org.apache.log4j.FileAppender
+log4j.appender.T1.file=trash.log
+log4j.appender.T1.append=false
+log4j.appender.T1.layout=org.apache.log4j.PatternLayout
+log4j.appender.T1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
Index: DCWoRMS/trunk/properties/generator_template.properties
===================================================================
--- DCWoRMS/trunk/properties/generator_template.properties	(revision 477)
+++ DCWoRMS/trunk/properties/generator_template.properties	(revision 477)
@@ -0,0 +1,5 @@
+resdesc=RESOURCES_PATH
+createscenario.tasksdesc=GENERATOR_XML_FILE
+createscenario.outputfolder=EXP_PATH/MAX_TASKS_NO
+createscenario.workloadfilename=WORKLOAD_FILENAME
+createscenario.overwrite_files=true
Index: DCWoRMS/trunk/properties/performance.properties
===================================================================
--- DCWoRMS/trunk/properties/performance.properties	(revision 477)
+++ DCWoRMS/trunk/properties/performance.properties	(revision 477)
@@ -0,0 +1,26 @@
+# Lack of any of the following fields (apart of number of beeps, which is optional) will casue a RuntimeException.
+
+# Memory measuring interval in miliseconds
+INTERVAL=100
+
+# Number of repeats of each experiment file
+REPEATS=3
+
+# Available RAM in MB
+MEMORY_IN_MB=2048
+
+# Next three fields describes three types of memory and how they will be measured, possible values
+# are: simple, details (every other argument is treated as none)
+HEAP_MEMORY=simple
+NON_HEAP_MEMORY=simple
+JVM_MEMORY=simple
+
+# Time is always meassured, however the results are much more reliable when all memory arguments are
+# none (or something other than simple and details), there's also possible to meassure time precisly
+# by specyfinng option "precisly" (every other argument is treated as occasional)
+
+TIME_MEASURING=precisly
+
+#Number of beeps after finish (default 0)
+
+NO_OF_BEEPS=3
Index: DCWoRMS/trunk/properties/generator_template.xml
===================================================================
--- DCWoRMS/trunk/properties/generator_template.xml	(revision 477)
+++ DCWoRMS/trunk/properties/generator_template.xml	(revision 477)
@@ -0,0 +1,31 @@
+<tns:WorkloadConfiguration 
+	xmlns:tns="http://www.man.poznan.pl/WorkloadSchema" 
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ 	xsi:noNameSpaceSchemaLocation="/Users/marcin/workspace/brain/symulator/gssim/simulator/schemas/WorkloadSchema3g.xsd">
+ 	
+ 	 	
+  	<SimulationStartTime>1970-01-01T01:00:00</SimulationStartTime>
+ 
+	<JobCount avg="MAX_TASKS_NO" distribution="constant" seed="21"/>
+ 
+	<TaskCount avg="1" distribution="constant" seed="21"/>
+ 
+	<TaskLength id="tl" avg="1200" min="100" max="1800" stdev="2000.0" distribution="normal" seed="21"/>
+ 
+	<JobPackageLength avg="2" min="1" max="10" stdev="5" distribution="normal" seed="21"/>
+ 
+	<JobInterval avg="600" min="0" max="1200" stdev="1000" distribution="normal" seed="21"/>
+ 
+ 
+	<ComputingResourceHostParameter metric="cpucount">
+		<value id="cpucnt" avg="6" min="1" max="12" stdev="10.0" distribution="normal" seed="21"/>
+	</ComputingResourceHostParameter>
+  
+  	<ExecutionTime>
+  		<execDuration id="exec_duration" refElementId="tl"  expr="x"/>
+  		<periodStart avg="600" min="0" max="1200" stdev="2000" distribution="normal" seed="21"/>
+  		<periodEnd id="period_duration" refElementId="exec_duration"
+  					avg="900" min="700" max="1200" stdev="250" distribution="normal" expr="x" seed="17"/>
+  	</ExecutionTime>
+	 
+</tns:WorkloadConfiguration>
Index: DCWoRMS/trunk/build.xml
===================================================================
--- DCWoRMS/trunk/build.xml	(revision 477)
+++ DCWoRMS/trunk/build.xml	(revision 477)
@@ -0,0 +1,159 @@
+<project name="gssim" default="compile" basedir=".">
+
+	<!-- declare location of basic directories and variables in the project-->
+	<property name="src" location="src" />
+	<property name="build" location="build" />
+	<property name="jars" location="jars" />
+	<property name="to-grms" location="to-grms" />
+
+	<!-- define basic classpath. This jars are required to compile source code. -->
+	<path id="class.path">
+		<pathelement path="${jars}/bsh-2.0b4.jar" />
+		<pathelement path="${jars}/colt.jar" />
+		<pathelement path="${jars}/commons-lang-2.6.jar" />
+		<pathelement path="${jars}/commons-logging.jar" />
+		<pathelement path="${jars}/gridsim.jar" />
+		<pathelement path="${jars}/gssim_workload3g.jar" />
+		<pathelement path="${jars}/guava-13.0.jar" />
+		<pathelement path="${jars}/jcommon-1.0.10.jar" />
+		<pathelement path="${jars}/jfreechart-1.0.6.jar" />
+		<pathelement path="${jars}/qcg_schemas_tools.jar" />
+		<pathelement path="${jars}/qcg-broker_schemas.jar" />
+		<pathelement path="${jars}/schemas.jar" />
+		<pathelement path="${jars}/simjava.jar" />
+		<pathelement path="${jars}/TimetableChart.jar" />
+		<pathelement path="${jars}/joda-time/joda-time-1.6.jar" />
+		<pathelement path="${jars}/castor-1.3.3-RC1/castor-1.3.3-RC1-codegen.jar" />
+		<pathelement path="${jars}/castor-1.3.3-RC1/castor-1.3.3-RC1-core.jar" />
+		<pathelement path="${jars}/castor-1.3.3-RC1/castor-1.3.3-RC1-xml-schema.jar" />
+		<pathelement path="${jars}/castor-1.3.3-RC1/castor-1.3.3-RC1-xml.jar" />
+		<pathelement path="${jars}/castor-1.3.3-RC1/castor-1.3.3-RC1.jar" />
+	</path>
+
+	<!-- 
+		compile all source code, except test.* package. Class files are located in 
+		${build}/classes directory along with the java files.  
+	-->
+	<target name="compile" depends="init">
+
+		<copy todir="${build}/classes">
+			<fileset dir="${src}">
+				<exclude name="simulator/factory/QueueingSystemFactory.java" />
+				<exclude name="simulator/factory/ResourcesRandomNumbersFactory.java" />
+				<exclude name="simulator/factory/SingleResourceFactory.java" />
+				<exclude name="simulator/lists/ResourceUsage.java" />
+				<exclude name="simulator/lists/ResourceUsageDynamic.java" />
+				<exclude name="simulator/workload/generator/ResourceGeneratorInterface.java" />
+				<exclude name="simulator/workload/generator/impl/ResourceGenerator.java" />
+				<exclude name="simulator/workload/generator/validators/ResourceConfigValidator.java" />
+				<exclude name="simulator/workload/generator/validators/XMLValidator.java" />
+
+			</fileset>
+		</copy>
+
+		<javac srcdir="${build}/classes" destdir="${build}/classes" debug="on" includeantruntime="false">
+			<classpath refid="class.path" />
+		</javac>
+
+	</target>
+
+	<!-- 
+		creates jar files from copiled classes.
+		gssim.jar - contains all compiled classes
+		schedframe.jar - contains classes only from schedframe package
+		gssim_schedframe.jar - contains classes only from gssim.schedframe package, 
+			those classes are GSSIM specific implementations of interfaces from schedframe package
+		gssim_light.jar - contains all classes except those from schedframe and gssim.schedframe
+			packages 
+	-->
+	<target name="jar" depends="compile,
+								jar.schedframe, 
+								jar.gssim.schedframe, 
+								jar.gssim.light, 
+								jar.gssim" />
+
+	<target name="jar.schedframe">
+		<jar destfile="${build}/schedframe.jar" basedir="${build}/classes" includes="schedframe/**" />
+	</target>
+
+	<target name="jar.gssim.schedframe">
+		<jar destfile="${build}/gssim_schedframe.jar" basedir="${build}/classes" includes="gssim/schedframe/**" />
+	</target>
+
+	<target name="jar.gssim.light">
+		<jar destfile="${build}/gssim_light.jar" basedir="${build}/classes" excludes="schedframe/**,gssim/schedframe/**,gssim/db/**" />
+	</target>
+
+	<target name="jar.gssim">
+		<jar destfile="${build}/gssim.jar" basedir="${build}/classes" />
+	</target>
+
+	<!-- 
+		creates build directory where compiled classes and build jar
+		will be placed
+	-->
+	<target name="init">
+		<mkdir dir="${build}/classes" />
+	</target>
+
+
+	<!-- prepares file structure to run on grms -->
+	<target name="grms.prepare" depends="compile, jar.gssim">
+		<copy todir="${to-grms}/jars">
+			<fileset dir="${jars}" />
+		</copy>
+
+		<copy todir="${to-grms}/simulator">
+			<fileset dir="simulator" />
+		</copy>
+
+		<copy todir="${to-grms}/properties">
+			<fileset dir="properties" />
+		</copy>
+
+		<copy file="${build}/gssim.jar" tofile="${to-grms}/gssim.jar" />
+		<copy file="start-gssim.sh" tofile="${to-grms}/start-gssim.sh" />
+		<chmod file="${to-grms}/start-gssim.sh" perm="ugo+rx" />
+	</target>
+
+	<!-- removes directory for preparation to grms from the file system -->
+	<target name="grms.clean">
+		<delete dir="${to-grms}" />
+	</target>
+
+	<target name="grms.install" depends="grms.prepare,  grms.clean"/>
+	
+	<!-- removes build directory from the file system -->
+	<target name="clean" depends="grms.clean">
+		<delete dir="${build}" />
+	</target>
+	
+	<!-- 
+		Start expetiment execution. This target requires an additional parameter
+		-Dconfig which points experiment configuration file.
+		Usage: ant run -Dconfig="example/experiment.properties" 
+	-->
+	<target name="run">
+		<available property="properties.file" type="file" file="${config}" value="${config}" />
+		<antcall target="runExperiment" />
+	</target>
+
+	<target name="runExperiment" depends="compile" if="properties.file">
+		<echo message="Running experiment described in: ${properties.file}" />
+
+		<java classname="simulator.DataCenterWorkloadSimulator" classpath="${build}/classes" fork="true">
+			<arg file="${properties.file}" />
+			<classpath>
+				<path refid="class.path" />
+				<pathelement path="${jars}/junit-4.4.jar" />
+				<pathelement path="${jars}/log4j-1.2.13.jar" />
+				<pathelement path="${jars}/xalan-2.6.jar" />
+				<pathelement path="${jars}/castor_snapshot/castor-xml-1.2.1-SNAPSHOT.jar" />
+				<pathelement path="${jars}/xerces/xerces-2_9_0/xercesImpl.jar" />
+				<pathelement path="${jars}/xerces/xerces-2_9_0/xml-apis.jar" />
+				<dirset dir="properties" />
+			</classpath>
+		</java>
+	</target>
+
+</project>
Index: DCWoRMS/trunk/build/classes/eduni/simjava/distributions/GeneralGenerator.java
===================================================================
--- DCWoRMS/trunk/build/classes/eduni/simjava/distributions/GeneralGenerator.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/eduni/simjava/distributions/GeneralGenerator.java	(revision 477)
@@ -0,0 +1,10 @@
+package eduni.simjava.distributions;
+
+import cern.jet.random.AbstractDistribution;
+
+public class GeneralGenerator extends AbstractSpecificGenerator{
+
+	public GeneralGenerator(AbstractDistribution generator) {
+		super(generator);
+	}
+}
Index: DCWoRMS/trunk/build/classes/eduni/simjava/distributions/PeriodicGenerator.java
===================================================================
--- DCWoRMS/trunk/build/classes/eduni/simjava/distributions/PeriodicGenerator.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/eduni/simjava/distributions/PeriodicGenerator.java	(revision 477)
@@ -0,0 +1,63 @@
+package eduni.simjava.distributions;
+
+import java.util.Date;
+
+import cern.jet.random.AbstractDistribution;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+public class PeriodicGenerator extends AbstractSpecificGenerator{
+	
+	private long beginValidTime;
+	private long endValidTime;
+	private boolean useTime;
+	
+	public PeriodicGenerator(AbstractDistribution generator){
+		super(generator);
+		this.useTime = false;
+	}
+	
+	public PeriodicGenerator(AbstractDistribution generator, Date beginValidTime, Date endValidTime){
+		super(generator);
+		this.beginValidTime = beginValidTime.getTime();
+		this.endValidTime = endValidTime.getTime();
+		useTime = true;
+	}
+	
+	
+	public boolean isValid(long time){
+		if(!useTime) return true;
+		
+		if(time >= beginValidTime && time <= endValidTime)
+			return true;
+		else
+			return false;
+	}
+	
+	public boolean isValid(Date time){
+		if(time == null)
+			return false;
+		
+		return isValid(time.getTime());
+	}
+	
+	public long getBeginValidTime_L(){
+		return beginValidTime;
+	}
+	
+	public long getEndValidTime_L(){
+		return endValidTime;
+	}
+	
+	public Date getBeginValidTime_D(){
+		return new Date(beginValidTime);
+	}
+	
+	public Date getEndValidTime_D(){
+		return new Date(endValidTime);
+	}
+	
+}
Index: DCWoRMS/trunk/build/classes/eduni/simjava/distributions/DetailDistGenerator.java
===================================================================
--- DCWoRMS/trunk/build/classes/eduni/simjava/distributions/DetailDistGenerator.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/eduni/simjava/distributions/DetailDistGenerator.java	(revision 477)
@@ -0,0 +1,49 @@
+package eduni.simjava.distributions;
+
+import cern.jet.random.AbstractDistribution;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+
+public class DetailDistGenerator extends AbstractSpecificGenerator {
+	
+	/**
+	 * interval length
+	 */ 
+	private double prcnt;
+	
+	public DetailDistGenerator(AbstractDistribution generator){
+		super(generator);
+		this.prcnt = 0;
+	}
+	
+	public DetailDistGenerator(AbstractDistribution generator, double prcnt){
+		super(generator);
+		this.prcnt = prcnt;
+	}
+
+	/**
+	 * Returns percentage interval length.
+	 * @return
+	 */
+	public double getPrcnt(){
+		return prcnt;
+	}
+
+	public int compareTo(AbstractSpecificGenerator o) {
+		if(o instanceof DetailDistGenerator) {
+			
+			DetailDistGenerator ddg = (DetailDistGenerator) o;
+			double anotherPrcnt = ddg.getPrcnt();
+			return Double.compare(prcnt, anotherPrcnt);
+			
+		} else {
+			return -1;
+		}
+		
+	}
+	
+}
Index: DCWoRMS/trunk/build/classes/eduni/simjava/distributions/AbstractSpecificGenerator.java
===================================================================
--- DCWoRMS/trunk/build/classes/eduni/simjava/distributions/AbstractSpecificGenerator.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/eduni/simjava/distributions/AbstractSpecificGenerator.java	(revision 477)
@@ -0,0 +1,36 @@
+package eduni.simjava.distributions;
+
+import cern.jet.random.AbstractDistribution;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+
+public abstract class AbstractSpecificGenerator implements Comparable<AbstractSpecificGenerator>{
+	protected AbstractDistribution generator;
+	
+	protected double lastGeneraterdValue;
+	
+	public AbstractSpecificGenerator(AbstractDistribution generator){
+		this.generator = generator;
+		this.lastGeneraterdValue = generator.nextDouble();
+	}
+	
+	public double getLastGeneratedValue(){
+		return lastGeneraterdValue;
+	}
+	
+	public void setLastGeneratedValue(double value){
+		lastGeneraterdValue = value;
+	}
+	
+	public AbstractDistribution getGenerator(){
+		return generator;
+	}
+	
+	public int compareTo(AbstractSpecificGenerator o){
+		return -1;
+	}
+}
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 477)
@@ -0,0 +1,49 @@
+package org.joda.time;
+
+import java.util.Calendar;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import eduni.simjava.Sim_system;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+
+public class VCMilisProvider extends DateTimeUtils.MillisProvider {
+
+	private Log log = LogFactory.getLog(VCMilisProvider.class);
+	
+	// start time offset
+	protected long startTime; 
+	
+	public VCMilisProvider(Calendar initTime){
+
+		// cut milliseconds
+		String msg = "Cut start time milliseconds " + initTime.getTime() + 
+					" (" + initTime.getTimeInMillis() + ") to ";
+		
+		initTime.set(Calendar.MILLISECOND, 0);
+		
+		log.debug(msg + initTime.getTime() + 
+				" (" + initTime.getTimeInMillis() + ")");
+		 
+		this.startTime = initTime.getTimeInMillis();
+	}
+	
+	long getMillis() {
+		
+		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
+		vc = vc * 1000;
+		
+		return this.startTime + vc;
+	}
+
+}
Index: DCWoRMS/trunk/build/classes/org/joda/time/DateTimeUtilsExt.java
===================================================================
--- DCWoRMS/trunk/build/classes/org/joda/time/DateTimeUtilsExt.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/org/joda/time/DateTimeUtilsExt.java	(revision 477)
@@ -0,0 +1,52 @@
+package org.joda.time;
+
+import java.lang.reflect.Field;
+import java.util.Calendar;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.joda.time.DateTimeUtils;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+
+public class DateTimeUtilsExt extends DateTimeUtils {
+	
+	private static Log log = LogFactory.getLog(DateTimeUtilsExt.class);
+	private static Calendar offsetTime;
+	
+	public static void initVirtualTimeAccess(Calendar startTime){
+		offsetTime = startTime;
+		try {
+			Field privateStringField = DateTimeUtils.class.
+										getDeclaredField("cMillisProvider");
+			privateStringField.setAccessible(true);
+			privateStringField.set(null, new VCMilisProvider(startTime));
+			privateStringField.setAccessible(false);
+			
+			log.info("org.joda.time PACKAGE IS USING SIMJAVA VIRTUAL CLOCK " +
+									"TO DETERMINE CURRENT TIME.");
+			
+		} catch (SecurityException e) {
+			e.printStackTrace();
+		} catch (NoSuchFieldException e) {
+			e.printStackTrace();
+		} catch (IllegalArgumentException e) {
+			e.printStackTrace();
+		} catch (IllegalAccessException e) {
+			e.printStackTrace();
+		}
+	}
+	
+	public static DateTime getDateTimeAt(double vtime){
+		DateTime dt = new DateTime(offsetTime.getTimeInMillis());
+		return dt.plusSeconds((int) vtime);
+	}
+	
+	public static Calendar getOffsetTime(){
+		return offsetTime;
+	}
+}
Index: DCWoRMS/trunk/build/classes/qcg/shared/constants/BrokerConstants.java
===================================================================
--- DCWoRMS/trunk/build/classes/qcg/shared/constants/BrokerConstants.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/qcg/shared/constants/BrokerConstants.java	(revision 477)
@@ -0,0 +1,112 @@
+/*
+ * Created on Jun 13, 2004
+ *
+ */
+package qcg.shared.constants;
+
+
+/**
+ * @author yulo
+ *
+ */
+public interface BrokerConstants {
+    
+    public static final short SUBMITION_NOTIFICATION = 0;
+    public static final short MIGRATION_NOTIFICATION = 1;
+    //public static final short MIGRATION_PENDING_NOTIFICATION = 2;
+    public static final short IMPROVE_NOTIFICATION = 2;
+    
+    public static final long JOB_STATUS_UNCOMMITTED = 1;
+    public static final long JOB_STATUS_SUBMITTED = 2;
+    public static final long JOB_STATUS_ACTIVE = 4;
+    public static final long JOB_STATUS_FINISHED = 8;
+    public static final long JOB_STATUS_FAILED = 16;
+    public static final long JOB_STATUS_CANCELED = 32;
+    public static final long JOB_STATUS_SUSPENDED = 64;
+    public static final long JOB_STATUS_BROKEN = 128;
+    
+    public static final long TASK_STATUS_UNSUBMITTED = 1;
+    public static final long TASK_STATUS_QUEUED = 2;
+    public static final long TASK_STATUS_PREPROCESSING = 4;
+    public static final long TASK_STATUS_PENDING = 8;
+    public static final long TASK_STATUS_RUNNING = 16;
+    public static final long TASK_STATUS_STOPPED = 32;
+    public static final long TASK_STATUS_POSTPROCESSING = 64;
+    public static final long TASK_STATUS_FINISHED = 128;
+    public static final long TASK_STATUS_SUSPENDED = 256;
+    public static final long TASK_STATUS_FAILED = 512;
+    public static final long TASK_STATUS_CANCELED = 1024;
+    public static final long TASK_STATUS_UNCOMMITTED = 2048;
+    
+    public static final int LOCAL_STATUS_UNKNOWN = 0;
+    public static final int LOCAL_STATUS_PENDING = 1;
+    public static final int LOCAL_STATUS_ACTIVE = 2;
+    public static final int LOCAL_STATUS_FAILED = 4;
+    public static final int LOCAL_STATUS_DONE = 8;
+    public static final int LOCAL_STATUS_SUSPENDED = 16;
+    public static final int LOCAL_STATUS_UNSUBMITTED = 32;
+    public static final int LOCAL_STATUS_CANCELED = 64;
+      
+    
+    public static final int QUEUE_ACTIVE = 0;
+    public static final int QUEUE_PENDING = 1;
+    
+    public static final long TASK_QUEUED                = 1;
+    public static final long TASK_RESOURCE              = 2;
+    public static final long TASK_RESOURCE_DONE         = 4;
+    public static final long TASK_STAGE_IN              = 8;
+    public static final long TASK_STAGE_IN_DONE         = 16;
+    public static final long TASK_SUBMIT                = 32;
+    public static final long TASK_SUBMIT_DONE           = 64;
+    public static final long TASK_EXEC                  = 128;
+    public static final long TASK_EXEC_PENDING          = 256;
+    public static final long TASK_EXEC_ACTIVE           = 512;
+    public static final long TASK_EXEC_DONE             = 1024;
+    public static final long TASK_STAGE_OUT             = 2048;
+    public static final long TASK_STAGE_OUT_DONE        = 4096;
+    public static final long TASK_DONE                  = 8192;
+    public static final long TASK_FAILED                = 16384;
+    public static final long TASK_CANCEL_DONE           = 32768;
+    public static final long TASK_CANCEL_FAILED         = 65536;
+    public static final long MIGRATE_QUEUED             = 1 << 17;
+    public static final long MIGRATE_EXEC_SUSPEND       = 1 << 18;
+    public static final long MIGRATE_EXEC_SUSPEND_DONE  = 1 << 19;
+    public static final long MIGRATE_RESOURCE           = 1 << 20;
+    public static final long MIGRATE_RESOURCE_DONE      = 1 << 21;
+    public static final long MIGRATE_STAGE_IN           = 1 << 22;
+    public static final long MIGRATE_STAGE_IN_DONE      = 1 << 23;
+    public static final long MIGRATE_SUBMIT             = 1 << 24;
+    public static final long MIGRATE_DONE               = 1 << 25;
+    public static final long MIGRATE_FAILED             = 1 << 26;
+    public static final long MIGRATE_STAGE_OUT          = 1 << 27;
+    public static final long MIGRATE_STAGE_OUT_DONE     = 1 << 28;
+    public static final long REQUEST_FAILED             = 1 << 29;
+    public static final long TASK_CANCEL                = 1 << 30;
+    public static final long TASK_UNSUBMITTED           = 1 << 31;
+    public static final long TASK_UNCOMMITTED           = 1 << 32;
+    
+    public static final int PARAM_HOST = 0;
+    public static final int PARAM_LRM = 1;
+    public static final int PARAM_MEM = 2;
+    public static final int PARAM_CPUS = 3;
+    public static final int PARAM_SPEED = 4;
+    public static final int PARAM_OSTYPE = 5;
+    public static final int PARAM_OSVER = 6;
+    public static final int PARAM_OSREL = 7;
+    public static final int PARAM_BAND = 8;
+    public static final int PARAM_LAT = 9;
+    public static final int PARAM_CAP = 10;
+    public static final int PARAM_TYPE = 11;
+    public static final int PARAM_FREEMEM = 12;
+    public static final int PARAM_FREECPU = 13;
+    
+    public final static String CONFIG_FNAME = "./etc/config.prop";
+    public final static String ERRORS_FNAME = "./etc/errors.prop";
+    
+    public static final int SUBMITION_TYPE = 0;
+    public static final int MIGRATION_TYPE = 1;
+    public static final int MIGRATION_TYPE_DESC = 2;
+    public static final int MIGRATION_TYPE_NODESC = 3;
+    public static final int RESUME_TYPE_DESC = 4;
+    public static final int RESUME_TYPE_NODESC = 5;
+}
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 477)
@@ -0,0 +1,70 @@
+package example.timeestimation;
+
+import gssim.schedframe.scheduling.ExecTask;
+
+import java.util.Map;
+
+import schedframe.Parameters;
+import schedframe.PluginConfiguration;
+import schedframe.events.scheduling.SchedulingEvent;
+import schedframe.resources.units.PEUnit;
+import schedframe.resources.units.ResourceUnit;
+import schedframe.resources.units.ResourceUnitName;
+import schedframe.resources.units.StandardResourceUnitName;
+
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+public class DefaultTimeEstimationPlugin implements schedframe.scheduling.plugin.estimation.ExecutionTimeEstimationPlugin{
+
+	/*
+	 * 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).
+	 * 
+	 * Example implementation calculate the estimation based on cpu processing power.
+	 * There is also a simple assumption, that cpu processing power is a linear function
+	 * of number of allocated cpus and their speed.
+	 */
+	public double execTimeEstimation(SchedulingEvent event,
+			Map<ResourceUnitName, ResourceUnit> allocatedResources,
+			ExecTask task, double completionPercentage) {
+		
+		// collect all information necessary to do the calculation
+		PEUnit peUnit = (PEUnit) allocatedResources.get(StandardResourceUnitName.PE);
+
+		// obtain single pe speed
+		int speed = peUnit.getSpeed();
+
+		// number of used pe  
+		int cnt = peUnit.getUsedAmount();
+
+		double remainingLength =  task.getLength() * (1- completionPercentage);
+		// do the calculation
+		double execTime = (remainingLength / (cnt * speed));
+
+		// if the result is very close to 0, but less then one millisecond then round this result to 0.001
+		if (Double.compare(execTime, 0.001) < 0) {
+			execTime = 0.001;
+		}
+
+		// time is measured in integer units, so get the nearest execTime int value.
+		execTime = Math.ceil(execTime);
+		return execTime;
+	}
+
+	public PluginConfiguration getConfiguration() {
+		return null;
+	}
+
+	public String getName() {
+		return "ExampleTimeEstimationPlugin";
+	}
+
+	public void init(Parameters parameters) {
+	}
+
+}
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 477)
@@ -0,0 +1,86 @@
+package example.globalplugin;
+
+import java.util.List;
+import java.util.Properties;
+import java.util.Random;
+
+import schedframe.events.scheduling.SchedulingEvent;
+import schedframe.scheduling.SchedulerDescription;
+import schedframe.scheduling.manager.resources.ResourceManager;
+import schedframe.scheduling.manager.tasks.JobRegistry;
+import schedframe.scheduling.plan.SchedulingPlanInterface;
+import schedframe.scheduling.plan.impl.Allocation;
+import schedframe.scheduling.plan.impl.ScheduledTask;
+import schedframe.scheduling.plan.impl.SchedulingPlan;
+import schedframe.scheduling.plugin.grid.Module;
+import schedframe.scheduling.plugin.grid.ModuleList;
+import schedframe.scheduling.plugin.grid.ResourceDiscovery;
+import schedframe.scheduling.queue.TaskQueue;
+import schedframe.scheduling.queue.TaskQueueList;
+import schedframe.scheduling.tasks.TaskInterface;
+import schedframe.scheduling.tasks.WorkloadUnit;
+
+public class GridFCFSRandomPlugin extends BaseGlobalPlugin {
+
+	private Random rand;
+	
+	public GridFCFSRandomPlugin() {
+		rand = new Random(5);
+	}
+	
+	public SchedulingPlanInterface schedule(SchedulingEvent event,
+			TaskQueueList queues, 
+			JobRegistry jobRegistry,
+			ResourceManager resourceManager, ModuleList modules)  {
+		
+		ResourceDiscovery resources = null;
+		for(int i = 0; i < modules.size(); i++){
+			Module m = modules.get(i);
+			switch(m.getType()){
+				case RESOURCE_DISCOVERY: resources = (ResourceDiscovery) m;
+					break;
+			}
+		}
+		
+		SchedulingPlan plan = new SchedulingPlan();
+		
+		TaskQueue q = queues.get(0);
+		int size = q.size();
+		
+		// order of the resources on this list is not determined
+		List<SchedulerDescription> availableResources = resources.getResources(null);
+		int resourceIdx = -1;
+		
+		for(int i = 0; i < size; i++) {
+			WorkloadUnit<?> job = q.remove(0);
+			TaskInterface<?> task = (TaskInterface<?>)job;
+			
+			resourceIdx = rand.nextInt(availableResources.size());
+			SchedulerDescription sd = availableResources.get(resourceIdx);
+			
+			Allocation allocation = new Allocation();
+			allocation.setProcessesCount(1);
+			allocation.setProviderName(sd.getProvider().getProviderId());
+			
+			ScheduledTask scheduledTask = new ScheduledTask(task);
+			scheduledTask.setTaskId(task.getId());
+			scheduledTask.setJobId(task.getJobId());
+			scheduledTask.addAllocation(allocation);		
+			
+			plan.addTask(scheduledTask);
+
+		}
+		return plan;
+		
+	}
+
+
+	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 477)
@@ -0,0 +1,83 @@
+package example.globalplugin;
+
+import java.util.LinkedList;
+import java.util.List;
+
+import schedframe.events.scheduling.SchedulingEvent;
+import schedframe.scheduling.SchedulerDescription;
+import schedframe.scheduling.manager.resources.ResourceManager;
+import schedframe.scheduling.manager.tasks.JobRegistry;
+import schedframe.scheduling.plan.SchedulingPlanInterface;
+import schedframe.scheduling.plan.impl.Allocation;
+import schedframe.scheduling.plan.impl.ScheduledTask;
+import schedframe.scheduling.plan.impl.SchedulingPlan;
+import schedframe.scheduling.plugin.grid.Module;
+import schedframe.scheduling.plugin.grid.ModuleList;
+import schedframe.scheduling.plugin.grid.ResourceDiscovery;
+import schedframe.scheduling.queue.TaskQueue;
+import schedframe.scheduling.queue.TaskQueueList;
+import schedframe.scheduling.tasks.TaskInterface;
+import schedframe.scheduling.tasks.WorkloadUnit;
+
+public class GridFCFSRoundRobinPlugin extends BaseGlobalPlugin {
+
+	private LinkedList<String> lastUsedResources = new LinkedList<String>();
+
+	public SchedulingPlanInterface schedule(SchedulingEvent event,
+			TaskQueueList queues, 
+			JobRegistry jobRegistry,
+			ResourceManager resourceManager, ModuleList modules)  {
+	
+		ResourceDiscovery resources = null;
+		for(int i = 0; i < modules.size(); i++){
+			Module m = modules.get(i);
+			switch(m.getType()){
+				case RESOURCE_DISCOVERY: resources = (ResourceDiscovery) m;
+					break;
+			}
+		}
+		
+		SchedulingPlan plan = new SchedulingPlan();
+		
+		TaskQueue q = queues.get(0);
+		int size = q.size();
+		
+		// order of the resources on this list is not determined
+		List<SchedulerDescription> availableResources = resources.getResources();
+		
+		for(int i = 0; i < size; i++) {
+			WorkloadUnit<?> job = q.remove(0);
+			TaskInterface<?> task = (TaskInterface<?>)job;
+			
+			SchedulerDescription sd = availableResources.get(availableResources.size() - 1);
+			for(SchedulerDescription schedDesc: availableResources){
+				if(!lastUsedResources.contains(schedDesc.getProvider().getProviderId())){
+					if(lastUsedResources.size() + 1 >= availableResources.size()){
+						lastUsedResources.poll();
+					}
+					lastUsedResources.add(schedDesc.getProvider().getProviderId());
+					sd = schedDesc;
+					break;
+				}
+			}
+		
+			Allocation allocation = new Allocation();
+			allocation.setProcessesCount(1);
+			allocation.setProviderName(sd.getProvider().getProviderId());
+			System.out.println("----" + sd.getProvider().getProviderId());
+			ScheduledTask scheduledTask = new ScheduledTask(task);
+			scheduledTask.setTaskId(task.getId());
+			scheduledTask.setJobId(task.getJobId());
+			scheduledTask.addAllocation(allocation);		
+			
+			plan.addTask(scheduledTask);
+		}
+		return plan;
+	}
+
+	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 477)
@@ -0,0 +1,49 @@
+package example.globalplugin;
+
+import schedframe.Parameters;
+import schedframe.PluginConfiguration;
+import schedframe.events.scheduling.SchedulingEventType;
+import schedframe.scheduling.WorkloadUnitListImpl;
+import schedframe.scheduling.manager.resources.ResourceManager;
+import schedframe.scheduling.plugin.SchedulingPluginConfiguration;
+import schedframe.scheduling.plugin.grid.GlobalSchedulingPlugin;
+import schedframe.scheduling.plugin.grid.ModuleList;
+import schedframe.scheduling.queue.TaskQueue;
+import schedframe.scheduling.queue.TaskQueueList;
+import schedframe.scheduling.tasks.WorkloadUnit;
+import schemas.StringValueWithUnit;
+
+public abstract class BaseGlobalPlugin implements GlobalSchedulingPlugin {
+
+	SchedulingPluginConfiguration plugConf;
+	
+	public PluginConfiguration getConfiguration() {
+		return plugConf;
+	}
+	
+	public int placeJobsInQueues(WorkloadUnitListImpl newJobs, TaskQueueList queues, ResourceManager resourceManager,
+			ModuleList moduleList) {
+
+		// get the first queue from all available queues.
+		TaskQueue queue = queues.get(0);
+
+		for (int i = 0; i < newJobs.size(); i++) {
+			WorkloadUnit<?> task = newJobs.get(i);
+			queue.add(task);
+		}
+
+		return 0;
+	}
+	
+	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){
+			
+		}
+	}
+	
+	
+}
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 477)
@@ -0,0 +1,107 @@
+package example.globalplugin;
+
+
+import java.util.List;
+import java.util.Properties;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import schedframe.events.scheduling.SchedulingEvent;
+import schedframe.scheduling.SchedulerDescription;
+import schedframe.scheduling.manager.resources.ResourceManager;
+import schedframe.scheduling.manager.tasks.JobRegistry;
+import schedframe.scheduling.plan.SchedulingPlanInterface;
+import schedframe.scheduling.plan.impl.Allocation;
+import schedframe.scheduling.plan.impl.ScheduledTask;
+import schedframe.scheduling.plan.impl.SchedulingPlan;
+import schedframe.scheduling.plugin.grid.Module;
+import schedframe.scheduling.plugin.grid.ModuleList;
+import schedframe.scheduling.plugin.grid.ResourceDiscovery;
+import schedframe.scheduling.queue.TaskQueue;
+import schedframe.scheduling.queue.QueueDescription;
+import schedframe.scheduling.queue.TaskQueueList;
+import schedframe.scheduling.tasks.TaskInterface;
+import schedframe.scheduling.tasks.WorkloadUnit;
+
+public class GridFCFSLoadBalancingPlugin extends BaseGlobalPlugin {
+
+	private Log log = LogFactory.getLog(GridFCFSLoadBalancingPlugin.class);
+	
+	public SchedulingPlanInterface schedule(SchedulingEvent event,
+			TaskQueueList queues, 
+			JobRegistry jobRegistry,
+			ResourceManager resourceManager, ModuleList modules)  {
+	
+		ResourceDiscovery resources = null;
+		for(int i = 0; i < modules.size(); i++){
+			Module m = modules.get(i);
+			switch(m.getType()){
+				case RESOURCE_DISCOVERY: resources = (ResourceDiscovery) m;
+					break;
+			}
+		}
+		
+		SchedulingPlan plan = new SchedulingPlan();
+		
+		TaskQueue q = queues.get(0);
+		int size = q.size();
+		
+		// order of the resources on this list is not determined
+		List<SchedulerDescription> availableResources = resources.getResources();
+		int resourceIdx = -1;
+		
+		for(int i = 0; i < size; i++) {
+			WorkloadUnit<?> job = q.remove(0);
+			TaskInterface<?> task = (TaskInterface<?>)job;
+
+			resourceIdx = findLeastLoadedResourceIdx(availableResources);
+			SchedulerDescription sd = availableResources.get(resourceIdx);
+			
+			Allocation allocation = new Allocation();
+			allocation.setProcessesCount(1);
+			allocation.setProviderName(sd.getProvider().getProviderId());
+			
+			ScheduledTask scheduledTask = new ScheduledTask(task);
+			scheduledTask.setTaskId(task.getId());
+			scheduledTask.setJobId(task.getJobId());
+			scheduledTask.addAllocation(allocation);		
+			
+			plan.addTask(scheduledTask);
+		}
+		return plan;
+		
+	}
+
+	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);
+			long totalLoad = getQueueLoad(sd.getAvailableQueues());
+			if(totalLoad < minLoad){
+				resourceIdx = i;
+				minLoad = totalLoad;
+			}
+		}
+		return resourceIdx;
+	}
+
+	private long getQueueLoad(List<QueueDescription> queues){
+		long load = 0;
+		for(QueueDescription queue : queues){
+			load = load + queue.getLoad();
+		}
+		return load;
+	}
+	
+}
Index: DCWoRMS/trunk/build/classes/example/energy/DefaultEnergyEstimationPlugin.java
===================================================================
--- DCWoRMS/trunk/build/classes/example/energy/DefaultEnergyEstimationPlugin.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/example/energy/DefaultEnergyEstimationPlugin.java	(revision 477)
@@ -0,0 +1,11 @@
+package example.energy;
+
+
+public class DefaultEnergyEstimationPlugin extends BaseEnergyEstimationPlugin{
+
+	@Override
+	public String getName() {
+		return getClass().getName();
+	}
+
+}
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 477)
@@ -0,0 +1,33 @@
+package example.energy;
+
+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.power.StandardPowerStateName;
+import schedframe.scheduling.manager.tasks.JobRegistry;
+
+public class CPUEnergyEstimationPlugin extends BaseEnergyEstimationPlugin  {
+
+	@Override
+	public double estimatePowerConsumption(EnergyEvent event, JobRegistry jobRegistry,
+			ComputingResource resource) {
+		Processor cpu = (Processor)resource;
+		if(resource.getPowerInterface().getPowerState().getName().equals(StandardPowerStateName.OFF))
+			return 0;
+		if(resource.getStatus() == ResourceStatus.BUSY)
+			try {
+				return cpu.getPowerInterface().getPowerConsumption(cpu.getPowerInterface().getPState());
+			} catch (NoSuchFieldException e) {
+				return 0;
+			}
+		else 
+			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 477)
@@ -0,0 +1,46 @@
+package example.energy;
+
+import schedframe.Parameters;
+import schedframe.PluginConfiguration;
+import schedframe.resources.computing.ComputingResource;
+import schedframe.resources.computing.profiles.energy.EnergyEvent;
+import schedframe.resources.computing.profiles.energy.power.plugin.EnergyEstimationPlugin;
+import schedframe.scheduling.manager.tasks.JobRegistry;
+
+public abstract class BaseEnergyEstimationPlugin implements EnergyEstimationPlugin {
+
+	@Override
+	public PluginConfiguration getConfiguration() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+	
+	@Override
+	public double estimatePowerConsumption(EnergyEvent event, JobRegistry jobRegistry, ComputingResource resource) {
+		double power = 0;
+		try {
+			return resource.getPowerInterface().getPowerConsumption(resource.getPowerInterface().getPowerState());
+		} catch (NoSuchFieldException e) {
+			power = 0;
+		}
+		for(ComputingResource child:resource.getChildren()){
+			power = power + child.getPowerInterface().getRecentPowerUsage().getValue(); 
+		}
+		return power;
+	}
+
+	@Override
+	public double estimateEnergyDissipation(EnergyEvent event, JobRegistry jobRegistry, ComputingResource resourceManager) {
+		throw new RuntimeException("Not implemented.");
+	}
+
+	@Override
+	public double estimateTemperature(EnergyEvent event, JobRegistry jobRegistry, ComputingResource resourceManager) {
+		throw new RuntimeException("Not implemented.");
+	}
+	
+	public void init(Parameters parameters) {
+
+	}
+
+}
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 477)
@@ -0,0 +1,29 @@
+package example.energy;
+
+import schedframe.resources.computing.ComputingNode;
+import schedframe.resources.computing.ComputingResource;
+import schedframe.resources.computing.profiles.energy.EnergyEvent;
+import schedframe.resources.computing.profiles.energy.power.PowerUsage;
+import schedframe.scheduling.manager.tasks.JobRegistry;
+
+public class DataCenterEnergyEstimationPlugin extends BaseEnergyEstimationPlugin{
+
+	@Override
+	public double estimatePowerConsumption(EnergyEvent event, JobRegistry jobRegistry,
+			ComputingResource resource) {
+		double power = 0;
+		for(ComputingResource child:resource.getChildren()){
+			ComputingNode node = (ComputingNode)child;
+			PowerUsage powerUsage = node.getPowerInterface().getRecentPowerUsage();
+			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 477)
@@ -0,0 +1,36 @@
+package example.energy;
+
+import schedframe.resources.computing.ComputingNode;
+import schedframe.resources.computing.ComputingResource;
+import schedframe.resources.computing.Processor;
+import schedframe.resources.computing.profiles.energy.EnergyEvent;
+import schedframe.scheduling.manager.tasks.JobRegistry;
+
+public class ComputingNodeEnergyEstimationPlugin extends BaseEnergyEstimationPlugin {
+
+	@Override
+	public double estimatePowerConsumption(EnergyEvent event, JobRegistry jobRegistry,
+			ComputingResource resource) {
+		double power = 0;
+		ComputingNode node = (ComputingNode) resource;
+		for(Processor cpu: node.getProcessors()){
+			try{
+				power = power + cpu.getPowerInterface().getRecentPowerUsage().getValue();
+			} catch(Exception e){
+				//power = power + cpu.getPowerInterface().getPowerConsumption(cpu.getPowerInterface().getPowerState());
+			}
+		}
+
+		try {
+			power += node.getPowerInterface().getPowerConsumption(node.getPowerInterface().getPowerState());
+		} catch (NoSuchFieldException e) {
+		}
+
+		return power;
+	}
+
+	public String getName() {
+		return getClass().getName();
+	}
+
+}
Index: DCWoRMS/trunk/build/classes/example/localplugin/BaseLocalPlugin.java
===================================================================
--- DCWoRMS/trunk/build/classes/example/localplugin/BaseLocalPlugin.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/example/localplugin/BaseLocalPlugin.java	(revision 477)
@@ -0,0 +1,114 @@
+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.WorkloadUnitListImpl;
+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 schedframe.scheduling.tasks.WorkloadUnit;
+import schemas.StringValueWithUnit;
+
+public abstract class BaseLocalPlugin implements LocalSchedulingPlugin {
+
+	SchedulingPluginConfiguration plugConf;
+	
+	public PluginConfiguration getConfiguration() {
+		return plugConf;
+	}
+	
+	public SchedulingResponseType handleResourceAllocationViolation(SchedulingEvent event,
+			TaskQueueList queues, 
+			JobRegistryImpl jobRegistry, 
+					ResourceManager resourceManager, ModuleList modules){
+		SchedulingResponseType timeEvent = null;
+		switch(event.getType()){
+			case TASK_REQUESTED_TIME_EXPIRED: 
+				timeEvent = SchedulingResponseType.KILL_TASK;
+				break;
+		}
+		return timeEvent;
+	}
+	
+	public int placeJobsInQueues(WorkloadUnitListImpl newJobs,
+			TaskQueueList queues, 
+			ResourceManager resourceManager, ModuleList moduleList) {
+		
+		// get the first queue from all available queues.
+		TaskQueue queue = queues.get(0);
+
+		for(int i = 0; i < newJobs.size(); i++){
+			WorkloadUnit<?> task = newJobs.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){
+			
+		}
+	}
+}
Index: DCWoRMS/trunk/build/classes/example/localplugin/FCFSEnergyAwareClusterLocalPlugin.java
===================================================================
--- DCWoRMS/trunk/build/classes/example/localplugin/FCFSEnergyAwareClusterLocalPlugin.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/example/localplugin/FCFSEnergyAwareClusterLocalPlugin.java	(revision 477)
@@ -0,0 +1,103 @@
+package example.localplugin;
+
+import gridsim.Gridlet;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+
+import schedframe.events.scheduling.SchedulingEvent;
+import schedframe.resources.computing.ComputingNode;
+import schedframe.scheduling.manager.resources.ClusterResourceManager;
+import schedframe.scheduling.manager.resources.ResourceManager;
+import schedframe.scheduling.manager.tasks.JobRegistry;
+import schedframe.scheduling.plan.SchedulingPlanInterface;
+import schedframe.scheduling.plan.impl.SchedulingPlan;
+import schedframe.scheduling.plugin.grid.ModuleList;
+import schedframe.scheduling.queue.TaskQueue;
+import schedframe.scheduling.queue.TaskQueueList;
+import schedframe.scheduling.tasks.TaskInterface;
+import schedframe.scheduling.tasks.WorkloadUnit;
+
+public class FCFSEnergyAwareClusterLocalPlugin extends BaseLocalPlugin {
+
+	public FCFSEnergyAwareClusterLocalPlugin () {
+	}
+
+	public SchedulingPlanInterface schedule(SchedulingEvent event, TaskQueueList queues, JobRegistry jobRegistry,
+			ResourceManager resManager, ModuleList modules) {
+
+		ClusterResourceManager resourceManager = (ClusterResourceManager) resManager;
+		SchedulingPlan plan = new SchedulingPlan();
+		// chose the events types to serve.
+		// Different actions for different events are possible.
+		switch (event.getType()) {
+		case START_TASK_EXECUTION:
+		case TASK_FINISHED:
+			// our tasks are placed only in first queue (see
+			// BaseLocalPlugin.placeJobsInQueues() method)
+			TaskQueue q = queues.get(0);
+			// check all tasks in queue
+
+			for (int i = 0; i < q.size(); i++) {
+				WorkloadUnit<?> job = q.get(i);
+				TaskInterface<?> task = (TaskInterface<?>) job;
+				// if status of the tasks in READY
+				if (task.getStatus() == Gridlet.READY) {
+
+					String nodeName = chooseProviderForExecution(resourceManager, task);
+					if (nodeName != null) {
+						addToSchedulingPlan(plan, task, nodeName);
+					}
+				}
+			}
+
+			break;
+		}
+		return plan;
+	}
+
+	private String chooseProviderForExecution(ClusterResourceManager resourceManager, TaskInterface<?> task) {
+		int cpuRequest;
+		try {
+			cpuRequest = Double.valueOf(task.getCpuCntRequest()).intValue();
+		} catch (NoSuchFieldException e) {
+			cpuRequest = 1;
+		}
+		List<ComputingNode> nodes = resourceManager.getComputingNodes();
+		nodes = findSuitableNodes(cpuRequest, nodes);
+		Collections.sort(nodes, new Comparator<ComputingNode>(){
+			 
+		    public int compare(ComputingNode node1, ComputingNode node2){    
+		        return node1.getResourceCharacteristic().getParameters().get("category").get(0).getContent().compareTo(node2.getResourceCharacteristic().getParameters().get("category").get(0).getContent());
+		   
+		    }
+		});
+
+		return nodes.size() == 0 ? null : nodes.get(0).getName();
+	}
+	
+	private List<ComputingNode> findSuitableNodes(int cpuRequest, List<ComputingNode> nodes){
+		List<ComputingNode> avNodes = new ArrayList<ComputingNode>();
+		for(ComputingNode node: nodes){
+			if(node.getFreeProcessorsNumber() >= cpuRequest){
+				avNodes.add(node);
+			}
+		}
+		return avNodes;
+	}
+	
+	public String getName() {
+		return getClass().getName();
+	}
+
+	class CategoryComparator implements Comparator<String>{
+		 
+	    public int compare(String cat1, String cat2){    
+	        return cat1.compareTo(cat2);
+	   
+	    }
+	}
+}
+
Index: DCWoRMS/trunk/build/classes/example/localplugin/RackLocalPlugin.java
===================================================================
--- DCWoRMS/trunk/build/classes/example/localplugin/RackLocalPlugin.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/example/localplugin/RackLocalPlugin.java	(revision 477)
@@ -0,0 +1,61 @@
+package example.localplugin;
+
+import gridsim.Gridlet;
+import schedframe.events.scheduling.SchedulingEvent;
+import schedframe.scheduling.manager.resources.ClusterResourceManager;
+import schedframe.scheduling.manager.resources.ResourceManager;
+import schedframe.scheduling.manager.tasks.JobRegistry;
+import schedframe.scheduling.plan.SchedulingPlanInterface;
+import schedframe.scheduling.plan.impl.SchedulingPlan;
+import schedframe.scheduling.plugin.grid.ModuleList;
+import schedframe.scheduling.queue.TaskQueue;
+import schedframe.scheduling.queue.TaskQueueList;
+import schedframe.scheduling.tasks.TaskInterface;
+import schedframe.scheduling.tasks.WorkloadUnit;
+
+public class RackLocalPlugin  extends BaseLocalPlugin {
+
+	public RackLocalPlugin() {
+	}
+
+	public SchedulingPlanInterface schedule(SchedulingEvent event, TaskQueueList queues, JobRegistry jobRegistry,
+			ResourceManager resManager, ModuleList modules) {
+
+		ClusterResourceManager resourceManager = (ClusterResourceManager) resManager;
+		SchedulingPlan plan = new SchedulingPlan();
+		// chose the events types to serve.
+		// Different actions for different events are possible.
+		switch (event.getType()) {
+		case START_TASK_EXECUTION:
+		case TASK_FINISHED:
+		//case TIMER:
+			// our tasks are placed only in first queue (see
+			// BaseLocalPlugin.placeJobsInQueues() method)
+			TaskQueue q = queues.get(0);
+			// check all tasks in queue
+
+			for (int i = 0; i < q.size(); i++) {
+				WorkloadUnit<?> job = q.get(i);
+				TaskInterface<?> task = (TaskInterface<?>) job;
+				// if status of the tasks in READY
+				if (task.getStatus() == Gridlet.READY) {
+					System.out.println(resourceManager.getSchedulers().get(0).get_name());
+					String nodeName = resourceManager.getSchedulers().get(0).get_name();
+					if (nodeName != null) {
+						addToSchedulingPlan(plan, task, nodeName);
+					}
+				}
+			}
+
+			break;
+		}
+		return plan;
+	}
+
+	
+	public String getName() {
+		return getClass().getName();
+	}
+
+
+}
Index: DCWoRMS/trunk/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 477)
@@ -0,0 +1,227 @@
+package example.localplugin;
+
+import gridsim.Gridlet;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+
+import schedframe.events.scheduling.SchedulingEvent;
+import schedframe.resources.ResourceStatus;
+import schedframe.resources.StandardResourceType;
+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.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 FCFSClusterLocalPlugin extends BaseLocalPlugin {
+
+	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() == Gridlet.READY) {
+					
+					/****************3 ways to schedule task****************/
+					
+					/****************1. Choosing particular resources to perform execution****************/
+					Map<ResourceUnitName, ResourceUnit> choosenResources = chooseResourcesForExecution2(resourceManager, task);
+					if (choosenResources != null) {
+						addToSchedulingPlan(plan, task, choosenResources);
+					}
+					
+					/****************2. Choosing resource scheduler/provider to submit task.  If the given resource doesn't contains/isn't 
+					a scheduler, random resources from the given resource will be chosen in order to perform execution****************/
+					/*String provName = chooseProviderForExecution(resourceManager);
+					if (provName != null) {
+						addToSchedulingPlan(plan, task, provName);
+					}*/
+
+					/****************3. Scheduler will choose random resources to perform execution****************/
+					//addToSchedulingPlan(plan, task);
+				}
+			}
+
+			break;
+		}
+		return plan;
+	}
+
+	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) {
+
+		Map<ResourceUnitName, ResourceUnit> map = new HashMap<ResourceUnitName, ResourceUnit>();
+		List<ComputingNode> nodes = resourceManager.getComputingNodes();
+		for (ComputingNode node : nodes) {
+			int cpuRequest;
+			try {
+				cpuRequest = Double.valueOf(task.getCpuCntRequest()).intValue();
+			} catch (NoSuchFieldException e) {
+				cpuRequest = 1;
+			}
+
+			if (cpuRequest != 0) {
+
+				List<Processor> processors = node.getProcessors();
+				if (processors.size() < cpuRequest) {
+					continue;
+				}
+
+				List<ComputingResource> 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) {
+					continue;
+				}
+
+				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) {
+
+					Memory memory = null;
+					try{
+						if (node.getFreeMemory() >= memoryRequest) {		
+							memory = new Memory(node.getMemory(), memoryRequest, memoryRequest);
+						}		
+					} catch(NoSuchFieldException e){
+						continue;
+					}
+					if(memory == null)
+						continue;
+					else {
+						map.put(StandardResourceUnitName.MEMORY, memory);
+						return map;
+					}
+				}
+			}
+		}
+	
+		return null;
+	}
+
+	@SuppressWarnings("unchecked")
+	private String chooseProviderForExecution(ResourceManager unitsManager) {
+		List<ComputingResource> processingElements;
+		Properties properties = new Properties();
+		properties.setProperty("type", StandardResourceType.ComputingNode.toString());
+		// properties.setProperty("status", ResourceStatus.FREE.toString());
+		processingElements = (List<ComputingResource>) unitsManager.filterResources(properties);
+		return processingElements.get(0).getName();
+	}
+
+	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 477)
@@ -0,0 +1,51 @@
+package example.localplugin;
+
+import gridsim.Gridlet;
+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;
+import schedframe.scheduling.queue.TaskQueue;
+import schedframe.scheduling.queue.TaskQueueList;
+import schedframe.scheduling.tasks.TaskInterface;
+import schedframe.scheduling.tasks.WorkloadUnit;
+
+public class FCFS_BFLocalPlugin extends BaseLocalPlugin {
+
+	public SchedulingPlanInterface<?> 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.
+		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() == Gridlet.READY) {
+					addToSchedulingPlan(plan, task);
+				}
+			}
+			break;
+		}
+		return plan;
+	}
+
+	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 477)
@@ -0,0 +1,159 @@
+package example.localplugin;
+
+import gridsim.Gridlet;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import schedframe.events.scheduling.SchedulingEvent;
+import schedframe.resources.ResourceStatus;
+import schedframe.resources.computing.ComputingNode;
+import schedframe.resources.computing.ComputingResource;
+import schedframe.resources.computing.profiles.energy.power.StandardPowerStateName;
+import schedframe.resources.units.ProcessingElements;
+import schedframe.resources.units.ResourceUnit;
+import schedframe.resources.units.ResourceUnitName;
+import schedframe.resources.units.StandardResourceUnitName;
+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 FCFSNodePowerManagementClusterLocalPlugin extends BaseLocalPlugin {
+
+	public FCFSNodePowerManagementClusterLocalPlugin () {
+	}
+
+	public SchedulingPlanInterface schedule(SchedulingEvent event, TaskQueueList queues, JobRegistry jobRegistry,
+			ResourceManager resManager, ModuleList modules) {
+
+		ClusterResourceManager resourceManager = (ClusterResourceManager) resManager;
+		SchedulingPlan plan = new SchedulingPlan();
+		// chose the events types to serve.
+		// Different actions for different events are possible.
+		switch (event.getType()) {
+		case START_TASK_EXECUTION:
+		case TASK_FINISHED:
+			// our tasks are placed only in first queue (see
+			// BaseLocalPlugin.placeJobsInQueues() method)
+			TaskQueue q = queues.get(0);
+			// check all tasks in queue
+
+			for (int i = 0; i < q.size(); i++) {
+				WorkloadUnit<?> job = q.get(i);
+				TaskInterface<?> task = (TaskInterface<?>) job;
+				// if status of the tasks in READY
+				if (task.getStatus() == Gridlet.READY) {
+
+					Map<ResourceUnitName, ResourceUnit> choosenResources = chooseResourcesForExecution(resourceManager, task);
+					if (choosenResources  != null) {
+						addToSchedulingPlan(plan, task, choosenResources);
+					} else {
+						if(harnessIdleNodesToWork(task, resourceManager.getComputingNodes()))
+							i--;
+					}
+				}
+			}
+
+			turnOffIdleNodes(resourceManager.getComputingNodes());
+
+			break;
+		}
+		return plan;
+	}
+	
+	private Map<ResourceUnitName, ResourceUnit> chooseResourcesForExecution(ClusterResourceManager resourceManager, TaskInterface<?> task) {
+
+		List<ComputingNode> nodes = resourceManager.getComputingNodes();
+		nodes = findSuitableNodes(task, nodes);
+		Collections.sort(nodes, new Comparator<ComputingNode>(){
+		    public int compare(ComputingNode node1, ComputingNode node2){    
+		        return node1.getResourceCharacteristic().getParameters().get("category").get(0).getContent().compareTo(node2.getResourceCharacteristic().getParameters().get("category").get(0).getContent());
+		    }
+		});
+		if(nodes.size() > 0)
+		{
+			Map<ResourceUnitName, ResourceUnit> map = new HashMap<ResourceUnitName, ResourceUnit>();
+			List<ComputingResource> choosenResources =  new ArrayList<ComputingResource>();
+			int cpuRequest;
+			try {
+				cpuRequest = Double.valueOf(task.getCpuCntRequest()).intValue();
+			} catch (NoSuchFieldException e) {
+				cpuRequest = 1;
+			}
+			for (int i = 0; i < nodes.get(0).getProcessors().size() && cpuRequest > 0; i++) {
+				if (nodes.get(0).getProcessors().get(i).getStatus() == ResourceStatus.FREE) {
+					choosenResources.add(nodes.get(0).getProcessors().get(i));
+					cpuRequest--;
+				}
+			}
+			ProcessingElements result = new ProcessingElements(nodes.get(0).getName());
+			result.addAll(choosenResources);
+			map.put(StandardResourceUnitName.PE, result);
+			return map;
+		} else 
+			return null;
+	}
+	
+	private List<ComputingNode> findSuitableNodes(TaskInterface<?> task, List<ComputingNode> nodes){
+		int cpuRequest;
+		try {
+			cpuRequest = Double.valueOf(task.getCpuCntRequest()).intValue();
+		} catch (NoSuchFieldException e) {
+			cpuRequest = 1;
+		}
+		List<ComputingNode> avNodes = new ArrayList<ComputingNode>();
+		for(ComputingNode node: nodes){
+			if(node.getFreeProcessorsNumber() >= cpuRequest){
+				avNodes.add(node);
+			}
+		}
+		return avNodes;
+	}
+
+	private void turnOffIdleNodes(List<ComputingNode> nodes){
+		for(ComputingNode node : nodes){
+			if(node.getFreeProcessorsNumber() == node.getProcessorsNumber()){
+				node.getPowerInterface().setPowerState(StandardPowerStateName.OFF);
+			}
+		}
+	}
+	
+	private boolean harnessIdleNodesToWork(TaskInterface<?> task, List<ComputingNode> nodes){
+		int cpuRequest;
+		try {
+			cpuRequest = Double.valueOf(task.getCpuCntRequest()).intValue();
+		} catch (NoSuchFieldException e) {
+			cpuRequest = 1;
+		}
+		Collections.sort(nodes, new Comparator<ComputingNode>(){
+		    public int compare(ComputingNode node1, ComputingNode node2){    
+		        return node1.getResourceCharacteristic().getParameters().get("category").get(0).getContent().compareTo(node2.getResourceCharacteristic().getParameters().get("category").get(0).getContent());
+		    }
+		});
+		for (int i = 0; i < nodes.size() && cpuRequest > 0; i++) {
+			ComputingNode node = nodes.get(i);
+			if(node.getPowerInterface().getPowerState() == StandardPowerStateName.OFF){
+				node.getPowerInterface().setPowerState(StandardPowerStateName.ON);
+				cpuRequest -= node.getProcessorsNumber();
+			}
+		}
+		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 477)
@@ -0,0 +1,147 @@
+package example.localplugin;
+
+import gridsim.Gridlet;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import schedframe.events.scheduling.SchedulingEvent;
+import schedframe.resources.ResourceStatus;
+import schedframe.resources.computing.ComputingNode;
+import schedframe.resources.computing.ComputingResource;
+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.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 FCFSConsolidationClusterLocalPlugin extends BaseLocalPlugin {
+
+	public FCFSConsolidationClusterLocalPlugin () {
+	}
+
+	public SchedulingPlanInterface schedule(SchedulingEvent event, TaskQueueList queues, JobRegistry jobRegistry,
+			ResourceManager resManager, ModuleList modules) {
+
+		ClusterResourceManager resourceManager = (ClusterResourceManager) resManager;
+		SchedulingPlan plan = new SchedulingPlan();
+		// chose the events types to serve.
+		// Different actions for different events are possible.
+		switch (event.getType()) {
+		case START_TASK_EXECUTION:
+		case TASK_FINISHED:
+			// our tasks are placed only in first queue (see
+			// BaseLocalPlugin.placeJobsInQueues() method)
+			TaskQueue q = queues.get(0);
+			// check all tasks in queue
+
+			for (int i = 0; i < q.size(); i++) {
+				WorkloadUnit<?> job = q.get(i);
+				TaskInterface<?> task = (TaskInterface<?>) job;
+				// if status of the tasks in READY
+				if (task.getStatus() == Gridlet.READY) {
+
+					Map<ResourceUnitName, ResourceUnit> choosenResources = null;
+					try {
+						choosenResources = chooseResourcesForExecution(resourceManager, task);
+					} catch (NoSuchFieldException e) {
+						// TODO Auto-generated catch block
+						e.printStackTrace();
+					}
+					if (choosenResources  != null) {
+						addToSchedulingPlan(plan, task, choosenResources);
+					} 
+				}
+			}
+
+			break;
+		}
+		return plan;
+	}
+	
+	private Map<ResourceUnitName, ResourceUnit> chooseResourcesForExecution(ClusterResourceManager resourceManager, TaskInterface<?> task) throws NoSuchFieldException {
+
+		List<ComputingNode> nodes = resourceManager.getComputingNodes();
+		nodes = findSuitableNodes(task, nodes);
+		Collections.sort(nodes, new Comparator<ComputingNode>(){
+		    public int compare(ComputingNode node1, ComputingNode node2){   
+		        return node1.getResourceCharacteristic().getParameters().get("category").get(0).getContent().compareTo(node2.getResourceCharacteristic().getParameters().get("category").get(0).getContent());
+		    }
+		});
+		if(nodes.size() > 0)
+		{
+			ComputingNode node = nodes.get(0);
+			Map<ResourceUnitName, ResourceUnit> map = new HashMap<ResourceUnitName, ResourceUnit>();
+			List<ComputingResource> choosenResources =  new ArrayList<ComputingResource>();
+			int cpuRequest;
+			try {
+				cpuRequest = Double.valueOf(task.getCpuCntRequest()).intValue();
+			} catch (NoSuchFieldException e) {
+				cpuRequest = 1;
+			}
+			for (int i = 0; i < node.getProcessors().size() && cpuRequest > 0; i++) {
+				if (node.getProcessors().get(i).getStatus() == ResourceStatus.FREE) {
+					choosenResources.add(node.getProcessors().get(i));
+					cpuRequest--;
+				}
+			}
+			ProcessingElements result = new ProcessingElements(node.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) {
+				Memory memory = new Memory(node.getMemory(), memoryRequest, memoryRequest);
+				map.put(StandardResourceUnitName.MEMORY, memory);
+			}
+			return map;
+		} else 
+			return null;
+	}
+	
+	private List<ComputingNode> findSuitableNodes(TaskInterface<?> task, List<ComputingNode> nodes) throws NoSuchFieldException{
+		int cpuRequest;
+		try {
+			cpuRequest = Double.valueOf(task.getCpuCntRequest()).intValue();
+		} catch (NoSuchFieldException e) {
+			cpuRequest = 1;
+		}
+		int memoryRequest;
+		try {
+			memoryRequest = Double.valueOf(task.getMemoryRequest()).intValue();
+		} catch (NoSuchFieldException e) {
+			memoryRequest = 0;
+		}
+		List<ComputingNode> suitableNodes = new ArrayList<ComputingNode>();
+		for(ComputingNode node: nodes){
+			if(node.getFreeProcessorsNumber() >= cpuRequest && node.getFreeMemory() >= memoryRequest){
+				suitableNodes.add(node);
+			}
+		}
+		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 477)
@@ -0,0 +1,195 @@
+package example.localplugin;
+
+import gridsim.Gridlet;
+
+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.ComputingResource;
+import schedframe.resources.computing.Processor;
+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.UsedResourceList;
+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.SubmittedTask;
+import schedframe.scheduling.tasks.TaskInterface;
+import schedframe.scheduling.tasks.WorkloadUnit;
+
+public class FCFSCPUFreqScalingClusterLocalPlugin extends BaseLocalPlugin {
+
+	List<Processor> allocatedCPUs;
+	public FCFSCPUFreqScalingClusterLocalPlugin () {
+		allocatedCPUs = new ArrayList<Processor>();
+	}
+
+	public SchedulingPlanInterface schedule(SchedulingEvent event, TaskQueueList queues, JobRegistry jobRegistry,
+			ResourceManager resManager, ModuleList modules) {
+
+		ClusterResourceManager resourceManager = (ClusterResourceManager) resManager;
+		SchedulingPlan plan = new SchedulingPlan();
+		// our tasks are placed only in first queue (see
+		// BaseLocalPlugin.placeJobsInQueues() method)
+		TaskQueue q = queues.get(0);
+		// chose the events types to serve.
+		// Different actions for different events are possible.
+		switch (event.getType()) {
+		
+		case START_TASK_EXECUTION:
+
+			// 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() == Gridlet.READY) {
+
+					Map<ResourceUnitName, ResourceUnit> choosenResources = chooseResourcesForExecution(resourceManager, task);
+					if (choosenResources  != null) {
+						addToSchedulingPlan(plan, task, choosenResources);
+						ProcessingElements pes = (ProcessingElements)choosenResources.get(StandardResourceUnitName.PE);
+						List<Processor> processors =  new ArrayList<Processor>();
+						for(ComputingResource res : pes){
+							processors.add((Processor) res);
+						}
+						adjustFrequency(ResourceStatus.BUSY,processors);
+					} 
+				}
+			}
+			break;
+			
+		case TASK_FINISHED:
+			TaskFinishedEvent finEvent = (TaskFinishedEvent) event;
+			SubmittedTask subTask = (SubmittedTask )jobRegistry.getSubmittedTask(finEvent.getJobId(), finEvent.getTaskId());
+			UsedResourceList<ResourceHistoryItem> usedResourcesList = subTask.getUsedResources();
+			ProcessingElements pes = (ProcessingElements)usedResourcesList.getLast().getResourceUnits().get(StandardResourceUnitName.PE);
+			List<Processor> processors =  new ArrayList<Processor>();
+			for(ComputingResource res : pes){
+				processors.add((Processor) res);
+				allocatedCPUs.add((Processor) res);
+			}
+			adjustFrequency(ResourceStatus.FREE, processors);
+			break;
+			
+		case TASK_REQUESTED_TIME_EXPIRED:
+			TaskRequestedTimeExpiredEvent timExpEvent = (TaskRequestedTimeExpiredEvent) event;
+			 subTask = (SubmittedTask )jobRegistry.getSubmittedTask(timExpEvent.getJobId(), timExpEvent.getTaskId());
+			usedResourcesList = subTask.getUsedResources();
+			pes = (ProcessingElements)usedResourcesList.getLast().getResourceUnits().get(StandardResourceUnitName.PE);
+			processors =  new ArrayList<Processor>();
+			for(ComputingResource res : pes){
+				allocatedCPUs.remove((Processor) res);
+			}
+			// 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() == Gridlet.READY) {
+
+					Map<ResourceUnitName, ResourceUnit> choosenResources = chooseResourcesForExecution(resourceManager, task);
+					if (choosenResources  != null) {
+						addToSchedulingPlan(plan, task, choosenResources);
+						pes = (ProcessingElements)choosenResources.get(StandardResourceUnitName.PE);
+						processors =  new ArrayList<Processor>();
+						for(ComputingResource res : pes){
+							processors.add((Processor) res);
+						}
+						adjustFrequency(ResourceStatus.BUSY, processors);
+					} 
+				}
+			}
+			break;
+		}
+		return plan;
+	}
+	
+	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 = resourceManager.getProcessors();
+			processors.removeAll(allocatedCPUs);
+			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();
+			result.addAll(choosenResources);
+			map.put(StandardResourceUnitName.PE, result);
+		}
+		return map;
+	}
+
+	private void adjustFrequency(ResourceStatus status, List<Processor> processors){
+		switch(status){
+		case BUSY:
+			for(Processor cpu: processors){
+				try {
+					if(cpu.getPowerInterface().getSupportedPStates().containsKey("P0"))
+						cpu.getPowerInterface().setPState("P0");
+				} catch (NoSuchFieldException e) {
+					// TODO Auto-generated catch block
+					e.printStackTrace();
+				}
+			}
+			break;
+		case FREE:
+			for(Processor cpu: processors){
+				try {
+					if(cpu.getPowerInterface().getSupportedPStates().containsKey("P3"))
+						cpu.getPowerInterface().setPState("P3");
+				} catch (NoSuchFieldException e) {
+					// TODO Auto-generated catch block
+					e.printStackTrace();
+				}
+			}
+			break;
+		}
+	}
+	
+	public String getName() {
+		return getClass().getName();
+	}
+
+}
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 477)
@@ -0,0 +1,77 @@
+package example.localplugin;
+
+import gridsim.Gridlet;
+
+import java.util.List;
+import java.util.Random;
+
+import schedframe.events.scheduling.SchedulingEvent;
+import schedframe.resources.computing.ComputingNode;
+import schedframe.scheduling.manager.resources.ClusterResourceManager;
+import schedframe.scheduling.manager.resources.ResourceManager;
+import schedframe.scheduling.manager.tasks.JobRegistry;
+import schedframe.scheduling.plan.SchedulingPlanInterface;
+import schedframe.scheduling.plan.impl.SchedulingPlan;
+import schedframe.scheduling.plugin.grid.ModuleList;
+import schedframe.scheduling.queue.TaskQueue;
+import schedframe.scheduling.queue.TaskQueueList;
+import schedframe.scheduling.tasks.TaskInterface;
+import schedframe.scheduling.tasks.WorkloadUnit;
+
+public class FCFSRandomClusterLocalPlugin extends BaseLocalPlugin {
+
+	private Random rand;
+	
+	public FCFSRandomClusterLocalPlugin() {
+		rand = new Random(5);
+	}
+
+	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() == Gridlet.READY) {
+					/*for(ResourceUnitName key:resManager.getSharedResourceUnits().keySet()){
+						System.out.println(key.getName());
+					}*/
+					addToSchedulingPlan(plan, task);
+					/*String nodeName = chooseRandomProvider(resourceManager);
+					if (nodeName != null) {
+						addToSchedulingPlan(plan, task, nodeName);
+					}*/
+				}
+			}
+			break;
+		}
+		return plan;
+	}
+
+	private String chooseRandomProvider(ClusterResourceManager resourceManager) {
+		List<ComputingNode> nodes = resourceManager.getComputingNodes();
+		int nodeIdx = rand.nextInt(nodes.size());
+		return nodes.get(nodeIdx).getName();
+	}
+	
+	public String getName() {
+		return getClass().getName();
+	}
+
+
+}
+
Index: DCWoRMS/trunk/build/classes/gridsim/GridSimShutdown.java
===================================================================
--- DCWoRMS/trunk/build/classes/gridsim/GridSimShutdown.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/gridsim/GridSimShutdown.java	(revision 477)
@@ -0,0 +1,176 @@
+/*
+ * Title:        GridSim Toolkit
+ * Description:  GridSim (Grid Simulation) Toolkit for Modeling and Simulation
+ *               of Parallel and Distributed Systems such as Clusters and Grids
+ * Licence:      GPL - http://www.gnu.org/copyleft/gpl.html
+ *
+ * $Id: GridSimShutdown.java,v 1.4 2009/01/07 14:31:54 mkrystek Exp $
+ */
+
+package gridsim;
+
+import java.util.Calendar;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import eduni.simjava.Sim_event;
+
+
+/**
+ * GridimShutdown waits for termination of all GridSim user entities to
+ * determine the end of simulation.
+ * <p>
+ * This class will be created by GridSim upon initialization of the simulation,
+ * i.e. done via <tt>GridSim.init()</tt> method. Hence, do not need to worry
+ * about creating an object of this class.
+ * <p>
+ * This class signals the user-defined report-writer
+ * entity to interact with the GridStatistics entity to generate a report.
+ * Finally, it signals the end of simulation to GridInformationService (GIS)
+ * entity.
+ *
+ * @author       Manzur Murshed and Rajkumar Buyya
+ * @since        GridSim Toolkit 1.0
+ * @invariant $none
+ * @see gridsim.GridSim#init(int, Calendar, boolean)
+ * @see gridsim.GridSim#init(int, Calendar, boolean, String[], String[], String)
+ */
+public class GridSimShutdown extends GridSimCore
+{
+    protected int numUser_;
+    protected String reportWriterName_;
+    private Log log = LogFactory.getLog(GridSimShutdown.class);
+
+    /**
+     * Allocates a new GridSimShutdown object.
+     * <p>
+     * The total number of
+     * grid user entity plays an important role to determine whether all
+     * resources should be shut down or not.
+     * If one or more users are still not finish, then the resources will not
+     * be shut down. Therefore, it is important to give a correct number of
+     * total grid user entity. Otherwise, GridSim program will hang or encounter
+     * a weird behaviour.
+     *
+     * @param name       the name to be associated with this entity (as
+     *                   required by Sim_entity class from simjava package)
+     * @param numUser    total number of grid user entity
+     * @param reportWriterName  a <tt>ReportWriter</tt> entity name. This entity
+     *                          can be found inside a gridbroker package.
+     * @throws Exception This happens when creating this entity before
+     *                   initializing GridSim package or this entity name is
+     *                   <tt>null</tt> or empty
+     * @see gridsim.GridSim#init(int, Calendar, boolean, String[], String[],
+     *          String)
+     * @see gridsim.GridSim#init(int, Calendar, boolean)
+     * @see eduni.simjava.Sim_entity
+     * @pre name != null
+     * @pre numUser >= 0
+     * @post $none
+     */
+    public GridSimShutdown(String name, int numUser,
+                String reportWriterName) throws Exception
+    {
+        // NOTE: This entity doesn't use any I/O port.
+        //super(name, GridSimTags.DEFAULT_BAUD_RATE);
+        super(name);
+        this.numUser_ = numUser;
+        this.reportWriterName_ = reportWriterName;
+    }
+
+    /**
+     * Allocates a new GridSimShutdown object.
+     * <p>
+     * The total number of
+     * grid user entity plays an important role to determine whether all
+     * resources should be shut down or not.
+     * If one or more users are still not finish, then the resources will not
+     * be shut down. Therefore, it is important to give a correct number of
+     * total grid user entity. Otherwise, GridSim program will hang or encounter
+     * a weird behaviour.
+     *
+     * @param name       the name to be associated with this entity (as
+     *                   required by Sim_entity class from simjava package)
+     * @param numUser    total number of grid user entity
+     * @throws Exception This happens when creating this entity before
+     *                   initializing GridSim package or this entity name is
+     *                   <tt>null</tt> or empty
+     * @see gridsim.GridSim#init(int, Calendar, boolean, String[], String[],
+     *          String)
+     * @see gridsim.GridSim#init(int, Calendar, boolean)
+     * @see eduni.simjava.Sim_entity
+     * @pre name != null
+     * @pre numUser >= 0
+     * @post $none
+     */
+    public GridSimShutdown(String name, int numUser) throws Exception {
+        this(name, numUser, null);
+    }
+
+    /**
+     * The main method that shuts down resources and Grid Information
+     * Service (GIS). In addition, this method writes down a report at the
+     * end of a simulation based on <tt>reportWriterName</tt> defined in
+     * the Constructor.
+     * <br>
+     * <b>NOTE:</b> This method shuts down grid resources and GIS entities
+     *              <tt>AFTER</tt> all grid users have been shut down.
+     *              Therefore, the number of grid users given in the
+     *              Constructor <tt>must</tt> be correct. Otherwise, GridSim
+     *              package hangs forever or it does not terminate properly.
+     * @pre $none
+     * @post $none
+     */
+    public void body()
+    {
+        Sim_event ev = new Sim_event();
+
+        // wait for shutdown message from all users.
+        // NOTE: this can cause GridSim to be hanged if numUser_ doesn't match
+        // with number of user entities given during GridSim.init().
+        for (int i = 0; i < numUser_; i++) {
+            super.sim_get_next(ev);
+        }
+
+        // Shutdown GIS - now GIS is responsible for informing end of simulation
+        // This is to simplify design and coding, without introducing any static
+        // methods for GridSim and GIS.
+        super.send(GridSim.getGridInfoServiceEntityId(),
+                   GridSimTags.SCHEDULE_NOW, GridSimTags.END_OF_SIMULATION);
+
+        //super.sim_pause(100); //FIXME we don't want this line at all
+
+        // Invoke report Writer and shutdown
+        if (reportWriterName_ != null)
+        {
+            int repWriterID = GridSim.getEntityId(reportWriterName_);
+            if (repWriterID != -1)
+            {
+                super.send(repWriterID, GridSimTags.SCHEDULE_NOW,
+                        GridSimTags.END_OF_SIMULATION);
+            }
+            else
+            {
+            	if(log.isErrorEnabled())
+            		log.error(super.get_name() +
+                        ": User defined Report Writer entity " +
+                        reportWriterName_ + " does not exist.");
+            }
+        }
+        else
+        {
+            // check whether GridStatistics entity has been created or not
+            int id = GridSim.getGridStatisticsEntityId();
+            if (id != -1) {
+                super.send(id, 0.0, GridSimTags.END_OF_SIMULATION);
+            }
+        }
+
+        super.terminateIOEntities();
+    }
+
+
+    /////////////////////// PRIVATE METHODS //////////////////////////
+
+} // end class
Index: DCWoRMS/trunk/build/classes/gridsim/gssim/filter/SubTaskFilter.java
===================================================================
--- DCWoRMS/trunk/build/classes/gridsim/gssim/filter/SubTaskFilter.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/gridsim/gssim/filter/SubTaskFilter.java	(revision 477)
@@ -0,0 +1,45 @@
+package gridsim.gssim.filter;
+
+import schedframe.scheduling.tasks.SubmittedTask;
+import eduni.simjava.Sim_event;
+import gridsim.filter.FilterResult;
+
+/**
+ * @author wojtek
+ *
+ */
+public class SubTaskFilter extends FilterResult {
+
+	public SubTaskFilter(int gridletID, int tag) {
+		super(gridletID, 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 SubmittedTask) {
+
+					SubmittedTask subTask = (SubmittedTask) obj;
+
+					if (subTask.getGridletID() == eventID_) {
+						result = true;
+					}
+				}
+			}
+		} catch (Exception e) {
+			result = false;
+		}
+
+		return result;
+	}
+
+}
Index: DCWoRMS/trunk/build/classes/gridsim/gssim/WormsTags.java
===================================================================
--- DCWoRMS/trunk/build/classes/gridsim/gssim/WormsTags.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/gridsim/gssim/WormsTags.java	(revision 477)
@@ -0,0 +1,31 @@
+package gridsim.gssim;
+
+import gridsim.GridSimTags;
+
+/**
+ * @author Marcin Krystek
+ */
+public class WormsTags extends GridSimTags {
+	
+	protected static final int GSSIMBASE = 600; 
+	
+	public static final int UPDATE= GSSIMBASE - 1;
+	
+	public static final int TIMER = GSSIMBASE + 1;
+	
+	public static final int TASK_READY_FOR_EXECUTION = GSSIMBASE + 2;
+	
+	public static final int TASK_EXECUTION_FINISHED = GSSIMBASE + 3;
+	
+
+	/**
+	 * Message tag: query resource about its current state in object form (load, queues, etc.)
+	 */ 
+	public static final int QUERY_RESOURCE_DESC = GSSIMBASE + 4; 
+
+	public static final int QUERY_RESOURCE_DESC_RESULT = GSSIMBASE + 5; 
+	
+	public static final int TASK_REQUESTED_TIME_EXPIRED = GSSIMBASE + 6;
+
+
+}
Index: DCWoRMS/trunk/build/classes/simulator/WormsUsers.java
===================================================================
--- DCWoRMS/trunk/build/classes/simulator/WormsUsers.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/simulator/WormsUsers.java	(revision 477)
@@ -0,0 +1,333 @@
+package simulator;
+
+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.net.InfoPacket;
+import gssim.schedframe.scheduling.utils.JobDescription;
+import gssim.schedframe.scheduling.utils.TaskDescription;
+
+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 WormsUsers 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(WormsUsers.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 WormsUsers(String name, String destinationName, WorkloadLoader workload) throws Exception {
+		super(name, WormsConstants.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 = null;
+					try {
+						jobId = returnedJob.getId();
+					} catch (NoSuchFieldException e) {
+						// TODO Auto-generated catch block
+						e.printStackTrace();
+					}
+				
+				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() == Gridlet.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/GridSimWrapper.java
===================================================================
--- DCWoRMS/trunk/build/classes/simulator/GridSimWrapper.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/simulator/GridSimWrapper.java	(revision 477)
@@ -0,0 +1,65 @@
+package simulator;
+
+import eduni.simjava.Sim_exception;
+import eduni.simjava.Sim_system;
+import gridsim.GridSim;
+import gridsim.GridSimRandom;
+import gridsim.GridSimShutdown;
+
+
+import java.util.Calendar;
+
+public class GridSimWrapper extends GridSim {
+
+	protected GridSimWrapper(String name) throws Exception {
+		super(name);
+
+	}
+
+	protected GridSimWrapper(String name, double baudRate) throws Exception {
+		super(name, baudRate);
+	}
+
+	protected static void initCommonVariable(Calendar cal, boolean traceFlag, int numUser, String reportWriterName)
+			throws Exception {
+		// NOTE: the order for the below 3 lines are important
+		Sim_system.initialise();
+		Sim_system.set_trc_level(1);
+		Sim_system.set_auto_trace(traceFlag);
+
+		// Set the current Wall clock time as the starting time of simulation
+		calendar_ = cal;
+		if (cal == null) {
+			calendar_ = Calendar.getInstance();
+		}
+
+		SimulationStartDate = calendar_.getTime();
+		rand = new GridSimRandom();
+
+		// creates a GridSimShutdown object
+		GridSimShutdown shutdown = new GridSimShutdown("GridSimShutdown", numUser, reportWriterName);
+		shutdownID_ = shutdown.get_id();
+	}
+
+    public static void startSimulation() throws NullPointerException
+    {
+        System.out.println("Starting GridSim version 4.0");
+        try {
+            Sim_system.run();
+        }
+        catch (Sim_exception e)
+        {
+            throw new NullPointerException("GridSim.startGridSimulation() :" +
+                    " Error - you haven't initialized GridSim.");
+        }
+    }
+    
+    public static void setSeed(long seed){
+    	Sim_system.set_seed(seed);
+    }
+    
+    public static void setTraceSettings() {
+		Sim_system.set_trace_detail(true, true, true);
+		Sim_system.set_trace_level(Integer.MAX_VALUE);
+    }
+}
Index: DCWoRMS/trunk/build/classes/simulator/workload/exceptons/NoSuchCommentException.java
===================================================================
--- DCWoRMS/trunk/build/classes/simulator/workload/exceptons/NoSuchCommentException.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/simulator/workload/exceptons/NoSuchCommentException.java	(revision 477)
@@ -0,0 +1,14 @@
+package simulator.workload.exceptons;
+
+public class NoSuchCommentException extends Exception{
+	
+	private static final long serialVersionUID = -1257647143189079034L;
+
+	public NoSuchCommentException(){
+		super();
+	}
+
+	public NoSuchCommentException(String message) {
+		super(message);
+	}
+}
Index: DCWoRMS/trunk/build/classes/simulator/workload/exceptons/NoSuchFieldException.java
===================================================================
--- DCWoRMS/trunk/build/classes/simulator/workload/exceptons/NoSuchFieldException.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/simulator/workload/exceptons/NoSuchFieldException.java	(revision 477)
@@ -0,0 +1,5 @@
+package simulator.workload.exceptons;
+
+public class NoSuchFieldException {
+
+}
Index: DCWoRMS/trunk/build/classes/simulator/workload/exceptons/XMLLogicException.java
===================================================================
--- DCWoRMS/trunk/build/classes/simulator/workload/exceptons/XMLLogicException.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/simulator/workload/exceptons/XMLLogicException.java	(revision 477)
@@ -0,0 +1,14 @@
+package simulator.workload.exceptons;
+
+public class XMLLogicException extends Exception {
+	
+	private static final long serialVersionUID = 1238471681577925949L;
+
+	public XMLLogicException(){
+		super();
+	}
+
+	public XMLLogicException(String arg){
+		super(arg);
+	}
+}
Index: DCWoRMS/trunk/build/classes/simulator/workload/fileFilters/QcgJobFileNameFilter.java
===================================================================
--- DCWoRMS/trunk/build/classes/simulator/workload/fileFilters/QcgJobFileNameFilter.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/simulator/workload/fileFilters/QcgJobFileNameFilter.java	(revision 477)
@@ -0,0 +1,24 @@
+package simulator.workload.fileFilters;
+
+import java.io.File;
+import java.io.FilenameFilter;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+
+public class QcgJobFileNameFilter implements FilenameFilter{
+
+	public static final String FILE_NAME_PREFIX = "QcgJob";
+	
+	public QcgJobFileNameFilter(){};
+	
+	public boolean accept(File dir, String name) {
+			if(name.startsWith(FILE_NAME_PREFIX) && name.endsWith("xml"))
+				return true;
+			else
+				return false;
+	}
+}
Index: DCWoRMS/trunk/build/classes/simulator/workload/fileFilters/SWFFileNameFilter.java
===================================================================
--- DCWoRMS/trunk/build/classes/simulator/workload/fileFilters/SWFFileNameFilter.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/simulator/workload/fileFilters/SWFFileNameFilter.java	(revision 477)
@@ -0,0 +1,20 @@
+package simulator.workload.fileFilters;
+
+import java.io.File;
+import java.io.FilenameFilter;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+public class SWFFileNameFilter implements FilenameFilter{
+	
+	public boolean accept(File dir, String name) {
+		if(name.endsWith("swf"))
+			return true;
+		else
+			return false;
+	}
+
+}
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 477)
@@ -0,0 +1,244 @@
+package simulator.workload;
+
+import org.qcg.broker.schemas.jobdesc.QcgJob;
+import gssim.schedframe.scheduling.utils.JobDescription;
+import gssim.schedframe.scheduling.utils.TaskDescription;
+
+import java.io.IOException;
+import java.text.DateFormat;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.TreeMap;
+
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.xpath.XPathExpressionException;
+
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.exolab.castor.xml.MarshalException;
+import org.exolab.castor.xml.ValidationException;
+
+
+import simulator.utils.XsltTransformations;
+import simulator.workload.exceptons.NoSuchCommentException;
+import simulator.workload.reader.archive.AbstractWAParser;
+import simulator.workload.reader.archive.WAFields;
+import simulator.workload.reader.archive.WAReader;
+import simulator.workload.reader.archive.WAParser;
+import simulator.workload.reader.archive.gwf.GWFFields;
+import simulator.workload.reader.archive.swf.SWFFields;
+import simulator.workload.reader.xmlJob.XMLJobReader;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+public class WorkloadLoader {
+	
+	private static Log log = LogFactory.getLog(WorkloadLoader.class);
+	
+	protected XMLJobReader<QcgJob> xmlJobReader;
+	protected WAReader<QcgJob> waReader;
+	protected WAParser localWAParser;
+	protected int generatedJobsCnt;
+	protected int generatedTasksCnt;
+	
+	protected Date simulationStartTime;
+	
+	protected XsltTransformations xsltTransformation = null;
+	
+	protected Map<String, JobDescription> jobGridletsMap;
+	
+	public WorkloadLoader(XMLJobReader<QcgJob> xmlReader, WAReader<QcgJob> swfReader){
+		if(swfReader == null){
+			throw new RuntimeException("Swf reader is required to build proper gridlerts.");
+		}
+		this.xmlJobReader = xmlReader;
+		this.waReader = swfReader;
+		this.generatedJobsCnt = 0;
+		this.generatedTasksCnt = 0;
+		this.jobGridletsMap = new TreeMap<String, JobDescription>();
+		try {
+			this.xsltTransformation = new XsltTransformations();
+		} catch (XPathExpressionException e) {
+			e.printStackTrace();
+		} catch (ParserConfigurationException e) {
+			e.printStackTrace();
+		}
+	}
+	
+	protected JobDescription createJobDescription(String jobDesc, long puSpeed) throws IOException{
+		
+		JobDescription jobDescription = null;
+		try {
+			jobDescription = this.xsltTransformation.splitJobToTasks(jobDesc);
+		} catch (Exception e) {
+			throw new IOException(e.getMessage());
+		}
+		
+		// look for any 
+		
+		if(jobDescription.size() == 0){
+			if(log.isWarnEnabled())
+				log.warn("Omiting job gridlet creation for job "+jobDescription.getDescription().getAppId()+". This job contains no tasks.");
+			return null;
+		}
+		
+		// needed for Gridlet class
+		
+		String jobId = jobDescription.getJobId();
+		int parserType = localWAParser.getType();
+		
+		for(int i = 0; i < jobDescription.size(); i++){
+			TaskDescription taskDesc = jobDescription.get(i);
+			
+			String waTaskDesc[] = localWAParser.readTask(jobId, taskDesc.getTaskId());
+			if(waTaskDesc != null) {
+				
+				if(parserType == 0){
+				
+					taskDesc.setUserDn(waTaskDesc[SWFFields.DATA_USER_ID]);
+					
+					long timeValue = Long.parseLong(waTaskDesc[SWFFields.DATA_SUBMIT_TIME]);
+					taskDesc.setSubmissionTime(timeValue);
+					
+					long waitTime = Long.parseLong(waTaskDesc[GWFFields.DATA_WAIT_TIME]);
+					taskDesc.setWorkloadLogWaitTime(waitTime);
+					
+					timeValue = Long.parseLong(waTaskDesc[SWFFields.DATA_RUN_TIME]);
+					if(timeValue <= 0)
+						return null;
+					
+					long allocProcesors = Long.parseLong(waTaskDesc[SWFFields.DATA_NUMBER_OF_ALLOCATED_PROCESSORS]);
+					if(allocProcesors <= 0)
+						return null;
+					
+					timeValue = timeValue * puSpeed * allocProcesors;
+					taskDesc.setTaskLength(timeValue);
+
+				} else if(parserType == 1){
+				
+					taskDesc.setUserDn(waTaskDesc[GWFFields.DATA_USER_ID]);
+					
+					long timeValue = Long.parseLong(waTaskDesc[GWFFields.DATA_SUBMIT_TIME]);
+					taskDesc.setSubmissionTime(timeValue);
+					
+					long waitTime = Long.parseLong(waTaskDesc[GWFFields.DATA_WAIT_TIME]);
+					taskDesc.setWorkloadLogWaitTime(waitTime);
+					
+					timeValue = Long.parseLong(waTaskDesc[GWFFields.DATA_RUN_TIME]);
+					if(timeValue <= 0)
+						return null;
+					
+					long allocProcesors = Long.parseLong(waTaskDesc[GWFFields.DATA_NPROCS]);
+					if(allocProcesors <= 0)
+						return null;
+					
+					timeValue = timeValue * puSpeed * allocProcesors;
+					taskDesc.setTaskLength(timeValue);
+				}
+			}
+			
+			this.generatedTasksCnt++;
+		}
+		
+		this.generatedJobsCnt++;
+		
+		return jobDescription;
+	}
+	
+	
+	public boolean load() throws IOException, MarshalException, ValidationException{
+		
+		// prepare local swf parser
+		this.localWAParser = AbstractWAParser.getInstance(this.waReader.getParser().getFileName());
+		this.localWAParser.loadHeader();
+
+		long puSpeed = getPUSpeed();
+		this.simulationStartTime = getSimulationStartTimeValue();
+		
+		this.localWAParser.reset();
+
+
+		// determine which reader should be used
+		String jobDesc = null;
+		JobDescription job = null;
+			
+		if(this.xmlJobReader != null){ // use xml job reader. Xml job require xslt transformation
+			while((jobDesc = this.xmlJobReader.readRaw()) != null){
+				jobDesc = this.xsltTransformation.extendJobDescription(jobDesc);
+				job = createJobDescription(jobDesc, puSpeed);
+				if(job != null)
+					this.jobGridletsMap.put(job.getJobId(), job);
+			}
+		} else {						// use swf job reader. Job created by this reader does not require xslt transformation
+			while((jobDesc = this.waReader.readRaw()) != null){
+				job = createJobDescription(jobDesc, puSpeed);
+				if(job != null)
+					this.jobGridletsMap.put(job.getJobId(), job);
+			}
+		}
+
+		this.localWAParser.close();
+		if(this.xmlJobReader != null)
+			this.xmlJobReader.close();
+		
+		return true;
+	}
+	
+	protected long getPUSpeed(){
+		long puSpeed = 1;
+		try {
+			puSpeed = Long.parseLong(this.localWAParser.getCommentValue(WAFields.COMMENT_PUSPEED));
+		} catch (NoSuchCommentException e1) {
+			if(log.isWarnEnabled())
+				log.warn("Assuming default processing unit speed = 1");
+		}
+		return puSpeed;
+	}
+	
+	
+	protected Date getSimulationStartTimeValue(){
+		Date simulationStartTime = null;
+		try {
+			
+			DateFormat df = new SimpleDateFormat("EEE MMM dd HH:mm:ss ZZZZ yyyy", Locale.ENGLISH);
+			simulationStartTime = df.parse(this.localWAParser.getCommentValue(WAFields.COMMENT_STARTTIME));
+		} catch (NoSuchCommentException e){
+			simulationStartTime = new Date(0);
+			if(log.isWarnEnabled())
+				log.warn("Assuming default simulation start time - "+simulationStartTime);
+		} catch (ParseException e) {
+			simulationStartTime = new Date(0);
+			if(log.isWarnEnabled())
+				log.warn("Wrong format of simulation start time comment.\nAssuming default simulation start time - "+simulationStartTime);
+		}
+		return simulationStartTime;
+	}
+	
+	public int getJobCount(){
+		return generatedJobsCnt;
+	}
+	
+	public int getTaskCount(){
+		return generatedTasksCnt;
+	}
+	
+	public Date getSimulationStartTime(){
+		return this.simulationStartTime;
+	}
+	
+	public List<JobDescription> getJobs(){
+		ArrayList<JobDescription> list = 
+			new ArrayList<JobDescription>(this.jobGridletsMap.values());
+		return list;
+	}
+	
+}
Index: DCWoRMS/trunk/build/classes/simulator/workload/writer/JobWriter.java
===================================================================
--- DCWoRMS/trunk/build/classes/simulator/workload/writer/JobWriter.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/simulator/workload/writer/JobWriter.java	(revision 477)
@@ -0,0 +1,12 @@
+package simulator.workload.writer;
+
+import java.io.IOException;
+
+public interface JobWriter<Job> {
+
+	public boolean write(Job job) throws IOException;
+	
+	public void setOverwrite(boolean overwrite);
+	
+	public void close() throws IOException;
+}
Index: DCWoRMS/trunk/build/classes/simulator/workload/writer/xmlJob/QcgXmlJobWriter.java
===================================================================
--- DCWoRMS/trunk/build/classes/simulator/workload/writer/xmlJob/QcgXmlJobWriter.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/simulator/workload/writer/xmlJob/QcgXmlJobWriter.java	(revision 477)
@@ -0,0 +1,83 @@
+package simulator.workload.writer.xmlJob;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.exolab.castor.xml.MarshalException;
+import org.exolab.castor.xml.ValidationException;
+
+import simulator.workload.fileFilters.QcgJobFileNameFilter;
+
+import org.qcg.broker.schemas.jobdesc.QcgJob;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+
+public class QcgXmlJobWriter implements XMLJobWriter<QcgJob>{
+
+	private Log log = LogFactory.getLog(QcgXmlJobWriter.class);
+	public boolean overwrite;
+	public String fileNamePrefix;
+	public File directory;
+	
+	public QcgXmlJobWriter(String dirName, String fileNamePrefix){
+		this.overwrite = true;
+		this.fileNamePrefix = fileNamePrefix;
+		this.directory = new File(dirName);
+
+		if(!directory.exists())
+			directory.mkdirs();
+		
+	}
+	
+	public boolean write(QcgJob job) throws IOException{
+		String fileName = QcgJobFileNameFilter.FILE_NAME_PREFIX+"_"+job.getAppId()+".xml";
+		
+		File file = new File(directory, fileName);
+		if(file.exists()) {
+			if(this.overwrite){
+				if(!file.delete()){
+					if(log.isErrorEnabled())
+						log.error("File " + fileName + " can not be deleted.");
+					return false;
+				}
+				if(!file.createNewFile()){
+					if(log.isErrorEnabled())
+						log.error("File " + fileName + " can not be created.");
+					return false;
+				}
+			} else {
+				throw new IOException("File "+fileName + " exists and can not be removed. Set overwrite attribute value to true.");
+			}
+		}
+		
+		FileWriter writer = new FileWriter(file);
+		
+		try {
+		
+			job.marshal(writer);
+	
+		} catch (MarshalException e) {
+			throw new IOException(e.getMessage());
+		} catch (ValidationException e) {
+			throw new IOException(e.getMessage());
+		} finally {
+			writer.close();
+		}
+		
+		
+		return true;
+	}
+
+	public void setOverwrite(boolean overwrite) {
+		this.overwrite = overwrite;
+	}
+
+	public void close() throws IOException{};
+}
Index: DCWoRMS/trunk/build/classes/simulator/workload/writer/xmlJob/XMLJobWriter.java
===================================================================
--- DCWoRMS/trunk/build/classes/simulator/workload/writer/xmlJob/XMLJobWriter.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/simulator/workload/writer/xmlJob/XMLJobWriter.java	(revision 477)
@@ -0,0 +1,13 @@
+package simulator.workload.writer.xmlJob;
+
+import simulator.workload.writer.JobWriter;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ * @param <Job>
+ */
+public interface XMLJobWriter<Job> extends JobWriter<Job>{
+
+}
Index: DCWoRMS/trunk/build/classes/simulator/workload/writer/swf/SWFJobWriter.java
===================================================================
--- DCWoRMS/trunk/build/classes/simulator/workload/writer/swf/SWFJobWriter.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/simulator/workload/writer/swf/SWFJobWriter.java	(revision 477)
@@ -0,0 +1,25 @@
+package simulator.workload.writer.swf;
+
+import java.io.IOException;
+
+import simulator.workload.writer.JobWriter;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ * @param <Job>
+ */
+public interface SWFJobWriter<Job> extends JobWriter<Job>{
+
+	public void writeFieldDescriptionHeader() throws IOException;
+	
+	public void writeComment(String key, String value) throws IOException;
+	
+	public void useTaskMapping(boolean use);
+	
+	public void setJobSubmitTime(long submitTime);
+	
+	public void addTaskLength(String taskId, long taskLength);
+	
+}
Index: DCWoRMS/trunk/build/classes/simulator/workload/writer/swf/AbstractSWFJobWriter.java
===================================================================
--- DCWoRMS/trunk/build/classes/simulator/workload/writer/swf/AbstractSWFJobWriter.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/simulator/workload/writer/swf/AbstractSWFJobWriter.java	(revision 477)
@@ -0,0 +1,108 @@
+package simulator.workload.writer.swf;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.Writer;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
+
+import simulator.DataCenterWorkloadSimulator;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ * @param <Job>
+ */
+public abstract class AbstractSWFJobWriter<Job> implements SWFJobWriter<Job>{
+
+	public static String COMMENT = ";";
+	public static String FIELD_SEPARATOR = "\t\t";
+	public static String IRRELEVANT = "-1";
+	
+	protected long submitTime;
+	protected boolean useTaskMapping;
+	protected Map<String, Long> tasksLength;
+	protected ArrayList<String> taskMapping;
+	protected Writer writer;
+	
+	protected AbstractSWFJobWriter(String dirName, String fileName) throws IOException{
+		submitTime = 0;
+		useTaskMapping = true;
+		tasksLength = new HashMap<String, Long>();
+		taskMapping = new ArrayList<String>();
+		
+		File dir = new File(dirName);
+		if(!dir.exists()) {
+			dir.mkdirs();
+		} else if(!dir.isDirectory()){
+			throw new IOException(dirName + " is not a directory.");
+		}
+		
+		File swfFile = new File(dir, fileName);
+		writer = new FileWriter(swfFile);
+	}
+	
+	
+	
+	public void writeFieldDescriptionHeader() throws IOException {
+		writer.write(COMMENT + "Automatically generated workload description by the " + DataCenterWorkloadSimulator.SIMULATOR_NAME + "\n");
+		writer.write(COMMENT + FIELD_SEPARATOR + "j|" + FIELD_SEPARATOR + "s|" + FIELD_SEPARATOR + "w|" + FIELD_SEPARATOR + "r|" + FIELD_SEPARATOR + "c|" + FIELD_SEPARATOR + "c|" + FIELD_SEPARATOR + "m|" + FIELD_SEPARATOR + "p|" + FIELD_SEPARATOR + "t|" + FIELD_SEPARATOR + "m|" + FIELD_SEPARATOR + "s|" + FIELD_SEPARATOR + "u|" + FIELD_SEPARATOR + "g|" + FIELD_SEPARATOR + "e|" + FIELD_SEPARATOR + "q|" + FIELD_SEPARATOR + "p|" + FIELD_SEPARATOR + "p|" + FIELD_SEPARATOR + "t|\n"+
+					 COMMENT + FIELD_SEPARATOR + "o|" + FIELD_SEPARATOR + "u|" + FIELD_SEPARATOR + "a|" + FIELD_SEPARATOR + "u|" + FIELD_SEPARATOR + "p|" + FIELD_SEPARATOR + "p|" + FIELD_SEPARATOR + "e|" + FIELD_SEPARATOR + "r|" + FIELD_SEPARATOR + "i|" + FIELD_SEPARATOR + "e|" + FIELD_SEPARATOR + "t|" + FIELD_SEPARATOR + "i|" + FIELD_SEPARATOR + "i|" + FIELD_SEPARATOR + "x|" + FIELD_SEPARATOR + "u|" + FIELD_SEPARATOR + "a|" + FIELD_SEPARATOR + "r|" + FIELD_SEPARATOR + "h|\n"+
+					 COMMENT + FIELD_SEPARATOR + "b|" + FIELD_SEPARATOR + "b|" + FIELD_SEPARATOR + "i|" + FIELD_SEPARATOR + "n|" + FIELD_SEPARATOR + "u|" + FIELD_SEPARATOR + "u|" + FIELD_SEPARATOR + "m|" + FIELD_SEPARATOR + "o|" + FIELD_SEPARATOR + "m|" + FIELD_SEPARATOR + "m|" + FIELD_SEPARATOR + "a|" + FIELD_SEPARATOR + "d|" + FIELD_SEPARATOR + "d|" + FIELD_SEPARATOR + "e|" + FIELD_SEPARATOR + "e|" + FIELD_SEPARATOR + "r|" + FIELD_SEPARATOR + "e|" + FIELD_SEPARATOR + "i|\n"+
+					 COMMENT + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + "m|" + FIELD_SEPARATOR + "t|" + FIELD_SEPARATOR + "t|" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + "c|" + FIELD_SEPARATOR + "e|" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + "t|" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + "c|" + FIELD_SEPARATOR + "u|" + FIELD_SEPARATOR + "t|" + FIELD_SEPARATOR + "c|" + FIELD_SEPARATOR + "n|\n"+
+					 COMMENT + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + "i|" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + "i|" + FIELD_SEPARATOR + "a|" + FIELD_SEPARATOR + "t|" + FIELD_SEPARATOR + "u|" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + "r|" + FIELD_SEPARATOR + "u|" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + "u|" + FIELD_SEPARATOR + "e|" + FIELD_SEPARATOR + "i|" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + "k|\n"+
+					 COMMENT + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + "t|" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + "m|" + FIELD_SEPARATOR + "l|" + FIELD_SEPARATOR + "i|" + FIELD_SEPARATOR + "s|" + FIELD_SEPARATOR + "r|" + FIELD_SEPARATOR + "r|" + FIELD_SEPARATOR + "e|" + FIELD_SEPARATOR + "s|" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + "t|" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + "t|" + FIELD_SEPARATOR + "j|" + FIELD_SEPARATOR + " |\n"+
+					 COMMENT + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + "e|" + FIELD_SEPARATOR + "l|" + FIELD_SEPARATOR + "m|" + FIELD_SEPARATOR + "e|" + FIELD_SEPARATOR + "e|" + FIELD_SEPARATOR + "e|" + FIELD_SEPARATOR + "q|" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + "a|" + FIELD_SEPARATOR + "n|" + FIELD_SEPARATOR + "i|" + FIELD_SEPARATOR + "o|" + FIELD_SEPARATOR + "t|\n"+
+					 COMMENT + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + "o|" + FIELD_SEPARATOR + "e|" + FIELD_SEPARATOR + "d|" + FIELD_SEPARATOR + "q|" + FIELD_SEPARATOR + "q|" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + "b|" + FIELD_SEPARATOR + "r|" + FIELD_SEPARATOR + "o|" + FIELD_SEPARATOR + "b|" + FIELD_SEPARATOR + "i|\n"+
+					 COMMENT + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + "c|" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + "l|" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + "n|" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + "m|\n"+
+					 COMMENT + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + "e|" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + " |" + FIELD_SEPARATOR + "e|\n");
+	}
+	
+	public void writeComment(String key, String value) throws IOException {
+		writer.write(COMMENT+key+": "+value+"\n");
+	}
+	
+	public void setJobSubmitTime(long submitTime) {
+		this.submitTime = submitTime;
+	}
+
+	public void addTaskLength(String taskId, long taskLength) {
+		this.tasksLength.put(taskId, taskLength);
+	}
+
+	public void setOverwrite(boolean overwrite) {
+	}
+	
+	public void useTaskMapping(boolean use) {
+		this.useTaskMapping = use;
+	}	
+	
+	public void writeLine(String array[]) throws IOException{
+		for (int i = 0; i < array.length; i++) {
+			writer.write(FIELD_SEPARATOR + array[i]);
+		}
+		writer.write("\n");
+	}
+	
+	public void close() throws IOException {
+		if(useTaskMapping){
+			writer.write(COMMENT+"IDMapping: swfID:jobID:taskID\n"+COMMENT+" ");
+			for(int i = 1; i <= taskMapping.size(); i++){
+				writer.write(taskMapping.get(i-1) + ", ");
+				if(i %  10 == 0){
+					writer.write("\n"+COMMENT + " ");
+				}
+			}
+			writer.write("\n"+COMMENT+"IDMapping: end\n");
+		}
+		
+		this.taskMapping.clear();
+		this.tasksLength.clear();
+		
+		writer.close();
+	}
+
+}
Index: DCWoRMS/trunk/build/classes/simulator/workload/writer/swf/QcgSWFJobWriter.java
===================================================================
--- DCWoRMS/trunk/build/classes/simulator/workload/writer/swf/QcgSWFJobWriter.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/simulator/workload/writer/swf/QcgSWFJobWriter.java	(revision 477)
@@ -0,0 +1,182 @@
+package simulator.workload.writer.swf;
+
+import java.io.IOException;
+import java.util.Random;
+
+import org.exolab.castor.types.Duration;
+
+import simulator.workload.reader.archive.swf.SWFFields;
+
+import org.qcg.broker.schemas.exception.NoSuchParamException;
+import org.qcg.broker.schemas.jobdesc.ExecutionTimeType;
+import org.qcg.broker.schemas.jobdesc.QcgJob;
+import org.qcg.broker.schemas.jobdesc.Task;
+import org.qcg.broker.schemas.jobdesc.wrapper.TaskRequirements;
+import org.qcg.broker.schemas.jobdesc.wrapper.impl.TaskRequirementsImpl;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+public class QcgSWFJobWriter extends AbstractSWFJobWriter<QcgJob>{
+
+	protected int intTaskId;
+	protected String workloadArray[];
+	protected Random random;
+	
+	public QcgSWFJobWriter(String dirName, String fileName) throws IOException{
+		super(dirName, fileName);
+		this.intTaskId = 0;
+		this.workloadArray = new String[18];
+		this.random = new Random(System.currentTimeMillis());
+	}
+	
+	public boolean write(QcgJob job) throws IOException {
+		long taskLength;
+		String idMapping;
+		String taskId;
+		TaskRequirements taskReqWrapper = new TaskRequirementsImpl();
+		
+		for(int i = 0; i < job.getTaskCount(); i++){
+			Task task = job.getTask(i);
+			taskReqWrapper.wrap(task);
+			
+			// prepare swf task id
+			if(this.useTaskMapping){
+				taskId = String.valueOf(intTaskId);
+				idMapping = taskId+":"+job.getAppId()+":"+task.getTaskId();
+				intTaskId++;
+				this.taskMapping.add(idMapping);
+			} else {
+				taskId = task.getTaskId();
+			}
+			
+			// prepare task length value
+			if(tasksLength.containsKey(task.getTaskId())){
+				taskLength = tasksLength.get(task.getTaskId());
+			} else {
+				taskLength = 0;
+			}
+			
+			double tab[] = null;
+			
+			// prepare requested number of processors
+			String reqCpuCnt = IRRELEVANT;
+			try {
+				double min = 0;
+				double max = Double.MAX_VALUE;
+				
+				if((tab = taskReqWrapper.getCpucount()).length != 0){ // try single value
+					reqCpuCnt = String.valueOf(Math.round(tab[0]));
+					
+				} else {
+					double d[][] = taskReqWrapper.getRangeCpucount(); 
+					if(d.length != 0 && (tab = d[0]).length != 0){ // try range value
+						min = tab[0];
+						max = tab[1];
+						double r = random.nextDouble();
+						reqCpuCnt = String.valueOf(Math.round(min + (max - min) * r));
+					
+					} else {										// try single min and max value
+						boolean change = false;
+						if((tab = taskReqWrapper.getMinCpucount()).length != 0) {
+							min = tab[0];
+							change = true;
+						}
+						if((tab = taskReqWrapper.getMaxCpucount()).length != 0){
+							max = tab[0];
+							change = true;
+						}
+						if(change) {
+							double r = random.nextDouble();
+							reqCpuCnt = String.valueOf(Math.round(min + (max - min) * r));
+						}
+					}
+				}
+				
+			} catch(NoSuchParamException e){
+
+			}
+			
+			// prepare requested memory
+			String reqMemCnt = IRRELEVANT;
+			try {
+				double min = 0;
+				double max = Double.MAX_VALUE;
+				
+				if((tab = taskReqWrapper.getMemory()).length != 0){ // try single value
+					reqMemCnt = String.valueOf(Math.round(tab[0]));
+					
+				} else {
+					double d[][] = taskReqWrapper.getRangeMemory(); 
+					if(d.length != 0 && (tab = d[0]).length != 0){ // try range value
+						min = tab[0];
+						max = tab[1];
+						double r = random.nextDouble();
+						reqMemCnt = String.valueOf(Math.round(min + (max - min) * r));
+						
+					} else {										// try single min and max value
+						boolean change = false;
+						if((tab = taskReqWrapper.getMinMemory()).length != 0) {
+							min = tab[0];
+							change = true;
+						}
+						if((tab = taskReqWrapper.getMaxMemory()).length != 0){
+							max = tab[0];
+							change = true;
+						}
+						if(change){
+							double r = random.nextDouble();
+							reqMemCnt = String.valueOf(Math.round(min + (max - min) * r));
+						}
+					}
+				} 
+				
+			} catch(NoSuchParamException e){
+
+			}
+			
+			// prepare requested time
+			long reqTaskLength = taskLength;
+			ExecutionTimeType ett = task.getExecutionTime();
+			if(ett != null){
+				Duration duration = ett.getExecutionDuration();
+				reqTaskLength = duration.toLong();
+			}
+			
+			
+			workloadArray[SWFFields.DATA_JOB_NUMBER] = taskId;
+			workloadArray[SWFFields.DATA_SUBMIT_TIME] = String.valueOf(this.submitTime);
+			workloadArray[SWFFields.DATA_WAIT_TIME] = IRRELEVANT;
+			workloadArray[SWFFields.DATA_RUN_TIME] = String.valueOf(taskLength);
+			workloadArray[SWFFields.DATA_NUMBER_OF_ALLOCATED_PROCESSORS] = reqCpuCnt;
+			workloadArray[SWFFields.DATA_AVERAGE_CPU_TIME_USED] = IRRELEVANT;
+			workloadArray[SWFFields.DATA_USED_MEMORY] = IRRELEVANT;
+			workloadArray[SWFFields.DATA_REQUESTED_NUMBER_OF_PROCESSORS] = reqCpuCnt;
+			workloadArray[SWFFields.DATA_REQUESTED_TIME] = String.valueOf(reqTaskLength);
+			workloadArray[SWFFields.DATA_REQUESTED_MEMORY] = reqMemCnt;
+			workloadArray[SWFFields.DATA_STATUS] = IRRELEVANT;
+			workloadArray[SWFFields.DATA_USER_ID] = IRRELEVANT;
+			workloadArray[SWFFields.DATA_GROUP_ID] = IRRELEVANT;
+			workloadArray[SWFFields.DATA_EXECUTABLE_NUMBER]  = IRRELEVANT;
+			workloadArray[SWFFields.DATA_QUEUE_NUMBER] = IRRELEVANT;
+			workloadArray[SWFFields.DATA_PARTITION_NUMBER] = IRRELEVANT;
+			workloadArray[SWFFields.DATA_PRECEDING_JOB_NUMBER] = IRRELEVANT;
+			workloadArray[SWFFields.DATA_THINK_TIME_FROM_PRECEDING_JOB] = IRRELEVANT;
+			
+			writeLine(workloadArray);
+			
+		}
+		
+		this.tasksLength.clear();
+		
+		return true;
+	}
+	
+	public void addTaskMapping(String swfJobId, String xmlJobId, String xmlTaskId){
+		if(!this.useTaskMapping)
+			return;
+		this.taskMapping.add(swfJobId+":"+xmlJobId+":"+xmlTaskId);
+	}
+}
Index: DCWoRMS/trunk/build/classes/simulator/workload/reader/xmlJob/XMLJobReader.java
===================================================================
--- DCWoRMS/trunk/build/classes/simulator/workload/reader/xmlJob/XMLJobReader.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/simulator/workload/reader/xmlJob/XMLJobReader.java	(revision 477)
@@ -0,0 +1,8 @@
+package simulator.workload.reader.xmlJob;
+
+
+import simulator.workload.reader.JobReader;
+
+public interface XMLJobReader<Job> extends JobReader<Job>{
+
+}
Index: DCWoRMS/trunk/build/classes/simulator/workload/reader/xmlJob/DirReader.java
===================================================================
--- DCWoRMS/trunk/build/classes/simulator/workload/reader/xmlJob/DirReader.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/simulator/workload/reader/xmlJob/DirReader.java	(revision 477)
@@ -0,0 +1,62 @@
+package simulator.workload.reader.xmlJob;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileReader;
+import java.io.FilenameFilter;
+import java.io.IOException;
+
+import simulator.workload.fileFilters.QcgJobFileNameFilter;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+public class DirReader implements WLFileAccess {
+
+	protected File files[];
+	protected int currentPosition;
+	
+	public DirReader(File dir){
+		FilenameFilter fileNameFilter = new QcgJobFileNameFilter();
+		this.files = dir.listFiles(fileNameFilter);
+		
+		this.currentPosition = -1;
+	}
+	
+	public String getFileName() {
+		if(currentPosition >= this.files.length || currentPosition < 0)
+			return null;
+		
+		return this.files[currentPosition].getAbsolutePath();
+	}
+
+	public String read() throws IOException {
+		currentPosition++;
+		
+		if(currentPosition >= files.length)
+			return null;
+		
+		BufferedReader reader = null;
+		StringBuffer buffer = new StringBuffer();
+
+		try {
+			reader = new BufferedReader(new FileReader(files[currentPosition]));
+			String line = null;
+			
+			while((line = reader.readLine()) != null){
+				buffer.append(line);
+			}
+			
+		} finally{
+			reader.close();
+		}
+		
+		return buffer.toString();
+	}
+
+	public void close() {
+		
+	}
+}
Index: DCWoRMS/trunk/build/classes/simulator/workload/reader/xmlJob/WLFileAccess.java
===================================================================
--- DCWoRMS/trunk/build/classes/simulator/workload/reader/xmlJob/WLFileAccess.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/simulator/workload/reader/xmlJob/WLFileAccess.java	(revision 477)
@@ -0,0 +1,27 @@
+package simulator.workload.reader.xmlJob;
+
+import java.io.IOException;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+public interface WLFileAccess {
+	
+	/**
+	 * 
+	 * @return Name of the file from which value returned
+	 * by read() method come from. 
+	 */
+	public String getFileName();
+	
+	/**
+	 * 
+	 * @return content of the next file
+	 * @throws IOException 
+	 */
+	public String read() throws IOException;
+	
+	public void close();
+}
Index: DCWoRMS/trunk/build/classes/simulator/workload/reader/xmlJob/QcgXmlJobReader.java
===================================================================
--- DCWoRMS/trunk/build/classes/simulator/workload/reader/xmlJob/QcgXmlJobReader.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/simulator/workload/reader/xmlJob/QcgXmlJobReader.java	(revision 477)
@@ -0,0 +1,90 @@
+package simulator.workload.reader.xmlJob;
+
+import java.io.File;
+import java.io.IOException;
+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.QcgJob;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+
+public class QcgXmlJobReader implements XMLJobReader<QcgJob> {
+
+	protected static Unmarshaller unmarshaller;
+	static {
+		XMLContext context = new XMLContext();
+		try {
+			context.addPackage("org.qcg.broker.schemas.jobdesc.QcgJob");
+			unmarshaller = context.createUnmarshaller();
+		} catch (ResolverException e) {
+			e.printStackTrace();
+			unmarshaller = null;
+		}
+	}
+	
+	protected WLFileAccess workload;
+	
+	
+	public QcgXmlJobReader(File dir) throws IOException{
+		if(dir == null)
+			throw new IOException("Set directory name with xml's and file name prefix.");
+		
+		String dirName = dir.getName();
+		
+		if(!dir.exists()) 
+			throw new IOException("Directory "+dirName + " doeas not exist.");
+		
+		if(dir.isDirectory()){
+			this.workload = new DirReader(dir);
+		} else {
+			throw new IOException(dirName + " is not a directory or tar archive.");
+		}
+	}
+
+	public void close() throws IOException {
+		this.workload.close();
+	}
+
+	public String getCurrentPosition() {
+		return this.workload.getFileName();
+	}
+	
+	public String readRaw() throws IOException{
+		return this.workload.read();
+	}
+
+	public QcgJob read() throws IOException {
+
+		String s = readRaw();
+		StringReader reader = new StringReader(s);
+		QcgJob job = null;
+		
+		try {
+		
+			job = (QcgJob) unmarshaller.unmarshal(reader);
+		
+		} catch (MarshalException e) {
+			new IOException(e.getMessage());
+		} catch (ValidationException e) {
+			new IOException(e.getMessage());
+		} finally {
+			reader.close();
+		}
+		
+		return job;
+	}
+
+	public void reset() throws IOException {
+	}
+}
Index: DCWoRMS/trunk/build/classes/simulator/workload/reader/JobReader.java
===================================================================
--- DCWoRMS/trunk/build/classes/simulator/workload/reader/JobReader.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/simulator/workload/reader/JobReader.java	(revision 477)
@@ -0,0 +1,16 @@
+package simulator.workload.reader;
+
+import java.io.IOException;
+
+public interface JobReader <Job> {
+	
+	public void close() throws IOException;
+	
+	public Job read() throws IOException;
+	
+	public String readRaw() throws IOException;
+	
+	public void reset() throws IOException;
+	
+	public String getCurrentPosition();
+}
Index: DCWoRMS/trunk/build/classes/simulator/workload/reader/archive/AbstractWAReader.java
===================================================================
--- DCWoRMS/trunk/build/classes/simulator/workload/reader/archive/AbstractWAReader.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/simulator/workload/reader/archive/AbstractWAReader.java	(revision 477)
@@ -0,0 +1,92 @@
+package simulator.workload.reader.archive;
+
+import java.io.IOException;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.Locale;
+
+import simulator.workload.exceptons.NoSuchCommentException;
+import simulator.workload.reader.archive.gwf.QcgGWFJobReader;
+import simulator.workload.reader.archive.swf.QcgSWFJobReader;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ * @param <Task>
+ * @param <Job>
+ */
+
+public abstract class AbstractWAReader<Task, Job> implements WAReader<Job>{
+	
+	protected WAParser waParser = null;
+	protected String taskData[];
+	
+	
+	public AbstractWAReader(String fileName) throws NullPointerException, IOException{
+		this.waParser = AbstractWAParser.getInstance(fileName);
+		taskData = null;
+	}
+	
+	public AbstractWAReader(WAParser parser) {
+		this.waParser = parser;
+		taskData = null;
+	}
+	
+	protected abstract Task createTask(String[] data);
+	
+	public void close() throws IOException{
+		if(waParser != null)
+			waParser.close();
+	}
+	
+	public static synchronized Date getStartTime(String workloadFileName) throws IOException, NoSuchCommentException{
+		Date date = null;
+		WAParser parser = AbstractWAParser.getInstance(workloadFileName);
+		parser.loadHeader();
+		
+		String s = parser.getCommentValue(WAFields.COMMENT_STARTTIME);
+		
+		parser.close();
+		try {
+			SimpleDateFormat df = new SimpleDateFormat("EEE MMM dd HH:mm:ss ZZZZ yyyy", Locale.ENGLISH);
+			date = df.parse(s);
+		} catch (ParseException e) {
+			throw new IOException(e.getMessage());
+		}
+		
+		return date;
+	}
+	
+	public void reset() throws IOException{
+		if(waParser != null)
+			waParser.reset();
+	}
+	
+	public WAParser getParser(){
+		return this.waParser;
+	}
+	
+	public static AbstractWAReader
+			<org.qcg.broker.schemas.jobdesc.Task, 
+			org.qcg.broker.schemas.jobdesc.QcgJob> getInstace(String fileName){
+		
+		String name = fileName.trim().toLowerCase();
+		
+		try {
+			
+			if(name.endsWith("swf")){
+				return new QcgSWFJobReader(fileName);
+				
+			} else if(name.endsWith("gwf")){
+				return new QcgGWFJobReader(fileName);
+			}
+			
+		} catch(Exception e){
+			e.printStackTrace();
+		}
+		
+		return null;
+	}
+}
Index: DCWoRMS/trunk/build/classes/simulator/workload/reader/archive/WAFields.java
===================================================================
--- DCWoRMS/trunk/build/classes/simulator/workload/reader/archive/WAFields.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/simulator/workload/reader/archive/WAFields.java	(revision 477)
@@ -0,0 +1,16 @@
+package simulator.workload.reader.archive;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+
+public abstract class WAFields {
+	
+	public static final String COMMENT_STARTTIME = "StartTime";
+	public static final String COMMENT_NOTE = "Note";
+	public static final String COMMENT_PUSPEED = "PUSpeed";
+	public static final String COMMENT_IDMAPPING = "IDMapping";
+	
+}
Index: DCWoRMS/trunk/build/classes/simulator/workload/reader/archive/swf/SWFFields.java
===================================================================
--- DCWoRMS/trunk/build/classes/simulator/workload/reader/archive/swf/SWFFields.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/simulator/workload/reader/archive/swf/SWFFields.java	(revision 477)
@@ -0,0 +1,72 @@
+package simulator.workload.reader.archive.swf;
+
+
+import simulator.workload.reader.archive.WAFields;
+
+public abstract class SWFFields extends WAFields{
+	
+	public static final String COMMENT_VERSION = "Version";
+	public static final String COMMENT_COMPUTER = "Computer";
+	public static final String COMMENT_INSTALLATION = "Installation";
+	public static final String COMMENT_ACKNOWLEDGE = "Acknowledge";
+	public static final String COMMENT_INFORMATION = "Information";
+	public static final String COMMENT_CONVERSION = "Conversion";
+	public static final String COMMENT_MAXJOBS = "MaxJobs";
+	public static final String COMMENT_MAXRECORDS = "MaxRecords";
+	public static final String COMMENT_PREEMPTION = "Preemption";
+	public static final String COMMENT_UNIXSTARTTIME = "UnixStartTime";
+	public static final String COMMENT_TIMEZONE = "TimeZone";
+	public static final String COMMENT_TIMEZONESTRING = "TimeZoneString";
+	public static final String COMMENT_ENDTIME = "EndTime";
+	public static final String COMMENT_MAXNODES = "MaxNodes";
+	public static final String COMMENT_MAXPROCS = "MaxProcs";
+	public static final String COMMENT_MAXRUNTIME = "MaxRuntime";
+	public static final String COMMENT_MAXMEMORY = "MaxMemory";
+	public static final String COMMENT_ALLOWOVERUSE = "AllowOveruse";
+	public static final String COMMENT_MAXQUEUES = "MaxQueues";
+	public static final String COMMENT_QUEUES = "Queues";
+	public static final String COMMENT_QUEUE = "Queue";
+	public static final String COMMENT_MAXPARTITIONS = "MaxPartitions";
+	public static final String COMMENT_PARTITIONS = "Partitions";
+	public static final String COMMENT_PARTITION = "Partition";
+	
+	public static final String COMMENTS_LABELS[] = {SWFFields.COMMENT_VERSION,SWFFields.COMMENT_COMPUTER,
+		SWFFields.COMMENT_INSTALLATION,SWFFields.COMMENT_ACKNOWLEDGE,SWFFields.COMMENT_INFORMATION,
+		SWFFields.COMMENT_CONVERSION,SWFFields.COMMENT_MAXJOBS,SWFFields.COMMENT_MAXRECORDS,
+		SWFFields.COMMENT_PREEMPTION,SWFFields.COMMENT_UNIXSTARTTIME,SWFFields.COMMENT_TIMEZONE,
+		SWFFields.COMMENT_TIMEZONESTRING,SWFFields.COMMENT_STARTTIME,SWFFields.COMMENT_ENDTIME,
+		SWFFields.COMMENT_MAXNODES,SWFFields.COMMENT_MAXPROCS,SWFFields.COMMENT_MAXRUNTIME,
+		SWFFields.COMMENT_MAXMEMORY,SWFFields.COMMENT_ALLOWOVERUSE,SWFFields.COMMENT_MAXQUEUES,
+		SWFFields.COMMENT_QUEUES,SWFFields.COMMENT_QUEUE, SWFFields.COMMENT_MAXPARTITIONS,
+		SWFFields.COMMENT_PARTITIONS,SWFFields.COMMENT_PARTITION, SWFFields.COMMENT_NOTE, SWFFields.COMMENT_PUSPEED, 
+		SWFFields.COMMENT_IDMAPPING};
+
+	
+	public static final int DATA_JOB_NUMBER = 0;
+	public static final int DATA_SUBMIT_TIME = 1;
+	public static final int DATA_WAIT_TIME = 2;
+	public static final int DATA_RUN_TIME = 3;
+	public static final int DATA_NUMBER_OF_ALLOCATED_PROCESSORS = 4;
+	public static final int DATA_AVERAGE_CPU_TIME_USED = 5;
+	public static final int DATA_USED_MEMORY = 6;
+	public static final int DATA_REQUESTED_NUMBER_OF_PROCESSORS = 7;
+	public static final int DATA_REQUESTED_TIME = 8;
+	public static final int DATA_REQUESTED_MEMORY = 9;
+	public static final int DATA_STATUS = 10;
+	public static final int DATA_USER_ID = 11;
+	public static final int DATA_GROUP_ID = 12;
+	public static final int DATA_EXECUTABLE_NUMBER = 13;
+	public static final int DATA_QUEUE_NUMBER = 14;
+	public static final int DATA_PARTITION_NUMBER = 15;
+	public static final int DATA_PRECEDING_JOB_NUMBER = 16;
+	public static final int DATA_THINK_TIME_FROM_PRECEDING_JOB = 17;
+	public static final int DATA_FIELDS[] = {SWFFields.DATA_JOB_NUMBER,SWFFields.DATA_SUBMIT_TIME,
+		SWFFields.DATA_WAIT_TIME,SWFFields.DATA_RUN_TIME,SWFFields.DATA_NUMBER_OF_ALLOCATED_PROCESSORS,
+		SWFFields.DATA_AVERAGE_CPU_TIME_USED,SWFFields.DATA_USED_MEMORY,
+		SWFFields.DATA_REQUESTED_NUMBER_OF_PROCESSORS,SWFFields.DATA_REQUESTED_TIME,
+		SWFFields.DATA_REQUESTED_MEMORY,SWFFields.DATA_STATUS,SWFFields.DATA_USER_ID,
+		SWFFields.DATA_GROUP_ID,SWFFields.DATA_EXECUTABLE_NUMBER,SWFFields.DATA_QUEUE_NUMBER,
+		SWFFields.DATA_PARTITION_NUMBER, SWFFields.DATA_PRECEDING_JOB_NUMBER,
+		SWFFields.DATA_THINK_TIME_FROM_PRECEDING_JOB};
+
+}
Index: DCWoRMS/trunk/build/classes/simulator/workload/reader/archive/swf/QcgSWFJobReader.java
===================================================================
--- DCWoRMS/trunk/build/classes/simulator/workload/reader/archive/swf/QcgSWFJobReader.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/simulator/workload/reader/archive/swf/QcgSWFJobReader.java	(revision 477)
@@ -0,0 +1,228 @@
+package simulator.workload.reader.archive.swf;
+
+import org.qcg.broker.schemas.jobdesc.ComputingResourceBaseTypeChoice;
+import org.qcg.broker.schemas.jobdesc.ComputingResourceType;
+import org.qcg.broker.schemas.jobdesc.ComputingResourceBaseTypeChoiceItem;
+import org.qcg.broker.schemas.jobdesc.ComputingResourceParameterType;
+import org.qcg.broker.schemas.jobdesc.ExecutionTimeType;
+import org.qcg.broker.schemas.jobdesc.ParameterTypeChoice;
+import org.qcg.broker.schemas.jobdesc.ParameterTypeChoiceItem;
+import org.qcg.broker.schemas.jobdesc.ResourceRequirementsType;
+import org.qcg.broker.schemas.jobdesc.Value;
+import org.qcg.broker.schemas.jobdesc.RequirementsType;
+import org.qcg.broker.schemas.jobdesc.types.ComputingParameterName;
+import org.qcg.broker.schemas.jobdesc.Task;
+import java.io.IOException;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.exolab.castor.types.Duration;
+
+import simulator.workload.reader.archive.QcgWAJobReader;
+
+
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+public class QcgSWFJobReader extends QcgWAJobReader {
+
+	private Log log = LogFactory.getLog(QcgSWFJobReader.class);
+	
+	protected String currntJobID;
+	
+	public QcgSWFJobReader(String fileName) throws NullPointerException,
+			IOException {
+		super(fileName);
+		this.waParser.loadHeader();
+	}
+	
+	public QcgSWFJobReader(SWFParser parser) {
+		super(parser);
+	}
+
+	protected Task createTask(String[] data) {
+		RequirementsType requirements = null;
+		ResourceRequirementsType taskReq = null;
+		ComputingResourceType compResource = null;
+		ComputingResourceBaseTypeChoice choice = null;
+		ComputingResourceBaseTypeChoiceItem crItem = null;		
+		ComputingResourceParameterType param = null;
+		
+		Task task = null;
+		long value = -1;
+		
+		task = new Task();
+		requirements = new RequirementsType();
+		taskReq = new ResourceRequirementsType();
+		compResource = new ComputingResourceType();
+		choice = new ComputingResourceBaseTypeChoice();
+		
+		compResource.setComputingResourceBaseTypeChoice(choice);
+		taskReq.addComputingResource(compResource);
+		requirements.setResourceRequirements(taskReq);
+		task.setRequirements(requirements);
+		
+		for(int i = 0; i < SWFFields.DATA_FIELDS.length; i++){
+			try {
+				
+				value = Long.parseLong(data[SWFFields.DATA_FIELDS[i]]);
+				
+				switch(SWFFields.DATA_FIELDS[i]){
+					case SWFFields.DATA_NUMBER_OF_ALLOCATED_PROCESSORS:
+						if(value <= 0){
+							if(log.isWarnEnabled())
+								log.warn("Task "+data[0] + " is omited. Number of allocated processors should be grather then 0.");
+							return null;
+						}
+						break;
+					case SWFFields.DATA_REQUESTED_NUMBER_OF_PROCESSORS:
+						if(value <= 0){
+							if(log.isWarnEnabled())
+								log.warn("Task "+data[0] + " is omited. Number of requested processors should be grather then 0.");
+							return null;
+						}
+						break;
+					case SWFFields.DATA_RUN_TIME:
+						if(value <= 0){
+							if(log.isWarnEnabled())
+								log.warn("Task "+data[0] + " is omited. Task runtime should be grather then 0.");
+							return null;
+						}
+						break;
+				}
+				
+				if (value == -1) continue;
+				
+			} catch (NumberFormatException e) {
+				if(SWFFields.DATA_FIELDS[i] != SWFFields.DATA_JOB_NUMBER &&
+					SWFFields.DATA_FIELDS[i] != SWFFields.DATA_PRECEDING_JOB_NUMBER)
+					continue;
+			}
+
+			switch(SWFFields.DATA_FIELDS[i]){
+				case SWFFields.DATA_JOB_NUMBER:
+					currntJobID = data[SWFFields.DATA_FIELDS[i]];
+					String tab[] = this.waParser.getIDMapping(currntJobID);
+					task.setTaskId(tab[1]);
+					break;
+					
+				case SWFFields.DATA_SUBMIT_TIME:
+					/*  
+					 * This is information for simulator not for task description.
+					 * See WorkloadLoader for details.
+					 */ 
+					break;
+					
+				case SWFFields.DATA_WAIT_TIME:
+					break;
+					
+				case SWFFields.DATA_RUN_TIME:
+					/*  
+					 * This is information for simulator not for task description.
+					 * See WorkloadLoader for details.
+					 */
+					break;
+					
+				case SWFFields.DATA_NUMBER_OF_ALLOCATED_PROCESSORS:
+					/*  
+					 * This is information for simulator not for task description.
+					 * See WorkloadLoader for details.
+					 */
+					break;
+					
+				case SWFFields.DATA_AVERAGE_CPU_TIME_USED:
+					break;
+					
+				case SWFFields.DATA_USED_MEMORY:
+					/*  
+					 * This is information for simulator not for task description.
+					 * See WorkloadLoader for details.
+					 */
+					break;
+					
+				case SWFFields.DATA_REQUESTED_NUMBER_OF_PROCESSORS:
+					
+					crItem = new ComputingResourceBaseTypeChoiceItem();
+					param = new ComputingResourceParameterType();
+					
+					param.setName(ComputingParameterName.CPUCOUNT);
+					{
+						ParameterTypeChoice tpChoice = new ParameterTypeChoice();
+						ParameterTypeChoiceItem item = new ParameterTypeChoiceItem();
+						Value paramValue = new Value();
+						
+						paramValue.setContent(Long.valueOf(value).doubleValue());
+						item.setValue(paramValue);
+						tpChoice.addParameterTypeChoiceItem(item);
+						param.setParameterTypeChoice(tpChoice);
+					}
+					crItem.setHostParameter(param);
+					choice.addComputingResourceBaseTypeChoiceItem(crItem);
+					
+					break;
+					
+				case SWFFields.DATA_REQUESTED_TIME:
+					ExecutionTimeType executionTime = new ExecutionTimeType();
+
+					// requested time is expressed in swf file in seconds
+					// multiply value * 1000 to get milliseconds
+					Duration d = new Duration(value * 1000);
+					
+					executionTime.setExecutionDuration(d);
+					task.setExecutionTime(executionTime);
+					break;
+					
+				case SWFFields.DATA_REQUESTED_MEMORY:
+					crItem = new ComputingResourceBaseTypeChoiceItem();
+					param = new ComputingResourceParameterType();
+					
+					param.setName(ComputingParameterName.MEMORY);
+					{
+						ParameterTypeChoice tpChoice = new ParameterTypeChoice();
+						ParameterTypeChoiceItem item = new ParameterTypeChoiceItem();
+						Value paramValue = new Value();
+						
+						paramValue.setContent(Long.valueOf(value).doubleValue());
+						item.setValue(paramValue);
+						tpChoice.addParameterTypeChoiceItem(item);
+						param.setParameterTypeChoice(tpChoice);
+					}
+					
+					crItem.setHostParameter(param);
+					choice.addComputingResourceBaseTypeChoiceItem(crItem);
+					
+					break;
+					
+				case SWFFields.DATA_STATUS:
+					break;
+					
+				case SWFFields.DATA_USER_ID:
+					break;
+					
+				case SWFFields.DATA_GROUP_ID:
+					break;
+					
+				case SWFFields.DATA_EXECUTABLE_NUMBER:
+					break;
+					
+				case SWFFields.DATA_QUEUE_NUMBER:
+					break;
+					
+				case SWFFields.DATA_PARTITION_NUMBER:
+					break;
+					
+				case SWFFields.DATA_PRECEDING_JOB_NUMBER:
+					break;
+					
+				case SWFFields.DATA_THINK_TIME_FROM_PRECEDING_JOB:
+					break;
+			}
+		}
+		
+		return task;
+	}
+	
+}
Index: DCWoRMS/trunk/build/classes/simulator/workload/reader/archive/swf/SWFParser.java
===================================================================
--- DCWoRMS/trunk/build/classes/simulator/workload/reader/archive/swf/SWFParser.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/simulator/workload/reader/archive/swf/SWFParser.java	(revision 477)
@@ -0,0 +1,93 @@
+package simulator.workload.reader.archive.swf;
+
+import java.io.IOException;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import simulator.workload.reader.archive.AbstractWAParser;
+
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+
+public class SWFParser extends AbstractWAParser {
+
+	private Log log = LogFactory.getLog(SWFParser.class);
+ 
+	public SWFParser(String fileName) throws IOException, NullPointerException{
+		super(fileName);
+		this.fieldsNo = 18;
+		this.COMMENT = ";";
+	}
+
+	
+	public String[] readTask(String id) throws IOException{
+		String fields[] = null;
+		boolean found = false;
+		
+		
+		Long jobPosition = this.jobIndex.get(id);
+		
+		// if index for job id is calculated, then use it!
+		if(jobPosition != null){
+			super.seek(jobPosition);
+			fields = readTask();
+			if(!id.equals(fields[0])) {
+				log.error("Wrong index for task: " + id + ". Found task: " + fields[0]);
+				return null;
+			}
+		} else {
+			// do classic search, read file from current position to the end, move to the beginning
+			// and continue to current position
+			
+			long filePointer = getFilePointer();
+			// reads from current position to the end of file
+			while(!found && (fields = readTask()) != null){
+				if(fields[SWFFields.DATA_JOB_NUMBER].equals(id))
+					found = true;
+			}
+			
+			if(!found){
+				// back to the beginning
+				System.out.println("search from begin for " + id);
+				super.seek(0);
+				// reads from the beginning of file to current position
+				while(!found && filePointer != getFilePointer() && (fields = readTask()) != null){
+					if(fields[SWFFields.DATA_JOB_NUMBER].equals(id))
+						found = true;
+				}
+			}
+		
+			if(found == false) return null;
+		}
+		
+		return fields;
+	}
+	
+	protected void buildIdx(String line, long position){
+		if(line == null || line.length() == 0)
+			return;
+		
+		String fields[] = line.split(FIELD_SEPARATOR+"+");
+
+		if(fields == null || fields.length != fieldsNo) {
+			int i = (fields == null ?  -1 : fields.length);
+			log.error("Can not build job index for line: " + line +
+					"\nSome data fields are missing. Expected fields length is " + fieldsNo + ", in file is " + i );
+			fields = null;
+			return;
+		} 
+		
+		String jobId = fields[SWFFields.DATA_JOB_NUMBER];
+		this.jobIndex.put(jobId, position);
+	}
+	
+	public int getType(){
+		return 0;
+	}
+	
+}
Index: DCWoRMS/trunk/build/classes/simulator/workload/reader/archive/QcgWAJobReader.java
===================================================================
--- DCWoRMS/trunk/build/classes/simulator/workload/reader/archive/QcgWAJobReader.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/simulator/workload/reader/archive/QcgWAJobReader.java	(revision 477)
@@ -0,0 +1,102 @@
+package simulator.workload.reader.archive;
+
+import java.io.IOException;
+import java.io.StringWriter;
+import java.io.Writer;
+
+import org.exolab.castor.xml.MarshalException;
+import org.exolab.castor.xml.Marshaller;
+import org.exolab.castor.xml.ResolverException;
+import org.exolab.castor.xml.ValidationException;
+import org.exolab.castor.xml.XMLContext;
+
+import simulator.workload.reader.archive.swf.SWFFields;
+import org.qcg.broker.schemas.jobdesc.QcgJob;
+import org.qcg.broker.schemas.jobdesc.Task;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+
+public abstract class QcgWAJobReader extends AbstractWAReader<Task, QcgJob> {
+
+	protected String currntJobID;
+	protected Marshaller marshaller;
+	
+	public QcgWAJobReader(String fileName) throws NullPointerException,
+			IOException {
+		super(fileName);
+		init();
+	}
+	
+	public QcgWAJobReader(WAParser parser){
+		super(parser);
+		init();
+	}
+
+	protected void init(){
+		XMLContext context = new XMLContext();
+		try {
+			context.addPackage("org.qcg.broker.schemas.jobdesc.QcgJob");
+			this.marshaller = context.createMarshaller();
+		} catch (ResolverException e) {
+			e.printStackTrace();
+			this.marshaller = null;
+		}
+	}
+	
+	public QcgJob read() throws IOException {
+		Task task = null;
+		
+		if(taskData == null) {
+			taskData = waParser.readTask();
+			if(taskData == null) return null;
+			
+			currntJobID = taskData[SWFFields.DATA_JOB_NUMBER];
+		}
+		
+		
+		QcgJob job = new QcgJob();
+		String appID = this.waParser.getIDMapping(currntJobID)[0];
+		job.setAppId(appID);
+		
+		
+		while(taskData != null && this.waParser.getIDMapping(currntJobID)[0].equals(appID)){
+			
+			task = createTask(taskData);
+			if(task != null)
+				job.addTask(task);
+			taskData = waParser.readTask();
+			if(taskData != null)
+				currntJobID = taskData[SWFFields.DATA_JOB_NUMBER];
+		}
+		
+		return job;
+	}
+	
+	public String readRaw() throws IOException{
+		QcgJob job = null;
+		
+		if((job = read()) == null)
+			return null;
+		
+		Writer w = new StringWriter();
+		try {
+			this.marshaller.setWriter(w);
+			this.marshaller.marshal(job);
+		} catch (MarshalException e) {
+			new IOException(e.getMessage());
+		} catch (ValidationException e) {
+			new IOException(e.getMessage());
+		}
+		
+		return w.toString();
+	}
+	
+	public String getCurrentPosition() {
+		return currntJobID;
+	}
+
+}
Index: DCWoRMS/trunk/build/classes/simulator/workload/reader/archive/gwf/GWFFields.java
===================================================================
--- DCWoRMS/trunk/build/classes/simulator/workload/reader/archive/gwf/GWFFields.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/simulator/workload/reader/archive/gwf/GWFFields.java	(revision 477)
@@ -0,0 +1,54 @@
+package simulator.workload.reader.archive.gwf;
+
+import simulator.workload.reader.archive.WAFields;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+public abstract class GWFFields extends WAFields {
+	
+	public static final int DATA_JOB_ID = 0;
+	public static final int DATA_SUBMIT_TIME = 1;
+	public static final int DATA_WAIT_TIME = 2;
+	public static final int DATA_RUN_TIME = 3;
+	public static final int DATA_NPROCS = 4;
+	public static final int DATA_AVERAGE_CPU_TIME_USED = 5;
+	public static final int DATA_USED_MEMORY = 6;
+	public static final int DATA_REQ_NPROCS = 7;
+	public static final int DATA_REQ_TIME = 8;
+	public static final int DATA_REQ_MEMORY = 9;
+	public static final int DATA_STATUS = 10;
+	public static final int DATA_USER_ID = 11;
+	public static final int DATA_GROUP_ID = 12;
+	public static final int DATA_EXECUTABLE_ID = 13;
+	public static final int DATA_QUEUE_ID = 14;
+	public static final int DATA_PARTITION_ID = 15;
+	public static final int DATA_ORIG_SITE_ID = 16;
+	public static final int DATA_LAST_RUN_SITE_ID = 17;
+	public static final int DATA_JOB_STRUCTURE = 18;
+	public static final int DATA_JOB_STRUCTURE_PARAMS = 19;
+	public static final int DATA_USED_NETWORK = 20;
+	public static final int DATA_USED_LOCALDISKSPACE = 21;
+	public static final int DATA_USED_RESOURCES = 22;
+	public static final int DATA_REQ_PLATFORM = 23;
+	public static final int DATA_REQ_NETWORK = 24;
+	public static final int DATA_REQ_LOCAL_DISK_SPACE = 25;
+	public static final int DATA_REQ_RESOURCES = 26;
+	public static final int DATA_VO_ID = 27;
+	public static final int DATA_PROJECT_ID = 28;
+	
+	public static int DATA_FIELDS[] = {
+			GWFFields.DATA_JOB_ID, GWFFields.DATA_SUBMIT_TIME, GWFFields.DATA_WAIT_TIME,
+			GWFFields.DATA_RUN_TIME, GWFFields.DATA_NPROCS, GWFFields.DATA_AVERAGE_CPU_TIME_USED,
+			GWFFields.DATA_USED_MEMORY, GWFFields.DATA_REQ_NPROCS, GWFFields.DATA_REQ_TIME,
+			GWFFields.DATA_REQ_MEMORY, GWFFields.DATA_STATUS, GWFFields.DATA_USER_ID,
+			GWFFields.DATA_GROUP_ID, GWFFields.DATA_EXECUTABLE_ID, GWFFields.DATA_QUEUE_ID,
+			GWFFields.DATA_PARTITION_ID, GWFFields.DATA_ORIG_SITE_ID, GWFFields.DATA_LAST_RUN_SITE_ID,
+			GWFFields.DATA_JOB_STRUCTURE, GWFFields.DATA_JOB_STRUCTURE_PARAMS, GWFFields.DATA_USED_NETWORK,
+			GWFFields.DATA_USED_LOCALDISKSPACE, GWFFields.DATA_USED_RESOURCES, GWFFields.DATA_REQ_PLATFORM,
+			GWFFields.DATA_REQ_NETWORK, GWFFields.DATA_REQ_LOCAL_DISK_SPACE, GWFFields.DATA_REQ_RESOURCES,
+			GWFFields.DATA_VO_ID, GWFFields.DATA_PROJECT_ID };
+
+}
Index: DCWoRMS/trunk/build/classes/simulator/workload/reader/archive/gwf/QcgGWFJobReader.java
===================================================================
--- DCWoRMS/trunk/build/classes/simulator/workload/reader/archive/gwf/QcgGWFJobReader.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/simulator/workload/reader/archive/gwf/QcgGWFJobReader.java	(revision 477)
@@ -0,0 +1,195 @@
+package simulator.workload.reader.archive.gwf;
+
+import java.io.IOException;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.exolab.castor.types.Duration;
+
+import org.qcg.broker.schemas.jobdesc.ComputingResourceBaseTypeChoice;
+import org.qcg.broker.schemas.jobdesc.ComputingResourceBaseTypeChoiceItem;
+import org.qcg.broker.schemas.jobdesc.ComputingResourceParameterType;
+import org.qcg.broker.schemas.jobdesc.ComputingResourceType;
+import org.qcg.broker.schemas.jobdesc.ExecutionTimeType;
+import org.qcg.broker.schemas.jobdesc.ParameterTypeChoice;
+import org.qcg.broker.schemas.jobdesc.ParameterTypeChoiceItem;
+import org.qcg.broker.schemas.jobdesc.RequirementsType;
+import org.qcg.broker.schemas.jobdesc.ResourceRequirementsType;
+import org.qcg.broker.schemas.jobdesc.Task;
+import org.qcg.broker.schemas.jobdesc.Value;
+import org.qcg.broker.schemas.jobdesc.types.ComputingParameterName;
+import simulator.workload.reader.archive.QcgWAJobReader;
+import simulator.workload.reader.archive.WAParser;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+
+public class QcgGWFJobReader extends QcgWAJobReader{
+
+	private Log log = LogFactory.getLog(QcgGWFJobReader.class);
+	
+	public QcgGWFJobReader(String fileName) throws NullPointerException,
+			IOException {
+		super(fileName);
+		this.waParser.loadHeader();
+	}
+	
+	public QcgGWFJobReader(WAParser parser) {
+		super(parser);
+	}
+
+	protected Task createTask(String[] data) {
+		RequirementsType requirements = null;
+		ResourceRequirementsType taskReq = null;
+		ComputingResourceType compResource = null;
+		ComputingResourceBaseTypeChoice choice = null;
+		ComputingResourceBaseTypeChoiceItem crItem = null;		
+		ComputingResourceParameterType param = null;
+		
+		Task task = null;
+		long value = -1;
+		
+		task = new Task();
+		requirements = new RequirementsType();
+		taskReq = new ResourceRequirementsType();
+		compResource = new ComputingResourceType();
+		choice = new ComputingResourceBaseTypeChoice();
+		
+		compResource.setComputingResourceBaseTypeChoice(choice);
+		taskReq.addComputingResource(compResource);
+		requirements.setResourceRequirements(taskReq);
+		task.setRequirements(requirements);
+		
+		for(int i = 0; i < GWFFields.DATA_FIELDS.length; i++){
+			try {
+				
+				value = Long.parseLong(data[GWFFields.DATA_FIELDS[i]]);
+				
+				switch(GWFFields.DATA_FIELDS[i]){
+					case GWFFields.DATA_NPROCS:
+						if(value <= 0){
+							if(log.isWarnEnabled())
+								log.warn("Task "+data[0] + " is omited. Number of allocated processors should be grather then 0.");
+							return null;
+						}
+						break;
+					case GWFFields.DATA_REQ_NPROCS:
+						if(value <= 0){
+							if(log.isWarnEnabled())
+								log.warn("Task "+data[0] + " is omited. Number of requested processors should be grather then 0.");
+							return null;
+						}
+						break;
+					case GWFFields.DATA_RUN_TIME:
+						if(value <= 0){
+							if(log.isWarnEnabled())
+								log.warn("Task "+data[0] + " is omited. Task runtime should be grather then 0.");
+							return null;
+						}
+						break;
+				}
+				
+				if (value == -1) continue;
+				
+			} catch (NumberFormatException e) {
+				if(GWFFields.DATA_FIELDS[i] != GWFFields.DATA_JOB_ID)
+					continue;
+			}
+
+			switch(GWFFields.DATA_FIELDS[i]){
+				case GWFFields.DATA_JOB_ID:
+					currntJobID = data[GWFFields.DATA_FIELDS[i]];
+					String tab[] = this.waParser.getIDMapping(currntJobID);
+					task.setTaskId(tab[1]);
+					break;
+					
+				case GWFFields.DATA_SUBMIT_TIME:
+					/*  
+					 * This is information for simulator not for task description.
+					 * See WorkloadLoader for details.
+					 */ 
+					break;
+					
+				case GWFFields.DATA_RUN_TIME:
+					/*  
+					 * This is information for simulator not for task description.
+					 * See WorkloadLoader for details.
+					 */
+					break;
+					
+				case GWFFields.DATA_NPROCS:
+					/*  
+					 * This is information for simulator not for task description.
+					 * See WorkloadLoader for details.
+					 */
+					break;
+					
+				case GWFFields.DATA_USED_MEMORY:
+					/*  
+					 * This is information for simulator not for task description.
+					 * See WorkloadLoader for details.
+					 */
+					break;
+					
+				case GWFFields.DATA_REQ_NPROCS:
+					
+					crItem = new ComputingResourceBaseTypeChoiceItem();
+					param = new ComputingResourceParameterType();
+					
+					param.setName(ComputingParameterName.CPUCOUNT);
+					{
+						ParameterTypeChoice tpChoice = new ParameterTypeChoice();
+						ParameterTypeChoiceItem item = new ParameterTypeChoiceItem();
+						Value paramValue = new Value();
+						
+						paramValue.setContent(Long.valueOf(value).doubleValue());
+						item.setValue(paramValue);
+						tpChoice.addParameterTypeChoiceItem(item);
+						param.setParameterTypeChoice(tpChoice);
+					}
+					crItem.setHostParameter(param);
+					choice.addComputingResourceBaseTypeChoiceItem(crItem);
+					
+					break;
+					
+				case GWFFields.DATA_REQ_TIME:
+					ExecutionTimeType executionTime = new ExecutionTimeType();
+
+					// requested time is expressed in swf file in seconds
+					// multiply value * 1000 to get milliseconds
+					Duration d = new Duration(value * 1000);
+					
+					executionTime.setExecutionDuration(d);
+					task.setExecutionTime(executionTime);
+					break;
+					
+				case GWFFields.DATA_REQ_MEMORY:
+					crItem = new ComputingResourceBaseTypeChoiceItem();
+					param = new ComputingResourceParameterType();
+					
+					param.setName(ComputingParameterName.MEMORY);
+					{
+						ParameterTypeChoice tpChoice = new ParameterTypeChoice();
+						ParameterTypeChoiceItem item = new ParameterTypeChoiceItem();
+						Value paramValue = new Value();
+						
+						paramValue.setContent(Long.valueOf(value).doubleValue());
+						item.setValue(paramValue);
+						tpChoice.addParameterTypeChoiceItem(item);
+						param.setParameterTypeChoice(tpChoice);
+					}
+					
+					crItem.setHostParameter(param);
+					choice.addComputingResourceBaseTypeChoiceItem(crItem);
+					
+					break;
+					
+			}
+		}
+		
+		return task;
+	}
+}
Index: DCWoRMS/trunk/build/classes/simulator/workload/reader/archive/gwf/GWFParser.java
===================================================================
--- DCWoRMS/trunk/build/classes/simulator/workload/reader/archive/gwf/GWFParser.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/simulator/workload/reader/archive/gwf/GWFParser.java	(revision 477)
@@ -0,0 +1,72 @@
+package simulator.workload.reader.archive.gwf;
+
+import java.io.IOException;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import simulator.workload.reader.archive.AbstractWAParser;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+
+public class GWFParser extends AbstractWAParser {
+
+	private Log log = LogFactory.getLog(GWFParser.class);
+	
+	public GWFParser(String fileName) throws IOException, NullPointerException {
+		super(fileName);
+		this.fieldsNo = 29;
+		this.COMMENT = "#";
+	}
+
+	public String[] readTask(String id) throws IOException {
+		long filePointer = getFilePointer();
+		String fields[] = null;
+		boolean found = false;
+		
+		// reads from current position to the end of file
+		while(!found && (fields = readTask()) != null){
+			if(fields[GWFFields.DATA_JOB_ID].equals(id))
+				found = true;
+		}
+		
+		if(!found){
+			// back to the beginning
+			super.seek(0);
+			// reads from the beginning of file to current position
+			while(!found && filePointer != getFilePointer() && (fields = readTask()) != null){
+				if(fields[GWFFields.DATA_JOB_ID].equals(id))
+					found = true;
+			}
+		}
+
+		if(found == false) return null;
+		
+		return fields;
+	}
+	
+	protected void buildIdx(String line, long position){
+		if(line == null || line.length() == 0)
+			return;
+		
+		String fields[] = line.split(FIELD_SEPARATOR+"+");
+
+		if(fields == null || fields.length != fieldsNo) {
+			log.error("Can not build job index for line: " + line +
+					"\nSome data fields are missing.");
+			return;
+		} 
+		
+		String jobId = fields[GWFFields.DATA_JOB_ID];
+		this.jobIndex.put(jobId, position);
+		
+	}
+	
+	public int getType(){
+		return 1;
+	}
+}
Index: DCWoRMS/trunk/build/classes/simulator/workload/reader/archive/WAParser.java
===================================================================
--- DCWoRMS/trunk/build/classes/simulator/workload/reader/archive/WAParser.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/simulator/workload/reader/archive/WAParser.java	(revision 477)
@@ -0,0 +1,45 @@
+package simulator.workload.reader.archive;
+
+import java.io.IOException;
+import java.util.HashMap;
+
+import simulator.workload.exceptons.NoSuchCommentException;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+
+public interface WAParser {
+	
+	public HashMap<String, String> loadHeader() throws IOException;
+	
+	public HashMap<String, String[]> getIDMapping();
+	
+	public String[] getIDMapping(String waID);
+	
+	public boolean isHeaderLoaded() throws IOException;
+	
+	public String[] readTask() throws IOException;
+	
+	public String[] readTask(String taskId) throws IOException;
+	
+	public String[] readTask(String jobID, String taskId) throws IOException;
+	
+	public String getCommentValue(String label) throws NoSuchCommentException;
+	
+	public String getDataField(int field) throws NoSuchFieldException;
+	
+	public String setCommentSign(String comment) ;
+	
+	public String setFieldSeparator(String fieldSeparator) ;
+
+	public void reset() throws IOException;
+	
+	public void close() throws IOException;
+	
+	public String getFileName();
+	
+	public int getType();
+}
Index: DCWoRMS/trunk/build/classes/simulator/workload/reader/archive/AbstractWAParser.java
===================================================================
--- DCWoRMS/trunk/build/classes/simulator/workload/reader/archive/AbstractWAParser.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/simulator/workload/reader/archive/AbstractWAParser.java	(revision 477)
@@ -0,0 +1,287 @@
+package simulator.workload.reader.archive;
+
+import java.io.IOException;
+import java.io.RandomAccessFile;
+import java.util.HashMap;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import simulator.workload.exceptons.NoSuchCommentException;
+import simulator.workload.reader.archive.gwf.GWFParser;
+import simulator.workload.reader.archive.swf.SWFParser;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+
+public abstract class AbstractWAParser extends RandomAccessFile implements WAParser {
+
+	private Log log = LogFactory.getLog(AbstractWAParser.class);
+	
+	private static final long serialVersionUID = 1L;
+	private String fileName;
+	
+	protected String COMMENT = ";";
+	protected String FIELD_SEPARATOR = "\\s"; //white spaces
+
+	protected HashMap<String, String> comments;
+	protected HashMap<String, String[]> idMapping; // key - swf job id, value - value[0] xml job id, value[1] xml task id
+	protected HashMap<String, String> reverseIdMapping; // key - xmlJobId_xmlTaskId, value - swf job id
+	protected HashMap<String, Long> jobIndex;
+	protected String fields[];
+	protected int fieldsNo;
+	protected boolean headerLoaded;
+	protected boolean buildIndex;
+	
+	public AbstractWAParser(String fileName) throws IOException, NullPointerException{
+		super(fileName, "r");
+		this.fileName = fileName;
+		this.comments = new HashMap<String, String>();
+		this.idMapping = new HashMap<String, String[]>();
+		this.reverseIdMapping = new HashMap<String, String>();
+		this.jobIndex = new HashMap<String, Long>();
+		this.headerLoaded = false;
+		this.buildIndex = true;
+		this.fieldsNo = 18;
+	}
+
+
+	/**
+	 * Reads one task description and returns all fields in table. 
+	 * Skips comments lines, so you can mix task description with comments.
+	 */
+	public String[] readTask() throws IOException {
+		String line = null;
+		fields = null;
+		
+		while((line = readLine()) != null){
+			line = line.trim();
+			if(line.length() == 0 || line.startsWith(COMMENT)){
+				continue;
+			} else{
+				fields = line.split(FIELD_SEPARATOR+"+");
+
+				if(fields == null || fields.length != fieldsNo)
+					throw new IOException("Some data fields are missing.");
+				else
+					break;
+			}
+				
+		}
+		return fields;
+	}
+	
+		
+	public String[] readTask(String jobID, String taskId) throws IOException{
+		String key = jobID+"_"+taskId;
+		String swfJobId;
+		
+		if(reverseIdMapping.containsKey(key)){
+			swfJobId = reverseIdMapping.get(key);
+		} else {
+			swfJobId = jobID;
+		}
+		
+		return readTask(swfJobId);
+	}
+
+	public String getCommentValue(String label) throws NoSuchCommentException {
+		if(!comments.containsKey(label))
+			throw new NoSuchCommentException("No comment value for "+label);
+		
+		return comments.get(label);
+	}
+
+	public String getDataField(int field) throws NoSuchFieldException {
+		if(field >= fields.length)
+			throw new NoSuchFieldException("No such field.");
+		
+		return fields[field];
+	}
+
+	/**
+	 * Reads all comments that have appropriate format and place them in HashMap.
+	 * Builds job index - decision depends on value of buildIndex variable. 
+	 */
+	public HashMap<String, String> loadHeader() throws IOException {
+		String line = null;
+		String label = null;
+		String value = null;
+		int idx = -1;
+		
+		
+		// default speed for processing unit in millions of instructions.
+		comments.put(WAFields.COMMENT_PUSPEED, "1");
+		
+		long position = 0;
+		while((position = super.getFilePointer()) != -1 && (line = readLine()) != null){
+			line = line.trim();
+			if(!line.startsWith(COMMENT)){
+				if(buildIndex){
+					buildIdx(line, position);
+				}	
+				continue;
+			}
+				
+			idx = line.indexOf(":");
+			if(idx == -1)
+				continue;
+
+			label = line.substring(1, idx);
+			label = label.trim();
+
+			if(idx + 1 > line.length())
+				throw new IOException("No value for comment: "+label);
+			
+			value = line.substring(idx + 1, line.length());
+			value = value.trim();
+			
+			if(label.equals(WAFields.COMMENT_NOTE) && comments.containsKey(label)){
+				value = comments.get(label)+"; "+value;
+			} else if(label.equals(WAFields.COMMENT_IDMAPPING)){
+				loadIDMapping();
+				continue;
+			}
+
+			comments.put(label, value);
+		}
+		reset();
+		headerLoaded = true;
+		return comments;
+	}
+
+	protected void loadIDMapping() throws IOException{
+		String line = null;
+		
+		while((line = readLine()) != null){
+			
+			line = line.trim();
+		
+			if(!line.startsWith(COMMENT))
+				continue;
+			
+			line = line.substring(1).trim(); // to cut beginning ';'
+			if(line.startsWith(WAFields.COMMENT_IDMAPPING+": end"))
+				break;
+			
+			String idsInLine[] = line.split(",");
+			String third = null;
+			String ids[] = null;
+			
+			for(int i = 0; i < idsInLine.length; i++){
+				third = idsInLine[i];
+				ids = third.split(":");
+				if(ids.length < 3){
+					if(ids.length != 1)
+						if(log.isWarnEnabled())
+							log.warn(third + " is not complete. Use swfJobId:xmlJobId:xmlTaskId");
+					continue;
+				}
+				String key = ids[0].trim();
+				String value[] = new String[2];
+				value[0] = ids[1].trim(); // job id
+				value[1] = ids[2].trim(); // task id
+				idMapping.put(key, value);
+				reverseIdMapping.put(value[0]+"_"+value[1], key);
+			}
+			
+		}
+	}
+	
+	/**
+	 * Sets comment sign. Default is ';'.
+	 */
+	public String setCommentSign(String comment) {
+		String oldComment = this.COMMENT;
+		this.COMMENT = comment;
+		return oldComment;
+	}
+
+	/**
+	 * Sets data fields separator. Default is tab (\t).
+	 */
+	public String setFieldSeparator(String fieldSeparator) {
+		String oldSeparator = this.FIELD_SEPARATOR;
+		this.FIELD_SEPARATOR = fieldSeparator;
+		return oldSeparator;
+	}
+	
+	/**
+	 * Decide if task position index should be build. It is very useful
+	 * and significantly speedup 
+	 * @return previous value
+	 */
+	public boolean buildIndex(boolean build){
+		boolean old = this.buildIndex;
+		this.buildIndex = build;
+		return old;
+	}
+
+	public void close() throws IOException {
+		super.close();
+		this.comments.clear();
+		this.comments = null;
+		this.idMapping.clear();
+		this.idMapping = null;
+		this.reverseIdMapping.clear();
+		this.reverseIdMapping = null;
+		this.jobIndex.clear();
+		this.jobIndex = null;
+	}
+
+	/**
+	 * Puts file pointer to the beginning of file.
+	 */
+	public void reset() throws IOException {
+		super.seek(0);
+	}
+	
+	public boolean isHeaderLoaded() {
+		return headerLoaded;
+	}
+	
+	public HashMap<String, String[]> getIDMapping(){
+		return this.idMapping;
+	}
+
+
+	public String[] getIDMapping(String waID) {
+		
+		if(idMapping.containsKey(waID)){
+			return this.idMapping.get(waID);
+		}
+		else {	// if mapping for job is not provided, then we assume that xmlJobId, xmlTaskId, swfJobId are equal.
+			String tab[] = {waID, waID};
+			return tab;
+		}
+	}
+	
+	
+	public String getFileName(){
+		return this.fileName;
+	}
+	
+	protected abstract void buildIdx(String line, long position);
+	
+	public static WAParser getInstance(String fileName){
+		String name = fileName.trim().toLowerCase();
+		
+		try {
+			
+			if(name.endsWith("swf")){
+				return new SWFParser(fileName);
+				
+			} else if(name.endsWith("gwf")){
+				return new GWFParser(fileName);
+			}
+			
+		} catch(Exception e){
+			e.printStackTrace();
+		}
+		
+		return null;
+	}
+}
Index: DCWoRMS/trunk/build/classes/simulator/workload/reader/archive/WAReader.java
===================================================================
--- DCWoRMS/trunk/build/classes/simulator/workload/reader/archive/WAReader.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/simulator/workload/reader/archive/WAReader.java	(revision 477)
@@ -0,0 +1,8 @@
+package simulator.workload.reader.archive;
+
+import simulator.workload.reader.JobReader;
+
+public interface WAReader<Job> extends JobReader<Job>{
+
+	public WAParser getParser();
+}
Index: DCWoRMS/trunk/build/classes/simulator/workload/reader/resource/ResourceReader.java
===================================================================
--- DCWoRMS/trunk/build/classes/simulator/workload/reader/resource/ResourceReader.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/simulator/workload/reader/resource/ResourceReader.java	(revision 477)
@@ -0,0 +1,18 @@
+package simulator.workload.reader.resource;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+public interface ResourceReader <Resource, Calendar> {
+
+	public void close();
+	
+	public void setCalendar(Calendar calendar);
+	
+	public Resource read() throws Exception;
+	
+	public void loadPlugins(String fileName);
+	
+}
Index: DCWoRMS/trunk/build/classes/simulator/workload/generator/RandomNumbersWrapper.java
===================================================================
--- DCWoRMS/trunk/build/classes/simulator/workload/generator/RandomNumbersWrapper.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/simulator/workload/generator/RandomNumbersWrapper.java	(revision 477)
@@ -0,0 +1,476 @@
+package simulator.workload.generator;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.xpath.XPath;
+import javax.xml.xpath.XPathConstants;
+import javax.xml.xpath.XPathExpression;
+import javax.xml.xpath.XPathExpressionException;
+import javax.xml.xpath.XPathFactory;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+import org.xml.sax.SAXException;
+
+import simulator.RandomNumbers;
+import simulator.workload.reader.archive.AbstractWAParser;
+import simulator.workload.reader.archive.WAParser;
+import simulator.workload.reader.archive.swf.SWFFields;
+
+import bsh.EvalError;
+import bsh.Interpreter;
+
+import com.sun.org.apache.xml.internal.dtm.ref.DTMNodeList;
+
+public class RandomNumbersWrapper {
+	
+	protected Log log = LogFactory.getLog(RandomNumbersWrapper.class);
+	
+	protected WAParser swfParser;
+	protected String jobId;
+	protected String taskId;
+	
+	protected RandomNumbers randomNumbers[];
+	
+	/**
+	 * List of all dependency paths detected in workload.
+	 */
+	protected ArrayList<ArrayList<String>> idDep;
+	
+	/**
+	 * Map, where key is workload node id and value is arithmetic expression.
+	 */
+	protected HashMap <String, String> idExpMap;
+	protected Interpreter interpreter;
+	
+	public RandomNumbersWrapper(){
+		swfParser = null;
+		idExpMap = new HashMap<String, String>();
+		interpreter = new Interpreter();
+		randomNumbers = new RandomNumbers[5];
+		/*
+		 * 0 - parameterRandomNumbers; 
+		 * 1 - hardConstraintsRandomNumbers;
+		 * 2 - softConstraintsRandomNumbers;
+		 * 3 - timeConstraintsRandomNumbers;
+		 * 4 - precedingConstraintsRandomNumbers;
+		 */
+	}
+	
+	public void setExternalFileDpendencies(String fileName){
+		try {
+			
+			this.swfParser = AbstractWAParser.getInstance(fileName);
+			
+		} catch (NullPointerException e) {
+			e.printStackTrace();
+		}
+	}
+	
+	public void setCurrentJobId(String id){
+		this.jobId = id;
+	}
+	
+	public void setCurrentTaskId(String id){
+		this.taskId = id;
+	}
+	
+	public void setParameterRandomNumbers(RandomNumbers parameterRandomNumbers) {
+		randomNumbers[0] = parameterRandomNumbers;
+	}
+	public void setHardConstraintsRandomNumbers(
+			RandomNumbers hardConstraintsRandomNumbers) {
+		randomNumbers[1] = hardConstraintsRandomNumbers;
+	}
+	public void setSoftConstraintsRandomNumbers(
+			RandomNumbers softConstraintsRandomNumbers) {
+		randomNumbers[2] = softConstraintsRandomNumbers;
+	}
+	public void setTimeConstraintsRandomNumbers(
+			RandomNumbers timeConstraintsRandomNumbers) {
+		randomNumbers[3] = timeConstraintsRandomNumbers;
+	}
+	public void setPrecedingConstraintsRandomNumbers(
+			RandomNumbers precedingConstraintsRandomNumbers) {
+		randomNumbers[4] = precedingConstraintsRandomNumbers;
+	}
+	
+	
+	public double evalValueFor(String id, String refElementId){
+		ArrayList<String> path = null;
+		String idName;
+		boolean found = false;
+		int idx = 0;
+		
+		// find path which contains node.id . 
+		for(int i = 0; i < idDep.size(); i++){
+			path = idDep.get(i);
+			// find position of id in path
+			for(idx = 0; idx < path.size(); idx++){
+				idName = path.get(idx);
+				if(idName.equals(id)) {
+					found = true;
+					break;
+				}
+			}
+			if(found) break;
+		}
+		
+		if(!found)
+			throw new RuntimeException("No value for "+id);
+
+		RandomNumbers randomNumber;
+		String genName;
+		String expr;
+		double value = 0;
+		Number nValue;
+		
+		
+		try {
+			// this is the id of the first node in the path. All others nodes depends on this node. 
+			idName = path.get(0);
+				
+			if(isExternalFileDependent(refElementId)){	// evaluate external file dependency
+				value = evalExternalFileDependency(refElementId);
+				if(idExpMap.containsKey(idName)){
+					expr = idExpMap.get(idName);
+					interpreter.set("x", value);
+					nValue = (Number) interpreter.eval(expr);
+					value = nValue.doubleValue();
+				}
+			} else {								// if there is no external file dependency, try to use random generator
+				for(int i = 0; i < randomNumbers.length; i++){
+					randomNumber = randomNumbers[i];
+					if(randomNumber.containsElement(idName)){
+						genName = randomNumber.getGeneratorName(idName);
+				//		value = randomNumber.getRandomValue(genName);
+						value = randomNumber.getLastGeneratedRandomValue(genName);
+						break;
+					}
+				}
+			}
+			
+			// execute all arithmetic dependency expressions between first node and current one.
+			for(int i = 1; i <= idx; i++){
+				idName = path.get(i);
+				expr = idExpMap.get(idName);
+				interpreter.set("x", value);
+				nValue = (Number)interpreter.eval(expr);
+				value = nValue.doubleValue();
+				if(i < idx) {
+					// random factor which was generated last time should be added to current value.
+					for(int j = 0; j < randomNumbers.length; j++){
+						randomNumber = randomNumbers[j];
+						if(randomNumber.containsElement(idName)){
+							genName = randomNumber.getGeneratorName(idName);
+							value = value + randomNumber.getLastGeneratedRandomValue(genName);
+							break;
+						}
+					}
+				}
+			}
+			
+			// if for current node is defined any random generator, it means that to the value 
+			// accounted by arithmetic expressions some random factor must be added.
+			for(int i = 0; i < randomNumbers.length; i++){
+				randomNumber = randomNumbers[i];
+				if(randomNumber.containsElement(idName)){
+					genName = randomNumber.getGeneratorName(idName);
+					value = value + randomNumber.getRandomValue(genName);
+					break;
+				}
+			}
+			
+		} catch (IllegalAccessException e){
+			e.printStackTrace();
+		} catch (EvalError e) {
+			e.printStackTrace();
+		}
+
+		return value;
+	}
+	
+	
+	/**
+	 * 
+	 * @param fileLocation - workload configuration file location
+	 * @return list of lists of xml elements id's, organized in dependency order (top-down hierarchy)
+	 * or null if no dependencies in workload configuration file were detected.
+	 * @throws Exception if cycle in dependency graph was detected
+	 */
+	public ArrayList<ArrayList<String>> findDependencies(String fileLocation) throws Exception{
+		ArrayList <ArrayList<String>> genOrderList = new ArrayList<ArrayList<String>>();
+		
+		try {
+			DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
+			DocumentBuilder builder = docFactory.newDocumentBuilder();
+			Document doc = builder.parse(fileLocation);
+			
+			
+			XPathFactory factory = XPathFactory.newInstance();
+			XPath xpath = factory.newXPath();
+			XPathExpression expr = xpath.compile("//*[@id]");
+			
+			Object wynik = expr.evaluate(doc, XPathConstants.NODESET);
+			DTMNodeList list = (DTMNodeList) wynik;
+			Node node = null;
+			Node refAttr = null;
+			Node idAttr = null;
+			
+			HashMap<String, Integer> nodeMap = new HashMap<String, Integer>();
+			HashMap<Integer, String> nodeMapInv = new HashMap<Integer, String>();
+			String key;
+			for(int i = 0; i < list.getLength(); i++){
+				node = list.item(i);
+				key = node.getAttributes().getNamedItem("id").getNodeValue();
+				nodeMap.put(key, i);
+				nodeMapInv.put(i, key);
+				node = node.getAttributes().getNamedItem("expr");
+				if(node != null && node.getNodeValue() != null)
+					idExpMap.put(key, node.getNodeValue());
+				else
+					idExpMap.put(key, "x");
+			}
+			
+			int size = nodeMap.size();
+			if(size == 0)
+				return null;
+			
+			int refGraph[] = new int[size];
+			for(int i = 0; i < refGraph.length; i++)
+				refGraph[i] = -1;
+			
+			expr = xpath.compile("//*[@refElementId]");
+			wynik = expr.evaluate(doc, XPathConstants.NODESET);
+			int x = 0;
+			int y = 0;
+			String idValue = null;
+			for(int i = 0; i < list.getLength(); i++){
+				node = list.item(i);
+				refAttr = node.getAttributes().getNamedItem("refElementId");
+				idAttr = node.getAttributes().getNamedItem("id");
+				if(refAttr != null){
+					try {
+						idValue = idAttr.getNodeValue();
+						y = nodeMap.get(idValue);
+						x = nodeMap.get(refAttr.getNodeValue());
+						refGraph[y] = nodeMap.get(nodeMapInv.get(x));
+						
+					} catch (NullPointerException e){
+						log.warn("Element referenced by " + idValue + " doeas not exist in configuration file.");
+					}
+				}
+			}
+
+			// find start points
+			/*
+			 * ostatni w grafie jest ten, ktory nie poprzedza innego wierzcholka (nie ma nastepnikow).
+			 * W celu lokalizacji:
+			 * jezeli wierzcholek 'i' posiada poprzednika 'p', to poprzednik 'p' oznaczany jest jako uzyty
+			 * (posiadajacy nastepnika) - pod indeksem reprezentujacym 'p' w helpTab wpisywne jest -1
+			 */
+			
+			int helpTab[] = new int[refGraph.length];
+			for(int i = 0; i < refGraph.length; i++){
+				if(refGraph[i] != -1)			// bo -1 nie moze byc indeksem tablicy
+					helpTab[refGraph[i]] = -1;
+			}
+			
+			// path end detection
+			/*
+			 * jezeli wierzcholek 'i' posiada w tabeli helpTab wartosc 0, to oznacza, ze nie posiada
+			 * nastepnikow - jest ostatnim wierzcholkiem na sciezce
+			 */
+			ArrayList <Integer> pathEnd = new ArrayList<Integer>();
+			for(int i = 0; i < helpTab.length; i++){
+				if(helpTab[i] == 0) {
+					pathEnd.add(i);
+				}
+			}
+			
+			int loopDetector[] = new int[refGraph.length];
+			/*
+			 * jezeli jakis wierzcholek nigdy nie zostal uzyty w trakcie przejscia wszystkimi sciezkami
+			 * to albo jest wolnym strzelcem albo nalezy do cyklu, z ktorego zaden wierzcholek nie nalezy
+			 * do listy pathEnd
+			 */
+			int usedNodes[] = new int[refGraph.length]; // 1 - used, 0 - not used
+			boolean process = true;
+			boolean loopNotFound = true;
+			int idx = 0;
+			int pathId = 0;
+			int val = 0;
+			String path = new String();
+			ArrayList <String> genOrder = new ArrayList<String>();
+			
+			if(pathEnd.size() == 0)
+				throw new Exception("ERROR: Loop detected in attributes dependency.");
+			
+			// for each path (path end)
+			for(int i = 0; i < pathEnd.size(); i++){
+				System.arraycopy(refGraph, 0, loopDetector, 0, refGraph.length);
+				idx = pathEnd.get(i);
+				usedNodes[idx] = 1;
+				pathId = refGraph.length + idx;
+				path = nodeMapInv.get(idx);
+				genOrder.clear();
+				genOrder.add(0, path);
+				process = true;
+				loopNotFound = true;
+				
+				// found ancestor of current nod
+				// path is build from the end to the beginning
+				while(process && loopNotFound){
+					val = loopDetector[idx];
+					
+					if(val == -1)
+						process = false;
+					else if(val == -pathId)
+ 						loopNotFound = false;
+ 					else {
+ 						loopDetector[idx] = -pathId;
+ 						path = nodeMapInv.get(val) + " -> " + path;
+ 						usedNodes[val] = 1;
+ 						genOrder.add(0, nodeMapInv.get(val));
+ 					}
+					idx = val;
+				}
+				if(!loopNotFound) {
+					throw new Exception("ERROR: Loop detected in atributes dependency, path: "+path);
+				}
+				
+				if(genOrder.size() > 0){
+					genOrderList.add((ArrayList<String>)genOrder.clone());
+				}
+				
+			}
+			
+			// the same as above loop, but for all unused nodes.
+			for(int i = 0; i < usedNodes.length; i++){
+				if(usedNodes[i] == 0){
+					System.arraycopy(refGraph, 0, loopDetector, 0, refGraph.length);
+					idx = i;
+					pathId = refGraph.length + idx;
+					path = nodeMapInv.get(idx);
+					genOrder.clear();
+					genOrder.add(0, path);
+					process = true;
+					loopNotFound = true;
+					
+					while(process && loopNotFound){
+						val = loopDetector[idx];
+						
+						if(val == -1)
+							process = false;
+						else if(val == -pathId)
+	 						loopNotFound = false;
+	 					else {
+	 						loopDetector[idx] = -pathId;
+	 						path = nodeMapInv.get(val) + " -> " + path;
+	 						genOrder.add(0, nodeMapInv.get(val));
+	 					}
+						idx = val;
+					}
+					if(!loopNotFound){
+						throw new Exception("ERROR: Loop detected in atributes dependency, path: "+path);
+					}
+					
+					if(genOrder.size() > 0){
+						genOrderList.add((ArrayList<String>)genOrder.clone());
+					}
+				}
+			}
+			
+		} catch (XPathExpressionException e) {
+			e.printStackTrace();
+		} catch (ParserConfigurationException e) {
+			e.printStackTrace();
+		} catch (SAXException e) {
+			e.printStackTrace();
+		} catch (IOException e) {
+			e.printStackTrace();
+		}
+		
+		idDep = genOrderList;
+		return genOrderList;
+	}
+	
+	protected boolean isExternalFileDependent(String idName){
+		if(idName.startsWith("swf."))
+			return true;
+		
+		return false;
+	}
+	
+	protected double evalExternalFileDependency(String refElementId){
+		String filedName = refElementId.substring(4).toUpperCase();
+		
+		try {
+			String value = null;
+			
+			if("JOB_NUMBER".equals(filedName)){
+				value = swfParser.readTask(jobId, taskId)[SWFFields.DATA_JOB_NUMBER];
+			} else if("SUBMIT_TIME".equals(filedName)){
+				value = swfParser.readTask(jobId, taskId)[SWFFields.DATA_SUBMIT_TIME];
+			} else if("WAIT_TIME".equals(filedName)){
+				value = swfParser.readTask(jobId, taskId)[SWFFields.DATA_WAIT_TIME];
+			} else if("RUN_TIME".equals(filedName)){
+				value = swfParser.readTask(jobId, taskId)[SWFFields.DATA_RUN_TIME];
+			} else if("NUMBER_OF_ALLOCATED_PROCESSORS".equals(filedName)){
+				value = swfParser.readTask(jobId, taskId)[SWFFields.DATA_NUMBER_OF_ALLOCATED_PROCESSORS];
+			} else if("AVERAGE_CPU_TIME_USED".equals(filedName)){
+				value = swfParser.readTask(jobId, taskId)[SWFFields.DATA_AVERAGE_CPU_TIME_USED];
+			} else if("USED_MEMORY".equals(filedName)){
+				value = swfParser.readTask(jobId, taskId)[SWFFields.DATA_USED_MEMORY];
+			} else if("REQUESTED_NUMBER_OF_PROCESSORS".equals(filedName)){
+				value = swfParser.readTask(jobId, taskId)[SWFFields.DATA_REQUESTED_NUMBER_OF_PROCESSORS];
+			} else if("REQUESTED_TIME".equals(filedName)){
+				value = swfParser.readTask(jobId, taskId)[SWFFields.DATA_REQUESTED_TIME];
+			} else if("REQUESTED_MEMORY".equals(filedName)){
+				value = swfParser.readTask(jobId, taskId)[SWFFields.DATA_REQUESTED_MEMORY];
+			} else if("STATUS".equals(filedName)){
+				value = swfParser.readTask(jobId, taskId)[SWFFields.DATA_STATUS];
+			} else if("USER_ID".equals(filedName)){
+				value = swfParser.readTask(jobId, taskId)[SWFFields.DATA_USER_ID];
+			} else if("GROUP_ID".equals(filedName)){
+				value = swfParser.readTask(jobId, taskId)[SWFFields.DATA_GROUP_ID];
+			} else if("EXECUTABLE_NUMBER".equals(filedName)){
+				value = swfParser.readTask(jobId, taskId)[SWFFields.DATA_EXECUTABLE_NUMBER];
+			} else if("QUEUE_NUMBER".equals(filedName)){
+				value = swfParser.readTask(jobId, taskId)[SWFFields.DATA_QUEUE_NUMBER];
+			} else if("PARTITION_NUMBER".equals(filedName)){
+				value = swfParser.readTask(jobId, taskId)[SWFFields.DATA_PARTITION_NUMBER];
+			} else if("PRECEDING_JOB_NUMBER".equals(filedName)){
+				value = swfParser.readTask(jobId, taskId)[SWFFields.DATA_PRECEDING_JOB_NUMBER];
+			} else if("THINK_TIME_FROM_PRECEDING_JOB".equals(filedName)){
+				value = swfParser.readTask(jobId, taskId)[SWFFields.DATA_THINK_TIME_FROM_PRECEDING_JOB];
+			} else {
+				log.error("No external value for element reference "+refElementId + ". Assign default value 0.");
+				return 0;
+			}
+			
+			return Double.valueOf(value);
+			
+		} catch (IOException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+		
+		return 0;
+	}
+	
+	public void close(){
+		try {
+			swfParser.close();
+		} catch (IOException e) {
+			e.printStackTrace();
+		}
+	}
+}
Index: DCWoRMS/trunk/build/classes/simulator/workload/generator/JobGenerator.java
===================================================================
--- DCWoRMS/trunk/build/classes/simulator/workload/generator/JobGenerator.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/simulator/workload/generator/JobGenerator.java	(revision 477)
@@ -0,0 +1,20 @@
+package simulator.workload.generator;
+
+import java.io.FileNotFoundException;
+import java.io.IOException;
+
+/**
+ * @author Marcin Krystek
+ *
+ */
+public interface JobGenerator {
+	
+	public void generateWorkload(String workloadConfigFileName, String outputDirectoryName, 
+								boolean overwriteExistingFiles, String outputWorkloadFileName) throws FileNotFoundException, IOException;
+	
+	public void generateXMLSupplement(String configurationFileName, String swfFileName, 
+								String outputDirectoryName, boolean ignoreNonEmptyOutputDir) throws FileNotFoundException, IOException;
+	
+	public void performPostprocessing(String resDescriptionFileName, String outputDirectoryName, String outputWorkloadFileName);
+	
+}
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 477)
@@ -0,0 +1,923 @@
+package simulator.workload.generator.impl;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.Writer;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Locale;
+import java.util.Set;
+
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.xpath.XPath;
+import javax.xml.xpath.XPathConstants;
+import javax.xml.xpath.XPathExpression;
+import javax.xml.xpath.XPathExpressionException;
+import javax.xml.xpath.XPathFactory;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.exolab.castor.types.Duration;
+import org.exolab.castor.xml.MarshalException;
+import org.exolab.castor.xml.ValidationException;
+import org.qcg.broker.schemas.jobdesc.Application;
+import org.qcg.broker.schemas.jobdesc.ComputingResourceBaseTypeChoice;
+import org.qcg.broker.schemas.jobdesc.ComputingResourceBaseTypeChoiceItem;
+import org.qcg.broker.schemas.jobdesc.ComputingResourceParameterType;
+import org.qcg.broker.schemas.jobdesc.ComputingResourceType;
+import org.qcg.broker.schemas.jobdesc.Executable;
+import org.qcg.broker.schemas.jobdesc.ExecutionTimeType;
+import org.qcg.broker.schemas.jobdesc.ExecutionType;
+import org.qcg.broker.schemas.jobdesc.ParameterBoundaryType;
+import org.qcg.broker.schemas.jobdesc.ParameterChoice;
+import org.qcg.broker.schemas.jobdesc.ParameterTypeChoice;
+import org.qcg.broker.schemas.jobdesc.ParameterTypeChoiceItem;
+import org.qcg.broker.schemas.jobdesc.ParameterValueType;
+import org.qcg.broker.schemas.jobdesc.PreferencesType;
+import org.qcg.broker.schemas.jobdesc.QcgJob;
+import org.qcg.broker.schemas.jobdesc.RangeType;
+import org.qcg.broker.schemas.jobdesc.RequirementsType;
+import org.qcg.broker.schemas.jobdesc.ResourceRequirementsType;
+import org.qcg.broker.schemas.jobdesc.StringValue;
+import org.qcg.broker.schemas.jobdesc.Task;
+import org.qcg.broker.schemas.jobdesc.TimePeriod;
+import org.qcg.broker.schemas.jobdesc.TimePeriodChoice;
+import org.qcg.broker.schemas.jobdesc.types.ComputingParameterName;
+import org.qcg.broker.schemas.jobdesc.types.ExecutionTypeTypeType;
+import org.qcg.broker.schemas.jobdesc.types.ParameterOptimizationTypeType;
+import org.qcg.broker.schemas.jobdesc.types.PreferencesTypePreferenceTypeType;
+import org.w3c.dom.DOMException;
+import org.w3c.dom.Node;
+import org.xml.sax.InputSource;
+
+import simulator.WormsConstants;
+import simulator.utils.GSSimXML;
+import simulator.utils.XsltTransformations;
+import simulator.workload.exceptons.NoSuchCommentException;
+import simulator.workload.fileFilters.QcgJobFileNameFilter;
+import simulator.workload.generator.JobGenerator;
+import simulator.workload.generator.configuration.ComputingResourceHostParameter;
+import simulator.workload.generator.configuration.ExecDuration;
+import simulator.workload.generator.configuration.ExecutionTime;
+import simulator.workload.generator.configuration.ExecutionTimeChoice;
+import simulator.workload.generator.configuration.Importance;
+import simulator.workload.generator.configuration.Max;
+import simulator.workload.generator.configuration.Min;
+import simulator.workload.generator.configuration.Parameter;
+import simulator.workload.generator.configuration.PeriodDuration;
+import simulator.workload.generator.configuration.PeriodEnd;
+import simulator.workload.generator.configuration.PeriodStart;
+import simulator.workload.generator.configuration.Preferences;
+import simulator.workload.generator.configuration.Range;
+import simulator.workload.generator.configuration.TaskLength;
+import simulator.workload.generator.configuration.Value;
+import simulator.workload.generator.configuration.WorkloadConfiguration;
+import simulator.workload.generator.configuration.types.OptimizationTypeType;
+import simulator.workload.generator.configuration.types.PreferencesPreferenceTypeType;
+import simulator.workload.reader.archive.AbstractWAParser;
+import simulator.workload.reader.archive.AbstractWAReader;
+import simulator.workload.reader.archive.WAParser;
+import simulator.workload.reader.archive.WAReader;
+import simulator.workload.reader.archive.swf.SWFFields;
+import simulator.workload.writer.swf.QcgSWFJobWriter;
+import simulator.workload.writer.swf.SWFJobWriter;
+
+import com.sun.org.apache.xml.internal.dtm.ref.DTMNodeList;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+public class QcgJobGenerator extends AbstractJobGenerator implements JobGenerator {
+
+	private static Log log = LogFactory.getLog(QcgJobGenerator.class);
+	protected static int TIME_OUT = 10;
+	private File lastUpdatedFile = null;
+	private String lastUpdatedJob = null;
+	
+	public void generateXMLSupplement(String configurationFileName, String waFileName, 
+							String outputDirectoryName, boolean ignoreNonEmptyOutputDir) 
+												throws FileNotFoundException, IOException{
+		if(log.isInfoEnabled())
+			log.info("Generate xml suplement - start");
+		
+		WAReader<QcgJob> swfReader = AbstractWAReader.getInstace(waFileName);
+		WAParser swfParser = AbstractWAParser.getInstance(waFileName);
+		QcgJob QcgJob = null;
+		Task task = null;
+		Writer writer = null;
+		long startTime = 0;
+		
+		File outputDirectory = prepareWorkloadDirectory(outputDirectoryName, ignoreNonEmptyOutputDir);
+		
+		try {
+			randomNumbersWrapper.findDependencies(configurationFileName);
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+
+		workload = (WorkloadConfiguration) GSSimXML.unmarshal(WorkloadConfiguration.class, new FileReader(configurationFileName));
+		init(workload);
+		this.randomNumbersWrapper.setExternalFileDpendencies(waFileName);
+		
+		swfParser.loadHeader();
+		try {
+			SimpleDateFormat df = new SimpleDateFormat("EEE MMM dd HH:mm:ss ZZZZ yyyy", Locale.ENGLISH);
+			startTime = df.parse(swfParser.getCommentValue(SWFFields.COMMENT_STARTTIME)).getTime();
+		} catch (NoSuchCommentException e) {
+			if(log.isErrorEnabled())
+				log.error("No start time filed in swf header. Start time = 0");
+			startTime = 0;
+		} catch (ParseException e) {
+			if(log.isErrorEnabled())
+				log.error("Start time parse exception. Start time = 0");
+			startTime = 0;
+		}
+		
+		try {
+			
+			while((QcgJob = swfReader.read()) != null){
+				
+				for(int i = 0; i < QcgJob.getTaskCount(); i++){
+					task = QcgJob.getTask(i);
+					this.randomNumbersWrapper.setCurrentJobId(QcgJob.getAppId());
+					this.randomNumbersWrapper.setCurrentTaskId(task.getTaskId());
+					RequirementsType hardConstraints = createResourceRequirements(workload, task.getRequirements());
+					if(hardConstraints != null) {
+						task.setRequirements(hardConstraints);
+					}
+					
+					
+					long submitTime = 0;
+					String sTab[] = swfParser.readTask(QcgJob.getAppId(), task.getTaskId());
+					if(sTab != null)
+						submitTime = startTime + Long.parseLong(sTab[SWFFields.DATA_SUBMIT_TIME]) * 1000;
+
+					ExecutionTimeType execTime = createTimeRequirements(workload, submitTime, task.getExecutionTime());
+					if(execTime != null) {
+						task.setExecutionTime(execTime);
+					}
+					
+				}
+				
+				if(QcgJob.getTaskCount() > 0){
+					writer = new FileWriter(outputDirectory.getPath() + 
+											File.separator + 
+											QcgJobFileNameFilter.FILE_NAME_PREFIX + 
+											QcgJob.getAppId() + 
+											".xml");
+					
+					GSSimXML.marshal(QcgJob, writer);
+					writer.close();
+				}
+			}
+			
+			swfReader.close();
+			
+		} catch (IOException e) {
+			throw e;
+		} finally {
+			swfReader.close();
+			swfParser.close();
+			this.randomNumbersWrapper.close();
+		}
+		
+		if(log.isInfoEnabled())
+			log.info("Generate xml suplement - done");
+	}
+
+	
+	public void generateWorkload(String workloadConfigFileName,
+			String outputDirectoryName, boolean overwriteExistingFiles,
+			String outputWorkloadFileName) throws FileNotFoundException, IOException {
+		
+		if(log.isInfoEnabled())
+			log.info("Generate workload - start");
+		
+		boolean creationResult = false;
+		File outputDirectory = prepareWorkloadDirectory(outputDirectoryName, overwriteExistingFiles);
+
+		SWFJobWriter<QcgJob> swfJobWriter = new QcgSWFJobWriter(outputDirectoryName, outputWorkloadFileName);
+		swfJobWriter.writeFieldDescriptionHeader();
+		
+		try {
+			randomNumbersWrapper.findDependencies(workloadConfigFileName);
+		} catch (Exception e2) {
+			e2.printStackTrace();
+		}
+
+		// load workload configuration from xml file
+		try {
+			workload = WorkloadConfiguration.unmarshal(new FileReader(workloadConfigFileName));
+		} catch (MarshalException e2) {
+			e2.printStackTrace();
+		} catch (ValidationException e2) {
+			e2.printStackTrace();
+		}
+
+		// beginning of time FIXME the SIMULATION VIRTUAL TIME has not yet been tested
+		simulationVirtualTime = workload.getSimulationStartTime().getTime();
+		long simulationStartTime = simulationVirtualTime;
+		
+		swfJobWriter.writeComment("StartTime", String.valueOf(workload.getSimulationStartTime()));
+		
+		jobCount = workload.getWorkloadConfigurationChoice().getJobCount();
+		simulationDuration = workload.getWorkloadConfigurationChoice().getSimulationTime();
+		if (simulationDuration != null)
+			simulationEndTime = new Date(simulationVirtualTime+simulationDuration.toLong());
+		
+		init(workload);
+
+		if (jobCount != null) {
+			try {
+				jobCountToBeGenerated = (int) getRandomValueFor(jobCount, parameterRandomNumbers);
+				jobCountToBeGenerated--; // because we count jobs from 0
+			} catch (IllegalAccessException e) {
+				e.printStackTrace();
+			}
+		}
+		
+		// the random length of the task group to be submitted at one moment
+		long jobPackageLength = 0L;
+		TaskLength taskLength;
+		// we start with first job
+		generatedJobCount = 0;
+		
+		while (proceedConditionsAreFulfilled()) {
+			QcgJob QcgJob = new QcgJob();
+			
+			String jobID = Integer.toString(generatedJobCount);
+			QcgJob.setAppId(jobID);
+			
+			//initially - a standard value
+			taskCountToBeGenerated = WormsConstants.DEFAULT_TASK_COUNT_IN_SINGLE_JOB; 
+			
+			try {
+				taskCountToBeGenerated = (int) getRandomValueFor(workload.getTaskCount(), parameterRandomNumbers);
+			} catch (IllegalAccessException e1) {
+				e1.printStackTrace();
+			}
+
+			// the end of current package of tasks, need to generate new package length
+			if (jobPackageLength == 0) {
+				try {
+					// it is always a whole number
+					jobPackageLength = (long) getRandomValueFor(workload.getJobPackageLength(), parameterRandomNumbers);
+					// it is always a whole number
+					long jobInterval = (long) getRandomValueFor(workload.getJobInterval(), parameterRandomNumbers);
+					// all jobs (tasks) in a package have the same submit time 
+					simulationVirtualTime = simulationVirtualTime + (jobInterval * 1000);
+					if (simulationDuration != null) {
+						simulationVirtualTime = Math.min(simulationVirtualTime, simulationEndTime.getTime());
+					}
+				} catch (IllegalAccessException e) {
+					e.printStackTrace();
+				}
+			}
+			
+			for (int taskNum = 0; taskNum < taskCountToBeGenerated; taskNum++) {
+				Task task = new Task();
+				QcgJob.addTask(task);
+				
+				task.setTaskId(String.valueOf(taskNum));
+				
+				// create section execution
+				//ExecutionType execution = createExecution(workload, null);
+				//task.setExecution(execution);
+				
+				// create requirements section
+				RequirementsType requirements = createResourceRequirements(workload, null);
+				if(requirements != null) {
+					task.setRequirements(requirements);
+				}
+				
+				taskLength = workload.getTaskLength();
+				if(taskLength != null) {
+					try {
+						long l_taskLength = (long) getRandomValueFor(taskLength, parameterRandomNumbers);
+						swfJobWriter.addTaskLength(task.getTaskId(), l_taskLength);
+					} catch (IllegalAccessException e) {
+						e.printStackTrace();
+					}
+				}
+				
+				// create execution time section
+				//long submitTime = workload.getSimulationStartTime().getTime() + simulationVirtualTime*1000;
+				long submitTime = simulationVirtualTime;
+				ExecutionTimeType execTime = createTimeRequirements(workload, submitTime, null);
+				if(execTime != null) {
+					task.setExecutionTime(execTime);
+				}
+				
+			} // end of task generation
+
+
+			// one job less from the package
+			jobPackageLength--;
+			
+			// create workflow from generated tasks
+			// createWorkflow(workload, QcgJob.getTask());
+			
+			File taskFile = null;
+			if(generatedJobCount < 10)
+				taskFile = new File(outputDirectory, QcgJobFileNameFilter.FILE_NAME_PREFIX + "_0" + jobID + ".xml");
+			else
+				taskFile = new File(outputDirectory, QcgJobFileNameFilter.FILE_NAME_PREFIX + "_" + jobID + ".xml");
+			
+			try {
+				creationResult = taskFile.createNewFile();
+			} catch (IOException e) {
+				e.printStackTrace();
+			}
+			
+			// the file was not created
+			if (! creationResult) { 
+				throw new IOException("Cannot create the task file for taskid: "+jobID);
+			}
+
+			FileWriter taskWriter = new FileWriter(taskFile);
+			GSSimXML.marshal(QcgJob, taskWriter);
+			taskWriter.flush();
+			taskWriter.close();
+			
+			//swfJobWriter.setJobSubmitTime(simulationVirtualTime);
+			swfJobWriter.setJobSubmitTime((simulationVirtualTime - simulationStartTime)/1000);
+			swfJobWriter.write(QcgJob);
+			
+			generatedJobCount++;
+		
+		} // end of job generation
+
+		swfJobWriter.close();
+		
+		if(log.isInfoEnabled())
+			log.info("Generate workload - done");
+	}
+
+	protected ExecutionType createExecution(WorkloadConfiguration workload, ExecutionType exec){
+		ExecutionType execution = new ExecutionType();
+		Executable executable = new Executable();
+				Application application = new Application();
+				application.setName("app");
+			executable.setApplication(application);
+		execution.setExecutable(executable);
+		execution.setType(ExecutionTypeTypeType.SINGLE);
+		return execution;
+	}
+
+
+	protected RequirementsType createResourceRequirements(WorkloadConfiguration workload, RequirementsType hCons) {
+		ResourceRequirementsType resRequirements = null;
+		RequirementsType requirements = hCons;
+		ComputingResourceHostParameter compResParameters[] = workload.getComputingResourceHostParameter();
+		
+		if (compResParameters != null && compResParameters.length > 0) {
+			
+			if(requirements == null) {
+				requirements = new RequirementsType();
+				
+			}
+			
+			resRequirements = requirements.getResourceRequirements();
+			if(resRequirements == null){
+				resRequirements = new ResourceRequirementsType();
+				requirements.setResourceRequirements(resRequirements);
+			}
+			
+			ComputingResourceType computingResource = null;
+			if(resRequirements.getComputingResourceCount() == 0){
+				computingResource = new ComputingResourceType();
+				resRequirements.addComputingResource(computingResource);
+			} else {
+				computingResource = resRequirements.getComputingResource(0);
+			}
+			
+			ComputingResourceBaseTypeChoice choice = computingResource.getComputingResourceBaseTypeChoice();
+			if(choice == null){
+				choice = new ComputingResourceBaseTypeChoice();
+				computingResource.setComputingResourceBaseTypeChoice(choice);
+			}
+					
+			
+			
+			for (int i = 0; i < compResParameters.length; i++) {
+				ComputingResourceHostParameter compResParameter = compResParameters[i];
+
+				ComputingResourceBaseTypeChoiceItem item = new ComputingResourceBaseTypeChoiceItem();
+				choice.addComputingResourceBaseTypeChoiceItem(item);
+				
+				ComputingResourceParameterType hostParameter = new ComputingResourceParameterType();
+				item.setHostParameter(hostParameter);
+				
+				String name = compResParameter.getMetric();
+				ComputingParameterName parameterName = ComputingParameterName.fromValue(name);
+				hostParameter.setName(parameterName);
+				
+				Range[] ranges = compResParameter.getRange();
+				ParameterTypeChoice ptc = new ParameterTypeChoice();
+				hostParameter.setParameterTypeChoice(ptc);
+				
+				for (int r = 0; r < ranges.length; ++r) {
+					ParameterTypeChoiceItem ptci = new ParameterTypeChoiceItem();
+						org.qcg.broker.schemas.jobdesc.Range range = new org.qcg.broker.schemas.jobdesc.Range();
+					ptci.setRange(range);
+					ptc.addParameterTypeChoiceItem(ptci);
+					
+					Range workloadRange = ranges[r];
+					if (workloadRange.getMax() != null) {
+						
+						try {
+							Max maxRange = workloadRange.getMax();
+							Double rangeMax = getRandomValueFor(maxRange, hardConstraintsRandomNumbers);
+							
+							ParameterBoundaryType max = new ParameterBoundaryType();
+							max.setContent(Math.round(rangeMax));
+							range.setMax(max);
+							
+						} catch (IllegalAccessException e) {
+							e.printStackTrace();
+						}
+						
+					}
+					if (workloadRange.getMin() != null) {
+						try {
+							Min minRange = workloadRange.getMin();
+							Double rangeMin = getRandomValueFor(minRange, hardConstraintsRandomNumbers);
+							
+							ParameterBoundaryType min = new ParameterBoundaryType();
+							min.setContent(Math.round(rangeMin));
+							range.setMin(min);
+						} catch (IllegalAccessException e) {
+							e.printStackTrace();
+						}
+
+					}
+				}
+
+				boolean useStringValue = useStringValue(parameterName);
+				Value[] values = compResParameter.getValue();
+				for (int v = 0; v < values.length; ++v) {
+					
+					try {
+						
+						
+						Double dValue = getRandomValueFor(values[v], hardConstraintsRandomNumbers);
+						
+						
+						if(useStringValue) {
+							StringValue stringValue = new StringValue();
+							stringValue.setValue(String.valueOf(Math.round(dValue)));
+							hostParameter.addStringValue(stringValue);
+						} else {
+							ParameterTypeChoiceItem ptci = new ParameterTypeChoiceItem();
+							org.qcg.broker.schemas.jobdesc.Value value = new org.qcg.broker.schemas.jobdesc.Value();
+								value.setContent(Math.round(dValue));
+							ptci.setValue(value);
+							ptc.addParameterTypeChoiceItem(ptci);
+						}
+
+					} catch (IllegalAccessException e) {
+						e.printStackTrace();
+					}
+					
+				}
+			}
+		}
+
+		// create section preferences
+		if(resRequirements != null){
+			PreferencesType preferences = createPreferences(workload, resRequirements.getPreferences());
+			if(preferences != null) {
+				resRequirements.setPreferences(preferences);
+			}
+		}
+		
+		return requirements;
+	}
+	
+
+	protected PreferencesType createPreferences(WorkloadConfiguration workload, PreferencesType sCons) {
+		PreferencesType preferences = sCons;
+		Preferences workloadPreferences = workload.getPreferences();
+		
+		if (workloadPreferences == null) 
+			return preferences;
+		
+		if(preferences == null)
+			preferences = new PreferencesType();
+			
+		PreferencesTypePreferenceTypeType softConstraintsPreferenceTypeType = null;
+		
+		switch (workloadPreferences.getPreferenceType().getType()) {
+			case PreferencesPreferenceTypeType.PRIORITY_TYPE:
+				softConstraintsPreferenceTypeType = PreferencesTypePreferenceTypeType.PRIORITY;
+				break;
+			case PreferencesPreferenceTypeType.RANKING_TYPE:
+				softConstraintsPreferenceTypeType = PreferencesTypePreferenceTypeType.RANKING;
+				break;
+		}
+
+		preferences.setPreferenceType(softConstraintsPreferenceTypeType);
+
+		
+		Parameter[] parameters = workloadPreferences.getParameter();
+		for (int i = 0; i < parameters.length; ++i) {
+			Parameter constraint = parameters[i];
+			org.qcg.broker.schemas.jobdesc.Parameter parameter = new org.qcg.broker.schemas.jobdesc.Parameter();
+			
+			switch (constraint.getOptimizationType().getType()) {
+				case OptimizationTypeType.COST_TYPE:
+					parameter.setOptimizationType(ParameterOptimizationTypeType.COST);
+					break;
+				case OptimizationTypeType.GAIN_TYPE:
+					parameter.setOptimizationType(ParameterOptimizationTypeType.GAIN);						
+					break;
+			}
+
+			String parameterName = constraint.getName();
+			parameter.setName(parameterName);
+
+			String endpoint = constraint.getEndpoint();
+			parameter.setEndpoint(endpoint);
+
+			Importance importance = constraint.getImportance();
+			try {
+				Double impValue;
+				impValue = getRandomValueFor(importance, softConstraintsRandomNumbers);
+				
+				if (impValue.equals(new Double(0)) && 
+						softConstraintsPreferenceTypeType == PreferencesTypePreferenceTypeType.PRIORITY) {
+					
+					if(log.isWarnEnabled())
+						log.warn("\nWARNING: the constraint "+ parameterName + 
+										" has importance set to zero."+
+										" Non deterministic simulation may occur!\n");
+				}
+				parameter.setImportance(impValue.intValue());
+				
+				ParameterChoice choice = new ParameterChoice();
+				parameter.setParameterChoice(choice);
+				
+				Range rangeTab[] = constraint.getRange();
+				if(rangeTab != null && rangeTab.length > 0){
+					Range range = rangeTab[0];
+					Min rangeMin = range.getMin();
+					Max rangeMax = range.getMax();
+					Double minValue = getRandomValueFor(rangeMin, softConstraintsRandomNumbers);
+					Double maxValue = getRandomValueFor(rangeMax, softConstraintsRandomNumbers);
+					
+					RangeType jobDescRange = new RangeType();
+					
+					ParameterBoundaryType min = new ParameterBoundaryType();
+					min.setContent(minValue);
+					jobDescRange.setMin(min);
+					
+					ParameterBoundaryType max = new ParameterBoundaryType();
+					max.setContent(maxValue);
+					jobDescRange.setMax(max);
+					
+					choice.setRange(jobDescRange);
+				}
+				
+				Value value = constraint.getValue();
+				if(value != null){
+					double v = getRandomValueFor(value, softConstraintsRandomNumbers);
+					ParameterValueType vt = new ParameterValueType();
+					vt.setContent(v);
+					choice.setValue(vt);
+				}
+				
+			} catch (IllegalAccessException e) {
+				e.printStackTrace();
+			}
+
+			preferences.addParameter(parameter);
+		}
+		
+		return preferences;
+	}
+
+	
+	protected ExecutionTimeType createTimeRequirements(WorkloadConfiguration workload, long submitTime, ExecutionTimeType exeTime) {
+		ExecutionTimeType execTime = exeTime;
+		Double value = null;
+		long l_execDuration = 0l;
+		ExecutionTime timeConstraints = workload.getExecutionTime();
+		
+		try {
+			if(timeConstraints != null) {
+				if(execTime == null)
+					execTime = new ExecutionTimeType();
+				
+				ExecDuration execDuration = timeConstraints.getExecDuration();
+				if(execDuration != null) {
+					value = getRandomValueFor(execDuration, timeConstraintsRandomNumbers);
+					l_execDuration = value.longValue();
+					execTime.setExecutionDuration(new Duration(l_execDuration));
+				}
+				
+				PeriodStart periodStart = timeConstraints.getPeriodStart();
+				ExecutionTimeChoice choice = timeConstraints.getExecutionTimeChoice();
+				if(periodStart != null || choice != null){
+					TimePeriod timePeriod = new TimePeriod();
+						value = 0.0;
+						if(periodStart != null){
+							value = getRandomValueFor(periodStart, timeConstraintsRandomNumbers);
+							timePeriod.setPeriodStart(new Date(submitTime + value.longValue()*1000));
+						}
+					
+						if(choice != null){
+							TimePeriodChoice timePeriodChoice = new TimePeriodChoice();
+								
+								PeriodDuration duration = choice.getPeriodDuration();
+								if(duration != null){
+									value = getRandomValueFor(duration, timeConstraintsRandomNumbers);
+									timePeriodChoice.setPeriodDuration(new Duration(value.longValue()));
+								}
+								
+								PeriodEnd periodEnd = choice.getPeriodEnd();
+								if(periodEnd != null){
+									value = getRandomValueFor(periodEnd, timeConstraintsRandomNumbers);
+									
+									timePeriodChoice.setPeriodEnd(
+											new Date(submitTime + value.longValue()*1000));
+								}
+							
+							timePeriod.setTimePeriodChoice(timePeriodChoice);
+						}
+					
+					execTime.setTimePeriod(timePeriod);
+				}
+			}
+		} catch (IllegalAccessException e) {
+			e.printStackTrace();
+		}
+		
+		return execTime;
+	}
+	
+	public void performPostprocessing(String resDescriptionFileName,
+			String outputDirectoryName, String outputWorkloadFileName) {
+		int PCT_STEP = 10;
+		Long cpuSpeed = Long.MAX_VALUE;
+		XPathFactory factory = XPathFactory.newInstance();
+		XPath xpath = factory.newXPath();
+		XPathExpression expression = null;
+		Object obj = null;
+		DTMNodeList nodeList = null;
+		Node node = null;
+		XsltTransformations transformer = null;
+		
+		log.info("Workload postprocessing - start");
+		
+		try {
+			
+			transformer = new XsltTransformations();
+			
+			expression = xpath.compile("//hostParameter[@name='cpuspeed']");
+			InputSource s = new InputSource(new FileReader(resDescriptionFileName));
+			obj = expression.evaluate(s, XPathConstants.NODESET);
+			nodeList = (DTMNodeList) obj;
+			long current = 0;
+			for(int i = 0; i < nodeList.getLength(); i++){
+				node = nodeList.item(i);
+				current = Long.parseLong(node.getChildNodes().item(1).getTextContent());
+				if(current < cpuSpeed)
+					cpuSpeed = current;
+			}
+
+		
+			if(cpuSpeed == Long.MAX_VALUE){
+					log.error("minimum CpuSpeed not found.");
+				return;
+			}
+			
+			
+			File dir = new File(outputDirectoryName);
+			File files[] = dir.listFiles(new QcgJobFileNameFilter());
+			
+			HashMap<String, File> fileMap = new HashMap<String, File>();
+			int base = files.length / PCT_STEP;
+			int nextBase = base;
+			
+			log.info("Loading job ids...");
+			log.info("0%");
+			for(int i = 0; i < files.length; i++){
+				File file = files[i];
+				String job = readJob(file);
+				String jobId = transformer.extractJobId(job);
+				fileMap.put(jobId, file);
+				if(i + 1 >= nextBase){
+					log.info((nextBase / base) * PCT_STEP + "%");
+					nextBase = nextBase + base;
+				}
+			}
+			log.info("Loading job ids - DONE");
+			
+			File wafFile = new File(outputWorkloadFileName);
+			if(!wafFile.exists()){
+				wafFile = new File(outputDirectoryName, outputWorkloadFileName);
+				if(!wafFile.exists())
+					throw new IOException("No swf file in specified location.");
+			}
+			
+			
+			File originalWAFile = new File(wafFile.getAbsolutePath()+"_original.swf");
+			if (originalWAFile.exists())
+				if (! originalWAFile.delete())
+						log.error("Cannot delete file " + originalWAFile.getAbsolutePath());
+			if (! wafFile.renameTo(originalWAFile))
+					log.error("Cannot remove file " + originalWAFile.getAbsolutePath());
+			
+			QcgSWFJobWriter swfWriter = new QcgSWFJobWriter(wafFile.getParent(), wafFile.getName());
+			swfWriter.writeFieldDescriptionHeader();
+			
+			log.info("Updating swf header...");
+			WAParser waParser = AbstractWAParser.getInstance(originalWAFile.getAbsolutePath());
+			HashMap<String, String> swfHeader = waParser.loadHeader();
+			swfHeader.put(SWFFields.COMMENT_PUSPEED, String.valueOf(cpuSpeed));
+			
+			Set<String> keys = swfHeader.keySet();
+			Iterator<String> itr = keys.iterator();
+			String key;
+			while(itr.hasNext()){
+				key = itr.next();
+				swfWriter.writeComment(key, swfHeader.get(key));
+			}
+			log.info("Updating swf header - DONE");
+			
+			String task[] = null;
+			
+			long taskLength;
+			long value;
+			Duration duration;
+			HashMap<String, String[]> idMapping = waParser.getIDMapping();
+			base = idMapping.size() / PCT_STEP;
+			nextBase = base;
+			int taskCnt = 0;
+			log.info("Processing jobs...");
+			log.info("0%");
+			while((task = waParser.readTask()) != null){
+				taskCnt++;
+				
+				String ids[] = idMapping.get(task[SWFFields.DATA_JOB_NUMBER]);
+				String jobId = ids[0];
+				String taskId = ids[1];
+				
+				taskLength = Long.parseLong(task[SWFFields.DATA_RUN_TIME]);
+				
+				// value = how many seconds this task was executed on processing unit with speed = cpuSpeed
+				value = taskLength / cpuSpeed;
+				task[SWFFields.DATA_RUN_TIME] = String.valueOf(value);
+				
+				taskLength = Long.parseLong(task[SWFFields.DATA_REQUESTED_TIME]);
+				value = taskLength / cpuSpeed;
+				task[SWFFields.DATA_REQUESTED_TIME] = String.valueOf(value); 
+				
+				value = value * 1000;			// taskLenght in milliseconds
+				duration = new Duration(value);
+				
+				File file = fileMap.get(jobId);
+				String job = readJob(file);
+				String updatedJob = transformer.jobPostProcessing(job, taskId, duration.toString());
+				writeJob(file, updatedJob);
+				
+				swfWriter.addTaskMapping(task[SWFFields.DATA_JOB_NUMBER], jobId, taskId);
+				swfWriter.writeLine(task);
+				if(taskCnt >= nextBase){
+					log.info((nextBase / base) * PCT_STEP + "%");
+					nextBase = nextBase + base;
+				}
+			}
+			
+			flushCache();
+			
+			waParser.close();
+			swfWriter.close();
+			log.info("Processing jobs - DONE");
+			
+		} catch (FileNotFoundException e) {
+			e.printStackTrace();
+		} catch (NullPointerException e) {
+			e.printStackTrace();
+		} catch (IOException e) {
+			e.printStackTrace();
+		} catch (XPathExpressionException e) {
+			e.printStackTrace();
+		} catch (ParserConfigurationException e) {
+			e.printStackTrace();
+		} catch (DOMException e) {
+			e.printStackTrace();
+		}
+		
+		log.info("Workload postprocessing - done");
+	}
+	
+	/**
+	 * Reads job description from specified file. If the argument file 
+	 * was updated by previous writeJob() method, then readJob returns updated 
+	 * value without physical disk access.
+	 * 
+	 * @param file
+	 * @return
+	 */
+	protected String readJob(File file){
+		if(file.equals(lastUpdatedFile)){
+			return lastUpdatedJob;
+		}
+		
+		flushCache();
+		this.lastUpdatedJob = null;
+		
+		String doc = "";
+		String line = null;
+		try {
+			BufferedReader reader = new BufferedReader(new FileReader(file));
+			while((line = reader.readLine()) != null){
+				doc += line;
+			}
+			reader.close();
+			
+		} catch (FileNotFoundException e) {
+			e.printStackTrace();
+		} catch (IOException e) {
+			e.printStackTrace();
+		}
+		
+		return doc;
+	}
+	
+	/**
+	 * This implementation does not really writes file to disk, instead job is saved
+	 * in buffer and file is marked as last update file. To force writing task do disk
+	 * call flushCache() method.
+	 * @param file
+	 * @param job
+	 */
+	protected void writeJob(File file, String job){
+		this.lastUpdatedFile = file;
+		this.lastUpdatedJob = job;
+	}
+	
+	/**
+	 * Force writing job description to file specified in last/previous call of
+	 * writeJob method.
+	 */
+	protected void flushCache(){
+		if(lastUpdatedFile == null || lastUpdatedJob == null)
+			return;
+		
+		if(lastUpdatedFile.exists()){
+			lastUpdatedFile.delete();
+		}
+		
+		Writer writer = null;
+		try {
+			
+			writer = new FileWriter(lastUpdatedFile);
+			writer.write(lastUpdatedJob);
+			
+		} catch (IOException e) {
+			e.printStackTrace();
+		} finally {
+			if(writer != null)
+				try {
+					writer.close();
+				} catch (IOException e) {
+					e.printStackTrace();
+				}
+		}
+	}
+
+	protected void createWorkflow(WorkloadConfiguration workload, Task tasks[]){
+		throw new RuntimeException("Not implemented.");
+	}
+	
+	protected boolean useStringValue(ComputingParameterName parameterName){
+		// odblokowac te metode, jak tylko skoncza sie testy Kikasa i Ariela
+		if(1 == 1)
+			return false;
+		
+		switch (parameterName){
+			case OSNAME:
+			case OSTYPE:
+			case OSVERSION:
+			case CPUARCH:
+			case OSRELEASE:
+			case APPLICATION:
+			case HOSTNAME:
+			case REMOTESUBMISSIONINTERFACE:
+			case LOCALRESOURCEMANAGER: return true;
+			
+			default : return false;
+		}
+	}	
+}
Index: DCWoRMS/trunk/build/classes/simulator/workload/generator/impl/AbstractJobGenerator.java
===================================================================
--- DCWoRMS/trunk/build/classes/simulator/workload/generator/impl/AbstractJobGenerator.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/simulator/workload/generator/impl/AbstractJobGenerator.java	(revision 477)
@@ -0,0 +1,229 @@
+package simulator.workload.generator.impl;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.util.Date;
+import java.util.Random;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.exolab.castor.types.Duration;
+import simulator.RandomNumbers;
+import simulator.factory.JobRandomNubersFactory;
+import simulator.workload.fileFilters.QcgJobFileNameFilter;
+import simulator.workload.fileFilters.SWFFileNameFilter;
+import simulator.workload.generator.RandomNumbersWrapper;
+import simulator.workload.generator.configuration.JobCount;
+import simulator.workload.generator.configuration.MultiDistribution;
+import simulator.workload.generator.configuration.RandParams;
+import simulator.workload.generator.configuration.RandParamsSequence;
+import simulator.workload.generator.configuration.WorkloadConfiguration;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+
+public abstract class AbstractJobGenerator {
+
+	private Log log = LogFactory.getLog(AbstractJobGenerator.class);
+
+	/**the description of the tasks that are to be generated*/
+	protected WorkloadConfiguration workload;
+	
+	/**the number of tasks generated - one of the proceed conditions*/
+	protected int generatedJobCount;
+	protected int generatedTaskCount;
+	protected int taskCountToBeGenerated;
+	
+	/**number of jobs to be generated*/
+	protected int jobCountToBeGenerated;
+	
+	/**the virtual (logical) time of the simulation - one of the proceed conditions*/ 
+	protected long simulationVirtualTime;
+	
+	protected JobCount jobCount;
+	protected Duration simulationDuration;
+	protected Date simulationEndTime;
+
+	/**a random number generator objects*/
+	//the values set in this "random numbers" are not copied to the TaskGridlet object
+	protected RandomNumbers parameterRandomNumbers; 
+	protected RandomNumbers hardConstraintsRandomNumbers;
+	protected RandomNumbers softConstraintsRandomNumbers;
+	protected RandomNumbers timeConstraintsRandomNumbers;
+	protected RandomNumbers precedingConstraintsRandomNumbers;
+	protected RandomNumbersWrapper randomNumbersWrapper;
+	
+	protected Random detailDistIntervalChooser;
+	
+	protected JobRandomNubersFactory randomNumbersFactory;
+	
+
+	/**
+	 * 
+	 */
+	public AbstractJobGenerator(){
+		generatedJobCount = 0;
+		generatedTaskCount = 0;
+		taskCountToBeGenerated = 0;
+		randomNumbersWrapper = new RandomNumbersWrapper();
+		detailDistIntervalChooser = new Random(System.currentTimeMillis());
+	}
+	
+	/**
+	 * 
+	 * @param outputDirectoryName
+	 * @param overwriteExistingFiles
+	 * @return
+	 * @throws FileNotFoundException
+	 * @throws IOException
+	 */
+	protected File prepareWorkloadDirectory(String outputDirectoryName, boolean overwriteExistingFiles) 
+	throws FileNotFoundException, IOException{
+		File outputDirectory = new File (outputDirectoryName);
+		
+		if (!outputDirectory.exists()) {
+			if(!outputDirectory.mkdir()){
+				throw new FileNotFoundException("Output directory "+outputDirectoryName+" does not exist and can not be created.");
+			}
+		}
+		
+		if (!outputDirectory.isDirectory()) {
+			throw new IOException("Output directory "+outputDirectoryName+" is not a directory");
+		}
+		
+		if (outputDirectory.list().length > 0) {//the directory is not empty
+			if (!overwriteExistingFiles)
+				throw new IOException("The outputdirectory "+ outputDirectoryName +" is not empty.");
+			
+			File[] files = null;
+			
+			files = outputDirectory.listFiles(new QcgJobFileNameFilter());
+			for (int i = 0; i < files.length; i++) {
+				File file = files[i];					
+				if(!file.delete()){
+					if(log.isErrorEnabled())
+						log.error("File "+file.getPath() + " can not be deleted.");
+				}
+			}
+			
+			files = outputDirectory.listFiles(new SWFFileNameFilter());
+			for (int i = 0; i < files.length; i++) {
+				File file = files[i];					
+				if(!file.delete()){
+					if(log.isErrorEnabled())
+						log.error("File "+file.getPath() + " can not be deleted.");
+				}
+			}
+			
+		}
+		
+		return outputDirectory;
+	}
+	
+
+	/**
+	 * Initializes the randomNumbers field with appropriate random number generators. 
+	 * @param workload 
+	 */
+	protected void init(WorkloadConfiguration workload) {
+		
+		randomNumbersFactory = new JobRandomNubersFactory();
+		
+		
+		parameterRandomNumbers = 
+					randomNumbersFactory.initParameterRandomNumbers(workload);
+		randomNumbersWrapper.setParameterRandomNumbers(parameterRandomNumbers);
+
+		/*
+		 * Setting the hard constraints values
+		 */		
+
+		hardConstraintsRandomNumbers = 
+					randomNumbersFactory.initHardConstraintsRandomNumbers(workload);
+		randomNumbersWrapper.setHardConstraintsRandomNumbers(hardConstraintsRandomNumbers);
+		/*
+		 * Setting the soft constraints values
+		 */
+		softConstraintsRandomNumbers = 
+					randomNumbersFactory.initSoftConstraintsRandomNumbers(workload);
+		randomNumbersWrapper.setSoftConstraintsRandomNumbers(softConstraintsRandomNumbers);
+		/*
+		 * Setting time constraints values
+		 */
+		timeConstraintsRandomNumbers = 
+					randomNumbersFactory.initTimeConstraintsRandomNumbers(workload);
+		randomNumbersWrapper.setTimeConstraintsRandomNumbers(timeConstraintsRandomNumbers);
+		/*
+		 * Setting preceding constraints values
+		 */
+		precedingConstraintsRandomNumbers = 
+					randomNumbersFactory.initPrecedingConstraintsRandomNumbers(workload);
+		randomNumbersWrapper.setPrecedingConstraintsRandomNumbers(precedingConstraintsRandomNumbers);
+	}
+	
+	
+	/**
+	 * 
+	 * @return true if this entity should continue execution, false, if 
+	 * this entity should stop
+	 */
+	protected boolean proceedConditionsAreFulfilled() {
+		if (jobCount != null) {
+			if (jobCountToBeGenerated < generatedJobCount) {
+				return false; //cannot continue
+			} 
+				
+			return true; //can continue
+
+		} else if (simulationDuration != null) {
+			if (simulationVirtualTime >= simulationEndTime.getTime() /* simulationDuration.toLong()*/) {
+				return false; //cannot continue
+			} 
+			return true; //can continue
+			
+		} else { //if specification changes, one may add new conditions here
+			return false; 
+		}
+	}
+	
+	protected double getRandomValueFor(RandParams randParams, RandomNumbers randNumbers) throws IllegalAccessException{
+		return getRandomValueFor(randParams, JobRandomNubersFactory.getGeneratorName(randParams), randNumbers);
+	}
+	
+	private double getRandomValueFor(RandParams randParams, String name, RandomNumbers randNumbers) throws IllegalAccessException{
+		MultiDistribution md = null;
+		RandParamsSequence rps = null;
+		
+		if(randParams == null)
+			throw new IllegalAccessException("Specify RandParams object.");
+		if(randNumbers == null)
+			throw new IllegalAccessException("Specify random numbers map.");
+		
+		if(randParams.getRefElementId() != null){
+			return randomNumbersWrapper.evalValueFor(randParams.getId(), randParams.getRefElementId());
+		}
+		
+		md = randParams.getMultiDistribution();
+		rps = randParams.getRandParamsSequence();
+		if(md == null && rps == null){
+			return randNumbers.getRandomValue(name);
+		}
+		
+		if(md != null && rps == null){
+			return randNumbers.getRandomValue(name, detailDistIntervalChooser.nextDouble());
+		}
+		
+		if(md == null && rps != null){
+			//return randNumbers.getRandomValue(name, workload.getSimulationStartTime().getTime() + (simulationVirtualTime*1000));
+			return randNumbers.getRandomValue(name, simulationVirtualTime);
+		}
+		
+		throw new IllegalAccessException("Use direct generator description, " +
+				"reference to another element, multidistribution or periodic valid values for element "+name);
+	}
+	
+}
Index: DCWoRMS/trunk/build/classes/simulator/workload/generator/WorkloadGenerator.java
===================================================================
--- DCWoRMS/trunk/build/classes/simulator/workload/generator/WorkloadGenerator.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/simulator/workload/generator/WorkloadGenerator.java	(revision 477)
@@ -0,0 +1,55 @@
+package simulator.workload.generator;
+
+import java.io.FileNotFoundException;
+import java.io.IOException;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import simulator.ConfigurationOptions;
+import simulator.workload.generator.impl.QcgJobGenerator;
+
+public class WorkloadGenerator {
+	
+	private Log log = LogFactory.getLog(WorkloadGenerator.class);
+	
+	public static void main(String args[]){
+		WorkloadGenerator generator = new WorkloadGenerator();
+		generator.run(args);
+	}
+	
+	public void run(String args[]){
+		log.info("Start workload generator.");
+		
+		if(args == null || args.length == 0){
+			log.error("Path to properties file is not provided. Can not configure workload generator.");
+			return;
+		}
+		
+		String propertiesFileName = args[0];
+		ConfigurationOptions co = ConfigurationOptions.getConfiguration(propertiesFileName);
+		if(co == null){
+			log.error("Configuration options are not defined. Check file: "+propertiesFileName);
+			return;
+		}
+		
+		JobGenerator jobGenerator = new QcgJobGenerator();
+		
+		try {
+			
+			log.info("Generating workload.");
+			jobGenerator.generateWorkload(co.workloadDescFileName, co.outputFolder, co.overwriteFiles, co.outputWorkloadFileName);
+			
+			log.info("Performing postprocessing.");
+			jobGenerator.performPostprocessing(co.resdescFileName, co.outputFolder, co.outputWorkloadFileName);
+			
+		} catch (FileNotFoundException e) {
+			e.printStackTrace();
+		} catch (IOException e) {
+			e.printStackTrace();
+		}
+		
+		
+		log.info("End workload generator.");
+	}
+}
Index: DCWoRMS/trunk/build/classes/simulator/WormsConstants.java
===================================================================
--- DCWoRMS/trunk/build/classes/simulator/WormsConstants.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/simulator/WormsConstants.java	(revision 477)
@@ -0,0 +1,102 @@
+package simulator;
+
+import eduni.simjava.Sim_stat;
+
+public class WormsConstants {
+
+	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 477)
@@ -0,0 +1,51 @@
+package simulator;
+
+
+import gssim.schedframe.scheduling.utils.JobDescription;
+import gssim.schedframe.scheduling.utils.TaskDescription;
+
+import java.util.List;
+
+import schedframe.scheduling.tasks.Job;
+import schedframe.scheduling.tasks.JobInterface;
+
+
+/**
+ * This interface introduces a generic user entity, which is intended to send jobs and tasks
+ * to a broker entity.
+ * 
+ * @author Stanislaw Szczepanowski
+ * @param <SubJob> a job type, which implements the {@link Job} interface
+ */
+public interface GenericUser {
+
+	/**
+	 * @return a list of all jobs, that have been sent by the user entity
+	 */
+	public List<JobDescription> getAllSentJobs();
+	
+	/**
+	 * @return a list of all tasks, that have been sent by the user entity
+	 */
+	public List<TaskDescription> getAllSentTasks();
+	
+	/**
+	 * @return a list of all jobs, that have returned from execution to the user entity
+	 */
+	public List<JobInterface<?>> getAllReceivedJobs();
+	
+	/**
+	 * @return the name of the user entity (unique in the entire simulation run)
+	 */
+	public String getUserName();
+	
+	public int getFinishedTasksCount() ;
+	
+	
+	/**
+	 * This method is intended for debug purposes.
+	 * @return <code>true</code> if during the simulation, any error occurred 
+	 * (e.g. the same job has been returned twice).
+	 */
+	public boolean isError();
+}
Index: DCWoRMS/trunk/build/classes/simulator/RandomNumbers.java
===================================================================
--- DCWoRMS/trunk/build/classes/simulator/RandomNumbers.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/simulator/RandomNumbers.java	(revision 477)
@@ -0,0 +1,445 @@
+package simulator;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import simulator.stats.random.MinMaxDistribution;
+import simulator.workload.generator.configuration.Dist;
+import simulator.workload.generator.configuration.PeriodicValidValues;
+import simulator.workload.generator.configuration.types.ParameterAttributesDistributionType;
+import cern.jet.random.AbstractDistribution;
+import cern.jet.random.Exponential;
+import cern.jet.random.Gamma;
+import cern.jet.random.Normal;
+import cern.jet.random.Poisson;
+import cern.jet.random.Uniform;
+import cern.jet.random.engine.MersenneTwister64;
+import cern.jet.random.engine.RandomEngine;
+import eduni.simjava.distributions.AbstractSpecificGenerator;
+import eduni.simjava.distributions.DetailDistGenerator;
+import eduni.simjava.distributions.GeneralGenerator;
+import eduni.simjava.distributions.PeriodicGenerator;
+
+/**
+ * A class that stores random number generator for given metrics. Its functionality is basically similar to a hash table
+ * where a key is a metric name and a value stored at that key is a previously set random number generator with proper distribution
+ * @author Stanislaw Szczepanowski
+ *
+ */
+public class RandomNumbers {
+
+	/**
+	 * a hash table that stores the random number generators on the basis of the given key
+	 * the key is the name of the parameter (metric name, String object), for which a random generator should be retrieved
+	 */
+	protected Map<String, List<AbstractSpecificGenerator>> rndGenerators;  
+
+	/**
+	 * holds mapping between node id and internal random numbers generator name.
+	 */
+	protected HashMap<String, String> idMap;
+	
+	/**
+	 * A field indicating, that if no seed is given to a value, this global seed is to be used. 
+	 * If this value is <code>null</code>, then a random number is to be picked (e.g. System.nanoTime()).
+	 * Such functionality is used for example for test purposes.
+	 */
+	protected static Long baseSeed;
+	
+	/**
+	 * Default constructor
+	 */
+	public RandomNumbers() {
+		rndGenerators = new HashMap<String, List<AbstractSpecificGenerator>>();	
+		idMap = new HashMap<String, String>();
+		init();
+	}
+	
+	/**
+	 * Constructor with initial capacity
+	 * @param initialCapacity the initial capacity of this hash map
+	 */
+	public RandomNumbers(int initialCapacity) {
+		rndGenerators = new HashMap<String, List<AbstractSpecificGenerator>>(initialCapacity);
+		idMap = new HashMap<String, String>(initialCapacity);
+		init();
+	}
+	
+	/** A common initialization method used in constructors */
+	protected void init() {
+	}
+	
+	/**
+	 * Adds a random number generator at given key (name) 
+	 * @param parameterName the name of the generator
+	 * @param generator the generator to be stored
+	 */
+	public void addRandomGenerator(String parameterName, PeriodicGenerator generator) {
+		List<AbstractSpecificGenerator> list;
+		
+		if(rndGenerators.containsKey(parameterName)){
+			list = rndGenerators.get(parameterName);
+			list.add(generator);
+		} else {
+			list = new ArrayList<AbstractSpecificGenerator>(1);
+			list.add(generator);
+			rndGenerators.put(parameterName, list);
+		}
+	}
+	
+	public void addRandomGenerator(String parameterName, DetailDistGenerator generator){
+		ArrayList <AbstractSpecificGenerator>list;
+		int idx = -1;
+		if(rndGenerators.containsKey(parameterName)){
+			list = (ArrayList<AbstractSpecificGenerator>) rndGenerators.get(parameterName);
+			list.ensureCapacity(list.size() + 1);
+
+			// this should guarantee, that elements on the list are ordered.
+			while(++idx < list.size() && generator.compareTo(list.get(idx)) > 0);
+			list.add(idx, generator);
+			
+		} else {
+			list = new ArrayList<AbstractSpecificGenerator>(1);
+			list.add(generator);
+			rndGenerators.put(parameterName, list);
+		}
+	}
+	
+	public boolean addRandomGenerator(String parameterName, Dist detailDist){
+		Double percnt = Double.valueOf(detailDist.getContent());
+		
+		AbstractDistribution generator = createRandomGenerator(
+				detailDist.getDistribution().getType(), detailDist.hasAvg(), detailDist.getAvg(),
+				detailDist.getStdev(), detailDist.hasMin(), detailDist.getMin(),
+				detailDist.hasMax(), detailDist.getMax(), detailDist.hasSeed(), detailDist.getSeed(), parameterName);
+		
+		if(generator == null)
+			return false;
+		
+		DetailDistGenerator ddg = new DetailDistGenerator(generator, percnt);
+		addRandomGenerator(parameterName, ddg);
+		
+		return true;
+	}
+	
+	public boolean addRandomGenerator(String parameterName,  PeriodicValidValues values){
+		AbstractDistribution generator = createRandomGenerator(
+					values.getDistribution().getType(), values.hasAvg(), values.getAvg(),
+					values.getStdev(), values.hasMin(), values.getMin(), 
+					values.hasMax(), values.getMax(), values.hasSeed(), values.getSeed(), parameterName);
+		
+		if(generator == null)
+			return false;
+		
+		PeriodicGenerator pg = new PeriodicGenerator(generator, values.getBeginValidTime(), values.getEndValidTime());
+		addRandomGenerator(parameterName, pg);
+		
+		return true;
+	}
+
+	
+	/**
+	 * Creates and stores a random numbers generator
+	 * @param distribution the distribution of this generator descried as in {@link ParameterAttributesDistributionType}
+	 * @param avg the average value
+	 * @param stdev the standard deviation value 
+	 * @param min minimal value
+	 * @param max maximal value
+	 * @param useSeed true, if the given seed is to be used
+	 * @param seed the seed for random number generator
+	 * @param name the name of the random numbers generator
+	 */
+	public boolean addRandomGenerator(int distribution, boolean useAvg, double avg, double stdev, boolean useMin, double min, boolean useMax, double max, boolean useSeed, long seed, String name) {
+		AbstractDistribution generator = createRandomGenerator(distribution, useAvg, avg, stdev, useMin, min, useMax, max, useSeed, seed, name);
+		if(generator == null)
+			return false;
+		
+		GeneralGenerator gg = new GeneralGenerator(generator);
+		List<AbstractSpecificGenerator> list;
+		
+		if(rndGenerators.containsKey(name)){
+			list = rndGenerators.get(name);
+			list.add(gg);
+		} else {
+			list = new ArrayList<AbstractSpecificGenerator>(1);
+			list.add(gg);
+			rndGenerators.put(name, list);
+		}
+		
+		return true;
+	}
+	
+	
+	
+	/**
+	 * Retrieves the next random value from the given random numbers generator.
+	 * Generator is valid for whole simulation time.
+	 * @param parameterName the random numbers generator name
+	 * @return the next random value (according to the setting of the random numbers generator)
+	 * @throws IllegalAccessException
+	 */
+	public double getRandomValue(String parameterName) throws IllegalAccessException{
+		List<AbstractSpecificGenerator> list = rndGenerators.get(parameterName);
+		AbstractSpecificGenerator asg;
+		AbstractDistribution generator = null;
+		double ret;
+		
+		if(list == null || list.size() == 0){
+			throw new IllegalAccessException("No random generator for given metric " + parameterName);
+		}
+		
+		// generator on index 0 should be valid for whole simulation period, if PeriodicGenerator is used or
+		// should cover 100% of tasks if DetailDistGenerator is used
+		asg = list.get(0);
+		
+		generator = asg.getGenerator();
+		
+		ret = generator.nextDouble();
+		asg.setLastGeneratedValue(ret);
+		
+		return ret;
+	}
+	
+	public double getLastGeneratedRandomValue(String parameterName) throws IllegalAccessException{
+		List<AbstractSpecificGenerator> list = rndGenerators.get(parameterName);
+		AbstractSpecificGenerator asg = list.get(0);
+		return asg.getLastGeneratedValue();
+	}
+	
+	
+	/**
+	 * Retrieves the next random value from the given random numbers generator.
+	 * Generator is valid only for some period of simulation time.
+	 * @param parameterName the random numbers generator name
+	 * @param time current simulation time
+	 * @return the next random value (according to the setting of the random numbers generator)
+	 * @throws IllegalAccessException
+	 */
+	public double getRandomValue(String parameterName, long time) throws IllegalAccessException {
+		List<AbstractSpecificGenerator> list = rndGenerators.get(parameterName);
+		AbstractSpecificGenerator asg = null;
+		PeriodicGenerator pGen = null;
+		AbstractDistribution generator = null;
+		double ret;
+		
+		if(list == null || list.size() == 0) {
+			throw new IllegalAccessException("No random generator for given metric " + parameterName);
+		}
+		
+		for(int i = 1; i < list.size(); i++){
+			asg = list.get(i);
+			if(asg instanceof PeriodicGenerator)
+				pGen = (PeriodicGenerator) asg;
+			else
+				throw new RuntimeException("Wrong specific generator type. PeriodicGenerator was expected.");
+			
+			if(pGen.isValid(time)){
+				generator = pGen.getGenerator();
+				break;
+			}
+		}
+		
+		// generator on index = 0 should be valid for whole simulation period
+		if(generator == null) {
+			pGen = (PeriodicGenerator)list.get(0);
+			if(pGen.isValid(time)){
+				generator = pGen.getGenerator();
+			}
+		}
+		
+		if(generator == null)
+			throw new IllegalAccessException("No valid "+parameterName+" generator for given time " + time);
+		ret = generator.nextDouble();
+		
+		return ret;
+	}
+	
+	/**
+	 * Retrieves the next random value from the given random numbers generator.
+	 * Generator is valid for specified percent of generated tasks.
+	 * @param parameterName
+	 * @param prcnt
+	 * @return
+	 * @throws IllegalAccessError
+	 */
+	public double getRandomValue(String parameterName, double prcnt) throws IllegalAccessError {
+		int idx = 0;
+		double prcntSum = 0.0;
+		DetailDistGenerator ddg = null;
+		
+		if(!rndGenerators.containsKey(parameterName))
+			throw new IllegalAccessError("No generators for "+parameterName+" available.");
+		
+		List <AbstractSpecificGenerator> list = rndGenerators.get(parameterName);
+
+		if(list.size() == 0)
+			throw new IllegalAccessError("No generator for "+parameterName + " available.");
+		
+		if(list.get(0) instanceof DetailDistGenerator){
+			/* 
+			 * Looking for appropriate generator.
+			 * List of elements is ordered from min to max. For loop is checking to which interval requested 
+			 * percent belongs to.
+			 */
+			for(idx = 0; idx < list.size(); idx++){
+				ddg = (DetailDistGenerator)list.get(idx);
+				prcntSum = prcntSum + ddg.getPrcnt();
+				// this is to handle double numbers representation precision
+				if((prcntSum - prcnt) > 0.000000001)
+					break;
+			}
+			
+			if(idx >= list.size())
+				throw new IllegalAccessError("Value "+prcnt +" doeas not belong to any interval defined by DetailDistGenerators");
+
+			return ddg.getGenerator().nextDouble();
+
+		} else {
+			throw new IllegalAccessError(list.get(0).getClass().getName() +
+					" generator can not be used for evaluating values for multidistribution element definition.\n" +
+					"Use " + DetailDistGenerator.class.getName() + " instead.");
+		}
+	}
+	
+	/**
+	 * Retrieves a snapshot of all random numbers generators next random values
+	 * @return a result hash map has structure of pairs as: &lt;String random_numbers_generator_name, Double random_value&gt;
+	 */
+	public Map<String, Double> getMappedRandomValues() {
+		Map<String, Double> resultHashMap = new HashMap<String, Double>(rndGenerators.size());
+		
+		Set<String> keys = rndGenerators.keySet();
+		for (Iterator<String> i = keys.iterator(); i.hasNext(); ) {
+			String name = i.next();
+			Double value = null;
+			try {
+				value = new Double(getRandomValue(name));
+			} catch (IllegalAccessException e) {
+				e.printStackTrace();
+			}
+			resultHashMap.put(name, value);
+		}
+		
+		return resultHashMap;
+	}
+
+	/**
+	 * Constructs a new random numbers generator.
+	 * 
+	 * @param distribution the distribution of this generator descried as in {@link ParameterAttributesDistributionType}
+	 * @param useAvg <code>true</code>, if the given average value is to be used; <code>false</code> otherwise
+	 * @param avg the average value
+	 * @param stdev the standard deviation value 
+	 * @param useMin <code>true</code>, if the given minimal value is to be used; <code>false</code> otherwise
+	 * @param min minimal value
+	 * @param useMax <code>true</code>, if the given maximal value is to be used; <code>false</code> otherwise
+	 * @param max maximal value
+	 * @param useSeed <code>true</code>, if the given seed is to be used; <code>false</code> otherwise
+	 * @param seed the seed for random number generator
+	 * @param name the name of the random numbers generator
+	 * @return the constructed random numbers generator
+	 */
+	public AbstractDistribution createRandomGenerator(int distribution, boolean useAvg, double avg, double stdev, boolean useMin, double min, boolean useMax, double max, boolean useSeed, long seed, String name) {
+		AbstractDistribution resultGenerator = null;
+		
+		if(useAvg == false && useMax == false && useMin == false)
+			return null;
+		
+		int validSeed = -1;
+		if (isBaseSeedSet()) { //use the base seed (has the highest priority)
+			validSeed = baseSeed.intValue();
+		} else if (useSeed) {
+			validSeed = (int) seed;
+		} else { //don't use seed
+			validSeed = (int) System.nanoTime();
+		}
+		
+		RandomEngine randomEngine = new MersenneTwister64(validSeed);
+		
+		switch (distribution) {
+		case ParameterAttributesDistributionType.CONSTANT_TYPE:
+			//this will result in a generator of constant values equal to avg
+			resultGenerator = new Normal(avg, 0.0, randomEngine); 
+			break;
+
+		case ParameterAttributesDistributionType.NORMAL_TYPE:
+			resultGenerator = new Normal(avg, stdev, randomEngine);
+			break;
+
+		case ParameterAttributesDistributionType.POISSON_TYPE:
+			resultGenerator = new Poisson(avg, randomEngine);
+			break;
+
+		case ParameterAttributesDistributionType.UNIFORM_TYPE:
+			resultGenerator = new Uniform(min, max, randomEngine);
+			break;
+			
+		case ParameterAttributesDistributionType.EXPONENTIAL_TYPE:
+			resultGenerator = new Exponential(avg, randomEngine);
+			break;
+			
+		case ParameterAttributesDistributionType.GAMMA_TYPE:
+			resultGenerator = new Gamma(avg, stdev, randomEngine);
+			break;
+
+		case ParameterAttributesDistributionType.HARMONIC_TYPE:
+			resultGenerator = null; //TODO finish implementation
+			break;
+		}
+		Double minValue = null;
+		Double maxValue = null;
+		boolean wrap = false; //indicates, whether the wrapper should be used
+		if (useMin) {
+			minValue = min;
+			wrap = true;
+		}
+		if (useMax) {
+			maxValue = max;
+			wrap = true;
+		}
+		if (wrap) //wrap the generator, only if necessary
+			resultGenerator = new MinMaxDistribution(resultGenerator, minValue, maxValue);
+		return resultGenerator;
+	}
+	
+	public void addIdGeneratorNameMapping(String id, String generatorName){
+		idMap.put(id, generatorName);
+	}
+	
+	public boolean containsElement(String id){
+		return idMap.containsKey(id);
+	}
+	
+	public String getGeneratorName(String id){
+		return idMap.get(id);
+	}
+	
+	public List<AbstractSpecificGenerator> getGenList(String arg){
+		return rndGenerators.get(arg);
+	}
+	
+	/**
+	 * Sets a new value of the base seed for this class. If a <code>null</code> value
+	 * is given, then the base seed is disabled.
+	 * @param baseSeed the new value of the base seed, or <code>null</code> if the base seed is to be disabled
+	 */
+	public static void setBaseSeed(Long baseSeed) {
+		RandomNumbers.baseSeed = baseSeed;
+	}
+	
+	public static boolean isBaseSeedSet() {
+		return (baseSeed != null);
+	}
+	
+	public static long getBaseSeed() {
+		return baseSeed;
+	}
+	
+	public static void clearBaseSeed() {
+		baseSeed = null;
+	}
+}
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 477)
@@ -0,0 +1,479 @@
+package simulator;
+
+//import eduni.cloudsim.GSSIM;
+import java.io.File;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.PrintStream;
+import java.security.InvalidParameterException;
+import java.text.NumberFormat;
+import java.util.Calendar;
+import java.util.Date;
+
+import javax.swing.JFileChooser;
+import javax.swing.filechooser.FileFilter;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.exolab.castor.xml.MarshalException;
+import org.exolab.castor.xml.ValidationException;
+import org.joda.time.DateTimeUtilsExt;
+import org.qcg.broker.schemas.jobdesc.QcgJob;
+
+import schedframe.Initializable;
+import schedframe.ResourceController;
+import simulator.reader.ResourceReader;
+import simulator.stats.AccumulatedStatistics;
+import simulator.stats.implementation.GSSimStatistics;
+import simulator.utils.LogErrStream;
+import simulator.workload.WorkloadLoader;
+import simulator.workload.reader.archive.AbstractWAReader;
+import simulator.workload.reader.archive.WAReader;
+import simulator.workload.reader.xmlJob.QcgXmlJobReader;
+import simulator.workload.reader.xmlJob.XMLJobReader;
+import cern.jet.random.Uniform;
+import cern.jet.random.engine.MersenneTwister64;
+
+/**
+ * The main class of the Data Center Workload Scheduling Simulator. It has the
+ * {@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.
+ * In this case, the input parameter, describing the simulation options, must be
+ * earlier prepared. The results of the simulation can be acquired using the
+ * {@link #getAccumulatedStatistics()} method.
+ * 
+ * @author Stanislaw Szczepanowski & Wojciech Piatek
+ */
+public class DataCenterWorkloadSimulator {
+
+	/**
+	 * The name of the simulator application
+	 */
+	public static final String SIMULATOR_NAME = "Data Center Workload Simulator";
+
+	/**
+	 * Stores the statistical data of last run of the simulator (it may consist
+	 * of several runs of simulations)
+	 */
+	protected static AccumulatedStatistics accumulatedStatistics;
+
+	protected static int simulationRunNumber = 0;
+
+	/**
+	 * Determines the maximum fraction digits when printing floating point
+	 * values
+	 */
+	public static int MAXIMUM_FRACTION_DIGITS = 3;
+
+	/**
+	 * The format of the numbers that will be printed
+	 */
+	public static NumberFormat DFAULT_NUMBER_FORMAT = NumberFormat
+			.getInstance();
+	static {
+		DFAULT_NUMBER_FORMAT.setMaximumFractionDigits(MAXIMUM_FRACTION_DIGITS); // 0,001
+	}
+
+	private Log log = LogFactory.getLog(DataCenterWorkloadSimulator.class);
+
+	protected String statsOutputPath;
+
+
+	/**
+	 * Default empty constructor
+	 */
+	public DataCenterWorkloadSimulator() {
+	}
+
+	/**
+	 * The main method to start the simulation the accepted arguments are:
+	 * args[0] - the name of the resource bundle file with the configuration
+	 * args[1] (optional) - the number of simulations that are to be performed
+	 * (the default value is 1)
+	 * 
+	 * @param args
+	 *            the arguments passed to the application
+	 */
+	public static void main(String[] args) {
+		DataCenterWorkloadSimulator gssim = new DataCenterWorkloadSimulator();
+		gssim.run(args);
+	}
+
+	public void run(String args[]) {
+		System.setErr(new PrintStream(new LogErrStream(log)));
+
+		String propertiesFileName = null;
+		if (args.length == 0) {
+			JFileChooser ch = new JFileChooser(".");
+			FileFilter filter = new FileFilter() {
+				@Override
+				public boolean accept(File f) {
+					return f.getName().endsWith(".properties")
+							|| f.isDirectory();
+				}
+
+				@Override
+				public String getDescription() {
+					return "WoRMS experiment file";
+				}
+			};
+			ch.setFileFilter(filter);
+			ch.setDialogTitle("Choose the WoRMS simulation experiment file");
+			int result = ch.showOpenDialog(ch);
+			if (result == JFileChooser.APPROVE_OPTION) {
+				propertiesFileName = ch.getSelectedFile().getAbsolutePath();
+			} else {
+				if (log.isFatalEnabled())
+					log.fatal("Resource bundle file name was not provided.");
+				return;
+			}
+		} else if (args.length == 2 && "-multiuser".equals(args[0])) {
+			runMultiuser(args[1], this);
+			return;
+		} else {
+			propertiesFileName = args[0];
+		}
+
+		ConfigurationOptions configurationOptions = ConfigurationOptions
+				.getConfiguration(propertiesFileName);
+		int noOfSimulations = 1; // default value is one
+
+		if(configurationOptions.getNumberOfSimulations() > 1)
+			noOfSimulations = configurationOptions.getNumberOfSimulations();
+		else if (args.length == 2) {// second parameter is given
+			noOfSimulations = Integer.parseInt(args[1]);
+			if (noOfSimulations < 1) {
+				throw new InvalidParameterException(
+						"Number of simulations cannot be less than 1");
+			}
+		}
+
+		if (log.isInfoEnabled())
+			log.info(":: Starting " + SIMULATOR_NAME + ". " + noOfSimulations
+					+ " simulation runs will be performed. ::");
+
+		File outputDir = null;
+
+		try {
+			outputDir = prepareDirecotry(configurationOptions);
+		} catch (Exception e) {
+			if (log.isErrorEnabled())
+				log.error("FAILED to create the output path", e);
+			return;
+		}
+
+		File outputPropertiesFile = new File(outputDir, "experiment.properties");
+
+		accumulatedStatistics = new AccumulatedStatistics(noOfSimulations);
+		
+		for (int i = 0; i < noOfSimulations; ++i) {
+			simulationRunNumber++;
+			String simulationIdentifier = "Simulation " + (i + 1);
+			try {
+				performSimulation(simulationIdentifier,
+						configurationOptions); // run the simulation
+
+			} catch (Exception e) {
+				if (log.isErrorEnabled())
+					log.error("ERROR in simulation run \""
+							+ simulationIdentifier + "\":", e);
+				break;
+			}
+		}
+
+		if (log.isInfoEnabled())
+			log.info("Done :: " + SIMULATOR_NAME + " has finished "
+					+ noOfSimulations + " simulation runs ::");
+
+		System.out.flush();
+		System.err.flush();
+
+		try {
+			copyFile(new File(propertiesFileName), outputPropertiesFile);
+		} catch (IOException e) {
+			log.error("IO exception occured during copying properties file to output path");
+		}
+	}
+
+	private void runMultiuser(String rootDirPath, DataCenterWorkloadSimulator gssim) {
+		throw new RuntimeException("not supported yet");
+	}
+
+
+	/**
+	 * Starts a single simulation run.
+	 * 
+	 * @param options
+	 *            the configuration options according to which the simulation is
+	 *            to be performed
+	 * @param simulationStatistics
+	 *            the statistics object that is to be filled after the
+	 *            simulation run
+	 * @throws Exception
+	 *             any exception that may occur
+	 */
+	private void performSimulation(String simulationIdentifier,
+			ConfigurationOptions options) throws Exception {
+		// Startup of the random number generators must be set up with a random
+		// seed that is greater than zero
+		// if seed is not given then all consecutive simulations are the same
+		// if seed < 0 then the random numbers are equal to zero
+		Uniform uniform = new Uniform(new MersenneTwister64(new Date()));
+		// seed should be > 0 and fits to int size (which is also important)
+		long seed = uniform.nextLongFromTo(1, Integer.MAX_VALUE);
+		if (log.isDebugEnabled())
+			log.debug("Shuffled initial seed: " + seed);
+
+		assert seed > 0 && seed <= Integer.MAX_VALUE : "Initial seed is <= 0, what is improper";
+		
+		GridSimWrapper.setSeed(seed);
+		GridSimWrapper.setTraceSettings();
+		
+		long startSimulation = System.currentTimeMillis();
+		if (log.isInfoEnabled()) {
+			log.info(":: Starting simulation run: \"" + simulationIdentifier
+					+ "\" ::");
+			log.info(":: In the the mode of ");
+		}
+
+		WorkloadLoader workload = loadWorkload(options);
+	
+		// BEGIN: Initializing the GridSim:
+		int numUser = 1; // the number of users in the experiment simulation
+		// (default 1)
+		
+		Date date = workload.getSimulationStartTime();
+		Calendar calendar = Calendar.getInstance();
+		if (date == null)
+			calendar.setTimeInMillis(0L);
+		else
+			calendar.setTime(date);
+
+		boolean traceFlag = true; // means: trace GridSim events/activities
+		String[] excludeFromFile = { "" }, excludeFromProcessing = { "" };
+		
+		GridSimWrapper.init(numUser, calendar, traceFlag, excludeFromFile,
+				excludeFromProcessing, null);
+		DateTimeUtilsExt.initVirtualTimeAccess(calendar);
+
+		ResourceReader resourceReader = new ResourceReader(
+				options);
+		ResourceController rc = resourceReader.read();
+
+		while(!rc.getToInit().isEmpty()){
+			Initializable initObj = rc.getToInit().pop();
+			initObj.initiate();
+		}
+		rc.setInitList(null);
+		
+		WormsUsers wl = new WormsUsers("Users",
+				rc.getScheduler().get_name(), workload);
+		
+		GridSimWrapper.startSimulation();
+		long stopSimulation = System.currentTimeMillis();
+
+		GSSimStatistics stats = new GSSimStatistics(simulationIdentifier,
+				options, wl, statsOutputPath, rc);
+		accumulatedStatistics.add(stats);
+		if (log.isInfoEnabled())
+			log.info("Generating statistics...");
+		stats.generateStatistics();
+
+		long duration = (stopSimulation - startSimulation) / 1000;
+		if (log.isInfoEnabled())
+			log.info("The simulation run took " + duration + " seconds");
+
+		// if necessary generate gifs from sjvg - need to rewrite the SJVG
+		// classes for public methods
+		if (log.isInfoEnabled())
+			log.info(":: Finished simulation run: \"" + simulationIdentifier
+					+ "\" ::");
+
+		System.out.flush();
+		System.err.flush();
+	}
+
+	private WorkloadLoader loadWorkload(ConfigurationOptions options) throws IOException, MarshalException, ValidationException{
+		XMLJobReader<QcgJob> xmlJobReader = null;
+		WAReader<QcgJob> swfReader = null;
+
+		String wlFileName = options.inputWorkloadFileName;
+
+		if (options.inputFolder != null) {
+			File f = null;
+			if (options.inputTar != null) {
+				f = new File(options.inputFolder + File.separator
+						+ options.inputTar);
+			} else {
+				f = new File(options.inputFolder);
+			}
+
+			xmlJobReader = new QcgXmlJobReader(f);
+
+			wlFileName = options.inputFolder + File.separator
+					+ options.inputWorkloadFileName;
+		}
+
+		swfReader = AbstractWAReader.getInstace(wlFileName);
+
+		WorkloadLoader workload = new WorkloadLoader(xmlJobReader, swfReader);
+		workload.load();
+
+		return workload;
+	}
+	
+
+	private File prepareDirecotry(ConfigurationOptions options) throws Exception {
+		// String statsOutputPath = null;
+		if (options.createScenario) {
+			File outputFolderFile = new File(options.outputFolder);
+			if (!outputFolderFile.exists()) {
+				if (!outputFolderFile.mkdirs())
+					throw new IOException("Cannot create the output path: "
+							+ statsOutputPath + ". Cause: ");
+			}
+
+			if (log.isInfoEnabled())
+				log.info("CREATING SCENARIO ::");
+			statsOutputPath = options.outputFolder
+					+ options.statsOutputSubfolderNameCreate;
+		} else {
+			if (log.isInfoEnabled())
+				log.info("READING SCENARIO ::");
+			String prefix = null;
+			if (options.inputFolder != null) {
+				prefix = options.inputFolder;
+			} else if (options.inputWorkloadFileName != null) {
+				prefix = new File(options.inputWorkloadFileName).getParent();
+			} else {
+				prefix = System.getProperty("user.dir");
+			}
+			statsOutputPath = prefix + File.separator
+					+ options.statsOutputSubfolderNameRerad;
+		}
+		statsOutputPath += File.separator;
+
+		// create the output folder
+		File statsOutputPathFile = new File(statsOutputPath);
+		if (!statsOutputPathFile.exists()) {
+			if (!statsOutputPathFile.mkdirs())
+				throw new IOException("Cannot create the output (stats) path: "
+						+ statsOutputPath + ". Cause: ");
+		}
+
+		File folder = new File(statsOutputPath);
+		File fileList[] = folder.listFiles();
+		for (int i = 0; i < fileList.length; i++) {
+			File tmpFile = fileList[i];
+			String name = tmpFile.getName();
+			if (name.length() > 4) {
+				String subName = name.substring(0, 5);
+				if (subName.compareTo("Chart") == 0
+						|| subName.compareTo("Stats") == 0) {
+					tmpFile.delete();
+				}
+			}
+		}
+		return statsOutputPathFile;
+	}
+
+	/**
+	 * Removes the given directory no matter if it is empty or non empty. If the
+	 * given parameter represents a file, it is not deleted. See the description
+	 * of the return statement.
+	 * 
+	 * @param dirPath
+	 *            the file representing the directory to be deleted.
+	 * @return true, if the given directory with all its contents have been
+	 *         remove; false if deletion of any of files ended with error (all
+	 *         other files are possibly also deleted)
+	 */
+	private static boolean deleteDirectory(File dirPath) {
+		if (dirPath.exists() && dirPath.isDirectory()) {
+			boolean result = true;
+			File[] files = dirPath.listFiles();
+			for (File file : files) {
+				if (file.isFile())
+					result |= file.delete();
+				else
+					result |= deleteDirectory(file);
+			}
+			result |= dirPath.delete();
+			return result;
+		}
+		return false; // it is not a directory
+	}
+	
+	/**
+	 * Static method to move a file from given "from" location to "to" location
+	 * 
+	 * @param from
+	 *            from location
+	 * @param to
+	 *            to location
+	 * @return true if the operation succeeded, false otherwise
+	 */
+	private static boolean moveFile(String from, String to) {
+		File fromFile = new File(from);
+		File toFile = new File(to);
+		if (toFile.exists()) {
+			if (!toFile.delete())
+				return false;
+		}
+		if (!fromFile.renameTo(toFile)) {
+			return false;
+		}
+		return true;
+	}
+	
+	private void copyFile(File inputFile, File outputFile) throws IOException {
+
+		FileReader in = new FileReader(inputFile);
+		FileWriter out = new FileWriter(outputFile);
+		int c;
+
+		while ((c = in.read()) != -1)
+			out.write(c);
+
+		in.close();
+		out.close();
+	}
+
+	/**
+	 * Returns the accumulated simulation statistics from the last run of the
+	 * simulator
+	 * 
+	 * @return the accumulated simulation statistics from the last run of the
+	 *         simulator
+	 */
+	public static AccumulatedStatistics getAccumulatedStatistics() {
+		return accumulatedStatistics;
+	}
+
+	public static int getSimulationRunNumber(){
+		return simulationRunNumber;
+	}
+	
+	protected class WorkloadDirectoryFilter implements java.io.FileFilter {
+
+		public boolean accept(File file) {
+			if (file.isDirectory() && file.getName().startsWith("workload"))
+				return true;
+			else
+				return false;
+		}
+	}
+
+	protected class PropertiesFileFilter implements java.io.FileFilter {
+
+		public boolean accept(File file) {
+			if (file.isFile() && file.getName().endsWith(".properties"))
+				return true;
+			else
+				return false;
+		}
+	}
+
+}
Index: DCWoRMS/trunk/build/classes/simulator/stats/GSSAccumulator.java
===================================================================
--- DCWoRMS/trunk/build/classes/simulator/stats/GSSAccumulator.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/simulator/stats/GSSAccumulator.java	(revision 477)
@@ -0,0 +1,138 @@
+/**
+ * 
+ */
+package simulator.stats;
+
+import java.io.PrintStream;
+
+import simulator.DataCenterWorkloadSimulator;
+import gridsim.Accumulator;
+
+/**
+ * This class temporarily adds new methods to {@link Accumulator} class.
+ * 
+ * @author Stanislaw Szczepanowski
+ * 
+ */
+public class GSSAccumulator extends Accumulator {
+
+	public GSSAccumulator() {
+		super();
+	}
+
+	public GSSAccumulator(Accumulator acc) {
+		n_ = acc.getCount();
+		mean_ = acc.getMean();
+		sqrMean_ = acc.getStandardDeviation() + (mean_ * mean_);
+		min_ = acc.getMin();
+		max_ = acc.getMax();
+		last_ = acc.getLast();
+	}
+
+	/**
+	 * This method must be overloaded, since it returns the wrong value.
+	 */
+	public double getStandardDeviation() {
+		return Math.sqrt(getVariance());
+	}
+
+	/**
+	 * Calculates the variance of accumulated items
+	 * 
+	 * @return the Standard Deviation of accumulated items
+	 * @pre $none
+	 * @post $none
+	 */
+	public double getVariance() {
+		return sqrMean_ - (mean_ * mean_);
+	}
+
+	public boolean equals(Object obj) {
+		if (!(obj instanceof GSSAccumulator))
+			return false;
+
+		GSSAccumulator otherAcc = (GSSAccumulator) obj;
+		if (Double.compare(this.last_, otherAcc.last_) != 0)
+			return false;
+		if (Double.compare(this.max_, otherAcc.max_) != 0)
+			return false;
+		if (Double.compare(this.mean_, otherAcc.mean_) != 0)
+			return false;
+		if (Double.compare(this.min_, otherAcc.min_) != 0)
+			return false;
+		if (Double.compare(this.n_, otherAcc.n_) != 0)
+			return false;
+		if (Double.compare(this.sqrMean_, otherAcc.sqrMean_) != 0)
+			return false;
+
+		return true;
+	}
+
+	public String toString() {
+		String accumulatorSeparator = ";";
+		StringBuffer buffer = new StringBuffer(50);
+
+		buffer.append(accumulatorSeparator);
+		buffer.append(DataCenterWorkloadSimulator.DFAULT_NUMBER_FORMAT.format(this
+				.getMean()));
+		buffer.append(accumulatorSeparator);
+		buffer.append(DataCenterWorkloadSimulator.DFAULT_NUMBER_FORMAT.format(this
+				.getStandardDeviation()));
+		buffer.append(accumulatorSeparator);
+		buffer.append(DataCenterWorkloadSimulator.DFAULT_NUMBER_FORMAT.format(this
+				.getVariance()));
+		buffer.append(accumulatorSeparator);
+		buffer.append(DataCenterWorkloadSimulator.DFAULT_NUMBER_FORMAT.format(this
+				.getMin()));
+		buffer.append(accumulatorSeparator);
+		buffer.append(DataCenterWorkloadSimulator.DFAULT_NUMBER_FORMAT.format(this
+				.getMax()));
+		buffer.append(accumulatorSeparator);
+		buffer.append(DataCenterWorkloadSimulator.DFAULT_NUMBER_FORMAT.format(this
+				.getSum()));
+		buffer.append(accumulatorSeparator);
+		buffer.append(DataCenterWorkloadSimulator.DFAULT_NUMBER_FORMAT.format(this
+				.getCount()));
+		buffer.append(accumulatorSeparator);
+
+		return buffer.toString();
+	}
+
+	public String toFormatedString() {
+
+		String accumulatorSeparator = "; ";
+		StringBuffer buffer = new StringBuffer(50);
+
+		buffer.append(accumulatorSeparator);
+		buffer.append(String.format("%16s",
+				DataCenterWorkloadSimulator.DFAULT_NUMBER_FORMAT.format(this
+						.getMean())));
+		buffer.append(accumulatorSeparator);
+		buffer.append(String.format("%16s",
+				DataCenterWorkloadSimulator.DFAULT_NUMBER_FORMAT.format(this
+						.getStandardDeviation())));
+		buffer.append(accumulatorSeparator);
+		buffer.append(String.format("%16s",
+				DataCenterWorkloadSimulator.DFAULT_NUMBER_FORMAT.format(this
+						.getVariance())));
+		buffer.append(accumulatorSeparator);
+		buffer.append(String.format("%16s",
+				DataCenterWorkloadSimulator.DFAULT_NUMBER_FORMAT.format(this
+						.getMin())));
+		buffer.append(accumulatorSeparator);
+		buffer.append(String.format("%16s",
+				DataCenterWorkloadSimulator.DFAULT_NUMBER_FORMAT.format(this
+						.getMax())));
+		buffer.append(accumulatorSeparator);
+		buffer.append(String.format("%16s",
+				DataCenterWorkloadSimulator.DFAULT_NUMBER_FORMAT.format(this
+						.getSum())));
+		buffer.append(accumulatorSeparator);
+		buffer.append(String.format("%16s",
+				DataCenterWorkloadSimulator.DFAULT_NUMBER_FORMAT.format(this
+						.getCount())));
+		buffer.append(accumulatorSeparator);
+
+		return buffer.toString();
+	}
+}
Index: DCWoRMS/trunk/build/classes/simulator/stats/SimulationStatistics.java
===================================================================
--- DCWoRMS/trunk/build/classes/simulator/stats/SimulationStatistics.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/simulator/stats/SimulationStatistics.java	(revision 477)
@@ -0,0 +1,51 @@
+package simulator.stats;
+
+public interface SimulationStatistics {
+	
+	public static final String TASK_WAITING_TIME = "Task waiting time";
+
+	public static final String MAKESPAN = "Makespan";
+	
+	public static final String TASK_COMPLETION_TIME = "Task completion time";
+	
+	public static final String DELAYED_TASKS = "Delayed tasks";
+
+	public static final String TASK_TARDINESS = "Task tardiness";
+
+	public static final String TASK_LATENESS = "Task lateness";
+	
+	public static final String TASK_START_TIME = "Task start time";
+
+	public static final String TASK_FLOW_TIME = "Task flow time";
+
+	public static final String TASK_EXECUTION_TIME = "Task execution time";
+
+	public static final String FAILED_REQUESTS = "Failed requests (tasks)";
+	
+	public static final String RESOURCES_TOTAL_LOAD = "Resources total load";
+
+	public static final String RESOURCES_RESERVATION_LOAD = "Resources reservation load";
+	
+	public static final String ENERGY_USAGE = "Energy usage";
+
+	public static final String RESOURCES_QUEUE_LENGTH = "Resources queue length";
+
+	
+	public void generateStatistics();
+	
+	public void gatherTaskStatistics();
+	
+
+	
+	public void saveSimulationStatistics();
+	
+
+
+	public String getOutputFolderName();
+
+	public GSSAccumulator getStats(String resourcesTotalLoad);
+
+	public boolean accumulatedStats();
+
+	
+}
Index: DCWoRMS/trunk/build/classes/simulator/stats/random/MinMaxDistribution.java
===================================================================
--- DCWoRMS/trunk/build/classes/simulator/stats/random/MinMaxDistribution.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/simulator/stats/random/MinMaxDistribution.java	(revision 477)
@@ -0,0 +1,66 @@
+package simulator.stats.random;
+
+import cern.jet.random.AbstractDistribution;
+
+/**
+ * Represents a wrapper for a specific random distribution class. The purpose of this class is
+ * to provide the random values, with a given distribution, but within a given range [min; max] - inclusive. 
+ * Min may be called a lower bound, and max an upper bound.
+ * @author Stanislaw Szczepanowski
+ *
+ */
+public class MinMaxDistribution extends AbstractDistribution {
+
+	/**
+	 * The lower bound for the allowed random values (<code>null</code> if no bound was set)
+	 */
+	protected Double min;
+	
+	/**
+	 * The upper bound for the allowed random values (<code>null</code> if no bound was set)
+	 */
+	protected Double max;
+	
+	/**
+	 * The source distribution for random values
+	 */
+	protected AbstractDistribution source;
+	
+	/**
+	 * MinMax constructor. 
+	 * It constructs the class with a given original distribution and minimal and maximal values.
+	 * @param origDistribution the original distribution, which will be the source for random numbers. It must not be <code>null</code>.
+	 * @param min the minimal allowed value for the random numbers. If a <code>null</code> value is given, then no lower bound will be set.
+	 * @param max the maximal allowed value for the random numbers. If a <code>null</code> value is given, then no upper bound will be set.
+	 */
+	public MinMaxDistribution(AbstractDistribution origDistribution, Double min, Double max) {
+		source = origDistribution;
+		
+		if (min != null && max != null) {
+			if (min > max)
+				throw new IllegalArgumentException("ERROR: invalid parameters min > max");
+		}
+		
+		this.min = min;
+		this.max = max;
+	}
+	
+	@Override
+	public double nextDouble() {
+		double value;
+		
+		for (;;) {
+			value = source.nextDouble();
+			
+			if (min != null && Double.compare(value, min) < 0)
+				continue;
+			
+			if (max != null && Double.compare(value, max) > 0)
+				continue;
+
+			break;
+		}
+		
+		return value;
+	}
+}
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 477)
@@ -0,0 +1,205 @@
+package simulator.stats;
+
+
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.PrintStream;
+import java.util.ArrayList;
+import java.util.List;
+
+import simulator.stats.implementation.GSSimStatistics;
+import gridsim.Accumulator;
+
+
+public class AccumulatedStatistics {
+
+	protected static final String ACCUMULATED_SIMULATIONS_STATISTICS_OUTPUT_FILE_NAME = "Stats_Accumulated_Simulations.txt";  
+	
+	protected List<SimulationStatistics> simulations;
+
+	public AccumulatedStatistics(int noOfSimulations) {
+		simulations = new ArrayList<SimulationStatistics>(noOfSimulations);
+	}
+
+	public AccumulatedStatistics() {
+		simulations = new ArrayList<SimulationStatistics>();
+	}
+
+	public void add(SimulationStatistics simulationStatistics) {
+		simulations.add(simulationStatistics);
+	}
+
+	public void saveStatistics() {		
+
+		SimulationStatistics simulationStatisticsNew = simulations.get(0);
+
+		if(!simulationStatisticsNew.accumulatedStats())
+			return;
+		String dirName = simulationStatisticsNew.getOutputFolderName();
+		if(dirName == null)
+			return;
+
+		PrintStream out = null;
+		try {
+			File file = new File(dirName + ACCUMULATED_SIMULATIONS_STATISTICS_OUTPUT_FILE_NAME);
+			out = new PrintStream(new FileOutputStream(file));
+		}  catch (IOException e) {
+			e.printStackTrace();
+		}
+		
+		GSSAccumulator resourceLoad = getAccumulatedResourceLoad();
+		GSSAccumulator reservationLoad = getAccumulatedReservationLoad();
+		GSSAccumulator makespan = getAccumulatedMakespan();
+		GSSAccumulator taskExecutionTime = getAccumulatedJobExecutionTime();
+		GSSAccumulator taskQueueLength = getAccumulatedQueueJobCount();
+		GSSAccumulator taskCompletionTime = getAccumulatedCompletionTime();
+		GSSAccumulator taskWaitingTime = getAccumulatedWaitingTime();
+		GSSAccumulator taskFlowTime = getAccumulatedJobFlowTime();
+		GSSAccumulator taskLateness = getAccumulatedLateness();
+		GSSAccumulator delayedTasks = getAccumulatedDelayedTasks();
+		GSSAccumulator taskTardiness = getAccumulatedTardiness();
+		GSSAccumulator failedRequests = getAccumulatedFailedRequests();
+		
+		out.print("Delayed tasks (accumulated)");
+		out.println(delayedTasks);
+		out.print("Failed requests (accumulated)");
+		out.println(failedRequests);
+		out.print("Makespan (accumulated)");
+		out.println(makespan);		
+		out.print("Resources queue length (accumulated)");
+		out.println(taskQueueLength);
+		out.print("Mean (accumulated) resource load");
+		out.println(resourceLoad);		
+		out.print("Mean (accumulated) reservation load");
+		out.println(reservationLoad);		
+		out.print("Task completion time (accumulated)");
+		out.println(taskCompletionTime);		
+		out.print("Task execution time (accumulated)");
+		out.println(taskExecutionTime);		
+		out.print("Task flow time (accumulated)");
+		out.println(taskFlowTime);
+		out.print("Task waiting time (accumulated)");
+		out.println(taskWaitingTime);
+		out.print("Task lateness (accumulated)");
+		out.println(taskLateness);		
+		out.print("Task tardiness (accumulated)");
+		out.println(taskTardiness);		
+		out.println(); 
+		out.close();
+	}
+
+	public GSSAccumulator getAccumulatedResourceLoad() {
+		GSSAccumulator resourceMeanLoad = new GSSAccumulator();	
+		for (SimulationStatistics simStat : simulations) {
+			GSSAccumulator simulationResTotalLoad = simStat.getStats(SimulationStatistics.RESOURCES_TOTAL_LOAD); 
+			resourceMeanLoad.add(simulationResTotalLoad.getMean());
+		}
+		return resourceMeanLoad; 
+	}
+
+	public GSSAccumulator getAccumulatedReservationLoad(){
+		GSSAccumulator reservationMean = new GSSAccumulator();
+		for (SimulationStatistics simStat : simulations) {
+			Accumulator simulationResvTotalLoad = simStat.getStats(SimulationStatistics.RESOURCES_RESERVATION_LOAD);
+			reservationMean.add(simulationResvTotalLoad.getMean());
+		}
+		return reservationMean;
+	}
+
+	/*public GSSAccumulator getAccumulatedBokrerThroughput() {
+		GSSAccumulator meanThroughput = new GSSAccumulator();
+		
+		for (SimulationStatisticsNew simStat : simulations) {
+			double simulationMeanThroughput = simStat.getBrokerStats().average(Sim_stat.THROUGHPUT);
+			meanThroughput.add(simulationMeanThroughput);
+		}
+		return meanThroughput;
+	}*/
+
+	public GSSAccumulator getAccumulatedJobFlowTime() {
+		GSSAccumulator meanJobFlowTime = new GSSAccumulator();
+		for (SimulationStatistics simStat : simulations) {
+			Accumulator simulationJobFlowTime = simStat.getStats(SimulationStatistics.TASK_FLOW_TIME);
+			meanJobFlowTime.add(simulationJobFlowTime.getMean());
+		}
+		return meanJobFlowTime;
+	}
+
+	public GSSAccumulator getAccumulatedLateness() {
+		GSSAccumulator meanLateness = new GSSAccumulator();
+		for (SimulationStatistics simStat : simulations) {
+			Accumulator simulationLateness = simStat.getStats(SimulationStatistics.TASK_LATENESS);
+			meanLateness.add(simulationLateness.getMean());
+		}
+		return meanLateness;
+	}
+
+	public GSSAccumulator getAccumulatedFailedRequests() {
+		GSSAccumulator meanFailedRequests = new GSSAccumulator();
+		for (SimulationStatistics simStat : simulations) {
+			Accumulator simulationFailedRequestes = simStat.getStats(SimulationStatistics.FAILED_REQUESTS);
+			meanFailedRequests.add(simulationFailedRequestes.getMean());
+		}
+		return meanFailedRequests;
+	}
+
+	public GSSAccumulator getAccumulatedTardiness() {
+		GSSAccumulator meanTardiness = new GSSAccumulator();
+		for (SimulationStatistics simStat : simulations) {
+			Accumulator simulationJobTardiness = simStat.getStats(SimulationStatistics.TASK_TARDINESS);
+			meanTardiness.add(simulationJobTardiness.getMean());
+		}
+		return meanTardiness;
+	}
+
+	public GSSAccumulator getAccumulatedDelayedTasks() {
+		GSSAccumulator delayedTasks = new GSSAccumulator();
+		for (SimulationStatistics simStat : simulations) {
+			Accumulator simulationDelayedTasks = simStat.getStats(SimulationStatistics.DELAYED_TASKS);
+			delayedTasks.add(simulationDelayedTasks.getMean());
+		}
+		return delayedTasks;
+	}
+
+	public GSSAccumulator getAccumulatedCompletionTime() {
+		GSSAccumulator meanJobCompletionTime = new GSSAccumulator();
+		
+		for (SimulationStatistics simStat : simulations) {
+			Accumulator simulationJobTurnaroundTime = simStat.getStats(SimulationStatistics.TASK_COMPLETION_TIME);
+			meanJobCompletionTime.add(simulationJobTurnaroundTime.getMean());
+		}
+		return meanJobCompletionTime;
+	}
+
+	public GSSAccumulator getAccumulatedMakespan() {
+		GSSAccumulator meanMakespan = new GSSAccumulator();
+		for (SimulationStatistics simStat : simulations) {
+			meanMakespan.add(simStat.getStats(SimulationStatistics.MAKESPAN).getMean());
+		}
+		return meanMakespan;
+	}
+
+	public GSSAccumulator getAccumulatedWaitingTime() {
+		GSSAccumulator meanWaitingTime = new GSSAccumulator();
+		for (SimulationStatistics simStat : simulations)
+			meanWaitingTime.add(simStat.getStats(SimulationStatistics.TASK_WAITING_TIME).getMean());
+		return meanWaitingTime;
+	}
+
+	public GSSAccumulator getAccumulatedJobExecutionTime() {
+		GSSAccumulator meanJobExecutionTime = new GSSAccumulator();
+		for (SimulationStatistics simStat : simulations)
+			meanJobExecutionTime.add(simStat.getStats(SimulationStatistics.TASK_EXECUTION_TIME).getMean());
+		return meanJobExecutionTime;
+	}
+
+	public GSSAccumulator getAccumulatedQueueJobCount() {
+		GSSAccumulator meanQueuJobCount = new GSSAccumulator();
+		for (SimulationStatistics simStat : simulations)
+			meanQueuJobCount.add(simStat.getStats(SimulationStatistics.RESOURCES_QUEUE_LENGTH).getMean());
+		return meanQueuJobCount;
+	}
+
+}
Index: DCWoRMS/trunk/build/classes/simulator/stats/implementation/ResourceStats.java
===================================================================
--- DCWoRMS/trunk/build/classes/simulator/stats/implementation/ResourceStats.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/simulator/stats/implementation/ResourceStats.java	(revision 477)
@@ -0,0 +1,78 @@
+package simulator.stats.implementation;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import schedframe.resources.computing.ComputingResource;
+import simulator.stats.implementation.out.StatsSerializer;
+
+public class ResourceStats implements StatsInterface {
+
+	// raw resource statistic
+	protected String resourceName;
+	protected int cpucnt;
+	protected int cpuspeed;
+	protected int memory;
+	protected double queueLength;
+	protected Map<String, Double> processorsLoad;
+	protected Map<String, Double> processorsReservationLoad;
+
+	private String[] headers = { "resourceName", "memory", "cpu", "cpu_speed",
+			"queue_length", "cpu_load", "reservation_load" };
+
+	public ResourceStats(ComputingResource compResource) {
+		this.resourceName = compResource.getName();
+		init();
+
+	}
+
+	public void init() {
+		this.cpucnt = 0;
+		this.cpuspeed = 0;
+		this.memory = 0;
+		this.queueLength = 0;
+		this.processorsLoad = new HashMap<String, Double>();
+		this.processorsReservationLoad = new HashMap<String, Double>();
+	}
+
+	public double getQueueLength() {
+		return queueLength;
+	}
+
+	public void setQueueLength(double queueLength) {
+		this.queueLength = queueLength;
+	}
+
+	public Map<String, Double> getPELoad() {
+		return processorsLoad;
+	}
+
+	public Map<String, Double> getProcessorsReservationLoad() {
+		return processorsReservationLoad;
+	}
+
+	public String getResourceName() {
+		return resourceName;
+	}
+
+	public int getCpucnt() {
+		return cpucnt;
+	}
+
+	public int getCpuspeed() {
+		return cpuspeed;
+	}
+
+	public int getMemory() {
+		return memory;
+	}
+
+	public Object serialize(StatsSerializer serializer) {
+		return serializer.visit(this);
+	}
+
+	public String[] getHeaders() {
+		return headers;
+	}
+
+}
Index: DCWoRMS/trunk/build/classes/simulator/stats/implementation/StatsAbstractClass.java
===================================================================
--- DCWoRMS/trunk/build/classes/simulator/stats/implementation/StatsAbstractClass.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/simulator/stats/implementation/StatsAbstractClass.java	(revision 477)
@@ -0,0 +1,21 @@
+package simulator.stats.implementation;
+
+import simulator.stats.implementation.out.StatsSerializer;
+import java.util.UUID;
+
+public abstract class StatsAbstractClass {
+
+	protected UUID uuid;
+	
+	protected StatsAbstractClass(){
+		uuid = UUID.randomUUID();
+	}
+	
+	public abstract Object serialize(StatsSerializer serializer);
+	public abstract String[] getHeaders();
+	
+	public UUID getUUID() {
+		return uuid;
+	}
+	
+}
Index: DCWoRMS/trunk/build/classes/simulator/stats/implementation/AccumulatedResourceStats.java
===================================================================
--- DCWoRMS/trunk/build/classes/simulator/stats/implementation/AccumulatedResourceStats.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/simulator/stats/implementation/AccumulatedResourceStats.java	(revision 477)
@@ -0,0 +1,55 @@
+package simulator.stats.implementation;
+
+import simulator.stats.GSSAccumulator;
+import simulator.stats.implementation.out.StatsSerializer;
+
+/**
+ * 
+ * @author Marcin Krystek
+ * 
+ */
+public class AccumulatedResourceStats implements StatsInterface {
+
+	// accumulated resource statistic
+	protected GSSAccumulator resourceLoad;
+	protected GSSAccumulator resourceReservationLoad;
+	protected String resourceName;
+
+	private String[] headers = { "Resource name", "Factor's name", "mean",
+			"stdev", "variance", "minimum", "maximum", "sum", "count" };
+
+	public AccumulatedResourceStats(String resourceName) {
+		this.resourceName = resourceName;
+		this.resourceLoad = new GSSAccumulator();
+		this.resourceReservationLoad = new GSSAccumulator();
+	}
+
+	public String getResourceName() {
+		return this.resourceName;
+	}
+
+	public void addResourceLoad(double load) {
+		this.resourceLoad.add(load);
+	}
+
+	public void addReservationLoad(double load) {
+		this.resourceReservationLoad.add(load);
+	}
+
+	public GSSAccumulator getResourceLoad() {
+		return this.resourceLoad;
+	}
+
+	public GSSAccumulator getResourceReservationLoad() {
+		return this.resourceReservationLoad;
+	}
+
+	public Object serialize(StatsSerializer serializer) {
+		return serializer.visit(this);
+	}
+
+	public String[] getHeaders() {
+		return headers;
+	}
+
+}
Index: DCWoRMS/trunk/build/classes/simulator/stats/implementation/StatsInterface.java
===================================================================
--- DCWoRMS/trunk/build/classes/simulator/stats/implementation/StatsInterface.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/simulator/stats/implementation/StatsInterface.java	(revision 477)
@@ -0,0 +1,10 @@
+package simulator.stats.implementation;
+
+import simulator.stats.implementation.out.StatsSerializer;
+
+public interface StatsInterface {
+
+	public Object serialize(StatsSerializer serializer);
+	public String[] getHeaders();
+	
+}
Index: DCWoRMS/trunk/build/classes/simulator/stats/implementation/ResourceEnergyStats.java
===================================================================
--- DCWoRMS/trunk/build/classes/simulator/stats/implementation/ResourceEnergyStats.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/simulator/stats/implementation/ResourceEnergyStats.java	(revision 477)
@@ -0,0 +1,66 @@
+package simulator.stats.implementation;
+
+import java.util.Map;
+import java.util.TreeMap;
+
+import schedframe.resources.ResourceType;
+import simulator.stats.implementation.out.StatsSerializer;
+
+public class ResourceEnergyStats {
+	protected Map<Long, Double> energy;
+	protected String resourceName;
+	protected String usageType;
+	protected ResourceType resourceType;
+	protected double meanUsage;
+	protected double sumUsage;
+	
+	public void setSumUsage(double sumUsage) {
+		this.sumUsage = sumUsage;
+	}
+
+	public double getSumUsage() {
+		return sumUsage;
+	}
+	public void setMeanUsage(double meanUsage) {
+		this.meanUsage = meanUsage;
+	}
+	
+	public double getMeanUsage() {
+		return meanUsage;
+	}
+	
+	private String[] headers = { "resourceName", "timestamp", "usage" };
+	
+	public ResourceEnergyStats (String resourceName, ResourceType resourceType, String usageType) {
+		this.resourceName = resourceName;
+		this.resourceType = resourceType;
+		this.usageType = usageType;
+		this.energy = new TreeMap<Long, Double>();
+		this.meanUsage = 0;
+	}
+
+	public String getResourceName() {
+		return this.resourceName;
+	}
+	
+	public ResourceType getResourceType() {
+		return resourceType;
+	}
+
+	public String getUsageType() {
+		return this.usageType;
+	}	
+
+	public Map<Long, Double> getEnergy() {
+		return this.energy;
+	}
+
+	public Object serialize(StatsSerializer serializer) {
+		return serializer.visit(this);
+	}
+
+	public String[] getHeaders() {
+		return headers;
+	}
+
+}
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 477)
@@ -0,0 +1,181 @@
+package simulator.stats.implementation;
+
+import gssim.schedframe.scheduling.Executable;
+
+import java.util.List;
+
+import simulator.stats.implementation.out.StatsSerializer;
+
+/**
+ * 
+ * @author Marcin Krystek
+ * 
+ */
+public class TaskStats implements StatsInterface {
+	protected List<String> processorsName;
+	protected double reservationStartDate;
+	protected double reservationFinishDate;
+
+	protected Executable task;
+	protected long startSimulationTimeSek;
+	
+	private String headers[] = { "JobID", "TaskID", "UserDN", "ResName", "CpuCnt",
+			"ExecStartDate", "ExecFinishDate", "ExecEndDate", "GB_SubDate",
+			"LB_SubDate", "CompletionTime", "ExecStartTime",
+			"ExecutionTime", "ReadyTime", "StartTime", "FlowTime",
+			"WaitingTime", "GQ_WaitingTime", "Lateness", "Tardiness",
+			"ReservStartDate", "ReservFinishDate", "ProcessorName", "Energy"};
+
+	public TaskStats(Executable task, long startSimulationTime) {
+		this.task = task;
+		this.startSimulationTimeSek = startSimulationTime / 1000;
+	}
+
+	public Object serialize(StatsSerializer serializer) {
+		return serializer.visit(this);
+	}
+
+	public String getJobID() {
+		return this.task.getJobId();
+	}
+
+	public String getTaskID() {
+		return this.task.getId();
+	}
+
+	public String 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 += " ";
+		}
+		return resName;
+	}
+
+	public long getCpuCnt() {
+		long cpuCnt = -1;
+		try {
+			cpuCnt = Double.valueOf(task.getCpuCntRequest()).longValue();
+		} catch (NoSuchFieldException e) {
+		}
+
+		return cpuCnt;
+	}
+
+	public double getExecStartDate() {
+		return task.getExecStartTime();
+	}
+
+	public double getExecFinishDate() {
+		return task.getFinishTime();
+	}
+
+	public double getExecEndDate() {
+		double ret = -1;
+		try {
+			ret = task.getExecutionEndTime().getMillis() / 1000;
+		} catch (NoSuchFieldException e) {
+			ret = task.getFinishTime();
+		}
+		return ret;
+	}
+
+	public double getGB_SubDate() {
+		return task.getSubmissionTimeToBroker().getMillis() / 1000;
+	}
+
+	public double getLB_SubDate() {
+		return task.getSubmissionTime();
+	}
+
+	public double getCompletionTime() {
+		return task.getFinishTime() - startSimulationTimeSek;
+	}
+
+	public double getExecutionTime() {
+		return task.getFinishTime() - task.getExecStartTime();
+	}
+
+	public double getExecStartTime() {
+		return task.getExecStartTime() - startSimulationTimeSek;
+	}
+
+	public double getReadyTime() {
+		double readyTime = 0;
+
+		try {
+			readyTime = task.getExecutionStartTime().getMillis() / 1000
+					- startSimulationTimeSek;
+		} catch (Exception ex) {
+			readyTime = task.getSubmissionTimeToBroker().getMillis()/1000 - startSimulationTimeSek;
+		}
+
+		return readyTime;
+	}
+
+	public double getStartTime() {
+		return task.getExecStartTime()
+				- task.getSubmissionTimeToBroker().getMillis() / 1000;
+	}
+
+	public double getFlowTime() {
+		return getCompletionTime() - getReadyTime();
+	}
+
+	public double getWaitingTime() {
+		return task.getWaitingTime();
+	}
+
+	public double getGQ_WaitingTime() {
+		return task.getSubmissionTime()
+				- task.getSubmissionTimeToBroker().getMillis() / 1000;
+	}
+
+	public double getLateness() {
+		double execEndDate = getExecEndDate();
+		double lateness = 0;
+		if (execEndDate != -1) {
+			lateness = task.getFinishTime() - execEndDate;
+		}
+		return lateness;
+	}
+
+	public double getTardiness() {
+		return Math.max(getLateness(), 0.0);
+	}
+
+	public void setProcessorsName(List<String> value) {
+		this.processorsName = value;
+	}
+
+	public void setReservationStartDate(double value) {
+		this.reservationStartDate = value;
+	}
+
+	public void setReservationFinishDate(double value) {
+		this.reservationFinishDate = value;
+	}
+
+	public List<String> getProcessorsName() {
+		return processorsName;
+	}
+
+	public double getReservationStartDate() {
+		return reservationStartDate;
+	}
+
+	public double getReservationFinishDate() {
+		return reservationFinishDate;
+	}
+
+	public String[] getHeaders() {
+		return headers;
+	}
+
+}
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 477)
@@ -0,0 +1,431 @@
+package simulator.stats.implementation.out;
+
+
+import java.util.Map;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import simulator.DataCenterWorkloadSimulator;
+import simulator.stats.implementation.AccumulatedResourceStats;
+import simulator.stats.implementation.GSSAccumulatorsStats;
+import simulator.stats.implementation.JobStats;
+import simulator.stats.implementation.ResourceEnergyStats;
+import simulator.stats.implementation.ResourceStats;
+import simulator.stats.implementation.ResourceUsageStats;
+import simulator.stats.implementation.TaskStats;
+
+/**
+ * 
+ * @author Marcin Krystek, Jarek Szymczak
+ *
+ */
+public class StringSerializer extends AbstractStringSerializer {
+
+	private Log log = LogFactory.getLog(StringSerializer.class);
+
+	public String visit(TaskStats taskStats) {
+		StringBuffer buffer = null;
+
+		if(printedHeaders.add("taskStats")) {
+			buffer = new StringBuffer(520);
+			String[] headers = taskStats.getHeaders();
+			if (headers.length >= 10) {
+
+				for(int i = 0; i < 10; i++)
+				{
+					buffer.append(headers[i]);
+					buffer.append(fieldSeparator);
+				}
+				
+				if (this.useExtended) {
+					
+					for(int i = 10; i < headers.length; i++)
+					{
+						buffer.append(headers[i]);
+						buffer.append(fieldSeparator);
+					}
+					
+				}
+
+			} else {
+				buffer.append(headers.toString());
+			}
+			buffer.append(System.getProperty("line.separator"));
+		} else {
+			buffer = new StringBuffer(260);
+		}
+		
+		buffer.append(taskStats.getJobID());
+		buffer.append(fieldSeparator);
+		buffer.append(taskStats.getTaskID());
+		buffer.append(fieldSeparator);
+		buffer.append(taskStats.getUserDN());
+		buffer.append(fieldSeparator);
+		buffer.append(taskStats.getResName());
+		buffer.append(fieldSeparator);
+		buffer.append(taskStats.getCpuCnt());
+		buffer.append(fieldSeparator);
+		buffer.append(Double.valueOf(taskStats.getExecStartDate()).longValue());
+		buffer.append(fieldSeparator);
+		buffer.append(Double.valueOf(taskStats.getExecFinishDate()).longValue());
+		buffer.append(fieldSeparator);
+		buffer.append(Double.valueOf(taskStats.getExecEndDate()).longValue());
+		buffer.append(fieldSeparator);
+		buffer.append(Double.valueOf(taskStats.getGB_SubDate()).longValue());
+		buffer.append(fieldSeparator);
+		buffer.append(Double.valueOf(taskStats.getLB_SubDate()).longValue());
+		buffer.append(fieldSeparator);
+		if (this.useExtended) {
+			buffer.append(Double.valueOf(taskStats.getCompletionTime())
+					.longValue());
+			buffer.append(fieldSeparator);
+			buffer.append(Double.valueOf(taskStats.getExecStartTime()).longValue());
+			buffer.append(fieldSeparator);
+			buffer.append(Double.valueOf(taskStats.getExecutionTime()).longValue());
+			buffer.append(fieldSeparator);
+			buffer.append(Double.valueOf(taskStats.getReadyTime()).longValue());
+			buffer.append(fieldSeparator);
+			buffer.append(Double.valueOf(taskStats.getStartTime()).longValue());
+			buffer.append(fieldSeparator);
+			buffer.append(Double.valueOf(taskStats.getFlowTime()).longValue());
+			buffer.append(fieldSeparator);
+			buffer.append(Double.valueOf(taskStats.getWaitingTime()).longValue());
+			buffer.append(fieldSeparator);
+			buffer.append(Double.valueOf(taskStats.getGQ_WaitingTime())
+					.longValue());
+			buffer.append(fieldSeparator);
+			buffer.append(Double.valueOf(taskStats.getLateness()).longValue());
+			buffer.append(fieldSeparator);
+			buffer.append(Double.valueOf(taskStats.getTardiness()).longValue());
+			buffer.append(fieldSeparator);
+			buffer.append(Double.valueOf(taskStats.getReservationStartDate())
+					.longValue());
+			buffer.append(fieldSeparator);
+			buffer.append(Double.valueOf(taskStats.getReservationFinishDate())
+					.longValue());
+			buffer.append(fieldSeparator);
+			buffer.append(taskStats.getProcessorsName());
+			buffer.append(fieldSeparator);
+		}
+		
+		
+		return buffer.toString();
+	}
+
+	public String visit(JobStats jobStats) {
+		
+		StringBuffer buffer = null;
+
+		if(printedHeaders.add("jobStats")) {
+			buffer = new StringBuffer(200);
+			String[] headers = jobStats.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(100);
+		}
+		
+		buffer.append(jobStats.getJobID());
+		buffer.append(fieldSeparator);
+		buffer.append(defaultNumberFormat
+				.format(jobStats.getMeanTaskCompletionTime().getMean()));
+		buffer.append(fieldSeparator);
+		buffer.append(defaultNumberFormat
+				.format(jobStats.getMeanTaskExecutionTime().getMean()));
+		buffer.append(fieldSeparator);
+		buffer.append(defaultNumberFormat
+				.format(jobStats.getMeanTaskStartTime().getMean()));
+		buffer.append(fieldSeparator);
+		buffer.append(defaultNumberFormat
+				.format(jobStats.getMeanTaskFlowTime().getMean()));
+		buffer.append(fieldSeparator);
+		buffer.append(defaultNumberFormat
+				.format(jobStats.getMeanTaskWaitingTime().getMean()));
+		buffer.append(fieldSeparator);
+		buffer.append(defaultNumberFormat
+				.format(jobStats.getMeanTaskGQ_WaitingTime().getMean()));
+		buffer.append(fieldSeparator);
+		buffer.append(defaultNumberFormat
+				.format(jobStats.getTardiness().getMean()));
+		buffer.append(fieldSeparator);
+		buffer.append(defaultNumberFormat
+				.format(jobStats.getLateness().getMean()));
+		buffer.append(fieldSeparator);
+		buffer.append(defaultNumberFormat
+				.format(jobStats.getMakespan().getMean()));
+		buffer.append(fieldSeparator);
+		
+		return buffer.toString();
+	}
+	
+	public String visit(ResourceStats resourceStats){
+		
+		StringBuffer buffer = null;
+
+		if(printedHeaders.add("resourceStats")) {
+			buffer = new StringBuffer(600);
+			String[] headers = resourceStats.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(300);
+		}
+		
+		buffer.append(resourceStats.getResourceName());
+		buffer.append(fieldSeparator);
+
+		buffer.append(resourceStats.getMemory());
+		buffer.append(fieldSeparator);
+
+		buffer.append(resourceStats.getCpucnt());
+		buffer.append(fieldSeparator);
+
+		buffer.append(resourceStats.getCpuspeed());
+		buffer.append(fieldSeparator);
+
+		buffer.append(DataCenterWorkloadSimulator.DFAULT_NUMBER_FORMAT
+				.format(resourceStats.getQueueLength()));
+		buffer.append(fieldSeparator);
+
+		/*Map<String, Double> processorsLoad = resourceStats.getProcessorsLoad();
+		for (String processorName : processorsLoad.keySet()) {
+
+			Double load = processorsLoad.get(processorName);
+			buffer.append(processorName);
+			buffer.append(" ");
+			buffer.append(GridSchedulingSimulator.DFAULT_NUMBER_FORMAT
+							.format(load));
+			buffer.append(":");
+
+		}*/
+
+		buffer.append(fieldSeparator);
+		Map<String, Double> processorsReservationLoad = resourceStats
+				.getProcessorsReservationLoad();
+		for (String processorName : processorsReservationLoad.keySet()) {
+
+			Double reservationLoad = processorsReservationLoad
+					.get(processorName);
+			buffer.append(processorName);
+			buffer.append(" ");
+			buffer.append(DataCenterWorkloadSimulator.DFAULT_NUMBER_FORMAT
+					.format(reservationLoad));
+			buffer.append(":");
+		}
+		buffer.append(fieldSeparator);
+		return buffer.toString();
+	}
+	
+	public String visit(AccumulatedResourceStats accResStats){
+		
+		StringBuffer buffer = null;
+
+		if(printedHeaders.add("accResStats")) {
+			buffer = new StringBuffer(340);
+			String[] headers = accResStats.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(170);
+		}
+		
+		buffer.append(accResStats.getResourceName());
+		buffer.append(fieldSeparator);
+		buffer.append("load");
+		buffer.append(accResStats.getResourceLoad().toString());
+		buffer.append(System.getProperty("line.separator"));
+		buffer.append(accResStats.getResourceName());
+		buffer.append(fieldSeparator);
+		buffer.append("reservationload");
+		buffer.append(accResStats.getResourceReservationLoad().toString());
+		buffer.append(System.getProperty("line.separator"));
+		
+		return buffer.toString();
+	}
+
+	public Object visit(ResourceUsageStats resourceUsageStats) {
+		Map<Long, Integer> resourceUsage = resourceUsageStats.getUsage();
+		
+		int mapSize = resourceUsage.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 * resourceUsage.size();
+		
+		StringBuffer buffer = null;
+
+		if(printedHeaders.add(resourceUsageStats.getUsageType())) {
+			buffer = new StringBuffer(size + 42);
+			String[] headers = resourceUsageStats.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 : resourceUsage.keySet()) {
+			
+			buffer.append(resourceUsageStats.getResourceName());
+			buffer.append(fieldSeparator);
+			Integer value = resourceUsage.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"));
+
+		}
+
+		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();
+		
+		int mapSize = resourceEnergy.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 * resourceEnergy.size();
+		
+		StringBuffer buffer = null;
+
+		if(printedHeaders.add(resourceEnergyStats.getUsageType())) {
+			buffer = new StringBuffer(size + 42);
+			String[] headers = resourceEnergyStats.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 : resourceEnergy.keySet()) {
+			
+			buffer.append(resourceEnergyStats.getResourceName());
+			buffer.append(fieldSeparator);
+			Double value = resourceEnergy.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"));
+
+		}
+		buffer.append("mean: "+resourceEnergyStats.getMeanUsage() + " sum: " +resourceEnergyStats.getSumUsage());
+		buffer.append(System.getProperty("line.separator"));
+
+		return buffer.toString();
+	}
+
+	public Object visit(GSSAccumulatorsStats accStats) {
+
+		StringBuffer buffer = null;
+
+		if(printedHeaders.add("accStats")) {
+			buffer = new StringBuffer(2800);
+			String[] headers = accStats.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(1400);
+		}
+		
+		buffer.append("Delayed tasks");
+		buffer.append(accStats.delayedTasks);
+		buffer.append(System.getProperty("line.separator"));
+		buffer.append("Failed requests (tasks)");
+		buffer.append(accStats.failedRequests);
+		buffer.append(System.getProperty("line.separator"));
+		buffer.append("Makespan");
+		buffer.append(accStats.makespan);
+		buffer.append(System.getProperty("line.separator"));
+		buffer.append("Resources queue length");
+		buffer.append(accStats.meanQueueLength);
+		buffer.append(System.getProperty("line.separator"));
+		buffer.append("Resources total load");
+		buffer.append(accStats.meanTotalLoad);
+		buffer.append(System.getProperty("line.separator"));
+		buffer.append("Resources reservation load");
+		buffer.append(accStats.meanReservationLoad);
+		buffer.append(System.getProperty("line.separator"));
+		buffer.append("Energy usage");
+		buffer.append(accStats.meanEnergyUsage);
+		buffer.append(System.getProperty("line.separator"));
+		buffer.append("Task completion time");
+		buffer.append(accStats.meanTaskCompletionTime);
+		buffer.append(System.getProperty("line.separator"));
+		buffer.append("Task execution time");
+		buffer.append(accStats.meanTaskExecutionTime);
+		buffer.append(System.getProperty("line.separator"));
+		buffer.append("Task start time");
+		buffer.append(accStats.meanTaskStartTime);
+		buffer.append(System.getProperty("line.separator"));
+		buffer.append("Task flow time");
+		buffer.append(accStats.meanTaskFlowTime);
+		buffer.append(System.getProperty("line.separator"));
+		buffer.append("Task waiting time");
+		buffer.append(accStats.meanTaskWaitingTime);
+		buffer.append(System.getProperty("line.separator"));
+		buffer.append("Task lateness");
+		buffer.append(accStats.lateness);
+		buffer.append(System.getProperty("line.separator"));
+		buffer.append("Task tardiness");
+		buffer.append(accStats.tardiness);
+		
+		return buffer.toString();
+	}
+
+}
Index: DCWoRMS/trunk/build/classes/simulator/stats/implementation/out/FormatedStringSerializer.java
===================================================================
--- DCWoRMS/trunk/build/classes/simulator/stats/implementation/out/FormatedStringSerializer.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/simulator/stats/implementation/out/FormatedStringSerializer.java	(revision 477)
@@ -0,0 +1,570 @@
+package simulator.stats.implementation.out;
+
+import java.util.Map;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import simulator.DataCenterWorkloadSimulator;
+import simulator.stats.implementation.AccumulatedResourceStats;
+import simulator.stats.implementation.GSSAccumulatorsStats;
+import simulator.stats.implementation.JobStats;
+import simulator.stats.implementation.ResourceEnergyStats;
+import simulator.stats.implementation.ResourceStats;
+import simulator.stats.implementation.ResourceUsageStats;
+import simulator.stats.implementation.TaskStats;
+
+/**
+ * 
+ * @author Marcin Krystek, Jarek Szymczak
+ * 
+ *         This serializer needs correct implementation. Now it works as simple
+ *         StringSerializer.
+ * 
+ */
+
+public class FormatedStringSerializer extends AbstractStringSerializer {
+
+	private Log log = LogFactory.getLog(FormatedStringSerializer.class);
+	
+	private String fieldSeparator = "; ";
+
+	public String visit(TaskStats taskStats) {
+
+		StringBuffer buffer = null;
+
+		if(printedHeaders.add("taskStats")) {
+			buffer = new StringBuffer(520);
+			String[] headers = taskStats.getHeaders();
+			if (headers.length == 23) {
+
+				buffer.append(String.format("%5s", headers[0]));
+				buffer.append(fieldSeparator);
+				buffer.append(String.format("%7s", headers[1]));
+				buffer.append(fieldSeparator);
+				buffer.append(String.format("%7s", headers[2]));
+				buffer.append(fieldSeparator);
+				buffer.append(String.format("%14s", headers[3]));
+				buffer.append(fieldSeparator);
+				buffer.append(String.format("%7s", headers[4]));
+				buffer.append(fieldSeparator);
+				buffer.append(String.format("%14s", headers[5]));
+				buffer.append(fieldSeparator);
+				buffer.append(String.format("%15s", headers[6]));
+				buffer.append(fieldSeparator);
+				buffer.append(String.format("%13s", headers[7]));
+				buffer.append(fieldSeparator);
+				buffer.append(String.format("%13s", headers[8]));
+				buffer.append(fieldSeparator);
+				buffer.append(String.format("%13s", headers[9]));
+				buffer.append(fieldSeparator);
+
+				if (this.useExtended) {
+					buffer.append(String.format("%15s", headers[10]));
+					buffer.append(fieldSeparator);
+					buffer.append(String.format("%14s", headers[11]));
+					buffer.append(fieldSeparator);
+					buffer.append(String.format("%14s", headers[12]));
+					buffer.append(fieldSeparator);
+					buffer.append(String.format("%10s", headers[13]));
+					buffer.append(fieldSeparator);
+					buffer.append(String.format("%10s", headers[14]));
+					buffer.append(fieldSeparator);
+					buffer.append(String.format("%9s", headers[15]));
+					buffer.append(fieldSeparator);
+					buffer.append(String.format("%12s", headers[16]));
+					buffer.append(fieldSeparator);
+					buffer.append(String.format("%15s", headers[17]));
+					buffer.append(fieldSeparator);
+					buffer.append(String.format("%9s", headers[18]));
+					buffer.append(fieldSeparator);
+					buffer.append(String.format("%10s", headers[19]));
+					buffer.append(fieldSeparator);
+					buffer.append(String.format("%16s", headers[20]));
+					buffer.append(fieldSeparator);
+					buffer.append(String.format("%17s", headers[21]));
+					buffer.append(fieldSeparator);
+					buffer.append(String.format("%-17s", headers[22]));
+					buffer.append(fieldSeparator);
+				}
+
+			} else {
+				buffer.append(headers.toString());
+			}
+			buffer.append(System.getProperty("line.separator"));
+		} else {
+			buffer = new StringBuffer(260);
+		}
+
+		buffer.append(String.format("%5s", taskStats.getJobID()));
+		buffer.append(fieldSeparator);
+		buffer.append(String.format("%7s", taskStats.getTaskID()));
+		buffer.append(fieldSeparator);
+		buffer.append(String.format("%7s", taskStats.getUserDN()));
+		buffer.append(fieldSeparator);
+		buffer.append(String.format("%14s", taskStats.getResName()));
+		buffer.append(fieldSeparator);
+		buffer.append(String.format("%7d", taskStats.getCpuCnt()));
+		buffer.append(fieldSeparator);
+		buffer.append(String.format("%14d",
+				Double.valueOf(taskStats.getExecStartDate()).longValue()));
+		buffer.append(fieldSeparator);
+		buffer.append(String.format("%15d",
+				Double.valueOf(taskStats.getExecFinishDate()).longValue()));
+		buffer.append(fieldSeparator);
+		buffer.append(String.format("%13d",
+				Double.valueOf(taskStats.getExecEndDate()).longValue()));
+		buffer.append(fieldSeparator);
+		buffer.append(String.format("%13d",
+				Double.valueOf(taskStats.getGB_SubDate()).longValue()));
+		buffer.append(fieldSeparator);
+		buffer.append(String.format("%13d",
+				Double.valueOf(taskStats.getLB_SubDate()).longValue()));
+		buffer.append(fieldSeparator);
+
+		if (this.useExtended) {
+			buffer.append(String.format("%15d",
+					Double.valueOf(taskStats.getCompletionTime()).longValue()));
+			buffer.append(fieldSeparator);
+			buffer.append(String.format("%14d",
+					Double.valueOf(taskStats.getExecStartTime()).longValue()));
+			buffer.append(fieldSeparator);
+			buffer.append(String.format("%14d",
+					Double.valueOf(taskStats.getExecutionTime()).longValue()));
+			buffer.append(fieldSeparator);
+			buffer.append(String.format("%10d",
+					Double.valueOf(taskStats.getReadyTime()).longValue()));
+			buffer.append(fieldSeparator);
+			buffer.append(String.format("%10d",
+					Double.valueOf(taskStats.getStartTime()).longValue()));
+			buffer.append(fieldSeparator);
+			buffer.append(String.format("%9d",
+					Double.valueOf(taskStats.getFlowTime()).longValue()));
+			buffer.append(fieldSeparator);
+			buffer.append(String.format("%12d",
+					Double.valueOf(taskStats.getWaitingTime()).longValue()));
+			buffer.append(fieldSeparator);
+			buffer.append(String.format("%15d",
+					Double.valueOf(taskStats.getGQ_WaitingTime()).longValue()));
+			buffer.append(fieldSeparator);
+			buffer.append(String.format("%9d",
+					Double.valueOf(taskStats.getLateness()).longValue()));
+			buffer.append(fieldSeparator);
+			buffer.append(String.format("%10d",
+					Double.valueOf(taskStats.getTardiness()).longValue()));
+			buffer.append(fieldSeparator);
+			buffer.append(String.format("%16d",
+					Double.valueOf(taskStats.getReservationStartDate())
+							.longValue()));
+			buffer.append(fieldSeparator);
+			buffer.append(String.format("%17d",
+					Double.valueOf(taskStats.getReservationFinishDate())
+							.longValue()));
+			buffer.append(fieldSeparator);
+			buffer.append(String.format("%-17s", taskStats.getProcessorsName()));
+			buffer.append(fieldSeparator);
+
+		}
+
+		return buffer.toString();
+	}
+
+	public String visit(JobStats jobStats) {
+
+		StringBuffer buffer = null;
+
+		if(printedHeaders.add("jobStats")) {
+			buffer = new StringBuffer(200);
+			String[] headers = jobStats.getHeaders();
+			if (headers.length == 10) {
+
+				buffer.append(String.format("%5s", headers[0]));
+				buffer.append(fieldSeparator);
+				buffer.append(String.format("%23s", headers[1]));
+				buffer.append(fieldSeparator);
+				buffer.append(String.format("%22s", headers[2]));
+				buffer.append(fieldSeparator);
+				buffer.append(String.format("%18s", headers[3]));
+				buffer.append(fieldSeparator);
+				buffer.append(String.format("%17s", headers[4]));
+				buffer.append(fieldSeparator);
+				buffer.append(String.format("%20s", headers[5]));
+				buffer.append(fieldSeparator);
+				buffer.append(String.format("%23s", headers[6]));
+				buffer.append(fieldSeparator);
+				buffer.append(String.format("%9s", headers[7]));
+				buffer.append(fieldSeparator);
+				buffer.append(String.format("%10s", headers[8]));
+				buffer.append(fieldSeparator);
+				buffer.append(String.format("%9s", headers[9]));
+				buffer.append(fieldSeparator);
+
+			} else {
+				buffer.append(headers.toString());
+			}
+			buffer.append(System.getProperty("line.separator"));
+		} else {
+			buffer = new StringBuffer(100);
+		}
+
+		buffer.append(String.format("%5s", jobStats.getJobID()));
+		buffer.append(fieldSeparator);
+		buffer.append(String.format("%23s", defaultNumberFormat.format(jobStats
+				.getMeanTaskCompletionTime().getMean())));
+		buffer.append(fieldSeparator);
+		buffer.append(String.format("%22s", defaultNumberFormat.format(jobStats
+				.getMeanTaskExecutionTime().getMean())));
+		buffer.append(fieldSeparator);
+		buffer.append(String.format("%18s", defaultNumberFormat.format(jobStats
+				.getMeanTaskStartTime().getMean())));
+		buffer.append(fieldSeparator);
+		buffer.append(String.format("%17s", defaultNumberFormat.format(jobStats
+				.getMeanTaskFlowTime().getMean())));
+		buffer.append(fieldSeparator);
+		buffer.append(String.format("%20s", defaultNumberFormat.format(jobStats
+				.getMeanTaskWaitingTime().getMean())));
+		buffer.append(fieldSeparator);
+		buffer.append(String.format("%23s", defaultNumberFormat.format(jobStats
+				.getMeanTaskGQ_WaitingTime().getMean())));
+		buffer.append(fieldSeparator);
+		buffer.append(String.format("%9s",
+				defaultNumberFormat.format(jobStats.getTardiness().getMean())));
+		buffer.append(fieldSeparator);
+		buffer.append(String.format("%10s",
+				defaultNumberFormat.format(jobStats.getLateness().getMean())));
+		buffer.append(fieldSeparator);
+		buffer.append(String.format("%9s",
+				defaultNumberFormat.format(jobStats.getMakespan().getMean())));
+		buffer.append(fieldSeparator);
+
+		return buffer.toString();
+	}
+
+	public String visit(ResourceStats resourceStats) {
+
+		StringBuffer buffer = null;
+
+		if(printedHeaders.add("resourceStats")) {
+			buffer = new StringBuffer(600);
+			String[] headers = resourceStats.getHeaders();
+			if (headers.length == 7) {
+
+				buffer.append(String.format("%-20s", headers[0]));
+				buffer.append(fieldSeparator);
+				buffer.append(String.format("%6s", headers[1]));
+				buffer.append(fieldSeparator);
+				buffer.append(String.format("%3s", headers[2]));
+				buffer.append(fieldSeparator);
+				buffer.append(String.format("%9s", headers[3]));
+				buffer.append(fieldSeparator);
+				buffer.append(String.format("%12s", headers[4]));
+				buffer.append(fieldSeparator);
+				buffer.append(String.format("%-120s", headers[5]));
+				buffer.append(fieldSeparator);
+				buffer.append(String.format("%-120s", headers[6]));
+				buffer.append(fieldSeparator);
+			} else {
+				buffer.append(headers.toString());
+			}
+			buffer.append(System.getProperty("line.separator"));
+		} else {
+			buffer = new StringBuffer(300);
+		}
+
+		buffer.append(String.format("%-20s", resourceStats.getResourceName()));
+		buffer.append(fieldSeparator);
+
+		buffer.append(String.format("%6d", resourceStats.getMemory()));
+		buffer.append(fieldSeparator);
+
+		buffer.append(String.format("%3d", resourceStats.getCpucnt()));
+		buffer.append(fieldSeparator);
+
+		buffer.append(String.format("%9d", resourceStats.getCpuspeed()));
+		buffer.append(fieldSeparator);
+
+		buffer.append(String.format("%-12s",
+				DataCenterWorkloadSimulator.DFAULT_NUMBER_FORMAT
+						.format(resourceStats.getQueueLength())));
+		buffer.append(fieldSeparator);
+
+		StringBuffer tempBuffer = new StringBuffer();
+		
+		/*Map<String, Double> processorsLoad = resourceStats.getProcessorsLoad();
+		for (String processorName : processorsLoad.keySet()) {
+
+			Double load = processorsLoad.get(processorName);
+			tempBuffer.append(String.format("%-12s", processorName));
+			tempBuffer.append(" ");
+			tempBuffer.append(String.format("%-5s", GridSchedulingSimulator.DFAULT_NUMBER_FORMAT
+					.format(load)));
+			tempBuffer.append(": ");
+
+		}*/
+		
+		buffer.append(String.format("%-120s", tempBuffer.toString()));
+		buffer.append(fieldSeparator);
+		
+		tempBuffer = new StringBuffer();
+		
+		Map<String, Double> processorsReservationLoad = resourceStats
+				.getProcessorsReservationLoad();
+		for (String processorName : processorsReservationLoad.keySet()) {
+
+			Double reservationLoad = processorsReservationLoad
+					.get(processorName);
+			tempBuffer.append(String.format("%-12s", processorName));
+			tempBuffer.append(" ");
+			tempBuffer.append(String.format("%-5s", DataCenterWorkloadSimulator.DFAULT_NUMBER_FORMAT
+					.format(reservationLoad)));
+			tempBuffer.append(": ");
+		}
+		buffer.append(String.format("%-120s", tempBuffer.toString()));
+		buffer.append(fieldSeparator);
+		return buffer.toString();
+	}
+
+	public String visit(AccumulatedResourceStats accResStats) {
+
+		StringBuffer buffer = null;
+
+		if(printedHeaders.add("accResStats")) {
+			buffer = new StringBuffer(340);
+			String[] headers = accResStats.getHeaders();
+			if (headers.length == 9) {
+
+				buffer.append(String.format("%-27s", headers[0]));
+				buffer.append(fieldSeparator);
+				buffer.append(String.format("%-27s", headers[1]));
+				buffer.append(fieldSeparator);
+				buffer.append(String.format("%16s", headers[2]));
+				buffer.append(fieldSeparator);
+				buffer.append(String.format("%16s", headers[3]));
+				buffer.append(fieldSeparator);
+				buffer.append(String.format("%16s", headers[4]));
+				buffer.append(fieldSeparator);
+				buffer.append(String.format("%16s", headers[5]));
+				buffer.append(fieldSeparator);
+				buffer.append(String.format("%16s", headers[6]));
+				buffer.append(fieldSeparator);
+				buffer.append(String.format("%16s", headers[7]));
+				buffer.append(fieldSeparator);
+				buffer.append(String.format("%16s", headers[8]));
+				buffer.append(fieldSeparator);
+			} else {
+				buffer.append(headers.toString());
+			}
+			buffer.append(System.getProperty("line.separator"));
+		} else {
+			buffer = new StringBuffer(170);
+		}
+
+		buffer.append(String.format("%-27s", accResStats.getResourceName()));
+		buffer.append(fieldSeparator);
+		buffer.append(String.format("%-27s", "load"));
+		buffer.append(accResStats.getResourceLoad().toFormatedString());
+		buffer.append(System.getProperty("line.separator"));
+		buffer.append(String.format("%-27s", accResStats.getResourceName()));
+		buffer.append(fieldSeparator);
+		buffer.append(String.format("%-27s", "reservationload"));
+		buffer.append(accResStats.getResourceReservationLoad()
+				.toFormatedString());
+		buffer.append(System.getProperty("line.separator"));
+
+		return buffer.toString();
+	}
+
+	public Object visit(ResourceUsageStats resourceUsageStats) {
+		Map<Long, Integer> resourceUsage = resourceUsageStats.getUsage();
+
+		int mapSize = resourceUsage.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 * resourceUsage.size();
+
+		StringBuffer buffer = null;
+
+		if(printedHeaders.add(resourceUsageStats.getResourceType().getName())) {
+			buffer = new StringBuffer(size + 42);
+			String[] headers = resourceUsageStats.getHeaders();
+			if (headers.length == 3) {
+
+				buffer.append(String.format("%-20s", headers[0]));
+				buffer.append(fieldSeparator);
+				buffer.append(String.format("%15s", headers[1]));
+				buffer.append(fieldSeparator);
+				buffer.append(String.format("%5s", headers[2]));
+				buffer.append(fieldSeparator);
+
+			} else {
+				buffer.append(headers.toString());
+			}
+			buffer.append(System.getProperty("line.separator"));
+		} else {
+			buffer = new StringBuffer(size);
+		}
+
+		for (Long timestamp : resourceUsage.keySet()) {
+
+			buffer.append(String.format("%-20s",
+					resourceUsageStats.getResourceName()));
+			buffer.append(fieldSeparator);
+			Integer value = resourceUsage.get(timestamp);
+			buffer.append(String.format("%15d", timestamp));
+			buffer.append(fieldSeparator);
+			buffer.append(String.format("%5s",
+					DataCenterWorkloadSimulator.DFAULT_NUMBER_FORMAT.format(value)));
+			buffer.append(fieldSeparator);
+			buffer.append(System.getProperty("line.separator"));
+
+		}
+
+		return buffer.toString();
+	}
+
+	
+	public Object visit(GSSAccumulatorsStats accStats) {
+
+		StringBuffer buffer = null;
+
+		if(printedHeaders.add("accStats")) {
+			buffer = new StringBuffer(2800);
+			String[] headers = accStats.getHeaders();
+			if (headers.length == 8) {
+
+				buffer.append(String.format("%-26s", headers[0]));
+				buffer.append(fieldSeparator);
+				buffer.append(String.format("%16s", headers[1]));
+				buffer.append(fieldSeparator);
+				buffer.append(String.format("%16s", headers[2]));
+				buffer.append(fieldSeparator);
+				buffer.append(String.format("%16s", headers[3]));
+				buffer.append(fieldSeparator);
+				buffer.append(String.format("%16s", headers[4]));
+				buffer.append(fieldSeparator);
+				buffer.append(String.format("%16s", headers[5]));
+				buffer.append(fieldSeparator);
+				buffer.append(String.format("%16s", headers[6]));
+				buffer.append(fieldSeparator);
+				buffer.append(String.format("%16s", headers[7]));
+				buffer.append(fieldSeparator);
+			} else {
+				buffer.append(headers.toString());
+			}
+			buffer.append(System.getProperty("line.separator"));
+		} else {
+			buffer = new StringBuffer(1400);
+		}
+
+		buffer.append(String.format("%-26s", "Delayed tasks"));
+		buffer.append(accStats.delayedTasks.toFormatedString());
+		buffer.append(System.getProperty("line.separator"));
+		buffer.append(String.format("%-26s", "Failed requests (tasks)"));
+		buffer.append(accStats.failedRequests.toFormatedString());
+		buffer.append(System.getProperty("line.separator"));
+		buffer.append(String.format("%-26s", "Makespan"));
+		buffer.append(accStats.makespan.toFormatedString());
+		buffer.append(System.getProperty("line.separator"));
+		buffer.append(String.format("%-26s", "Resources queue length"));
+		buffer.append(accStats.meanQueueLength.toFormatedString());
+		buffer.append(System.getProperty("line.separator"));
+		buffer.append(String.format("%-26s", "Resources total load"));
+		buffer.append(accStats.meanTotalLoad.toFormatedString());
+		buffer.append(System.getProperty("line.separator"));
+		buffer.append(String.format("%-26s", "Resources reservation load"));
+		buffer.append(accStats.meanReservationLoad.toFormatedString());
+		buffer.append(System.getProperty("line.separator"));
+		buffer.append(String.format("%-26s", "Energy usage"));
+		buffer.append(accStats.meanEnergyUsage.toFormatedString());
+		buffer.append(System.getProperty("line.separator"));
+		buffer.append(String.format("%-26s", "Task completion time"));
+		buffer.append(accStats.meanTaskCompletionTime.toFormatedString());
+		buffer.append(System.getProperty("line.separator"));
+		buffer.append(String.format("%-26s", "Task execution time"));
+		buffer.append(accStats.meanTaskExecutionTime.toFormatedString());
+		buffer.append(System.getProperty("line.separator"));
+		buffer.append(String.format("%-26s", "Task start time"));
+		buffer.append(accStats.meanTaskStartTime.toFormatedString());
+		buffer.append(System.getProperty("line.separator"));
+		buffer.append(String.format("%-26s", "Task flow time"));
+		buffer.append(accStats.meanTaskFlowTime.toFormatedString());
+		buffer.append(System.getProperty("line.separator"));
+		buffer.append(String.format("%-26s", "Task waiting time"));
+		buffer.append(accStats.meanTaskWaitingTime.toFormatedString());
+		buffer.append(System.getProperty("line.separator"));
+		buffer.append(String.format("%-26s", "Task lateness"));
+		buffer.append(accStats.lateness.toFormatedString());
+		buffer.append(System.getProperty("line.separator"));
+		buffer.append(String.format("%-26s", "Task tardiness"));
+		buffer.append(accStats.tardiness.toFormatedString());
+
+		return buffer.toString();
+
+	}
+
+	public Object visit(ResourceEnergyStats resourceEnergyStats) {
+		Map<Long, Double> resourceEnergy = resourceEnergyStats.getEnergy();
+		
+		int mapSize = resourceEnergy.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 * resourceEnergy.size();
+		
+		StringBuffer buffer = null;
+
+		if(printedHeaders.add(resourceEnergyStats.getUsageType())) {
+			buffer = new StringBuffer(size + 42);
+			String[] headers = resourceEnergyStats.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 : resourceEnergy.keySet()) {
+			
+			buffer.append(resourceEnergyStats.getResourceName());
+			buffer.append(fieldSeparator);
+			Double value = resourceEnergy.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"));
+
+		}
+		buffer.append("mean: "+resourceEnergyStats.getMeanUsage() + " sum: " +resourceEnergyStats.getSumUsage());
+		buffer.append(System.getProperty("line.separator"));
+
+		return buffer.toString();
+	}
+}
Index: DCWoRMS/trunk/build/classes/simulator/stats/implementation/out/AbstractStringSerializer.java
===================================================================
--- DCWoRMS/trunk/build/classes/simulator/stats/implementation/out/AbstractStringSerializer.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/simulator/stats/implementation/out/AbstractStringSerializer.java	(revision 477)
@@ -0,0 +1,25 @@
+package simulator.stats.implementation.out;
+
+import java.text.NumberFormat;
+import java.util.HashSet;
+import java.util.Set;
+
+public abstract class AbstractStringSerializer implements StatsSerializer {
+	
+	protected boolean useExtended = true;
+	protected String fieldSeparator = ";";
+	protected NumberFormat defaultNumberFormat;
+	protected Set<String> printedHeaders = new HashSet<String>();
+	
+	public void useExtendedOutput(boolean arg){
+		this.useExtended = arg;
+	}
+	
+	public void setFieldSeparator(String separator){
+		this.fieldSeparator = separator;
+	}
+	
+	public void setDefaultNumberFormat(NumberFormat value){
+		this.defaultNumberFormat = value;
+	}
+}
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 477)
@@ -0,0 +1,33 @@
+package simulator.stats.implementation.out;
+
+import simulator.stats.implementation.AccumulatedResourceStats;
+import simulator.stats.implementation.GSSAccumulatorsStats;
+import simulator.stats.implementation.JobStats;
+import simulator.stats.implementation.ResourceEnergyStats;
+import simulator.stats.implementation.ResourceStats;
+import simulator.stats.implementation.ResourceUsageStats;
+import simulator.stats.implementation.TaskStats;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+public interface StatsSerializer {
+
+	public Object visit(TaskStats arg);
+	
+	public Object visit(JobStats arg);
+	
+	public Object visit(ResourceStats arg);
+	
+	public Object visit(AccumulatedResourceStats arg);
+	
+	public Object visit(ResourceUsageStats arg);
+	
+	public Object visit(ResourceEnergyStats arg);
+
+	
+	public Object visit(GSSAccumulatorsStats arg);
+	
+}
Index: DCWoRMS/trunk/build/classes/simulator/stats/implementation/JobStats.java
===================================================================
--- DCWoRMS/trunk/build/classes/simulator/stats/implementation/JobStats.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/simulator/stats/implementation/JobStats.java	(revision 477)
@@ -0,0 +1,95 @@
+package simulator.stats.implementation;
+
+import java.io.PrintStream;
+
+import simulator.stats.GSSAccumulator;
+import simulator.stats.implementation.out.StatsSerializer;
+
+/**
+ * 
+ * @author Marcin Krystek
+ * 
+ */
+public class JobStats implements StatsInterface {
+
+	protected String jobID;
+	protected GSSAccumulator meanTaskCompletionTime;
+	protected GSSAccumulator meanTaskExecutionTime;
+	protected GSSAccumulator meanTaskStartTime;
+	protected GSSAccumulator meanTaskFlowTime;
+	protected GSSAccumulator meanTaskWaitingTime;
+	protected GSSAccumulator meanTaskGQ_WaitingTime;
+	protected GSSAccumulator lateness;
+	protected GSSAccumulator tardiness;
+	protected GSSAccumulator makespan;
+
+	JobStats(String jobID) {
+		this.jobID = jobID;
+		init();
+	}
+
+	private String[] headers = { "jobID", "meanTaskCompletionTime",
+			"meanTaskExecutionTime", "meanTaskStartTime", "meanTaskFlowTime",
+			"meanTaskWaitingTime", "meanTaskGQ_WaitingTime", "lateness",
+			"tardiness", "makespan" };
+
+	private void init() {
+		this.meanTaskCompletionTime = new GSSAccumulator();
+		this.meanTaskExecutionTime = new GSSAccumulator();
+		this.meanTaskStartTime = new GSSAccumulator();
+		this.meanTaskFlowTime = new GSSAccumulator();
+		this.meanTaskWaitingTime = new GSSAccumulator();
+		this.meanTaskGQ_WaitingTime = new GSSAccumulator();
+		this.lateness = new GSSAccumulator();
+		this.tardiness = new GSSAccumulator();
+		this.makespan = new GSSAccumulator();
+	}
+
+	public String getJobID() {
+		return jobID;
+	}
+
+	public GSSAccumulator getMeanTaskCompletionTime() {
+		return meanTaskCompletionTime;
+	}
+
+	public GSSAccumulator getMeanTaskExecutionTime() {
+		return meanTaskExecutionTime;
+	}
+
+	public GSSAccumulator getMeanTaskStartTime() {
+		return meanTaskStartTime;
+	}
+
+	public GSSAccumulator getMeanTaskFlowTime() {
+		return meanTaskFlowTime;
+	}
+
+	public GSSAccumulator getMeanTaskWaitingTime() {
+		return meanTaskWaitingTime;
+	}
+
+	public GSSAccumulator getMeanTaskGQ_WaitingTime() {
+		return meanTaskGQ_WaitingTime;
+	}
+
+	public GSSAccumulator getLateness() {
+		return lateness;
+	}
+
+	public GSSAccumulator getTardiness() {
+		return tardiness;
+	}
+
+	public GSSAccumulator getMakespan() {
+		return makespan;
+	}
+
+	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 477)
@@ -0,0 +1,65 @@
+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 {
+
+	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" };
+
+	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;
+	}
+
+	public Object serialize(StatsSerializer serializer) {
+		return serializer.visit(this);
+	}
+
+	public String[] getHeaders() {
+		return headers;
+	}
+
+}
Index: DCWoRMS/trunk/build/classes/simulator/stats/implementation/GSSimStatistics.java
===================================================================
--- DCWoRMS/trunk/build/classes/simulator/stats/implementation/GSSimStatistics.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/simulator/stats/implementation/GSSimStatistics.java	(revision 477)
@@ -0,0 +1,1443 @@
+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.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.DateTime;
+import org.joda.time.DateTimeUtilsExt;
+
+import schedframe.ResourceController;
+import schedframe.exceptions.ResourceException;
+import schedframe.resources.ResourceType;
+import schedframe.resources.StandardResourceType;
+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.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.JobRegistryImpl;
+import schedframe.scheduling.tasks.Job;
+import schedframe.scheduling.tasks.JobInterface;
+import simulator.ConfigurationOptions;
+import simulator.DataCenterWorkloadSimulator;
+import simulator.GenericUser;
+import simulator.WormsConstants;
+import simulator.stats.GSSAccumulator;
+import simulator.stats.SimulationStatistics;
+import simulator.stats.implementation.out.AbstractStringSerializer;
+import simulator.stats.implementation.out.FormatedStringSerializer;
+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 eduni.simjava.Sim_stat;
+import gssim.schedframe.scheduling.ExecTask;
+import gssim.schedframe.scheduling.Executable;
+
+public class GSSimStatistics implements SimulationStatistics {
+
+	private Log log = LogFactory.getLog(GSSimStatistics.class);
+
+	protected static float ALPHA = 0.5f;
+	protected static int GANTT_WIDTH = 1200;
+
+	//protected static final int BITS = 8;
+	//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 ENERGYUSAGE_STATISTICS_OUTPUT_FILE_NAME = "Energy.txt";
+	protected static final String RESOURCEUSAGE_STATISTICS_OUTPUT_FILE_NAME = "ResourceUtilization.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;
+	
+	private GenericUser users;
+	protected ResourceController resourceController;
+	protected boolean generateDiagrams = true;
+	protected AbstractStringSerializer serializer;
+	protected long startSimulationTime;
+	protected long endSimulationTime;
+	
+	
+	//RESOURCES
+	protected Timetable ganttDiagramPeTimetable;
+	protected Map<ResourceType, List<XYDataset>> resourceEnergyDiagrams;
+	protected Map<ResourceType, List<XYDataset>> resourceLoadDiagrams;
+	protected Map<String,List<ResStat>> basicResStats;
+	protected HashMap<String, Double> basicResLoad;
+	
+	protected Map<String, TimetableEventSource> peGanttMap;
+	protected Map<String, TimetableEventGroup> taskGanttMap;
+	
+	
+	//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 JobRegistryImpl jr;
+
+	
+	public GSSimStatistics(String simulationIdentifier, ConfigurationOptions co, GenericUser users,
+			String outputFolderName, ResourceController resourceController) {
+		this.simulationIdentifier = simulationIdentifier;
+		this.configuration = co;
+		this.users = users;
+
+		this.outputFolderName = outputFolderName;
+
+		if (this.configuration.formatstatisticsoutput)
+			this.serializer = new FormatedStringSerializer();
+		else
+			this.serializer = new StringSerializer();
+
+		this.serializer.setDefaultNumberFormat(DataCenterWorkloadSimulator.DFAULT_NUMBER_FORMAT);
+
+		this.resourceController = resourceController;
+		 jr = new JobRegistryImpl("COMPUTING_GRID_0#BROKER");
+		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) / 1000));
+		
+		log.info("gatherTaskStatistics");
+		s = System.currentTimeMillis();
+		gatherTaskStatistics();
+		e = System.currentTimeMillis();
+		log.info("time in sec: " + ((e - s) / 1000));
+
+		log.info("saveSimulationStatistics");
+		s = System.currentTimeMillis();
+		saveSimulationStatistics();
+		e = System.currentTimeMillis();
+		log.info("time in sec: " + ((e - s) / 1000));
+	}
+
+
+	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() {
+		
+		
+		//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);
+		
+		
+		
+		peGanttMap = new HashMap<String, TimetableEventSource>();
+		taskGanttMap = new HashMap<String, TimetableEventGroup>();
+		
+		
+		resourceLoadDiagrams = new HashMap<ResourceType, List<XYDataset>>();
+		resourceEnergyDiagrams = new HashMap<ResourceType, List<XYDataset>>();
+		
+		ganttDiagramPeTimetable = new Timetable(new FixedMillisecond(
+				startSimulationTime), new FixedMillisecond(endSimulationTime));
+		
+		PrintStream resourceLoadStatsFile = null;
+		try {
+			File file = new File(outputFolderName + STATS_FILE_NAME_PREFIX
+					+ simulationIdentifier + "_"
+					+ RESOURCEUSAGE_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;
+		}
+		
+		basicResStats = gatherPEStats(JobRegistryImpl.getAllocationHistory());
+		peStatsPostProcessing(basicResStats);
+		basicResLoad = calculatePELoad( basicResStats);
+
+		if (configuration.creatediagrams_processors) {
+			createPEGanttDiagram(basicResStats);
+		}
+		
+		for(StandardResourceType resType: resForAnalyze){
+			List<ComputingResource> resources = null;
+			try {
+				resources = new ArrayList<ComputingResource>();
+				for(ComputingResource compRes: resourceController.getComputingResources() ){
+					resources.addAll(compRes.getDescendantsByType(resType));
+				}
+			} catch (Exception e) {
+				continue;
+			}
+			if(type_stats.containsKey(resType)){
+				Map<String, GSSAccumulator> energyCategoryStats = new TreeMap<String, GSSAccumulator>();
+				Map<String, GSSAccumulator> loadCategoryStats = new TreeMap<String, GSSAccumulator>();
+				for(ComputingResource resource: resources){
+					ResourceUsageStats resourceUsage = null;
+					ResourceEnergyStats energyUsage = null;
+					if(type_stats.get(resType).contains(Stats.textLoad)){
+						resourceUsage = gatherResourceLoadStats(resource, basicResStats);
+						resourceUsage.setMeanUsage(calculateResourceLoad(resource, basicResLoad));
+						if (resourceLoadStatsFile != null) {
+							Object txt = resourceUsage.serialize(serializer);
+							resourceLoadStatsFile.println(txt);
+						}
+					}
+					if(type_stats.get(resType).contains(Stats.chartLoad)){
+						if (configuration.creatediagrams_resources) {
+							createResourceLoadDiagram(resourceUsage);
+						}
+					}
+					if(type_stats.get(resType).contains(Stats.textEnergy)){
+						energyUsage = gatherResourceEnergyStats(resource);
+						energyUsage.setMeanUsage(calculateEnergyLoad(energyUsage));
+						energyUsage.setSumUsage(energyUsage.getMeanUsage() * (endSimulationTime - startSimulationTime) / (3600 * 1000));
+						
+						EnergyExtension een = (EnergyExtension )(resource.getExtensionList().getExtension(ExtensionType.ENERGY_EXTENSION));
+						if(resourceController.getComputingResources().contains(resource)) {
+							if( een != null /*&& een.getPp() != null*/ ){
+								accStats.meanEnergyUsage.add(energyUsage.meanUsage);
+							}
+
+						} 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.meanUsage);
+							}
+						}
+						if (energyStatsFile != null) {
+							Object txt = energyUsage.serialize(serializer);
+							energyStatsFile.println(txt);
+						}
+					}
+					if(type_stats.get(resType).contains(Stats.chartEnergy)){
+
+						if (configuration.creatediagrams_energyusage) {
+							createResourceEnergyGanttDiagram(energyUsage);
+						}
+					}
+					
+					/*if(resType == ResourceType.ComputingNode){
+						ComputingNode compNode = (ComputingNode) resource;
+						if(energyCategoryStats.containsKey(resType+"#"+compNode.getCategory().getName())){
+							GSSAccumulator acc = energyCategoryStats.get(resType+"#"+compNode.getCategory().getName());
+							acc.add(energyUsage.meanUsage);
+							energyCategoryStats.put(resType+"#"+compNode.getCategory().getName(), acc);
+						} else{
+							GSSAccumulator acc = new GSSAccumulator();
+							acc.add(energyUsage.meanUsage);
+							energyCategoryStats.put(resType+"#"+compNode.getCategory().getName(), acc);
+						}
+						
+						if(loadCategoryStats.containsKey(resType+"#"+compNode.getCategory().getName())){
+							GSSAccumulator acc = loadCategoryStats.get(resType+"#"+compNode.getCategory().getName());
+							acc.add(resourceUsage.meanUsage);
+							loadCategoryStats.put(resType+"#"+compNode.getCategory().getName(), acc);
+						} else{
+							GSSAccumulator acc = new GSSAccumulator();
+							acc.add(resourceUsage.meanUsage);
+							loadCategoryStats.put(resType+"#"+compNode.getCategory().getName(), acc);
+						}
+					} else if(resType == ResourceType.Processor){
+						Processor proc = (Processor)resource;
+						if(energyCategoryStats.containsKey(resType+"#"+proc.getComputingNode().getCategory().getName())){
+							GSSAccumulator acc = energyCategoryStats.get(resType+"#"+proc.getComputingNode().getCategory().getName());
+							acc.add(energyUsage.meanUsage);
+							energyCategoryStats.put(resType+"#"+proc.getComputingNode().getCategory().getName(), acc);
+						} else{
+							GSSAccumulator acc = new GSSAccumulator();
+							acc.add(energyUsage.meanUsage);
+							energyCategoryStats.put(resType+"#"+proc.getComputingNode().getCategory().getName(), acc);
+						}
+						
+						if(loadCategoryStats.containsKey(resType+"#"+proc.getComputingNode().getCategory().getName())){
+							GSSAccumulator acc = loadCategoryStats.get(resType+"#"+proc.getComputingNode().getCategory().getName());
+							acc.add(resourceUsage.meanUsage);
+							loadCategoryStats.put(resType+"#"+proc.getComputingNode().getCategory().getName(), acc);
+						} else{
+							GSSAccumulator acc = new GSSAccumulator();
+							acc.add(resourceUsage.meanUsage);
+							loadCategoryStats.put(resType+"#"+proc.getComputingNode().getCategory().getName(), acc);
+						}
+					}*/
+				}
+				
+				if(energyCategoryStats.size() > 0)
+				{
+					energyStatsFile.println("\n=========BY CATEGORY===========");
+					for(String key: energyCategoryStats.keySet()){
+						GSSAccumulator acc = energyCategoryStats.get(key);
+						energyStatsFile.println(key + "- mean: "  + acc.getMean()+ " sum: " +acc.getMean() * (endSimulationTime-startSimulationTime) / (3600 * 1000) * acc.getCount());
+					}
+					energyStatsFile.println("\n\n");
+				}
+				
+				if(loadCategoryStats.size() > 0)
+				{
+					resourceLoadStatsFile.println("\n=========BY CATEGORY===========");
+					for(String key: loadCategoryStats.keySet()){
+						GSSAccumulator acc = loadCategoryStats.get(key);
+						resourceLoadStatsFile.println(key + "- mean: "  + acc.getMean());
+					}
+					resourceLoadStatsFile.println("\n\n");
+				}
+			}
+		}
+		
+		saveResourceGanttDiagrams();
+		createAccumulatedResourceSimulationStatistic();
+		if (energyStatsFile != null) {
+			energyStatsFile.close();
+		}
+		if (resourceLoadStatsFile != null) {
+			resourceLoadStatsFile.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(WormsConstants.TASKS_QUEUE_LENGTH_MEASURE_NAME)) {
+				return stats.average(measure);
+			}
+		}
+		return 0;
+	}
+	
+	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(Map<Integer, Map<String, Object>> history) {
+
+		Map<String, List<ResStat>> basicResStats = new TreeMap<String, List<ResStat>>(new MapPEIdComparator());
+		
+		for (Integer executableId : history.keySet()) {
+
+			Map<String, Object> historyItem = (Map<String, Object>) history.get(executableId);
+			List<ResourceHistoryItem> resHistItemList = (List<ResourceHistoryItem>) historyItem.get(WormsConstants.RESOURCES);
+			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 = ((DateTime) historyItem.get(WormsConstants.START_TIME)).getMillis();
+					long endDate = ((DateTime) historyItem.get(WormsConstants.END_TIME)).getMillis();
+					JobRegistryImpl jr = new JobRegistryImpl("stats");
+					ExecTask execTask = jr.getTaskExecutable(executableId);
+					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");
+		for(String resName: basicStats.keySet()){
+			try {
+				if(resource.getDescendantByName(resName) != null || resource.getName().compareTo(resName) == 0){
+					createResourceLoadData(usageStats, basicStats.get(resName));
+				}
+			} catch (ResourceException e) {
+				// TODO Auto-generated catch block
+				e.printStackTrace();
+			}
+		}
+		return usageStats;
+	}
+	
+	private TreeMap<Long, Integer> createResourceLoadData(ResourceUsageStats usageStats, List<ResStat> resStats) {
+
+		TreeMap<Long, Integer> ganttData = (TreeMap)usageStats.getUsage();
+		for (ResStat resStat : resStats) {
+			
+			long start_time = resStat.getStartDate();
+			long end_time = resStat.getEndDate();
+			if (end_time > start_time) {
+				Integer end = ganttData.get(end_time);
+				if (end == null) {
+					ganttData.put(end_time, 0);
+					Long left = getLeftKey(ganttData, end_time);
+					if (left != null) {
+						Integer leftValue = ganttData.get(left);
+						ganttData.put(end_time, leftValue);
+					}
+				}
+
+				Integer start = ganttData.get(start_time);
+				if (start == null) {
+					ganttData.put(start_time, 0);
+					Long left = getLeftKey(ganttData, start_time);
+					if (left != null) {
+						Integer leftValue = ganttData.get(left);
+						ganttData.put(start_time, leftValue);
+					}
+				}
+
+				SortedMap<Long, Integer> sm = ganttData.subMap(start_time,
+						end_time);
+				for (Long key : sm.keySet()) {
+					Integer keyVal = ganttData.get(key);
+					ganttData.put(key, keyVal + 1);
+				}
+			}
+		}
+		return ganttData;
+	}
+
+	private Long getLeftKey(TreeMap<Long, Integer> ganttData, Long toKey) {
+
+		SortedMap<Long, Integer> sm = ganttData.headMap(toKey);
+		if (sm.isEmpty()) {
+			return null;
+		}
+		return sm.lastKey();
+	}
+	
+	
+	private ResourceEnergyStats gatherResourceEnergyStats(ComputingResource resource) {
+		double power = 0;
+		ResourceEnergyStats resEnergyUsage = new ResourceEnergyStats(resource.getName(), resource.getType(), "resourceEnergyStats");
+		Map<Long, Double> usage = resEnergyUsage.getEnergy();
+		
+		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 * 1000);
+						lastPower = pu.getValue();
+						lastTime = pu.getTimestamp();
+					}
+				}
+			}
+		}
+		//System.out.println(power);
+		return resEnergyUsage;
+	}
+	
+	private void createResourceEnergyGanttDiagram(ResourceEnergyStats energyUsage) {
+
+		XYDataset dataset = createResourceEnergyGanttDataSet(energyUsage,
+				startSimulationTime, endSimulationTime);
+		
+		List<XYDataset> energyDiagram = resourceEnergyDiagrams.get(energyUsage.getResourceType());
+		if(energyDiagram == null){
+			energyDiagram = new ArrayList<XYDataset>();
+			energyDiagram.add(dataset);
+			resourceEnergyDiagrams.put(energyUsage.getResourceType(), energyDiagram);
+		} else {
+			energyDiagram.add(dataset);
+		}
+
+	}
+
+	private XYDataset createResourceEnergyGanttDataSet(
+			ResourceEnergyStats energyUsage, long start, long end) {
+
+		TreeMap<Long, Double> ganttdata = createResourceEnergyGanttData(energyUsage);
+		XYSeriesCollection dataset = new XYSeriesCollection();
+		XYSeries data = new XYSeries(energyUsage.getResourceName(), false, true);
+		//data.add(start, 0);
+		for (Long key : ganttdata.keySet()) {
+			Double val = ganttdata.get(key);
+			data.add(key, val);
+		}
+		data.add(end, 0);
+		dataset.addSeries(data);
+		return dataset;
+	}
+
+	private TreeMap<Long, Double> createResourceEnergyGanttData(
+			ResourceEnergyStats energyUsage) {
+
+		Map<Long, Double> energy = energyUsage.getEnergy();
+		TreeMap<Long, Double> ganttData = new TreeMap<Long, Double>();
+		for (Long euKey : energy.keySet()) {
+
+			ganttData.put(euKey, energy.get(euKey));
+		}
+		return ganttData;
+	}
+
+
+	private boolean saveResourceGanttDiagrams() {
+		JFreeChart resourceDiagram = null;
+		JFreeChart peDiagram = null;
+		JFreeChart resourceEnergyDiagram = 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_processors) {
+			peDiagram = getPeGanttDiagram(chartName, subtitle,
+					simulationTime);
+			if (!saveCategoryChart(peDiagram, fileName + "Processing_Elements",
+					"{0}"))
+				return false;
+		}
+
+		if (configuration.creatediagrams_resources) {
+			for(ResourceType resType: resourceLoadDiagrams.keySet()){
+				resourceDiagram = getResourcesLoadDiagram(resType, chartName, subtitle,
+						simulationTime);
+				if (!saveXYPlotChart(resourceDiagram, fileName + "Resources Load - "+resType))
+					return false;
+			}
+
+		}
+		if (configuration.creatediagrams_energyusage) {
+			for(ResourceType resType: resourceEnergyDiagrams.keySet()){
+				resourceEnergyDiagram = getResourcesEnergyDiagram(resType, chartName,
+						subtitle, simulationTime);
+				if (!saveXYPlotChart(resourceEnergyDiagram, fileName + "Energy - "+resType))
+					return false;
+			}
+		}
+		return true;
+	}
+	
+	private JFreeChart getResourcesLoadDiagram(ResourceType resType, String chartName, Title subtitle,
+			String simulationTime) {
+		String cpu = "CPU";
+		boolean urls = false;
+		boolean tooltip = true;
+		boolean legend = true;
+		CombinedDomainXYPlot cPlot = new CombinedDomainXYPlot();
+		DateAxis xAxis = new DateAxis(simulationTime);
+		JFreeChart chart = null;
+
+		List<XYDataset> loadDiagram = resourceLoadDiagrams.get(resType);
+		for (XYDataset dataset : loadDiagram) {
+			JFreeChart tChart = ChartFactory.createXYStepAreaChart("", "",
+				null, dataset, PlotOrientation.VERTICAL, legend, tooltip,
+				urls);
+			XYPlot tPlot = tChart.getXYPlot();
+			NumberAxis yAxis = new NumberAxis(cpu);
+			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 JFreeChart getResourcesEnergyDiagram(ResourceType resType, String chartName,
+			Title subtitle, String simulationTime) {
+		String energy = "ENERGY [W]";
+		boolean urls = false;
+		boolean tooltip = true;
+		boolean legend = true;
+		CombinedDomainXYPlot cPlot = new CombinedDomainXYPlot();
+		DateAxis xAxis = new DateAxis(simulationTime);
+
+		List<XYDataset> energyDiagram = resourceEnergyDiagrams.get(resType);
+		for (XYDataset dataset : energyDiagram) {
+
+			JFreeChart tChart = ChartFactory.createXYStepAreaChart("", "",
+					null, dataset, PlotOrientation.VERTICAL, legend, tooltip,
+					urls);
+
+			XYPlot tPlot = tChart.getXYPlot();
+			NumberAxis yAxis = new NumberAxis(energy);
+			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);
+		JFreeChart chart = new JFreeChart(chartName, cPlot);
+		chart.addSubtitle(subtitle);
+		return chart;
+	}
+	
+	
+	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,
+				ganttDiagramPeTimetable, legend, tooltip);
+		chart.addSubtitle(subtitle);
+		TimetableRenderer rend = (TimetableRenderer) chart.getCategoryPlot()
+				.getRenderer();
+		rend.setBackgroundBarPaint(null);
+		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 gssimSubtitle = "Created by "
+				+ DataCenterWorkloadSimulator.SIMULATOR_NAME
+				+ " http://www.gssim.org/";
+		c.addSubtitle(new TextTitle(gssimSubtitle));
+		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);
+			ganttDiagramPeTimetable.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);
+					ganttDiagramPeTimetable.addEventGroup(task);
+				}
+				ganttDiagramPeTimetable.addEvent(pe, task,
+						new FixedMillisecond(startDate), new FixedMillisecond(endDate));
+			}
+		}
+	}
+
+	private void createResourceLoadDiagram(ResourceUsageStats resStats) {
+
+		XYDataset dataset = createResourceLoadDataSet(resStats);
+
+		List<XYDataset> loadDiagram = resourceLoadDiagrams.get(resStats.getResourceType());
+		if(loadDiagram == null){
+			loadDiagram = new ArrayList<XYDataset>();
+			loadDiagram.add(dataset);
+			resourceLoadDiagrams.put(resStats.getResourceType(), loadDiagram);
+		} else {
+			loadDiagram.add(dataset);
+		}
+	}
+
+	private XYDataset createResourceLoadDataSet(ResourceUsageStats resStats) {
+
+		XYSeriesCollection dataset = new XYSeriesCollection();
+		XYSeries data = new XYSeries(resStats.resourceName, false, true);
+		Map<Long, Integer> usage = resStats.getUsage();
+		
+		for (Long key : usage.keySet()) {
+			Integer val = usage.get(key);
+			double newv =100*val/basicResStats.size();
+			int newinv = (int)newv;
+			data.add(key, new Integer(newinv));
+		}
+		dataset.addSeries(data);
+		return dataset;
+	}
+
+	private void createAccumulatedResourceSimulationStatistic() {
+
+		List<ComputingResource> resources = resourceController.getComputingResources();
+		for(ComputingResource compRes: resources){
+			//for(ComputingResource child :compRes.getChildren()){
+				double load = calculateResourceLoad(compRes, basicResLoad);
+				accStats.meanTotalLoad.add(load);
+				/*ResourceEnergyStats energyUsage = gatherResourceEnergyStats(compRes);
+				energyUsage.setMeanUsage(calculateEnergyLoad(energyUsage));
+				accStats.meanEnergyUsage.add(energyUsage.meanUsage);*/
+			//}	
+		}
+	}
+
+	private HashMap<String, Double> calculatePELoad(Map<String,List<ResStat>> basicResStats){
+		HashMap<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, HashMap<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 calculateEnergyLoad(ResourceEnergyStats resEnergyStats ){
+		double meanEnergyUsage = 0;
+		long time = 0;
+		double usage = 0;
+		Map<Long, Double> enUsage = resEnergyStats.getEnergy();
+		for (Long key : enUsage.keySet()) {
+			
+			if (time != 0) {
+				meanEnergyUsage += (usage * (key - time))
+						/ (endSimulationTime - startSimulationTime);
+
+				time = key;
+			} else {
+				time = key;
+			}
+			usage = (double) enUsage.get(key);
+		}
+		return meanEnergyUsage;
+	}
+	
+	/*private void createPEGanttDiagram(String peName,
+			String uniqueTaskID, Map<String, Object> historyItem) {
+		TimetableEventSource pe = peGanttMap.get(peName);
+		if(pe == null){
+			pe = new TimetableEventSource(peName);
+			ganttDiagramPETimetable.addEventSource(pe);
+			peGanttMap.put(peName, pe);
+		}
+		TimetableEventGroup task = taskGanttMap.get(uniqueTaskID);
+		long startDate = ((DateTime) historyItem.get(GssimConstants.START_TIME))
+				.getMillis();
+		long endDate = ((DateTime) historyItem.get(GssimConstants.END_TIME))
+				.getMillis();
+		if (task == null) {
+			task = new TimetableEventGroup(uniqueTaskID);
+			taskGanttMap.put(uniqueTaskID, task);
+			ganttDiagramPETimetable.addEventGroup(task);
+		}
+		ganttDiagramPETimetable.addEvent(pe, task,
+				new FixedMillisecond(startDate), new FixedMillisecond(endDate));
+	}*/
+	
+
+
+	/************* 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<TaskInterface> execList = JobRegistry.getInstance("COMPUTING_GRID_0#BROKER").getAllSubmittedTasks();
+			List<Executable> execList = jr.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 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 resIDlist[] = task.getAllResourceName();
+		String resID = resIDlist[resIDlist.length - 1];
+
+		long execStartTime = Double.valueOf(task.getExecStartTime()).longValue() * 1000;
+		long execEndTime = Double.valueOf(task.getFinishTime()).longValue() * 1000;
+
+		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 resIDlist[] = task.getAllResourceName();
+		String resID = resIDlist[resIDlist.length - 1];
+
+		long execStartTime = Double.valueOf(task.getExecStartTime()).longValue() * 1000;
+		long execEndTime = Double.valueOf(task.getFinishTime()).longValue() * 1000;
+
+		TaskSeries waitRes = ganttDiagramWaitingTimeSeriesCollection.getSeries(resID);
+		if (waitRes == null) {
+			waitRes = new TaskSeries(resID);
+			ganttDiagramWaitingTimeSeriesCollection.add(waitRes);
+		}
+
+		long sub = Double.valueOf(task.getSubmissionTime()).longValue() * 1000;
+		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 gssimSubtitle = "Created by " + DataCenterWorkloadSimulator.SIMULATOR_NAME + " http://www.gssim.org/";
+		c.addSubtitle(new TextTitle(gssimSubtitle));
+		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) {
+			try {
+				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());
+				}
+
+			} catch (NoSuchFieldException e) {
+				e.printStackTrace();
+			}
+			return -1;
+		}
+	}
+	
+	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;
+}
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 477)
@@ -0,0 +1,72 @@
+package simulator.stats.implementation;
+
+import simulator.stats.GSSAccumulator;
+import simulator.stats.implementation.out.StatsSerializer;
+
+public class GSSAccumulatorsStats implements StatsInterface {
+
+	public GSSAccumulator meanTotalLoad;
+	public GSSAccumulator meanReservationLoad;
+	public GSSAccumulator meanQueueLength;
+	public GSSAccumulator meanEnergyUsage;
+
+	public GSSAccumulator meanTaskStartTime;
+	public GSSAccumulator meanTaskCompletionTime;
+	public GSSAccumulator meanTaskExecutionTime;
+	public GSSAccumulator meanTaskWaitingTime;
+	public GSSAccumulator meanTaskFlowTime;
+	public GSSAccumulator lateness;
+	public GSSAccumulator tardiness;
+	public GSSAccumulator delayedTasks;
+	public GSSAccumulator failedRequests;
+	public GSSAccumulator makespan;
+
+	private String[] headers = { "Resource name", "mean", "stdev", "variance",
+			"minimum", "maximum", "sum", "count" };
+
+	public GSSAccumulatorsStats() {
+		meanTotalLoad = new GSSAccumulator();
+		meanReservationLoad = new GSSAccumulator();
+		meanQueueLength = new GSSAccumulator();
+		meanEnergyUsage = new GSSAccumulator();
+
+		meanTaskStartTime = new GSSAccumulator();
+		meanTaskCompletionTime = new GSSAccumulator();
+		meanTaskExecutionTime = new GSSAccumulator();
+		meanTaskWaitingTime = new GSSAccumulator();
+		meanTaskFlowTime = new GSSAccumulator();
+		lateness = new GSSAccumulator();
+		tardiness = new GSSAccumulator();
+		delayedTasks = new GSSAccumulator();
+		failedRequests = new GSSAccumulator();
+		makespan = new GSSAccumulator();
+	}
+
+	/*
+	 * public static String getAcccumulatorHeader() {
+	 * 
+	 * String accumulatorSeparator = ";";
+	 * 
+	 * StringBuffer buffer = new StringBuffer(260);
+	 * 
+	 * buffer.append(header[0]); buffer.append(accumulatorSeparator);
+	 * buffer.append(header[1]); buffer.append(accumulatorSeparator);
+	 * buffer.append(header[2]); buffer.append(accumulatorSeparator);
+	 * buffer.append(header[3]); buffer.append(accumulatorSeparator);
+	 * buffer.append(header[4]); buffer.append(accumulatorSeparator);
+	 * buffer.append(header[5]); buffer.append(accumulatorSeparator);
+	 * buffer.append(header[6]); buffer.append(accumulatorSeparator);
+	 * buffer.append(header[7]); buffer.append(accumulatorSeparator);
+	 * buffer.append(header[8]); buffer.append(accumulatorSeparator);
+	 * 
+	 * return buffer.toString(); }
+	 */
+
+	public Object serialize(StatsSerializer serializer) {
+		return serializer.visit(this);
+	}
+
+	public String[] getHeaders() {
+		return headers;
+	}
+}
Index: DCWoRMS/trunk/build/classes/simulator/stats/StatisticsInfo.java
===================================================================
--- DCWoRMS/trunk/build/classes/simulator/stats/StatisticsInfo.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/simulator/stats/StatisticsInfo.java	(revision 477)
@@ -0,0 +1,54 @@
+package simulator.stats;
+
+
+/**
+ * Gathers the statistics values used internally
+ * @author Stanislaw Szczepanowski
+ */
+public class StatisticsInfo {
+
+	/** The mean value */
+	protected GSSAccumulator mean;
+	/** The standard deviation value */
+	protected GSSAccumulator stdev;
+	/** The minimal value */
+	protected GSSAccumulator max;
+	/** The maximal value */
+	protected GSSAccumulator min;
+	/**
+	 * @param mean
+	 * @param stdev
+	 * @param max
+	 * @param min
+	 */
+	public StatisticsInfo(GSSAccumulator mean, GSSAccumulator stdev, GSSAccumulator max, GSSAccumulator min) {
+		this.mean = mean;
+		this.stdev = stdev;
+		this.max = max;
+		this.min = min;
+	}
+	/**
+	 * @return the maximal value
+	 */
+	public GSSAccumulator getMax() {
+		return max;
+	}
+	/**
+	 * @return the mean value
+	 */
+	public GSSAccumulator getMean() {
+		return mean;
+	}
+	/**
+	 * @return the minimal value
+	 */
+	public GSSAccumulator getMin() {
+		return min;
+	}
+	/**
+	 * @return the standard deviation value
+	 */
+	public GSSAccumulator getStdev() {
+		return stdev;
+	}
+}
Index: DCWoRMS/trunk/build/classes/simulator/utils/workload/StartTimeCalcultor.java
===================================================================
--- DCWoRMS/trunk/build/classes/simulator/utils/workload/StartTimeCalcultor.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/simulator/utils/workload/StartTimeCalcultor.java	(revision 477)
@@ -0,0 +1,21 @@
+package simulator.utils.workload;
+
+import simulator.workload.reader.archive.swf.SWFFields;
+
+public class StartTimeCalcultor implements TaskManagerInterface {
+
+	public String[] manageTask(String[] task) {
+		if(task == null)
+			return null;
+		
+		long submitTime = Long.valueOf(task[SWFFields.DATA_SUBMIT_TIME]);
+		long waitingTime = Long.valueOf(task[SWFFields.DATA_WAIT_TIME]);
+		
+		long sum = submitTime + waitingTime;
+		
+		task[SWFFields.DATA_THINK_TIME_FROM_PRECEDING_JOB] = String.valueOf(sum); 
+		
+		return task;
+	}
+
+}
Index: DCWoRMS/trunk/build/classes/simulator/utils/workload/SubmitTimeNormalizer.java
===================================================================
--- DCWoRMS/trunk/build/classes/simulator/utils/workload/SubmitTimeNormalizer.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/simulator/utils/workload/SubmitTimeNormalizer.java	(revision 477)
@@ -0,0 +1,23 @@
+package simulator.utils.workload;
+
+import simulator.workload.reader.archive.swf.SWFFields;
+
+public class SubmitTimeNormalizer implements TaskManagerInterface{
+
+	protected long submitTimeOffset = Long.MIN_VALUE;
+	
+	public String[] manageTask(String[] task) {
+		if(task == null)
+			return null;
+		
+		if(this.submitTimeOffset == Long.MIN_VALUE) {
+			this.submitTimeOffset = Long.valueOf(task[SWFFields.DATA_SUBMIT_TIME]);
+		}
+		
+		long submitTime = Long.valueOf(task[SWFFields.DATA_SUBMIT_TIME]) - this.submitTimeOffset;
+		task[SWFFields.DATA_SUBMIT_TIME] = String.valueOf(submitTime);
+		
+		return task;
+	}
+
+}
Index: DCWoRMS/trunk/build/classes/simulator/utils/workload/SwfManageTool.java
===================================================================
--- DCWoRMS/trunk/build/classes/simulator/utils/workload/SwfManageTool.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/simulator/utils/workload/SwfManageTool.java	(revision 477)
@@ -0,0 +1,103 @@
+package simulator.utils.workload;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import simulator.workload.reader.archive.swf.SWFParser;
+import simulator.workload.writer.swf.QcgSWFJobWriter;
+
+public class SwfManageTool {
+	
+	protected List<TaskManagerInterface> managersList;
+	protected QcgSWFJobWriter writer;
+	protected SWFParser parser;
+	protected File readFromFile;
+	
+	protected List<TaskManagerInterface> createTaskManageToolsList() throws IOException{
+		List<TaskManagerInterface> list = new ArrayList<TaskManagerInterface>();
+		
+		list.add(new IncorrectTaskRemover());
+		list.add(new SubmitTimeNormalizer());
+		list.add(new StartTimeCalcultor());
+		
+		return list;
+	}
+	
+	protected void prepareTools(String swfFileName) throws IOException{
+		File file = new File(swfFileName);
+		String dirName = file.getParent();
+		String fileName = file.getName();
+		
+		this.readFromFile = new File(dirName, Calendar.getInstance().getTimeInMillis()+"_"+fileName);
+		file.renameTo(this.readFromFile);
+		parser = new SWFParser(this.readFromFile.getAbsolutePath());
+		
+		
+		this.writer = new QcgSWFJobWriter(dirName, fileName);
+		this.writer.writeFieldDescriptionHeader();
+		
+		
+		// rewrite swf header
+		HashMap<String, String> header = parser.loadHeader();
+		Set<String> keys = header.keySet();
+		Iterator<String> itr = keys.iterator();
+		while(itr.hasNext()){
+			String key = itr.next();
+			this.writer.writeComment(key, header.get(key));
+		}
+		
+	}
+	
+	protected void close() throws IOException{
+		if(this.parser != null)
+			this.parser.close();
+		if(this.writer != null)
+			this.writer.close();
+		if(this.readFromFile != null)
+			this.readFromFile.delete();
+	}
+	
+	public void run(String swfFileName){
+		
+		try {
+			prepareTools(swfFileName);
+			this.managersList = createTaskManageToolsList();
+			
+			String task[] = null;
+			
+			while((task = parser.readTask()) != null){
+				for(int i = 0; i < managersList.size(); i++){
+					TaskManagerInterface taskManager = managersList.get(i);
+					task = taskManager.manageTask(task);
+				}
+				
+				if(task != null)
+					writer.writeLine(task);
+			}			
+			
+		} catch (IOException e) {
+			e.printStackTrace();
+		} finally {
+			try {
+				close();
+			} catch (IOException e) {
+				e.printStackTrace();
+			}
+		}
+		
+	}
+	
+	public static void main(String args[]){
+		SwfManageTool swfManager = new SwfManageTool();
+		//swfManager.run("src/simulator/utils/workload/DAS.swf");
+		swfManager.run("src/test/ariel/workload/SDSC/SDSC-SP2-1998-3.1-cln-1000_cp.swf");
+	}
+	
+
+}
Index: DCWoRMS/trunk/build/classes/simulator/utils/workload/IncorrectTaskRemover.java
===================================================================
--- DCWoRMS/trunk/build/classes/simulator/utils/workload/IncorrectTaskRemover.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/simulator/utils/workload/IncorrectTaskRemover.java	(revision 477)
@@ -0,0 +1,36 @@
+package simulator.utils.workload;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.impl.LogFactoryImpl;
+
+import simulator.workload.reader.archive.swf.SWFFields;
+
+public class IncorrectTaskRemover implements TaskManagerInterface{
+
+	public static Log log = LogFactoryImpl.getLog(IncorrectTaskRemover.class);
+	
+	public String[] manageTask(String[] task) {
+		if(task == null)
+			return null;
+		
+		if("-1".equals(task[SWFFields.DATA_RUN_TIME])) {
+			log.info("Removing task "+task[SWFFields.DATA_JOB_NUMBER] + ",  RUN_TIME = -1");
+			return null;	
+		}
+		if("-1".equals(task[SWFFields.DATA_REQUESTED_TIME])) {
+			log.info("Removing task "+task[SWFFields.DATA_JOB_NUMBER] + ",  REQUESTED_TIME = -1");
+			return null;
+		}
+		if("-1".equals(task[SWFFields.DATA_NUMBER_OF_ALLOCATED_PROCESSORS])){
+			log.info("Removing task "+task[SWFFields.DATA_JOB_NUMBER] + ",  NUMBER_OF_ALLOCATED_PROCESSORS = -1");
+			return null;
+		}
+		if("-1".equals(task[SWFFields.DATA_REQUESTED_NUMBER_OF_PROCESSORS])){
+			log.info("Removing task "+task[SWFFields.DATA_JOB_NUMBER] + ",  REQUESTED_NUMBER_OF_PROCESSORS = -1");
+			return null;
+		}
+		
+		return task;
+	}
+
+}
Index: DCWoRMS/trunk/build/classes/simulator/utils/workload/TaskManagerInterface.java
===================================================================
--- DCWoRMS/trunk/build/classes/simulator/utils/workload/TaskManagerInterface.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/simulator/utils/workload/TaskManagerInterface.java	(revision 477)
@@ -0,0 +1,7 @@
+package simulator.utils.workload;
+
+public interface TaskManagerInterface {
+
+	public String[] manageTask(String task[]);
+	
+}
Index: DCWoRMS/trunk/build/classes/simulator/utils/GSSimXML.java
===================================================================
--- DCWoRMS/trunk/build/classes/simulator/utils/GSSimXML.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/simulator/utils/GSSimXML.java	(revision 477)
@@ -0,0 +1,120 @@
+package simulator.utils;
+
+import java.io.IOException;
+import java.io.Reader;
+import java.io.StringReader;
+import java.io.StringWriter;
+import java.io.Writer;
+
+import org.castor.mapping.BindingType;
+import org.exolab.castor.xml.ClassDescriptorResolverFactory;
+import org.exolab.castor.xml.Introspector;
+import org.exolab.castor.xml.MarshalException;
+import org.exolab.castor.xml.Marshaller;
+import org.exolab.castor.xml.Unmarshaller;
+import org.exolab.castor.xml.ValidationException;
+import org.exolab.castor.xml.XMLClassDescriptorResolver;
+
+/**
+ * This class provides static methods for marshalling and unmarshalling xml documents.
+ * It uses static cache objects, making the marshalling and unmarshalling process far quicker. 
+ * 
+ * @author Stanislaw Szczepanowski
+ * @see <a href="http://www.castor.org/xml-best-practice.html#Performance-Considerations">Castor - Performance Considerations</a>
+ */
+public class GSSimXML {
+
+	/**
+	 * Hidden constructor
+	 */
+	protected GSSimXML() {
+	}
+	
+	/** The class descriptor resolver */
+	protected static XMLClassDescriptorResolver mcdr = (XMLClassDescriptorResolver) ClassDescriptorResolverFactory.createClassDescriptorResolver(BindingType.XML);
+	
+	/** The unmarshaller object */
+	protected static Unmarshaller unmarshaller = new Unmarshaller();
+	
+	/** The marshaller object */
+	protected static Marshaller marshaller = new Marshaller();
+	
+	//static initialization
+	static {
+		mcdr.setIntrospector(new Introspector());
+		unmarshaller.setResolver(mcdr);
+		marshaller.setResolver(mcdr);
+	}
+	
+	/**
+	 * A generic method for marshalling.
+	 * @param <T> the type of the object that is to be marshalled
+	 * @param object the object that is to be marshalled
+	 * @param writer the writer, where the result is to be written to
+	 * @return true, if the operation succeeded; false otherwise
+	 */
+	public static synchronized <T> boolean marshal(T object, Writer writer) {
+		try {
+			marshaller.setWriter(writer);
+			marshaller.marshal(object);
+		} catch (IOException e) {
+			e.printStackTrace();
+			return false;
+		} catch (MarshalException e) {
+			e.printStackTrace();
+			return false;
+		} catch (ValidationException e) {
+			e.printStackTrace();
+			return false;
+		}
+		return true;
+	}
+	
+	/**
+	 * A generic method for marshalling.
+	 * Performs a marshalling and return the result in form of a {@link String} object.
+	 * @param <T> the type of the object that is to be marshalled
+	 * @param object the object that is to be marshalled
+	 * @return a string containing the marshalled xml or <code>null</code> if any error occurred
+	 */
+	public static synchronized <T> String marshal(T object) {
+		StringWriter sw = new StringWriter();
+		if (marshal(object, sw))
+			return sw.toString();
+		else 
+			return null;
+	}
+
+	/**
+	 * A generic method for unmarshalling.
+	 * @param <T> the type of the object that is to be unmarshalled
+	 * @param clazz the class of the object that is to be marshalled
+	 * @param reader the reader, from which the result is to be read
+	 * @return the unmarshalled object; <code>null</code> if error occurs
+	 */
+	public static synchronized <T> T unmarshal(Class<T> clazz, Reader reader) {
+		unmarshaller.setClass(clazz);
+		T result = null;
+		try {
+			result = (T) unmarshaller.unmarshal(reader);
+		} catch (MarshalException e) {
+			e.printStackTrace();
+			return null;
+		} catch (ValidationException e) {
+			e.printStackTrace();
+			return null;
+		}
+		return result;
+	}
+	
+	/**
+	 * A generic method for unmarshalling.
+	 * @param <T> the type of the object that is to be unmarshalled
+	 * @param clazz the class of the object that is to be marshalled
+	 * @param xml the string, containing an xml document, from which the result is to be read
+	 * @return the unmarshalled object; <code>null</code> if error occurs
+	 */
+	public static synchronized <T> T unmarshal(Class<T> clazz, String xml) {
+		return unmarshal(clazz, new StringReader(xml));
+	}
+}
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 477)
@@ -0,0 +1,252 @@
+package simulator.utils;
+
+import gssim.schedframe.scheduling.utils.JobDescription;
+import gssim.schedframe.scheduling.utils.TaskDescription;
+
+import java.io.IOException;
+import java.io.Reader;
+import java.io.StringReader;
+import java.io.StringWriter;
+import java.io.Writer;
+import java.util.Properties;
+
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.Templates;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerConfigurationException;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.xpath.XPathExpressionException;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+public class XsltTransformations {
+	
+	public static String INSTALLDIR = null;
+	
+	static {
+		String key = "javax.xml.transform.TransformerFactory";
+		String value = 
+			//"org.apache.xalan.xsltc.trax.TransformerFactoryImpl";
+			"org.apache.xalan.processor.TransformerFactoryImpl";
+		Properties props = System.getProperties();
+		props.put(key, value);
+		System.setProperties(props);
+		
+		INSTALLDIR = System.getProperty("gssim.install.dir");
+		if(INSTALLDIR != null)
+			INSTALLDIR = INSTALLDIR+"/";
+		else 
+			INSTALLDIR = "";
+	}
+	
+	
+	public XsltTransformations() throws ParserConfigurationException, XPathExpressionException{
+	}
+	
+	protected enum Transformers {
+		EXTEND_JOB_DESC(INSTALLDIR+"simulator/xslt/ext_job_desc.xslt"),
+		TASK2RESOURCE_REQUIREMENTS(INSTALLDIR+"simulator/xslt/task2resreq.xslt"),
+		RESOURCE_REQUIREMENTS2RTG(INSTALLDIR+"simulator/xslt/resreq2rtg.xslt"),
+		RTG2HOST_PARAMETERS(INSTALLDIR+"simulator/xslt/rtg2host_params.xslt"),
+		HOST_PARAMETERS2RTG(INSTALLDIR+"simulator/xslt/host_params2rtg.xslt"),
+		RTG2SCHEDULIING_PLAN(INSTALLDIR+"simulator/xslt/schedulingPlan.xslt"),
+		EXTRACT_JOB_ID(INSTALLDIR+"simulator/xslt/extract_job_id.xslt"),
+		JOB_POSTPROCESSING(INSTALLDIR+"simulator/xslt/job_postprocessing.xslt");
+		
+		private String fileName;
+		private Transformer transformer;
+
+		private Transformers(String arg){
+			this.fileName = arg;
+			this.transformer = null;
+		}
+		
+		public Transformer geTransformer() throws TransformerConfigurationException{
+			if(this.transformer == null){
+				TransformerFactory tFactory = TransformerFactory.newInstance();
+				StreamSource ss = new StreamSource(this.fileName);
+				Templates translet = tFactory.newTemplates(ss);
+				this.transformer = translet.newTransformer();
+			}
+			
+			return this.transformer;
+		}
+	}
+	
+	public String extendJobDescription(String jobDesc){
+		Transformer t = null;
+		try {
+			t = Transformers.EXTEND_JOB_DESC.geTransformer();
+			return transform(t, jobDesc);
+		} catch (TransformerConfigurationException e) {
+			e.printStackTrace();
+		}
+		return null;
+	}
+	
+	public String taskToResourceRequirements(String task, String jobId, String userDN, org.joda.time.DateTime submitionTime){
+		Transformer t = null;
+		try {
+			t = Transformers.TASK2RESOURCE_REQUIREMENTS.geTransformer();
+			t.clearParameters();
+			t.setParameter("JOB_ID", jobId);
+			t.setParameter("USER_DN", userDN);
+			
+			org.exolab.castor.types.DateTime dt = new org.exolab.castor.types.DateTime(submitionTime.getMillis());
+			short milis = 0;
+			dt.setMilliSecond(milis);
+			t.setParameter("SUBMISSION_TIME", dt);
+			
+			return transform(t, task);
+			
+		} catch (TransformerConfigurationException e) {
+			e.printStackTrace();
+		}
+		return null;
+	}
+	
+	public String resourceRequirementsToRTG(String resReq){
+		Transformer t = null;
+		try {
+			t = Transformers.RESOURCE_REQUIREMENTS2RTG.geTransformer();
+			return transform(t, resReq);
+		} catch (TransformerConfigurationException e) {
+			e.printStackTrace();
+		}
+		return null;
+	}
+	
+	public String RTGToHostParameters(String rtg){
+		Transformer t = null;
+		try {
+			t = Transformers.RTG2HOST_PARAMETERS.geTransformer();
+			return transform(t, rtg);
+		} catch (TransformerConfigurationException e) {
+			e.printStackTrace();
+		}
+		return null;
+	}
+	
+	public String hostParametersToRTG(String hostParameters){
+		Transformer t = null;
+		try {
+			t = Transformers.HOST_PARAMETERS2RTG.geTransformer();
+			return transform(t, hostParameters);
+		} catch (TransformerConfigurationException e) {
+			e.printStackTrace();
+		}
+		return null;
+	}
+	
+	public String RTGToSchedulingPlan(String rtg){
+		Transformer t = null;
+		try {
+			t = Transformers.RTG2SCHEDULIING_PLAN.geTransformer();
+			return transform(t, rtg);
+		} catch (TransformerConfigurationException e) {
+			e.printStackTrace();
+		}
+		return null;
+	}
+	
+	public JobDescription splitJobToTasks(String xmlJob) throws Exception{
+
+		int begin = 0;
+		int end = 0;
+		
+		begin = xmlJob.indexOf("appId=") + 7;
+		end = xmlJob.indexOf("\"", begin);
+		String jobId = xmlJob.substring(begin, end);
+		
+		JobDescription jobDesc = new JobDescription(xmlJob);
+	    jobDesc.setJobId(jobId);
+		
+		begin = 0;
+		end = 0;
+		int tb = 0;
+		int te = 0;
+		String taskId;
+		while((begin = xmlJob.indexOf("<task", end)) != -1){
+			end = xmlJob.indexOf("</task>", begin);
+			end += 7;
+			String task = xmlJob.substring(begin, end);
+			tb = task.indexOf("taskId=") + 8;
+			te = task.indexOf("\"", tb);
+			taskId = task.substring(tb, te);
+			
+			
+			TaskDescription taskDescription = new TaskDescription(task);
+	    	taskDescription.setTaskId(taskId);
+	    	jobDesc.add(taskDescription);
+		}
+		
+		return jobDesc;
+	}
+	
+	public String extractJobId(String job){
+		Transformer t = null;
+		
+		try {
+		
+			t = Transformers.EXTRACT_JOB_ID.geTransformer();
+			return transform(t, job);
+			
+		} catch (TransformerConfigurationException e) {
+			e.printStackTrace();
+		} 
+		
+		return null;
+	}
+	
+	public String jobPostProcessing(String job, String taskId, String executionDuration){
+		Transformer t = null;
+		
+		try {
+		
+			t = Transformers.JOB_POSTPROCESSING.geTransformer();
+			t.setParameter("TASK_ID", taskId);
+			t.setParameter("EXEC_DURATION_VALUE", executionDuration);
+			
+			return transform(t, job);
+			
+		} catch (TransformerConfigurationException e) {
+			e.printStackTrace();
+		} 
+		
+		return null;
+	}
+	
+	protected String transform(Transformer t, String input){
+		Writer writer = new StringWriter();
+		Reader reader = new StringReader(input);
+		
+		try {
+			writer = new StringWriter();
+			reader = new StringReader(input);
+			
+			t.transform(new StreamSource(reader), new StreamResult(writer));
+			
+
+			return writer.toString();
+		} catch (TransformerConfigurationException e) {
+			e.printStackTrace();
+		} catch (TransformerException e) {
+			e.printStackTrace();
+		} finally {
+			try {
+				writer.close();
+				reader.close();
+			} catch (IOException e) {
+				e.printStackTrace();
+			}
+			
+		}
+		return null;
+	}
+}
Index: DCWoRMS/trunk/build/classes/simulator/utils/LogErrStream.java
===================================================================
--- DCWoRMS/trunk/build/classes/simulator/utils/LogErrStream.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/simulator/utils/LogErrStream.java	(revision 477)
@@ -0,0 +1,46 @@
+package simulator.utils;
+
+import java.io.IOException;
+import java.io.OutputStream;
+
+import org.apache.commons.logging.Log;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+
+public class LogErrStream extends OutputStream {
+	
+	private Log log;
+ 	
+	public LogErrStream(Log log) {
+ 		this.log = log;
+ 	}
+
+    public void close() {
+    }
+
+    public void flush() {
+        
+    }
+
+    public void write(final byte[] b) throws IOException {
+        String s = new String(b);
+    	log.error(s);
+    }
+
+    public void write(final byte[] b, final int off, final int len)
+        throws IOException {
+    	if(len == 1)
+    		return;
+    	
+    	String s = new String(b, off, len);
+        log.error(s);
+    }
+
+    public void write(final int b) throws IOException {
+        log.error(b);
+    }
+}
Index: DCWoRMS/trunk/build/classes/simulator/utils/MergeSort.java
===================================================================
--- DCWoRMS/trunk/build/classes/simulator/utils/MergeSort.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/simulator/utils/MergeSort.java	(revision 477)
@@ -0,0 +1,159 @@
+package simulator.utils;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Iterator;
+
+public class MergeSort<T>{
+
+	private Class<?> c;
+	private Method m;
+
+	public void initSort(T[] array, String methodName, boolean ascending) {
+		try {
+			c = Class.forName(array.getClass().getCanonicalName().substring(0,  array.getClass().getCanonicalName().length() -2));
+		} catch (ClassNotFoundException e) {
+			return;
+		}
+		try {
+			m = c.getMethod(methodName);
+		} catch (SecurityException e) {
+			return;
+		} catch (NoSuchMethodException e) {
+			return;
+		}
+		T[] tmpArray = array.clone();
+		mergeSort(array, tmpArray, 0, array.length-1, ascending);
+	}
+	
+	public void initCollectionSort(Collection<T> collection, String methodName, boolean ascending) {
+		
+		Iterator<T> iterator = collection.iterator();
+		try {
+			while (iterator.hasNext() && c == null) {
+				c = Class.forName(iterator.next().getClass().getCanonicalName());
+			}
+		} catch (ClassNotFoundException e) {
+			return;
+		}
+		if(c == null)
+			return;
+		try {
+			m = c.getMethod(methodName);
+		} catch (SecurityException e) {
+			return;
+		} catch (NoSuchMethodException e) {
+			return;
+		}
+		T[] array = (T[]) collection.toArray();
+		T[] tmpArray = array.clone();
+		mergeSort(array, tmpArray, 0, array.length-1, ascending);
+		collection.clear();
+		collection.addAll(new ArrayList(Arrays.asList(array)));
+
+	}
+
+	private void mergeSort(T[] array, T[] tmpArray, int left,
+			int right, boolean ascending) {
+		if (left < right) {
+			int center = (left + right) / 2;
+			mergeSort(array, tmpArray, left, center, ascending);
+			mergeSort(array, tmpArray, center + 1, right, ascending);
+			merge(array, tmpArray, left, center + 1, right, ascending);
+		}
+	}
+
+	private void merge(T[] array, T[] tmpArray, int leftPos,
+			int rightPos, int rightEnd, boolean ascending) {
+		int leftEnd = rightPos - 1;
+		int tmpPos = leftPos;
+		int numElements = rightEnd - leftPos + 1;
+		while (leftPos <= leftEnd && rightPos <= rightEnd)
+			try {
+				if(ascending)
+				{	
+					if (Integer.class.isInstance(m.invoke(array[leftPos])))
+					{
+						if ((Integer) m.invoke(array[leftPos]) < (Integer) m.invoke(array[rightPos]))
+							tmpArray[tmpPos++] = array[leftPos++];
+						else
+							tmpArray[tmpPos++] = array[rightPos++];
+					}
+					else if (Long.class.isInstance(m.invoke(array[leftPos])))
+					{
+						if ((Long) m.invoke(array[leftPos]) < (Long) m.invoke(array[rightPos]))
+							tmpArray[tmpPos++] = array[leftPos++];
+						else
+							tmpArray[tmpPos++] = array[rightPos++];
+					}
+					else if (Double.class.isInstance(m.invoke(array[leftPos])))
+					{
+						if ((Double) m.invoke(array[leftPos]) < (Double) m.invoke(array[rightPos]))
+							tmpArray[tmpPos++] = array[leftPos++];
+						else
+							tmpArray[tmpPos++] = array[rightPos++];
+					}
+					else if (String.class.isInstance(m.invoke(array[leftPos])))
+					{
+						if (((String) m.invoke(array[leftPos])).compareTo((String) m.invoke(array[rightPos])) < 0)
+							tmpArray[tmpPos++] = array[leftPos++];
+						else
+							tmpArray[tmpPos++] = array[rightPos++];
+					} else {
+						throw new IllegalAccessException();
+					}
+				}
+				
+				else {
+					if (Integer.class.isInstance(m.invoke(array[leftPos])))
+					{
+						if ((Integer) m.invoke(array[leftPos]) > (Integer) m.invoke(array[rightPos]))
+							tmpArray[tmpPos++] = array[leftPos++];
+						else
+							tmpArray[tmpPos++] = array[rightPos++];
+					}
+					else if (Long.class.isInstance(m.invoke(array[leftPos])))
+					{
+						if ((Long) m.invoke(array[leftPos]) > (Long) m.invoke(array[rightPos]))
+							tmpArray[tmpPos++] = array[leftPos++];
+						else
+							tmpArray[tmpPos++] = array[rightPos++];
+					}
+					else if (Double.class.isInstance(m.invoke(array[leftPos])))
+					{
+						if ((Double) m.invoke(array[leftPos]) > (Double) m.invoke(array[rightPos]))
+							tmpArray[tmpPos++] = array[leftPos++];
+						else
+							tmpArray[tmpPos++] = array[rightPos++];
+					}
+					else if (String.class.isInstance(m.invoke(array[leftPos])))
+					{
+						if (((String) m.invoke(array[leftPos])).compareTo((String) m.invoke(array[rightPos])) > 0)
+							tmpArray[tmpPos++] = array[leftPos++];
+						else
+							tmpArray[tmpPos++] = array[rightPos++];
+					} else {
+						throw new IllegalAccessException();
+					}
+				}
+			} catch (IllegalArgumentException e) {
+				break;
+			} catch (IllegalAccessException e) {
+				break;
+			} catch (InvocationTargetException e) {
+				break;
+			}
+
+		while (leftPos <= leftEnd)
+			tmpArray[tmpPos++] = array[leftPos++];
+
+		while (rightPos <= rightEnd)
+			tmpArray[tmpPos++] = array[rightPos++];
+
+		for (int i = 0; i < numElements; i++, rightEnd--)
+			array[rightEnd] = tmpArray[rightEnd];
+	}
+}
Index: DCWoRMS/trunk/build/classes/simulator/utils/DoubleMath.java
===================================================================
--- DCWoRMS/trunk/build/classes/simulator/utils/DoubleMath.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/simulator/utils/DoubleMath.java	(revision 477)
@@ -0,0 +1,62 @@
+/**
+ * Created on 2008-01-05
+ */
+package simulator.utils;
+
+import java.math.BigDecimal;
+import java.text.DecimalFormat;
+import java.util.Locale;
+
+/**
+ * This class provides basic mathematical operations for the <code>double</code> primitive type
+ * @author Stanislaw Szczepanowski
+ */
+public class DoubleMath {
+	
+	/**
+	 * The pattern used for converting a <code>double</code> value to a string
+	 */
+	public static String PATTERN = "###.###";
+	
+	/**
+	 * A protected constructor which will be invoked only 
+	 * one time in the lifetime of this class
+	 */
+	protected DoubleMath() {
+	}
+	
+	/**
+	 * Adds two <code>double</code> values and returns the result of addition
+	 * @param left the left argument
+	 * @param right the right argument
+	 * @return the result of addition of the two arguments
+	 */
+	public static double add(double left, double right) {
+		DecimalFormat df = (DecimalFormat) DecimalFormat.getInstance(Locale.ENGLISH);
+		df.applyPattern(PATTERN);
+		String leftStr = df.format(left);
+		String rightStr = df.format(right);
+		BigDecimal resultDec = new BigDecimal(leftStr);
+		BigDecimal rightDec = new BigDecimal(rightStr);
+		resultDec = resultDec.add(rightDec);
+		return resultDec.doubleValue();
+	}
+	
+	/**
+	 * Subtracts from the <code>left</code> argument the <code>right</code> argument and returns the result of subtraction
+	 * @param left the left argument
+	 * @param right the right argument
+	 * @return the result of subtraction of the two arguments
+	 */
+	public static double subtract(double left, double right) {
+		DecimalFormat df = (DecimalFormat) DecimalFormat.getInstance(Locale.ENGLISH);
+		df.applyPattern(PATTERN);
+		String leftStr = df.format(left);
+		String rightStr = df.format(right);
+		BigDecimal resultDec = new BigDecimal(leftStr);
+		BigDecimal rightDec = new BigDecimal(rightStr);
+		resultDec = resultDec.subtract(rightDec);
+		return resultDec.doubleValue();
+	}
+
+}
Index: DCWoRMS/trunk/build/classes/simulator/utils/InstanceFactory.java
===================================================================
--- DCWoRMS/trunk/build/classes/simulator/utils/InstanceFactory.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/simulator/utils/InstanceFactory.java	(revision 477)
@@ -0,0 +1,40 @@
+package simulator.utils;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+
+public class InstanceFactory {
+
+	private static Log log = LogFactory.getLog(InstanceFactory.class);
+	
+	public static final Object createInstance(String className, Class<?> z){
+		
+		if(className == null)
+			return null;
+		
+		Object obj = null;
+		
+		try {
+			
+			Class<?> c = Class.forName(className);
+			if(!z.isAssignableFrom(c)){
+				log.error(className + " does not implement desired interface " + z.getName());
+				return null;
+			}
+			
+			obj = c.newInstance();
+			
+		} catch (ClassNotFoundException e) {
+			log.error(e.getMessage() + " Class not found.");
+		} catch (InstantiationException e) {
+			log.error(e.getMessage() + " Can not create class instance.");
+		} catch (IllegalAccessException e) {
+			log.error(e.getMessage() + " Illegal Access.");
+		}
+		
+		return obj;
+		
+	}
+	
+}
Index: DCWoRMS/trunk/build/classes/simulator/utils/WorkloadCalculator.java
===================================================================
--- DCWoRMS/trunk/build/classes/simulator/utils/WorkloadCalculator.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/simulator/utils/WorkloadCalculator.java	(revision 477)
@@ -0,0 +1,154 @@
+package simulator.utils;
+
+import java.io.File;
+import java.util.Calendar;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Set;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import simulator.workload.reader.archive.swf.SWFFields;
+import simulator.workload.reader.archive.swf.SWFParser;
+import simulator.workload.writer.swf.QcgSWFJobWriter;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+public class WorkloadCalculator {
+
+	protected static Log log = LogFactory.getLog(WorkloadCalculator.class);
+	
+	public static void main(String args[]){
+	
+		WorkloadCalculator workloadCalculator = new WorkloadCalculator();
+		try {
+			throw new RuntimeException("Nieladnie tak uruchamiac w ciemno ;). " +
+					"Wybierz funkcje, ktora ma zostac wywolana");
+			
+			//workloadCalculator.normalizeSubmitTime(args[0]);
+			//workloadCalculator.removeIncorrectTasks(args[0]);
+			
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+	}
+	
+	/**
+	 * Rewrites swf file. Submit time of all tasks will be scaled down.
+	 * @param swfFileName
+	 */
+	public void normalizeSubmitTime(String swfFileName) throws Exception{
+		log.info("Start workload submit time normalization for "+swfFileName);
+		
+		File file = new File(swfFileName);
+		String dirName = file.getParent();
+		String fileName = file.getName();
+		
+		File newFile = new File(dirName, Calendar.getInstance().getTimeInMillis()+"_"+fileName);
+		file.renameTo(newFile);
+		
+		
+		QcgSWFJobWriter writer = new QcgSWFJobWriter(dirName, fileName);
+		// write swf filed description
+		writer.writeFieldDescriptionHeader();
+		
+		SWFParser parser = new SWFParser(newFile.getAbsolutePath());
+		
+		// rewrite swf header
+		HashMap<String, String> header = parser.loadHeader();
+		Set<String> keys = header.keySet();
+		Iterator<String> itr = keys.iterator();
+		while(itr.hasNext()){
+			String key = itr.next();
+			writer.writeComment(key, header.get(key));
+		}
+		
+		// rewrite tasks
+		String task[] = parser.readTask();
+		long submitTimeOffset = Long.valueOf(task[SWFFields.DATA_SUBMIT_TIME]);
+		task[SWFFields.DATA_SUBMIT_TIME] = "0";
+		writer.writeLine(task);
+		
+		while((task = parser.readTask()) != null){
+			long submitTime = Long.valueOf(task[SWFFields.DATA_SUBMIT_TIME]) - submitTimeOffset;
+			task[SWFFields.DATA_SUBMIT_TIME] = String.valueOf(submitTime);
+			writer.writeLine(task);
+		}
+		
+		parser.close();
+		writer.close();
+		
+		newFile.delete();
+		
+		log.info("End workload submit time normalization");
+	}
+	
+	/**
+	 * Rewrites swf file and deletes all tasks which parameter RUN_TIME or REQUESTED_TIME or 
+	 * number of ALLOCATED PRCESSORS or number of REQUESTED PROCESSORS equals -1.
+	 * @param swf file name 
+	 */
+	public void removeIncorrectTasks(String swfFileName) throws Exception{
+		log.info("Start removing incorrect tasks for "+swfFileName);
+		
+		File file = new File(swfFileName);
+		String dirName = file.getParent();
+		String fileName = file.getName();
+		
+		File newFile = new File(dirName, Calendar.getInstance().getTimeInMillis()+"_"+fileName);
+		file.renameTo(newFile);
+		
+		
+		QcgSWFJobWriter writer = new QcgSWFJobWriter(dirName, fileName);
+		// write swf filed description
+		writer.writeFieldDescriptionHeader();
+		
+		SWFParser parser = new SWFParser(newFile.getAbsolutePath());
+		
+		// rewrite swf header
+		HashMap<String, String> header = parser.loadHeader();
+		Set<String> keys = header.keySet();
+		Iterator<String> itr = keys.iterator();
+		while(itr.hasNext()){
+			String key = itr.next();
+			writer.writeComment(key, header.get(key));
+		}
+		
+		// rewrite tasks
+		String task[] = null;
+		
+		while((task = parser.readTask()) != null){
+			if("-1".equals(task[SWFFields.DATA_RUN_TIME])) {
+				log.info("Removing task "+task[SWFFields.DATA_JOB_NUMBER] + ",  RUN_TIME = -1");
+				continue;	
+			}
+				
+			if("-1".equals(task[SWFFields.DATA_REQUESTED_TIME])) {
+				log.info("Removing task "+task[SWFFields.DATA_JOB_NUMBER] + ",  REQUESTED_TIME = -1");
+				continue;
+			}
+			if("-1".equals(task[SWFFields.DATA_NUMBER_OF_ALLOCATED_PROCESSORS])){
+				log.info("Removing task "+task[SWFFields.DATA_JOB_NUMBER] + ",  NUMBER_OF_ALLOCATED_PROCESSORS = -1");
+				continue;
+			}
+			if("-1".equals(task[SWFFields.DATA_REQUESTED_NUMBER_OF_PROCESSORS])){
+				log.info("Removing task "+task[SWFFields.DATA_JOB_NUMBER] + ",  REQUESTED_NUMBER_OF_PROCESSORS = -1");
+				continue;
+			}
+
+			writer.writeLine(task);
+		}
+		
+		parser.close();
+		writer.close();
+		
+		newFile.delete();
+		
+		log.info("End removing incorrect tasks");
+	}
+	
+}
Index: DCWoRMS/trunk/build/classes/simulator/reader/ComputingResourceWrapper.java
===================================================================
--- DCWoRMS/trunk/build/classes/simulator/reader/ComputingResourceWrapper.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/simulator/reader/ComputingResourceWrapper.java	(revision 477)
@@ -0,0 +1,45 @@
+package simulator.reader;
+
+import org.qcg.broker.schemas.exception.UnknownParameter;
+
+import schemas.ComputingResource;
+import schemas.ComputingResourceTypeChoiceSequence;
+import schemas.ComputingResourceTypeChoiceSequence2;
+
+public class ComputingResourceWrapper {
+	
+	ComputingResource computingResource;
+	
+	public void wrap(ComputingResource computingResource) {
+		this.computingResource = computingResource;
+	}
+	
+	public long getChildCount(){
+		long compResCount = computingResource.getCount() > 1 ? computingResource.getCount() : 1;
+		return compResCount;
+	}
+
+	public ComputingResourceTypeChoiceSequence getCharacteristics() throws UnknownParameter {
+		if(computingResource.getComputingResourceTypeChoiceSequence() == null)
+			throw new UnknownParameter("Characeristics are not defined.");
+		return computingResource.getComputingResourceTypeChoiceSequence();
+	}
+	
+	public ComputingResourceTypeChoiceSequence2 getTemplate() throws UnknownParameter {
+		if(computingResource.getComputingResourceTypeChoiceSequence2() == null)
+			throw new UnknownParameter("Templates are not defined.");
+		return computingResource.getComputingResourceTypeChoiceSequence2();
+	}
+
+	public String getResourceClass(){
+		return this.computingResource.getClazz();
+	}
+	
+	public String getName(){
+		return this.computingResource.getName();
+	}
+	
+	public long getGroupId(){
+		return this.computingResource.getGroupId();
+	}
+}
Index: DCWoRMS/trunk/build/classes/simulator/reader/EnvironmentWrapper.java
===================================================================
--- DCWoRMS/trunk/build/classes/simulator/reader/EnvironmentWrapper.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/simulator/reader/EnvironmentWrapper.java	(revision 477)
@@ -0,0 +1,127 @@
+package simulator.reader;
+
+import java.util.ArrayList;
+
+import org.qcg.broker.schemas.exception.UnknownParameter;
+
+import schedframe.Parameter;
+import schedframe.Parameters;
+import schedframe.Property;
+import schemas.ComputingResource;
+import schemas.ComputingResourceTemplate;
+import schemas.ComputingResourceTypeChoiceSequence;
+import schemas.Environment;
+import schemas.Resources;
+import schemas.Templates;
+import schemas.TimeEstimationPlugin;
+
+public class EnvironmentWrapper {
+
+	Environment environment;
+
+	public void wrap(Environment environment) {
+		this.environment = environment;
+	}
+
+	public Templates getTemplates() throws UnknownParameter{
+		if(environment == null)
+			throw new UnknownParameter("Environment parameters are not defined.");
+		return environment.getTemplates();
+	}
+	
+	public ComputingResourceTemplate getTemplate(String templateId) throws UnknownParameter{
+		Templates templates = getTemplates() ;
+	
+		if(templates == null) 
+			return null;
+		
+		for (int i = 0; i < templates.getComputingResourceTemplateCount(); i++){
+			schemas.ComputingResourceTemplate template = templates.getComputingResourceTemplate(i);
+			if(template.getName().equals(templateId)){
+				return template;
+			}
+		}
+		return null;
+	}
+	
+	public Resources getResources() throws UnknownParameter{
+		if(environment == null)
+			throw new UnknownParameter("Environment parameters are not defined.");
+		return environment.getResources();
+	}
+	
+	public ComputingResource[] getComputingResources() throws UnknownParameter{
+		
+		ArrayList<ComputingResource>tab = null;
+		
+		if(environment == null)
+			throw new UnknownParameter("Environment parameters are not defined.");
+		Resources resources = getResources();
+		if(resources == null)
+			return null;
+		
+		tab = new ArrayList<ComputingResource>();
+		 
+		for(int i = 0; i < resources.getComputingResourceCount(); i++){
+			ComputingResource compRes = resources.getComputingResource(i);
+			tab.add(compRes);
+		}
+		if(tab.size() == 0)
+			return null;
+		else
+			return tab.toArray(new ComputingResource[0]);
+	}
+	
+	public TimeEstimationPlugin getTimeEstimationPlugin() throws UnknownParameter{
+		if(environment == null)
+			throw new UnknownParameter("Environment parameters are not defined.");
+		return environment.getTimeEstimationPlugin();
+	}
+	
+	public boolean initWithCompResTemplate(ComputingResource compRes, ComputingResourceTemplate template){
+
+		compRes.setClazz(template.getClazz());
+
+		compRes.setComputingResourceTypeChoiceSequence(new ComputingResourceTypeChoiceSequence());
+		compRes.getComputingResourceTypeChoiceSequence().setComputingResource(template.getComputingResource());
+		compRes.getComputingResourceTypeChoiceSequence().setResourceUnit(template.getResourceUnit());
+		compRes.getComputingResourceTypeChoiceSequence().setProfile(template.getProfile());
+		compRes.getComputingResourceTypeChoiceSequence().setParameter(template.getParameter());
+		
+		return true;
+	}
+	
+	public static Parameters extractParameters(schemas.Parameter[] parameters){
+		
+		Parameters params = null;
+		
+		if(parameters.length != 0)
+			params = new Parameters();
+		
+		for(int i = 0; i < parameters.length; i++){
+			schemas.Parameter parameter = parameters[i];
+			Parameter param = new Parameter(parameter.getName());
+			if(parameter.getParameterTypeSequence() != null && parameter.getParameterTypeSequence().getProperty() != null)
+			{							
+				int propertyCount = parameter.getParameterTypeSequence().getPropertyCount();
+				for(int j = 0; j < propertyCount; j++){
+					schemas.Property property = parameter.getParameterTypeSequence().getProperty(j);
+					Property prop = new Property(property.getName());
+					int stringValueWithUnitCount = property.getStringValueWithUnitCount();
+					for(int k = 0; k < stringValueWithUnitCount; k++){
+						prop.add(property.getStringValueWithUnit(k));
+					}
+					param.addProperty(prop);
+				}
+			} else {
+				int stringValueWithUnitCount =  parameter.getStringValueWithUnitCount();
+				for(int j = 0; j < stringValueWithUnitCount; j++){
+					param.add(parameter.getStringValueWithUnit(j));
+				}
+			}
+			params.put(parameter.getName(), param);
+		}
+		return params;
+	}
+
+}
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 477)
@@ -0,0 +1,444 @@
+package simulator.reader;
+
+import gridsim.ResourceCalendar;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.IOException;
+import java.util.ArrayDeque;
+import java.util.ArrayList;
+import java.util.Deque;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
+import org.exolab.castor.types.AnyNode;
+import org.exolab.castor.xml.MarshalException;
+import org.exolab.castor.xml.ValidationException;
+import org.qcg.broker.schemas.exception.UnknownParameter;
+
+import schedframe.Initializable;
+import schedframe.Parameter;
+import schedframe.Parameters;
+import schedframe.ResourceController;
+import schedframe.exceptions.ResourceException;
+import schedframe.resources.StandardResourceType;
+import schedframe.resources.computing.ComputingResource;
+import schedframe.resources.computing.ResourceFactory;
+import schedframe.resources.computing.description.AbstractResourceDescription;
+import schedframe.resources.computing.description.ComputingResourceDescription;
+import schedframe.resources.units.ResourceUnit;
+import schedframe.resources.units.ResourceUnitName;
+import schedframe.scheduling.Scheduler;
+import schedframe.scheduling.manager.resources.ManagedResources;
+import schedframe.scheduling.plugin.SchedulingPlugin;
+import schedframe.scheduling.plugin.estimation.ExecutionTimeEstimationPlugin;
+import schedframe.scheduling.queue.TaskQueue;
+import schedframe.scheduling.queue.TaskQueueList;
+import schemas.Environment;
+import schemas.ManagedComputingResources;
+import schemas.StringValueWithUnit;
+import simulator.ConfigurationOptions;
+import simulator.utils.InstanceFactory;
+
+public class ResourceReader {
+	
+	protected String resDescFileName;
+
+	protected ResourceCalendar resourceCalendar;
+	protected Deque<Initializable> toInit = new ArrayDeque<Initializable>();
+	
+	private ExecutionTimeEstimationPlugin execTimeEstimationPlugin;
+	private String globalSchedulingPluginName;
+	
+	public ResourceReader(ConfigurationOptions options) throws IOException {
+
+		resDescFileName = options.resdescFileName;
+		globalSchedulingPluginName = "example.globalplugin.GridFCFSRoundRobinPlugin";
+		prepareCalendar();
+	}
+
+	public ResourceController read() throws MarshalException, ValidationException, FileNotFoundException, Exception,
+			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));
+		
+		System.out.println("started creating environment description");
+		List<ComputingResourceDescription> mainCompResDescList = createEnvironmentDescription(env);
+		System.out.println("finished creating environment description");
+
+		System.out.println("started creating resources");
+		List<ComputingResource> computingResources = createResources(mainCompResDescList);
+		System.out.println("finished creating resource");
+
+		System.out.println("started creating schedulers");
+		Scheduler mainScheduler = createSchedulers(env.getResources().getScheduler(), computingResources);
+		System.out.println("finished creating schedulers");
+
+		ResourceController rc = new ResourceController(mainScheduler, computingResources);
+		rc.setInitList(toInit);
+		return rc;
+	}
+
+	protected List<ComputingResourceDescription> createEnvironmentDescription(Environment environment) throws Exception {
+
+		List<ComputingResourceDescription> mainCompResDescList = new ArrayList<ComputingResourceDescription>();
+		
+		LinkedList<ComputingResourceDescription> resDescStructure = new LinkedList<ComputingResourceDescription>();
+		LinkedList<schemas.ComputingResource> toExamine = new LinkedList<schemas.ComputingResource>();
+		EnvironmentWrapper environmentWrapper = new EnvironmentWrapper();
+		environmentWrapper.wrap(environment);
+		
+		String execTimeEstimationPluginClassName = null;
+		if(environmentWrapper.getTimeEstimationPlugin() != null){
+			execTimeEstimationPluginClassName = environmentWrapper.getTimeEstimationPlugin().getName();
+		}
+		
+		try{
+			execTimeEstimationPlugin = (ExecutionTimeEstimationPlugin) InstanceFactory.createInstance(
+					execTimeEstimationPluginClassName, ExecutionTimeEstimationPlugin.class);
+			if(execTimeEstimationPlugin == null) {
+				execTimeEstimationPluginClassName = "example.timeestimation.DefaultTimeEstimationPlugin";
+				execTimeEstimationPlugin = (ExecutionTimeEstimationPlugin) InstanceFactory.createInstance(
+						execTimeEstimationPluginClassName, ExecutionTimeEstimationPlugin.class);
+			} else {
+				Parameters params = EnvironmentWrapper.extractParameters(environmentWrapper.getTimeEstimationPlugin().getParameter());
+				execTimeEstimationPlugin.init(params);
+			}
+		} catch (Exception e){
+			if (execTimeEstimationPlugin == null) {
+				throw new Exception("Can not create execution time estimation plugin instance.");
+			}
+		}
+
+		if(environmentWrapper.getComputingResources() != null) {
+			for(int i = 0; i < environmentWrapper.getComputingResources().length; i++){
+				schemas.ComputingResource compResDef = environmentWrapper.getComputingResources()[i];
+				toExamine.push(compResDef);
+				
+				ComputingResourceDescription compResDesc = new ComputingResourceDescription(compResDef);
+				resDescStructure.push(compResDesc);
+				mainCompResDescList.add(compResDesc);
+			}
+		}
+		while (!toExamine.isEmpty()) {
+			schemas.ComputingResource parentCompResDef = toExamine.pop();
+			ComputingResourceDescription parentExecResDesc = resDescStructure.pop();
+			if(parentCompResDef.getComputingResourceTypeChoiceSequence() != null)
+			{
+				int computingResourceCount = parentCompResDef.getComputingResourceTypeChoiceSequence().getComputingResourceCount();
+				for (int i = 0; i < computingResourceCount; i++) {
+
+					schemas.ComputingResource compResDef = parentCompResDef.getComputingResourceTypeChoiceSequence().getComputingResource(i);
+					if(compResDef == null)
+						continue;
+					long compResCount = compResDef.getCount() > 1 ? compResDef.getCount() : 1;
+					
+					for(int j = 0; j < compResCount; j++){
+						if(compResDef.getComputingResourceTypeChoiceSequence2() != null){
+							String templateId = ((AnyNode)compResDef.getComputingResourceTypeChoiceSequence2().getTemplateId()).getFirstChild().getStringValue();
+							schemas.ComputingResourceTemplate template = environmentWrapper.getTemplate(templateId);
+							environmentWrapper.initWithCompResTemplate(compResDef, template);
+						} 
+						//toExamine.insertElementAt(compResDef, 0);
+						toExamine.addLast(compResDef);
+						ComputingResourceDescription resDesc = new ComputingResourceDescription(compResDef);
+						parentExecResDesc.addChildren(resDesc);
+						//resDescStructure.insertElementAt(resDesc, 0);
+						resDescStructure.addLast(resDesc);
+					}
+				}
+			} else
+				continue;
+		}
+		return mainCompResDescList;
+	}
+
+	protected List<ComputingResource> createResources(List<ComputingResourceDescription> mainCompResDesList) {
+
+		List<ComputingResource> mainCompResourceList = new ArrayList<ComputingResource>();
+		
+		Deque<ComputingResourceDescription> toExamine = new ArrayDeque<ComputingResourceDescription>();
+		Deque<ComputingResource> resStructure = new ArrayDeque<ComputingResource>();
+		
+		for(ComputingResourceDescription mainExecResDes : mainCompResDesList){
+			ComputingResource mainResource = ResourceFactory.createResource(mainExecResDes);
+			toExamine.push(mainExecResDes);
+			resStructure.push(mainResource);
+			mainCompResourceList.add(mainResource);
+		}
+
+		while (!toExamine.isEmpty()) {
+			ComputingResourceDescription parentResDesc = toExamine.pop();
+			ComputingResource parentResource = resStructure.pop();
+			toInit.add(parentResource);
+			List<AbstractResourceDescription> childrenResDesc = parentResDesc.getChildren();
+			if (childrenResDesc == null){
+				continue;
+			}
+			int compResCount = childrenResDesc.size();
+			for (int i = 0; i < compResCount; i++) {
+				ComputingResourceDescription compResDesc = (ComputingResourceDescription) childrenResDesc.get(i);
+				toExamine.push(compResDesc);
+				ComputingResource resource = ResourceFactory.createResource(compResDesc);
+				parentResource.addChild(resource);
+				resStructure.push(resource);
+			}
+		}
+		return mainCompResourceList;
+	}
+
+	protected Scheduler createSchedulers(schemas.Scheduler[] schedulersDef, List<ComputingResource> mainCompResourceList) throws Exception{
+
+		List<Scheduler> mainSchedulers = new ArrayList<Scheduler>();
+			
+		Deque<schemas.Scheduler> toExamine = new ArrayDeque<schemas.Scheduler>();	
+		Deque<Scheduler> schedulersStructure = new ArrayDeque<Scheduler>();
+		for(int i = 0; i < schedulersDef.length; i++){
+			schemas.Scheduler schedulerDef = schedulersDef[i];
+			Scheduler mainScheduler = initScheduler(schedulerDef, mainCompResourceList);
+			toExamine.push(schedulerDef);
+			schedulersStructure.push(mainScheduler);
+			mainSchedulers.add(mainScheduler);
+		}	
+	
+		while (!toExamine.isEmpty()) {
+			schemas.Scheduler parentSchedulerDef = toExamine.pop();
+		
+			Scheduler parentScheduler = null;
+			if(!schedulersStructure.isEmpty())
+				parentScheduler = schedulersStructure.pop();
+			
+			if(parentSchedulerDef.getSchedulerTypeChoice() == null)
+				continue;
+			int schedulerChoiceItemCount = parentSchedulerDef.getSchedulerTypeChoice().getSchedulerTypeChoiceItemCount();
+			for (int i = 0; i < schedulerChoiceItemCount; i++) {
+				schemas.Scheduler schedulerDef = parentSchedulerDef.getSchedulerTypeChoice().getSchedulerTypeChoiceItem(i).getScheduler();
+				if(schedulerDef == null)
+					continue;
+				else
+				{
+					Scheduler scheduler = initScheduler(schedulerDef, mainCompResourceList);
+					schedulersStructure.push(scheduler);
+					parentScheduler.addChild(scheduler);
+					toExamine.push(schedulerDef);
+				}
+			}
+			//necessary if children list isn't initialized in Scheduler
+			//parentScheduler.init();
+		}
+
+		//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")){
+			mainScheduler = mainSchedulers.get(0);
+		}
+		else{
+			SchedulingPlugin schedulingPlugin = (SchedulingPlugin) InstanceFactory.createInstance(globalSchedulingPluginName,
+					SchedulingPlugin.class);
+			TaskQueueList queues = new TaskQueueList(1);
+			TaskQueue queue = new TaskQueue(false);
+			queues.add(queue);
+			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);
+			}
+			//necessary if children list isn't initialized in Scheduler
+			//mainScheduler.init();
+		}
+		return mainScheduler;
+	}
+
+	protected Scheduler initScheduler(schemas.Scheduler schedulerDef, List<ComputingResource> mainCompResourceList) throws Exception{
+		Scheduler scheduler = null;
+		
+		ManagedResources managedResources = null;
+		//List<ComputingResource> managedCompResources = new ArrayList<ComputingResource>();
+		TaskQueueList queues = new TaskQueueList(1);
+		
+		if(schedulerDef.getQueue() != null && schedulerDef.getQueueCount() > 0){
+			int queueCount = schedulerDef.getQueueCount();
+			for(int i = 0; i < queueCount; i++){
+				schemas.QueueType queueDef = schedulerDef.getQueue(i);
+				TaskQueue queue = new TaskQueue(queueDef.getReservation());
+				queue.setName(queueDef.getName());
+				queue.setPriority(queueDef.getPriority());
+				queues.add(queue);
+			}
+		} else {
+			TaskQueue queue = new TaskQueue(false);
+			queues.add(queue);
+		}
+		
+		if(schedulerDef.getSchedulerTypeChoice() != null) {
+			int schedulerChoiceItemCount = schedulerDef.getSchedulerTypeChoice().getSchedulerTypeChoiceItemCount();
+			for (int i = 0; i < schedulerChoiceItemCount; i++) {
+				ManagedComputingResources mcr = schedulerDef.getSchedulerTypeChoice().getSchedulerTypeChoiceItem(i).getManagedComputingResources();
+				if(mcr == null)
+					continue;
+
+				List<String> managedCompResourcesIds = new ArrayList<String>();
+				int resourceNameCount = mcr.getResourceNameCount();
+				for(int j = 0; j < resourceNameCount; j++) { 
+					managedCompResourcesIds.add(mcr.getResourceName(j));
+				}
+				managedResources = matchResourcesForScheduler(mainCompResourceList, managedCompResourcesIds, mcr.getInclude());	
+				//managedResources = new ManagedResources(managedCompResources, new HashMap<ResourceUnitName, List<ResourceUnit>>());
+			}
+		}
+
+		SchedulingPlugin schedulingPlugin = null;
+		if(schedulerDef.getSchedulingPlugin() != null){
+			String schedulingPluginName = schedulerDef.getSchedulingPlugin().getName();
+			schedulingPlugin = (SchedulingPlugin) InstanceFactory.createInstance(schedulingPluginName,
+					SchedulingPlugin.class);
+			Parameters params = EnvironmentWrapper.extractParameters(schedulerDef.getSchedulingPlugin().getParameter());
+			if(schedulerDef.getSchedulingPlugin().getFrequency() != null)
+			{
+				Parameter param = new Parameter("frequency");
+				StringValueWithUnit sv = new StringValueWithUnit();
+				sv.setContent(String.valueOf(schedulerDef.getSchedulingPlugin().getFrequency().getContent()));
+				sv.setUnit(schedulerDef.getSchedulingPlugin().getFrequency().getUnit());
+				param.add(sv);
+				
+				if(params == null)
+					params = new Parameters();
+				params.put("frequency", param);
+			}
+			schedulingPlugin.init(params);
+		}	
+
+		//TODO - refactor (create scheduler in 1 line)
+		if(schedulerDef.getClazz().equals("GridBroker")){
+			scheduler = ResourceFactory.createScheduler(StandardResourceType.GS, "grid", schedulingPlugin, execTimeEstimationPlugin, queues, managedResources);
+		} else {
+			scheduler = ResourceFactory.createScheduler(StandardResourceType.LS, schedulerDef.getName(), schedulingPlugin, execTimeEstimationPlugin,  queues, managedResources);
+		}
+		return scheduler;
+	}
+	
+	/*private List<ComputingResource> matchCompResourcesForScheduler(List<ComputingResource> mainCompResourceList, List<String> resIdList, boolean include){
+		List<ComputingResource> compResources = new ArrayList<ComputingResource>();
+		for(ComputingResource mainCompRes: mainCompResourceList){
+			for(String resourceName : resIdList){
+				ComputingResource computingResource;
+				try {
+					if(resourceName.equals(mainCompRes.getName()))
+						computingResource = mainCompRes;
+					else
+						computingResource = mainCompRes.getDescendantByName(resourceName);
+				} catch (ResourceException e) {
+					computingResource = null;
+				}
+				if(computingResource != null)
+				{
+					if(include){
+						compResources.add(computingResource);
+					} else{
+						compResources.addAll(computingResource.getChildren());
+					}
+				}
+			}
+		}
+		return compResources;
+	}*/
+	
+	private ManagedResources matchResourcesForScheduler(List<ComputingResource> mainCompResourceList, List<String> resIdList, boolean include){
+		
+		List<ComputingResource> compResources = new ArrayList<ComputingResource>();
+		Map<ResourceUnitName, List<ResourceUnit>> resourceUnits = new HashMap<ResourceUnitName, List<ResourceUnit>>();
+		
+		for(ComputingResource mainCompRes: mainCompResourceList){
+			for(String resourceName : resIdList){
+				ComputingResource computingResource;
+				try {
+					if(resourceName.equals(mainCompRes.getName()))
+						computingResource = mainCompRes;
+					else
+						computingResource = mainCompRes.getDescendantByName(resourceName);
+				} catch (ResourceException e) {
+					continue;
+				}
+				if(computingResource != null)
+				{
+					if(include){
+						compResources.add(computingResource);
+					} else{
+						compResources.addAll(computingResource.getChildren());
+						resourceUnits = getSharedResourceUnits(computingResource);
+					}
+				}
+			}
+		}
+		return new ManagedResources(compResources, resourceUnits);
+	}
+	
+	
+	private Map<ResourceUnitName, List<ResourceUnit>> getSharedResourceUnits(ComputingResource compResources){
+		Map<ResourceUnitName, List<ResourceUnit>> resourceUnits = new HashMap<ResourceUnitName, List<ResourceUnit>>();
+		List<ResourceUnit> list;
+		boolean resourceNotVisited = true;
+		ComputingResource parent = compResources;
+		while(parent != null && resourceNotVisited){
+			Map<ResourceUnitName, List<ResourceUnit>> resUnits = parent.getResourceCharacteristic().getResourceUnits();
+			for(ResourceUnitName run : resUnits.keySet()){
+				for(ResourceUnit resUnit : resUnits.get(run)){
+					if((resourceUnits.get(run) == null)){
+						list = new ArrayList<ResourceUnit>(1);
+						resourceUnits.put(resUnit.getName(), list);
+						list.add(resUnit);
+					} else if(!resourceUnits.get(run).contains(resUnit)){
+						list = resourceUnits.get(resUnit.getName());
+						list.add(resUnit);
+					} else {
+						resourceNotVisited = false;
+					}
+				}
+			}
+			parent = parent.getParent();
+		}
+		return resourceUnits;
+	}
+	
+	private void prepareCalendar() {
+		long seed = 11L * 13L * 17L * 19L * 23L + 1L;
+		double timeZone = 0.0;
+		double peakLoad = 0.0; // the resource load during peak hour
+		double offPeakLoad = 0.0; // the resource load during off-peak hr
+		double holidayLoad = 0.0; // the resource load during holiday
+
+		// incorporates weekends so the grid resource is on 7 days a week
+		LinkedList<Integer> Weekends = new LinkedList<Integer>();
+		Weekends.add(java.util.Calendar.SATURDAY);
+		Weekends.add(java.util.Calendar.SUNDAY);
+
+		// incorporates holidays. However, no holidays are set in this example
+		LinkedList<Integer> Holidays = new LinkedList<Integer>();
+		resourceCalendar = new ResourceCalendar(timeZone, peakLoad, offPeakLoad, holidayLoad, Weekends, Holidays,
+				seed);
+	}
+	
+}
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 477)
@@ -0,0 +1,565 @@
+package simulator;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.util.MissingResourceException;
+import java.util.PropertyResourceBundle;
+import java.util.ResourceBundle;
+import java.util.logging.FileHandler;
+
+/**
+ * This aim of this class is to store all the configuration options passed to
+ * the program to steer its functionality. <br>
+ * As a general contract of this class, all fields, that store a path name to a
+ * folder will always be terminated with {@link File#separator} string.
+ * 
+ * @author Stanislaw Szczepanowski
+ * 
+ */
+public class ConfigurationOptions {
+
+	/*
+	 * =============================================================================================
+	 * Constants describing the contents of the resource bundle file
+	 * =============================================================================================
+	 */
+	/** 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";
+
+	/** The create scenario mode of the simulation */
+	public static final String CREATE_SCENARIO_MODIFIER = "createscenario";
+	/** The path to the file with the tasks description */
+	public static final String CREATE_SCENARIO_TASK_DESC = CREATE_SCENARIO_MODIFIER
+			+ ".tasksdesc";
+	/** The path to the output folder for generated tasks */
+	public static final String CREATE_SCENARIO_OUTPUT_FOLDER = CREATE_SCENARIO_MODIFIER
+			+ ".outputfolder";
+	/** The name of the workload file */
+	public static final String CREATE_SCENARIO_WORKLOAD_FILE = CREATE_SCENARIO_MODIFIER
+			+ ".workloadfilename";
+	/**
+	 * Shall the files in the output directory be overwritten, if the folder is
+	 * not empty
+	 */
+	public static final String CREATE_SCENARIO_OVERWRITE_FILES_MODIFIER = CREATE_SCENARIO_MODIFIER
+			+ ".overwrite_files";
+
+	/** The read scenario mode of the simulation */
+	public static final String READ_SCENARIO_MODIFIER = "readscenario";
+	/** The input folder with generated tasks */
+	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 */
+	public static final String READ_SCENARIO_WORKLOAD_FILE = READ_SCENARIO_MODIFIER
+			+ ".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_TASKS = CREATEDIAGRAMS + ".tasks";
+	public static final String CREATEDIAGRAMS_TASKSWAITINGTIME = CREATEDIAGRAMS + ".taskswaitingtime";
+	
+	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";
+	
+	/**
+	 * The main output folders base name
+	 */
+	public static final String STATS_OUTPUT_SUBFOLDER_NAME = "stats.outputfolder";
+	
+	public static final String USER_DN = "user.dn";
+	public static final String EXPERIMENT_ID = "experiment.id";
+	
+	public static final String NUMBER_OF_SIMULATIONS = "numberofsimulations";
+	
+	/**
+	 * Suffix for create scenario output folder
+	 */
+	public String statsOutputSubfolderNameCreate = null;
+	
+	/**
+	 * Suffix for read scenario output folder
+	 */
+	public String statsOutputSubfolderNameRerad = null;
+	
+	/* =============================================================================================== */
+	
+	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;
+
+	/**
+	 * the xml file name with resource description (according to the
+	 * HostParamSchema.xsd), e.g. simulator/schemas/ResourceDescription.xml
+	 */
+	public String resdescFileName = null;
+
+	/**
+	 * a xml file name (according to the simulator.schemas.WorkloadSchema.xsd)
+	 * with the description of jobs and tasks to be generated
+	 */
+	public String workloadDescFileName = null;
+
+	/**
+	 * the path to the folder, to which the generated xml job descriptions are
+	 * to be stored
+	 */
+	public String outputFolder = null;
+
+	/**
+	 * the name of the .swf simulator.workload file into which the
+	 * simulator.workload is to be written (it will be stored in the
+	 * outputFolder folder)
+	 */
+	public String outputWorkloadFileName = DEFAULT_WORKLOAD_FILE_NAME;
+
+	/**
+	 * the path to the folder where previously generated xml jobs descriptions
+	 * are stored
+	 */
+	public String inputFolder = null;
+	
+	public String inputTar = null;
+
+	/**
+	 * the name of the .swf simulator.workload file in the inputFolder folder
+	 */
+	public String inputWorkloadFileName = DEFAULT_WORKLOAD_FILE_NAME;
+
+	/**
+	 * a txt file name with topology description
+	 */
+	public String networkTopologyFileName = null;
+	
+	/**
+	 * Shows the mode of the simulator: true if it is the create scenario, false
+	 * if it is the read scenario mode
+	 */
+	public boolean createScenario = false;
+	
+	public boolean createXMLSupplement = false;
+
+	/**
+	 * true if the outputFolder is not empty and shall be overwritten, false
+	 * otherwise
+	 */
+	public boolean overwriteFiles = false;
+
+	/**
+	 * true if the history files are to be generated (makes the simulation
+	 * slower)
+	 */
+	public boolean printHistory = false;
+	
+	/**
+	 * The number of simulation runs that is to be performed. Default value is <code>1</code>.
+	 */
+	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 createjobsstatistics = true;
+	public boolean createsimulationstatistics = true;
+	public boolean formatstatisticsoutput = false;
+	
+	public static final String ENV_DESC_MODIFIER = "envdesc";
+	public String envDescFileName = null;
+	/**
+	 * An empty constructor.
+	 */
+	protected ConfigurationOptions() {
+	}
+
+	/**
+	 * A static method used to read a resource bundle file and set all the
+	 * fields in this class according to the contents of the file
+	 * 
+	 * @param resBundleFileName
+	 *            the path to the resource bundle file that stores the
+	 *            configuration
+	 * @return a ConfigurationOptions object with information set according to
+	 *         the properties file, <code>null</code> if any exception occurs
+	 */
+	public static ConfigurationOptions getConfiguration(String resBundleFileName) {
+
+		ConfigurationOptions co = new ConfigurationOptions();
+		File resBundleFile = new File(resBundleFileName);
+		ResourceBundle bundle = null;
+		try {
+			bundle = new PropertyResourceBundle(new FileInputStream(resBundleFile));
+		} catch (FileNotFoundException e) {
+			e.printStackTrace();
+			return null;
+		} catch (IOException e) {
+			e.printStackTrace();
+			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 {
+			co.workloadDescFileName = bundle.getString(CREATE_SCENARIO_TASK_DESC);
+			co.outputFolder = getSeparatorTerminatedPath(bundle
+					.getString(CREATE_SCENARIO_OUTPUT_FOLDER));
+			File f = new File(co.outputFolder);
+			String parent = f.getParent();
+			// output folder will have the same parent as the task description
+			// file
+			if (parent == null) {
+				f = new File(co.workloadDescFileName);
+				parent = f.getParent();
+				co.outputFolder = new File(parent, co.outputFolder)
+						.getAbsolutePath();
+				co.outputFolder = getSeparatorTerminatedPath(co.outputFolder);
+			}
+			co.outputWorkloadFileName = bundle
+					.getString(CREATE_SCENARIO_WORKLOAD_FILE);
+			co.overwriteFiles = Boolean.valueOf(
+					bundle.getString(CREATE_SCENARIO_OVERWRITE_FILES_MODIFIER))
+					.booleanValue();
+			co.createScenario = true; // success
+
+		} catch (MissingResourceException e) {
+			co.createScenario = false; // do not create scenario
+		}
+
+
+		try {
+			co.networkTopologyFileName = bundle
+					.getString(NETWORK_TOPOLOGY_FILE_MODIFIER);
+		} catch(MissingResourceException e){
+			co.networkTopologyFileName = null;
+		}
+		
+		if (co.createScenario == false) {
+			// read scenario
+			try {
+				co.inputFolder = getSeparatorTerminatedPath(bundle
+					.getString(READ_SCENARIO_INPUT_FOLDER));
+			} catch (MissingResourceException e) {
+				co.inputFolder = null;
+			}
+			
+			try {
+				co.inputTar = getSeparatorTerminatedPath(bundle
+					.getString(READ_SCENARIO_INPUT_TAR));
+			} catch (MissingResourceException e) {
+				co.inputTar = null;
+			}
+			
+			try {
+				co.inputWorkloadFileName = bundle
+						.getString(READ_SCENARIO_WORKLOAD_FILE);
+			} catch (MissingResourceException e){
+				co.inputWorkloadFileName = null;
+			}
+		}
+
+		try {
+			
+			if(Boolean.parseBoolean(
+					bundle.getString(CREATE_XML_SUPPLEMENT_FILES)))
+				co.createXMLSupplement = true;
+			else
+				co.createXMLSupplement = false;
+			
+		} catch (MissingResourceException e){
+			co.createXMLSupplement = false;
+		}
+		
+		try {
+			co.printHistory = Boolean.valueOf(
+					bundle.getString(PRINT_HISTORY_MODIFIER)).booleanValue();
+		} catch(MissingResourceException e){
+			co.printHistory = false;
+		}
+		
+		// create diagrams
+		
+		boolean createDiagrams = true;
+		try {
+			createDiagrams = Boolean.valueOf(
+					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;
+		}
+		try {
+			co.creatediagrams_resources_scale = Double.valueOf(
+					bundle.getString(CREATEDIAGRAMS_RESOURCES_SCALE)).doubleValue();
+		} catch(MissingResourceException e){
+			co.creatediagrams_resources_scale = -1;
+		}
+		try {
+			co.creatediagrams_energyusage = Boolean.valueOf(
+					bundle.getString(CREATEDIAGRAMS_ENERGYUSAGE)).booleanValue() && createDiagrams;
+		} catch(MissingResourceException e){
+			co.creatediagrams_energyusage = createDiagrams;
+		}
+		try {
+			co.creatediagrams_tasks = Boolean.valueOf(
+					bundle.getString(CREATEDIAGRAMS_TASKS)).booleanValue() && createDiagrams;
+		} catch(MissingResourceException e){
+			co.creatediagrams_tasks = createDiagrams;
+		}
+		try {
+			co.creatediagrams_taskswaitingtime = Boolean.valueOf(
+					bundle.getString(CREATEDIAGRAMS_TASKSWAITINGTIME)).booleanValue() && createDiagrams;
+		} catch(MissingResourceException e){
+			co.creatediagrams_taskswaitingtime = createDiagrams;
+		}
+		
+		
+		try {
+			co.statsOutputSubfolderNameCreate = bundle.getString(STATS_OUTPUT_SUBFOLDER_NAME);
+			co.statsOutputSubfolderNameRerad = co.statsOutputSubfolderNameCreate;
+		} catch(MissingResourceException e){
+			co.statsOutputSubfolderNameCreate = "stats_create";
+			co.statsOutputSubfolderNameRerad = "stats_read";
+		}
+
+		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();
+		} catch(MissingResourceException e){
+			co.createjobsstatistics = true;
+		}
+		try {
+			co.createsimulationstatistics = Boolean.valueOf(
+					bundle.getString(SIMULATION_STATISTICS)).booleanValue();
+		} catch(MissingResourceException e){
+			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();
+		} catch(MissingResourceException e){
+			co.numberOfSimulations = 1;
+		}
+		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;
+	}
+
+	public static String getSeparatorTerminatedPath(String path) {
+		if (path.endsWith(File.separator))
+			return new String(path);
+		else {
+			StringBuilder result = new StringBuilder(path.length()
+					+ File.separator.length());
+			result.append(path);
+			result.append(File.separator);
+			return result.toString();
+		}
+	}
+	
+	public void setNumberOfSimulations(int numberOfSimulations) {
+		this.numberOfSimulations = numberOfSimulations;
+	}
+	
+	public int getNumberOfSimulations() {
+		return numberOfSimulations;
+	}
+	
+	public void setWorkloadDescFileName(String workloadDescFileName) {
+		this.workloadDescFileName = workloadDescFileName;
+	}
+	
+	public String getWorkloadDescFileName() {
+		return workloadDescFileName;
+	}
+}
Index: DCWoRMS/trunk/build/classes/simulator/factory/JobRandomNubersFactory.java
===================================================================
--- DCWoRMS/trunk/build/classes/simulator/factory/JobRandomNubersFactory.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/simulator/factory/JobRandomNubersFactory.java	(revision 477)
@@ -0,0 +1,466 @@
+package simulator.factory;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.impl.LogFactoryImpl;
+
+import cern.jet.random.AbstractDistribution;
+import eduni.simjava.distributions.PeriodicGenerator;
+
+import simulator.RandomNumbers;
+import simulator.workload.generator.configuration.ComputingResourceHostParameter;
+import simulator.workload.generator.configuration.Dist;
+import simulator.workload.generator.configuration.ExecDuration;
+import simulator.workload.generator.configuration.ExecutionTime;
+import simulator.workload.generator.configuration.ExecutionTimeChoice;
+import simulator.workload.generator.configuration.Importance;
+import simulator.workload.generator.configuration.JobCount;
+import simulator.workload.generator.configuration.JobInterval;
+import simulator.workload.generator.configuration.JobPackageLength;
+import simulator.workload.generator.configuration.Max;
+import simulator.workload.generator.configuration.Min;
+import simulator.workload.generator.configuration.MultiDistribution;
+import simulator.workload.generator.configuration.OutputFileSize;
+import simulator.workload.generator.configuration.Parameter;
+import simulator.workload.generator.configuration.ParentCard;
+import simulator.workload.generator.configuration.ParentStates_OR;
+import simulator.workload.generator.configuration.PeriodDuration;
+import simulator.workload.generator.configuration.PeriodEnd;
+import simulator.workload.generator.configuration.PeriodStart;
+import simulator.workload.generator.configuration.PeriodicValidValues;
+import simulator.workload.generator.configuration.PrecedingConstraints;
+import simulator.workload.generator.configuration.Preferences;
+import simulator.workload.generator.configuration.RandParams;
+import simulator.workload.generator.configuration.RandParamsSequence;
+import simulator.workload.generator.configuration.Range;
+import simulator.workload.generator.configuration.RunSameHost;
+import simulator.workload.generator.configuration.TaskCount;
+import simulator.workload.generator.configuration.TaskLength;
+import simulator.workload.generator.configuration.Trigger;
+import simulator.workload.generator.configuration.Triggers;
+import simulator.workload.generator.configuration.Value;
+import simulator.workload.generator.configuration.WorkflowLevel;
+import simulator.workload.generator.configuration.WorkloadConfiguration;
+
+
+public class JobRandomNubersFactory {
+
+	protected String triggerNames[];
+	
+	private static Log log = LogFactoryImpl.getLog(JobRandomNubersFactory.class);
+	
+	/**
+	 * 
+	 * @param workload
+	 * @param jobCountDescriptor
+	 * @param taskCountDescriptor
+	 * @param taskLengthDescriptor
+	 * @param tasksDistanceDescriptor
+	 * @param tasksPackageLengthDescriptor
+	 * @param taskWaitTimeDescriptor
+	 * @return
+	 */
+	public RandomNumbers initParameterRandomNumbers(
+							WorkloadConfiguration workload){
+		
+		RandomNumbers parameterRandomNumbers = new RandomNumbers();
+		String name = null;
+
+		if (workload.getWorkloadConfigurationChoice().getJobCount() != null) {
+			JobCount jobCount = workload.getWorkloadConfigurationChoice().getJobCount();
+			name = getGeneratorName(jobCount);
+			if(log.isDebugEnabled()){
+				log.debug("Creating genrator for JobCount. Generator id: " + name);
+			}
+			addRandomNumbers(parameterRandomNumbers, jobCount, name);
+		}
+
+		TaskCount taskCount = workload.getTaskCount();
+		name = getGeneratorName(taskCount);
+		if(log.isDebugEnabled()){
+			log.debug("Creating genrator for TaskCount range.min. Generator id: " + name);
+		}
+		addRandomNumbers(parameterRandomNumbers, taskCount, name);
+		
+		TaskLength taskLength = workload.getTaskLength();
+		name  = getGeneratorName(taskLength);
+		if(log.isDebugEnabled()){
+			log.debug("Creating genrator for TaskLength range.min. Generator id: " + name);
+		}
+		addRandomNumbers(parameterRandomNumbers, taskLength, name);
+
+		JobInterval jobInterval = workload.getJobInterval();
+		name = getGeneratorName(jobInterval);
+		if(log.isDebugEnabled()){
+			log.debug("Creating genrator for JobInterval range.min. Generator id: " + name);
+		}
+		addRandomNumbers(parameterRandomNumbers, jobInterval, name);
+
+		JobPackageLength jobPackageLength = workload.getJobPackageLength();
+		name = getGeneratorName(jobPackageLength);
+		if(log.isDebugEnabled()){
+			log.debug("Creating genrator for JobPackageLength range.min. Generator id: " + name);
+		}
+		addRandomNumbers(parameterRandomNumbers, jobPackageLength, name);
+
+		return parameterRandomNumbers; 
+	}
+	
+	/**
+	 * 
+	 * @param workload
+	 * @param maxDescriptor
+	 * @param minDescriptor
+	 * @param valueDescriptor
+	 * @return
+	 */
+	public RandomNumbers initHardConstraintsRandomNumbers(WorkloadConfiguration workload){
+		
+		RandomNumbers hardConstraintsRandomNumbers = new RandomNumbers();
+		
+		ComputingResourceHostParameter[] hardConstraints = workload.getComputingResourceHostParameter();
+		if (hardConstraints != null && hardConstraints.length > 0) {
+			for (int i = 0; i < hardConstraints.length; ++i) {
+				ComputingResourceHostParameter hardConstraint = hardConstraints[i];
+				String name = hardConstraint.getMetric();
+
+				Range[] ranges = hardConstraint.getRange();
+				for (int r = 0; r < ranges.length; ++r) {
+					Range range = ranges[r];
+					Max max = range.getMax();
+					if (max != null) {
+						String maxName = getGeneratorName(max);
+						if(log.isDebugEnabled()){
+							log.debug("Creating genrator for " + name + " " + r + " range.min. Generator id: " + maxName);
+						}
+						addRandomNumbers(hardConstraintsRandomNumbers, max, maxName);
+					}
+					Min min = range.getMin();
+					if (min != null) {
+						String minName = getGeneratorName(min);
+						if(log.isDebugEnabled()){
+							log.debug("Creating genrator for " + name + " " + r + " range.min. Generator id: " + minName);
+						}
+						addRandomNumbers(hardConstraintsRandomNumbers, min, minName);
+					}
+				}
+
+				Value[] values = hardConstraint.getValue();
+				for (int v = 0; v < values.length; ++v) {
+					Value value = values[v];
+					String valueName = getGeneratorName(value);
+					if(log.isDebugEnabled()){
+						log.debug("Creating genrator for " + name + " " + v + " value. Generator id: "+valueName);
+					}
+					addRandomNumbers(hardConstraintsRandomNumbers, value, valueName);
+				}			
+			}
+		}
+		
+		return hardConstraintsRandomNumbers;
+	}
+	
+	/**
+	 * 
+	 * @param workload
+	 * @param indiffThresholdDescriptor
+	 * @param importanceDescriptor
+	 * @return
+	 */
+	public RandomNumbers initSoftConstraintsRandomNumbers(WorkloadConfiguration workload){
+		
+		RandomNumbers softConstraintsRandomNumbers = new RandomNumbers();
+		String name;
+		String detailName;
+		Preferences softConstraints = workload.getPreferences();
+		if (softConstraints != null) {
+			Parameter[] constraints = softConstraints.getParameter();
+			for (int i = 0; i < constraints.length; ++i) {
+				Parameter constraint = constraints[i];
+				//the name is a big concatenation
+				name = constraint.getName();
+				
+				Importance importance = constraint.getImportance();
+				detailName = getGeneratorName(importance);
+				
+				if(log.isDebugEnabled()){
+					log.debug("Creating genrator for parameter " + name + " importance. Generator id: " + detailName);
+				}
+				addRandomNumbers(softConstraintsRandomNumbers, importance, detailName);
+				
+				Range rangeTab[] = constraint.getRange();
+				if(rangeTab != null && rangeTab.length > 0){
+					Range range = rangeTab[0];
+					Min min = range.getMin();
+					detailName = getGeneratorName(min);
+					if(log.isDebugEnabled()){
+						log.debug("Creating genrator for parameter " + name + " range.min. Generator id: " + detailName);
+					}
+					addRandomNumbers(softConstraintsRandomNumbers, min, detailName);
+					
+					Max max = range.getMax();
+					detailName = getGeneratorName(max);
+					if(log.isDebugEnabled()){
+						log.debug("Creating genrator for parameter " + name + " range.max. Generator id: " + detailName);
+					}
+					
+					addRandomNumbers(softConstraintsRandomNumbers, max, detailName);
+				}
+				
+				Value value = constraint.getValue();
+				if(value != null){
+					detailName = getGeneratorName(value);
+					if(log.isDebugEnabled()){
+						log.debug("Creating genrator for parameter " + name + " value. Generator id: " + detailName);
+					}
+					
+					addRandomNumbers(softConstraintsRandomNumbers, value, detailName);
+				}
+			}
+		}
+
+		return softConstraintsRandomNumbers;
+	}
+	
+	
+	/**
+	 * 
+	 * @param workload
+	 * @return
+	 */
+	public RandomNumbers initTimeConstraintsRandomNumbers(WorkloadConfiguration workload){
+		RandomNumbers timeConstraintsRandomNumbers = new RandomNumbers();
+		ExecutionTime timeConstraints = workload.getExecutionTime();
+		
+		if(timeConstraints != null) {
+			String name = null;
+			PeriodStart periodStart = timeConstraints.getPeriodStart();
+			if(periodStart != null){
+				name = getGeneratorName(periodStart);
+				if(log.isDebugEnabled()){
+					log.debug("Creating genrator for parameter ExecutionTime.PeriodStart Generator id: " + name);
+				}
+				addRandomNumbers(timeConstraintsRandomNumbers, periodStart, name);
+			}
+			
+			ExecDuration execDuration = timeConstraints.getExecDuration();
+			if(execDuration != null){
+				name = getGeneratorName(execDuration);
+				if(log.isDebugEnabled()){
+					log.debug("Creating genrator for parameter ExecutionTime.ExecutionDuration Generator id: " + name);
+				}
+				addRandomNumbers(timeConstraintsRandomNumbers, execDuration, name);
+			}
+			
+			ExecutionTimeChoice choice = timeConstraints.getExecutionTimeChoice();
+			if(choice != null) {
+		
+				PeriodDuration periodDuration = choice.getPeriodDuration();
+				if(periodDuration != null){
+					name = getGeneratorName(periodDuration);
+					if(log.isDebugEnabled()){
+						log.debug("Creating genrator for parameter ExecutionTime.PeriodDuration Generator id: " + name);
+					}
+					addRandomNumbers(timeConstraintsRandomNumbers, periodDuration, name);
+				}
+				
+				PeriodEnd periodEnd = choice.getPeriodEnd();
+				if(periodEnd != null) {
+					name = getGeneratorName(periodEnd);
+					if(log.isDebugEnabled()){
+						log.debug("Creating genrator for parameter ExecutionTime.PeriodEnd Generator id: " + name);
+					}
+					addRandomNumbers(timeConstraintsRandomNumbers, periodEnd, name);
+				}
+			}
+		}
+		return timeConstraintsRandomNumbers;
+	}
+	
+	
+	/**
+	 * 
+	 * @param workload
+	 * @return
+	 */
+	public RandomNumbers initPrecedingConstraintsRandomNumbers(WorkloadConfiguration workload){
+		RandomNumbers precedingConstraintsRandomNumbers = new RandomNumbers();
+		PrecedingConstraints constraints = workload.getPrecedingConstraints();
+		
+		if(constraints == null) 
+			return precedingConstraintsRandomNumbers;
+		
+		ParentCard parentCard = constraints.getParentCard();
+		String name = null;
+		
+		if(parentCard != null){
+			name = getGeneratorName(parentCard);
+			if(log.isDebugEnabled()){
+				log.debug("Creating genrator for PrecedingConstraints.ParentCard Generator id: " + name);
+			}
+			addRandomNumbers(precedingConstraintsRandomNumbers, parentCard, name);
+		}
+		
+		WorkflowLevel workflowLevel = constraints.getWorkflowLevel();
+		if(workflowLevel != null){
+			name = getGeneratorName(workflowLevel);
+			if(log.isDebugEnabled()){
+				log.debug("Creating genrator for PrecedingConstraints.WorkflowLevel Generator id: " + name);
+			}
+			addRandomNumbers(precedingConstraintsRandomNumbers, workflowLevel, name);
+		}
+		
+		OutputFileSize outputFileSize = constraints.getOutputFileSize();
+		if(outputFileSize != null){
+			name = getGeneratorName(outputFileSize);
+			if(log.isDebugEnabled()){
+				log.debug("Creating genrator for PrecedingConstraints.OutputFileSize Generator id: " + name);
+			}
+			addRandomNumbers(precedingConstraintsRandomNumbers, outputFileSize, name);
+		}
+		
+		ParentStates_OR parentStates = constraints.getParentStates_OR();
+		if(parentStates != null){
+			name = getGeneratorName(parentStates);
+			if(log.isDebugEnabled()){
+				log.debug("Creating genrator for PrecedingConstraints.ParentStates_OR Generator id: " + name);
+			}
+			addRandomNumbers(precedingConstraintsRandomNumbers, parentStates, name);
+		}
+		
+		RunSameHost runSameHost = constraints.getRunSameHost();
+		if(runSameHost != null){
+			name = getGeneratorName(runSameHost);
+			if(log.isDebugEnabled()){
+				log.debug("Creating genrator for PrecedingConstraints.RunSameHost Generator id: " + name);
+			}
+			addRandomNumbers(precedingConstraintsRandomNumbers, runSameHost, name);
+		}
+		
+		Trigger trigger;
+		Triggers triggers = constraints.getTriggers();
+		String tname;
+		if(triggers != null){
+			triggerNames = new String[triggers.getTriggerCount()];
+			
+			for(int i = 0; i < triggers.getTriggerCount(); i++){
+				trigger = triggers.getTrigger(i);
+				triggerNames[i] = (String)trigger.getName();
+				tname = getGeneratorName(trigger);
+				if(log.isDebugEnabled()){
+					log.debug("Creating genrator for PrecedingConstraints.Trigger " + triggerNames[i] + " Generator id: " + tname);
+				}
+				addRandomNumbers(precedingConstraintsRandomNumbers, trigger, tname);
+			}
+		}
+		
+		return precedingConstraintsRandomNumbers;
+	}
+	
+	protected RandomNumbers addPeriodicValidValues(RandomNumbers randomNumbers, RandParams params, String name){
+		PeriodicValidValues values[];
+		int len = 0;
+		
+		if(params.getRandParamsSequence() == null)
+			return randomNumbers;
+		
+		len = params.getRandParamsSequence().getPeriodicValidValuesCount();
+		if(len == 0)
+			return randomNumbers;
+		
+		values = params.getRandParamsSequence().getPeriodicValidValues();
+		for(int i = 0; i < values.length; i++){
+			if(randomNumbers.addRandomGenerator(name, values[i])){
+				if(values[i].getId() != null){
+					randomNumbers.addIdGeneratorNameMapping(values[i].getId(), name);
+				}
+			}
+		}
+		return randomNumbers;
+	}
+	
+	protected RandomNumbers addDetailDistributions(RandomNumbers randomNumbers, RandParams params, String name){
+		MultiDistribution md = null;
+		Dist distTable[] = null;
+		
+		md = params.getMultiDistribution();
+		if(md == null)
+			return randomNumbers;
+		
+		distTable = md.getDist();
+		for(int i = 0; i < distTable.length; i++){
+			if(randomNumbers.addRandomGenerator(name, distTable[i])){
+				if(distTable[i].getId() != null)
+					randomNumbers.addIdGeneratorNameMapping(distTable[i].getId(), name);
+			}
+		}
+		return randomNumbers;
+	}
+	
+	public boolean addRandomNumbers(RandomNumbers rn, RandParams rp, String name) {
+		MultiDistribution md = null;
+		RandParamsSequence randParamSeq = null;
+		AbstractDistribution generator;
+		
+		md = rp.getMultiDistribution();
+		randParamSeq = rp.getRandParamsSequence();
+		
+		// if simple generator definition is used
+		if(md == null && randParamSeq == null){
+		
+			if(rn.addRandomGenerator(rp.getDistribution().getType(), rp.hasAvg(), rp.getAvg(), rp.getStdev(), 
+								rp.hasMin(), rp.getMin(), rp.hasMax(), rp.getMax(), rp.hasSeed(), rp.getSeed(), name)) {
+				if(rp.getId() != null)
+					rn.addIdGeneratorNameMapping(rp.getId(), name);
+				return true;
+			} else {
+				return false;
+			}
+				
+		
+		} else if(md != null && randParamSeq == null){ // if multidistribution is used
+			/*
+			 * TODO Marcin: dopelnienie do 1 (do 100%) moze zostac zdefiniowane w glownym elemencie
+			 * Sprawdzic czy faktycznie potrzeba uzupelnienia do 100%, a nastepnie
+			 * trzeba by dodac tak opisany generator za pomoca rn.addRandomGenerator(parameterName, detailDist)
+			 */ 
+			addDetailDistributions(rn, rp, name);
+			if(rp.getId() != null)
+				rn.addIdGeneratorNameMapping(rp.getId(), name);
+			
+		} else if(md == null && randParamSeq != null){ // if periodic valid values are used
+			
+			generator = rn.createRandomGenerator(rp.getDistribution().getType(), rp.hasAvg(), rp.getAvg(), 
+								rp.getStdev(), rp.hasMin(), rp.getMin(), rp.hasMax(), rp.getMax(), rp.hasSeed(), rp.getSeed(), name);
+			if(generator == null)
+				throw new RuntimeException("Define default generator (which will be valid for whole simulation time) for "+name);
+			
+			PeriodicGenerator pg = new PeriodicGenerator(generator);
+			rn.addRandomGenerator(name, pg);
+			
+			addPeriodicValidValues(rn, rp, name);
+			if(rp.getId() != null)
+				rn.addIdGeneratorNameMapping(rp.getId(), name);
+			
+		} else {
+			throw new RuntimeException("Use Multidistribution _OR_ Periodic valid values. This two things can not be used togeter.");
+		}
+		
+		return true; 
+	}
+	
+	
+	
+	/**
+	 * 
+	 * @return
+	 */
+	public String[] getTriggerNames(){
+		return triggerNames;
+	}
+	
+	public static String getGeneratorName(Object object){
+		return String.valueOf(object.hashCode());
+	}
+	
+}
+
Index: DCWoRMS/trunk/build/classes/test/.castor.cdr
===================================================================
--- DCWoRMS/trunk/build/classes/test/.castor.cdr	(revision 477)
+++ DCWoRMS/trunk/build/classes/test/.castor.cdr	(revision 477)
@@ -0,0 +1,61 @@
+-- listing properties --
+test.Templates=test.TemplatesDescriptor
+test.TimeEstimationPluginType=test.TimeEstimationPluginTypeDescriptor
+test.ComputingResourceInterfaceChoice3=test.ComputingResourceInterfaceChoice...
+test.Environment=test.EnvironmentDescriptor
+test.EnergyEstimationPlugin=test.EnergyEstimationPluginDescriptor
+test.Scheduler=test.SchedulerDescriptor
+test.ComputingResourceInterfaceChoice2=test.ComputingResourceInterfaceChoice...
+test.ResourceParameter=test.ResourceParameterDescriptor
+test.ComputingResourceTemplateType=test.ComputingResourceTemplateTypeDes...
+test.ParameterType=test.ParameterTypeDescriptor
+test.Resources=test.ResourcesDescriptor
+test.EnergyEstimationPluginType=test.EnergyEstimationPluginTypeDescri...
+test.ComputingResourceTypeChoice2=test.ComputingResourceTypeChoice2Desc...
+test.SchedulerType=test.SchedulerTypeDescriptor
+test.EnergyEstimationPluginTypeChoiceItem=test.EnergyEstimationPluginTypeChoice...
+test.ComputingResourceParameterType=test.ComputingResourceParameterTypeDe...
+test.PStateType=test.PStateTypeDescriptor
+test.PStatesType=test.PStatesTypeDescriptor
+test.ListOfManagedResources=test.ListOfManagedResourcesDescriptor
+test.EnergyParameter=test.EnergyParameterDescriptor
+test.ComputingResourceTemplate=test.ComputingResourceTemplateDescriptor
+test.PowerStateType=test.PowerStateTypeDescriptor
+test.OtherParameter=test.OtherParameterDescriptor
+test.EnergyStatesTransitionType=test.EnergyStatesTransitionTypeDescri...
+test.EnergyPowerProfileTypeChoice=test.EnergyPowerProfileTypeChoiceDesc...
+test.EnergyEstimationPluginTypeChoice=test.EnergyEstimationPluginTypeChoice...
+test.ResourceList=test.ResourceListDescriptor
+test.EnergyPowerProfile=test.EnergyPowerProfileDescriptor
+test.ComputingResourceInterfaceChoice=test.ComputingResourceInterfaceChoice...
+test.Transition=test.TransitionDescriptor
+test.LocationType=test.LocationTypeDescriptor
+test.PowerStates=test.PowerStatesDescriptor
+test.SchedulingPlugin=test.SchedulingPluginDescriptor
+test.ComputingResource=test.ComputingResourceDescriptor
+test.ManagedComputingResource=test.ManagedComputingResourceDescriptor
+test.ComputingResourceTypeChoice=test.ComputingResourceTypeChoiceDescr...
+test.Location=test.LocationDescriptor
+test.SchedulingPluginType=test.SchedulingPluginTypeDescriptor
+test.SchedulingParameter=test.SchedulingParameterDescriptor
+test.PowerStatesTypeItem=test.PowerStatesTypeItemDescriptor
+test.PStatesTypeItem=test.PStatesTypeItemDescriptor
+test.ComputingResourceInterfaceChoiceItem=test.ComputingResourceInterfaceChoice...
+test.SizeType=test.SizeTypeDescriptor
+test.ComputingResourceInterface=test.ComputingResourceInterfaceDescri...
+test.EnergyPowerProfileTypeChoiceItem=test.EnergyPowerProfileTypeChoiceItem...
+test.ComputingResourceType=test.ComputingResourceTypeDescriptor
+test.ManagedComputingResourceType=test.ManagedComputingResourceTypeDesc...
+test.Resource=test.ResourceDescriptor
+test.SchedulerTypeChoice=test.SchedulerTypeChoiceDescriptor
+test.SchedulerTypeChoiceItem=test.SchedulerTypeChoiceItemDescriptor
+test.EnergyPowerProfileType=test.EnergyPowerProfileTypeDescriptor
+test.PowerState=test.PowerStateDescriptor
+test.PState=test.PStateDescriptor
+test.TimeEstimationPlugin=test.TimeEstimationPluginDescriptor
+test.Size=test.SizeDescriptor
+test.PowerStatesType=test.PowerStatesTypeDescriptor
+test.Property=test.PropertyDescriptor
+test.ResourceListItem=test.ResourceListItemDescriptor
+test.OtherParameterType=test.OtherParameterTypeDescriptor
+test.PStates=test.PStatesDescriptor
Index: DCWoRMS/trunk/build/classes/test/stress/AbstractExperimentsGenerator.java
===================================================================
--- DCWoRMS/trunk/build/classes/test/stress/AbstractExperimentsGenerator.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/test/stress/AbstractExperimentsGenerator.java	(revision 477)
@@ -0,0 +1,195 @@
+package test.stress;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.nio.channels.FileChannel;
+import java.util.Enumeration;
+import java.util.Properties;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * Abstract class with methods useful for generating range of experiments.
+ * 
+ * @author Jarek Szymczak
+ * @version $Id$
+ */
+public abstract class AbstractExperimentsGenerator {
+
+	/** Class logger. */
+	private static final Log LOGGER =
+			LogFactory.getLog(AbstractExperimentsGenerator.class);
+
+	/**
+	 * Copy files with tasks limitations (at least it's written to do it, it can
+	 * copy other things - depending on variables).
+	 * 
+	 * @param n
+	 *            number of files to copy
+	 * @param sourceFolderPath
+	 *            the source folder path
+	 * @param destinationFolderPath
+	 *            the destination folder path
+	 * @param variables
+	 *            variables from file "properties/variables.properties", this
+	 *            variable contains i.e. templates with file names, etc.
+	 */
+	protected void copyFiles(long n, String sourceFolderPath,
+			String destinationFolderPath, Properties variables) {
+		File dir = new File(destinationFolderPath);
+		if (dir.exists())
+			deleteDirectory(dir);
+		try {
+			dir.mkdirs();
+		} catch (SecurityException e) {
+			LOGGER
+					.error("Security violation while trying to create directories: "
+							+ dir.getAbsolutePath() + "!");
+		}
+		try {
+			for (long i = 0; i < n; i++) {
+				String fileName =
+						"/"
+								+ (i < 10 ? variables
+										.getProperty("DIGIT_JOB_TEMPLATE")
+										: variables
+												.getProperty("NUMBER_JOB_TEMPLATE"))
+								+ Long.toString(i)
+								+ variables.getProperty("JOB_EXTENSION");
+				copyFile(sourceFolderPath + fileName, destinationFolderPath
+						+ fileName);
+			}
+		} catch (Exception e) {
+			LOGGER.error("Error while copying experimnets files!");
+		}
+
+	}
+
+	/**
+	 * Copies file from source path to destination path - if destination file
+	 * exists it will be overwritten.
+	 * 
+	 * @param sourceFilePath
+	 *            the source file path
+	 * @param destFilePath
+	 *            the dest file path
+	 * @throws IOException
+	 *             Signals that an I/O exception has occurred.
+	 */
+	protected static void copyFile(String sourceFilePath, String destFilePath)
+			throws IOException {
+
+		File sourceFile = new File(sourceFilePath);
+		File destFile = new File(destFilePath);
+
+		if (!destFile.exists()) {
+			try {
+				destFile.createNewFile();
+			} catch (SecurityException e) {
+				LOGGER.error("Security violation while trying to create file: "
+						+ destFile.getAbsolutePath() + "!");
+			}
+		}
+
+		FileChannel source = null;
+		FileChannel destination = null;
+		try {
+			source = new FileInputStream(sourceFile).getChannel();
+			destination = new FileOutputStream(destFile).getChannel();
+			destination.transferFrom(source, 0, source.size());
+		} finally {
+			if (source != null)
+				source.close();
+			if (destination != null)
+				destination.close();
+		}
+	}
+
+	/**
+	 * Deletes directory.
+	 * 
+	 * @param path
+	 *            the path
+	 * @return true, if successful
+	 */
+	protected boolean deleteDirectory(File path) {
+		if (path.exists()) {
+			File[] files = path.listFiles();
+			for (int i = 0; i < files.length; i++) {
+				if (files[i].isDirectory()) {
+					deleteDirectory(files[i]);
+				} else {
+					try {
+						files[i].delete();
+					} catch (SecurityException e) {
+						LOGGER
+								.error("Security violation while trying to delete file: "
+										+ files[i].getAbsolutePath() + "!");
+					}
+				}
+			}
+		}
+		return (path.delete());
+	}
+
+	/**
+	 * Substitutes variables in input and returns output.
+	 * 
+	 * @param input
+	 *            the input with variables
+	 * @param variables
+	 *            the variables
+	 * @return the output with replaced variables
+	 */
+	protected String substituteVariables(String input, Properties variables) {
+		String output = input;
+		String key;
+		Enumeration<Object> keys = variables.keys();
+		while (keys.hasMoreElements()) {
+			key = (String) keys.nextElement();
+			output = output.replaceAll(key, variables.getProperty(key));
+		}
+		return output;
+	}
+
+	/**
+	 * Creates the file from template by substituting all the variables in
+	 * template.
+	 * 
+	 * @param templatePath
+	 *            the template path
+	 * @param outputPath
+	 *            the output path
+	 * @param variables
+	 *            the variables
+	 * @throws IOException
+	 *             Signals that an I/O exception has occurred.
+	 */
+	protected void createFileFromTemplate(String templatePath,
+			String outputPath, Properties variables) throws IOException {
+		File template = new File(templatePath);
+		File output = new File(outputPath);
+
+		BufferedReader reader = new BufferedReader(new FileReader(template));
+		String line = "";
+		StringBuilder oldtext = new StringBuilder();
+		while ((line = reader.readLine()) != null) {
+			oldtext.append(line);
+			oldtext.append('\n');
+		}
+
+		reader.close();
+
+		String newtext = substituteVariables(oldtext.toString(), variables);
+
+		FileWriter writer = new FileWriter(output);
+		writer.write(newtext);
+		writer.close();
+	}
+}
Index: DCWoRMS/trunk/build/classes/test/stress/GeneratingAndTestingManager.java
===================================================================
--- DCWoRMS/trunk/build/classes/test/stress/GeneratingAndTestingManager.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/test/stress/GeneratingAndTestingManager.java	(revision 477)
@@ -0,0 +1,242 @@
+package test.stress;
+
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * The class responsible for generate tasks or resource range experiments and
+ * running memory and time analysis on them.
+ * 
+ * @author Jarek Szymczak
+ * @version $Id$
+ */
+public class GeneratingAndTestingManager {
+
+	/** Class logger. */
+	private static final Log LOGGER =
+			LogFactory.getLog(GeneratingAndTestingManager.class);
+
+	/**
+	 * The file paths of generated experiments passed to memory and time
+	 * analysis.
+	 */
+	private static List<String> parameters = new ArrayList<String>();
+
+	/** List of paramters (after they're parsed from main method arguments). */
+	private static Map<String, String[]> methodParameters =
+			new HashMap<String, String[]>();
+
+	/**
+	 * It determines whether memory and time analysis should be performed after
+	 * experiments generation.
+	 */
+	private static boolean run;
+
+	/**
+	 * The main method. Apart arguments the program is run with, generation of
+	 * experiments depends on file "properties/variables.properties" and
+	 * "*properties/template*.*" files
+	 * 
+	 * @param args
+	 *            the following arguments (other are not allowed - arguments
+	 *            predecessed by "#" are integers):
+	 *            <ul>
+	 *            <li><b>-r</b> - memory and time analysis will be performed
+	 *            after generation (if specified)
+	 *            <li><b>--rg #tasks #start #step #end</b> - experiments with
+	 *            #tasks number of tasks will be generated for range of
+	 *            resources from #start to #end with step #step
+	 *            <li><b>--rv #tasks #resources_1 ... #resources_n</b> -
+	 *            experiments with #tasks number of tasks will be generated for
+	 *            #resources_1, ..., #resources_n number of resources
+	 *            <li><b>--tg #start #step #end</b> - experiments with tasks
+	 *            range from #start to #end with step #step will be generated
+	 *            <li><b>--tv #tasks_1 ... #tasks_n</b> - experiments with
+	 *            #tasks_1, ..., #tasks_n number of tasks will be generated
+	 *            </ul>
+	 * 
+	 * @throws FileNotFoundException
+	 *             if one of necessary files was not found
+	 * @throws IOException
+	 *             Signals that an I/O exception has occurred.
+	 * @throws InterruptedException
+	 *             should not occur
+	 */
+	public static void main(String args[]) throws FileNotFoundException,
+			IOException, InterruptedException {
+
+		String argsProcessed[] = args;
+
+		while (argsProcessed.length != 0) {
+			argsProcessed = processArguments(argsProcessed);
+		}
+
+		if (methodParameters.containsKey("tg")
+				&& methodParameters.containsKey("tv")) {
+			System.out
+					.println("Argumets --tg and --tv cannot be used together");
+			return;
+		}
+
+		if (methodParameters.containsKey("rg")
+				&& methodParameters.containsKey("rv")) {
+			System.out
+					.println("Argumets --rg and --rv cannot be used together");
+			return;
+		}
+
+		if (methodParameters.containsKey("tg")
+				&& (methodParameters.get("tg").length != 4)) {
+			System.out.println("Wrong usage of --tg argument");
+			return;
+		}
+
+		if (methodParameters.containsKey("rg")
+				&& (methodParameters.get("rg").length != 5)) {
+			System.out.println("Wrong usage of --rg argument");
+			return;
+		}
+
+		if (methodParameters.containsKey("tv")
+				&& (methodParameters.get("tv").length < 2)) {
+			System.out.println("Wrong usage of --tg argument");
+			return;
+		}
+
+		if (methodParameters.containsKey("rv")
+				&& (methodParameters.get("rv").length < 3)) {
+			System.out.println("Wrong usage of --rg argument");
+			return;
+		}
+
+		if (methodParameters.containsKey("tg")
+				&& methodParameters.containsKey("tv")) {
+			System.out
+					.println("Argumets --tg and --tv cannot be used together");
+			return;
+		}
+
+		if (methodParameters.containsKey("tg")) {
+			TasksExperimentsGenerator teg = new TasksExperimentsGenerator();
+			parameters.add(teg.run(methodParameters.get("tg")));
+		}
+
+		if (methodParameters.containsKey("tv")) {
+			TasksExperimentsGenerator teg = new TasksExperimentsGenerator();
+			parameters.add(teg.run(methodParameters.get("tv")));
+		}
+
+		if (methodParameters.containsKey("rg")) {
+			ResourcesExperimentsGenerator reg =
+					new ResourcesExperimentsGenerator();
+			parameters.add(reg.run(methodParameters.get("rg")));
+		}
+
+		if (methodParameters.containsKey("rv")) {
+			ResourcesExperimentsGenerator reg =
+					new ResourcesExperimentsGenerator();
+			parameters.add(reg.run(methodParameters.get("rv")));
+		}
+
+		if (run) {
+			LOGGER
+					.info("Memory and time consumption analysis will begin in 3 seconds, please wait...");
+
+			for (int i = 0; i < 5; i++) {
+				System.gc();
+				Thread.sleep(600);
+			}
+
+			MemoryAndTimeAnalyzer.main(parameters.toArray(new String[parameters
+					.size()]));
+		}
+
+	}
+
+	/**
+	 * It processes the arguments. It moves arguments with it's parameters from
+	 * an args array (they're removed) to methodParameters map.
+	 * 
+	 * @param args
+	 *            array with (possibly) many groups of parameters (arguments)
+	 * @return separated group of parameters
+	 */
+	private static String[] processArguments(String args[]) {
+		int offset = 0;
+
+		if ("-r".equals(args[0])) {
+			run = true;
+			offset = 1;
+
+		} else {
+
+			do {
+				offset++;
+			} while ((offset < args.length) && !args[offset].startsWith("-"));
+
+			if ("--rv".equals(args[0])) {
+
+				String[] rvArgs = arrayCopyOfRange(args, 0, offset);
+				rvArgs[0] = "-v";
+				methodParameters.put("rv", rvArgs);
+
+			} else if ("--rg".equals(args[0])) {
+				String[] rvArgs = arrayCopyOfRange(args, 0, offset);
+				rvArgs[0] = "-g";
+				methodParameters.put("rg", rvArgs);
+
+			} else if ("--tv".equals(args[0])) {
+				String[] rvArgs = arrayCopyOfRange(args, 0, offset);
+				rvArgs[0] = "-v";
+				methodParameters.put("tv", rvArgs);
+
+			} else if ("--tg".equals(args[0])) {
+				String[] rvArgs = arrayCopyOfRange(args, 0, offset);
+				rvArgs[0] = "-g";
+				methodParameters.put("tg", rvArgs);
+
+			} else {
+				System.out.println("Incorrect switch (" + args[0]
+						+ "). Supported are:");
+				System.out
+						.println("-r\t\tif specified after generation tests will be performed");
+				System.out
+						.println("--rv\t\tif resources experiment generation from certain values");
+				System.out
+						.println("--rg\t\tif resources experiment generation");
+				System.out
+						.println("--tv\t\tif tasks experiment generation from certain values");
+				System.out.println("--tg\t\tif tasks experiment generation");
+
+				System.exit(-1);
+			}
+		}
+
+		return arrayCopyOfRange(args, offset, args.length);
+	}
+
+	/**
+	 * Copy of array's range. Method written as a wrapper to System method
+	 * arraycopy().
+	 * 
+	 * @param original
+	 *            the original array
+	 * @param from
+	 *            from index
+	 * @param to
+	 *            to index
+	 * @return truncated array
+	 */
+	private static String[] arrayCopyOfRange(String[] original, int from, int to) {
+		String[] result = new String[to - from];
+		System.arraycopy(original, from, result, 0, to - from);
+		return result;
+	}
+}
Index: DCWoRMS/trunk/build/classes/test/stress/MemoryAndTimeAnalyzer.java
===================================================================
--- DCWoRMS/trunk/build/classes/test/stress/MemoryAndTimeAnalyzer.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/test/stress/MemoryAndTimeAnalyzer.java	(revision 477)
@@ -0,0 +1,490 @@
+package test.stress;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.lang.management.MemoryMXBean;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Properties;
+import java.awt.Toolkit;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import simulator.DataCenterWorkloadSimulator;
+
+/**
+ * Class responsible for performin memory and time analysis of experiments
+ * execution.
+ * 
+ * @author Jarek Szymczak
+ * @version $Id$
+ */
+public class MemoryAndTimeAnalyzer {
+
+	/** The class logger. */
+	private static final Log LOGGER =
+			LogFactory.getLog(MemoryAndTimeAnalyzer.class);
+
+	/** The properties. */
+	private static Properties properties = new Properties();
+
+	/**
+	 * Variables determinig what type of memories should be meassured and should
+	 * it be performed in detailed or simple way.
+	 */
+	private static boolean heap, nonHeap, jvm, heapDet, nonHeapDet, jvmDet;
+
+	/**
+	 * Determines if the time is meassured precisly (it's not disturb with
+	 * memory meassuring).
+	 */
+	private static boolean timePrec;
+
+	/** Memory details output stream. */
+	private static FileOutputStream outDetails;
+
+	/** The current number of iterations - used for progress calculation. */
+	private static int currentNumberOfIterations;
+
+	/** The total number of iterations - used for progress calculation. */
+	private static int totalNumberOfIterations;
+
+	/** Number of repeats of each experiments. */
+	private static int repeats;
+
+	/**
+	 * It stores information about amount of system memory in a certain machine
+	 * (in megabytes).
+	 */
+	private static int memoryInMB;
+
+	/** The interval between memory checks (in miliseconds). */
+	private static int interval;
+
+	/**
+	 * The object used for gathering the information about heap and non-heap
+	 * memory.
+	 */
+	private static MemoryMXBean memoryMXBean =
+			java.lang.management.ManagementFactory.getMemoryMXBean();
+
+	/**
+	 * The GSSIM object which is analyzed with certain experiment (for each
+	 * experiment new object is created, and the old one is dereferenced and
+	 * deleted (probably).
+	 */
+	private static DataCenterWorkloadSimulator gssim =
+			new DataCenterWorkloadSimulator();
+
+	/**
+	 * Variables helpful during time and memory consumption analysis (they're
+	 * not local to simplify working with the thread responsible for memory
+	 * analysis and to write the details to outDetails output stream.
+	 */
+	private static long timestart, hmemstart, hmemmax, nmemmax, jvmmemmax,
+			timend;
+
+	/**
+	 * Performs memory and time analysis of a single file.
+	 * 
+	 * @param filename
+	 *            experiment file path
+	 * @param iteration
+	 *            iteration number
+	 * @return array with results: time, heap memory, non-heap memory and JVM
+	 *         memory
+	 * @throws InterruptedException
+	 *             the interrupted exception when thread was interrupted during
+	 *             sleep
+	 */
+	private static double[] singleTask(String filename, int iteration)
+			throws InterruptedException {
+		double[] result = new double[4];
+
+		Thread t = new Thread() {
+			public void run() {
+				long htemp, ntemp, jvmtemp;
+				hmemmax = hmemstart;
+				nmemmax = 0;
+				jvmmemmax = 0;
+				try {
+					while (!interrupted()) {
+
+						sleep(interval);
+
+						htemp =
+								heap ? memoryMXBean.getHeapMemoryUsage()
+										.getUsed() : 0;
+						ntemp =
+								nonHeap ? memoryMXBean.getNonHeapMemoryUsage()
+										.getUsed() : 0;
+						jvmtemp = jvm ? getJVMMemory() : 0;
+
+						if (htemp > hmemmax)
+							hmemmax = htemp;
+						if (ntemp > nmemmax)
+							nmemmax = ntemp;
+						if (htemp > jvmmemmax)
+							jvmmemmax = jvmtemp;
+
+						if (heapDet)
+							outDetails.write(String.format("%.3f\t",
+									(hmemmax - hmemstart) / (1024.0 * 1024.0))
+									.getBytes("UTF-8"));
+
+						if (nonHeapDet)
+							outDetails.write(String.format("%.3f\t",
+									nmemmax / (1024.0 * 1024.0)).getBytes(
+									"UTF-8"));
+
+						if (jvmDet)
+							outDetails.write(String.format("%.3f\t",
+									jvmmemmax / (1024.0 * 1024.0)).getBytes(
+									"UTF-8"));
+
+						if (heapDet || nonHeapDet || jvmDet)
+							outDetails.write("\n".getBytes("UTF-8"));
+					}
+				} catch (InterruptedException e) {
+					return;
+				} catch (IOException e) {
+					// if this happens it's very bad,,, but it's totally
+					// unexpected - only if there's a problem with closing
+					// stream from ps process
+					throw new RuntimeException(e);
+				}
+			}
+		};
+
+		try {
+			if (heapDet || nonHeapDet || jvmDet)
+				outDetails.write(("\n\n" + filename + " (iteration: "
+						+ Integer.toString(iteration) + ") \n\n")
+						.getBytes("UTF-8"));
+			if (heapDet)
+				outDetails.write("Hmem\t".getBytes("UTF-8"));
+			if (nonHeapDet)
+				outDetails.write("Nmem\t".getBytes("UTF-8"));
+			if (jvmDet)
+				outDetails.write("JVMmem\t".getBytes("UTF-8"));
+			if (heapDet || nonHeapDet || jvmDet)
+				outDetails.write("\n".getBytes("UTF-8"));
+		} catch (IOException e) {
+			// if this happens it's very bad,,, but it's totally unexpected
+			throw new RuntimeException(e);
+		}
+
+		LOGGER.info("Current progress in number of experiments performed: "
+				+ Integer.toString(currentNumberOfIterations)
+				+ " / "
+				+ Integer.toString(totalNumberOfIterations)
+				+ " ("
+				+ Integer.toString((currentNumberOfIterations) * 100
+						/ totalNumberOfIterations) + "%)");
+
+		currentNumberOfIterations++;
+
+		gssim = null;
+
+		for (int i = 0; i < 5; i++) {
+			Thread.sleep(600);
+			System.gc();
+		}
+
+		hmemstart = memoryMXBean.getHeapMemoryUsage().getUsed();
+		gssim = new DataCenterWorkloadSimulator();
+
+		if (heap || nonHeap || jvm)
+			t.start();
+
+		timestart = System.currentTimeMillis();
+		gssim.run(new String[] { filename });
+		timend = System.currentTimeMillis();
+
+		if (heap || nonHeap || jvm) {
+			t.interrupt();
+			t.join();
+
+			if (timePrec) {
+				gssim = null;
+				for (int i = 0; i < 5; i++)
+					System.gc();
+				gssim = new DataCenterWorkloadSimulator();
+
+				timestart = System.currentTimeMillis();
+				gssim.run(new String[] { filename });
+				timend = System.currentTimeMillis();
+			}
+		}
+
+		result[0] = (timend - timestart) / 1000.0;
+		result[1] = (hmemmax - hmemstart) / (1024.0 * 1024.0);
+		result[2] = nmemmax / (1024.0 * 1024.0);
+		result[3] = jvmmemmax / (1024.0 * 1024.0);
+
+		return result;
+	}
+
+	/**
+	 * Repeats task number specified in variable "repeats" times
+	 * 
+	 * @param filename
+	 *            experiment filename
+	 * @return the formatted line with results (content depends on
+	 *         configuration)
+	 * @throws InterruptedException
+	 *             thrown when thread is interrupted during sleep
+	 */
+	private static String repeatTask(String filename)
+			throws InterruptedException {
+
+		double[] temp;
+
+		double tavg = 0;
+		double tstdev = 0;
+		double hmavg = 0;
+		double hmstdev = 0;
+		double nmstdev = 0;
+		double nmavg = 0;
+		double jvmmavg = 0;
+		double jvmmstdev = 0;
+
+		for (int i = 0; i < repeats; i++) {
+			temp = singleTask(filename, i);
+			tavg += temp[0];
+			tstdev += temp[0] * temp[0];
+			hmavg += temp[1];
+			hmstdev += temp[1] * temp[1];
+			nmavg += temp[2];
+			nmstdev += temp[2] * temp[2];
+			jvmmavg += temp[3];
+			jvmmstdev += temp[3] * temp[3];
+		}
+
+		tavg /= repeats;
+		tstdev /= repeats;
+		hmavg /= repeats;
+		hmstdev /= repeats;
+		nmavg /= repeats;
+		nmstdev /= repeats;
+		jvmmavg /= repeats;
+		jvmmstdev /= repeats;
+
+		tstdev = Math.sqrt(tstdev - tavg * tavg);
+		hmstdev = Math.sqrt(hmstdev - hmavg * hmavg);
+		nmstdev = Math.sqrt(nmstdev - nmavg * nmavg);
+		jvmmstdev = Math.sqrt(jvmmstdev - jvmmavg * jvmmavg);
+
+		StringBuilder result =
+				new StringBuilder(String.format("%.3f\t%.3f\t", tavg, tstdev));
+
+		if (heap)
+			result.append(String.format("%.3f\t%.3f\t", hmavg, hmstdev));
+		if (nonHeap)
+			result.append(String.format("%.3f\t%.3f\t", nmavg, nmstdev));
+		if (jvm)
+			result.append(String.format("%.3f\t%.3f\t", jvmmavg, jvmmstdev));
+
+		return result.toString();
+	}
+
+	/**
+	 * Gets the JVM memory. It works only under linux and only if the process
+	 * name begins with "java" (so, for instance, it doesn't work when the
+	 * application is run under Eclipse SDK). It depends on {@link #memoryInMB}
+	 * variable
+	 * 
+	 * @return amount of memory used by JVM process (in bytes)
+	 * @throws IOException
+	 *             Signals that an I/O exception has occurred.
+	 */
+	public static Long getJVMMemory() throws IOException {
+		BufferedReader reader = null;
+		try {
+			Process proc =
+					Runtime
+							.getRuntime()
+							.exec(
+									new String[] { "bash", "-c",
+											"ps u --width=5 | grep java | tr -s ' ' | cut -d ' ' -f 4" });
+			reader =
+					new BufferedReader(new InputStreamReader(proc
+							.getInputStream()));
+
+			String line;
+			if (null != (line = reader.readLine())) {
+				return Math.round(Double.parseDouble(line) / 100.0 * memoryInMB
+						* 1024.0 * 1024.0);
+			}
+			return null;
+		} catch (IOException e) {
+			System.out.println(e.getMessage());
+			return null;
+		} finally {
+			if (reader != null)
+				reader.close();
+		}
+
+	}
+
+	/**
+	 * The main method. It reads the properties of analysis from file
+	 * "properties/performance.properties" - this path is relative so it's
+	 * important from which folder the application is run. Meaning of each
+	 * property is described in the .properties file, please do not change it's
+	 * content other than parameters' values
+	 * 
+	 * @param args
+	 *            the arguments of main methods are relative paths to
+	 *            .properties files with experiments or directories containing
+	 *            these files (it's not recursive)
+	 * @throws IOException
+	 *             Signals that an I/O exception has occurred.
+	 * @throws InterruptedException
+	 *             fall-through exception which is not possible to occur
+	 */
+	public static void main(String[] args) throws IOException,
+			InterruptedException {
+
+		LOGGER.info("Reading the properties");
+
+		properties.load(new FileInputStream(new File(
+				"properties/performance.properties")));
+
+		int noOfBeeps =
+				Integer.parseInt(properties.getProperty("NO_OF_BEEPS", "0"));
+
+		interval = Integer.parseInt(properties.getProperty("INTERVAL"));
+		repeats = Integer.parseInt(properties.getProperty("REPEATS"));
+		memoryInMB = Integer.parseInt(properties.getProperty("MEMORY_IN_MB"));
+
+		heap =
+				"simple".equals(properties.getProperty("HEAP_MEMORY"))
+						|| "details".equals(properties
+								.getProperty("HEAP_MEMORY"));
+		heapDet = "details".equals(properties.getProperty("HEAP_MEMORY"));
+		nonHeap =
+				"simple".equals(properties.getProperty("NON_HEAP_MEMORY"))
+						|| "details".equals(properties
+								.getProperty("NON_HEAP_MEMORY"));
+		nonHeapDet =
+				"details".equals(properties.getProperty("NON_HEAP_MEMORY"));
+		jvm =
+				"simple".equals(properties.getProperty("JVM_MEMORY"))
+						|| "details".equals(properties
+								.getProperty("JVM_MEMORY"));
+		jvmDet = "details".equals(properties.getProperty("JVM_MEMORY"));
+
+		timePrec = (!jvm && !heap && !nonHeap);
+
+		if ("precisly".equals(properties.getProperty("TIME_MEASURING")))
+			timePrec = true;
+
+		LOGGER.info("Preparing file list to perform experiment");
+
+		List<String> records = new ArrayList<String>();
+
+		File temp;
+
+		if (args.length < 1)
+			return;
+
+		for (int i = 0; i < args.length; i++) {
+			if ((new File(args[i])).exists())
+				if (args[i].endsWith(".properties"))
+					records.add(args[i]);
+				else {
+					temp = new File(args[i]);
+					String[] files = temp.list();
+					if (files != null) {
+						for (String file : files) {
+							if ((new File(args[i] + "/" + file).exists() && file
+									.endsWith(".properties")))
+								records.add(args[i] + "/" + file);
+						}
+					}
+				}
+		}
+
+		totalNumberOfIterations = repeats * records.size();
+
+		if (records.size() == 0)
+			return;
+
+		int counter = 0;
+		File file = null;
+		File fileDetails = null;
+
+		do {
+			counter++;
+			file =
+					new File("performance_result_" + Integer.toString(counter)
+							+ ".txt");
+			fileDetails =
+					new File("performance_result_" + Integer.toString(counter)
+							+ "_details.txt");
+		} while (file.exists() || fileDetails.exists());
+
+		FileOutputStream out = new FileOutputStream(file);
+
+		if (heapDet || nonHeapDet || jvmDet)
+			outDetails = new FileOutputStream(fileDetails);
+
+		StringBuilder header = new StringBuilder("Measuring time precisly: ");
+
+		if (timePrec)
+			header.append("yes\n");
+		else
+			header.append("no\n");
+
+		header.append(String.format("Number of repets: %d\n", repeats));
+		header.append(String.format(
+				"Interval between memory checking: %d ms\n", interval));
+		header.append(String.format("System memory: %d MB\n\n", memoryInMB));
+
+		header.append("Name\tTavg\tTstdev\t");
+
+		if (heap)
+			header.append("HMavg\tHMstdev\t");
+		if (nonHeap)
+			header.append("NMavg\tNMstdev\t");
+		if (jvm)
+			header.append("JVMMavg\tJVMMstdev\t");
+		header.append('\n');
+
+		LOGGER.info("Measuring of performance begun");
+
+		try {
+
+			out.write(header.toString().getBytes("UTF-8"));
+			if (heapDet || nonHeapDet || jvmDet)
+				outDetails
+						.write(("Detailed analysis of memory usage with interval: "
+								+ interval + "ms\n\n").getBytes("UTF-8"));
+			Collections.sort(records);
+			for (String record : records) {
+				out.write((record + "\t" + repeatTask(record) + "\n")
+						.getBytes("UTF-8"));
+			}
+		} finally {
+			if (out != null)
+				out.close();
+			if (outDetails != null)
+				outDetails.close();
+		}
+
+		LOGGER.info("Measuring of performance ended succesfully");
+
+		for (int i = 0; i < noOfBeeps; i++) {
+			Toolkit.getDefaultToolkit().beep();
+			Thread.sleep(1000);
+		}
+	}
+
+}
Index: DCWoRMS/trunk/build/classes/test/stress/TasksExperimentsGenerator.java
===================================================================
--- DCWoRMS/trunk/build/classes/test/stress/TasksExperimentsGenerator.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/test/stress/TasksExperimentsGenerator.java	(revision 477)
@@ -0,0 +1,235 @@
+package test.stress;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+import java.util.Map.Entry;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import simulator.workload.generator.WorkloadGenerator;
+import simulator.workload.reader.archive.swf.SWFParser;
+import simulator.workload.writer.swf.QcgSWFJobWriter;
+
+/**
+ * Class responsible for generating experiments based on amount and range of
+ * tasks.
+ * 
+ * @author Jarek Szymczak
+ * @version $Id$
+ */
+public class TasksExperimentsGenerator extends AbstractExperimentsGenerator {
+
+	/** Class logger. */
+	private static final Log LOGGER =
+			LogFactory.getLog(TasksExperimentsGenerator.class);
+
+	/**
+	 * It runs the resource range / values based generation
+	 * 
+	 * @param args
+	 *            the following arguments (other are not allowed - arguments
+	 *            predecessed by "#" are integers):
+	 *            <ul>
+	 *            <li><b>-g #start #step #end</b> - experiments with tasks
+	 *            range from #start to #end with step #step will be generated
+	 *            <li><b>-v #tasks_1 ... #tasks_n</b> - experiments with
+	 *            #tasks_1, ..., #tasks_n number of tasks will be generated
+	 *            </ul>
+	 * @return path to directory containing generated experiments
+	 * @throws FileNotFoundException
+	 *             one of necessary files was not found
+	 * @throws IOException
+	 *             signals that an I/O exception has occurred
+	 */
+	public String run(String args[]) throws FileNotFoundException, IOException {
+
+		long max = 0;
+		long[] values = null;
+
+		if (args[0].equals("-g")) {
+
+			long start = Long.parseLong(args[1]);
+			long step = Long.parseLong(args[2]);
+			max = Long.parseLong(args[3]);
+
+			values =
+					new long[(int) Math.ceil((double) (max - start)
+							/ (double) step)];
+			int i = 0;
+			for (long j = start; j < max; j += step) {
+				values[i++] = j;
+			}
+		} else if (args[0].equals("-v")) {
+			values = new long[args.length - 2];
+			for (int i = 1; i < args.length - 1; i++)
+				values[i - 1] = Long.parseLong(args[i]);
+			max = Long.parseLong(args[args.length - 1]);
+		} else {
+			throw new RuntimeException("Class must be launched with -v or -g");
+		}
+
+		LOGGER.info("Generating workload from range: "
+				+ Long.toString(values[0]) + "-" + Long.toString(max));
+
+		Properties variables = new Properties();
+		FileInputStream fis = null;
+		try {
+			fis =
+					new FileInputStream(new File(
+							"properties/variables.properties"));
+			variables.load(fis);
+		} catch (FileNotFoundException e) {
+			LOGGER
+					.error("Could not find variables.properties file, application will terminate!");
+			throw new RuntimeException(e);
+		} catch (IOException e) {
+			LOGGER
+					.error("Problems with I/O operations while trying to load variables.properties file, application will terminate!");
+			throw new RuntimeException(e);
+		} finally {
+			try {
+				if (fis != null)
+					fis.close();
+			} catch (IOException e) {
+				LOGGER
+						.error("An error occured while closing the stream with variables");
+			}
+		}
+
+		variables.setProperty("MAX_TASKS_NO", Long.toString(max));
+
+		createFileFromTemplate("properties/generator_template.properties",
+				"properties/generator.properties", variables);
+		createFileFromTemplate("properties/generator_template.xml",
+				"properties/generator.xml", variables);
+
+		deleteDirectory(new File(variables.getProperty("EXP_PATH")));
+
+		File dir =
+				new File(variables.getProperty("EXP_PATH") + "/"
+						+ variables.getProperty("MAX_TASKS_NO"));
+
+		if (!dir.exists()) {
+			try {
+				dir.mkdirs();
+			} catch (SecurityException e) {
+				LOGGER
+						.error("Security violation while trying to create directories: "
+								+ dir.getAbsolutePath() + "!");
+			}
+		}
+
+		String parameters[] = { "properties/generator.properties" };
+		WorkloadGenerator.main(parameters); // deleteDirectory(new File("raz"));
+		LOGGER.info("Dividing max number of tasks among other values");
+		for (long i : values) {
+
+			LOGGER.debug("Workload with " + Long.toString(i)
+					+ " tasks is about to be truncated");
+			variables.setProperty("TASKS_NO", Long.toString(i));
+
+			copyFiles(i, variables.getProperty("EXP_PATH") + "/"
+					+ variables.getProperty("MAX_TASKS_NO"), variables
+					.getProperty("EXP_PATH")
+					+ "/" + variables.getProperty("TASKS_NO"), variables);
+
+			truncWorkloadFile(i, variables.getProperty("EXP_PATH") + "/"
+					+ variables.getProperty("MAX_TASKS_NO") + "/"
+					+ variables.getProperty("WORKLOAD_FILENAME"), variables
+					.getProperty("EXP_PATH")
+					+ "/"
+					+ variables.getProperty("TASKS_NO")
+					+ "/"
+					+ variables.getProperty("WORKLOAD_FILENAME"));
+
+			int zeroes =
+					variables.getProperty("MAX_TASKS_NO").length()
+							- variables.getProperty("TASKS_NO").length();
+			StringBuilder expPropertiesNo = new StringBuilder();
+			for (int j = 0; j < zeroes; j++)
+				expPropertiesNo.append('0');
+			expPropertiesNo.append(variables.getProperty("TASKS_NO"));
+			expPropertiesNo.append(".properties");
+
+			createFileFromTemplate(
+					"properties/reservation_template.properties", variables
+							.getProperty("EXP_PATH")
+							+ "/" + expPropertiesNo.toString(), variables);
+			LOGGER.debug("Workload with " + Long.toString(i)
+					+ " tasks truncating finished");
+		}
+
+		variables
+				.setProperty("TASKS_NO", variables.getProperty("MAX_TASKS_NO"));
+
+		createFileFromTemplate("properties/reservation_template.properties",
+				variables.getProperty("EXP_PATH") + "/"
+						+ variables.getProperty("TASKS_NO") + ".properties",
+				variables);
+
+		LOGGER.info("Division of tasks finished");
+
+		return variables.getProperty("EXP_PATH");
+	}
+
+	/**
+	 * It truncates workload file.
+	 * 
+	 * @param numberOfExperiments
+	 *            the number of experiments contained in originalWorkloadPath to
+	 *            save in truncWorkloadPath
+	 * @param originalWorkloadPath
+	 *            the original workload path
+	 * @param truncWorkloadPath
+	 *            the truncated workload path
+	 * @throws IOException
+	 *             Signals that an I/O exception has occurred.
+	 */
+	private void truncWorkloadFile(long numberOfExperiments,
+			String originalWorkloadPath, String truncWorkloadPath)
+			throws IOException {
+
+		SWFParser swfParser = null;
+		QcgSWFJobWriter jobWriter = null;
+
+		try {
+			swfParser = new SWFParser(originalWorkloadPath);
+			File temp = new File(truncWorkloadPath);
+			jobWriter = new QcgSWFJobWriter(temp.getParent(), temp.getName());
+
+			Map<String, String> header = swfParser.loadHeader();
+			Set<Entry<String, String>> commentsEntrySet = header.entrySet();
+			header.entrySet();
+
+			for (Entry<String, String> entry : commentsEntrySet) {
+				jobWriter.writeComment(entry.getKey(), entry.getValue());
+			}
+
+			Map<String, String[]> mapping = swfParser.getIDMapping();
+			String[] singleJob = null;
+			String[] singleJobMapping = null;
+
+			for (long i = 0; i < numberOfExperiments; i++) {
+				singleJob = swfParser.readTask();
+				singleJobMapping = mapping.get(Long.toString(i));
+
+				jobWriter.writeLine(singleJob);
+				jobWriter.addTaskMapping(Long.toString(i), singleJobMapping[0],
+						singleJobMapping[1]);
+			}
+
+		} finally {
+			if (swfParser != null)
+				swfParser.close();
+			if (jobWriter != null)
+				jobWriter.close();
+		}
+
+	}
+}
Index: DCWoRMS/trunk/build/classes/test/stress/ResourcesExperimentsGenerator.java
===================================================================
--- DCWoRMS/trunk/build/classes/test/stress/ResourcesExperimentsGenerator.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/test/stress/ResourcesExperimentsGenerator.java	(revision 477)
@@ -0,0 +1,233 @@
+package test.stress;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.IOException;
+import java.util.Properties;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import simulator.workload.generator.WorkloadGenerator;
+
+/**
+ * Class responsible for generating experiments based on amount and range of
+ * resources and a certain amount of tasks.
+ * 
+ * @author Jarek Szymczak
+ * @version $Id$
+ */
+public class ResourcesExperimentsGenerator extends AbstractExperimentsGenerator {
+
+	/** Class logger. */
+	private static final Log LOGGER =
+			LogFactory.getLog(ResourcesExperimentsGenerator.class);
+
+	/**
+	 * It runs the resource range / values based generation.
+	 * 
+	 * @param args
+	 *            the following arguments (other are not allowed - arguments
+	 *            predecessed by "#" are integers):
+	 *            <ul>
+	 *            <li><b>-g #tasks #start #step #end</b> - experiments with
+	 *            #tasks number of tasks will be generated for range of
+	 *            resources from #start to #end with step #step
+	 *            <li><b>-v #tasks #resources_1 ... #resources_n</b> -
+	 *            experiments with #tasks number of tasks will be generated for
+	 *            #resources_1, ..., #resources_n number of resources
+	 *            </ul>
+	 * @return path to directory containing generated experiments
+	 */
+	public String run(String args[]) {
+
+		long max = 0;
+		long tasks = 0;
+		long[] values = null;
+
+		if (args[0].equals("-g")) {
+
+			tasks = Long.parseLong(args[1]);
+			long start = Long.parseLong(args[2]);
+			long step = Long.parseLong(args[3]);
+			max = Long.parseLong(args[4]);
+
+			values =
+					new long[(int) Math.ceil((double) (max - start)
+							/ (double) step) + 1];
+			for (long j = start; j <= max; j += step) {
+				values[(int) ((j - start) / step)] = j;
+			}
+		} else if (args[0].equals("-v")) {
+			tasks = Long.parseLong(args[1]);
+			values = new long[args.length - 2];
+			max = Long.parseLong(args[args.length - 1]);
+			for (int i = 2; i < args.length; i++) {
+				values[i - 2] = Long.parseLong(args[i]);
+			}
+		} else {
+			throw new RuntimeException("Class must be launched with -v or -g");
+		}
+
+		LOGGER
+				.info("Generating workload from range (for resource experiments): "
+						+ Long.toString(values[0]) + "-" + Long.toString(max));
+
+		Properties variables = new Properties();
+		FileInputStream fis = null;
+		try {
+			fis =
+					new FileInputStream(new File(
+							"properties/variables.properties"));
+			variables.load(fis);
+		} catch (FileNotFoundException e) {
+			LOGGER
+					.error("Could not find variables.properties file, application will terminate!");
+			throw new RuntimeException(e);
+		} catch (IOException e) {
+			LOGGER
+					.error("Problems with I/O operations while trying to load variables.properties file, application will terminate!");
+			throw new RuntimeException(e);
+		} finally {
+			try {
+				if (fis != null)
+					fis.close();
+			} catch (IOException e) {
+				LOGGER
+						.error("An error occured while closing the stream with variables");
+			}
+		}
+
+		variables
+				.setProperty("EXP_PATH", variables.getProperty("RES_EXP_PATH"));
+
+		variables.setProperty("MAX_RES_NO", Long.toString(max));
+
+		variables.setProperty("MAX_TASKS_NO", Long.toString(tasks));
+
+		try {
+			createFileFromTemplate("properties/generator_template.properties",
+					"properties/generator.properties", variables);
+			createFileFromTemplate("properties/generator_template.xml",
+					"properties/generator.xml", variables);
+		} catch (IOException e) {
+			LOGGER
+					.error("Error while trying to generate files needed for generation of tasks, applcation will terminate!");
+			throw new RuntimeException(e);
+		}
+
+		deleteDirectory(new File(variables.getProperty("EXP_PATH")));
+
+		File dir =
+				new File(variables.getProperty("EXP_PATH") + "/"
+						+ variables.getProperty("MAX_TASKS_NO"));
+
+		if (!dir.exists()) {
+			try {
+				dir.mkdirs();
+			} catch (SecurityException e) {
+				LOGGER
+						.error("Security violation while trying to create directories: "
+								+ dir.getAbsolutePath() + "!");
+			}
+		}
+
+		String parameters[] = { "properties/generator.properties" };
+		WorkloadGenerator.main(parameters);
+
+		LOGGER.info("Dividing max number of tasks among other values");
+
+		variables
+				.setProperty("TASKS_NO", variables.getProperty("MAX_TASKS_NO"));
+
+		for (long i : values) {
+
+			variables.setProperty("RES_NO", Long.toString(i));
+
+			variables.setProperty("RESOURCES_PATH", variables
+					.getProperty("EXP_PATH")
+					+ "/AResources128_" + Long.toString(i) + ".xml");
+
+			int zeroes =
+					variables.getProperty("MAX_RES_NO").length()
+							- variables.getProperty("RES_NO").length();
+			StringBuilder expPropertiesNo =
+					new StringBuilder(variables.getProperty("TASKS_NO"));
+			expPropertiesNo.append("R");
+			for (int j = 0; j < zeroes; j++)
+				expPropertiesNo.append('0');
+			expPropertiesNo.append(variables.getProperty("RES_NO"));
+			expPropertiesNo.append(".properties");
+
+			try {
+
+				createResourcesFromSingleTemplate(i,
+						"properties/resource_template.part",
+						"properties/resources_template.xml", variables);
+
+				createFileFromTemplate(
+						"properties/reservation_template.properties", variables
+								.getProperty("EXP_PATH")
+								+ "/" + expPropertiesNo.toString(), variables);
+			} catch (IOException e) {
+				LOGGER.error("An exception occured while trying to ");
+			}
+		}
+
+		return variables.getProperty("EXP_PATH");
+	}
+
+	/**
+	 * Generates the resource file (it's directory is specified in variables and
+	 * file name depends on amount of resources it contains) from general and
+	 * single templates. It's based on variables replacement mechanism in method
+	 * 
+	 * @param numberOfResources
+	 *            the number of resources the
+	 * @param templatePath
+	 *            the template path
+	 * @param generalTemplatePath
+	 *            the general template path
+	 * @param variables
+	 *            the variables for resources generation
+	 * @throws IOException
+	 *             Signals that an I/O exception has occurred.
+	 *             {@link #substituteVariables(String, Properties)}. After
+	 *             preparation of variables it calls method:
+	 *             {@link #createFileFromTemplate(String, String, Properties)}
+	 */
+	private void createResourcesFromSingleTemplate(long numberOfResources,
+			String templatePath, String generalTemplatePath,
+			Properties variables) throws IOException {
+
+		File template = new File(templatePath);
+
+		BufferedReader reader = new BufferedReader(new FileReader(template));
+		String line = "";
+		StringBuilder oldtext = new StringBuilder();
+		try {
+			while ((line = reader.readLine()) != null) {
+				oldtext.append(line);
+				oldtext.append('\n');
+			}
+		} finally {
+			if (reader != null)
+				reader.close();
+		}
+
+		StringBuilder newtext = new StringBuilder();
+
+		for (long i = 0; i < numberOfResources; i++) {
+			variables.setProperty("RESOURCE_ID", "compRes" + Long.toString(i));
+			newtext.append(substituteVariables(oldtext.toString(), variables));
+		}
+
+		variables.setProperty("RESOURCES_DETAILS", newtext.toString());
+
+		createFileFromTemplate(generalTemplatePath, variables
+				.getProperty("RESOURCES_PATH"), variables);
+	}
+}
Index: DCWoRMS/trunk/build/classes/schedframe/Finalizable.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/Finalizable.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/Finalizable.java	(revision 477)
@@ -0,0 +1,7 @@
+package schedframe;
+
+public interface Finalizable {
+	
+	public void finalize();
+	
+}
Index: DCWoRMS/trunk/build/classes/schedframe/Initializable.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/Initializable.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/Initializable.java	(revision 477)
@@ -0,0 +1,7 @@
+package schedframe;
+
+public interface Initializable {
+	
+	public void initiate();
+	
+}
Index: DCWoRMS/trunk/build/classes/schedframe/Parameter.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/Parameter.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/Parameter.java	(revision 477)
@@ -0,0 +1,40 @@
+package schedframe;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import schemas.StringValueWithUnit;
+
+public class Parameter extends ArrayList<StringValueWithUnit> {
+
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 1L;
+	protected String name;
+	protected List<Property> properties;
+
+	public Parameter(String name) {
+		this.name = name;
+	}
+
+	public List<Property> getProperties() {
+		return properties;
+	}
+
+	public boolean addProperty(Property prop){
+		if(properties == null){
+			properties = new ArrayList<Property>();
+		}
+		return properties.add(prop);
+	}
+	
+	public Property getProperty(String propName){
+		for(Property property: properties){
+			if(property.getName().equals(propName)){
+				return property;
+			}
+		}
+		return null;
+	}
+}
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 477)
@@ -0,0 +1,27 @@
+package schedframe.events;
+
+import schedframe.scheduling.tasks.WorkloadUnit;
+
+
+
+public class TaskEvent {
+
+	protected WorkloadUnit<?> task;
+	protected String resourceName;
+	
+	public TaskEvent(WorkloadUnit<?> task,
+			 String resourceName) {
+		super();
+		this.task = task;
+		this.resourceName = resourceName;
+	}
+	
+	public WorkloadUnit<?> getTask() {
+		return task;
+	}
+
+	public String getResourceName() {
+		return resourceName;
+	}
+	
+}
Index: DCWoRMS/trunk/build/classes/schedframe/events/scheduling/TaskFailedEvent.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/events/scheduling/TaskFailedEvent.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/events/scheduling/TaskFailedEvent.java	(revision 477)
@@ -0,0 +1,17 @@
+package schedframe.events.scheduling;
+
+import java.util.List;
+
+public class TaskFailedEvent extends SchedulingEvent{
+	
+	protected List<String> epr;
+	
+	public TaskFailedEvent(List<String> list){
+		super(SchedulingEventType.TASK_FAILED);
+		this.epr = list;
+	}
+	
+	public List<String> getReservations(){
+		return this.epr;
+	}
+}
Index: DCWoRMS/trunk/build/classes/schedframe/events/scheduling/TaskFinishedEvent.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/events/scheduling/TaskFinishedEvent.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/events/scheduling/TaskFinishedEvent.java	(revision 477)
@@ -0,0 +1,30 @@
+package schedframe.events.scheduling;
+
+
+public class TaskFinishedEvent extends SchedulingEvent {
+	
+	//protected List<String> epr;
+
+	protected String jobId;
+	protected String taskId;
+	
+	public TaskFinishedEvent(/*List<String> list*/ String jobId, String taskId){
+		super(SchedulingEventType.TASK_FINISHED);
+		//this.epr = list;
+		this.jobId = jobId;
+		this.taskId = taskId;
+	}
+	
+	/*public List<String> getReservations(){
+		return this.epr;
+	}*/
+	
+	public String getJobId() {
+		return jobId;
+	}
+
+	public String getTaskId() {
+		return taskId;
+	}
+
+}
Index: DCWoRMS/trunk/build/classes/schedframe/events/scheduling/TaskArrivedEvent.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/events/scheduling/TaskArrivedEvent.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/events/scheduling/TaskArrivedEvent.java	(revision 477)
@@ -0,0 +1,9 @@
+package schedframe.events.scheduling;
+
+
+public class TaskArrivedEvent extends SchedulingEvent {
+
+	public TaskArrivedEvent(){
+		super(SchedulingEventType.TASK_ARRIVED);
+	}
+}
Index: DCWoRMS/trunk/build/classes/schedframe/events/scheduling/TimerEvent.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/events/scheduling/TimerEvent.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/events/scheduling/TimerEvent.java	(revision 477)
@@ -0,0 +1,10 @@
+package schedframe.events.scheduling;
+
+
+public class TimerEvent extends SchedulingEvent {
+
+	public TimerEvent() {
+		super(SchedulingEventType.TIMER);
+	}
+
+}
Index: DCWoRMS/trunk/build/classes/schedframe/events/scheduling/TaskCanceledEvent.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/events/scheduling/TaskCanceledEvent.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/events/scheduling/TaskCanceledEvent.java	(revision 477)
@@ -0,0 +1,41 @@
+package schedframe.events.scheduling;
+
+import java.util.List;
+
+
+public class TaskCanceledEvent extends SchedulingEvent {
+
+	protected String jobId;
+	protected String taskId;
+	protected List<String> epr;
+	
+	public TaskCanceledEvent(List<String> list){
+		super(SchedulingEventType.TASK_CANCELED);
+		this.epr = list;
+		this.jobId = null;
+		this.taskId = null;
+	}
+	
+	public TaskCanceledEvent(String jobId, String taskId) {
+		super(SchedulingEventType.TASK_CANCELED);
+		this.jobId = jobId;
+		this.taskId = taskId;
+	}
+	
+	public void setReason(EventReason reason){
+		this.reason = reason;
+	}
+
+	public String getJobId() {
+		return jobId;
+	}
+
+	public String getTaskId() {
+		return taskId;
+	}
+	
+	public List<String> getReservations(){
+		return this.epr;
+	}
+
+}
Index: DCWoRMS/trunk/build/classes/schedframe/events/scheduling/SchedulingEventCommand.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/events/scheduling/SchedulingEventCommand.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/events/scheduling/SchedulingEventCommand.java	(revision 477)
@@ -0,0 +1,28 @@
+package schedframe.events.scheduling;
+
+import schedframe.events.Event;
+import schedframe.events.EventCommand;
+import schedframe.events.EventType;
+import schedframe.resources.computing.ComputingResource;
+
+public class SchedulingEventCommand implements EventCommand {
+
+	private ComputingResource compResource;
+	
+	public SchedulingEventCommand (ComputingResource compResource) {
+		this.compResource = compResource;
+	}
+	
+	public void execute(EventType evType) {
+		SchedulingEvent ev = new SchedulingEvent(evType);
+		ev.setSource(compResource.getName());
+		compResource.getEventHandler().handleSchedulingEvent(ev);
+	}
+	
+	public void execute(Event event) {
+		SchedulingEvent ev = new SchedulingEvent(event.getType());
+		ev.setSource(compResource.getName());
+		compResource.getEventHandler().handleSchedulingEvent(ev);
+	}
+
+}
Index: DCWoRMS/trunk/build/classes/schedframe/events/scheduling/TaskRequestedTimeExpiredEvent.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/events/scheduling/TaskRequestedTimeExpiredEvent.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/events/scheduling/TaskRequestedTimeExpiredEvent.java	(revision 477)
@@ -0,0 +1,20 @@
+package schedframe.events.scheduling;
+
+public class TaskRequestedTimeExpiredEvent extends SchedulingEvent{
+	protected String jobId;
+	protected String taskId;
+	
+	public TaskRequestedTimeExpiredEvent(String jobId, String taskId) {
+		super(SchedulingEventType.TASK_REQUESTED_TIME_EXPIRED);
+		this.jobId = jobId;
+		this.taskId = taskId;
+	}
+
+	public String getJobId() {
+		return jobId;
+	}
+
+	public String getTaskId() {
+		return taskId;
+	}
+}
Index: DCWoRMS/trunk/build/classes/schedframe/events/scheduling/SchedulingEvent.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/events/scheduling/SchedulingEvent.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/events/scheduling/SchedulingEvent.java	(revision 477)
@@ -0,0 +1,53 @@
+package schedframe.events.scheduling;
+
+import schedframe.events.Event;
+import schedframe.events.EventType;
+
+public class SchedulingEvent implements Event{
+	
+	protected EventType type;
+	protected EventReason reason;
+	
+	protected String source;
+	
+	public SchedulingEvent(EventType eventType){
+		this(eventType, EventReason.UNKNOWN);
+	}
+	
+	public SchedulingEvent(EventType eventType, EventReason eventReason){
+		type = eventType;
+		reason = eventReason;
+	}
+	
+	public SchedulingEventType getType(){
+		SchedulingEventType schedEventType; 
+		try{
+			schedEventType = (SchedulingEventType)type;
+		} catch(Exception e){
+			schedEventType = SchedulingEventType.RESOURCE_STATE_CHANGED;
+		}
+		return schedEventType;
+	}
+	
+	public EventReason getReason(){
+		return reason;
+	}
+	
+	public void setSource(String value){
+		this.source = value;
+	}
+	
+	public String getSource(){
+		return this.source;
+	}
+
+	public int getTag() {
+		return type.getTag();
+	}
+
+	@Override
+	public Object getData() {
+		return null;
+	}
+	
+}
Index: DCWoRMS/trunk/build/classes/schedframe/events/scheduling/SchedulingEventType.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/events/scheduling/SchedulingEventType.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/events/scheduling/SchedulingEventType.java	(revision 477)
@@ -0,0 +1,51 @@
+package schedframe.events.scheduling;
+
+import schedframe.events.EventType;
+
+public enum SchedulingEventType implements EventType {
+
+	// task related
+	TASK_FINISHED(1),
+	TASK_FAILED(2),
+	TASK_CANCELED(4),
+	TASK_ARRIVED(8),
+	START_TASK_EXECUTION(16384),
+	TASK_REQUESTED_TIME_EXPIRED(32768),
+
+	//job related
+	JOB_ARRIVED(16),
+	JOB_FINISHED(32),
+	JOB_FAILED(64),
+	JOB_CANCELED(128),
+
+	//time related
+	TIMER(254),
+	
+	//resource related
+	RESOURCE_FAILED(512),
+	//provider related (relevant to grid scheduling)
+	PROVIDER_FAILED(1024),
+	
+	//reservation related
+	RESERVATION_ACTIVE(2048),
+	RESERVATION_FINISHED(4096),
+	RESERVATION_FAILED(8192),
+	RESERVATION_EXPIRED(16384),
+	
+	RESOURCE_STATE_CHANGED(32668)
+	;
+	
+	protected int tag;
+	
+	private SchedulingEventType(int tag){
+		this.tag = tag;
+	}
+	
+	public int getTag(){
+		return this.tag;
+	}
+	
+	public String getName(){
+		return toString();
+	}
+}
Index: DCWoRMS/trunk/build/classes/schedframe/events/scheduling/EventReason.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/events/scheduling/EventReason.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/events/scheduling/EventReason.java	(revision 477)
@@ -0,0 +1,24 @@
+package schedframe.events.scheduling;
+
+public enum EventReason {
+	//Reasons that caused given events
+	UNKNOWN,
+
+	//task-related
+	//TASK_FAILED
+	APP_FAILURE,
+	SYSTEM_FAILURE,
+	RESOURCE_FAILURE,
+	
+	//TASK_CANCELED
+	RESERVATION_EXCEEDED,
+	RESOURCES_EXCEEDED,
+	
+	//resource/provider-related
+	TEMPORARY_FAILURE,
+	PERMAMENT_FAILURE,
+	
+	
+	SIM_INIT
+	;
+}
Index: DCWoRMS/trunk/build/classes/schedframe/events/scheduling/SchedulingResponseType.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/events/scheduling/SchedulingResponseType.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/events/scheduling/SchedulingResponseType.java	(revision 477)
@@ -0,0 +1,20 @@
+package schedframe.events.scheduling;
+
+public enum SchedulingResponseType {
+
+	TERMINATE_TASK(0),
+	KILL_TASK(0),
+	STOP_AND_RESUME_FROM_CHECKPOINT(0),
+	EXECUTE_ANYWAY(0),
+	ONE_HOUR_GRACE_PERIOD(3600);
+	
+	protected int timer;
+	
+	private SchedulingResponseType(int timer){
+		this.timer = timer;
+	}
+	
+	public int getTimer(){
+		return this.timer;
+	}
+}
Index: DCWoRMS/trunk/build/classes/schedframe/events/scheduling/StartTaskExecutionEvent.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/events/scheduling/StartTaskExecutionEvent.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/events/scheduling/StartTaskExecutionEvent.java	(revision 477)
@@ -0,0 +1,28 @@
+package schedframe.events.scheduling;
+
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+public class StartTaskExecutionEvent extends SchedulingEvent {
+
+	protected String jobId;
+	protected String taskId;
+	
+	public StartTaskExecutionEvent(String jobId, String taskId) {
+		super(SchedulingEventType.START_TASK_EXECUTION);
+		this.jobId = jobId;
+		this.taskId = taskId;
+	}
+
+	public String getJobId() {
+		return jobId;
+	}
+
+	public String getTaskId() {
+		return taskId;
+	}
+	
+}
Index: DCWoRMS/trunk/build/classes/schedframe/events/ResourceEventCommand.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/events/ResourceEventCommand.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/events/ResourceEventCommand.java	(revision 477)
@@ -0,0 +1,22 @@
+package schedframe.events;
+
+import schedframe.resources.computing.ComputingResource;
+
+public class ResourceEventCommand implements EventCommand {
+
+	private ComputingResource compResource;
+	
+	public ResourceEventCommand(ComputingResource compResource) {
+		this.compResource = compResource;
+	}
+	
+	public void execute(EventType evType) {
+		//TODO - add event factory
+		throw new RuntimeException("not implemented");
+	}
+
+	public void execute(Event event) {
+		compResource.getEventHandler().handleResourceEvent(event);
+	}
+
+}
Index: DCWoRMS/trunk/build/classes/schedframe/events/EventHandler.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/events/EventHandler.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/events/EventHandler.java	(revision 477)
@@ -0,0 +1,11 @@
+package schedframe.events;
+
+import schedframe.events.scheduling.SchedulingEvent;
+
+public interface EventHandler {
+	
+	public void handleResourceEvent(Event event);
+	
+	public void handleSchedulingEvent(SchedulingEvent event);
+	
+}
Index: DCWoRMS/trunk/build/classes/schedframe/events/EventCommand.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/events/EventCommand.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/events/EventCommand.java	(revision 477)
@@ -0,0 +1,10 @@
+package schedframe.events;
+
+
+
+public interface EventCommand {
+
+	public void execute(EventType evType);
+	
+	public void execute(Event event);
+}
Index: DCWoRMS/trunk/build/classes/schedframe/events/Event.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/events/Event.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/events/Event.java	(revision 477)
@@ -0,0 +1,16 @@
+package schedframe.events;
+
+import schedframe.events.scheduling.EventReason;
+
+public interface Event {
+	
+	public EventType getType();
+	
+	public String getSource();
+	
+	public int getTag();
+	
+	public Object getData();
+	
+	public EventReason getReason();
+}
Index: DCWoRMS/trunk/build/classes/schedframe/events/EventType.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/events/EventType.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/events/EventType.java	(revision 477)
@@ -0,0 +1,9 @@
+package schedframe.events;
+
+public interface EventType {
+
+	public String getName();
+	
+	public int getTag();
+	
+}
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 477)
@@ -0,0 +1,24 @@
+package schedframe;
+
+import java.util.ArrayList;
+
+import schemas.StringValueWithUnit;
+
+public class Property extends ArrayList<StringValueWithUnit>{
+
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 1L;
+	protected String name;
+
+	public Property(String name) {
+		super();
+		this.name = name;
+	}
+
+	public String getName() {
+		return name;
+	}
+	
+}
Index: DCWoRMS/trunk/build/classes/schedframe/DescriptionContainer.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/DescriptionContainer.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/DescriptionContainer.java	(revision 477)
@@ -0,0 +1,28 @@
+package schedframe;
+
+/**
+ * Interface of a container for descriptions included in external document, e.g. XML document
+ * 
+ * @author Ariel
+ *
+ */
+
+public interface DescriptionContainer<T> {
+
+	/**
+	 * @return an object of a class that represents the description 
+	 */
+	public T getDescription();
+
+	/**
+	 * Provides the description as an original document
+	 * @return string representation of the description
+	 */
+	public String getDocument() throws Exception;
+	
+	/**
+	 * Calls {@link #getDocument} method
+	 * @return string representation of the description
+	 */
+	public String toString();
+}
Index: DCWoRMS/trunk/build/classes/schedframe/PluginConfiguration.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/PluginConfiguration.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/PluginConfiguration.java	(revision 477)
@@ -0,0 +1,16 @@
+package schedframe;
+
+import java.util.Map;
+
+import schedframe.events.scheduling.SchedulingEventType;
+
+public interface PluginConfiguration {
+	
+	/**
+	 * SchedulingEventType - type of the event served by the plugin.
+	 * Object - parameter of the event, if particular event requires one.
+	 * @return
+	 */
+	public Map<SchedulingEventType, Object> getServedEvents();
+
+}
Index: DCWoRMS/trunk/build/classes/schedframe/StaticResourceLoadCalendar.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/StaticResourceLoadCalendar.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/StaticResourceLoadCalendar.java	(revision 477)
@@ -0,0 +1,70 @@
+package schedframe;
+import gridsim.ResourceCalendar;
+
+import java.util.LinkedList;
+import java.util.Properties;
+
+import schedframe.exceptions.ModuleException;
+import schedframe.scheduling.plugin.grid.Module;
+import schedframe.scheduling.plugin.grid.ModuleType;
+
+public class StaticResourceLoadCalendar extends ResourceCalendar implements Module{
+	
+	private static long seed_; 
+	private static double timeZone_;
+	private static double peakLoad_;
+	private static double offPeakLoad_;
+	private static double holidayLoad_;
+	private static LinkedList<Integer> Weekends_;
+	private static LinkedList<Integer> Holidays_;
+	
+	static{
+		seed_ = 11L * 13L * 17L * 19L * 23L + 1L; 
+		timeZone_ = 0.0;
+		peakLoad_ = 0.0; // the resource load during peak hour
+		offPeakLoad_ = 0.0; // the resource load during off-peak hr
+		holidayLoad_ = 0.0; // the resource load during holiday
+		
+		// incorporates weekends so the grid resource is on 7 days a week
+		Weekends_ = new LinkedList<Integer>();
+		Weekends_.add(java.util.Calendar.SATURDAY);
+		Weekends_.add(java.util.Calendar.SUNDAY);
+
+		// incorporates holidays. However, no holidays are set in this example
+		Holidays_ = new LinkedList<Integer>();
+	}
+
+
+	public StaticResourceLoadCalendar(double timeZone, double peakLoad,
+			double offPeakLoad, double relativeHolidayLoad,
+			LinkedList weekendList, LinkedList holidayList, long seed) {
+		super(timeZone, peakLoad, offPeakLoad, relativeHolidayLoad, weekendList,
+				holidayList, seed);
+		// TODO Auto-generated constructor stub
+	}
+
+	public StaticResourceLoadCalendar(){
+		super(timeZone_, peakLoad_, offPeakLoad_, 
+				holidayLoad_, Weekends_, Holidays_, seed_);
+	}
+
+	@Override
+	public void init(Properties properties) throws ModuleException {
+		// TODO Auto-generated method stub
+		
+	}
+
+	@Override
+	public void dispose() throws ModuleException {
+		// TODO Auto-generated method stub
+		
+	}
+
+	@Override
+	public ModuleType getType() {
+		return ModuleType.RESOURCE_CALENDAR;
+	}
+
+
+
+}
Index: DCWoRMS/trunk/build/classes/schedframe/resources/StandardResourceType.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/resources/StandardResourceType.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/resources/StandardResourceType.java	(revision 477)
@@ -0,0 +1,22 @@
+package schedframe.resources;
+
+
+public enum StandardResourceType implements ResourceType {
+
+	Grid,
+	DataCenter,
+	Rack,
+	RECS,
+	ComputingNode,
+	Processor,
+	Core,
+	Undefined,
+	ResourceProvider,
+	GS,
+	LS;
+
+	public String getName() {
+		return toString();
+	}
+	
+}
Index: DCWoRMS/trunk/build/classes/schedframe/resources/utils/ResourceIdGenerator.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/resources/utils/ResourceIdGenerator.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/resources/utils/ResourceIdGenerator.java	(revision 477)
@@ -0,0 +1,21 @@
+package schedframe.resources.utils;
+
+import java.util.HashMap;
+
+import schedframe.resources.ResourceType;
+
+public class ResourceIdGenerator {
+	
+	private static HashMap<ResourceType, Integer> resourceCounter = new HashMap<ResourceType, Integer>();
+	
+	public static int getId(ResourceType type){
+
+		int value = 0;
+		if(resourceCounter.containsKey(type)){
+			value = resourceCounter.get(type);
+			value++;
+		}
+		resourceCounter.put(type, value);
+		return value;
+	}
+}
Index: DCWoRMS/trunk/build/classes/schedframe/resources/ResourceTypeFactory.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/resources/ResourceTypeFactory.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/resources/ResourceTypeFactory.java	(revision 477)
@@ -0,0 +1,40 @@
+package schedframe.resources;
+
+
+public class ResourceTypeFactory {
+	
+	public static ResourceType createResourceType(String typeName){
+		
+		if(typeName.equals(StandardResourceType.Grid.getName()))
+			return StandardResourceType.Grid;
+		
+		else if (typeName.equals(StandardResourceType.DataCenter.getName()))
+			return StandardResourceType.DataCenter;
+		
+		else if (typeName.equals(StandardResourceType.Rack.getName()))
+			return StandardResourceType.Rack;
+		
+		else if (typeName.equals(StandardResourceType.RECS.getName()))
+			return StandardResourceType.RECS;
+		
+		else if (typeName.equals(StandardResourceType.ComputingNode.getName()))
+			return StandardResourceType.ComputingNode;
+		
+		else if (typeName.equals(StandardResourceType.Processor.getName()))
+			return StandardResourceType.Processor;
+		
+		else if (typeName.equals(StandardResourceType.Core.getName()))
+			return StandardResourceType.Core;
+		
+		else if (typeName.equals(StandardResourceType.ResourceProvider.getName()))
+			return StandardResourceType.ResourceProvider;
+		
+		else if (typeName.equals(StandardResourceType.GS.getName()))
+			return StandardResourceType.GS;
+		
+		else if (typeName.equals(StandardResourceType.LS.getName()))
+			return StandardResourceType.LS;
+		
+		else return new UserResourceType(typeName);
+	}
+}
Index: DCWoRMS/trunk/build/classes/schedframe/resources/units/PEUnit.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/resources/units/PEUnit.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/resources/units/PEUnit.java	(revision 477)
@@ -0,0 +1,107 @@
+package schedframe.resources.units;
+
+
+
+
+public class PEUnit extends AbstractResourceUnit {
+	
+	protected int total;
+	protected int used;
+	protected int peSpeed;
+	
+	public PEUnit(PEUnit pe, int total, int used) {
+		super(pe);
+		this.total = total;
+		this.used = used;
+		this.peSpeed = 1;
+	}
+	
+	protected PEUnit(){
+		super(StandardResourceUnitName.PE);
+		this.peSpeed = 1;
+	}
+	
+	public PEUnit(int total, int used, int avgSpeed){
+		this();
+		this.total = total;
+		this.used = used;
+		this.peSpeed = avgSpeed;
+	}
+	
+	public PEUnit(String resId, int total, int used) {
+		super(StandardResourceUnitName.PE, resId);
+		this.total = total;
+		this.used = used;
+		this.peSpeed = 1;
+	}
+	
+	public void setSpeed(int speed) {
+		this.peSpeed = speed;
+	}
+	
+	public int getSpeed(){
+		return this.peSpeed;
+	}
+	
+	public int getFreeAmount() {
+		return this.total - this.used;
+	}
+	
+	public int getUsedAmount(){
+		return this.used;
+	}
+
+	public int getAmount(){
+		return this.total;
+	}
+	
+	public void setUsedAmount(int amount) {
+		this.used = amount;
+	}
+	
+	public void reset(){
+		this.used = 0;
+	}
+	
+	public ResourceUnit toDiscrete(){
+		throw new UnsupportedOperationException();
+	}
+	
+	
+	/**
+	 * Compares processing power of the free processors, which is calculated as product
+	 * of {@link #getAmount()} * {@link #getProcessorSpeed()}
+	 * Returns a negative integer, zero, or a positive integer as this object is less
+     * than, equal to, or greater than the specified object
+	 */
+	public int compareTo(ResourceUnit o) {
+		if(o instanceof PEUnit){
+			PEUnit pe = (PEUnit) o;
+			int p_power = pe.getAmount() * pe.getSpeed();
+			int power = this.getAmount() * this.getSpeed();
+			if(power < p_power) return -1;
+			if(power > p_power) return 1;
+			return 0;
+		} else {
+			throw new ClassCastException();
+		}
+	}
+	
+	public boolean equals(Object o){
+		if(o instanceof PEUnit){
+			if(!super.equals(o))
+				return false;
+			PEUnit pe = (PEUnit) o;
+			if(pe.getSpeed() != this.getSpeed()) return false;
+			return true;
+		} else {
+			return false;
+		}
+	}
+
+	public PEUnit replicate (int amount){
+		amount = Math.min(getAmount(), amount);
+		PEUnit peUnit = new PEUnit(this, amount, amount);
+		return peUnit;
+	}
+}
Index: DCWoRMS/trunk/build/classes/schedframe/resources/units/Memory.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/resources/units/Memory.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/resources/units/Memory.java	(revision 477)
@@ -0,0 +1,86 @@
+package schedframe.resources.units;
+
+
+
+public class Memory extends AbstractResourceUnit {
+
+	protected int total;
+	protected int used;
+
+	public Memory(Memory m, int total, int used) {
+		super(m);
+		this.total = total;
+		this.used = used;
+	}
+	
+	public Memory(Memory m) {
+		super(m);
+		this.total = m.total;
+		this.used = m.used;
+	}
+	
+	public Memory(int total, int used) {
+		super(StandardResourceUnitName.MEMORY);
+		this.total = total;
+		this.used = used;
+	}
+	
+	public Memory(String resId, int total, int used) {
+		super(StandardResourceUnitName.MEMORY, resId);
+		this.total = total;
+		this.used = used;
+	}
+
+	public int getFreeAmount() {
+		return this.total - this.used - this.getProvisioner().getPending();
+	}
+
+	public int getUsedAmount(){
+		return this.used;
+	}
+	
+	public void setUsedAmount(int amount){
+		if(amount > this.total){
+			throw new IllegalArgumentException(
+					"Used amount can not be grather then total amount.");
+		}
+		this.used = amount;
+	}
+	
+	public int getAmount(){
+		return this.total;
+	}
+
+	public ResourceUnit toDiscrete() throws ClassNotFoundException {
+		throw new ClassNotFoundException("There is no distinguish class version for " 
+										+ getClass().getName());
+	}
+
+	/**
+	 * Comparing two Memory objects is equivalent to
+	 * comparing the free amount of the resource. See {@link #getAmount()}
+	 */
+	public int compareTo(ResourceUnit o) {
+		if(o instanceof Memory){
+			int free = total - used;
+			if(free < o.getFreeAmount()) return -1;
+			if(free > o.getFreeAmount()) return 1;
+			return 0;
+		} else {
+			throw new IllegalArgumentException(o + " is not an instance of " +
+											"memory resource unit.");
+		}
+	}
+
+	public boolean equals(Object o){
+		if(o instanceof Memory){
+			return super.equals(o);
+		} else {
+			return false;
+		}
+	}
+
+
+}
+
+
Index: DCWoRMS/trunk/build/classes/schedframe/resources/units/CpuSpeed.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/resources/units/CpuSpeed.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/resources/units/CpuSpeed.java	(revision 477)
@@ -0,0 +1,83 @@
+package schedframe.resources.units;
+
+
+
+public class CpuSpeed extends AbstractResourceUnit{
+
+	protected int total;
+	protected int used;
+	
+	public CpuSpeed(CpuSpeed cs, int total, int used) {
+		super(cs);
+		this.total = total;
+		this.used = used;
+	}
+	
+	public CpuSpeed(CpuSpeed cs) {
+		super(cs);
+		this.total = cs.total;
+		this.used = cs.used;
+	}
+	
+	public CpuSpeed(int total, int used) {
+		super(StandardResourceUnitName.CPUSPEED);
+		this.total = total;
+		this.used = used;
+	}
+	
+	public CpuSpeed(String resId, int total, int used) {
+		super(StandardResourceUnitName.CPUSPEED, resId);
+		this.total = total;
+		this.used = used;
+	}
+	
+	public int getFreeAmount() {
+		return this.total - this.used;
+	}
+
+	public int getUsedAmount(){
+		return this.used;
+	}
+	
+	public void setUsedAmount(int amount){
+		this.used = amount;
+	}
+	
+	public void setAmount(int amount){
+		this.total = amount;
+	}
+
+	public int getAmount(){
+		return this.total;
+	}
+
+	public ResourceUnit toDiscrete() throws ClassNotFoundException {
+		throw new ClassNotFoundException("There is no distinguish class version for " 
+										+ getClass().getName());
+	}
+
+	/**
+	 * Comparing two Memory objects is equivalent to
+	 * comparing the free amount of the resource. See {@link #getAmount()}
+	 */
+	public int compareTo(ResourceUnit o) {
+		if(o instanceof CpuSpeed){
+			int free = total - used;
+			if(free < o.getFreeAmount()) return -1;
+			if(free > o.getFreeAmount()) return 1;
+			return 0;
+		} else {
+			throw new IllegalArgumentException(o + " is not an instance of " +
+											"memory resource unit.");
+		}
+	}
+
+	public boolean equals(Object o){
+		if(o instanceof CpuSpeed){
+			return super.equals(o);
+		} else {
+			return false;
+		}
+	}
+
+}
Index: DCWoRMS/trunk/build/classes/schedframe/resources/units/ProcessingElements.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/resources/units/ProcessingElements.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/resources/units/ProcessingElements.java	(revision 477)
@@ -0,0 +1,305 @@
+package schedframe.resources.units;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+import java.util.ListIterator;
+
+import schedframe.resources.ResourceStatus;
+import schedframe.resources.ResourceType;
+import schedframe.resources.computing.ComputingResource;
+
+public class ProcessingElements extends PEUnit implements List<ComputingResource> {
+
+	protected List<ComputingResource> resources;
+
+	public ProcessingElements(){
+		super();
+		resources =  new ArrayList<ComputingResource>(1);
+		provisioner = new ProcessingElementsResourceUnitProvisioner(ResourceUnitState.FREE, 0);
+	}
+	
+	public ProcessingElements(String resName){
+		this();
+		resourceId = resName;
+	}
+	
+	public ProcessingElements(List<ComputingResource> resources){
+		this();
+		this.resources = resources;
+	}
+	
+	public ProcessingElements(String resName, List<ComputingResource> resources){
+		this(resName);
+		this.resources = resources;
+	}
+
+	public ResourceType getResourceType(){
+		if(resources != null && resources.size() > 0)
+			return resources.get(0).getType();
+		else return null;
+	}
+	
+	public int getAmount(){
+		return this.resources.size();
+	}
+	
+	public int getSpeed(){
+		int peCnt = getAmount();
+		
+		double avgSpeed = 0;
+		for(int i = 0; i < peCnt; i++){
+			try {
+				avgSpeed += resources.get(i).getResourceCharacteristic().getResourceUnit(StandardResourceUnitName.CPUSPEED).getAmount();
+			} catch (NoSuchFieldException e) {
+				// TODO Auto-generated catch block
+				e.printStackTrace();
+			}
+		}
+		avgSpeed = avgSpeed / peCnt;
+		int speed = (int) Math.round(avgSpeed);
+		return speed;
+	}
+
+	@Override
+	public boolean add(ComputingResource e) {
+		if(resources == null)
+			resources = new ArrayList<ComputingResource>(1);
+		return resources.add(e);
+
+	}
+
+	@Override
+	public void add(int index, ComputingResource element) {
+		if(resources == null)
+			resources = new ArrayList<ComputingResource>(1);
+		resources.add(index, element);
+	}
+
+	@Override
+	public boolean addAll(Collection<? extends ComputingResource> c) {
+		if(resources == null)
+			resources = new ArrayList<ComputingResource>(c.size());
+		return resources.addAll(c);
+	}
+
+	@Override
+	public boolean addAll(int index, Collection<? extends ComputingResource> c) {
+		return resources.addAll(index, c);
+	}
+
+	@Override
+	public void clear() {
+		// TODO Auto-generated method stub
+
+	}
+
+	@Override
+	public boolean contains(Object o) {
+		return resources.contains(o);
+	}
+
+	@Override
+	public boolean containsAll(Collection<?> c) {
+		return resources.containsAll(c);
+	}
+
+	@Override
+	public ComputingResource get(int index) {
+		return resources.get(index);
+	}
+
+	@Override
+	public int indexOf(Object o) {
+		return resources.indexOf(o);
+	}
+
+	@Override
+	public boolean isEmpty() {
+		return resources.isEmpty();
+	}
+
+	@Override
+	public Iterator<ComputingResource> iterator() {
+		return resources.iterator();
+	}
+
+	@Override
+	public int lastIndexOf(Object o) {
+		return resources.lastIndexOf(o);
+	}
+
+	@Override
+	public ListIterator<ComputingResource> listIterator() {
+		return resources.listIterator();
+	}
+
+	@Override
+	public ListIterator<ComputingResource> listIterator(int index) {
+		return resources.listIterator(index);
+	}
+
+	@Override
+	public boolean remove(Object o) {
+		// TODO Auto-generated method stub
+		return false;
+	}
+
+	@Override
+	public ComputingResource remove(int index) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public boolean removeAll(Collection<?> c) {
+		// TODO Auto-generated method stub
+		return false;
+	}
+
+	@Override
+	public boolean retainAll(Collection<?> c) {
+		// TODO Auto-generated method stub
+		return false;
+	}
+
+	@Override
+	public ComputingResource set(int index, ComputingResource element) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public int size() {
+		return resources.size();
+	}
+
+	@Override
+	public List<ComputingResource> subList(int fromIndex, int toIndex) {
+		return resources.subList(fromIndex, toIndex);
+	}
+
+	@Override
+	public Object[] toArray() {
+		return resources.toArray();
+	}
+
+	@Override
+	public <T> T[] toArray(T[] a) {
+		return resources.toArray(a);
+	}
+
+	
+	protected int getAmount(ResourceStatus status){
+		int sum = 0;
+		for(int i = 0; i < this.resources.size(); i++){
+			if(resources.get(i).getStatus() == status){
+				sum++;
+			}
+		}
+		return sum;
+	}
+	
+	public int getFreeAmount(){
+		return getAmount(ResourceStatus.FREE);
+	}
+
+	public int getUsedAmount(){
+		return getAmount(ResourceStatus.BUSY);
+	}
+	
+	public void setUsedAmount(int amount) {
+		int cnt = getAmount(ResourceStatus.BUSY);
+		int delta = amount - cnt;
+
+		//allocate resources
+		if(delta > 0){
+				for(int i = 0; i < this.resources.size() && delta > 0; i++){
+					ComputingResource r = this.resources.get(i);
+					if(r.getStatus() == ResourceStatus.FREE || r.getStatus() == ResourceStatus.PENDING){
+						r.setStatus(ResourceStatus.BUSY);
+						delta--;
+					}
+				}
+		}
+		//free resources
+		else if(delta < 0) {
+			for(int i = this.resources.size() - 1; i >= 0 && delta < 0; i--){
+				ComputingResource r = this.resources.get(i);
+				if(r.getStatus() == ResourceStatus.BUSY){
+					r.setStatus(ResourceStatus.FREE);
+					delta++;
+				}
+			}
+		}
+	}
+	
+	public ProcessingElements replicate(int amount){
+		List<ComputingResource> compResources =  new ArrayList<ComputingResource>(amount);
+		Iterator<ComputingResource> it = resources.iterator();
+		amount = Math.min(resources.size(), amount);
+		while(it.hasNext() && amount > 0){
+			ComputingResource compRes = it.next();
+			if(compRes.getStatus() == ResourceStatus.FREE){
+				compResources.add(compRes);
+				amount--;
+			}
+		}
+		return new ProcessingElements(compResources);
+	}
+
+	public ResourceUnitProvisioner getProvisioner() {
+		if(provisioner == null){
+			provisioner = new ProcessingElementsResourceUnitProvisioner(ResourceUnitState.FREE, 0);
+		}
+        return provisioner;
+	}
+	
+	class ProcessingElementsResourceUnitProvisioner implements ResourceUnitProvisioner{
+
+		protected ResourceUnitState state;
+		protected int pending;
+
+		public ProcessingElementsResourceUnitProvisioner (ResourceUnitState state, int pending) {
+			this.state = state;
+			this.pending = pending;
+		}
+
+		public ResourceUnitState getState() {
+			return state;
+		}
+
+		public void setState(ResourceUnitState newState) {
+
+			if(newState == ResourceUnitState.FREE){
+				setUsedAmount(getUsedAmount() - getAmount());
+			} else if(newState == ResourceUnitState.PENDING){
+				for (int i = 0; i < resources.size(); i++) {
+					ComputingResource pe = resources.get(i);
+					if (pe.getStatus() == ResourceStatus.FREE) {
+						pe.setStatus(ResourceStatus.PENDING);
+					}
+				}
+				setPending(getPending() + getAmount());
+			} else if(state == ResourceUnitState.PENDING && newState == ResourceUnitState.BUSY){
+				setPending(getProvisioner().getPending() - getAmount());
+				setUsedAmount(getUsedAmount() + getAmount());
+			} else if(state == ResourceUnitState.FREE && newState == ResourceUnitState.BUSY){
+				setUsedAmount(getUsedAmount() + getAmount());
+			}
+			state = newState;
+		}
+		
+		public int getPending() {
+			return pending;
+		}
+
+		public void setPending(int pending) {
+			this.pending = pending;
+		}
+		
+	}
+	
+
+}
Index: DCWoRMS/trunk/build/classes/schedframe/resources/units/StandardResourceUnitName.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/resources/units/StandardResourceUnitName.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/resources/units/StandardResourceUnitName.java	(revision 477)
@@ -0,0 +1,52 @@
+package schedframe.resources.units;
+
+
+public enum StandardResourceUnitName implements ResourceUnitName{
+
+
+    /**
+     * Constant MEMORY
+     */
+    MEMORY("memory"),
+
+    /**
+     * Constant CPU
+     */
+    CPU("cpu"),
+    
+    /**
+     * Constant GPU
+     */
+    GPU("gpu"),
+    
+    /**
+     * Constant CPUSPEED
+     */
+    CPUSPEED("cpuspeed"),
+    
+    /**
+     * Constant APPLICATION
+     */
+    APPLICATION("application"),
+    
+    /**
+     * Constant STORAGE
+     */
+    STORAGE("storage"),
+    
+    COST("cost"),
+    
+    PE("processingElement");
+
+    
+    private final String name;
+
+    private StandardResourceUnitName(String value) {
+        this.name = value;
+    }
+
+    public String getName(){
+    	return this.name;
+    }
+
+}
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 477)
@@ -0,0 +1,123 @@
+package schedframe.resources.units;
+
+import schedframe.Parameters;
+
+public abstract class AbstractResourceUnit implements ResourceUnit, Cloneable {
+	
+	protected ResourceUnitName name;
+	
+	protected ResourceUnitType resourceType;;
+
+	protected String resourceId;
+	
+	protected ResourceUnitProvisioner provisioner;
+	
+	
+	public AbstractResourceUnit(AbstractResourceUnit unit){
+		this.name = unit.name;
+		this.resourceType = unit.resourceType;
+		this.resourceId = unit.resourceId;
+		this.provisioner = new SimpleResourceUnitProvisioner(unit, ResourceUnitState.FREE, 0);
+	}
+	
+	public AbstractResourceUnit(ResourceUnitName name) {
+		this.name = name;
+		resourceId = "";
+		resourceType = ResourceUnitType.CONTINUOUS_RESOURCE;
+		this.provisioner = new SimpleResourceUnitProvisioner(this, ResourceUnitState.FREE, 0);
+	}
+
+	public AbstractResourceUnit(ResourceUnitName name, String resId) {
+		this(name);
+		resourceId = resId;
+		resourceType = ResourceUnitType.CONTINUOUS_RESOURCE;
+		this.provisioner = new SimpleResourceUnitProvisioner(this, ResourceUnitState.FREE, 0);
+	}
+	
+	public ResourceUnitName getName() {
+		return name;
+	}
+
+	public String getResourceId() {
+		return resourceId;
+	}
+	
+	public ResourceUnitType getResourceUnitType() {
+		return this.resourceType;
+	}
+	
+	public boolean equals(Object o){
+		if(o instanceof AbstractResourceUnit){
+			AbstractResourceUnit unit = (AbstractResourceUnit) o;
+			if(this.name != unit.getName()) return false;
+			if(!this.resourceId.equals(unit.getResourceId())) return false;
+			if(this.getFreeAmount() != unit.getFreeAmount()) return false;
+			if(this.getUsedAmount() != unit.getUsedAmount()) return false;
+			return true;
+		} else {
+			return false;
+		}
+	}
+	
+	public Object clone(){
+		Object obj = null;
+		try {
+			obj = super.clone();
+		} catch (CloneNotSupportedException e) {
+			e.printStackTrace();
+		}
+		return obj;
+	}
+	
+	public void reset(){};
+	
+	public void init(Parameters parameters){
+		
+	}
+	
+	public ResourceUnitProvisioner getProvisioner() {
+        return provisioner;
+
+	}
+
+	class SimpleResourceUnitProvisioner implements ResourceUnitProvisioner{
+
+		protected ResourceUnit primaryUnit;
+		protected ResourceUnitState state;
+		protected int pending;
+		
+		public SimpleResourceUnitProvisioner (ResourceUnit primaryUnit, ResourceUnitState state, int pending) {
+			this.primaryUnit = primaryUnit;
+			this.state = state;
+			this.pending = pending;
+		}
+
+		public ResourceUnitState getState() {
+			return state;
+		}
+
+		public void setState(ResourceUnitState newState) {
+
+			if(newState == ResourceUnitState.FREE){
+				primaryUnit.setUsedAmount(primaryUnit.getUsedAmount() - getAmount());
+			} else if(newState == ResourceUnitState.PENDING){
+				primaryUnit.getProvisioner().setPending(primaryUnit.getProvisioner().getPending() + getAmount());
+			} else if(state == ResourceUnitState.PENDING && newState == ResourceUnitState.BUSY){
+				primaryUnit.getProvisioner().setPending(primaryUnit.getProvisioner().getPending() - getAmount());
+				primaryUnit.setUsedAmount(primaryUnit.getUsedAmount() + getAmount());
+			} else if(state == ResourceUnitState.FREE && newState == ResourceUnitState.BUSY){
+				primaryUnit.setUsedAmount(primaryUnit.getUsedAmount() + getAmount());
+			}
+			state = newState;
+		}
+		
+		public int getPending() {
+			return pending;
+		}
+
+		public void setPending(int pending) {
+			this.pending = pending;
+		}
+		
+	}
+}
Index: DCWoRMS/trunk/build/classes/schedframe/resources/units/ResourceUnitFactory.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/resources/units/ResourceUnitFactory.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/resources/units/ResourceUnitFactory.java	(revision 477)
@@ -0,0 +1,76 @@
+package schedframe.resources.units;
+
+
+
+
+
+public class ResourceUnitFactory {
+	
+	/*public static ResourceUnit creteUnit(String resourceClass, int totalAmount, int usedAmount){
+		switch(ResourceParameterName.fromValue(resourceClass)){
+			case CPUCOUNT: return new Processors(totalAmount, usedAmount, 1);
+			case MEMORY: return new Memory(totalAmount, usedAmount);
+			case FREEMEMORY: return new FreeMemory(totalAmount, usedAmount); 
+			case CPUSPEED: return new CpuSpeed(totalAmount, usedAmount); 
+		default:
+			return new FreeMemory(totalAmount, usedAmount); 
+			//throw new IllegalArgumentException("Paramter " + resourceClass + " is not supported.");
+		}
+	}*/
+	
+	public static ResourceUnit createUnit(String unitName, String resId, int totalAmount, int usedAmount){
+		if(unitName.equals(StandardResourceUnitName.CPU.getName()))
+			return new PEUnit(resId, totalAmount, usedAmount);
+		if(unitName.equals(StandardResourceUnitName.PE.getName()))
+			return new PEUnit(resId, totalAmount, usedAmount);
+		else if(unitName.equals(StandardResourceUnitName.MEMORY.getName()))
+			 return new Memory(resId, totalAmount, usedAmount);
+		else if(unitName.equals(StandardResourceUnitName.STORAGE.getName()))
+			 return new Storage(resId, totalAmount, usedAmount);
+		else if(unitName.equals(StandardResourceUnitName.GPU.getName()))
+			 return new GPU(resId, totalAmount, usedAmount);
+		else if (unitName.equals(StandardResourceUnitName.CPUSPEED.getName()))
+			return new CpuSpeed(resId, totalAmount, usedAmount); 
+		else if (unitName.equals(StandardResourceUnitName.COST.getName()))
+			return new Cost(resId, totalAmount);
+		else if (unitName.equals(StandardResourceUnitName.APPLICATION.getName()))
+			return new Applications(resId); 
+		else
+			return new SimpleResourceUnit(ResourceUnitNameFactory.createResourceUnitName(unitName), resId, totalAmount, usedAmount); 
+	}
+	
+	public static ResourceUnit createUnit(String unitName, int totalAmount, int usedAmount){
+		if(unitName.equals(StandardResourceUnitName.CPU.getName()))
+			return new PEUnit(totalAmount, usedAmount, 1);
+		else if(unitName.equals(StandardResourceUnitName.MEMORY.getName()))
+			 return new Memory(totalAmount, usedAmount);
+		else if (unitName.equals(StandardResourceUnitName.CPUSPEED.getName()))
+			return new CpuSpeed(totalAmount, usedAmount); 
+		else
+			return new SimpleResourceUnit(ResourceUnitNameFactory.createResourceUnitName(unitName), totalAmount, usedAmount); 
+	}
+	
+	
+	public static ResourceUnit createUnit(ResourceUnitName unitName, int totalAmount, int usedAmount){
+		if(unitName.equals(StandardResourceUnitName.CPU))
+			return new PEUnit(totalAmount, usedAmount, 1);
+		else if(unitName.equals(StandardResourceUnitName.MEMORY))
+			 return new Memory(totalAmount, usedAmount);
+		else if (unitName.equals(StandardResourceUnitName.CPUSPEED))
+			return new CpuSpeed(totalAmount, usedAmount); 
+		else
+			return new SimpleResourceUnit(unitName, totalAmount, usedAmount); 
+	}
+	
+	/*public static ResourceUnit creteUnit(String resourceClass, int totalAmount, int usedAmount){
+		
+		switch(ResourceUnitClass.valueOf(resourceClass)){
+			case CPU: return new Processors(totalAmount, usedAmount, 1);
+			case MEMORY: return new Memory(totalAmount, usedAmount);
+			case STORAGE: return new Storage(totalAmount, usedAmount);
+		default:
+			
+			throw new IllegalArgumentException("Paramter " + resourceClass + " is not supported.");
+		}
+	}*/
+}
Index: DCWoRMS/trunk/build/classes/schedframe/resources/units/ResourceUnitProvisioner.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/resources/units/ResourceUnitProvisioner.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/resources/units/ResourceUnitProvisioner.java	(revision 477)
@@ -0,0 +1,13 @@
+package schedframe.resources.units;
+
+
+public interface ResourceUnitProvisioner {
+
+	public int getPending();
+
+	public void setPending(int pending);
+	
+	public ResourceUnitState getState();
+	
+	public void setState(ResourceUnitState newState);
+}
Index: DCWoRMS/trunk/build/classes/schedframe/resources/units/ResourceUnitType.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/resources/units/ResourceUnitType.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/resources/units/ResourceUnitType.java	(revision 477)
@@ -0,0 +1,33 @@
+package schedframe.resources.units;
+
+/**
+ * 
+ * Type of resource unit
+ * For instance, continuous for memory, bandwidth, etc. and discrete for processors
+ * 
+ * @author Ariel
+ *
+ */
+public enum ResourceUnitType {
+
+	UNKNOWN("unknown", 0),
+	CONTINUOUS_RESOURCE("continuous resource", 1),
+	DISCRETE_RESOURCE("discrete resource", 2)
+	;
+	
+	private final int iValue;
+	private final String sValue;
+	
+	private ResourceUnitType(final String sValue, final int iValue){
+		this.sValue = sValue;
+		this.iValue = iValue;
+	}
+	
+	public String toString(){
+		return this.sValue;
+	}
+	
+	public int toInt(){
+		return this.iValue;
+	}
+}
Index: DCWoRMS/trunk/build/classes/schedframe/resources/units/SimpleResourceUnit.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/resources/units/SimpleResourceUnit.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/resources/units/SimpleResourceUnit.java	(revision 477)
@@ -0,0 +1,60 @@
+package schedframe.resources.units;
+
+
+
+public class SimpleResourceUnit extends AbstractResourceUnit {
+
+	protected int total;
+	protected int used;
+	
+	public SimpleResourceUnit(SimpleResourceUnit sru, int total, int used) {
+		super(sru);
+		this.total = total;
+		this.used = used;
+	}
+	
+	public SimpleResourceUnit(SimpleResourceUnit sru) {
+		super(sru);
+		this.total = sru.total;
+		this.used = sru.used;
+	}
+	
+	public SimpleResourceUnit(ResourceUnitName name, int total, int used) {
+		super(name);
+		this.total = total;
+		this.used = used;
+	}
+	
+	public SimpleResourceUnit(ResourceUnitName name, String resId, int total, int used) {
+		super(name, resId);
+		this.total = total;
+		this.used = used;
+	}
+	
+	public int getFreeAmount() {
+		return this.total - this.used;
+	}
+
+	public int getUsedAmount(){
+		return this.used;
+	}
+	
+	public void setUsedAmount(int amount){
+		if(amount > this.total){
+			throw new IllegalArgumentException(
+					"Used amount can not be grather then total amount.");
+		}
+		this.used = amount;
+	}
+	
+	public int getAmount(){
+		return this.total;
+	}
+
+	public ResourceUnit toDiscrete() throws ClassNotFoundException {
+		throw new ClassNotFoundException("There is no distinguish class version for " 
+										+ getClass().getName());
+	}
+
+
+}
Index: DCWoRMS/trunk/build/classes/schedframe/resources/units/Storage.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/resources/units/Storage.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/resources/units/Storage.java	(revision 477)
@@ -0,0 +1,82 @@
+package schedframe.resources.units;
+
+
+public class Storage extends AbstractResourceUnit {
+
+	protected int total;
+	protected int used;
+
+	public Storage(Storage s, int total, int used) {
+		super(s);
+		this.total = total;
+		this.used = used;
+	}
+	
+	public Storage (Storage s) {
+		super(s);
+		this.total = s.total;
+		this.used = s.used;
+	}
+	
+	public Storage(int total, int used) {
+		super(StandardResourceUnitName.STORAGE);
+		this.total = total;
+		this.used = used;
+	}
+	
+	public Storage (String resId, int total, int used) {
+		super(StandardResourceUnitName.STORAGE, resId);
+		this.total = total;
+		this.used = used;
+	}
+
+	public int getFreeAmount() {
+		return this.total - this.used;
+	}
+
+	public int getUsedAmount(){
+		return this.used;
+	}
+	
+	public void setUsedAmount(int amount){
+		if(amount > this.total){
+			throw new IllegalArgumentException(
+					"Used amount can not be grather then total amount.");
+		}
+		this.used = amount;
+	}
+	
+	public int getAmount(){
+		return this.total;
+	}
+
+	public ResourceUnit toDiscrete() throws ClassNotFoundException {
+		throw new ClassNotFoundException("There is no distinguish class version for " 
+										+ getClass().getName());
+	}
+
+	/**
+	 * Comparing two Memory objects is equivalent to
+	 * comparing the free amount of the resource. See {@link #getAmount()}
+	 */
+	public int compareTo(ResourceUnit o) {
+		if(o instanceof Memory){
+			int free = total - used;
+			if(free < o.getFreeAmount()) return -1;
+			if(free > o.getFreeAmount()) return 1;
+			return 0;
+		} else {
+			throw new IllegalArgumentException(o + " is not an instance of " +
+											"memory resource unit.");
+		}
+	}
+
+	public boolean equals(Object o){
+		if(o instanceof Memory){
+			return super.equals(o);
+		} else {
+			return false;
+		}
+	}
+	
+}
Index: DCWoRMS/trunk/build/classes/schedframe/resources/units/Cost.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/resources/units/Cost.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/resources/units/Cost.java	(revision 477)
@@ -0,0 +1,66 @@
+package schedframe.resources.units;
+
+
+
+public class Cost extends AbstractResourceUnit {
+	
+	protected int value;
+
+	public Cost(Cost c) {
+		super(c);
+		this.value = c.value;
+	}
+	
+	public Cost(int value) {
+		super(StandardResourceUnitName.COST);
+		this.value = value;
+	}
+	
+	public Cost(String resId, int value) {
+		super(StandardResourceUnitName.COST, resId);
+		this.value = value;
+	}
+
+	public int getFreeAmount() {
+		return 0;
+	}
+
+	public int getUsedAmount(){
+		return 0;
+	}
+	
+	public void setUsedAmount(int amount){
+	}
+	
+	public int getAmount(){
+		return this.value;
+	}
+
+	public ResourceUnit toDiscrete() throws ClassNotFoundException {
+		throw new ClassNotFoundException("There is no distinguish class version for " 
+										+ getClass().getName());
+	}
+
+	/**
+	 * Comparing two Memory objects is equivalent to
+	 * comparing the free amount of the resource. See {@link #getAmount()}
+	 */
+	public int compareTo(ResourceUnit o) {
+		if(o instanceof Cost){
+			if(this.value < o.getAmount()) return -1;
+			if(this.value > o.getAmount()) return 1;
+			return 0;
+		} else {
+			throw new IllegalArgumentException(o + " is not an instance of " +
+											"memory resource unit.");
+		}
+	}
+
+	public boolean equals(Object o){
+		if(o instanceof Cost){
+			return super.equals(o);
+		} else {
+			return false;
+		}
+	}
+}
Index: DCWoRMS/trunk/build/classes/schedframe/resources/units/ResourceUnitNameFactory.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/resources/units/ResourceUnitNameFactory.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/resources/units/ResourceUnitNameFactory.java	(revision 477)
@@ -0,0 +1,31 @@
+package schedframe.resources.units;
+
+
+public class ResourceUnitNameFactory {
+
+	public static ResourceUnitName createResourceUnitName(String unitName){
+
+		if(unitName.equals(StandardResourceUnitName.MEMORY.getName()))
+			return StandardResourceUnitName.MEMORY;
+		
+		else if (unitName.equals(StandardResourceUnitName.STORAGE.getName()))
+			return StandardResourceUnitName.STORAGE;
+		
+		else if (unitName.equals(StandardResourceUnitName.PE.getName()))
+			return StandardResourceUnitName.PE;
+		
+		else if (unitName.equals(StandardResourceUnitName.CPUSPEED.getName()))
+			return StandardResourceUnitName.CPUSPEED;
+		
+		else if (unitName.equals(StandardResourceUnitName.GPU.getName()))
+			return StandardResourceUnitName.GPU;
+		
+		else if (unitName.equals(StandardResourceUnitName.APPLICATION.getName()))
+			return StandardResourceUnitName.APPLICATION;
+		
+		else if (unitName.equals(StandardResourceUnitName.COST.getName()))
+			return StandardResourceUnitName.COST;
+
+		else return new UserResourceUnitName(unitName);
+	}
+}
Index: DCWoRMS/trunk/build/classes/schedframe/resources/units/Applications.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/resources/units/Applications.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/resources/units/Applications.java	(revision 477)
@@ -0,0 +1,74 @@
+package schedframe.resources.units;
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+
+public class Applications extends AbstractResourceUnit {
+
+	
+	protected List<String> applicationNames;
+	
+	public Applications(String resId){
+		super(StandardResourceUnitName.APPLICATION, resId);
+		
+		this.resourceType = ResourceUnitType.DISCRETE_RESOURCE;
+		this.applicationNames = new ArrayList<String>(2);
+	}
+	
+	public Applications(String resId, List<String> names){
+		super(StandardResourceUnitName.APPLICATION, resId);
+		
+		this.resourceType = ResourceUnitType.DISCRETE_RESOURCE;
+		
+		if(names == null)
+			this.applicationNames = new ArrayList<String>(2);
+		else
+			this.applicationNames = names;
+	}
+	
+	public void addApplication(String name){
+		this.applicationNames.add(name);
+	}
+	
+	public List<String> getApplicationNames(){
+		return this.applicationNames;
+	}
+	
+	public boolean containsApplication(String name){
+		return this.applicationNames.contains(name);
+	}
+	
+	public int getAmount() {
+		return this.applicationNames.size();
+	}
+
+	public int getFreeAmount() {
+		return this.getAmount();
+	}
+
+	public int getUsedAmount() {
+		return 0;
+	}
+
+	public void setUsedAmount(int amount) {
+	}
+
+	public ResourceUnit toDiscrete() throws ClassNotFoundException {
+		return this;
+	}
+
+	public int compareTo(ResourceUnit o) {
+		return 0;
+	}
+
+	public String toString(){
+		StringBuffer buffer = new StringBuffer();
+		for(int i = 0; i < this.applicationNames.size(); i++){
+			buffer.append(this.applicationNames.get(i) + ", ");
+		}
+		
+		return getName() + ": " + buffer.toString();
+	}
+}
Index: DCWoRMS/trunk/build/classes/schedframe/resources/units/UserResourceUnitName.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/resources/units/UserResourceUnitName.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/resources/units/UserResourceUnitName.java	(revision 477)
@@ -0,0 +1,15 @@
+package schedframe.resources.units;
+
+public class UserResourceUnitName implements ResourceUnitName {
+
+	protected String name;
+
+	public UserResourceUnitName(String name) {
+		this.name = name;
+	}
+
+	public String getName() {
+		return name;
+	}
+
+}
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 477)
@@ -0,0 +1,26 @@
+package schedframe.resources.units;
+
+import schedframe.Parameters;
+
+public interface ResourceUnit {
+
+	public ResourceUnitName getName();
+	
+	public ResourceUnitType getResourceUnitType();
+	
+	public String getResourceId();
+	
+	public int getFreeAmount() ;
+
+	public int getUsedAmount();
+	
+	public int getAmount();
+	
+	public void setUsedAmount(int amount);
+	
+	public ResourceUnit toDiscrete() throws ClassNotFoundException;
+	
+	public void init(Parameters parameters);
+	
+	public ResourceUnitProvisioner getProvisioner();
+}
Index: DCWoRMS/trunk/build/classes/schedframe/resources/units/ResourceUnitName.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/resources/units/ResourceUnitName.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/resources/units/ResourceUnitName.java	(revision 477)
@@ -0,0 +1,7 @@
+package schedframe.resources.units;
+
+public interface ResourceUnitName {
+	
+	public String getName();
+
+}
Index: DCWoRMS/trunk/build/classes/schedframe/resources/units/ResourceUnitState.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/resources/units/ResourceUnitState.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/resources/units/ResourceUnitState.java	(revision 477)
@@ -0,0 +1,7 @@
+package schedframe.resources.units;
+
+public enum ResourceUnitState {
+	FREE,
+	PENDING,
+	BUSY;
+}
Index: DCWoRMS/trunk/build/classes/schedframe/resources/units/GPU.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/resources/units/GPU.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/resources/units/GPU.java	(revision 477)
@@ -0,0 +1,59 @@
+package schedframe.resources.units;
+
+
+
+public class GPU extends AbstractResourceUnit {
+
+	protected int total;
+	protected int used;
+
+	public GPU(GPU m) {
+		super(m);
+		this.total = m.total;
+		this.used = m.used;
+	}
+	
+	public GPU(int total, int used) {
+		super(StandardResourceUnitName.GPU);
+		this.total = total;
+		this.used = used;
+	}
+	
+	public GPU(String resId, int total, int used) {
+		super(StandardResourceUnitName.GPU, resId);
+		this.total = total;
+		this.used = used;
+	}
+
+	public int getFreeAmount() {
+		return this.total - this.used;
+	}
+
+	public int getUsedAmount(){
+		return this.used;
+	}
+	
+	public void setUsedAmount(int amount){
+		if(amount > this.total){
+			throw new IllegalArgumentException(
+					"Used amount can not be grather then total amount.");
+		}
+		this.used = amount;
+	}
+	
+	public int getAmount(){
+		return this.total;
+	}
+
+	@Override
+	public ResourceUnit toDiscrete() throws ClassNotFoundException {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	public int compareTo(ResourceUnit o) {
+		// TODO Auto-generated method stub
+		return 0;
+	}
+
+}
Index: DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/airthroughput/plugin/AirThroughputEstimationPlugin.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/airthroughput/plugin/AirThroughputEstimationPlugin.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/airthroughput/plugin/AirThroughputEstimationPlugin.java	(revision 477)
@@ -0,0 +1,11 @@
+package schedframe.resources.computing.profiles.energy.airthroughput.plugin;
+
+import schedframe.Plugin;
+import schedframe.events.Event;
+import schedframe.resources.computing.ComputingResource;
+import schedframe.scheduling.manager.tasks.JobRegistry;
+
+public interface AirThroughputEstimationPlugin extends Plugin {
+	
+	public double estimateAirThroughPut(Event event, JobRegistry jobRegistry, ComputingResource resource);
+}
Index: DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/airthroughput/plugin/DefaultAirThroughputEstimationPlugin.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/airthroughput/plugin/DefaultAirThroughputEstimationPlugin.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/airthroughput/plugin/DefaultAirThroughputEstimationPlugin.java	(revision 477)
@@ -0,0 +1,35 @@
+package schedframe.resources.computing.profiles.energy.airthroughput.plugin;
+
+import schedframe.Parameters;
+import schedframe.PluginConfiguration;
+import schedframe.events.Event;
+import schedframe.resources.computing.ComputingResource;
+import schedframe.scheduling.manager.tasks.JobRegistry;
+
+public class DefaultAirThroughputEstimationPlugin implements AirThroughputEstimationPlugin {
+
+	@Override
+	public String getName() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public void init(Parameters properties) {
+		// TODO Auto-generated method stub
+
+	}
+
+	@Override
+	public PluginConfiguration getConfiguration() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public double estimateAirThroughPut(Event event, JobRegistry jobRegistry, ComputingResource resource) {
+		// TODO Auto-generated method stub
+		return 0;
+	}
+
+}
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 477)
@@ -0,0 +1,26 @@
+package schedframe.resources.computing.profiles.energy.airthroughput;
+
+import java.util.List;
+
+import schedframe.Parameters;
+import schedframe.resources.computing.profiles.energy.airthroughput.plugin.AirThroughputEstimationPlugin;
+
+public class AirThroughputProfile {
+	
+	AirThroughputEstimationPlugin airThroughputEstimationPlugin;
+	protected List <AirThroughputState> airThroughputStates;
+
+	public AirThroughputProfile(AirThroughputEstimationPlugin airThroughputEstimationPlugin, List<AirThroughputState> airThroughputStates) {
+		super();
+		this.airThroughputEstimationPlugin = airThroughputEstimationPlugin;
+		this.airThroughputStates = airThroughputStates;
+	}
+
+	public List<AirThroughputState> getAirThroughputStates() {
+		return airThroughputStates;
+	}
+	
+	public void init(Parameters parameters){
+		
+	}
+}
Index: DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/airthroughput/AirThroughputState.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/airthroughput/AirThroughputState.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/airthroughput/AirThroughputState.java	(revision 477)
@@ -0,0 +1,31 @@
+package schedframe.resources.computing.profiles.energy.airthroughput;
+
+import schedframe.Parameters;
+
+public class AirThroughputState {
+
+	protected String name;
+	protected double value;
+	protected double powerUsage;
+	
+	public AirThroughputState(String name, double value, double powerUsage) {
+		super();
+		this.name = name;
+		this.value = value;
+		this.powerUsage = powerUsage;
+	}
+	
+	public String getName() {
+		return name;
+	}
+	public double getValue() {
+		return value;
+	}
+	public double getPowerUsage() {
+		return powerUsage;
+	}
+	
+	public void init(Parameters parameters){
+		
+	}
+}
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 477)
@@ -0,0 +1,121 @@
+package schedframe.resources.computing.profiles.energy;
+
+import java.util.Properties;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import schedframe.events.Event;
+import schedframe.resources.computing.ComputingResource;
+import schedframe.resources.computing.extensions.Extension;
+import schedframe.resources.computing.extensions.ExtensionException;
+import schedframe.resources.computing.extensions.ExtensionType;
+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 */{
+
+	private Log log = LogFactory.getLog(EnergyExtension.class);
+
+	protected PowerInterface powerInterface;
+	protected PowerProfile powerProfile;
+
+  	protected ComputingResource computingResource;
+
+	public EnergyExtension(PowerInterface powerInterface, PowerProfile pp) {
+		this.powerInterface = powerInterface;
+		this.powerProfile = pp;
+	}
+
+	@Override
+	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;
+		else if(event.getType().getName().equals(EnergyEventType.FREQUENCY_CHANGED.getName()))
+			return true;
+		else if(event.getType().getName().equals(EnergyEventType.TASK_STARTED.getName()))
+			return true;
+		else if(event.getType().getName().equals(EnergyEventType.TASK_FINISHED.getName()))
+			return true;
+		else return false;
+
+	}
+	
+
+	@Override
+	public void handleEvent(Event event) {
+		EnergyEvent enEvent = (EnergyEvent)event;
+		double power = 0;
+		switch (enEvent.getType()) {
+		
+		case POWER_STATE_CHANGED:
+			power = powerProfile.getEnergyEstimationPlugin().estimatePowerConsumption(enEvent, new JobRegistryImpl(computingResource.getName()), computingResource);
+			/*if(resource instanceof ComputingNode){
+				ComputingNode node = (ComputingNode)resource;
+				if(event.getData() instanceof PowerState){
+					PowerState newState = (PowerState)event.getData();
+					if(newState == PowerState.ON) {
+						addToPowerUsageHistory(power+node.getPowerInterface().START_COST);
+						addToPowerUsageHistory(DateTimeUtils.currentTimeMillis()+node.getPowerInterface().START_TIME, power);
+					}else if(newState == PowerState.OFF){
+						addToPowerUsageHistory(power+node.getPowerInterface().SHUTDOWN_COST);
+						addToPowerUsageHistory(DateTimeUtils.currentTimeMillis()+node.getPowerInterface().SHUTDOWN_TIME, power);
+					}
+				}
+			}
+			else */powerProfile.addToPowerUsageHistory(power);
+			break;
+			
+		case FREQUENCY_CHANGED:
+			power = powerProfile.getEnergyEstimationPlugin().estimatePowerConsumption(enEvent, new JobRegistryImpl(computingResource.getName()), computingResource);
+			powerProfile.addToPowerUsageHistory(power);
+			break;
+			
+		case TASK_STARTED:
+			power = powerProfile.getEnergyEstimationPlugin().estimatePowerConsumption(enEvent, new JobRegistryImpl(computingResource.getName()), computingResource);
+			powerProfile.addToPowerUsageHistory(power);
+			break;
+
+		case TASK_FINISHED:
+			//System.out.println(this.resource.getName() + " - ENERGY EXTENSION: TASK FINISHED");
+			power = powerProfile.getEnergyEstimationPlugin().estimatePowerConsumption(enEvent, new JobRegistryImpl(computingResource.getName()), computingResource);
+			//System.out.println(this.resource.getName() + " - ESTIMATED ENERGY:" + power);
+			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;
+	}
+
+	public ComputingResource getResource() {
+		return computingResource;
+	}
+
+	public void setResource(ComputingResource compRes){
+		this.computingResource = compRes;
+	}
+
+	public PowerInterface getPowerInterface() {
+		return powerInterface;
+	}
+
+	public PowerProfile getPowerProfile() {
+		return powerProfile;
+	}
+
+
+}
Index: DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/EnergyException.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/EnergyException.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/EnergyException.java	(revision 477)
@@ -0,0 +1,22 @@
+package schedframe.resources.computing.profiles.energy;
+
+public class EnergyException extends Exception{
+
+	private static final long serialVersionUID = 1L;
+
+	public EnergyException(){
+		super();
+	}
+
+	public EnergyException(String message){
+		super(message);
+	}
+	
+	public EnergyException(Throwable cause){
+		super(cause);
+	}
+	
+	public EnergyException(String message, Throwable cause){
+		super(message, cause);
+	}
+}
Index: DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/EnergyEvent.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/EnergyEvent.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/EnergyEvent.java	(revision 477)
@@ -0,0 +1,65 @@
+package schedframe.resources.computing.profiles.energy;
+
+import schedframe.events.Event;
+import schedframe.events.EventType;
+import schedframe.events.scheduling.EventReason;
+
+
+public class EnergyEvent implements Event{
+
+	protected EventType type;
+	protected EventReason reason;
+
+	protected String source;
+	protected Object data;
+
+	public EnergyEvent(EventType eventType, String source){
+		this.type = eventType;
+		this.source = source;
+		setReason(EventReason.UNKNOWN);
+	}
+	
+	public EnergyEvent(EventType eventType, Object data){
+		this.type = eventType;
+		this.data = data;
+		setReason(EventReason.UNKNOWN);
+	}
+	
+	public EnergyEvent(EventType eventType, String source, Object data){
+		this.type = eventType;
+		this.source = source;
+		this.data = data;
+		setReason(EventReason.UNKNOWN);
+	}
+	
+	public int getTag() {
+		return type.getTag();
+	}
+
+	public Object getData() {
+		return data;
+	}
+
+	public EnergyEventType getType() {
+		EnergyEventType enEventType; 
+		try{
+			enEventType = (EnergyEventType)type;
+		} catch(Exception e){
+			enEventType = EnergyEventType.POWER_STATE_CHANGED;
+		}
+		return enEventType;
+
+	}
+
+	public String getSource() {
+		return source;
+	}
+
+	public EventReason getReason() {
+		return reason;
+	}
+
+	public void setReason(EventReason reason) {
+		this.reason = reason;
+	}
+}
Index: DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/power/PowerStateName.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/power/PowerStateName.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/power/PowerStateName.java	(revision 477)
@@ -0,0 +1,7 @@
+package schedframe.resources.computing.profiles.energy.power;
+
+public interface PowerStateName {
+	
+	public String getName();
+
+}
Index: DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/power/PState.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/power/PState.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/power/PState.java	(revision 477)
@@ -0,0 +1,54 @@
+package schedframe.resources.computing.profiles.energy.power;
+
+public class PState {
+
+	protected String name;
+	protected double frequency;
+	protected double voltage;
+	protected double powerUsage;
+
+	/*public PState(PStateType name, double frequency, double voltage, double power) {
+		super();
+		this.name = name;
+		this.frequency = frequency;
+		this.voltage = voltage;
+		this.power = power;
+	}*/
+	
+	public String getName() {
+		return name;
+	}
+	public double getFrequency() {
+		return frequency;
+	}
+	public double getVoltage() {
+		return voltage;
+	}
+	public double getPower() {
+		return powerUsage;
+	}
+	
+	public static class Builder {
+	  
+		protected String name;
+		protected double frequency;
+		protected double voltage;
+		protected double powerUsage;
+		
+		public Builder name(String name){this.name = name; return this; }
+        public Builder frequency(double value){this.frequency = value; return this; }
+        public Builder voltage(double value){this.voltage = value; return this; }
+        public Builder powerUsage(double rate){this.powerUsage = rate; return this; }
+        
+        public PState build() {
+            return new PState(this);
+        }
+	}
+	
+	private PState(Builder builder) {
+		this.name = builder.name;
+		this.frequency = builder.frequency;
+		this.voltage = builder.voltage;
+		this.powerUsage = builder.powerUsage;
+	}
+}
Index: DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/power/PowerProfileFactory.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/power/PowerProfileFactory.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/power/PowerProfileFactory.java	(revision 477)
@@ -0,0 +1,50 @@
+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 PowerProfileFactory {
+
+
+
+	//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 throw new IllegalArgumentException("ResourceType " + resource.getType() + " is not supported.");
+
+		/*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/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 477)
@@ -0,0 +1,104 @@
+package schedframe.resources.computing.profiles.energy.power;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.joda.time.DateTimeUtils;
+
+import schedframe.Parameters;
+import schedframe.resources.computing.profiles.energy.power.plugin.EnergyEstimationPlugin;
+
+public class PowerProfile {
+
+	protected List<PowerUsage> powerUsage;
+	protected EnergyEstimationPlugin energyEstimationPlugin;
+
+	protected List<schedframe.resources.computing.profiles.energy.power.PowerState> supportedPowerStates;
+	protected Map<String, PState> supportedPStates;
+	
+
+	public PowerProfile(EnergyEstimationPlugin energyEstimationPlugin, List<schedframe.resources.computing.profiles.energy.power.PowerState> supportedPowerStates) {
+		this.energyEstimationPlugin = energyEstimationPlugin;
+		this.powerUsage = new ArrayList<PowerUsage>();
+		this.supportedPowerStates = supportedPowerStates;
+	}
+	
+	public PowerProfile(EnergyEstimationPlugin energyEstimationPlugin, List<schedframe.resources.computing.profiles.energy.power.PowerState> supportedPowerStates,  List<schedframe.resources.computing.profiles.energy.power.PState> pStates) {
+		this.energyEstimationPlugin = energyEstimationPlugin;
+		this.supportedPowerStates = supportedPowerStates;
+		this.powerUsage = new ArrayList<PowerUsage>();
+		if(pStates.size() > 0)
+			this.supportedPStates = new HashMap<String, PState>();
+		for(PState pState: pStates){
+			supportedPStates.put(pState.getName(), pState);
+		}
+	}
+	
+	/*public void initPlugin(String energyEstimationPluginClassName){
+		if(energyEstimationPluginClassName != null) {
+			energyEstimationPlugin = (EnergyEstimationPluginInterface) InstanceFactory.createInstance(
+					energyEstimationPluginClassName, EnergyEstimationPluginInterface.class);
+			if(energyEstimationPlugin == null){
+				energyEstimationPlugin = new DefaultEnergyEstimationPlugin();
+				log.info("Using default energy estimation plugin: " + DefaultEnergyEstimationPlugin.class.getName());
+				
+			} else {
+				energyEstimationPlugin.init(null);
+			}		
+		} else {
+			energyEstimationPlugin = new DefaultEnergyEstimationPlugin();
+			log.info("Using default energy estimation plugin: " + DefaultEnergyEstimationPlugin.class.getName());
+		}
+	}*/
+	
+	public EnergyEstimationPlugin getEnergyEstimationPlugin() {
+		return energyEstimationPlugin;
+	}
+	
+	public List<schedframe.resources.computing.profiles.energy.power.PowerState> getSupportedPowerStates() throws NoSuchFieldException{
+		if(supportedPowerStates == null)
+			throw new NoSuchFieldException("Supported power states are not defined.");
+		return supportedPowerStates;
+	}
+	
+	public Map<String, PState> getSupportedPStates() throws NoSuchFieldException {
+		if(supportedPStates == null)
+			throw new NoSuchFieldException("Supported p-states are not defined.");
+		return supportedPStates;
+	}
+	
+	public void addToPowerUsageHistory(double power) {
+
+		if (powerUsage.size() == 0) {
+			PowerUsage usage = new PowerUsage(DateTimeUtils.currentTimeMillis(), power);
+			powerUsage.add(usage);
+			return;
+		}
+
+		int lastIdx = powerUsage.size() - 1;
+		double lastPower = powerUsage.get(lastIdx).getValue();
+		if (lastPower != power) {
+			PowerUsage usage = powerUsage.get(lastIdx);
+			long currentTime = DateTimeUtils.currentTimeMillis();
+			if (usage.getTimestamp() == currentTime) {
+				usage.setValue(power);
+				if(lastIdx > 0 && powerUsage.get(lastIdx - 1).getValue() == power)
+					powerUsage.remove(usage);
+			} else {
+				usage = new PowerUsage(DateTimeUtils.currentTimeMillis(), power);
+				powerUsage.add(usage);
+			}
+		}
+	}
+
+	public List<PowerUsage> getPowerUsageHistory() {
+		return powerUsage;
+	}
+
+	public void init(Parameters 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 477)
@@ -0,0 +1,16 @@
+package schedframe.resources.computing.profiles.energy.power.plugin;
+
+import schedframe.Plugin;
+import schedframe.resources.computing.ComputingResource;
+import schedframe.resources.computing.profiles.energy.EnergyEvent;
+import schedframe.scheduling.manager.tasks.JobRegistry;
+
+public interface EnergyEstimationPlugin extends Plugin {
+	
+	public double estimatePowerConsumption(EnergyEvent event, JobRegistry jobRegistry, ComputingResource resource);
+
+	public double estimateEnergyDissipation(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/StandardPowerStateName.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/power/StandardPowerStateName.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/power/StandardPowerStateName.java	(revision 477)
@@ -0,0 +1,16 @@
+package schedframe.resources.computing.profiles.energy.power;
+
+
+public enum StandardPowerStateName implements PowerStateName{
+
+	ON,
+	OFF,
+	SLEEP,
+	SUSPEND,
+	HIBERNATE;
+
+	public String getName() {
+		return toString();
+	}
+	
+}
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 477)
@@ -0,0 +1,25 @@
+package schedframe.resources.computing.profiles.energy.power;
+
+public class PowerUsage {
+
+	protected long timestamp;
+	protected double value;
+
+	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;
+	}
+	
+}
Index: DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/power/CPUPowerProfile.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/power/CPUPowerProfile.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/power/CPUPowerProfile.java	(revision 477)
@@ -0,0 +1,24 @@
+package schedframe.resources.computing.profiles.energy.power;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import schedframe.resources.computing.profiles.energy.power.plugin.EnergyEstimationPlugin;
+
+public class CPUPowerProfile extends PowerProfile{
+
+	protected Map<String, PState> supportedPStates;
+
+	public CPUPowerProfile(EnergyEstimationPlugin energyEstimationPlugin, List<schedframe.resources.computing.profiles.energy.power.PowerState> supportedPowerStates, List<schedframe.resources.computing.profiles.energy.power.PState> pStates){
+		super(energyEstimationPlugin, supportedPowerStates);
+		supportedPStates = new HashMap<String, PState>();
+		for(PState pState: pStates){
+			supportedPStates.put(pState.getName(), pState);
+		}
+	}
+
+	public Map<String, PState> getSupportedPStates() {
+		return supportedPStates;
+	}
+}
Index: DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/power/PowerStateNameFactory.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/power/PowerStateNameFactory.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/power/PowerStateNameFactory.java	(revision 477)
@@ -0,0 +1,25 @@
+package schedframe.resources.computing.profiles.energy.power;
+
+
+public class PowerStateNameFactory {
+	
+	public static PowerStateName createPowerStateName (String powerStateName){
+		
+		if(powerStateName.equals(StandardPowerStateName.ON.getName()))
+			return StandardPowerStateName.ON;
+		
+		else if(powerStateName.equals(StandardPowerStateName.OFF.getName()))
+			return StandardPowerStateName.OFF;
+		
+		else if(powerStateName.equals(StandardPowerStateName.HIBERNATE.getName()))
+			return StandardPowerStateName.HIBERNATE;
+		
+		else if(powerStateName.equals(StandardPowerStateName.SLEEP.getName()))
+			return StandardPowerStateName.SLEEP;
+		
+		else if(powerStateName.equals(StandardPowerStateName.SUSPEND.getName()))
+			return StandardPowerStateName.SUSPEND;
+		
+		else return new UserPowerStateName(powerStateName);
+	}
+}
Index: DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/power/Transition.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/power/Transition.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/power/Transition.java	(revision 477)
@@ -0,0 +1,29 @@
+package schedframe.resources.computing.profiles.energy.power;
+
+import schedframe.Parameters;
+
+public class Transition {
+	protected PowerStateName to;
+	protected double powerUsage;
+	protected double time;
+	
+	public Transition(PowerStateName to, double powerUsage, double time) {
+		super();
+		this.to = to;
+		this.powerUsage = powerUsage;
+		this.time = time;
+	}
+	public PowerStateName getTo() {
+		return to;
+	}
+	public double getPowerUsage() {
+		return powerUsage;
+	}
+	public double getTime() {
+		return time;
+	}
+	
+	public void init(Parameters parameters){
+		
+	}
+}
Index: DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/power/ui/AbstractPowerInterface.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/power/ui/AbstractPowerInterface.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/power/ui/AbstractPowerInterface.java	(revision 477)
@@ -0,0 +1,113 @@
+package schedframe.resources.computing.profiles.energy.power.ui;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.joda.time.DateTimeUtils;
+
+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 abstract class AbstractPowerInterface implements PowerInterface{
+
+	protected PowerStateName currentPowerState;
+	protected PowerProfile powerProfile;
+	protected ComputingResource resource;
+	
+	public AbstractPowerInterface(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))
+					child.getPowerInterface().setPowerState(state);
+			}
+
+			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(schedframe.resources.computing.profiles.energy.power.PowerState powerState: powerProfile.getSupportedPowerStates()){
+			powerStates.add(powerState);
+		}
+		return powerStates;
+	}
+
+	public boolean supportPowerState(PowerStateName state) {
+		try {
+			for(schedframe.resources.computing.profiles.energy.power.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(schedframe.resources.computing.profiles.energy.power.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();
+	}
+	
+}
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 477)
@@ -0,0 +1,35 @@
+package schedframe.resources.computing.profiles.energy.power.ui;
+
+import schedframe.resources.computing.ComputingResource;
+import schedframe.resources.computing.DataCenter;
+import schedframe.resources.computing.profiles.energy.power.PowerProfile;
+import schedframe.resources.computing.profiles.energy.power.PowerStateName;
+import schedframe.resources.computing.profiles.energy.power.StandardPowerStateName;
+
+public class DataCenterPowerInterface extends AbstractPowerInterface{
+
+
+
+	
+	public DataCenterPowerInterface(ComputingResource resource, PowerProfile pp){
+		super(resource, pp);
+		currentPowerState = StandardPowerStateName.ON;
+	}
+
+	public boolean setPowerState(PowerStateName state) {
+		if(!supportPowerState(state))
+			return false;
+		currentPowerState = state;
+		DataCenter dataCenter = (DataCenter)resource;
+
+		for(ComputingResource child: dataCenter.getChildren()){
+			child.getPowerInterface().setPowerState(state);
+		}
+
+		return true;
+	}
+
+
+
+
+}
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 477)
@@ -0,0 +1,86 @@
+package schedframe.resources.computing.profiles.energy.power.ui;
+
+import schedframe.resources.ResourceStatus;
+import schedframe.resources.computing.ComputingNode;
+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.PowerStateName;
+import schedframe.resources.computing.profiles.energy.power.StandardPowerStateName;
+
+public class ComputingNodePowerInterface extends AbstractPowerInterface{
+
+	public static long START_TIME = 600000;
+	public static long SHUTDOWN_TIME = 300000;
+	public static double START_COST = 4000;
+	public static double SHUTDOWN_COST = 2000;
+
+	
+	public ComputingNodePowerInterface(ComputingResource resource, PowerProfile pp){
+		super(resource, pp);
+		currentPowerState = StandardPowerStateName.ON;
+	}
+
+	public boolean setPowerState(PowerStateName state){
+		if(!supportPowerState(state))
+			return false;
+		currentPowerState = state;
+		ComputingNode computingNode = (ComputingNode) resource;
+		if(computingNode.getProcessors() != null)
+		{
+			for(ComputingResource child:computingNode.getProcessors()){
+				child.getPowerInterface().setPowerState(state);
+			}
+		} else {
+			computingNode.handleEvent(new EnergyEvent(EnergyEventType.POWER_STATE_CHANGED, computingNode.getName()));
+		}
+		
+		if(state == StandardPowerStateName.OFF){
+			computingNode.setStatus(ResourceStatus.UNAVAILABLE);
+		}
+		else if(state == StandardPowerStateName.ON){
+			computingNode.setStatus(ResourceStatus.FREE);
+		}
+		//computingNode.handleEvent(new EnergyEvent(EnergyEventType.POWER_STATE_CHANGED, computingNode.getName()));
+		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(){
+		setPowerState(StandardPowerStateName.ON);
+	}
+	
+	public void turnOff(){
+		setPowerState(StandardPowerStateName.OFF);
+	}
+
+
+
+}
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 477)
@@ -0,0 +1,27 @@
+package schedframe.resources.computing.profiles.energy.power.ui;
+
+import java.util.List;
+
+import schedframe.resources.computing.profiles.energy.power.PowerState;
+import schedframe.resources.computing.profiles.energy.power.PowerStateName;
+import schedframe.resources.computing.profiles.energy.power.PowerUsage;
+
+public interface PowerInterface {
+
+	public PowerStateName getPowerState();
+	
+	public boolean setPowerState(PowerStateName powerState);
+	
+	public boolean supportPowerState(PowerStateName powerState);
+	
+	public List<PowerState> getSupportedPowerStates() throws NoSuchFieldException;
+	
+	public double getPowerConsumption(PowerStateName state) throws NoSuchFieldException;
+	
+	public PowerUsage getRecentPowerUsage();
+	
+	//public double getCurrentPowerConsumption();
+	
+	List<PowerUsage> getPowerUsageHistory();
+	
+}
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 477)
@@ -0,0 +1,126 @@
+package schedframe.resources.computing.profiles.energy.power.ui;
+
+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;
+import schedframe.resources.computing.profiles.energy.power.PState;
+import schedframe.resources.computing.profiles.energy.power.PowerProfile;
+import schedframe.resources.computing.profiles.energy.power.PowerStateName;
+import schedframe.resources.computing.profiles.energy.power.StandardPowerStateName;
+import schedframe.resources.units.CpuSpeed;
+import schedframe.resources.units.StandardResourceUnitName;
+
+public class ProcessorPowerInterface extends AbstractPowerInterface {
+
+	protected PState currentPState;
+
+
+	public ProcessorPowerInterface(ComputingResource resource, PowerProfile pp){
+		super(resource, pp);
+		currentPowerState = StandardPowerStateName.ON;
+		try {
+			currentPState = getSupportedPStates().get("P0");
+		} catch (NoSuchFieldException e) {
+			currentPState = null;
+		}
+	}
+	
+	public boolean setPowerState(PowerStateName powerState){
+		if(!supportPowerState(powerState))
+			return false;
+		if(powerState != currentPowerState){
+			currentPowerState = powerState;
+			//Processor cpu = (Processor) resource;
+			if(powerState == StandardPowerStateName.OFF){
+				resource.setStatus(ResourceStatus.UNAVAILABLE);
+			} else if(powerState == StandardPowerStateName.ON){
+				resource.setStatus(ResourceStatus.FREE);
+			}
+			resource.handleEvent(new EnergyEvent(EnergyEventType.POWER_STATE_CHANGED, resource.getName()));
+			//cpu.handleEvent(new EnergyEvent(EnergyEventType.POWER_STATE_CHANGED, cpu.getName()));			
+		}
+
+		return true;
+	}
+
+	public PState getPState(){
+		return currentPState;
+	}
+	
+	public Map<String, PState> getSupportedPStates() throws NoSuchFieldException {
+		return powerProfile.getSupportedPStates();
+	}
+	
+	public boolean supportPState(PState pState) {
+		try {
+			for(String pStateName: getSupportedPStates().keySet()){
+				if(pState.getName().equals(pStateName)){
+					return true;
+				}
+			}
+		} catch (NoSuchFieldException e) {
+			return false;
+		}
+		return false;
+	}
+	
+	public boolean setPState(String pStateName){
+		PState newPState;
+		try {
+			newPState = getSupportedPStates().get(pStateName);
+		} catch (NoSuchFieldException e) {
+			return false;
+		}
+
+		if(newPState != currentPState){
+			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());
+			//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());
+			return true;
+		}
+
+		return false;
+	}
+	
+	public double getFrequency() {
+		return currentPState.getFrequency();
+	}
+
+	public boolean setFrequency(double freq) {
+		try {
+			for(String pStateName: getSupportedPStates().keySet()){
+				if(getSupportedPStates().get(pStateName).getFrequency() == freq){
+					setPState(pStateName);
+					return true;
+				}
+			}
+		} catch (NoSuchFieldException e) {
+			return false;
+		}
+		return false;
+	}
+
+	public double getPowerConsumption(PState state) throws NoSuchFieldException{
+		double powerConsumption = 0;
+		if(supportPState(state)){
+			for(String pStateName: getSupportedPStates().keySet()){
+				if(pStateName.equals(state.getName())){
+					powerConsumption = getSupportedPStates().get(pStateName).getPower();
+					break;
+				}
+			}
+		}
+		return powerConsumption;
+	}
+
+}
+
Index: DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/power/UserPowerStateName.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/power/UserPowerStateName.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/power/UserPowerStateName.java	(revision 477)
@@ -0,0 +1,16 @@
+package schedframe.resources.computing.profiles.energy.power;
+
+public class UserPowerStateName implements PowerStateName {
+
+	protected String name;
+
+	public UserPowerStateName(String name) {
+		this.name = name;
+	}
+
+	public String getName() {
+		return name;
+	}
+
+
+}
Index: DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/power/PowerState.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/power/PowerState.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/resources/computing/profiles/energy/power/PowerState.java	(revision 477)
@@ -0,0 +1,33 @@
+package schedframe.resources.computing.profiles.energy.power;
+
+import java.util.List;
+
+import schedframe.Parameters;
+
+public class PowerState {
+	
+	protected PowerStateName name;
+	protected double powerUsage;
+	protected List<Transition> transitions;
+	
+	public PowerState(PowerStateName name, double powerUsage, List<Transition> transitions) {
+		super();
+		this.name = name;
+		this.powerUsage = powerUsage;
+		this.transitions = transitions;
+	}
+	public PowerStateName getName() {
+		return name;
+	}
+	public double getPowerUsage() {
+		return powerUsage;
+	}
+	public List<Transition> getTransitions() {
+		return transitions;
+	}
+	
+	public void init(Parameters parameters){
+		
+	}
+	
+}
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 477)
@@ -0,0 +1,33 @@
+package schedframe.resources.computing.profiles.energy;
+
+import schedframe.events.EventType;
+
+public enum EnergyEventType implements EventType {
+	
+	TASK_FINISHED(1),
+	TASK_FAILED(2),
+	TASK_CANCELED(4),
+	TASK_STARTED(8),
+
+	TIMER(16),
+
+	POWER_STATE_CHANGED(32),
+	FREQUENCY_CHANGED(64),
+	VOLTAGE_CHANGED(128),
+	RESOURCE_FAILED(256)
+	;
+
+	protected int tag;
+	
+	public int getTag() {
+		return tag;
+	}
+
+	private EnergyEventType(int tag){
+		this.tag = tag;
+	}
+	
+	public String getName(){
+		return toString();
+	}
+}
Index: DCWoRMS/trunk/build/classes/schedframe/resources/computing/description/ExecutingResourceDescription.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/resources/computing/description/ExecutingResourceDescription.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/resources/computing/description/ExecutingResourceDescription.java	(revision 477)
@@ -0,0 +1,74 @@
+package schedframe.resources.computing.description;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import schedframe.Parameters;
+import schedframe.resources.ResourceType;
+import schedframe.resources.units.ResourceUnit;
+import schedframe.resources.units.ResourceUnitName;
+
+public class ExecutingResourceDescription extends AbstractResourceDescription {
+
+	protected Map<ResourceUnitName, List<ResourceUnit>> resUnits;
+	protected Parameters parameters;
+	
+	public ExecutingResourceDescription(ResourceType type) {
+		super(type);
+	}
+
+	public Parameters getParameters() {
+		return parameters;
+	}
+	
+	public String getCompResourceParameterValue(String name){
+		return getParameters().get(name).get(0).getContent();
+	}
+	
+	public void addResourceUnit(ResourceUnit unit) {
+		if (this.resUnits == null)
+			this.resUnits = new HashMap<ResourceUnitName, List<ResourceUnit>>(1);
+		List<ResourceUnit> list = null;
+		if (this.resUnits.containsKey(unit.getName())) {
+			list = this.resUnits.get(unit.getName());
+		} else {
+			list = new ArrayList<ResourceUnit>(1);
+			this.resUnits.put(unit.getName(), list);
+		}
+		list.add(unit);
+	}
+	
+	public ResourceUnit getResourceUnit(ResourceUnitName unitName) throws NoSuchFieldException {
+		return getResourceUnitList(unitName).get(0);
+	}
+
+	public List<ResourceUnit> getResourceUnitList(ResourceUnitName unitName) throws NoSuchFieldException {
+		if (resUnits.containsKey(unitName))
+			return resUnits.get(unitName);
+		else
+			throw new NoSuchFieldException("Resource unit " + unitName + " is not available in resource " + this.id);
+	}
+
+	public Collection<ResourceUnit> getResourceUnit() {
+		if (resUnits == null)
+			return null;
+		List<ResourceUnit> values = new ArrayList<ResourceUnit>();
+		Collection<List<ResourceUnit>> lists = resUnits.values();
+		Iterator<List<ResourceUnit>> itr = lists.iterator();
+
+		while (itr.hasNext()) {
+			List<ResourceUnit> list = itr.next();
+			values.addAll(list);
+		}
+
+		return values;
+	}
+
+	public Map<ResourceUnitName, List<ResourceUnit>> getResourceUnits() {
+		return resUnits;
+	}
+}
Index: DCWoRMS/trunk/build/classes/schedframe/resources/computing/description/AbstractResourceDescription.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/resources/computing/description/AbstractResourceDescription.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/resources/computing/description/AbstractResourceDescription.java	(revision 477)
@@ -0,0 +1,59 @@
+package schedframe.resources.computing.description;
+
+
+import java.util.ArrayList;
+import java.util.List;
+
+import schedframe.resources.ResourceType;
+
+
+public abstract class AbstractResourceDescription {
+
+	protected String id;
+	protected ResourceType type;
+	protected List<AbstractResourceDescription> children;
+	
+	public AbstractResourceDescription(ResourceType type){
+		this.type = type;
+		this.children = null;
+	}
+
+	public List<AbstractResourceDescription> getChildren() {
+		return children;
+	}
+	
+	public void setChildren(List<AbstractResourceDescription> children) {
+		this.children = children;
+	}
+	
+	public void addChildren(AbstractResourceDescription child) {
+		//child.setParent(this);
+		if(children == null)
+			children = new ArrayList<AbstractResourceDescription> (1);
+		this.children.add(child);
+	}
+
+	public String getId(){
+		return this.id;
+	}
+
+	public ResourceType getType() {
+		return type;
+	}
+	
+	/*protected AbstractResourceDescription parent;
+	/public AbstractResourceDescription getParent() {
+		return parent;
+	}
+
+	public void setParent(AbstractResourceDescription parent) {
+		this.parent = parent;
+	}*/
+	
+	/*public enum ResourceType {
+		COMPUTING_RESOURCE,
+		QUEUING_SYSTEM;
+	}
+	*/
+	
+}
Index: DCWoRMS/trunk/build/classes/schedframe/resources/computing/description/ComputingResourceDescription.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/resources/computing/description/ComputingResourceDescription.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/resources/computing/description/ComputingResourceDescription.java	(revision 477)
@@ -0,0 +1,267 @@
+package schedframe.resources.computing.description;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import schedframe.Parameter;
+import schedframe.Parameters;
+import schedframe.Property;
+import schedframe.resources.ResourceTypeFactory;
+import schedframe.resources.computing.location.Location;
+import schedframe.resources.computing.profiles.energy.airthroughput.AirThroughputProfile;
+import schedframe.resources.computing.profiles.energy.airthroughput.AirThroughputState;
+import schedframe.resources.computing.profiles.energy.airthroughput.plugin.AirThroughputEstimationPlugin;
+import schedframe.resources.computing.profiles.energy.airthroughput.plugin.DefaultAirThroughputEstimationPlugin;
+import schedframe.resources.computing.profiles.energy.power.PState;
+import schedframe.resources.computing.profiles.energy.power.PowerProfile;
+import schedframe.resources.computing.profiles.energy.power.PowerState;
+import schedframe.resources.computing.profiles.energy.power.PowerStateNameFactory;
+import schedframe.resources.computing.profiles.energy.power.Transition;
+import schedframe.resources.computing.profiles.energy.power.plugin.EnergyEstimationPlugin;
+import schedframe.resources.units.ResourceUnit;
+import schedframe.resources.units.ResourceUnitFactory;
+import schedframe.resources.utils.ResourceIdGenerator;
+import schemas.ComputingResource;
+import schemas.Profile;
+import simulator.utils.InstanceFactory;
+import example.energy.DefaultEnergyEstimationPlugin;
+
+public class ComputingResourceDescription extends ExecutingResourceDescription {
+
+	//protected Map<ResourceUnitName, List<AbstractResourceUnit>> resUnits;
+	protected PowerProfile powerProfile;
+	protected AirThroughputProfile airThroughputProfile;
+	protected Location location;
+	//protected Parameters parameters;
+
+	public ComputingResourceDescription(ComputingResource computingResource) {
+
+		super(ResourceTypeFactory.createResourceType(computingResource.getClazz()));
+
+		initId(computingResource);
+
+		if (computingResource.getComputingResourceTypeChoiceSequence() != null) {
+			initResourceUnits(computingResource.getComputingResourceTypeChoiceSequence().getResourceUnit());
+			initProfiles(computingResource.getComputingResourceTypeChoiceSequence().getProfile());
+			initLocation(computingResource.getComputingResourceTypeChoiceSequence().getLocation());
+			this.parameters = extractParameters(computingResource.getComputingResourceTypeChoiceSequence().getParameter());
+		}
+	}
+
+	private void initId(ComputingResource computingResource){
+		this.id = computingResource.getName() != null ? computingResource.getName() : type.toString();
+		if(computingResource.getCount() > 1 || computingResource.getName() == null){
+			this.id = id + "_" + String.valueOf(ResourceIdGenerator.getId(type));
+		}
+	}
+	
+	private void initResourceUnits(schemas.ResourceUnit[] resourceUnitCharacteristics) {
+		for (int i = 0; i < resourceUnitCharacteristics.length; i++) {
+			schemas.ResourceUnit resourceUnitCharacteristic = resourceUnitCharacteristics[i];
+			ResourceUnit resourceUnit = ResourceUnitFactory.createUnit(resourceUnitCharacteristic.getClazz(), this.id,
+					 Double.valueOf(resourceUnitCharacteristic.getAmount().getContent()).intValue(), 0);
+			Parameters params = extractParameters(resourceUnitCharacteristic.getParameter());
+			resourceUnit.init(params);
+			addResourceUnit(resourceUnit);
+		}
+	}
+
+	private void initProfiles(Profile profile) {
+		if (profile != null) {
+			initPowerProfile(profile.getPowerProfile());
+			initAirThroughputProfile(profile.getAirThroughputProfile());
+		}
+	}
+	
+	private void initPowerProfile(schemas.PowerProfile powerProfileCharacteristic) {
+		
+		if (powerProfileCharacteristic != null) {
+			EnergyEstimationPlugin energyEstimationPlugin = null;
+			List<PowerState> powerStates = null;
+			List<PState> pStates = null;
+			if(powerProfileCharacteristic.getEnergyEstimationPlugin() != null){
+				String  energyEstimationPluginName = powerProfileCharacteristic.getEnergyEstimationPlugin().getName();
+				if(energyEstimationPluginName != null) {
+					energyEstimationPlugin = (EnergyEstimationPlugin) InstanceFactory.createInstance(
+							energyEstimationPluginName, EnergyEstimationPlugin.class);			
+				} else {
+					energyEstimationPlugin = new DefaultEnergyEstimationPlugin();
+				}
+				Parameters params = extractParameters(powerProfileCharacteristic.getEnergyEstimationPlugin().getParameter());
+				energyEstimationPlugin.init(params);
+			}
+			
+			if (powerProfileCharacteristic.getPowerStates() != null) {
+				powerStates = new ArrayList<PowerState>();
+				int powerStateCount = powerProfileCharacteristic.getPowerStates().getPowerStateCount();
+				for (int i = 0; i < powerStateCount ; i++) {
+					schemas.PowerState ps = powerProfileCharacteristic.getPowerStates().getPowerState(i);
+					List<Transition> transitions = new ArrayList<Transition>();
+					int transitionCount = ps.getTransitionCount();
+					for (int j = 0; j < transitionCount; j++) {
+						schemas.Transition t = ps.getTransition(j);
+						Transition transition = new Transition(PowerStateNameFactory.createPowerStateName(t.getTo()), t
+								.getPowerUsage().getContent(), t.getTime().getContent());
+						Parameters params = extractParameters(t.getParameter());
+						transition.init(params);
+						transitions.add(transition);
+					}
+					PowerState powerState = new PowerState(PowerStateNameFactory.createPowerStateName(ps.getName()), ps
+							.getPowerUsage().getContent(), transitions);
+					Parameters params = extractParameters(ps.getParameter());
+					powerState.init(params);
+					powerStates.add(powerState);
+				}
+			}
+			
+			if(powerProfileCharacteristic.getParameter() != null){
+				pStates = new ArrayList<PState>();
+				int parameterCount =  powerProfileCharacteristic.getParameterCount();
+				for(int i = 0; i < parameterCount; i++){
+					schemas.Parameter parameter = powerProfileCharacteristic.getParameter(i);
+					if(parameter.getName().equals("pState")){
+						PState.Builder builder =  new PState.Builder();
+						int propertyCount = parameter.getParameterTypeSequence().getPropertyCount();
+						for(int j = 0; j < propertyCount; j++){
+							schemas.Property property = parameter.getParameterTypeSequence().getProperty(j);
+							if(property.getName().equals("name")){
+								 builder = builder.name(property.getStringValueWithUnit(0).getContent());
+							} else if (property.getName().equals("frequency")){
+								 builder = builder.frequency(Double.valueOf(property.getStringValueWithUnit(0).getContent()));
+							} else if (property.getName().equals("voltage")){
+								builder = builder.voltage(Double.valueOf(property.getStringValueWithUnit(0).getContent()));
+							} else if (property.getName().equals("powerUsage")){
+								builder = builder.powerUsage(Double.valueOf(property.getStringValueWithUnit(0).getContent()));
+							}
+						}
+						PState pState = builder.build();
+						pStates.add(pState);
+					}
+				}	
+			}
+			this.powerProfile = new PowerProfile(energyEstimationPlugin, powerStates, pStates);
+			Parameters params = extractParameters(powerProfileCharacteristic.getParameter());
+			this.powerProfile.init(params);
+		}
+	}
+
+	private void initAirThroughputProfile(schemas.AirThroughputProfile airThroughputProfile) {
+		if (airThroughputProfile != null) {
+			
+			AirThroughputEstimationPlugin airThroughputEstimationPlugin = null;
+			List<AirThroughputState> airThroughputStates = null;
+			if(airThroughputProfile.getAirThroughputEstimationPlugin() != null){
+				String airThroughputEstimationPluginName = airThroughputProfile.getAirThroughputEstimationPlugin().getName();
+				if(airThroughputEstimationPluginName != null) {
+					airThroughputEstimationPlugin = (AirThroughputEstimationPlugin) InstanceFactory.createInstance(
+							airThroughputEstimationPluginName, AirThroughputEstimationPlugin.class);			
+				} else {
+					airThroughputEstimationPlugin = new DefaultAirThroughputEstimationPlugin();
+				}
+				Parameters params = extractParameters(airThroughputProfile.getAirThroughputEstimationPlugin().getParameter());
+				airThroughputEstimationPlugin.init(params);
+			}
+			if(airThroughputProfile.getAirThroughputStates() != null){
+				airThroughputStates = new ArrayList<AirThroughputState>();
+				int airThrouhputStateCount =  airThroughputProfile.getAirThroughputStates().getAirThroughputStateCount();
+				for (int i = 0; i < airThrouhputStateCount; i++) {
+					schemas.AirThroughputState ats = airThroughputProfile.getAirThroughputStates().getAirThroughputState(i);
+					AirThroughputState airThroughputState = new AirThroughputState(ats.getName(), ats.getValue()
+							.getContent(), ats.getPowerUsage().getContent());
+					Parameters params = extractParameters(ats.getParameter());
+					airThroughputState.init(params);
+					airThroughputStates.add(airThroughputState);
+				}
+			}
+			this.airThroughputProfile = new AirThroughputProfile(airThroughputEstimationPlugin, airThroughputStates);
+			Parameters params = extractParameters(airThroughputProfile.getParameter());
+			this.airThroughputProfile.init(params);
+		}
+	}
+	
+	private void initLocation(schemas.Location l) {
+		if (location != null) {
+			this.location = new Location(l.getHorizontal(), l.getVertical(), l.getDepth());
+			Parameters params = extractParameters(l.getParameter());
+			this.location.init(params);
+		}
+	}
+
+
+
+	/*private Properties initProperties(schemas.Parameter[] parameters){
+		Properties prop = new Properties();
+		
+		for(int i = 0; i < parameters.length; i++){
+			schemas.Parameter parameter = parameters[i];
+			List values = new ArrayList();
+			if(parameter.getParameterTypeSequence().getProperty() != null)
+			{
+				Map<String, List<StringValueWithUnit>> properties = new HashMap<String, List<StringValueWithUnit>>();
+				List<StringValueWithUnit> propValues = new ArrayList<StringValueWithUnit>();
+				for(int j = 0; j < parameter.getParameterTypeSequence().getPropertyCount(); j++){
+					schemas.Property property = parameter.getParameterTypeSequence().getProperty(j);
+					for(int k = 0; k < property.getStringValueWithUnitCount(); k++){
+						propValues.add(property.getStringValueWithUnit(k));
+					}
+					properties.put(property.getName(), propValues);
+				}
+				values.add(properties);
+			}else {
+				for(int j = 0; j < parameter.getStringValueWithUnitCount(); j++){
+					values.add(parameter.getStringValueWithUnit(j));
+				}
+			}
+			prop.put(parameter.getName(), values);
+		}
+		return prop;
+	}*/
+	
+	private Parameters extractParameters(schemas.Parameter[] parameters){
+		
+		Parameters params = null;
+		
+		if(parameters.length != 0)
+			params = new Parameters();
+		
+		for(int i = 0; i < parameters.length; i++){
+			schemas.Parameter parameter = parameters[i];
+			Parameter param = new Parameter(parameter.getName());
+			if(parameter.getParameterTypeSequence() != null && parameter.getParameterTypeSequence().getProperty() != null)
+			{							
+				int propertyCount = parameter.getParameterTypeSequence().getPropertyCount();
+				for(int j = 0; j < propertyCount; j++){
+					schemas.Property property = parameter.getParameterTypeSequence().getProperty(j);
+					Property prop = new Property(property.getName());
+					int stringValueWithUnitCount = property.getStringValueWithUnitCount();
+					for(int k = 0; k < stringValueWithUnitCount; k++){
+						prop.add(property.getStringValueWithUnit(k));
+					}
+					param.addProperty(prop);
+				}
+			} else {
+				int stringValueWithUnitCount =  parameter.getStringValueWithUnitCount();
+				for(int j = 0; j < stringValueWithUnitCount; j++){
+					param.add(parameter.getStringValueWithUnit(j));
+				}
+			}
+			params.put(parameter.getName(), param);
+		}
+		return params;
+	}
+
+	public PowerProfile getPowerProfile() {
+		return powerProfile;
+	}
+
+	public AirThroughputProfile getAirThroughputProfile() {
+		return airThroughputProfile;
+	}
+
+	public Location getLocation() {
+		return location;
+	}
+
+
+
+}
Index: DCWoRMS/trunk/build/classes/schedframe/resources/computing/validator/ResourceTypeValidator.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/resources/computing/validator/ResourceTypeValidator.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/resources/computing/validator/ResourceTypeValidator.java	(revision 477)
@@ -0,0 +1,19 @@
+package schedframe.resources.computing.validator;
+
+import schedframe.resources.ResourceType;
+import schedframe.resources.computing.ComputingResource;
+
+public class ResourceTypeValidator implements ResourceValidator {
+
+	private ResourceType type;
+	public ResourceTypeValidator(ResourceType type) {
+		super();
+		this.type = type;
+	}	
+
+	@Override
+	public boolean validate(ComputingResource resource) {
+		return resource.getType().getName().equals(type.getName());
+	}
+
+}
Index: DCWoRMS/trunk/build/classes/schedframe/resources/computing/validator/ResourceStatusValidator.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/resources/computing/validator/ResourceStatusValidator.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/resources/computing/validator/ResourceStatusValidator.java	(revision 477)
@@ -0,0 +1,20 @@
+package schedframe.resources.computing.validator;
+
+import schedframe.resources.ResourceStatus;
+import schedframe.resources.computing.ComputingResource;
+
+public class ResourceStatusValidator implements ResourceValidator{
+	
+	private ResourceStatus status;
+	
+	public ResourceStatusValidator(ResourceStatus status) {
+		super();
+		this.status = status;
+	}	
+
+	@Override
+	public boolean validate(ComputingResource resource) {
+		return resource.getStatus() == status;
+	}
+
+}
Index: DCWoRMS/trunk/build/classes/schedframe/resources/computing/validator/ResourcePropertiesValidator.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/resources/computing/validator/ResourcePropertiesValidator.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/resources/computing/validator/ResourcePropertiesValidator.java	(revision 477)
@@ -0,0 +1,26 @@
+package schedframe.resources.computing.validator;
+
+import java.util.Properties;
+
+import schedframe.resources.computing.ComputingResource;
+
+public class ResourcePropertiesValidator implements ResourceValidator{
+
+	private Properties properties;
+	public ResourcePropertiesValidator(Properties properties) {
+		super();
+		this.properties = properties;
+	}	
+
+	@Override
+	public boolean validate(ComputingResource resource) {
+		Properties resProperties = resource.getProperties();
+		for(Object key:  properties.keySet()){
+			String property = (String) key;
+			if(resProperties.getProperty(property) != properties.getProperty(property))
+				return false;
+		}
+		return true;
+	}
+
+}
Index: DCWoRMS/trunk/build/classes/schedframe/resources/computing/validator/ResourceValidator.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/resources/computing/validator/ResourceValidator.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/resources/computing/validator/ResourceValidator.java	(revision 477)
@@ -0,0 +1,7 @@
+package schedframe.resources.computing.validator;
+
+import schedframe.resources.computing.ComputingResource;
+
+public interface ResourceValidator {
+	boolean validate(ComputingResource resource);
+}
Index: DCWoRMS/trunk/build/classes/schedframe/resources/computing/validator/ResourceNameValidator.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/resources/computing/validator/ResourceNameValidator.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/resources/computing/validator/ResourceNameValidator.java	(revision 477)
@@ -0,0 +1,18 @@
+package schedframe.resources.computing.validator;
+
+import schedframe.resources.computing.ComputingResource;
+
+public class ResourceNameValidator implements ResourceValidator {
+
+	private String name;
+	public ResourceNameValidator(String name) {
+		super();
+		this.name = name;
+	}	
+
+	@Override
+	public boolean validate(ComputingResource resource) {
+		return resource.getName().equals(name);
+	}
+
+}
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 477)
@@ -0,0 +1,21 @@
+package schedframe.resources.computing;
+
+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.ui.PowerInterface;
+
+public class DataCenter extends ComputingResource{
+
+	public DataCenter(ComputingResourceDescription resDesc) {
+		super(resDesc);
+		//extensionList.add(new EnergyExtension(this, resDesc.getPowerInterface(), resDesc.getEnergyEstimationPlugin()));
+		PowerInterface pi = PowerProfileFactory.createPowerInterface(this, resDesc.getPowerProfile());
+		accept(new EnergyExtension(pi, resDesc.getPowerProfile()));
+	}
+		
+	public void accept(EnergyExtension e){
+		extensionList.add(e);
+		e.setResource(this);
+	}
+}
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 477)
@@ -0,0 +1,109 @@
+package schedframe.resources.computing;
+
+import java.util.List;
+import java.util.Properties;
+
+
+import schedframe.resources.ResourceStatus;
+import schedframe.resources.StandardResourceType;
+import schedframe.resources.computing.description.ComputingResourceDescription;
+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.ui.ComputingNodePowerInterface;
+import schedframe.resources.computing.profiles.energy.power.ui.PowerInterface;
+import schedframe.resources.computing.properties.ComputingNodePropertiesBuilder;
+import schedframe.resources.computing.properties.PropertiesDirector;
+import schedframe.resources.units.Cost;
+import schedframe.resources.units.Memory;
+import schedframe.resources.units.StandardResourceUnitName;
+
+public class ComputingNode extends ComputingResource{
+	
+
+	public ComputingNode (ComputingResourceDescription resDesc) {
+		super(resDesc);
+		
+		//extensionList.add(new EnergyExtension(this, resDesc.getPowerInterface(), resDesc.getEnergyEstimationPlugin()));
+		PowerInterface pi = PowerProfileFactory.createPowerInterface(this, resDesc.getPowerProfile());
+		accept(new EnergyExtension(pi, resDesc.getPowerProfile()));	
+	}
+	
+	/*public ComputingNode (String resourceName, ResourceCharacteristics resourceCharacteristic, Category cat, PowerInterface powerInterface) {
+		super(resourceName, ResourceType.COMPUTING_NODE, resourceCharacteristic);
+		category = cat;
+		accept(powerInterface);
+	//	extensionList.add(new EnergyExtension(this, "example.energy.ComputingNodeEnergyEstimationPlugin"));
+	}*/
+	
+	
+	public ComputingNodePowerInterface getPowerInterface(){
+		ComputingNodePowerInterface powerProfile = null;
+		if(extensionList.isExtensionAvailable(ExtensionType.ENERGY_EXTENSION)){
+			EnergyExtension ee = (EnergyExtension)extensionList.getExtension(ExtensionType.ENERGY_EXTENSION);
+			powerProfile = (ComputingNodePowerInterface)ee.getPowerInterface();
+		}
+		return powerProfile;
+	}
+
+	@SuppressWarnings("unchecked")
+	public List<Processor> getProcessors(){
+		return (List<Processor>) getDescendantsByType(StandardResourceType.Processor);
+	}
+	
+	@SuppressWarnings("unchecked")
+	public List<Processor> getFreeProcessors(){
+		return (List<Processor>) getDescendantsByTypeAndStatus(StandardResourceType.Processor, ResourceStatus.FREE);
+	}
+
+	public int getProcessorsNumber() {
+		return getProcessors().size();
+	}
+
+	public int getFreeProcessorsNumber() {
+		return getFreeProcessors().size();
+	}
+	
+	
+	//MEMORY 
+	public int getFreeMemory() throws NoSuchFieldException {
+		return getMemory().getFreeAmount();
+	}
+	
+	public int getTotalMemory() throws NoSuchFieldException {
+		return getMemory().getAmount();
+	}
+
+	public boolean isMemRequirementSatisfied(int memoryReq) throws NoSuchFieldException {
+		if (getFreeMemory() < memoryReq)
+			return false;
+		return true;
+	}
+	
+	public Memory getMemory() throws NoSuchFieldException {
+		return (Memory)resourceCharacteristic.getResourceUnit(StandardResourceUnitName.MEMORY);
+	}
+	
+	//COST
+	public int getProcessingCost() throws NoSuchFieldException {
+		return getCost().getAmount();
+	}
+	
+	private Cost getCost() throws NoSuchFieldException {
+		return (Cost) resourceCharacteristic.getResourceUnit(StandardResourceUnitName.COST);
+	}
+
+	
+	public Properties getProperties(){
+		PropertiesDirector propDirector = new PropertiesDirector();
+		propDirector.setPropertiesBuilder(new ComputingNodePropertiesBuilder());
+		propDirector.constructProperties(this);
+		return propDirector.getProperties();
+	}
+	
+	
+	public void accept(EnergyExtension e){
+		extensionList.add(e);
+		e.setResource(this);
+	}
+}
Index: DCWoRMS/trunk/build/classes/schedframe/resources/computing/properties/ComputingNodePropertiesBuilder.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/resources/computing/properties/ComputingNodePropertiesBuilder.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/resources/computing/properties/ComputingNodePropertiesBuilder.java	(revision 477)
@@ -0,0 +1,41 @@
+package schedframe.resources.computing.properties;
+
+import java.util.Properties;
+
+import schedframe.resources.computing.ComputingNode;
+import schedframe.resources.computing.ComputingResource;
+
+public class ComputingNodePropertiesBuilder implements PropertiesBuilder{
+	protected Properties properties;
+	private ComputingNode node;
+	
+	public Properties getProperties() {
+		return properties;
+	}
+
+	public void createProperties(ComputingResource resource) {
+		this.properties = new Properties();
+		this.node = (ComputingNode)resource;
+	}
+
+	public void buildBasicProperties() {
+		properties.setProperty("name", node.getName());
+		properties.setProperty("type", node.getType().toString());
+		properties.setProperty("status", node.getStatus().toString());
+	}
+
+	public void buildCharacteristicsProperties() {
+		try {
+			properties.setProperty("totalmemory", String.valueOf(node.getTotalMemory()));
+			properties.setProperty("freememory", String.valueOf(node.getFreeMemory()));
+			properties.setProperty("cost", String.valueOf(node.getProcessingCost()));
+		} catch (NoSuchFieldException e) {
+			// TODO Auto-generated catch block
+			//e.printStackTrace();
+		}
+	}
+
+	public void buildDescriptionProperties() {
+
+	}
+}
Index: DCWoRMS/trunk/build/classes/schedframe/resources/computing/properties/PropertiesBuilder.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/resources/computing/properties/PropertiesBuilder.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/resources/computing/properties/PropertiesBuilder.java	(revision 477)
@@ -0,0 +1,18 @@
+package schedframe.resources.computing.properties;
+
+import java.util.Properties;
+
+import schedframe.resources.computing.ComputingResource;
+
+public interface PropertiesBuilder {
+
+	public Properties getProperties();
+
+	public void createProperties(ComputingResource resource);
+
+	public void buildBasicProperties();
+
+	public void buildCharacteristicsProperties();
+
+	public void buildDescriptionProperties();
+}
Index: DCWoRMS/trunk/build/classes/schedframe/resources/computing/properties/ResourceProperties.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/resources/computing/properties/ResourceProperties.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/resources/computing/properties/ResourceProperties.java	(revision 477)
@@ -0,0 +1,21 @@
+package schedframe.resources.computing.properties;
+
+import java.util.Properties;
+
+import schedframe.resources.computing.description.AbstractResourceDescription;
+
+public class ResourceProperties extends Properties{
+
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = -2910645588712569885L;
+
+	public ResourceProperties(){
+		
+	}
+	
+	public ResourceProperties(AbstractResourceDescription ard){
+		
+	}
+}
Index: DCWoRMS/trunk/build/classes/schedframe/resources/computing/properties/DefaultPropertiesBuilder.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/resources/computing/properties/DefaultPropertiesBuilder.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/resources/computing/properties/DefaultPropertiesBuilder.java	(revision 477)
@@ -0,0 +1,35 @@
+package schedframe.resources.computing.properties;
+
+import java.util.Properties;
+
+import schedframe.resources.computing.ComputingResource;
+
+public class DefaultPropertiesBuilder implements PropertiesBuilder{
+
+	protected Properties properties;
+	private ComputingResource resource;
+	
+	public Properties getProperties() {
+		return properties;
+	}
+
+	public void createProperties(ComputingResource resource) {
+		this.properties = new Properties();
+		this.resource = resource;
+	}
+
+	public void buildBasicProperties() {
+		properties.setProperty("name", resource.getName());
+		properties.setProperty("type", resource.getType().toString());
+		properties.setProperty("status", resource.getStatus().toString());
+	}
+
+	public void buildCharacteristicsProperties() {
+		
+	}
+
+	public void buildDescriptionProperties() {
+
+	}
+
+}
Index: DCWoRMS/trunk/build/classes/schedframe/resources/computing/properties/PropertiesDirector.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/resources/computing/properties/PropertiesDirector.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/resources/computing/properties/PropertiesDirector.java	(revision 477)
@@ -0,0 +1,24 @@
+package schedframe.resources.computing.properties;
+
+import java.util.Properties;
+
+import schedframe.resources.computing.ComputingResource;
+
+public class PropertiesDirector {
+	PropertiesBuilder propBuilder;
+
+	public void setPropertiesBuilder(PropertiesBuilder pb) {
+		propBuilder = pb;
+	}
+
+	public Properties getProperties() {
+		return propBuilder.getProperties();
+	}
+
+	public void constructProperties(ComputingResource resource) {
+		propBuilder.createProperties(resource);
+		propBuilder.buildBasicProperties();
+		propBuilder.buildCharacteristicsProperties();
+		propBuilder.buildDescriptionProperties();
+	}
+}
Index: DCWoRMS/trunk/build/classes/schedframe/resources/computing/properties/CpuPropertiesBuilder.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/resources/computing/properties/CpuPropertiesBuilder.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/resources/computing/properties/CpuPropertiesBuilder.java	(revision 477)
@@ -0,0 +1,38 @@
+package schedframe.resources.computing.properties;
+
+import java.util.Properties;
+
+import schedframe.resources.computing.ComputingResource;
+import schedframe.resources.computing.Processor;
+
+public class CpuPropertiesBuilder implements PropertiesBuilder{
+	protected Properties properties;
+	private Processor cpu;
+	
+	public Properties getProperties() {
+		return properties;
+	}
+
+	public void createProperties(ComputingResource resource) {
+		this.properties = new Properties();
+		this.cpu = (Processor)resource;
+	}
+
+	public void buildBasicProperties() {
+		properties.setProperty("name", cpu.getName());
+		properties.setProperty("type", cpu.getType().toString());
+		properties.setProperty("status", cpu.getStatus().toString());
+	}
+
+	public void buildCharacteristicsProperties() {
+		properties.setProperty("speed", String.valueOf(cpu.getMIPS()));
+	}
+
+	public void buildDescriptionProperties() {
+
+
+	}
+
+
+
+}
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 477)
@@ -0,0 +1,295 @@
+package schedframe.resources.computing;
+
+import gridsim.GridSimTags;
+import gridsim.gssim.WormsTags;
+
+import java.util.ArrayList;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Properties;
+
+import schedframe.Initializable;
+import schedframe.events.Event;
+import schedframe.events.EventHandler;
+import schedframe.events.ResourceEventCommand;
+import schedframe.events.scheduling.EventReason;
+import schedframe.events.scheduling.SchedulingEvent;
+import schedframe.events.scheduling.SchedulingEventCommand;
+import schedframe.exceptions.ResourceException;
+import schedframe.resources.Resource;
+import schedframe.resources.ResourceStatus;
+import schedframe.resources.ResourceType;
+import schedframe.resources.computing.description.ComputingResourceDescription;
+import schedframe.resources.computing.extensions.Extension;
+import schedframe.resources.computing.extensions.ExtensionList;
+import schedframe.resources.computing.extensions.ExtensionListImpl;
+import schedframe.resources.computing.extensions.ExtensionType;
+import schedframe.resources.computing.profiles.energy.EnergyEvent;
+import schedframe.resources.computing.profiles.energy.EnergyEventType;
+import schedframe.resources.computing.profiles.energy.EnergyExtension;
+import schedframe.resources.computing.profiles.energy.power.ui.PowerInterface;
+import schedframe.resources.computing.properties.DefaultPropertiesBuilder;
+import schedframe.resources.computing.properties.PropertiesDirector;
+import schedframe.resources.computing.validator.ResourceNameValidator;
+import schedframe.resources.computing.validator.ResourcePropertiesValidator;
+import schedframe.resources.computing.validator.ResourceStatusValidator;
+import schedframe.resources.computing.validator.ResourceTypeValidator;
+import schedframe.resources.computing.validator.ResourceValidator;
+import schedframe.resources.units.PEUnit;
+import schedframe.resources.units.ResourceUnit;
+import schedframe.resources.units.StandardResourceUnitName;
+import schedframe.scheduling.Scheduler;
+
+public class ComputingResource implements Resource, Initializable{
+	
+	protected String name;
+	protected ResourceType type;
+	protected ResourceStatus status;
+
+	protected ComputingResource parent;
+	protected List<ComputingResource> children;
+	
+	protected Scheduler scheduler;
+	protected ResourceCharacteristics resourceCharacteristic;
+	protected ExtensionList extensionList;
+	
+
+	public ExtensionList getExtensionList() {
+		return extensionList;
+	}
+
+	public ComputingResource(ComputingResourceDescription resDesc) {
+		this.type = resDesc.getType();
+		this.name = resDesc.getId();
+		this.status = ResourceStatus.FREE;
+		this.extensionList = new ExtensionListImpl(1);
+		initCharacteristics(resDesc);
+		addFakeProcessors();
+	}
+
+	//TODO remove if possible (check if all scenarios can be realized - statistics issue) , since it's temporary method
+	private void addFakeProcessors() {
+		if(getResourceCharacteristic().getResourceUnits().get(StandardResourceUnitName.PE) != null){
+			for(ResourceUnit resUnit: getResourceCharacteristic().getResourceUnits().get(StandardResourceUnitName.PE)){
+				PEUnit peUnit = (PEUnit) resUnit;
+				for(int i = 0; i < peUnit.getAmount(); i++){
+					schemas.ComputingResource fakeCompResource = new schemas.ComputingResource();
+					fakeCompResource.setClazz("Processor");
+					addChild(ResourceFactory.createResource(new ComputingResourceDescription(fakeCompResource)));
+				}
+			}
+		}
+	}
+
+	protected void initCharacteristics(ComputingResourceDescription resDesc){
+		resourceCharacteristic = new ResourceCharacteristics.Builder().resourceUnits(resDesc.getResourceUnits()).location(resDesc.getLocation()).parameters(resDesc.getParameters()).build();
+	}
+	
+	public ComputingResource getParent() {
+		return parent;
+	}
+
+	public void setParent(ComputingResource newParent) {
+		parent = newParent;
+	}
+
+	public List<ComputingResource> getChildren() {
+		if (children == null)
+			return new ArrayList<ComputingResource>(1);
+		return children;
+	}
+
+	public void addChild(ComputingResource child) {
+		child.setParent(this);
+		if (children == null)
+			children = new ArrayList<ComputingResource>();
+		children.add(child);
+	}
+
+	public String getName() {
+		return name;
+	}
+
+	public ResourceType getType() {
+		return type;
+	}
+
+	public ResourceCharacteristics getResourceCharacteristic() {
+		return resourceCharacteristic;
+	}
+
+	public ResourceStatus getStatus() {
+		return status;
+	}
+
+	public void setStatus(ResourceStatus newStatus) {
+		if(newStatus != status){
+			status = newStatus;
+			if(children != null) {
+				for(ComputingResource child: children){
+					child.setStatus(status);
+				}
+			}	
+		}
+	}
+	
+	private void triggerEventUp(Event event) {
+		if(parent != null)
+			parent.handleEvent(event);
+	}
+
+	public void handleEvent(Event event){
+		ResourceEventCommand rec = new ResourceEventCommand(this);
+		rec.execute(event);
+		SchedulingEventCommand sec = new SchedulingEventCommand(this);
+		sec.execute(event);
+
+		
+		//old, correctly working method
+		/*if (extensionList != null) {
+			for (Extension extension : extensionList) {
+				if (extension.supportsEvent(event)) {
+					extension.handleEvent(event);
+				}
+			}
+		}*/
+		//TODO - delete, check before
+		//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);
+		//}
+		//triggerEventUp(event);
+	}
+	
+	public List <? extends ComputingResource> getDescendantsByType(ResourceType type) {
+		List<ResourceValidator> validators = new ArrayList<ResourceValidator>();
+		validators.add(new ResourceTypeValidator(type));
+		return searchDescendants(validators, true);
+	}
+
+	public List<? extends ComputingResource> getDescendantsByTypeAndStatus(ResourceType type, ResourceStatus status) {
+		List<ResourceValidator> validators = new ArrayList<ResourceValidator>();
+		validators.add(new ResourceStatusValidator(status));
+		validators.add(new ResourceTypeValidator(type));
+		return searchDescendants(validators, true);
+	}
+
+	public ComputingResource getDescendantByName(String resourceName) throws ResourceException {
+		List<ResourceValidator> validators = new ArrayList<ResourceValidator>();
+		validators.add(new ResourceNameValidator(resourceName));
+		List<? extends ComputingResource> resources = searchDescendants(validators, true);
+		return resources.size() == 0 ? null : resources.get(0);
+	}
+	
+	public List<? extends ComputingResource> filterDescendants(Properties properties)  {
+		List<ResourceValidator> validators = new ArrayList<ResourceValidator>();
+		validators.add(new ResourcePropertiesValidator(properties));
+		return searchDescendants(validators, false);
+	}
+	
+	protected List<? extends ComputingResource> searchDescendants(List<ResourceValidator> validators, boolean cutoff) {
+
+		List<ComputingResource> descendants = new ArrayList<ComputingResource>();
+		if (children != null) {
+			LinkedList<ComputingResource> toExamine = new LinkedList<ComputingResource>();
+			toExamine.push(this);
+
+			while (!toExamine.isEmpty()) {
+				ComputingResource resource = toExamine.pop();
+				List<ComputingResource> resources = resource.getChildren();
+				/*if (resources == null)
+					continue;*/
+				int numberOfRes = resources.size();
+				for (int i = 0; i < numberOfRes; i++) {
+					ComputingResource resourceChild = resources.get(i);
+					if (resourceChild.match(validators)) {
+						descendants.add(resourceChild);
+						if(cutoff == false) {
+							toExamine.addLast(resourceChild);
+						}
+					} else
+						//toExamine.insertElementAt(resourceChild, 0);
+						toExamine.addLast(resourceChild);
+				}
+			}
+		}
+		return descendants;
+	}
+	
+	protected boolean match(List<ResourceValidator> validators){
+		for(ResourceValidator validator: validators){
+			if(validator.validate(this) == false)
+				return false;
+		}
+		return true;
+	}
+	
+	public Properties getProperties(){
+		PropertiesDirector propDirector = new PropertiesDirector();
+		propDirector.setPropertiesBuilder(new DefaultPropertiesBuilder());
+		propDirector.constructProperties(this);
+		return propDirector.getProperties();
+	}
+	
+	public PowerInterface getPowerInterface(){
+		if (extensionList != null) {
+			for (Extension extension : extensionList) {
+				if (extension.getType() == ExtensionType.ENERGY_EXTENSION) {
+					EnergyExtension ee = (EnergyExtension)extension;
+					return ee.getPowerInterface();
+				}
+			}
+		}
+		return null;
+	}
+
+	public Scheduler getScheduler() {
+		return scheduler;
+	}
+	
+	public void setScheduler(Scheduler scheduler) {
+		this.scheduler = scheduler;
+		if(children != null){
+			for(ComputingResource child: children){
+				child.setScheduler(scheduler);
+			}	
+		}
+	}
+
+	class SimpleEventHandler implements EventHandler{
+		
+		public void handleResourceEvent(Event event){
+			if (extensionList != null) {
+				for (Extension extension : extensionList) {
+					if (extension.supportsEvent(event)) {
+						extension.handleEvent(event);
+					}
+				}
+			}
+			if(event.getReason() != EventReason.SIM_INIT)
+				triggerEventUp(event);
+		}
+		
+		public void handleSchedulingEvent(SchedulingEvent event){
+
+			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);
+			} else if(parent != null)
+				parent.getEventHandler().handleSchedulingEvent(event);
+		}
+	}
+	
+	public EventHandler getEventHandler(){
+		return new SimpleEventHandler();
+	}
+	
+	public void initiate(){
+		ResourceEventCommand rec = new ResourceEventCommand(this);
+		EnergyEvent event = new EnergyEvent(EnergyEventType.POWER_STATE_CHANGED, "Resource controller");
+		event.setReason(EventReason.SIM_INIT);
+		rec.execute(event);
+		//alternative way
+		//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 477)
@@ -0,0 +1,94 @@
+package schedframe.resources.computing;
+
+import java.util.List;
+import java.util.Properties;
+
+import schedframe.resources.StandardResourceType;
+import schedframe.resources.computing.description.ComputingResourceDescription;
+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.ui.PowerInterface;
+import schedframe.resources.computing.profiles.energy.power.ui.ProcessorPowerInterface;
+import schedframe.resources.computing.properties.CpuPropertiesBuilder;
+import schedframe.resources.computing.properties.PropertiesDirector;
+import schedframe.resources.units.CpuSpeed;
+import schedframe.resources.units.StandardResourceUnitName;
+
+public class Processor extends ComputingResource{
+	
+
+	public Processor (ComputingResourceDescription resDesc) {
+		super(resDesc);
+		//extensionList.add(new EnergyExtension(this, resDesc.getPowerInterface(), resDesc.getEnergyEstimationPlugin()));
+		PowerInterface pi = PowerProfileFactory.createPowerInterface(this, resDesc.getPowerProfile());
+		accept(new EnergyExtension(pi, resDesc.getPowerProfile()));	
+	}
+
+
+	public ComputingNode getComputingNode(){
+		return (ComputingNode)parent;
+	}
+	
+	@SuppressWarnings("unchecked")
+	public List<Core> getCores(){
+		return (List<Core>) getDescendantsByType(StandardResourceType.Core);
+	}
+	
+	public int getMIPS(){
+		int mips;
+		try {
+			mips = getSpeedUnit().getAmount();
+		} catch (NoSuchFieldException e) {
+			mips = 1;
+		}
+		return mips;
+	}
+	
+	public int getAvailableMIPS(){
+		int mips;
+		try {
+			mips = getSpeedUnit().getFreeAmount();
+		} catch (NoSuchFieldException e) {
+			mips = 1;
+		}
+		return mips;
+	}
+
+	private CpuSpeed getSpeedUnit() throws NoSuchFieldException{
+		return (CpuSpeed) resourceCharacteristic.getResourceUnit(StandardResourceUnitName.CPUSPEED);
+	}
+	
+	public ProcessorPowerInterface getPowerInterface(){
+		if (extensionList != null) {
+			if(extensionList.isExtensionAvailable(ExtensionType.ENERGY_EXTENSION)){
+				EnergyExtension ee = (EnergyExtension)extensionList.getExtension(ExtensionType.ENERGY_EXTENSION);
+				return (ProcessorPowerInterface)ee.getPowerInterface();
+			}
+		}
+		return null;
+	}
+	
+	public void initCharacteristics(ComputingResourceDescription resDesc){
+		//resourceCharacteristic = new ResourceCharacteristics.Builder().resourceUnits().build();
+		super.initCharacteristics(resDesc);
+		try{
+			resourceCharacteristic.addResourceUnit(new CpuSpeed(name, Integer.valueOf(resDesc.getCompResourceParameterValue("speed")) * 1, 0));
+		} catch(Exception e){
+			resourceCharacteristic.addResourceUnit(new CpuSpeed(name,  1, 0));
+		}
+	}
+	
+	public Properties getProperties(){
+		PropertiesDirector propDirector = new PropertiesDirector();
+		propDirector.setPropertiesBuilder(new CpuPropertiesBuilder());
+		propDirector.constructProperties(this);
+		return propDirector.getProperties();
+	}
+
+	public void accept(EnergyExtension e){
+		extensionList.add(e);
+		e.setResource(this);
+	}
+}
+
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 477)
@@ -0,0 +1,61 @@
+package schedframe.resources.computing;
+
+import schedframe.resources.StandardResourceType;
+import schedframe.resources.computing.description.ComputingResourceDescription;
+import schedframe.scheduling.Scheduler;
+import schedframe.scheduling.manager.resources.ManagedResources;
+import schedframe.scheduling.plugin.SchedulingPlugin;
+import schedframe.scheduling.plugin.estimation.ExecutionTimeEstimationPlugin;
+import schedframe.scheduling.policy.AbstractManagementSystem;
+import schedframe.scheduling.policy.global.GridBroker;
+import schedframe.scheduling.policy.local.LocalManagementSystem;
+import schedframe.scheduling.queue.TaskQueueList;
+import simulator.WormsConstants;
+
+
+public class ResourceFactory {
+
+	public static ComputingResource createResource(ComputingResourceDescription resDesc){
+		
+		if (resDesc.getType().equals(StandardResourceType.DataCenter))
+			return new DataCenter(resDesc);
+		else if (resDesc.getType().equals(StandardResourceType.ComputingNode))
+			return  new ComputingNode(resDesc);
+		else if (resDesc.getType().equals(StandardResourceType.Processor))
+			return new Processor(resDesc);
+		else
+			return new ComputingResource(resDesc);
+	
+		/*switch(resDesc.getType()){
+			case Grid: return new Grid(resDesc);
+			case DataCenter: return new DataCenter(resDesc);
+			case ComputingNode: return new ComputingNode(resDesc);
+			case Processor: return new Processor(resDesc);
+		default:
+			return new ComputingResource(resDesc);
+		}*/
+	}
+
+	public static Scheduler createScheduler(StandardResourceType type, String id, SchedulingPlugin schedulingPlugin, ExecutionTimeEstimationPlugin execTimeEstimationPlugin, TaskQueueList queues, ManagedResources managedResources) throws Exception{
+		AbstractManagementSystem ms;
+		switch(type){
+			case GS: {
+				ms = new GridBroker("grid",
+						schedulingPlugin, execTimeEstimationPlugin, queues);
+				return new Scheduler(ms, type, managedResources);
+			}
+			case LS: {
+				ms = new LocalManagementSystem(id, WormsConstants.MANAGEMENT_SYSTEM,
+						schedulingPlugin, execTimeEstimationPlugin, queues);
+				return new Scheduler(ms, type, managedResources);
+			}
+
+		default:{
+				ms = new LocalManagementSystem(id, WormsConstants.MANAGEMENT_SYSTEM,
+						schedulingPlugin, execTimeEstimationPlugin, queues);
+				return new Scheduler(ms, type, managedResources);
+			}
+		}
+	}
+}
+
Index: DCWoRMS/trunk/build/classes/schedframe/resources/computing/extensions/ExtensionList.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/resources/computing/extensions/ExtensionList.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/resources/computing/extensions/ExtensionList.java	(revision 477)
@@ -0,0 +1,12 @@
+package schedframe.resources.computing.extensions;
+
+import java.util.List;
+
+public interface ExtensionList extends List<Extension>{
+	
+	public <T extends Extension> List<T> get(ExtensionType type);
+	
+	public Extension getExtension(ExtensionType type);
+	
+	public boolean isExtensionAvailable(ExtensionType type);
+}
Index: DCWoRMS/trunk/build/classes/schedframe/resources/computing/extensions/ExtensionListImpl.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/resources/computing/extensions/ExtensionListImpl.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/resources/computing/extensions/ExtensionListImpl.java	(revision 477)
@@ -0,0 +1,55 @@
+package schedframe.resources.computing.extensions;
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+
+public class ExtensionListImpl extends ArrayList<Extension> implements ExtensionList {
+
+	private static final long serialVersionUID = -3824600938144742457L;
+
+	public ExtensionListImpl(){
+		super();
+	}
+	
+	public ExtensionListImpl(int initialSize){
+		super(initialSize);
+	}
+	
+	public List<Extension> get(ExtensionType type){
+		List<Extension> list = null;
+		
+		for(int i = 0; i < size(); i++){
+			Extension e = get(i);
+			if(e.getType() == type){
+				list = (list == null ? new ArrayList<Extension>(1) : list);
+				list.add(e);
+			}
+		}
+		return list;
+	}
+	
+	public Extension getExtension(ExtensionType type){
+		
+		for(int i = 0; i < size(); i++){
+			Extension e = get(i);
+			if(e.getType() == type){
+				return e;
+			}
+		}
+		return null;
+	}
+	
+	public boolean isExtensionAvailable(ExtensionType type){
+		for(int i = 0; i < size(); i++){
+			Extension e = get(i);
+			if(e.getType() == type){
+				return true;
+			}
+		}
+		return false;
+	}
+	
+	
+}
Index: DCWoRMS/trunk/build/classes/schedframe/resources/computing/extensions/ExtensionException.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/resources/computing/extensions/ExtensionException.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/resources/computing/extensions/ExtensionException.java	(revision 477)
@@ -0,0 +1,22 @@
+package schedframe.resources.computing.extensions;
+
+public class ExtensionException extends Exception {
+
+	private static final long serialVersionUID = -3388688857266748587L;
+	
+	public ExtensionException() {
+		super();
+	}
+
+    public ExtensionException(String message) {
+    	super(message);
+    }
+
+    public ExtensionException(String message, Throwable cause) {
+        super(message, cause);
+    }
+    
+    public ExtensionException(Throwable cause) {
+        super(cause);
+    }
+}
Index: DCWoRMS/trunk/build/classes/schedframe/resources/computing/extensions/Extension.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/resources/computing/extensions/Extension.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/resources/computing/extensions/Extension.java	(revision 477)
@@ -0,0 +1,19 @@
+package schedframe.resources.computing.extensions;
+
+import java.util.Properties;
+
+import schedframe.events.Event;
+
+public interface Extension /*extends Module*/{
+
+	public boolean supportsEvent(Event event);
+
+	//public void handleEvent(Sim_event ev);
+	
+	public void handleEvent(Event event);
+	
+	public void init(Properties properties) throws ExtensionException;
+	
+	public ExtensionType getType();
+}
+
Index: DCWoRMS/trunk/build/classes/schedframe/resources/computing/extensions/ExtensionType.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/resources/computing/extensions/ExtensionType.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/resources/computing/extensions/ExtensionType.java	(revision 477)
@@ -0,0 +1,26 @@
+package schedframe.resources.computing.extensions;
+
+import schedframe.resources.computing.profiles.energy.EnergyExtension;
+import schedframe.scheduling.plugin.grid.JobRegistry;
+
+public enum ExtensionType {
+
+	JOB_REGISTRY("Job registry", JobRegistry.class),
+	ENERGY_EXTENSION("EnergyExtension", EnergyExtension.class);
+	
+	private String name;
+	private Class<?> _interface;
+	
+	private ExtensionType(String name, Class<?> _class){
+		this.name = name;
+		this._interface = _class;
+	}
+	
+	public String toString(){
+		return this.name;
+	}
+	
+	public boolean isValidFor(Extension m){
+		return (m == null ? false : _interface.isAssignableFrom(m.getClass()));
+	}
+}
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 477)
@@ -0,0 +1,34 @@
+package schedframe.resources.computing;
+
+import java.util.List;
+
+import schedframe.resources.StandardResourceType;
+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.ui.PowerInterface;
+
+public class Rack extends ComputingResource{
+	
+
+	public Rack (ComputingResourceDescription resDesc) {
+		super(resDesc);
+		PowerInterface pi = PowerProfileFactory.createPowerInterface(this, resDesc.getPowerProfile());
+		accept(new EnergyExtension(pi, resDesc.getPowerProfile()));	
+	}
+
+	@SuppressWarnings("unchecked")
+	public List<ComputingNode> getComputingNodes(){
+		return (List<ComputingNode>) getDescendantsByType(StandardResourceType.ComputingNode);
+	}
+	
+	@SuppressWarnings("unchecked")
+	public List<Processor> getProcessors(){
+		return (List<Processor>) getDescendantsByType(StandardResourceType.Processor);
+	}
+	
+	public void accept(EnergyExtension e){
+		extensionList.add(e);
+		e.setResource(this);
+	}
+}
Index: DCWoRMS/trunk/build/classes/schedframe/resources/computing/ResourceCharacteristics.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/resources/computing/ResourceCharacteristics.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/resources/computing/ResourceCharacteristics.java	(revision 477)
@@ -0,0 +1,92 @@
+package schedframe.resources.computing;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import schedframe.Parameters;
+import schedframe.resources.computing.location.Location;
+import schedframe.resources.units.ResourceUnit;
+import schedframe.resources.units.ResourceUnitName;
+
+
+public class ResourceCharacteristics /*extends Properties*/{
+
+	private static final long serialVersionUID = 2719535186621622647L;
+
+	protected Map<ResourceUnitName, List<ResourceUnit>> resUnits;
+	protected Parameters parameters;
+	protected Location location;
+
+	/*public ResourceCharacteristics(Map<ResourceUnitName, List<AbstractResourceUnit>> resUnits){
+		this.resUnits = resUnits;
+	}
+
+	public ResourceCharacteristics(){
+		this.resUnits = null;
+	}
+	
+	public ResourceCharacteristics(Map<ResourceUnitName, List<AbstractResourceUnit>> resUnits, Parameters parameters){
+		this(resUnits);
+	}*/
+	
+	public Map<ResourceUnitName, List<ResourceUnit>> getResourceUnits() {
+		if(resUnits == null)
+			return new HashMap<ResourceUnitName, List<ResourceUnit>>();
+		return resUnits;
+	}
+	
+	public ResourceUnit getResourceUnit(ResourceUnitName unitName) throws NoSuchFieldException{
+		if(getResourceUnits().containsKey(unitName))
+			return getResourceUnits().get(unitName).get(0);
+		else throw new NoSuchFieldException("Resource unit " + unitName + 
+				" is not available in this resource ");
+	}
+	
+	public void addResourceUnit(ResourceUnit unit){ 
+		if(resUnits == null){
+			resUnits = new HashMap<ResourceUnitName, List<ResourceUnit>>(2);
+		}
+		List<ResourceUnit> list = null;
+		if(resUnits.containsKey(unit.getName())){
+			list = resUnits.get(unit.getName());
+		} else {
+			list = new ArrayList<ResourceUnit>(1);
+			resUnits.put(unit.getName(), list);
+		}
+		list.add(unit);
+	}
+	
+	
+	public static class Builder {
+		  
+		protected Map<ResourceUnitName, List<ResourceUnit>> resUnits;
+		protected Location location;
+		protected Parameters parameters;
+		
+		public Builder location(Location params){this.location = params; return this; }
+        public Builder parameters(Parameters prop){this.parameters = prop; return this; }
+        public Builder resourceUnits(Map<ResourceUnitName, List<ResourceUnit>> units){this.resUnits = units; return this; }
+        public Builder resourceUnits(){this.resUnits = new HashMap<ResourceUnitName, List<ResourceUnit>>(2); return this; }
+        
+        public ResourceCharacteristics build() {
+            return new ResourceCharacteristics(this);
+        }
+	}
+	
+	private ResourceCharacteristics(Builder builder) {
+		this.location = builder.location;
+		this.parameters = builder.parameters;
+		this.resUnits = builder.resUnits;
+	}
+
+	public Parameters getParameters() {
+		return parameters;
+	}
+
+	public Location getLocation() {
+		return location;
+	}
+
+}
Index: DCWoRMS/trunk/build/classes/schedframe/resources/computing/Grid.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/resources/computing/Grid.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/resources/computing/Grid.java	(revision 477)
@@ -0,0 +1,12 @@
+package schedframe.resources.computing;
+
+import schedframe.resources.computing.description.ComputingResourceDescription;
+
+public class Grid extends ComputingResource{
+
+	public Grid(ComputingResourceDescription resDesc) {
+		super(resDesc);
+		// TODO Auto-generated constructor stub
+	}
+
+}
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 477)
@@ -0,0 +1,61 @@
+package schedframe.resources.computing;
+
+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.ui.PowerInterface;
+import schedframe.resources.units.CpuSpeed;
+import schedframe.resources.units.StandardResourceUnitName;
+
+public class Core extends ComputingResource{
+	
+
+	public Core (ComputingResourceDescription resDesc) {
+		super(resDesc);
+		PowerInterface pi = PowerProfileFactory.createPowerInterface(this, resDesc.getPowerProfile());
+		accept(new EnergyExtension(pi, resDesc.getPowerProfile()));	
+	}
+
+	public Processor getProcessor(){
+		return (Processor)parent;
+	}
+	
+	public int getMIPS(){
+		int mips;
+		try {
+			mips = getSpeedUnit().getAmount();
+		} catch (NoSuchFieldException e) {
+			mips = 1;
+		}
+		return mips;
+	}
+	
+	public int getAvailableMIPS(){
+		int mips;
+		try {
+			mips = getSpeedUnit().getFreeAmount();
+		} catch (NoSuchFieldException e) {
+			mips = 1;
+		}
+		return mips;
+	}
+
+	private CpuSpeed getSpeedUnit() throws NoSuchFieldException{
+		return (CpuSpeed) resourceCharacteristic.getResourceUnit(StandardResourceUnitName.CPUSPEED);
+	}
+
+	public void initCharacteristics(ComputingResourceDescription resDesc){
+		super.initCharacteristics(resDesc);
+		try{
+			resourceCharacteristic.addResourceUnit(new CpuSpeed(name, Integer.valueOf(resDesc.getCompResourceParameterValue("speed")) * 1, 0));
+		} catch(Exception e){
+			resourceCharacteristic.addResourceUnit(new CpuSpeed(name,  1, 0));
+		}
+	}
+
+	public void accept(EnergyExtension e){
+		extensionList.add(e);
+		e.setResource(this);
+	}
+}
+
Index: DCWoRMS/trunk/build/classes/schedframe/resources/computing/location/Location.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/resources/computing/location/Location.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/resources/computing/location/Location.java	(revision 477)
@@ -0,0 +1,32 @@
+package schedframe.resources.computing.location;
+
+import schedframe.Parameters;
+
+public class Location {
+	
+	protected long horizontal;
+	protected long vertical;
+	protected long depth;
+	
+	public Location(long horizontal, long vertical, long depth) {
+		super();
+		this.horizontal = horizontal;
+		this.vertical = vertical;
+		this.depth = depth;
+	}
+	
+	public long getHorizontal() {
+		return horizontal;
+	}
+	public long getVertical() {
+		return vertical;
+	}
+	public long getDepth() {
+		return depth;
+	}
+	
+	public void init(Parameters parameters){
+		
+	}
+	
+}
Index: DCWoRMS/trunk/build/classes/schedframe/resources/Resource.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/resources/Resource.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/resources/Resource.java	(revision 477)
@@ -0,0 +1,12 @@
+package schedframe.resources;
+
+
+public interface Resource {
+
+	public String getName();
+
+	public ResourceType getType();
+
+	public ResourceStatus getStatus();
+	
+}
Index: DCWoRMS/trunk/build/classes/schedframe/resources/UserResourceType.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/resources/UserResourceType.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/resources/UserResourceType.java	(revision 477)
@@ -0,0 +1,16 @@
+package schedframe.resources;
+
+
+public class UserResourceType implements ResourceType {
+
+	protected String name;
+
+	public UserResourceType(String name) {
+		this.name = name;
+	}
+
+	public String getName() {
+		return name;
+	}
+	
+}
Index: DCWoRMS/trunk/build/classes/schedframe/resources/ResourceType.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/resources/ResourceType.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/resources/ResourceType.java	(revision 477)
@@ -0,0 +1,7 @@
+package schedframe.resources;
+
+public interface ResourceType {
+
+	public String getName();
+
+}
Index: DCWoRMS/trunk/build/classes/schedframe/resources/ResourceStatus.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/resources/ResourceStatus.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/resources/ResourceStatus.java	(revision 477)
@@ -0,0 +1,11 @@
+package schedframe.resources;
+
+public enum ResourceStatus {
+	BUSY,
+	FREE,
+	RESERVED,
+	FAILED,
+	PENDING,
+	AVAILABLE,
+	UNAVAILABLE;
+}
Index: DCWoRMS/trunk/build/classes/schedframe/resources/providers/LocalSystem.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/resources/providers/LocalSystem.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/resources/providers/LocalSystem.java	(revision 477)
@@ -0,0 +1,35 @@
+package schedframe.resources.providers;
+
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+public class LocalSystem extends ResourceProvider {
+
+	public LocalSystem(String id, String administrationDomain, String location) {
+		super(id, administrationDomain, location, "LocalSystem");
+	}
+	
+	public LocalSystem(){
+		super();
+	}
+
+	public void setProviderId(String id) {
+		this.id = id;
+	}
+
+	public void setProviderLocation(String location) {
+		this.location = location;
+	}
+
+	public void setAdministrationDomain(String administrationDoamain){
+		this.administrationDomain = administrationDoamain;
+	}
+	
+	public void setDescription(Object description){
+		this.description = description;
+	}
+
+}
Index: DCWoRMS/trunk/build/classes/schedframe/resources/providers/ResourceProvider.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/resources/providers/ResourceProvider.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/resources/providers/ResourceProvider.java	(revision 477)
@@ -0,0 +1,142 @@
+package schedframe.resources.providers;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+public class ResourceProvider {
+
+	protected String administrationDomain;
+	protected String id;
+	protected String location;
+	protected String type;
+	protected Object description;
+	protected String commonName;
+	
+	protected Map<String, String> properties;
+	
+	public ResourceProvider(String id, 
+							String administrationDomain, 
+							String location, 
+							String type) {
+		this.id = id;
+		this.administrationDomain = administrationDomain;
+	    this.location = location;
+	    this.type = type;
+	    this.description = null;
+	    this.properties = null;
+	}
+	
+	public ResourceProvider(){
+		this.id = null;
+		this.administrationDomain = null;
+		this.location = null;
+		this.description = null;
+		this.type = null;
+		this.properties = null;
+	}
+	
+	public String getAdministrationDomain() {
+		return this.administrationDomain;
+	}
+
+	public String getProviderId() {
+		return this.id;
+	}
+
+	public String getProviderLocation() {
+		return this.location;
+	}
+	
+	public Object getDescription(){
+		return this.description;
+	}
+	
+	public String getType(){
+		return this.type;
+	}
+	
+	public String getCommonName(){
+		return this.commonName;
+	}
+	
+	public void setCommonName(String name){
+		this.commonName = name;
+	}
+	
+	public void addProperty(String key, String value){
+		if(this.properties == null){
+			this.properties = new HashMap<String, String>();
+		}
+		
+		this.properties.put(key, value);
+	}
+	
+	public String getProperty(String key){
+		if(this.properties == null)
+			return null;
+		String value = this.properties.get(key);
+		return value;
+	}
+	
+	public Set<String> getPropertyKeys(){
+		if(this.properties == null)
+			return null;
+		
+		Set<String> keys = this.properties.keySet();
+		
+		return keys;
+	}
+	
+	public boolean equals(Object r){
+		if (r instanceof ResourceProvider == false) 
+			return false;
+		
+		ResourceProvider resProvider = (ResourceProvider) r;
+		
+		if(type != null && !type.equals(resProvider.getType()))
+			return false;
+		
+		if(administrationDomain != null && !administrationDomain.equals(resProvider.getAdministrationDomain()))
+			return false;
+		
+		if(location != null && !location.equals(resProvider.getProviderLocation()))
+			return false;
+		
+		if(id != null && !id.equals(resProvider.getProviderId()))
+			return false;
+		
+		return true;
+		
+	}
+	
+	public int hashCode() {
+		// 4 is for 4 letters in word null.
+		int cnt = (this.id == null ? 4 : this.id.length());
+		cnt += (this.administrationDomain == null ? 4 : this.administrationDomain.length());
+		cnt += (this.location == null ? 4 : this.location.length());
+		cnt += (this.type == null ? 4 : this.type.length());
+		cnt += (this.commonName == null ? 4 : this.commonName.length());
+		
+		StringBuffer buffer = new StringBuffer(cnt);
+		buffer.append(this.id);
+		buffer.append(this.administrationDomain);
+		buffer.append(this.location);
+		buffer.append(this.type);
+		buffer.append(this.commonName);
+		String s = buffer.toString();
+		return s.hashCode();
+	}
+
+	public String toString(){
+		return id + " " + administrationDomain + " " + location + " " + commonName;
+	}
+
+	
+}
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 477)
@@ -0,0 +1,146 @@
+package schedframe;
+
+import gridsim.GridSim;
+
+import java.util.Deque;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Set;
+
+import schedframe.exceptions.ResourceException;
+import schedframe.resources.computing.ComputingResource;
+import schedframe.scheduling.Scheduler;
+
+public class ResourceController {
+
+	protected static Scheduler scheduler;
+	protected static List<ComputingResource> computingResources;
+	protected Deque<Initializable> toInit;
+	
+	public  ResourceController(Scheduler logicalStructure, List<ComputingResource> compResources){
+		scheduler = logicalStructure;
+		computingResources = compResources;
+	}
+
+	public Scheduler getScheduler() {
+		return scheduler;
+	}
+
+	public List<ComputingResource> getComputingResources() {
+		return computingResources;
+	}
+
+	public static ComputingResource getComputingResourceByName(String resourceName) throws ResourceException {
+		ComputingResource resourceWithName = null;
+		for (int i = 0; i < computingResources.size() && resourceWithName == null; i++) {
+			ComputingResource resource = computingResources.get(i);
+			if (resource.getName().equals(resourceName))
+				resourceWithName = resource;
+			else
+				resourceWithName = resource.getDescendantByName(resourceName);
+		}
+		return resourceWithName;
+	}
+
+	public static Scheduler getSchedulerByName(String schedulerName) {
+		Scheduler schedulerWithName = null;
+
+		if (scheduler.getName().compareTo(schedulerName) == 0)
+			schedulerWithName = scheduler;
+		else if (scheduler.getChildren() != null) {
+			LinkedList<Scheduler> toExamine = new LinkedList<Scheduler>();
+			toExamine.push(scheduler);
+
+			while (!toExamine.isEmpty() && schedulerWithName != null) {
+				Scheduler scheduler = toExamine.pop();
+				List<Scheduler> schedulers = scheduler .getChildren();
+
+				int numberOfSched = schedulers.size();
+				for (int i = 0; i < numberOfSched; i++) {
+					Scheduler schedulerChild = schedulers.get(i);
+					if(scheduler.getName().equals(schedulerName)){
+						schedulerWithName = schedulerChild;
+						break;
+					} else
+						toExamine.addLast(schedulerChild);
+				}
+			}
+		}
+		return schedulerWithName;
+	}
+	
+	public static Scheduler getScheduler(String resName){
+		if(GridSim.getEntityId(resName) != -1){
+			return  getSchedulerByName(resName);
+		}
+		ComputingResource resourceWithName = null;
+		try {
+			resourceWithName = getComputingResourceByName(resName);
+		} catch (ResourceException e) {
+		}
+		/*for(int i = 0 ; i < computingResources.size() && resourceWithName == null; i++){
+			ComputingResource resource = computingResources.get(i);
+			if(resource.getName().equals(resName))
+				resourceWithName = resource;
+			else
+				try {
+					resourceWithName = resource.getDescendantByName(resName);
+				} catch (ResourceException e) {
+					return null;
+				}
+		}*/
+		if(resourceWithName == null)
+			return null;
+		List<ComputingResource> children = resourceWithName.getChildren();
+		Set<Scheduler> childrenSchedulers = new HashSet<Scheduler>();
+		if(children.isEmpty())
+			return null;
+		for(ComputingResource child: children) {
+			childrenSchedulers.add(child.getScheduler());
+		}	
+
+		Set<Scheduler> tempChildrenSchedulers = new HashSet<Scheduler>(childrenSchedulers);
+		while(childrenSchedulers.size() > 1){
+			childrenSchedulers = new HashSet<Scheduler>();
+			for(Scheduler s: tempChildrenSchedulers){
+				childrenSchedulers.add(s.getParent());
+			}
+			tempChildrenSchedulers = new HashSet<Scheduler>(childrenSchedulers);
+		}
+		Iterator<Scheduler> it = childrenSchedulers.iterator();
+		Scheduler potentialScheduler = it.next();
+		if(potentialScheduler.getCompResources().containsAll(children))
+			return potentialScheduler;
+		return null;
+	}
+	
+	public static ComputingResource getCommonComputingResourceParent(List<ComputingResource> compResources){
+		if(compResources.size() == 0)
+			return null;
+		Set<ComputingResource> candidates = new HashSet<ComputingResource>(compResources);
+		while(candidates.size() > 1){
+			Set<ComputingResource> parents = new HashSet<ComputingResource>();
+			Iterator<ComputingResource> it = candidates.iterator();
+			while(it.hasNext()){
+				ComputingResource compRes = it.next();
+				if(compRes.getParent() != null){
+					parents.add(compRes.getParent());
+				}
+				it.remove();
+			}
+			candidates.addAll(parents);
+		}
+		return candidates.toArray(new ComputingResource[0])[0];
+	}
+
+	public void setInitList(Deque<Initializable> toI) {
+		toInit = toI;
+	}
+
+	public Deque<Initializable> getToInit() {
+		return toInit;
+	}
+
+}
Index: DCWoRMS/trunk/build/classes/schedframe/Plugin.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/Plugin.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/Plugin.java	(revision 477)
@@ -0,0 +1,24 @@
+package schedframe;
+
+
+
+/**
+ * @author Stanislaw Szczepanowski
+ *
+ */
+public interface Plugin {
+	
+	/**
+	 * Returns the plugin name used in the simulation
+	 * @return the name of the plugin with all the package namespace, e.g. org.gridcompany.plugins.forecast.GridPlugin
+	 */
+	public String getName();
+	
+	/**
+	 * Initializes the plugin
+	 */
+	public void init(Parameters parameters);
+	
+	public PluginConfiguration getConfiguration();
+	
+}
Index: DCWoRMS/trunk/build/classes/schedframe/exceptions/ModuleException.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/exceptions/ModuleException.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/exceptions/ModuleException.java	(revision 477)
@@ -0,0 +1,27 @@
+package schedframe.exceptions;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+public class ModuleException extends Exception {
+
+	private static final long serialVersionUID = -3388688857266748587L;
+	
+	public ModuleException() {
+		super();
+	}
+
+    public ModuleException(String message) {
+    	super(message);
+    }
+
+    public ModuleException(String message, Throwable cause) {
+        super(message, cause);
+    }
+    
+    public ModuleException(Throwable cause) {
+        super(cause);
+    }
+}
Index: DCWoRMS/trunk/build/classes/schedframe/exceptions/ResourceException.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/exceptions/ResourceException.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/exceptions/ResourceException.java	(revision 477)
@@ -0,0 +1,22 @@
+package schedframe.exceptions;
+
+public class ResourceException extends Exception{
+
+	private static final long serialVersionUID = 1L;
+
+	public ResourceException() {
+		super();
+	}
+
+    public ResourceException(String message) {
+    	super(message);
+    }
+
+    public ResourceException(String message, Throwable cause) {
+        super(message, cause);
+    }
+    
+    public ResourceException(Throwable cause) {
+        super(cause);
+    }
+}
Index: DCWoRMS/trunk/build/classes/schedframe/Parameters.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/Parameters.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/Parameters.java	(revision 477)
@@ -0,0 +1,12 @@
+package schedframe;
+
+import java.util.HashMap;
+
+public class Parameters extends HashMap<String, Parameter>{
+
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 1L;
+	
+}
Index: DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/HostInterface.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/HostInterface.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/HostInterface.java	(revision 477)
@@ -0,0 +1,54 @@
+package schedframe.scheduling.plan;
+
+import schedframe.DescriptionContainer;
+
+
+public interface HostInterface<T> extends DescriptionContainer<T> {
+
+	/**
+	 * Returns the value of field 'frontendMachineParameters'.
+	 * 
+	 * @return the value of field 'FrontendMachineParameters'.
+	 */
+	public <ComputingResourcType> ComputingResourceTypeInterface<ComputingResourcType> getMachineParameters();
+
+	/**
+	 * Returns the value of field 'hostname'.
+	 * 
+	 * @return the value of field 'Hostname'.
+	 */
+	public java.lang.String getHostname();
+
+
+	/**
+	 * Returns the value of field 'queue'.
+	 * 
+	 * @return the value of field 'Queue'.
+	 */
+	public java.lang.String getQueue();
+
+	/**
+	 * Sets the value of field 'frontendMachineParameters'.
+	 * 
+	 * @param frontendMachineParameters the value of field
+	 * 'frontendMachineParameters'.
+	 */
+	public <ComputingResourceType> void setMachineParameters(
+			final ComputingResourceTypeInterface<ComputingResourceType> machineParameters);
+
+	/**
+	 * Sets the value of field 'hostname'.
+	 * 
+	 * @param hostname the value of field 'hostname'.
+	 */
+	public void setHostname(final java.lang.String hostname);
+
+
+	/**
+	 * Sets the value of field 'queue'.
+	 * 
+	 * @param queue the value of field 'queue'.
+	 */
+	public void setQueue(final java.lang.String queue);
+
+}
Index: DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/ComputingResourceTypeInterface.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/ComputingResourceTypeInterface.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/ComputingResourceTypeInterface.java	(revision 477)
@@ -0,0 +1,109 @@
+package schedframe.scheduling.plan;
+
+import schedframe.DescriptionContainer;
+
+
+
+public interface ComputingResourceTypeInterface <T> extends DescriptionContainer<T> {
+
+	/**
+	 * 
+	 * 
+	 * @param vComputingResourceTypeItem
+	 * @throws java.lang.IndexOutOfBoundsException if the index
+	 * given is outside the bounds of the collection
+	 */
+	public <ComputingResourceTypeItem> void addComputingResourceTypeItem(
+			final ComputingResourceTypeItemInterface<ComputingResourceTypeItem> vComputingResourceTypeItem)
+			throws java.lang.IndexOutOfBoundsException;
+
+	/**
+	 * 
+	 * 
+	 * @param index
+	 * @param vComputingResourceTypeItem
+	 * @throws java.lang.IndexOutOfBoundsException if the index
+	 * given is outside the bounds of the collection
+	 */
+	public <ComputingResourceTypeItem> void addComputingResourceTypeItem(
+			final int index,
+			final ComputingResourceTypeItemInterface<ComputingResourceTypeItem> vComputingResourceTypeItem)
+			throws java.lang.IndexOutOfBoundsException;
+
+	/**
+	 * Method getComputingResourceTypeItem.
+	 * 
+	 * @param index
+	 * @throws java.lang.IndexOutOfBoundsException if the index
+	 * given is outside the bounds of the collection
+	 * @return the value of the
+	 * schedframe.schedulingplan.impl.ComputingResourceTypeItem at
+	 * the given index
+	 */
+	public <ComputingResourceTypeItem> ComputingResourceTypeItemInterface<ComputingResourceTypeItem> 
+			getComputingResourceTypeItem(
+			final int index) throws java.lang.IndexOutOfBoundsException;
+
+	/**
+	 * Method getComputingResourceTypeItem.Returns the contents of
+	 * the collection in an Array.  <p>Note:  Just in case the
+	 * collection contents are changing in another thread, we pass
+	 * a 0-length Array of the correct type into the API call. 
+	 * This way we <i>know</i> that the Array returned is of
+	 * exactly the correct length.
+	 * 
+	 * @return this collection as an Array
+	 */
+	public <ComputingResourceTypeItem> ComputingResourceTypeItemInterface<ComputingResourceTypeItem>[] getComputingResourceTypeItem();
+
+	/**
+	 * Method getComputingResourceTypeItemCount.
+	 * 
+	 * @return the size of this collection
+	 */
+	public int getComputingResourceTypeItemCount();
+
+	/**
+	 */
+	public void removeAllComputingResourceTypeItem();
+
+	/**
+	 * Method removeComputingResourceTypeItem.
+	 * 
+	 * @param vComputingResourceTypeItem
+	 * @return true if the object was removed from the collection.
+	 */
+	public <ComputingResourceTypeItem> boolean removeComputingResourceTypeItem(
+			final ComputingResourceTypeItemInterface<ComputingResourceTypeItem> vComputingResourceTypeItem);
+
+	/**
+	 * Method removeComputingResourceTypeItemAt.
+	 * 
+	 * @param index
+	 * @return the element removed from the collection
+	 */
+	public <ComputingResourceTypeItem> ComputingResourceTypeItemInterface<ComputingResourceTypeItem> removeComputingResourceTypeItemAt(
+			final int index);
+
+	/**
+	 * 
+	 * 
+	 * @param index
+	 * @param vComputingResourceTypeItem
+	 * @throws java.lang.IndexOutOfBoundsException if the index
+	 * given is outside the bounds of the collection
+	 */
+	public <ComputingResourceTypeItem> void setComputingResourceTypeItem(
+			final int index,
+			final ComputingResourceTypeItemInterface<ComputingResourceTypeItem> vComputingResourceTypeItem)
+			throws java.lang.IndexOutOfBoundsException;
+
+	/**
+	 * 
+	 * 
+	 * @param vComputingResourceTypeItemArray
+	 */
+	public <ComputingResourceTypeItem> void setComputingResourceTypeItem(
+			final ComputingResourceTypeItemInterface<ComputingResourceTypeItem>[] vComputingResourceTypeItemArray);
+
+}
Index: DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/ScheduledTimeInterface.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/ScheduledTimeInterface.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/ScheduledTimeInterface.java	(revision 477)
@@ -0,0 +1,35 @@
+package schedframe.scheduling.plan;
+
+import schedframe.DescriptionContainer;
+
+public interface ScheduledTimeInterface<T> extends DescriptionContainer<T> {
+
+	/**
+	 * Returns the value of field 'end'.
+	 * 
+	 * @return the value of field 'End'.
+	 */
+	public java.util.Date getEnd();
+
+	/**
+	 * Returns the value of field 'start'.
+	 * 
+	 * @return the value of field 'Start'.
+	 */
+	public java.util.Date getStart();
+
+	/**
+	 * Sets the value of field 'end'.
+	 * 
+	 * @param end the value of field 'end'.
+	 */
+	public void setEnd(final java.util.Date end);
+
+	/**
+	 * Sets the value of field 'start'.
+	 * 
+	 * @param start the value of field 'start'.
+	 */
+	public void setStart(final java.util.Date start);
+
+}
Index: DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/ComputingResourceParameterTypeInterface.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/ComputingResourceParameterTypeInterface.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/ComputingResourceParameterTypeInterface.java	(revision 477)
@@ -0,0 +1,21 @@
+package schedframe.scheduling.plan;
+
+import org.qcg.broker.schemas.schedulingplan.types.ComputingParameterName;
+
+public interface ComputingResourceParameterTypeInterface<T> extends ParameterTypeInterface<T> {
+
+	/**
+	 * Returns the value of field 'name'.
+	 * 
+	 * @return the value of field 'Name'.
+	 */
+	public ComputingParameterName getName();
+
+	/**
+	 * Sets the value of field 'name'.
+	 * 
+	 * @param name the value of field 'name'.
+	 */
+	public void setName(final ComputingParameterName name);
+
+}
Index: DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/ParameterTypeInterface.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/ParameterTypeInterface.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/ParameterTypeInterface.java	(revision 477)
@@ -0,0 +1,197 @@
+package schedframe.scheduling.plan;
+
+import schedframe.DescriptionContainer;
+
+
+public interface ParameterTypeInterface<T> extends DescriptionContainer<T> {
+
+	/**
+	 * 
+	 * 
+	 * @param vParamValue
+	 * @throws java.lang.IndexOutOfBoundsException if the index
+	 * given is outside the bounds of the collection
+	 */
+	public void addParamValue(final java.lang.String vParamValue)
+			throws java.lang.IndexOutOfBoundsException;
+
+	/**
+	 * 
+	 * 
+	 * @param index
+	 * @param vParamValue
+	 * @throws java.lang.IndexOutOfBoundsException if the index
+	 * given is outside the bounds of the collection
+	 */
+	public void addParamValue(final int index,
+			final java.lang.String vParamValue)
+			throws java.lang.IndexOutOfBoundsException;
+
+	/**
+	 * 
+	 * 
+	 * @param vProperty
+	 * @throws java.lang.IndexOutOfBoundsException if the index
+	 * given is outside the bounds of the collection
+	 */
+	public <Property> void addProperty(
+			final ParameterPropertyInterface<Property> vProperty)
+			throws java.lang.IndexOutOfBoundsException;
+
+	/**
+	 * 
+	 * 
+	 * @param index
+	 * @param vProperty
+	 * @throws java.lang.IndexOutOfBoundsException if the index
+	 * given is outside the bounds of the collection
+	 */
+	public <Property> void addProperty(final int index,
+			final ParameterPropertyInterface<Property> vProperty)
+			throws java.lang.IndexOutOfBoundsException;
+
+
+	/**
+	 * Method getParamValue.
+	 * 
+	 * @param index
+	 * @throws java.lang.IndexOutOfBoundsException if the index
+	 * given is outside the bounds of the collection
+	 * @return the value of the java.lang.String at the given index
+	 */
+	public java.lang.String getParamValue(final int index)
+			throws java.lang.IndexOutOfBoundsException;
+
+	/**
+	 * Method getParamValue.Returns the contents of the collection
+	 * in an Array.  <p>Note:  Just in case the collection contents
+	 * are changing in another thread, we pass a 0-length Array of
+	 * the correct type into the API call.  This way we <i>know</i>
+	 * that the Array returned is of exactly the correct length.
+	 * 
+	 * @return this collection as an Array
+	 */
+	public java.lang.String[] getParamValue();
+
+	/**
+	 * Method getParamValueCount.
+	 * 
+	 * @return the size of this collection
+	 */
+	public int getParamValueCount();
+
+	/**
+	 * Method getProperty.
+	 * 
+	 * @param index
+	 * @throws java.lang.IndexOutOfBoundsException if the index
+	 * given is outside the bounds of the collection
+	 * @return the value of the
+	 * schedframe.schedulingplan.impl.Property at the given index
+	 */
+	public <Property> ParameterPropertyInterface<Property> getProperty(final int index)
+			throws java.lang.IndexOutOfBoundsException;
+
+	/**
+	 * Method getProperty.Returns the contents of the collection in
+	 * an Array.  <p>Note:  Just in case the collection contents
+	 * are changing in another thread, we pass a 0-length Array of
+	 * the correct type into the API call.  This way we <i>know</i>
+	 * that the Array returned is of exactly the correct length.
+	 * 
+	 * @return this collection as an Array
+	 */
+	public <Property> ParameterPropertyInterface<Property>[] getProperty();
+
+	/**
+	 * Method getPropertyCount.
+	 * 
+	 * @return the size of this collection
+	 */
+	public int getPropertyCount();
+
+
+	/**
+	 */
+	public void removeAllParamValue();
+
+	/**
+	 */
+	public void removeAllProperty();
+
+
+	/**
+	 * Method removeParamValue.
+	 * 
+	 * @param vParamValue
+	 * @return true if the object was removed from the collection.
+	 */
+	public boolean removeParamValue(final java.lang.String vParamValue);
+
+	/**
+	 * Method removeParamValueAt.
+	 * 
+	 * @param index
+	 * @return the element removed from the collection
+	 */
+	public java.lang.String removeParamValueAt(final int index);
+
+	/**
+	 * Method removeProperty.
+	 * 
+	 * @param vProperty
+	 * @return true if the object was removed from the collection.
+	 */
+	public <Property> boolean removeProperty(
+			final ParameterPropertyInterface<Property> vProperty);
+
+	/**
+	 * Method removePropertyAt.
+	 * 
+	 * @param index
+	 * @return the element removed from the collection
+	 */
+	public <Property> ParameterPropertyInterface<Property> removePropertyAt(
+			final int index);
+
+	/**
+	 * 
+	 * 
+	 * @param index
+	 * @param vParamValue
+	 * @throws java.lang.IndexOutOfBoundsException if the index
+	 * given is outside the bounds of the collection
+	 */
+	public void setParamValue(final int index,
+			final java.lang.String vParamValue)
+			throws java.lang.IndexOutOfBoundsException;
+
+	/**
+	 * 
+	 * 
+	 * @param vParamValueArray
+	 */
+	public void setParamValue(final java.lang.String[] vParamValueArray);
+
+	/**
+	 * 
+	 * 
+	 * @param index
+	 * @param vProperty
+	 * @throws java.lang.IndexOutOfBoundsException if the index
+	 * given is outside the bounds of the collection
+	 */
+	public <Property> void setProperty(final int index,
+			final ParameterPropertyInterface<Property> vProperty)
+			throws java.lang.IndexOutOfBoundsException;
+
+	/**
+	 * 
+	 * 
+	 * @param vPropertyArray
+	 */
+	public <Property> void setProperty(
+			final ParameterPropertyInterface<Property>[] vPropertyArray);
+
+
+}
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 477)
@@ -0,0 +1,196 @@
+package schedframe.scheduling.plan;
+
+import java.util.ArrayList;
+
+import schedframe.DescriptionContainer;
+import schedframe.scheduling.tasks.WorkloadUnit;
+
+public interface ScheduledTaskInterface<T> extends DescriptionContainer<T> {
+
+	/**
+	 * 
+	 * 
+	 * @param vAllocation
+	 * @throws java.lang.IndexOutOfBoundsException if the index
+	 * given is outside the bounds of the collection
+	 */
+	public <Allocation> void addAllocation(
+			final AllocationInterface<Allocation> vAllocation)
+			throws java.lang.IndexOutOfBoundsException;
+
+	/**
+	 * 
+	 * 
+	 * @param index
+	 * @param vAllocation
+	 * @throws java.lang.IndexOutOfBoundsException if the index
+	 * given is outside the bounds of the collection
+	 */
+	public <Allocation> void addAllocation(final int index,
+			final AllocationInterface<Allocation> vAllocation)
+			throws java.lang.IndexOutOfBoundsException;
+
+	/**
+	 */
+	public void deleteTopology();
+
+	/**
+	 * Method getAllocation.
+	 * 
+	 * @param index
+	 * @throws java.lang.IndexOutOfBoundsException if the index
+	 * given is outside the bounds of the collection
+	 * @return the value of the
+	 * schedframe.schedulingplan.impl.Allocation at the given index
+	 */
+	public <Allocation>AllocationInterface<Allocation> getAllocation(
+			final int index) throws java.lang.IndexOutOfBoundsException;
+
+	/**
+	 * Method getAllocation.Returns the contents of the collection
+	 * in an Array.  <p>Note:  Just in case the collection contents
+	 * are changing in another thread, we pass a 0-length Array of
+	 * the correct type into the API call.  This way we <i>know</i>
+	 * that the Array returned is of exactly the correct length.
+	 * 
+	 * @return this collection as an Array
+	 */
+	public <Allocation>AllocationInterface<Allocation>[] getAllocation();
+
+	/**
+	 * Method getAllocationCount.
+	 * 
+	 * @return the size of this collection
+	 */
+	public int getAllocationCount();
+
+	/**
+	 * Returns the value of field 'jobId'.
+	 * 
+	 * @return the value of field 'JobId'.
+	 */
+	public java.lang.String getJobId();
+
+	/**
+	 * Returns the value of field 'scheduledTime'.
+	 * 
+	 * @return the value of field 'ScheduledTime'.
+	 */
+	public <ScheduledTime>ScheduledTimeInterface<ScheduledTime> getScheduledTime();
+
+	/**
+	 * Returns the value of field 'status'.
+	 * 
+	 * @return the value of field 'Status'.
+	 */
+	public org.qcg.broker.schemas.schedulingplan.types.AllocationStatus getStatus();
+	
+	public String getStatusDescription();
+
+	/**
+	 * Returns the value of field 'taskId'.
+	 * 
+	 * @return the value of field 'TaskId'.
+	 */
+	public java.lang.String getTaskId();
+
+	/**
+	 * Returns the value of field 'topology'.
+	 * 
+	 * @return the value of field 'Topology'.
+	 */
+	public int getTopology();
+
+	/**
+	 * Method hasTopology.
+	 * 
+	 * @return true if at least one Topology has been added
+	 */
+	public boolean hasTopology();
+
+	/**
+	 */
+	public void removeAllAllocation();
+
+	/**
+	 * Method removeAllocation.
+	 * 
+	 * @param vAllocation
+	 * @return true if the object was removed from the collection.
+	 */
+	public <Allocation> boolean removeAllocation(
+			final AllocationInterface<Allocation> vAllocation);
+
+	/**
+	 * Method removeAllocationAt.
+	 * 
+	 * @param index
+	 * @return the element removed from the collection
+	 */
+	public <Allocation>AllocationInterface<Allocation> removeAllocationAt(final int index);
+
+	/**
+	 * 
+	 * 
+	 * @param index
+	 * @param vAllocation
+	 * @throws java.lang.IndexOutOfBoundsException if the index
+	 * given is outside the bounds of the collection
+	 */
+	public <Allocation> void setAllocation(final int index,
+			final AllocationInterface<Allocation> vAllocation)
+			throws java.lang.IndexOutOfBoundsException;
+
+	/**
+	 * 
+	 * 
+	 * @param vAllocationArray
+	 */
+	public <Allocation> void setAllocation(
+			final AllocationInterface<Allocation>[] vAllocationArray);
+
+	/**
+	 * Sets the value of field 'jobId'.
+	 * 
+	 * @param jobId the value of field 'jobId'.
+	 */
+	public void setJobId(final java.lang.String jobId);
+
+	/**
+	 * Sets the value of field 'scheduledTime'.
+	 * 
+	 * @param scheduledTime the value of field 'scheduledTime'.
+	 */
+	public <ScheduledTime> void setScheduledTime(
+			final ScheduledTimeInterface<ScheduledTime> scheduledTime);
+
+	/**
+	 * Sets the value of field 'status'.
+	 * 
+	 * @param status the value of field 'status'.
+	 */
+	public void setStatus(
+			final org.qcg.broker.schemas.schedulingplan.types.AllocationStatus status);
+	
+	public void setStatusDescription(String statusDescription);
+
+	/**
+	 * Sets the value of field 'taskID'.
+	 * 
+	 * @param taskId the value of field 'taskId'.
+	 */
+	public void setTaskId(final java.lang.String taskId);
+
+	/**
+	 * Sets the value of field 'topology'.
+	 * 
+	 * @param topology the value of field 'topology'.
+	 */
+	public void setTopology(final int topology);
+	
+
+	public ArrayList<AllocationInterface> getAllocations();
+	
+	public WorkloadUnit<?> getTask();
+
+}
Index: DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/OtherParameterTypeInterface.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/OtherParameterTypeInterface.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/OtherParameterTypeInterface.java	(revision 477)
@@ -0,0 +1,34 @@
+package schedframe.scheduling.plan;
+
+
+public interface OtherParameterTypeInterface<T> extends	ParameterTypeInterface<T> {
+
+	/**
+	 * Returns the value of field 'endpoint'.
+	 * 
+	 * @return the value of field 'Endpoint'.
+	 */
+	public java.lang.String getEndpoint();
+
+	/**
+	 * Returns the value of field 'name'.
+	 * 
+	 * @return the value of field 'Name'.
+	 */
+	public java.lang.String getName();
+
+	/**
+	 * Sets the value of field 'endpoint'.
+	 * 
+	 * @param endpoint the value of field 'endpoint'.
+	 */
+	public void setEndpoint(final java.lang.String endpoint);
+
+	/**
+	 * Sets the value of field 'name'.
+	 * 
+	 * @param name the value of field 'name'.
+	 */
+	public void setName(final java.lang.String name);
+
+}
Index: DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/PropertyInterface.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/PropertyInterface.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/PropertyInterface.java	(revision 477)
@@ -0,0 +1,17 @@
+package schedframe.scheduling.plan;
+
+
+import schedframe.DescriptionContainer;
+
+public interface PropertyInterface<T> extends DescriptionContainer<T> {
+
+		public java.lang.String getName();
+		
+		public java.lang.String getContent();
+
+	    public void setContent(
+	            final java.lang.String content);
+
+	    public void setName(final java.lang.String name);
+
+}
Index: DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/ParameterPropertyInterface.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/ParameterPropertyInterface.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/ParameterPropertyInterface.java	(revision 477)
@@ -0,0 +1,149 @@
+package schedframe.scheduling.plan;
+
+import schedframe.DescriptionContainer;
+
+
+public interface ParameterPropertyInterface<T> extends DescriptionContainer<T> {
+
+	/**
+	 * 
+	 * 
+	 * @param vValue
+	 * @throws java.lang.IndexOutOfBoundsException if the index
+	 * given is outside the bounds of the collection
+	 */
+	public void addValue(final java.lang.String vValue)
+			throws java.lang.IndexOutOfBoundsException;
+
+	/**
+	 * 
+	 * 
+	 * @param index
+	 * @param vValue
+	 * @throws java.lang.IndexOutOfBoundsException if the index
+	 * given is outside the bounds of the collection
+	 */
+	public void addValue(final int index, final java.lang.String vValue)
+			throws java.lang.IndexOutOfBoundsException;
+
+	/**
+	 */
+	public void deleteExclude();
+
+	/**
+	 * Returns the value of field 'exclude'.
+	 * 
+	 * @return the value of field 'Exclude'.
+	 */
+	public boolean getExclude();
+
+	/**
+	 * Returns the value of field 'name'.
+	 * 
+	 * @return the value of field 'Name'.
+	 */
+	public java.lang.String getName();
+
+	/**
+	 * Method getValue.
+	 * 
+	 * @param index
+	 * @throws java.lang.IndexOutOfBoundsException if the index
+	 * given is outside the bounds of the collection
+	 * @return the value of the java.lang.String at the given index
+	 */
+	public java.lang.String getValue(final int index)
+			throws java.lang.IndexOutOfBoundsException;
+
+	/**
+	 * Method getValue.Returns the contents of the collection in an
+	 * Array.  <p>Note:  Just in case the collection contents are
+	 * changing in another thread, we pass a 0-length Array of the
+	 * correct type into the API call.  This way we <i>know</i>
+	 * that the Array returned is of exactly the correct length.
+	 * 
+	 * @return this collection as an Array
+	 */
+	public java.lang.String[] getValue();
+
+	/**
+	 * Method getValueCount.
+	 * 
+	 * @return the size of this collection
+	 */
+	public int getValueCount();
+
+	/**
+	 * Method hasExclude.
+	 * 
+	 * @return true if at least one Exclude has been added
+	 */
+	public boolean hasExclude();
+
+	/**
+	 * Returns the value of field 'exclude'.
+	 * 
+	 * @return the value of field 'Exclude'.
+	 */
+	public boolean isExclude();
+
+	/**
+	 * Method isValid.
+	 * 
+	 * @return true if this object is valid according to the schema
+	 */
+	public boolean isValid();
+
+	/**
+	 */
+	public void removeAllValue();
+
+	/**
+	 * Method removeValue.
+	 * 
+	 * @param vValue
+	 * @return true if the object was removed from the collection.
+	 */
+	public boolean removeValue(final java.lang.String vValue);
+
+	/**
+	 * Method removeValueAt.
+	 * 
+	 * @param index
+	 * @return the element removed from the collection
+	 */
+	public java.lang.String removeValueAt(final int index);
+
+	/**
+	 * Sets the value of field 'exclude'.
+	 * 
+	 * @param exclude the value of field 'exclude'.
+	 */
+	public void setExclude(final boolean exclude);
+
+	/**
+	 * Sets the value of field 'name'.
+	 * 
+	 * @param name the value of field 'name'.
+	 */
+	public void setName(final java.lang.String name);
+
+	/**
+	 * 
+	 * 
+	 * @param index
+	 * @param vValue
+	 * @throws java.lang.IndexOutOfBoundsException if the index
+	 * given is outside the bounds of the collection
+	 */
+	public void setValue(final int index, final java.lang.String vValue)
+			throws java.lang.IndexOutOfBoundsException;
+
+	/**
+	 * 
+	 * 
+	 * @param vValueArray
+	 */
+	public void setValue(final java.lang.String[] vValueArray);
+
+}
Index: DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/AllocationInterface.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/AllocationInterface.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/AllocationInterface.java	(revision 477)
@@ -0,0 +1,122 @@
+package schedframe.scheduling.plan;
+
+import java.util.Map;
+
+import schedframe.DescriptionContainer;
+import schedframe.resources.units.ResourceUnit;
+import schedframe.resources.units.ResourceUnitName;
+
+
+public interface AllocationInterface<T> extends DescriptionContainer<T> {
+
+	/**
+	 */
+	public void deleteProcessQuantity();
+
+	/**
+	 * Returns the value of field 'additionalProperties'.
+	 * 
+	 * @return the value of field 'AdditionalProperties'.
+	 */
+	public <Properties> PropertiesTypeInterface<Properties> getAdditionalProperties();
+
+	/**
+	 * Returns the value of field 'host'. The field 'host' has the
+	 * following description: Submission host
+	 * 
+	 * @return the value of field 'Host'.
+	 */
+	public  HostInterface getHost();
+
+	/**
+	 * Returns the value of field 'processGroupId'.
+	 * 
+	 * @return the value of field 'ProcessGroupId'.
+	 */
+	public java.lang.String getProcessGroupId();
+
+	/**
+	 * Returns the value of field 'processQuantity'.
+	 * 
+	 * @return the value of field 'ProcessQuantity'.
+	 */
+	public int getProcessesCount();
+	
+	public <ProcessesMap_>ProcessesMapInterface<ProcessesMap_> getProcessesMap();
+
+	/**
+	 * Returns the value of field 'providerInfo'.
+	 * 
+	 * @return the value of field 'ProviderInfo'.
+	 */
+	public <ProviderInfo>ProviderInfoInterface<ProviderInfo> getProviderInfo();
+	
+	/**
+	 * Returns the value of field 'reservationId'. The field
+	 * 'reservationId' has the following description: Reservation
+	 * identifier in local system 
+	 * 
+	 * @return the value of field 'ReservationId'.
+	 */
+	public java.lang.String getReservationId();
+
+	/**
+	 * Method hasProcessQuantity.
+	 * 
+	 * @return true if at least one ProcessQuantity has been added
+	 */
+	public boolean hasProcessesCount();
+	
+	public boolean hasProcessesMap();
+
+	/**
+	 * Sets the value of field 'additionalProperties'.
+	 * 
+	 * @param additionalProperties the value of field
+	 * 'additionalProperties'.
+	 */
+	public <Properties> void setAdditionalProperties(
+			final PropertiesTypeInterface<Properties> additionalProperties);
+
+	/**
+	 * Sets the value of field 'host'. The field 'host' has the
+	 * following description: Submission host
+	 * 
+	 * @param host the value of field 'host'.
+	 */
+	public <Host> void setHost(final HostInterface<Host> host);
+
+	/**
+	 * Sets the value of field 'processGroupID'.
+	 * 
+	 * @param processGroupId the value of field 'processGroupId'.
+	 */
+	public void setProcessGroupId(final java.lang.String processGroupId);
+
+	/**
+	 * Sets the value of field 'processQuantity'.
+	 * 
+	 * @param processQuantity the value of field 'processQuantity'.
+	 */
+	public void setProcessesCount(final int processesCount);
+	
+	
+	public <ProcessesMap_> void setProcessesMap(ProcessesMapInterface<ProcessesMap_> processesMap);
+
+	/**
+	 * Sets the value of field 'providerInfo'.
+	 * 
+	 * @param providerInfo the value of field 'providerInfo'.
+	 */
+	public <ProviderInfo> void setProviderInfo(ProviderInfoInterface<ProviderInfo> providerInfo);
+	
+	public void setSpecificResources(Map<ResourceUnitName, ResourceUnit> choosenResources);
+	
+	public Map<ResourceUnitName, ResourceUnit> getRequestedResources();
+	
+	public void setProviderName(String providerName);
+	
+	public String getProviderName();
+	
+	public boolean isProcessing();
+}
Index: DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/PropertiesTypeInterface.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/PropertiesTypeInterface.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/PropertiesTypeInterface.java	(revision 477)
@@ -0,0 +1,122 @@
+package schedframe.scheduling.plan;
+
+
+import schedframe.DescriptionContainer;
+
+public interface PropertiesTypeInterface<T> extends DescriptionContainer<T> {
+
+
+   /**
+    * 
+    * 
+    * @param vProperty
+    * @throws java.lang.IndexOutOfBoundsException if the index
+    * given is outside the bounds of the collection
+    */
+   public <Property> void addProperty(
+           final PropertyInterface<Property> vProperty);
+
+   /**
+    * 
+    * 
+    * @param index
+    * @param vProperty
+    * @throws java.lang.IndexOutOfBoundsException if the index
+    * given is outside the bounds of the collection
+    */
+   public <Property> void addProperty(
+           final int index,
+           final PropertyInterface<Property> vProperty);
+
+   /**
+    * Method enumerateProperty.
+    * 
+    * @return an Enumeration over all possible elements of this
+    * collection
+    */
+   public <Property> java.util.Enumeration<PropertyInterface<Property>> enumerateProperty();
+
+   /**
+    * Method getProperty.
+    * 
+    * @param index
+    * @throws java.lang.IndexOutOfBoundsException if the index
+    * given is outside the bounds of the collection
+    * @return the value of the
+    * org.qcg.broker.schemas.schedulingplan.Property at the given index
+    */
+   public <Property> PropertyInterface<Property> getProperty(final int index)
+   throws java.lang.IndexOutOfBoundsException;
+   
+   /**
+    * Method getProperty.Returns the contents of the collection in
+    * an Array.  <p>Note:  Just in case the collection contents
+    * are changing in another thread, we pass a 0-length Array of
+    * the correct type into the API call.  This way we <i>know</i>
+    * that the Array returned is of exactly the correct length.
+    * 
+    * @return this collection as an Array
+    */
+   public <Property> PropertyInterface<Property>[] getProperty();
+
+   /**
+    * Method getPropertyCount.
+    * 
+    * @return the size of this collection
+    */
+   public int getPropertyCount();
+
+   /**
+    * Method iterateProperty.
+    * 
+    * @return an Iterator over all possible elements in this
+    * collection
+    */
+   public <Property> java.util.Iterator<PropertyInterface<Property>> iterateProperty();
+
+   /**
+    */
+   public void removeAllProperty();
+   
+   /**
+    * Method removeProperty.
+    * 
+    * @param vProperty
+    * @return true if the object was removed from the collection.
+    */
+   public <Property> boolean removeProperty(
+           final PropertyInterface<Property> vProperty);
+
+   /**
+    * Method removePropertyAt.
+    * 
+    * @param index
+    * @return the element removed from the collection
+    */
+   public <Property> PropertyInterface<Property> removePropertyAt(
+           final int index);
+
+   /**
+    * 
+    * 
+    * @param index
+    * @param vProperty
+    * @throws java.lang.IndexOutOfBoundsException if the index
+    * given is outside the bounds of the collection
+    */
+   public <Property> void setProperty(
+           final int index,
+           final PropertyInterface<Property> vProperty)
+   throws java.lang.IndexOutOfBoundsException;
+   
+   /**
+    * 
+    * 
+    * @param vPropertyArray
+    */
+   public <Property> void setProperty(
+           final PropertyInterface<Property>[] vPropertyArray);
+   
+
+
+}
Index: DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/ComputingResourceTypeItemInterface.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/ComputingResourceTypeItemInterface.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/ComputingResourceTypeItemInterface.java	(revision 477)
@@ -0,0 +1,48 @@
+package schedframe.scheduling.plan;
+
+import schedframe.DescriptionContainer;
+
+
+public interface ComputingResourceTypeItemInterface<T> extends DescriptionContainer<T> {
+
+	/**
+	 * Returns the value of field 'choiceValue'. The field
+	 * 'choiceValue' has the following description: Internal choice
+	 * value storage
+	 * 
+	 * @return the value of field 'ChoiceValue'.
+	 */
+	public java.lang.Object getChoiceValue();
+
+	/**
+	 * Returns the value of field 'hostParameter'.
+	 * 
+	 * @return the value of field 'HostParameter'.
+	 */
+	public <ComputingResourceParameterType> ComputingResourceParameterTypeInterface<ComputingResourceParameterType> getHostParameter();
+
+
+	/**
+	 * Returns the value of field 'otherParameter'.
+	 * 
+	 * @return the value of field 'OtherParameter'.
+	 */
+	public <OtherParameterType> OtherParameterTypeInterface<OtherParameterType> getOtherParameter();
+
+	/**
+	 * Sets the value of field 'hostParameter'.
+	 * 
+	 * @param hostParameter the value of field 'hostParameter'.
+	 */
+	public <ComputingResourceParameterType> void setHostParameter(
+			final ComputingResourceParameterTypeInterface<ComputingResourceParameterType> hostParameter);
+
+	/**
+	 * Sets the value of field 'otherParameter'.
+	 * 
+	 * @param otherParameter the value of field 'otherParameter'.
+	 */
+	public <OtherParameterType> void setOtherParameter(
+			final OtherParameterTypeInterface<OtherParameterType> otherParameter);
+
+}
Index: DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/impl/PropertiesType.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/impl/PropertiesType.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/impl/PropertiesType.java	(revision 477)
@@ -0,0 +1,116 @@
+package schedframe.scheduling.plan.impl;
+
+import java.io.StringWriter;
+import java.util.Enumeration;
+import java.util.Iterator;
+
+import org.exolab.castor.xml.MarshalException;
+import org.exolab.castor.xml.ValidationException;
+
+import schedframe.scheduling.plan.PropertiesTypeInterface;
+import schedframe.scheduling.plan.PropertyInterface;
+
+public class PropertiesType implements PropertiesTypeInterface<org.qcg.broker.schemas.schedulingplan.PropertiesType> {
+
+	protected org.qcg.broker.schemas.schedulingplan.PropertiesType pt;
+	
+	public PropertiesType(){
+		this.pt = new org.qcg.broker.schemas.schedulingplan.PropertiesType();
+	}
+	
+	public PropertiesType(org.qcg.broker.schemas.schedulingplan.PropertiesType value){
+		this.pt = value;
+	}
+	
+	public <Property_> void addProperty(PropertyInterface<Property_> property) {
+		this.pt.addProperty((org.qcg.broker.schemas.schedulingplan.Property)property.getDescription());
+	}
+
+	public <Property_> void addProperty(int index,
+			PropertyInterface<Property_> property) {
+		this.pt.addProperty(index, (org.qcg.broker.schemas.schedulingplan.Property) property.getDescription());
+	}
+
+	public <Property_> Enumeration<PropertyInterface<Property_>> enumerateProperty() {
+		throw new RuntimeException("Not implemented.");
+	}
+
+	@SuppressWarnings("unchecked")
+	public PropertyInterface<org.qcg.broker.schemas.schedulingplan.Property> getProperty(int index)
+			throws IndexOutOfBoundsException {
+		return new Property(this.pt.getProperty(index));
+	}
+
+	
+	@SuppressWarnings("unchecked")
+	public PropertyInterface<org.qcg.broker.schemas.schedulingplan.Property>[] getProperty() {
+		org.qcg.broker.schemas.schedulingplan.Property property[] = this.pt.getProperty();
+		if(property == null)
+			return null;
+		
+		Property ret[] = new Property[property.length];
+		for(int i = 0; i < property.length; i++){
+			ret[i] = new Property(property[i]);
+		}
+		
+		return ret;
+	}
+
+	public int getPropertyCount() {
+		return this.pt.getPropertyCount();
+	}
+
+	public <Property_> Iterator<PropertyInterface<Property_>> iterateProperty() {
+		throw new RuntimeException("Not implemented.");
+	}
+
+	public void removeAllProperty() {
+		this.pt.removeAllProperty();
+	}
+
+	public <Property_> boolean removeProperty(
+			PropertyInterface<Property_> property) {
+		return this.pt.removeProperty((org.qcg.broker.schemas.schedulingplan.Property)property.getDescription());
+	}
+
+	@SuppressWarnings("unchecked")
+	public PropertyInterface<org.qcg.broker.schemas.schedulingplan.Property> removePropertyAt(int index) {
+		return new Property(this.pt.removePropertyAt(index));
+	}
+
+	public <Property_> void setProperty(int index,
+			PropertyInterface<Property_> property)
+			throws IndexOutOfBoundsException {
+		this.pt.setProperty(index, (org.qcg.broker.schemas.schedulingplan.Property) property.getDescription());
+	}
+
+	public <Property_> void setProperty(
+			PropertyInterface<Property_>[] propertyArray) {
+		
+		org.qcg.broker.schemas.schedulingplan.Property tab[] = 
+				new org.qcg.broker.schemas.schedulingplan.Property[propertyArray.length];
+		
+		for(int i = 0; i < tab.length; i++){
+			tab[i] = (org.qcg.broker.schemas.schedulingplan.Property) propertyArray[i].getDescription();
+		}
+		
+		this.pt.setProperty(tab);
+	}
+
+	public org.qcg.broker.schemas.schedulingplan.PropertiesType getDescription() {
+		return this.pt;
+	}
+
+	public String getDocument() throws Exception {
+		StringWriter writer = new StringWriter();
+		try {
+			pt.marshal(writer);
+		} catch (MarshalException e) {
+			e.printStackTrace();
+		} catch (ValidationException e) {
+			e.printStackTrace();
+		}
+		return writer.toString();
+	}
+
+}
Index: DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/impl/ComputingResourceTypeItem.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/impl/ComputingResourceTypeItem.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/impl/ComputingResourceTypeItem.java	(revision 477)
@@ -0,0 +1,53 @@
+package schedframe.scheduling.plan.impl;
+
+import schedframe.scheduling.plan.ComputingResourceParameterTypeInterface;
+import schedframe.scheduling.plan.ComputingResourceTypeItemInterface;
+import schedframe.scheduling.plan.OtherParameterTypeInterface;
+
+public class ComputingResourceTypeItem 
+			implements ComputingResourceTypeItemInterface <org.qcg.broker.schemas.schedulingplan.ComputingResourceTypeItem> {
+
+	private static final long serialVersionUID = -8559307821866515716L;
+	protected org.qcg.broker.schemas.schedulingplan.ComputingResourceTypeItem ti;
+	
+	public ComputingResourceTypeItem(){
+		ti = new org.qcg.broker.schemas.schedulingplan.ComputingResourceTypeItem();
+	}
+	
+	public ComputingResourceTypeItem(org.qcg.broker.schemas.schedulingplan.ComputingResourceTypeItem value){
+		ti = value;
+	}
+	
+	public org.qcg.broker.schemas.schedulingplan.ComputingResourceTypeItem getDescription() {
+		return ti;
+	}
+
+	public String getDocument() {
+		return ""; 
+	}
+
+	public Object getChoiceValue() {
+		return ti.getChoiceValue();
+	}
+
+	@SuppressWarnings("unchecked")
+	public ComputingResourceParameterTypeInterface<org.qcg.broker.schemas.schedulingplan.ComputingResourceParameterType> getHostParameter() {
+		return new schedframe.scheduling.plan.impl.ComputingResourceParameterType(ti.getHostParameter());
+	}
+
+	@SuppressWarnings("unchecked")
+	public OtherParameterTypeInterface<org.qcg.broker.schemas.schedulingplan.OtherParameterType> getOtherParameter() {
+		return new schedframe.scheduling.plan.impl.OtherParameterType(ti.getOtherParameter());
+	}
+
+	public <ComputingResourceParameterType_> void setHostParameter(
+			ComputingResourceParameterTypeInterface<ComputingResourceParameterType_> hostParameter) {
+		ti.setHostParameter((org.qcg.broker.schemas.schedulingplan.ComputingResourceParameterType) hostParameter.getDescription());
+	}
+
+	public <OtherParameterType_> void setOtherParameter(
+			OtherParameterTypeInterface<OtherParameterType_> otherParameter) {
+		ti.setOtherParameter((org.qcg.broker.schemas.schedulingplan.OtherParameterType) otherParameter.getDescription());
+	}
+
+}
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 477)
@@ -0,0 +1,116 @@
+package schedframe.scheduling.plan.impl;
+
+import java.io.StringWriter;
+import java.util.ArrayList;
+
+import org.exolab.castor.xml.MarshalException;
+import org.exolab.castor.xml.ValidationException;
+
+import schedframe.scheduling.plan.ScheduledTaskInterface;
+import schedframe.scheduling.plan.SchedulingPlanInterface;
+
+
+public class SchedulingPlan implements SchedulingPlanInterface<org.qcg.broker.schemas.schedulingplan.SchedulingPlan> {
+
+	private static final long serialVersionUID = 2557774150841711876L;
+	protected org.qcg.broker.schemas.schedulingplan.SchedulingPlan sp;
+	
+	public SchedulingPlan(){
+		sp = new org.qcg.broker.schemas.schedulingplan.SchedulingPlan();
+		taskList = new ArrayList<ScheduledTaskInterface>();
+	}
+	
+	public SchedulingPlan(org.qcg.broker.schemas.schedulingplan.SchedulingPlan value){
+		sp = value;
+		taskList = new ArrayList<ScheduledTaskInterface>();
+	}
+	
+	public org.qcg.broker.schemas.schedulingplan.SchedulingPlan getDescription() {
+		return sp;
+	}
+
+	public String getDocument() {
+		StringWriter writer = new StringWriter();
+		try {
+			sp.marshal(writer);
+		} catch (MarshalException e) {
+			e.printStackTrace();
+		} catch (ValidationException e) {
+			e.printStackTrace();
+		}
+		return writer.toString();
+	}
+
+	public <Task_> void addTask(ScheduledTaskInterface<Task_> task)
+			throws IndexOutOfBoundsException {
+		sp.addTask((org.qcg.broker.schemas.schedulingplan.Task) task.getDescription());
+		taskList.add(task);
+	}
+
+	public <Task_> void addTask(int index, ScheduledTaskInterface<Task_> task)
+			throws IndexOutOfBoundsException {
+		sp.addTask(index, (org.qcg.broker.schemas.schedulingplan.Task) task.getDescription());
+		taskList.add(index, task);
+	}
+
+	@SuppressWarnings("unchecked")
+	public ScheduledTaskInterface<org.qcg.broker.schemas.schedulingplan.Task> getTask(int index)
+			throws IndexOutOfBoundsException {
+		return new ScheduledTask(sp.getTask(index));
+	}
+
+	@SuppressWarnings("unchecked")
+	public ScheduledTaskInterface<org.qcg.broker.schemas.schedulingplan.Task>[] getTask() {
+		org.qcg.broker.schemas.schedulingplan.Task tab[] = sp.getTask();
+		if(tab == null) return null;
+		
+		ScheduledTask ret[] = new ScheduledTask[tab.length];
+		for(int i = 0; i < tab.length; i++){
+			ret[i] = new ScheduledTask(tab[i]);
+		}
+		
+		return ret;
+	}
+
+	public int getTaskCount() {
+		return sp.getTaskCount();
+	}
+
+	public void removeAllTask() {
+		sp.removeAllTask();
+	}
+
+	public <Task_> boolean removeTask(ScheduledTaskInterface<Task_> task) {
+		return sp.removeTask((org.qcg.broker.schemas.schedulingplan.Task) task.getDescription());
+	}
+
+	@SuppressWarnings("unchecked")
+	public ScheduledTaskInterface<org.qcg.broker.schemas.schedulingplan.Task> removeTaskAt(int index) {
+		return new ScheduledTask(sp.removeTaskAt(index));
+	}
+
+	public <Task_> void setTask(int index, ScheduledTaskInterface<Task_> task)
+			throws IndexOutOfBoundsException {
+		sp.setTask(index, (org.qcg.broker.schemas.schedulingplan.Task) task.getDescription());
+	}
+
+	public <Task_> void setTask(ScheduledTaskInterface<Task_>[] taskArray) {
+		if(taskArray == null) return;
+		
+		org.qcg.broker.schemas.schedulingplan.Task tab[] = new org.qcg.broker.schemas.schedulingplan.Task[taskArray.length];
+		for(int i = 0; i < taskArray.length; i++){
+			tab[i] = (org.qcg.broker.schemas.schedulingplan.Task)taskArray[i].getDescription();
+		}
+		sp.setTask(tab);
+	}
+
+	
+	protected ArrayList<ScheduledTaskInterface> taskList;
+
+	public ArrayList<ScheduledTaskInterface> getTasks() {
+
+		return this.taskList;
+	}
+
+
+}
Index: DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/impl/ProcessesMap.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/impl/ProcessesMap.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/impl/ProcessesMap.java	(revision 477)
@@ -0,0 +1,60 @@
+package schedframe.scheduling.plan.impl;
+
+import java.io.StringWriter;
+
+import org.exolab.castor.xml.MarshalException;
+import org.exolab.castor.xml.ValidationException;
+
+import schedframe.scheduling.plan.ProcessesMapInterface;
+
+public class ProcessesMap implements ProcessesMapInterface<org.qcg.broker.schemas.schedulingplan.ProcessesMap> {
+
+	private org.qcg.broker.schemas.schedulingplan.ProcessesMap pm;
+	
+	public ProcessesMap(){
+		this.pm = new org.qcg.broker.schemas.schedulingplan.ProcessesMap();
+	}
+	
+	public ProcessesMap(org.qcg.broker.schemas.schedulingplan.ProcessesMap map){
+		this.pm = map;
+	}
+	
+	@Override
+	public int[] getProcessesPerNode() {
+		return pm.getProcessesPerNode();
+	}
+
+	@Override
+	public int getSlotsPerNode() {
+		return pm.getSlotsPerNode();
+	}
+
+	@Override
+	public void setProcessesPerNode(int[] arg) {
+		this.pm.setProcessesPerNode(arg);
+	}
+
+	@Override
+	public void setSlotsPerNode(int arg) {
+		this.pm.setSlotsPerNode(arg);
+	}
+
+	@Override
+	public org.qcg.broker.schemas.schedulingplan.ProcessesMap getDescription() {
+		return this.pm;
+	}
+
+	@Override
+	public String getDocument() throws Exception {
+		StringWriter sw = new StringWriter();
+		try {
+			pm.marshal(sw);
+		} catch (MarshalException e) {
+			e.printStackTrace();
+		} catch (ValidationException e) {
+			e.printStackTrace();
+		}
+		return sw.toString();
+	}
+
+}
Index: DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/impl/ProviderInfo.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/impl/ProviderInfo.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/impl/ProviderInfo.java	(revision 477)
@@ -0,0 +1,81 @@
+package schedframe.scheduling.plan.impl;
+
+import org.qcg.broker.schemas.schedulingplan.types.InterfaceType;
+
+import java.io.StringWriter;
+
+import org.exolab.castor.xml.MarshalException;
+import org.exolab.castor.xml.ValidationException;
+
+import schedframe.scheduling.plan.PropertiesTypeInterface;
+import schedframe.scheduling.plan.ProviderInfoInterface;
+
+
+public class ProviderInfo implements ProviderInfoInterface<org.qcg.broker.schemas.schedulingplan.ProviderInfo> {
+
+	private static final long serialVersionUID = -1629036434099074699L;
+	private org.qcg.broker.schemas.schedulingplan.ProviderInfo pi;
+	
+	public ProviderInfo(){
+		pi = new org.qcg.broker.schemas.schedulingplan.ProviderInfo();
+	}
+	
+	public ProviderInfo(org.qcg.broker.schemas.schedulingplan.ProviderInfo info){
+		this.pi = info;
+	}
+
+	public org.qcg.broker.schemas.schedulingplan.ProviderInfo getDescription() {
+		pi.getAdditionalProperties();
+		return pi;
+	}
+	
+	public String getDocument() {
+		StringWriter writer = new StringWriter();
+		try {
+			pi.marshal(writer);
+		} catch (MarshalException e) {
+			e.printStackTrace();
+		} catch (ValidationException e) {
+			e.printStackTrace();
+		}
+		return writer.toString();
+	}
+
+	public String getLocation() {
+		return pi.getLocation();
+	}
+
+	public String getProxyName() {
+		return pi.getProxyName();
+	}
+
+	public InterfaceType getType() {
+		return pi.getType();
+	}
+
+	public void setLocation(String location) {
+		pi.setLocation(location);
+	}
+
+	public void setProxyName(String proxyName) {
+		pi.setProxyName(proxyName);
+	}
+
+	public void setType(InterfaceType type) {
+		pi.setType(type);
+	}
+
+	@SuppressWarnings("unchecked")
+	public PropertiesTypeInterface<org.qcg.broker.schemas.schedulingplan.PropertiesType> getAdditionalProperties() {
+		org.qcg.broker.schemas.schedulingplan.PropertiesType properties = this.pi.getAdditionalProperties();
+		PropertiesType ret = new PropertiesType(properties);
+		return ret;
+	}
+
+	public <Properties_> void setAdditionalProperties(
+			PropertiesTypeInterface<Properties_> additionalProperties) {
+		this.pi.setAdditionalProperties(
+					(org.qcg.broker.schemas.schedulingplan.PropertiesType) additionalProperties.getDescription());
+	}
+
+}
Index: DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/impl/Host.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/impl/Host.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/impl/Host.java	(revision 477)
@@ -0,0 +1,71 @@
+package schedframe.scheduling.plan.impl;
+
+import java.io.StringWriter;
+
+import org.exolab.castor.xml.MarshalException;
+import org.exolab.castor.xml.ValidationException;
+
+import schedframe.scheduling.plan.ComputingResourceTypeInterface;
+import schedframe.scheduling.plan.HostInterface;
+
+public class Host implements HostInterface<org.qcg.broker.schemas.schedulingplan.Host> {
+
+	private static final long serialVersionUID = -5534266040248107980L;
+	protected org.qcg.broker.schemas.schedulingplan.Host host;
+	
+	public Host(){
+		host = new org.qcg.broker.schemas.schedulingplan.Host();
+	}
+	
+	public Host(org.qcg.broker.schemas.schedulingplan.Host value){
+		host = value;
+	}
+	
+	public org.qcg.broker.schemas.schedulingplan.Host getDescription() {
+		return host;
+	}
+
+	public String getDocument() {
+		StringWriter writer = new StringWriter();
+		try {
+			host.marshal(writer);
+		} catch (MarshalException e) {
+			e.printStackTrace();
+		} catch (ValidationException e) {
+			e.printStackTrace();
+		}
+		return writer.toString();
+	}
+
+	@SuppressWarnings("unchecked")
+	public ComputingResourceTypeInterface<org.qcg.broker.schemas.schedulingplan.ComputingResourceType> getMachineParameters() {
+		org.qcg.broker.schemas.schedulingplan.ComputingResourceType crt = host.getMachineParameters();
+		if(crt == null)
+			return null;
+		else
+			return new ComputingResourceType(crt);
+	}
+
+	public String getHostname() {
+		return host.getHostname();
+	}
+
+
+	public String getQueue() {
+		return host.getQueue();
+	}
+
+	public <ComputingResourceType_> void setMachineParameters(
+			ComputingResourceTypeInterface<ComputingResourceType_> machineParameters) {
+		host.setMachineParameters((org.qcg.broker.schemas.schedulingplan.ComputingResourceType) machineParameters.getDescription());
+	}
+
+	public void setHostname(String hostname) {
+		host.setHostname(hostname);
+	}
+
+	public void setQueue(String queue) {
+		host.setQueue(queue);
+	}
+
+}
Index: DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/impl/ComputingResourceType.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/impl/ComputingResourceType.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/impl/ComputingResourceType.java	(revision 477)
@@ -0,0 +1,113 @@
+package schedframe.scheduling.plan.impl;
+
+import java.io.StringWriter;
+
+import org.exolab.castor.xml.MarshalException;
+import org.exolab.castor.xml.ValidationException;
+
+import schedframe.scheduling.plan.ComputingResourceTypeInterface;
+import schedframe.scheduling.plan.ComputingResourceTypeItemInterface;
+
+public class ComputingResourceType implements ComputingResourceTypeInterface <
+									        org.qcg.broker.schemas.schedulingplan.ComputingResourceType> {
+
+	private static final long serialVersionUID = 5254980770479844861L;
+	protected org.qcg.broker.schemas.schedulingplan.ComputingResourceType rt;
+	
+	public ComputingResourceType(){
+		rt = new org.qcg.broker.schemas.schedulingplan.ComputingResourceType();
+	}
+	
+	public ComputingResourceType(org.qcg.broker.schemas.schedulingplan.ComputingResourceType value){
+		rt = value;
+	}
+	
+	public org.qcg.broker.schemas.schedulingplan.ComputingResourceType getDescription() {
+		return rt;
+	}
+
+	public String getDocument() {
+		StringWriter writer = new StringWriter();
+		try {
+			rt.marshal(writer);
+		} catch (MarshalException e) {
+			e.printStackTrace();
+		} catch (ValidationException e) {
+			e.printStackTrace();
+		}
+		return writer.toString();
+	}
+
+	public <ComputingResourceTypeItem_> void addComputingResourceTypeItem(
+			ComputingResourceTypeItemInterface<ComputingResourceTypeItem_> computingResourceTypeItem)
+			throws IndexOutOfBoundsException {
+		rt.addComputingResourceTypeItem((org.qcg.broker.schemas.schedulingplan.ComputingResourceTypeItem)computingResourceTypeItem.getDescription());
+	}
+
+	public <ComputingResourceTypeItem_> void addComputingResourceTypeItem(
+			int index,
+			ComputingResourceTypeItemInterface<ComputingResourceTypeItem_> computingResourceTypeItem)
+			throws IndexOutOfBoundsException {
+		rt.addComputingResourceTypeItem(index, (org.qcg.broker.schemas.schedulingplan.ComputingResourceTypeItem)computingResourceTypeItem.getDescription());
+	}
+
+	@SuppressWarnings("unchecked")
+	public ComputingResourceTypeItemInterface<org.qcg.broker.schemas.schedulingplan.ComputingResourceTypeItem> getComputingResourceTypeItem(
+			int index) throws IndexOutOfBoundsException {
+		return new ComputingResourceTypeItem(rt.getComputingResourceTypeItem(index));
+	}
+
+	@SuppressWarnings("unchecked")
+	public ComputingResourceTypeItemInterface<org.qcg.broker.schemas.schedulingplan.ComputingResourceTypeItem>[] getComputingResourceTypeItem() {
+		org.qcg.broker.schemas.schedulingplan.ComputingResourceTypeItem items[] = rt.getComputingResourceTypeItem();
+		if(items == null) return null;
+		
+		ComputingResourceTypeItem ret[] = new ComputingResourceTypeItem[items.length];
+		for(int i = 0; i < items.length; i++){
+			ret[i] = new ComputingResourceTypeItem(items[i]);
+		}
+		
+		return ret;
+	}
+
+	public int getComputingResourceTypeItemCount() {
+		return rt.getComputingResourceTypeItemCount();
+	}
+
+	public void removeAllComputingResourceTypeItem() {
+		rt.removeAllComputingResourceTypeItem();
+	}
+
+	public <ComputingResourceTypeItem_> boolean removeComputingResourceTypeItem(
+			ComputingResourceTypeItemInterface<ComputingResourceTypeItem_> computingResourceTypeItem) {
+		return rt.removeComputingResourceTypeItem((org.qcg.broker.schemas.schedulingplan.ComputingResourceTypeItem)computingResourceTypeItem.getDescription());
+	}
+
+	@SuppressWarnings("unchecked")
+	public ComputingResourceTypeItemInterface<org.qcg.broker.schemas.schedulingplan.ComputingResourceTypeItem> removeComputingResourceTypeItemAt(
+			int index) {
+		return new ComputingResourceTypeItem(rt.removeComputingResourceTypeItemAt(index));
+	}
+
+	public <ComputingResourceTypeItem_> void setComputingResourceTypeItem(
+			int index,
+			ComputingResourceTypeItemInterface<ComputingResourceTypeItem_> computingResourceTypeItem)
+			throws IndexOutOfBoundsException {
+		rt.setComputingResourceTypeItem(index, (org.qcg.broker.schemas.schedulingplan.ComputingResourceTypeItem) computingResourceTypeItem.getDescription());
+	}
+
+	public <ComputingResourceTypeItem_> void setComputingResourceTypeItem(
+			ComputingResourceTypeItemInterface<ComputingResourceTypeItem_>[] computingResourceTypeItemArray) {
+		if(computingResourceTypeItemArray == null) return;
+		
+		org.qcg.broker.schemas.schedulingplan.ComputingResourceTypeItem tab[] = 
+			new org.qcg.broker.schemas.schedulingplan.ComputingResourceTypeItem[computingResourceTypeItemArray.length];
+		
+		for(int i = 0; i < computingResourceTypeItemArray.length; i++){
+			tab[i] = (org.qcg.broker.schemas.schedulingplan.ComputingResourceTypeItem) computingResourceTypeItemArray[i].getDescription();
+		}
+		
+		rt.setComputingResourceTypeItem(tab);
+	}
+
+}
Index: DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/impl/ScheduledTime.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/impl/ScheduledTime.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/impl/ScheduledTime.java	(revision 477)
@@ -0,0 +1,57 @@
+package schedframe.scheduling.plan.impl;
+
+import java.io.StringWriter;
+import java.util.Date;
+
+import org.exolab.castor.xml.MarshalException;
+import org.exolab.castor.xml.ValidationException;
+
+import schedframe.scheduling.plan.ScheduledTimeInterface;
+
+
+public class ScheduledTime implements ScheduledTimeInterface<org.qcg.broker.schemas.schedulingplan.ScheduledTime>{
+
+	private static final long serialVersionUID = 8546333273529232717L;
+	private org.qcg.broker.schemas.schedulingplan.ScheduledTime st;
+	
+	public ScheduledTime(){
+		st = new org.qcg.broker.schemas.schedulingplan.ScheduledTime();
+	}
+	
+	public ScheduledTime(org.qcg.broker.schemas.schedulingplan.ScheduledTime st){
+		this.st = st;
+	}
+	
+	public org.qcg.broker.schemas.schedulingplan.ScheduledTime getDescription() {
+		return st;
+	}
+
+	public String getDocument() {
+		StringWriter writer = new StringWriter();
+		try {
+			st.marshal(writer);
+		} catch (MarshalException e) {
+			e.printStackTrace();
+		} catch (ValidationException e) {
+			e.printStackTrace();
+		}
+		return writer.toString();
+	}
+
+	public Date getEnd() {
+		return st.getEnd();
+	}
+
+	public Date getStart() {
+		return st.getStart();
+	}
+
+	public void setEnd(Date end) {
+		st.setEnd(end);
+	}
+
+	public void setStart(Date start) {
+		st.setStart(start);
+	}
+
+}
Index: DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/impl/ComputingResourceParameterType.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/impl/ComputingResourceParameterType.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/impl/ComputingResourceParameterType.java	(revision 477)
@@ -0,0 +1,162 @@
+package schedframe.scheduling.plan.impl;
+
+import java.io.StringWriter;
+
+import org.exolab.castor.xml.MarshalException;
+import org.exolab.castor.xml.ValidationException;
+
+import schedframe.scheduling.plan.ComputingResourceParameterTypeInterface;
+import schedframe.scheduling.plan.ParameterPropertyInterface;
+import org.qcg.broker.schemas.schedulingplan.types.ComputingParameterName;
+
+public class ComputingResourceParameterType implements ComputingResourceParameterTypeInterface<
+							org.qcg.broker.schemas.schedulingplan.ComputingResourceParameterType> {
+
+	private static final long serialVersionUID = 7369276462976219345L;
+	protected org.qcg.broker.schemas.schedulingplan.ComputingResourceParameterType pt;
+	
+	public ComputingResourceParameterType(){
+		pt = new org.qcg.broker.schemas.schedulingplan.ComputingResourceParameterType();
+	}
+	
+	public ComputingResourceParameterType(org.qcg.broker.schemas.schedulingplan.ComputingResourceParameterType value){
+		pt = value;
+	}
+	
+	
+	public  org.qcg.broker.schemas.schedulingplan.ComputingResourceParameterType getDescription() {
+		return pt;
+	}
+
+	public String getDocument() {
+		StringWriter writer = new StringWriter();
+		try {
+			pt.marshal(writer);
+		} catch (MarshalException e) {
+			e.printStackTrace();
+		} catch (ValidationException e) {
+			e.printStackTrace();
+		}
+		return writer.toString();
+	}
+
+	public ComputingParameterName getName() {
+		return pt.getName();
+	}
+
+	public void setName(ComputingParameterName name) {
+		pt.setName(name);
+	}
+
+	public void addParamValue(String paramValue)
+			throws IndexOutOfBoundsException {
+		pt.addParamValue(paramValue);
+	}
+
+	public void addParamValue(int index, String paramValue)
+			throws IndexOutOfBoundsException {
+		pt.addParamValue(index, paramValue);
+	}
+
+	public <Property_> void addProperty(ParameterPropertyInterface<Property_> property)
+			throws IndexOutOfBoundsException {
+		pt.addParameterProperty((org.qcg.broker.schemas.schedulingplan.ParameterProperty)property.getDescription());
+	}
+
+	public <Property_> void addProperty(int index, ParameterPropertyInterface<Property_> property)
+			throws IndexOutOfBoundsException {
+		pt.addParameterProperty(index, (org.qcg.broker.schemas.schedulingplan.ParameterProperty) property.getDescription());
+	}
+
+
+	public String getParamValue(int index) throws IndexOutOfBoundsException {
+		return pt.getParamValue(index);
+	}
+
+	public String[] getParamValue() {
+		return pt.getParamValue();
+	}
+
+	public int getParamValueCount() {
+		return pt.getParamValueCount();
+	}
+
+	@SuppressWarnings("unchecked")
+	public ParameterPropertyInterface<org.qcg.broker.schemas.schedulingplan.ParameterProperty> getProperty(int index)
+			throws IndexOutOfBoundsException {
+		return new schedframe.scheduling.plan.impl.ParameterProperty(pt
+				.getParameterProperty(index));
+	}
+
+	@SuppressWarnings("unchecked")
+	public ParameterPropertyInterface<org.qcg.broker.schemas.schedulingplan.ParameterProperty>[] getProperty() {
+		org.qcg.broker.schemas.schedulingplan.ParameterProperty tab[] = pt.getParameterProperty();
+		if (tab == null)
+			return null;
+
+		schedframe.scheduling.plan.impl.ParameterProperty ret[] = new schedframe.scheduling.plan.impl.ParameterProperty[tab.length];
+		for (int i = 0; i < tab.length; i++) {
+			ret[i] = new schedframe.scheduling.plan.impl.ParameterProperty(tab[i]);
+		}
+
+		return ret;
+	}
+
+	public int getPropertyCount() {
+		return pt.getParameterPropertyCount();
+	}
+
+
+	public void removeAllParamValue() {
+		pt.removeAllParamValue();
+	}
+
+	public void removeAllProperty() {
+		pt.removeAllParameterProperty();
+	}
+
+
+	public boolean removeParamValue(String paramValue) {
+		return pt.removeParamValue(paramValue);
+	}
+
+	public String removeParamValueAt(int index) {
+		return pt.removeParamValueAt(index);
+	}
+
+	public <Property_> boolean removeProperty(ParameterPropertyInterface<Property_> property) {
+		return pt.removeParameterProperty((org.qcg.broker.schemas.schedulingplan.ParameterProperty) property.getDescription());
+	}
+
+	@SuppressWarnings("unchecked")
+	public ParameterPropertyInterface<org.qcg.broker.schemas.schedulingplan.ParameterProperty> removePropertyAt(int index) {
+		return new schedframe.scheduling.plan.impl.ParameterProperty(pt
+				.removeParameterPropertyAt(index));
+	}
+
+
+	public void setParamValue(int index, String paramValue)
+			throws IndexOutOfBoundsException {
+		pt.setParamValue(index, paramValue);
+	}
+
+	public void setParamValue(String[] paramValueArray) {
+		pt.setParamValue(paramValueArray);
+	}
+
+	public <Property_> void setProperty(int index, ParameterPropertyInterface<Property_> property)
+			throws IndexOutOfBoundsException {
+		pt.setParameterProperty(index, (org.qcg.broker.schemas.schedulingplan.ParameterProperty)property.getDescription());
+	}
+
+	public <Property_> void setProperty(ParameterPropertyInterface<Property_>[] propertyArray) {
+		if (propertyArray == null)
+			return;
+		org.qcg.broker.schemas.schedulingplan.ParameterProperty tab[] = new org.qcg.broker.schemas.schedulingplan.ParameterProperty[propertyArray.length];
+		for (int i = 0; i < propertyArray.length; i++) {
+			tab[i] = (org.qcg.broker.schemas.schedulingplan.ParameterProperty)propertyArray[i].getDescription();
+		}
+		pt.setParameterProperty(tab);
+	}
+
+}
Index: DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/impl/ParameterType.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/impl/ParameterType.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/impl/ParameterType.java	(revision 477)
@@ -0,0 +1,145 @@
+package schedframe.scheduling.plan.impl;
+
+import java.io.StringWriter;
+
+import org.exolab.castor.xml.MarshalException;
+import org.exolab.castor.xml.ValidationException;
+
+import schedframe.scheduling.plan.ParameterTypeInterface;
+import schedframe.scheduling.plan.ParameterPropertyInterface;
+
+public class ParameterType implements ParameterTypeInterface<
+								org.qcg.broker.schemas.schedulingplan.ParameterType>{
+
+	private static final long serialVersionUID = 3808756887675318177L;
+	protected org.qcg.broker.schemas.schedulingplan.ParameterType pt;
+	
+	public ParameterType(){
+		pt = new org.qcg.broker.schemas.schedulingplan.ParameterType();
+	}
+
+	public ParameterType(org.qcg.broker.schemas.schedulingplan.ParameterType value){
+		pt = value;
+	}
+	
+	public org.qcg.broker.schemas.schedulingplan.ParameterType getDescription() {
+		return pt;
+	}
+
+	public String getDocument() {
+		StringWriter writer = new StringWriter();
+		try {
+			pt.marshal(writer);
+		} catch (MarshalException e) {
+			e.printStackTrace();
+		} catch (ValidationException e) {
+			e.printStackTrace();
+		}
+		return writer.toString();
+	}
+
+	public void addParamValue(String paramValue)
+			throws IndexOutOfBoundsException {
+		pt.addParamValue(paramValue);
+	}
+
+	public void addParamValue(int index, String paramValue)
+			throws IndexOutOfBoundsException {
+		pt.addParamValue(index, paramValue);
+	}
+
+	public <Property_> void addProperty(ParameterPropertyInterface<Property_> property)
+			throws IndexOutOfBoundsException {
+		pt.addParameterProperty((org.qcg.broker.schemas.schedulingplan.ParameterProperty)property.getDescription());
+	}
+
+	public <Property_> void addProperty(int index, ParameterPropertyInterface<Property_> property)
+			throws IndexOutOfBoundsException {
+		pt.addParameterProperty(index,(org.qcg.broker.schemas.schedulingplan.ParameterProperty) property.getDescription());
+	}
+
+	public String getParamValue(int index) throws IndexOutOfBoundsException {
+		return pt.getParamValue(index);
+	}
+
+	public String[] getParamValue() {
+		return pt.getParamValue();
+	}
+
+	public int getParamValueCount() {
+		return pt.getParamValueCount();
+	}
+
+	@SuppressWarnings("unchecked")
+	public ParameterPropertyInterface<org.qcg.broker.schemas.schedulingplan.ParameterProperty> getProperty(int index)
+			throws IndexOutOfBoundsException {
+		return new schedframe.scheduling.plan.impl.ParameterProperty(pt.getParameterProperty(index));
+	}
+
+	@SuppressWarnings("unchecked")
+	public ParameterPropertyInterface<org.qcg.broker.schemas.schedulingplan.ParameterProperty>[] getProperty() {
+		org.qcg.broker.schemas.schedulingplan.ParameterProperty tab[] = pt.getParameterProperty();
+		if(tab == null) return null;
+		
+		schedframe.scheduling.plan.impl.ParameterProperty ret[] = new schedframe.scheduling.plan.impl.ParameterProperty[tab.length];
+		for(int i = 0; i < tab.length; i++){
+			ret[i] = new schedframe.scheduling.plan.impl.ParameterProperty(tab[i]);
+		}
+		
+		return ret;
+	}
+
+	public int getPropertyCount() {
+		return pt.getParameterPropertyCount();
+	}
+
+	public void removeAllParamValue() {
+		pt.removeAllParamValue();
+	}
+
+	public void removeAllProperty() {
+		pt.removeAllParameterProperty();
+	}
+
+	public boolean removeParamValue(String paramValue) {
+		return pt.removeParamValue(paramValue);
+	}
+
+	public String removeParamValueAt(int index) {
+		return pt.removeParamValueAt(index);
+	}
+
+	public <Property_> boolean removeProperty(ParameterPropertyInterface<Property_> property) {
+		return pt.removeParameterProperty((org.qcg.broker.schemas.schedulingplan.ParameterProperty)property.getDescription());
+	}
+
+	@SuppressWarnings("unchecked")
+	public ParameterPropertyInterface<org.qcg.broker.schemas.schedulingplan.ParameterProperty> removePropertyAt(int index) {
+		return new schedframe.scheduling.plan.impl.ParameterProperty(pt.removeParameterPropertyAt(index));
+	}
+
+	public void setParamValue(int index, String paramValue)
+			throws IndexOutOfBoundsException {
+		pt.setParamValue(index, paramValue);
+	}
+
+	public void setParamValue(String[] paramValueArray) {
+		pt.setParamValue(paramValueArray);
+	}
+
+	public <Property_> void setProperty(int index, ParameterPropertyInterface<Property_> property)
+			throws IndexOutOfBoundsException {
+		pt.setParameterProperty(index, (org.qcg.broker.schemas.schedulingplan.ParameterProperty)property.getDescription());
+	}
+
+	public <Property_> void setProperty(ParameterPropertyInterface<Property_>[] propertyArray) {
+		if(propertyArray == null)
+			return;
+		org.qcg.broker.schemas.schedulingplan.ParameterProperty tab[] = new org.qcg.broker.schemas.schedulingplan.ParameterProperty[propertyArray.length];
+		for(int i = 0; i < propertyArray.length; i++){
+			tab[i] = (org.qcg.broker.schemas.schedulingplan.ParameterProperty)propertyArray[i].getDescription();
+		}
+		pt.setParameterProperty(tab);
+	}
+
+}
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 477)
@@ -0,0 +1,195 @@
+package schedframe.scheduling.plan.impl;
+
+import java.io.StringWriter;
+import java.util.ArrayList;
+
+import org.exolab.castor.xml.MarshalException;
+import org.exolab.castor.xml.ValidationException;
+
+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;
+
+public class ScheduledTask implements ScheduledTaskInterface<org.qcg.broker.schemas.schedulingplan.Task> {
+
+	private static final long serialVersionUID = -9006532413203045991L;
+	protected org.qcg.broker.schemas.schedulingplan.Task t;
+
+	public ScheduledTask(){
+		t = new org.qcg.broker.schemas.schedulingplan.Task();
+		allocationList = new ArrayList<AllocationInterface>();
+	}
+	
+	public ScheduledTask(org.qcg.broker.schemas.schedulingplan.Task value){
+		t = value;
+		allocationList = new ArrayList<AllocationInterface>();
+	}
+	
+	
+	public org.qcg.broker.schemas.schedulingplan.Task getDescription() {
+		return t;
+	}
+
+	public String getDocument() {
+		StringWriter writer = new StringWriter();
+		try {
+			t.marshal(writer);
+		} catch (MarshalException e) {
+			e.printStackTrace();
+		} catch (ValidationException e) {
+			e.printStackTrace();
+		}
+		return writer.toString();
+	}
+
+	public <Allocation_> void addAllocation(
+			AllocationInterface<Allocation_> allocation)
+			throws IndexOutOfBoundsException {
+		t.addAllocation((org.qcg.broker.schemas.schedulingplan.Allocation) allocation.getDescription());
+		allocationList.add(allocation);
+	}
+
+	public <Allocation_> void addAllocation(int index, AllocationInterface<Allocation_> allocation)
+			throws IndexOutOfBoundsException {
+		t.addAllocation(index, (org.qcg.broker.schemas.schedulingplan.Allocation) allocation.getDescription());
+		allocationList.add(index, allocation);
+	}
+
+	public void deleteTopology() {
+		t.deleteTopology();
+	}
+
+	@SuppressWarnings("unchecked")
+	public AllocationInterface<org.qcg.broker.schemas.schedulingplan.Allocation> getAllocation(int index)
+			throws IndexOutOfBoundsException {
+		return new schedframe.scheduling.plan.impl.Allocation(t.getAllocation(index));
+	}
+
+	@SuppressWarnings("unchecked")
+	public AllocationInterface<org.qcg.broker.schemas.schedulingplan.Allocation>[] getAllocation() {
+		org.qcg.broker.schemas.schedulingplan.Allocation tab[] = t.getAllocation();
+		if(tab == null) return null;
+		
+		schedframe.scheduling.plan.impl.Allocation ret[] = new schedframe.scheduling.plan.impl.Allocation[tab.length];
+		for(int i = 0; i < tab.length; i++){
+			ret[i] = new schedframe.scheduling.plan.impl.Allocation(tab[i]);
+		}
+		return ret;
+	}
+
+	public int getAllocationCount() {
+		return t.getAllocationCount();
+	}
+
+	public String getJobId() {
+		return t.getJobId();
+	}
+
+	public AllocationStatus getStatus() {
+		return t.getStatus();
+	}
+	
+	public String getStatusDescription(){
+		return t.getStatusDescription();
+	}
+
+	public String getTaskId() {
+		return t.getTaskId();
+	}
+
+	public int getTopology() {
+		return t.getTopology();
+	}
+
+	public boolean hasTopology() {
+		return t.hasTopology();
+	}
+
+	public void removeAllAllocation() {
+		t.removeAllAllocation();
+	}
+
+	public <Allocation_> boolean removeAllocation(
+			AllocationInterface<Allocation_> allocation) {
+		return t.removeAllocation((org.qcg.broker.schemas.schedulingplan.Allocation) allocation.getDescription());
+	}
+
+	@SuppressWarnings("unchecked")
+	public AllocationInterface<org.qcg.broker.schemas.schedulingplan.Allocation> removeAllocationAt(int index) {
+		return new schedframe.scheduling.plan.impl.Allocation(t.removeAllocationAt(index));
+	}
+
+	public <Allocation_> void setAllocation(int index,
+			AllocationInterface<Allocation_> allocation)
+			throws IndexOutOfBoundsException {
+		t.setAllocation(index, (org.qcg.broker.schemas.schedulingplan.Allocation)allocation.getDescription());
+		allocationList.set(index, allocation);
+	}
+
+	public <Allocation_> void setAllocation(
+			AllocationInterface<Allocation_>[] allocationArray) {
+		if(allocationArray == null) return;
+		
+		org.qcg.broker.schemas.schedulingplan.Allocation tab[] = new org.qcg.broker.schemas.schedulingplan.Allocation[allocationArray.length];
+		for(int i = 0; i < allocationArray.length; i++){
+			tab[i] = (org.qcg.broker.schemas.schedulingplan.Allocation)allocationArray[i].getDescription();
+		}
+		t.setAllocation(tab);
+	}
+
+	public void setJobId(String jobId) {
+		t.setJobId(jobId);
+	}
+
+	public void setStatus(AllocationStatus status) {
+		t.setStatus(status);
+	}
+
+	public void setStatusDescription(String statusDescription){
+		t.setStatusDescription(statusDescription);
+	}
+	
+	public void setTaskId(String taskId) {
+		t.setTaskId(taskId);
+	}
+
+	public void setTopology(int topology) {
+		t.setTopology(topology);
+	}
+
+	@SuppressWarnings("unchecked")
+	public ScheduledTimeInterface<org.qcg.broker.schemas.schedulingplan.ScheduledTime> getScheduledTime() {
+		org.qcg.broker.schemas.schedulingplan.ScheduledTime time = t.getScheduledTime();
+		if(time == null)
+			return null;
+		
+		ScheduledTime st = new ScheduledTime(time);
+		return st;
+	}
+
+	public <ScheduledTime_> void setScheduledTime(
+			ScheduledTimeInterface<ScheduledTime_> scheduledTime) {
+		t.setScheduledTime((org.qcg.broker.schemas.schedulingplan.ScheduledTime) scheduledTime.getDescription());
+	}
+	
+
+	protected WorkloadUnit<?> task;
+	protected ArrayList<AllocationInterface> allocationList;
+
+	public ScheduledTask(WorkloadUnit<?> task){
+		this();
+		this.task = task;
+	}
+
+	public ArrayList<AllocationInterface> getAllocations() {
+		return this.allocationList;
+	}
+	
+	public WorkloadUnit<?> getTask(){
+		return this.task;
+	}
+}
Index: DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/impl/Property.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/impl/Property.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/impl/Property.java	(revision 477)
@@ -0,0 +1,54 @@
+package schedframe.scheduling.plan.impl;
+
+import java.io.StringWriter;
+
+import org.exolab.castor.xml.MarshalException;
+import org.exolab.castor.xml.ValidationException;
+
+import schedframe.scheduling.plan.PropertyInterface;
+
+public class Property implements PropertyInterface<org.qcg.broker.schemas.schedulingplan.Property> {
+
+	protected org.qcg.broker.schemas.schedulingplan.Property p;
+	
+	public Property(){
+		this.p = new org.qcg.broker.schemas.schedulingplan.Property();
+	}
+	
+	public Property(org.qcg.broker.schemas.schedulingplan.Property value){
+		this.p = value;
+	}
+	
+	public String getContent() {
+		return this.p.getContent();
+	}
+
+	public String getName() {
+		return this.p.getName();
+	}
+
+	public void setContent(String content) {
+		this.p.setContent(content);
+	}
+
+	public void setName(String name) {
+		this.p.setName(name);
+	}
+
+	public org.qcg.broker.schemas.schedulingplan.Property getDescription() {
+		return this.p;
+	}
+
+	public String getDocument() throws Exception {
+		StringWriter writer = new StringWriter();
+		try {
+			p.marshal(writer);
+		} catch (MarshalException e) {
+			e.printStackTrace();
+		} catch (ValidationException e) {
+			e.printStackTrace();
+		}
+		return writer.toString();
+	}
+
+}
Index: DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/impl/OtherParameterType.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/impl/OtherParameterType.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/impl/OtherParameterType.java	(revision 477)
@@ -0,0 +1,161 @@
+package schedframe.scheduling.plan.impl;
+
+import java.io.StringWriter;
+
+import org.exolab.castor.xml.MarshalException;
+import org.exolab.castor.xml.ValidationException;
+
+import schedframe.scheduling.plan.OtherParameterTypeInterface;
+import schedframe.scheduling.plan.ParameterPropertyInterface;
+
+
+public class OtherParameterType	implements OtherParameterTypeInterface <org.qcg.broker.schemas.schedulingplan.OtherParameterType>{
+
+	private static final long serialVersionUID = 6601332996207982911L;
+	protected org.qcg.broker.schemas.schedulingplan.OtherParameterType pt;
+	
+	public OtherParameterType(){
+		pt = new org.qcg.broker.schemas.schedulingplan.OtherParameterType();
+	}
+	
+	public OtherParameterType(org.qcg.broker.schemas.schedulingplan.OtherParameterType value){
+		pt = value; 
+	}
+	
+	public org.qcg.broker.schemas.schedulingplan.OtherParameterType getDescription() {
+		return pt;
+	}
+
+	public String getDocument() {
+		StringWriter writer = new StringWriter();
+		try {
+			pt.marshal(writer);
+		} catch (MarshalException e) {
+			e.printStackTrace();
+		} catch (ValidationException e) {
+			e.printStackTrace();
+		}
+		return writer.toString();
+	}
+
+	public String getEndpoint() {
+		return pt.getEndpoint();
+	}
+
+	public String getName() {
+		return pt.getName();
+	}
+
+	public void setEndpoint(String endpoint) {
+		pt.setEndpoint(endpoint);
+	}
+
+	public void setName(String name) {
+		pt.setName(name);
+	}
+
+	public void addParamValue(String paramValue)
+	throws IndexOutOfBoundsException {
+		pt.addParamValue(paramValue);
+	}
+	
+	public void addParamValue(int index, String paramValue)
+		throws IndexOutOfBoundsException {
+		pt.addParamValue(index, paramValue);
+	}
+	
+	public <Property_> void addProperty(ParameterPropertyInterface<Property_> property)
+		throws IndexOutOfBoundsException {
+		pt.addParameterProperty((org.qcg.broker.schemas.schedulingplan.ParameterProperty)property.getDescription());
+	}
+	
+	public <Property_> void addProperty(int index, ParameterPropertyInterface<Property_> property)
+		throws IndexOutOfBoundsException {
+		pt.addParameterProperty(index, (org.qcg.broker.schemas.schedulingplan.ParameterProperty) property.getDescription());
+	}
+	
+	public String getParamValue(int index) throws IndexOutOfBoundsException {
+		return pt.getParamValue(index);
+	}
+	
+	public String[] getParamValue() {
+		return pt.getParamValue();
+	}
+	
+	public int getParamValueCount() {
+		return pt.getParamValueCount();
+	}
+	
+	@SuppressWarnings("unchecked")
+	public ParameterPropertyInterface<org.qcg.broker.schemas.schedulingplan.ParameterProperty> getProperty(int index)
+		throws IndexOutOfBoundsException {
+		return new schedframe.scheduling.plan.impl.ParameterProperty(pt.getParameterProperty(index));
+	}
+	
+	@SuppressWarnings("unchecked")
+	public ParameterPropertyInterface<org.qcg.broker.schemas.schedulingplan.ParameterProperty>[] getProperty() {
+		org.qcg.broker.schemas.schedulingplan.ParameterProperty tab[] = pt.getParameterProperty();
+		if(tab == null) return null;
+		
+		schedframe.scheduling.plan.impl.ParameterProperty ret[] = new schedframe.scheduling.plan.impl.ParameterProperty[tab.length];
+		for(int i = 0; i < tab.length; i++){
+			ret[i] = new schedframe.scheduling.plan.impl.ParameterProperty(tab[i]);
+		}
+		
+		return ret;
+	}
+	
+	public int getPropertyCount() {
+		return pt.getParameterPropertyCount();
+	}
+	
+	public void removeAllParamValue() {
+		pt.removeAllParamValue();
+	}
+	
+	public void removeAllProperty() {
+		pt.removeAllParameterProperty();
+	}
+	
+	public boolean removeParamValue(String paramValue) {
+		return pt.removeParamValue(paramValue);
+	}
+	
+	public String removeParamValueAt(int index) {
+		return pt.removeParamValueAt(index);
+	}
+	
+	public <Property_> boolean removeProperty(ParameterPropertyInterface<Property_> property) {
+		return pt.removeParameterProperty((org.qcg.broker.schemas.schedulingplan.ParameterProperty)property.getDescription());
+	}
+	
+	@SuppressWarnings("unchecked")
+	public ParameterPropertyInterface<org.qcg.broker.schemas.schedulingplan.ParameterProperty> removePropertyAt(int index) {
+		return new schedframe.scheduling.plan.impl.ParameterProperty(pt.removeParameterPropertyAt(index));
+	}
+	
+	public void setParamValue(int index, String paramValue)
+		throws IndexOutOfBoundsException {
+		pt.setParamValue(index, paramValue);
+	}
+	
+	public void setParamValue(String[] paramValueArray) {
+		pt.setParamValue(paramValueArray);
+	}
+	
+	public <Property_> void setProperty(int index, ParameterPropertyInterface<Property_> property)
+		throws IndexOutOfBoundsException {
+		pt.setParameterProperty(index, (org.qcg.broker.schemas.schedulingplan.ParameterProperty)property.getDescription());
+	}
+	
+	public <Property_> void setProperty(ParameterPropertyInterface<Property_>[] propertyArray) {
+		if(propertyArray == null)
+			return;
+		org.qcg.broker.schemas.schedulingplan.ParameterProperty tab[] = new org.qcg.broker.schemas.schedulingplan.ParameterProperty[propertyArray.length];
+		for(int i = 0; i < propertyArray.length; i++){
+			tab[i] = (org.qcg.broker.schemas.schedulingplan.ParameterProperty) propertyArray[i].getDescription();
+		}
+		pt.setParameterProperty(tab);
+	}
+	
+}
Index: DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/impl/Allocation.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/impl/Allocation.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/impl/Allocation.java	(revision 477)
@@ -0,0 +1,177 @@
+package schedframe.scheduling.plan.impl;
+
+import org.qcg.broker.schemas.schedulingplan.AllocationChoice;
+import org.qcg.broker.schemas.schedulingplan.Node;
+
+import java.io.StringWriter;
+import java.util.List;
+import java.util.Map;
+
+import org.exolab.castor.xml.MarshalException;
+import org.exolab.castor.xml.ValidationException;
+
+import schedframe.resources.units.ProcessingElements;
+import schedframe.resources.units.ResourceUnit;
+import schedframe.resources.units.ResourceUnitName;
+import schedframe.resources.units.StandardResourceUnitName;
+import schedframe.scheduling.manager.resources.utils.ResourceManagerUtils;
+import schedframe.scheduling.plan.AllocationInterface;
+import schedframe.scheduling.plan.HostInterface;
+import schedframe.scheduling.plan.ProcessesMapInterface;
+import schedframe.scheduling.plan.PropertiesTypeInterface;
+import schedframe.scheduling.plan.ProviderInfoInterface;
+
+public class Allocation implements AllocationInterface<org.qcg.broker.schemas.schedulingplan.Allocation> {
+
+	private static final long serialVersionUID = 5194463015598737779L;
+	protected org.qcg.broker.schemas.schedulingplan.Allocation allocation;
+	
+	public Allocation(){
+		allocation = new org.qcg.broker.schemas.schedulingplan.Allocation();
+	}
+	
+	public Allocation(org.qcg.broker.schemas.schedulingplan.Allocation value){
+		allocation = value;
+	}
+	
+	public org.qcg.broker.schemas.schedulingplan.Allocation getDescription() {
+		return allocation;
+	}
+
+	public String getDocument() {
+		StringWriter sw = new StringWriter();
+		try {
+			allocation.marshal(sw);
+		} catch (MarshalException e) {
+			e.printStackTrace();
+		} catch (ValidationException e) {
+			e.printStackTrace();
+		}
+		return sw.toString();
+	}
+
+	public void deleteProcessQuantity() {
+		allocation.getAllocationChoice().deleteProcessesCount();
+	}
+
+	@SuppressWarnings("unchecked")
+	public PropertiesTypeInterface<org.qcg.broker.schemas.schedulingplan.PropertiesType> getAdditionalProperties() {
+		PropertiesType api = 
+			new PropertiesType(allocation.getAdditionalProperties());
+		return api;
+	}
+
+	@SuppressWarnings("unchecked")
+	public HostInterface<org.qcg.broker.schemas.schedulingplan.Host> getHost() {
+		HostInterface<org.qcg.broker.schemas.schedulingplan.Host> host = new schedframe.scheduling.plan.impl.Host(allocation.getHost());
+		return host;
+	}
+
+	public String getProcessGroupId() {
+		return allocation.getProcessGroupId();
+	}
+
+	public int getProcessesCount() {
+		return allocation.getAllocationChoice().getProcessesCount();
+	}
+	
+	@SuppressWarnings("unchecked")
+	public ProcessesMapInterface<org.qcg.broker.schemas.schedulingplan.ProcessesMap> getProcessesMap(){
+		ProcessesMapInterface<org.qcg.broker.schemas.schedulingplan.ProcessesMap> map = 
+			new schedframe.scheduling.plan.impl.ProcessesMap(allocation.getAllocationChoice().getProcessesMap());
+		return map;
+	}
+
+	public boolean hasProcessesCount() {
+		return allocation.getAllocationChoice().hasProcessesCount();
+	}
+	
+	public boolean hasProcessesMap(){
+		return (allocation.getAllocationChoice().getProcessesMap() != null);
+	}
+
+	public <Properties_> void setAdditionalProperties(
+				PropertiesTypeInterface<Properties_> additionalProperties) {
+		allocation.setAdditionalProperties((org.qcg.broker.schemas.schedulingplan.PropertiesType)additionalProperties.getDescription());
+	}
+
+	public <Host_> void setHost(HostInterface<Host_> host) {
+		allocation.setHost((org.qcg.broker.schemas.schedulingplan.Host)host.getDescription());
+	}
+
+	public void setProcessGroupId(String processGroupId) {
+		allocation.setProcessGroupId(processGroupId);
+	}
+
+	public void setProcessesCount(int processCount) {
+		AllocationChoice choice = new AllocationChoice();
+		choice.setProcessesCount(processCount);
+		allocation.setAllocationChoice(choice);
+	}
+
+	public <ProcessesMap_> void setProcessesMap(ProcessesMapInterface<ProcessesMap_> processesMap){
+		AllocationChoice choice = new AllocationChoice();
+		choice.setProcessesMap(
+				(org.qcg.broker.schemas.schedulingplan.ProcessesMap) processesMap.getDescription());
+		allocation.setAllocationChoice(choice);
+		
+	}
+
+	@SuppressWarnings("unchecked")
+	public ProviderInfoInterface<org.qcg.broker.schemas.schedulingplan.ProviderInfo> getProviderInfo() {
+		org.qcg.broker.schemas.schedulingplan.ProviderInfo info = allocation.getProviderInfo();
+		if(info == null)
+			return null;
+		
+		ProviderInfoInterface providerInfo = new ProviderInfo(info);
+		return providerInfo;
+	}
+	
+	
+	public String getReservationId() {
+		org.qcg.broker.schemas.schedulingplan.Reservation r = allocation.getReservation();
+		return (r == null ? null : r.getId());
+	}
+
+	public <ProviderInfo_> void setProviderInfo(
+			ProviderInfoInterface<ProviderInfo_> providerInfo) {
+		allocation.setProviderInfo((org.qcg.broker.schemas.schedulingplan.ProviderInfo)providerInfo.getDescription());
+	}
+	
+
+	protected Map<ResourceUnitName, ResourceUnit> requestedResources;
+	protected boolean isProcessing = false;
+	protected String providerName;
+
+	@Override
+	public void setSpecificResources(
+			Map<ResourceUnitName, ResourceUnit> choosenResources) {
+		requestedResources = choosenResources;
+		ResourceManagerUtils.setPendingResources(choosenResources);
+		ProcessingElements processingElements = (ProcessingElements)requestedResources.get(StandardResourceUnitName.PE);
+		if(processingElements != null){
+			isProcessing = true;
+		}	
+	}
+
+	@Override
+	public Map<ResourceUnitName, ResourceUnit> getRequestedResources() {
+		return this.requestedResources;
+	}
+
+	public boolean isProcessing(){
+		return isProcessing;
+	}
+
+	@Override
+	public void setProviderName(String providerName) {
+		this.providerName = providerName;	
+	}
+
+	@Override
+	public String getProviderName() {
+		return providerName;
+	}
+
+
+}
Index: DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/impl/ParameterProperty.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/impl/ParameterProperty.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/impl/ParameterProperty.java	(revision 477)
@@ -0,0 +1,114 @@
+package schedframe.scheduling.plan.impl;
+
+import java.io.StringWriter;
+
+import org.exolab.castor.xml.MarshalException;
+import org.exolab.castor.xml.ValidationException;
+
+import schedframe.scheduling.plan.ParameterPropertyInterface;
+
+
+public class ParameterProperty implements ParameterPropertyInterface<org.qcg.broker.schemas.schedulingplan.ParameterProperty> {
+
+	private static final long serialVersionUID = -1452887249087909576L;
+	private org.qcg.broker.schemas.schedulingplan.ParameterProperty p;
+	
+	public ParameterProperty(){
+		p = new org.qcg.broker.schemas.schedulingplan.ParameterProperty();
+	}
+	
+	public ParameterProperty(org.qcg.broker.schemas.schedulingplan.ParameterProperty value){
+		this.p = value;
+	}
+	
+	public org.qcg.broker.schemas.schedulingplan.ParameterProperty getDescription() {
+		return p;
+	}
+
+	public String getDocument() {
+		StringWriter writer = new StringWriter();
+		try {
+			p.marshal(writer);
+		} catch (MarshalException e) {
+			e.printStackTrace();
+		} catch (ValidationException e) {
+			e.printStackTrace();
+		}
+		return writer.toString();
+	}
+
+	public void addValue(String value) throws IndexOutOfBoundsException {
+		p.addValue(value);
+	}
+
+	public void addValue(int index, String value)
+			throws IndexOutOfBoundsException {
+		p.addValue(index, value);
+	}
+
+	public void deleteExclude() {
+		p.deleteExclude();
+	}
+
+	public boolean getExclude() {
+		return p.getExclude();
+	}
+
+	public String getName() {
+		return p.getName();
+	}
+
+	public String getValue(int index) throws IndexOutOfBoundsException {
+		return p.getValue(index);
+	}
+
+	public String[] getValue() {
+		return p.getValue();
+	}
+
+	public int getValueCount() {
+		return p.getValueCount();
+	}
+
+	public boolean hasExclude() {
+		return p.hasExclude();
+	}
+
+	public boolean isExclude() {
+		return p.isExclude();
+	}
+
+	public boolean isValid() {
+		return p.isValid();
+	}
+
+	public void removeAllValue() {
+		p.removeAllValue();
+	}
+
+	public boolean removeValue(String value) {
+		return p.removeValue(value);
+	}
+
+	public String removeValueAt(int index) {
+		return p.removeValueAt(index);
+	}
+
+	public void setExclude(boolean exclude) {
+		p.setExclude(exclude);
+	}
+
+	public void setName(String name) {
+		p.setName(name);
+	}
+
+	public void setValue(int index, String value)
+			throws IndexOutOfBoundsException {
+		p.setValue(index, value);
+	}
+
+	public void setValue(String[] valueArray) {
+		p.setValue(valueArray);
+	}
+
+}
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 477)
@@ -0,0 +1,102 @@
+package schedframe.scheduling.plan;
+
+import java.util.ArrayList;
+
+import schedframe.DescriptionContainer;
+
+public interface SchedulingPlanInterface<T> extends DescriptionContainer<T> {
+
+	/**
+	 * 
+	 * 
+	 * @param vTask
+	 * @throws java.lang.IndexOutOfBoundsException if the index
+	 * given is outside the bounds of the collection
+	 */
+	public <Task> void addTask(final ScheduledTaskInterface<Task> vTask)
+			throws java.lang.IndexOutOfBoundsException;
+
+	/**
+	 * 
+	 * 
+	 * @param index
+	 * @param vTask
+	 * @throws java.lang.IndexOutOfBoundsException if the index
+	 * given is outside the bounds of the collection
+	 */
+	public <Task> void addTask(final int index,
+			final ScheduledTaskInterface<Task> vTask)
+			throws java.lang.IndexOutOfBoundsException;
+
+	/**
+	 * Method getTask.
+	 * 
+	 * @param index
+	 * @throws java.lang.IndexOutOfBoundsException if the index
+	 * given is outside the bounds of the collection
+	 * @return the value of the schedframe.schedulingplan.impl.Task
+	 * at the given index
+	 */
+	public <Task>ScheduledTaskInterface<Task> getTask(final int index)
+			throws java.lang.IndexOutOfBoundsException;
+
+	/**
+	 * Method getTask.Returns the contents of the collection in an
+	 * Array.  <p>Note:  Just in case the collection contents are
+	 * changing in another thread, we pass a 0-length Array of the
+	 * correct type into the API call.  This way we <i>know</i>
+	 * that the Array returned is of exactly the correct length.
+	 * 
+	 * @return this collection as an Array
+	 */
+	public <Task>ScheduledTaskInterface<Task>[] getTask();
+
+	/**
+	 * Method getTaskCount.
+	 * 
+	 * @return the size of this collection
+	 */
+	public int getTaskCount();
+
+	/**
+	 */
+	public void removeAllTask();
+
+	/**
+	 * Method removeTask.
+	 * 
+	 * @param vTask
+	 * @return true if the object was removed from the collection.
+	 */
+	public <Task> boolean removeTask(final ScheduledTaskInterface<Task> vTask);
+
+	/**
+	 * Method removeTaskAt.
+	 * 
+	 * @param index
+	 * @return the element removed from the collection
+	 */
+	public <Task>ScheduledTaskInterface<Task> removeTaskAt(final int index);
+
+	/**
+	 * 
+	 * 
+	 * @param index
+	 * @param vTask
+	 * @throws java.lang.IndexOutOfBoundsException if the index
+	 * given is outside the bounds of the collection
+	 */
+	public <Task> void setTask(final int index,
+			final ScheduledTaskInterface<Task> vTask)
+			throws java.lang.IndexOutOfBoundsException;
+
+	/**
+	 * 
+	 * 
+	 * @param vTaskArray
+	 */
+	public <Task> void setTask(final ScheduledTaskInterface<Task>[] vTaskArray);
+
+
+	public ArrayList<ScheduledTaskInterface> getTasks();
+}
Index: DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/ProcessesMapInterface.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/ProcessesMapInterface.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/ProcessesMapInterface.java	(revision 477)
@@ -0,0 +1,15 @@
+package schedframe.scheduling.plan;
+
+
+import schedframe.DescriptionContainer;
+
+public interface ProcessesMapInterface<T> extends DescriptionContainer<T> {
+
+	public void setSlotsPerNode(int arg);
+	
+	public int getSlotsPerNode();
+	
+	public void setProcessesPerNode(int[] arg);
+	
+	public int[] getProcessesPerNode();
+}
Index: DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/ProviderInfoInterface.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/ProviderInfoInterface.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/scheduling/plan/ProviderInfoInterface.java	(revision 477)
@@ -0,0 +1,56 @@
+package schedframe.scheduling.plan;
+
+import schedframe.DescriptionContainer;
+
+import org.qcg.broker.schemas.schedulingplan.types.InterfaceType;
+
+public interface ProviderInfoInterface<T> extends DescriptionContainer<T> {
+
+	/**
+	 * Returns the value of field 'location'.
+	 * 
+	 * @return the value of field 'Location'.
+	 */
+	public java.lang.String getLocation();
+
+	/**
+	 * Returns the value of field 'proxyName'.
+	 * 
+	 * @return the value of field 'ProxyName'.
+	 */
+	public java.lang.String getProxyName();
+
+	/**
+	 * Returns the value of field 'type'.
+	 * 
+	 * @return the value of field 'Type'.
+	 */
+	public InterfaceType getType();
+	
+	/**
+	 * Sets the value of field 'location'.
+	 * 
+	 * @param location the value of field 'location'.
+	 */
+	public void setLocation(final java.lang.String location);
+
+	/**
+	 * Sets the value of field 'proxyName'.
+	 * 
+	 * @param proxyName the value of field 'proxyName'.
+	 */
+	public void setProxyName(final java.lang.String proxyName);
+
+	/**
+	 * Sets the value of field 'type'.
+	 * 
+	 * @param type the value of field 'type'.
+	 */
+	public void setType(final InterfaceType type);
+	
+	public <Properties> void setAdditionalProperties(
+            final PropertiesTypeInterface<Properties> additionalProperties);
+	
+	public <Properties> PropertiesTypeInterface<Properties> getAdditionalProperties();
+
+}
Index: DCWoRMS/trunk/build/classes/schedframe/scheduling/SecurityContext.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/scheduling/SecurityContext.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/scheduling/SecurityContext.java	(revision 477)
@@ -0,0 +1,20 @@
+package schedframe.scheduling;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+public interface SecurityContext {
+
+	public String getUserIdentity();
+	
+	public Object getCertificate();
+	
+	public String getJobId();
+	
+	public String getTaskId();
+	
+	public String getProcessesSetId();
+
+}
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 477)
@@ -0,0 +1,319 @@
+package schedframe.scheduling;
+
+import eduni.simjava.Sim_event;
+import eduni.simjava.Sim_port;
+import eduni.simjava.Sim_system;
+import gridsim.GridSim;
+import gridsim.GridSimCore;
+import gridsim.GridSimTags;
+import gridsim.IO_data;
+import gridsim.gssim.WormsTags;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+
+import schedframe.Initializable;
+import schedframe.PluginConfiguration;
+import schedframe.events.scheduling.SchedulingEventType;
+import schedframe.resources.Resource;
+import schedframe.resources.ResourceStatus;
+import schedframe.resources.ResourceType;
+import schedframe.resources.computing.ComputingResource;
+import schedframe.resources.providers.LocalSystem;
+import schedframe.resources.units.ResourceUnit;
+import schedframe.resources.units.ResourceUnitName;
+import schedframe.scheduling.manager.resources.ManagedComputingResources;
+import schedframe.scheduling.manager.resources.ManagedResources;
+import schedframe.scheduling.policy.AbstractManagementSystem;
+import schedframe.scheduling.queue.TaskQueue;
+import schedframe.scheduling.queue.QueueDescription;
+import schedframe.scheduling.tasks.WorkloadUnit;
+
+public class Scheduler extends GridSimCore implements Resource, Initializable{
+	
+	protected ResourceStatus status;
+	protected ResourceType type;
+	
+	protected Scheduler parent;
+	protected List<Scheduler> children;
+	
+	protected AbstractManagementSystem managementSystem;
+	
+	protected ManagedComputingResources compResources;	
+
+	public Scheduler(AbstractManagementSystem manSys, ResourceType schedType, ManagedResources managedResources) throws Exception {
+		super(manSys.getName(), 1);
+		this.managementSystem = manSys;
+		this.compResources = new ManagedComputingResources();
+		this.status = ResourceStatus.AVAILABLE;
+		this.children = new ArrayList<Scheduler>(1);
+		this.type = schedType;
+		init(managedResources);
+	}
+
+	public void init(ManagedResources managedResources){
+		addResources(managedResources.getComputingResources());
+		managementSystem.init(this, managedResources);
+		
+		//required to terminate all scheduling entities after the end of simulation
+		Integer schedulerIdObj = new Integer(get_id());
+		List<Integer> schedRes = GridSim.getGridResourceList();
+		schedRes.add(schedulerIdObj);
+
+		/*if (supportsAR) {
+			res = GridSim.getAdvancedReservationList();
+			res.add(resIdObj);
+		} */
+
+	}
+	
+	public void addChild(Scheduler child) {
+		child.setParent(this);
+		if (children == null) {
+			children = new ArrayList<Scheduler>(1);
+		}
+		children.add(child);
+	}
+
+	public List<Scheduler> getChildren() {
+		return children;
+	}
+
+	public void setParent(Scheduler newParent) {
+		this.parent = newParent;
+	}
+
+	public Scheduler getParent() {
+		return parent;
+	}
+
+	/*public void addResource(ComputingResource resource) {
+		compResources.add(resource);
+	}*/
+
+	public void addResources(List<ComputingResource> res) {
+		for(ComputingResource resource:res){
+			compResources.add(resource);
+			resource.setScheduler(this);
+			for(ComputingResource child: resource.filterDescendants(new Properties())){
+				child.setScheduler(this);
+			}
+		}
+	}
+
+	public ManagedComputingResources getCompResources() {
+		return compResources;
+	}
+
+	public void body() {
+
+		PluginConfiguration pluginConfig = managementSystem.getSchedulingPluginConfiguration();
+		if (pluginConfig != null) {
+			Map<SchedulingEventType, Object> events = pluginConfig.getServedEvents();
+			if (events != null) {
+				Object obj = events.get(SchedulingEventType.TIMER);
+				if (obj != null) {
+					int delay = (Integer) obj;
+					send(this.get_id(), delay, WormsTags.TIMER);
+				}
+			}
+		}
+
+		// Process events until END_OF_SIMULATION is received from the
+		// GridSimShutdown Entity
+		Sim_event ev = new Sim_event();
+		sim_get_next(ev);
+		boolean run = true;
+		while (Sim_system.running()  && run) {
+			// sim_get_next(ev);
+			// if the simulation finishes then exit the loop
+			if (ev.get_tag() == GridSimTags.END_OF_SIMULATION) {
+				// 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;
+			}
+			
+			// process the received event
+			processRequest(ev);
+			sim_get_next(ev);
+		}
+	}
+	
+	protected void processRequest(Sim_event ev) {
+		switch (ev.get_tag()) {
+
+		case GridSimTags.GRIDLET_SUBMIT:
+			processGSSIMJobSubmit(ev, false);
+			break;
+
+		case GridSimTags.GRIDLET_SUBMIT_ACK:
+			processGSSIMJobSubmit(ev, true);
+			break;
+
+		case GridSimTags.GRIDLET_RETURN:
+			processGSSIMJobReturn(ev);
+			break;
+
+		default:
+			processOtherRequest(ev);
+			break;
+		}
+	}
+
+	protected void processOtherRequest(Sim_event ev) {
+		switch (ev.get_tag()) {
+		case WormsTags.QUERY_RESOURCE_DESC:
+			SchedulerDescription desc = new SchedulerDescription(new LocalSystem(get_name(), null, null));
+			Map<ResourceUnitName, List<ResourceUnit>> units = managementSystem.getResourceManager().getSharedResourceUnits();
+			desc.addResourceUnitList(units);
+			desc.addQueuesDescription(getQueuesDescription());
+
+			IO_data data = new IO_data(desc, 0, ev.get_src());
+			send(ev.get_src(), GridSimTags.SCHEDULE_NOW, WormsTags.QUERY_RESOURCE_DESC_RESULT, data);
+			break;
+
+		default:
+			managementSystem.processEvent(ev);
+			break;
+		}
+	}
+	
+	/*public boolean processOtherEvent(Sim_event ev) {
+		return false;
+	}*/
+	
+	protected void processGSSIMJobReturn(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();
+		managementSystem.notifySubmittedWorkloadUnit(job, ack);
+	}
+	
+	public void send(String entityName, double delay, int tag, Object data){
+		super.send(entityName, delay, tag, data);
+	}
+	
+	public void send(int destId, double delay, int tag){
+		super.send(destId, delay, tag);
+	}
+	
+	public void send(int destId, double delay, int tag, Object data){
+		super.send(destId, delay, tag, data);
+	}
+	
+	public void send(Sim_port destPort, double delay, int tag, Object data) {
+		super.send(destPort, delay, tag, data);
+	}
+
+	public void sendInternal(double delay, int tag, Object data) {
+		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() {
+		return output;
+	}
+
+	/*public Scheduler getScheduler(String resourceName){
+		ComputingResource resourceWithName = null;
+		for(int i = 0 ; i < compResources.size() && resourceWithName == null; i++){
+			ComputingResource resource = compResources.get(i);
+			if(resource.getName().equals(resourceName))
+				resourceWithName = resource;
+			else
+				try {
+					resourceWithName = resource.getDescendantByName(resourceName);
+				} catch (ResourceException e) {
+					return null;
+				}
+		}
+		if(resourceWithName == null)
+			return null;
+		List<ComputingResource> children = resourceWithName.getChildren();
+		Set<Scheduler> childrenSchedulers = new HashSet<Scheduler>();
+		for(ComputingResource child:children) {
+			childrenSchedulers.add(child.getScheduler());
+		}
+		Set<Scheduler> tempChildrenSchedulers = new HashSet<Scheduler>(childrenSchedulers);
+		while(childrenSchedulers.size() != 1){
+			childrenSchedulers = new HashSet<Scheduler>();
+			for(Scheduler s: tempChildrenSchedulers){
+				childrenSchedulers.add(s.getParent());
+			}
+			tempChildrenSchedulers = new HashSet<Scheduler>(childrenSchedulers);
+		}
+		Iterator<Scheduler> it = childrenSchedulers.iterator();
+		Scheduler potentialScheduler = it.next();
+		if(potentialScheduler.getResources().containsAll(children))
+			return potentialScheduler;
+		return null;
+
+	}*/
+	
+	public List<QueueDescription> getQueuesDescription(){
+		List<QueueDescription> queues = new ArrayList<QueueDescription>();
+		for(TaskQueue queue: managementSystem.getAccessQueues()){
+			QueueDescription qd;
+			try {
+				qd = new QueueDescription(queue.getName(), queue.getPriority(), queue.supportReservations(), getQueueLoad(queue.getName()));
+				queues.add(qd);
+			} catch (NoSuchFieldException e) {;
+			}
+		}
+		return queues;
+
+	}
+	private long getQueueLoad(String queueName) throws NoSuchFieldException{
+		Map<String, Integer> queue_size = managementSystem.getQueuesSize();
+		long load = 0;
+		if(queueName == null){
+			for(String queue: queue_size.keySet()){
+				load += queue_size.get(queue);
+			}
+			return load;
+		}
+		else if(queue_size.containsKey(queueName))
+			return queue_size.get(queueName);
+		else
+			throw new NoSuchFieldException("Queue " + queueName + 
+							" is not available in resource " + get_name());
+	}
+
+	public ResourceType getType() {
+		return this.type;
+	}
+
+	public ResourceStatus getStatus() {
+		return status;
+	}
+	
+	public void setStatus(ResourceStatus newStatus) {
+		status = newStatus;
+	}
+	
+	public void getResourceDescription(){
+		
+	}
+
+	public void initiate() {
+
+	}
+}
Index: DCWoRMS/trunk/build/classes/schedframe/scheduling/WorkloadUnitList.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/scheduling/WorkloadUnitList.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/scheduling/WorkloadUnitList.java	(revision 477)
@@ -0,0 +1,10 @@
+package schedframe.scheduling;
+
+import java.util.List;
+
+import schedframe.scheduling.tasks.WorkloadUnit;
+
+
+public interface WorkloadUnitList extends List<WorkloadUnit<?>>{
+
+}
Index: DCWoRMS/trunk/build/classes/schedframe/scheduling/plugin/SchedulingPluginConfiguration.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/scheduling/plugin/SchedulingPluginConfiguration.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/scheduling/plugin/SchedulingPluginConfiguration.java	(revision 477)
@@ -0,0 +1,24 @@
+package schedframe.scheduling.plugin;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import schedframe.PluginConfiguration;
+import schedframe.events.scheduling.SchedulingEventType;
+
+public class SchedulingPluginConfiguration implements PluginConfiguration {
+	
+	private Map<SchedulingEventType, Object> events;
+
+	public SchedulingPluginConfiguration(){
+		this.events = new HashMap<SchedulingEventType, Object>();
+	}
+	
+	public void addServedEvent(SchedulingEventType eventType, Object argument){
+		events.put(eventType, argument);
+	}
+	
+	public Map<SchedulingEventType, Object> getServedEvents() {
+		return events;
+	}
+}
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 477)
@@ -0,0 +1,39 @@
+package schedframe.scheduling.plugin.estimation;
+
+import gssim.schedframe.scheduling.ExecTask;
+
+import java.util.List;
+import java.util.Map;
+
+import schedframe.Plugin;
+import schedframe.events.scheduling.SchedulingEvent;
+import schedframe.resources.units.ResourceUnit;
+import schedframe.resources.units.ResourceUnitName;
+
+/**
+ * This interface is responsible for estimation of task execution time. It
+ * provides all necessary information to compute execution time. In general, the
+ * major method allow to develop different approaches and strategies of
+ * execution time computation. Ratings of processors, available memory, length
+ * of task (number of CPU instructions) and task requirements are used to
+ * specify duration of the task. The interface method returns an estimated
+ * execution time of the task, which is then applied to simulation.
+ * 
+ * @author Marcin Krystek
+ * 
+ */
+public interface ExecutionTimeEstimationPlugin extends Plugin {
+
+	/**
+	 * 
+	 * @param allocatedResources resource units allocated for task execution
+	 * @param task which will be executed
+	 * @param remainingLength 
+	 * @return estimated execution time of a task of specified length
+	 */
+	public double execTimeEstimation(SchedulingEvent event, Map<ResourceUnitName, ResourceUnit> allocatedResources, 
+									ExecTask task, 
+									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 477)
@@ -0,0 +1,24 @@
+package schedframe.scheduling.plugin;
+
+import schedframe.Plugin;
+import schedframe.events.scheduling.SchedulingEvent;
+import schedframe.scheduling.WorkloadUnitListImpl;
+import schedframe.scheduling.manager.resources.ResourceManager;
+import schedframe.scheduling.manager.tasks.JobRegistry;
+import schedframe.scheduling.plan.SchedulingPlanInterface;
+import schedframe.scheduling.plugin.grid.ModuleList;
+import schedframe.scheduling.queue.TaskQueueList;
+
+public interface SchedulingPlugin extends Plugin{
+
+	public int placeJobsInQueues(WorkloadUnitListImpl newJobs,
+			TaskQueueList queues, 
+			ResourceManager resourceManager, ModuleList modules);
+	
+	public SchedulingPlanInterface<?> schedule(SchedulingEvent event, 
+			TaskQueueList queues, 
+			JobRegistry jobRegistry, 
+			ResourceManager resourceManager, ModuleList modules);
+	
+}
+
Index: DCWoRMS/trunk/build/classes/schedframe/scheduling/plugin/grid/ResourceDiscovery.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/scheduling/plugin/grid/ResourceDiscovery.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/scheduling/plugin/grid/ResourceDiscovery.java	(revision 477)
@@ -0,0 +1,55 @@
+package schedframe.scheduling.plugin.grid;
+
+import java.util.List;
+
+import schedframe.resources.providers.ResourceProvider;
+import schedframe.scheduling.SchedulerDescription;
+import schedframe.scheduling.SecurityContext;
+import schedframe.scheduling.tasks.requirements.AbstractResourceRequirements;
+
+
+/**
+ * This interface provides access to information about resources
+ *
+ */
+public interface ResourceDiscovery extends Module {
+
+	/**
+	 * 
+	 * @return List of all administration domains in the system
+	 */
+	public List<String> getAdministrationDomains(SecurityContext secContext);
+	
+	/**
+	 * 
+	 * @return List of resource providers available in the system
+	 */
+	public List<ResourceProvider> getProviders(SecurityContext secContext);
+	
+	/**
+	 * 
+	 * @param admDomain
+	 * @return List of resource providers available in particular administration
+	 * domain.
+	 */
+	public List<ResourceProvider> getProviders(String admDomain, SecurityContext secContext);
+	
+
+	
+	public List<ResourceProvider> getProviders(AbstractResourceRequirements<?> reqDesc,
+												SecurityContext secContext);
+	
+	/**
+	 * @return description of all resources. Order of the resources is not determined.
+	 */
+	public List<SchedulerDescription> getResources(SecurityContext secContext);
+
+	/**
+	 * @param reqDesc resource requirements
+	 * @return description of all resources that meet resource requirements
+	 */
+	public List<SchedulerDescription> getResources(AbstractResourceRequirements<?> reqDesc, SecurityContext secContext);
+
+	public List<SchedulerDescription> getResources();
+	
+}
Index: DCWoRMS/trunk/build/classes/schedframe/scheduling/plugin/grid/ModuleList.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/scheduling/plugin/grid/ModuleList.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/scheduling/plugin/grid/ModuleList.java	(revision 477)
@@ -0,0 +1,12 @@
+package schedframe.scheduling.plugin.grid;
+
+import java.util.List;
+
+public interface ModuleList extends List<Module>{
+	
+	public <T extends Module> List<T> get(ModuleType type);
+	
+	public Module getModule(ModuleType type);
+	
+	public boolean isModuleAvailable(ModuleType type);
+}
Index: DCWoRMS/trunk/build/classes/schedframe/scheduling/plugin/grid/GlobalSchedulingPlugin.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/scheduling/plugin/grid/GlobalSchedulingPlugin.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/scheduling/plugin/grid/GlobalSchedulingPlugin.java	(revision 477)
@@ -0,0 +1,14 @@
+package schedframe.scheduling.plugin.grid;
+
+import schedframe.scheduling.plugin.SchedulingPlugin;
+
+/**
+ * Interface of a Grid Scheduler 
+ * 
+ * @author Ariel
+ *  
+ */
+public interface GlobalSchedulingPlugin extends SchedulingPlugin {
+
+
+}
Index: DCWoRMS/trunk/build/classes/schedframe/scheduling/plugin/grid/Module.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/scheduling/plugin/grid/Module.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/scheduling/plugin/grid/Module.java	(revision 477)
@@ -0,0 +1,22 @@
+package schedframe.scheduling.plugin.grid;
+
+import java.util.Properties;
+
+import eduni.simjava.Sim_event;
+
+import schedframe.exceptions.ModuleException;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+public interface Module {
+
+	public void init(Properties properties) throws ModuleException;
+	
+	public void dispose() throws ModuleException;
+	
+	public ModuleType getType();
+	
+}
Index: DCWoRMS/trunk/build/classes/schedframe/scheduling/plugin/grid/ModuleType.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/scheduling/plugin/grid/ModuleType.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/scheduling/plugin/grid/ModuleType.java	(revision 477)
@@ -0,0 +1,35 @@
+package schedframe.scheduling.plugin.grid;
+
+import schedframe.StaticResourceLoadCalendar;
+
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+public enum ModuleType {
+
+	RESOURCE_DISCOVERY("Resource_discovery", ResourceDiscovery.class),
+	JOB_REGISTRY("Job registry", JobRegistry.class),
+	RESOURCE_CALENDAR("Resource Calendar", StaticResourceLoadCalendar.class);
+	//DATA_MANAGER("Data Manager", DataManager.class),
+	//AR_EXTENSION("ARExtension", ARExtension.class);
+
+	
+	private String name;
+	private Class<?> _interface;
+	
+	private ModuleType(String name, Class<?> _class){
+		this.name = name;
+		this._interface = _class;
+	}
+	
+	public String toString(){
+		return this.name;
+	}
+	
+	public boolean isValidFor(Module m){
+		return (m == null ? false : _interface.isAssignableFrom(m.getClass()));
+	}
+}
Index: DCWoRMS/trunk/build/classes/schedframe/scheduling/plugin/grid/Prediction.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/scheduling/plugin/grid/Prediction.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/scheduling/plugin/grid/Prediction.java	(revision 477)
@@ -0,0 +1,52 @@
+package schedframe.scheduling.plugin.grid;
+
+
+/**
+ * This interface provides performance estimations that can be used in scheduling
+ *  
+ * @author Ariel
+ *
+ */
+public interface Prediction {
+
+	/**
+	 * Predicts runtime of a given task at specific resource
+	 * @param td Description of a task
+	 * @param rd Description of resources
+	 * @param resourceId id of resource
+	 * @return prediction of a task runtime for a given task and resource description
+	 */
+//	public PredictionValue getRunTime(TaskDescription td, ResourceDescription rd, String resourceId);
+
+	/**
+	 * Predicts runtime of a given task
+	 * @param td Description of a task
+	 * @return prediction of a task runtime for a given task
+	 */
+//	public PredictionValue getRunTime(TaskDescription td);
+	
+	/**
+	 * Predicts queue wait time of a given task at specific resource
+	 * @param td Description of a task
+	 * @param rd Description of resources
+	 * @param resourceId id of resource
+	 * @return prediction of a task waiting time for a given task and resource description
+	 */
+//	public PredictionValue getWaitTime(TaskDescription td, ResourceDescription rd, String resourceId);
+	
+	/**
+	 * Predicts a given parameter of a given task
+	 * @return prediction for a given parameter and task description 
+	 */
+//	public PredictionValue getPrediction(String paramName, TaskDescription td);
+
+	/**
+	 * Predicts runtimes of given tasks at specific resources
+	 * @param td Description of a task
+	 * @param rd Description of resources
+	 * @param resourceIds identifiers of resources
+	 * @return predictions for a given task; returned array contains predictions for requested resources 
+	 */
+//	public PredictionValue[] getRunTime(TaskDescription td, ResourceDescription rd, String[] resourceIds);
+
+}
Index: DCWoRMS/trunk/build/classes/schedframe/scheduling/plugin/grid/JobRegistry.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/scheduling/plugin/grid/JobRegistry.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/scheduling/plugin/grid/JobRegistry.java	(revision 477)
@@ -0,0 +1,53 @@
+package schedframe.scheduling.plugin.grid;
+
+import java.util.List;
+
+import schedframe.scheduling.tasks.JobInterface;
+import schedframe.scheduling.tasks.TaskInterface;
+
+
+/**
+ * The JobRegistry interface provides information about jobs and tasks 
+ * @author Ariel
+ *
+ */
+public interface JobRegistry extends Module{
+
+	/**
+	 * Provide information about submitted jobs which are active (not finished) 
+	 * @return array of Job objects 
+	 */
+	public List<JobInterface<?>> getActiveJobs();
+
+	/**
+	 * Provide information about submitted tasks which are active (not finished) 
+	 * @return array of Task objects 
+	 */
+	public List<TaskInterface<?>> getActiveTasks();
+	
+	/**
+	 * Gets information about a given job
+	 * @param jobID the identifier of the job
+	 * @return object implementing Job interface
+	 */
+	public JobInterface<?> getJobInfo(String jobID);
+
+	/**
+	 * Gets information about a given task
+	 * @param jobID the identifier of the job the task belongs to
+	 * @param taskId the identifier of the task
+	 * @return object implementing {@link TaskInterface} interface
+	 */
+	public TaskInterface<?> getTaskInfo(String jobID, String taskId);
+
+	/**
+	 * @param jobID the identifier of the job
+	 * @param job
+	 * @return
+	 */
+	public boolean addJob(JobInterface<?> job);
+	
+	
+	public boolean addTask(TaskInterface<?> task);
+	
+}
Index: DCWoRMS/trunk/build/classes/schedframe/scheduling/plugin/grid/ModuleListImpl.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/scheduling/plugin/grid/ModuleListImpl.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/scheduling/plugin/grid/ModuleListImpl.java	(revision 477)
@@ -0,0 +1,58 @@
+package schedframe.scheduling.plugin.grid;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+public class ModuleListImpl extends ArrayList<Module> implements ModuleList {
+
+	private static final long serialVersionUID = -3824600938144742457L;
+
+	public ModuleListImpl(){
+		super();
+	}
+	
+	public ModuleListImpl(int initialSize){
+		super(initialSize);
+	}
+	
+	public List<Module> get(ModuleType type){
+		List<Module> list = null;
+		
+		for(int i = 0; i < size(); i++){
+			Module m = get(i);
+			if(m.getType() == type){
+				list = (list == null ? new ArrayList<Module>(1) : list);
+				list.add(m);
+			}
+		}
+		return list;
+	}
+	
+	public Module getModule(ModuleType type){
+		
+		for(int i = 0; i < size(); i++){
+			Module m = get(i);
+			if(m.getType() == type){
+				return m;
+			}
+		}
+		return null;
+	}
+	
+	public boolean isModuleAvailable(ModuleType type){
+		for(int i = 0; i < size(); i++){
+			Module m = get(i);
+			if(m.getType() == type){
+				return true;
+			}
+		}
+		return false;
+	}
+	
+	
+}
Index: DCWoRMS/trunk/build/classes/schedframe/scheduling/plugin/local/ResourceAllocationInterface.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/scheduling/plugin/local/ResourceAllocationInterface.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/scheduling/plugin/local/ResourceAllocationInterface.java	(revision 477)
@@ -0,0 +1,33 @@
+package schedframe.scheduling.plugin.local;
+
+import java.util.Map;
+
+import schedframe.resources.units.ResourceUnit;
+import schedframe.resources.units.ResourceUnitName;
+
+public interface ResourceAllocationInterface {
+	
+	/**
+	 * Allocates resource units( marks as used) on the basis of given resource
+	 * units.
+	 * 
+	 * @param freeRes
+	 *            resource units to be consumed
+	 */
+	public boolean allocateResources(Map<ResourceUnitName, ResourceUnit> freeRes);
+
+	/**
+	 * Frees given resource units.
+	 * 
+	 * @param lastUsedResources
+	 *            resource units to be free
+	 */
+	public void freeResources(Map<ResourceUnitName, ResourceUnit> lastUsedResources);
+	
+	//public void allocateProcessors(Map<ResourceParameterName, ResourceUnit> freeRes);
+	
+
+	//public void clearPendingProcessors(List<Resource> choosenResources);
+	
+
+}
Index: DCWoRMS/trunk/build/classes/schedframe/scheduling/plugin/local/LocalSchedulingPlugin.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/scheduling/plugin/local/LocalSchedulingPlugin.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/scheduling/plugin/local/LocalSchedulingPlugin.java	(revision 477)
@@ -0,0 +1,19 @@
+package schedframe.scheduling.plugin.local;
+
+import schedframe.events.scheduling.SchedulingEvent;
+import schedframe.events.scheduling.SchedulingResponseType;
+import schedframe.scheduling.manager.resources.ResourceManager;
+import schedframe.scheduling.manager.tasks.JobRegistryImpl;
+import schedframe.scheduling.plugin.SchedulingPlugin;
+import schedframe.scheduling.plugin.grid.ModuleList;
+import schedframe.scheduling.queue.TaskQueueList;
+
+
+public interface LocalSchedulingPlugin extends SchedulingPlugin {
+
+	public SchedulingResponseType handleResourceAllocationViolation(SchedulingEvent event,
+					TaskQueueList queues, 
+					JobRegistryImpl jobRegistry, 
+					ResourceManager resourceManager, ModuleList modules);
+
+}
Index: DCWoRMS/trunk/build/classes/schedframe/scheduling/plugin/local/TimeOperations.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/scheduling/plugin/local/TimeOperations.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/scheduling/plugin/local/TimeOperations.java	(revision 477)
@@ -0,0 +1,573 @@
+package schedframe.scheduling.plugin.local;
+
+import java.util.ArrayList;
+
+import org.joda.time.DateTime;
+
+/**
+ * @author Ariel Oleksiak
+ * 
+ */
+public class TimeOperations {
+
+		long timeDelta;
+
+		public static final long TWENTY_FOUR_HOURS = 24*60*60*1000; //24h in millis
+
+		/**
+		 * Constructor of DateOperations class
+		 * @param timeDelta - parameter used to express potential time overheads, e.g.
+		 * while checking if certain period fits into another
+		 */
+		public TimeOperations(long timeDelta) {
+			this.timeDelta = timeDelta;
+		}
+
+		//Getters/setters
+		
+		public long getTimeDelta() {
+			return timeDelta;
+		}
+
+		public void setTimeDelta(long timeDelta) {
+			this.timeDelta = timeDelta;
+		}
+		
+		//end of getters/setters
+		
+		
+		//Comparisons
+		
+		/**
+		 * Compares two Calendar objects taking into account date only, i.e.
+		 * year, month, and day (without hour, minute, second, milis)
+		 * @param date1
+		 * @param date2
+		 * @return true if date1 is before date2; false otherwise
+		 */
+		public boolean beforeDate(DateTime date1, DateTime date2) {
+
+			if (date1 == null || date2 == null)
+				return false;
+			
+			if (date1.getYear() < date2.getYear())
+				return true;
+			if (date1.getYear() > date2.getYear())
+				return false;
+					
+			if (date1.getMonthOfYear() < date2.getMonthOfYear())
+				return true;
+			if (date1.getMonthOfYear() > date2.getMonthOfYear())
+				return false;
+			
+			if (date1.getDayOfMonth() < date2.getDayOfMonth())
+				return true;
+			if (date1.getDayOfMonth() > date2.getDayOfMonth())
+				return false;
+
+			return false;
+		}
+
+		
+		/**
+		 * Compares two Calendar objects taking into account date only, i.e.
+		 * year, month, and day (without hour, minute, second, milis)
+		 * @param date1
+		 * @param date2
+		 * @return true if dates are equal; false otherwise
+		 */
+		public boolean sameDate(DateTime date1, DateTime date2) {
+			
+			if (date1 == null || date2 == null)
+				return false;
+			
+			if (date1.getYear() != date2.getYear())
+				return false;
+			
+			if (date1.getMonthOfYear() != date2.getMonthOfYear())
+				return false;
+			
+			if (date1.getDayOfMonth() != date2.getDayOfMonth())
+				return false;
+
+			return true;
+		}
+
+		/**
+		 * Check whether one date is before another date. Only time is taken into account, i.e.
+		 * hour, minute, second, milis (without year, month, and day)
+		 * @param date1
+		 * @param date2
+		 * @return true if date1 is before date2
+		 */
+		public boolean beforeDayTime(DateTime date1, DateTime date2) {
+
+			if (date1 == null || date2 == null)
+				  return false;
+
+			if(date1.getHourOfDay() < date2.getHourOfDay())
+				return true;
+			if(date1.getHourOfDay() > date2.getHourOfDay())
+				return false;
+			
+			if(date1.getMinuteOfHour() < date2.getMinuteOfHour())
+				return true;
+			if(date1.getMinuteOfHour() > date2.getMinuteOfHour())
+				return false;
+			
+			if(date1.getSecondOfMinute() < date2.getSecondOfMinute())
+				return true;
+			if(date1.getSecondOfMinute() > date2.getSecondOfMinute())
+				return false;
+			
+			if(date1.getMillisOfSecond() < date2.getMillisOfSecond())
+				return true;
+			if(date1.getMillisOfSecond() > date2.getMillisOfSecond())
+				return false;
+			
+			return false;
+		}
+
+		/**
+		 * Check whether a period, whose length is equal duration, is before specific date. Only time is taken into account, i.e.
+		 * hour, minute, second, milis (without year, month, and day)
+		 * @param date1
+		 * @param duration - duration of a period to be checked
+		 * @param date2
+		 * @return true if date1 + duration is before date2
+		 */
+		public boolean beforeDayTime(DateTime date1, long duration, DateTime date2) {
+			if (date1 == null || date2 == null)
+				  return false;
+
+			date1 = date1.plus(duration + timeDelta);
+			
+			return beforeDate(date1, date2);
+		}
+
+		/**
+		 * Check whether dates are equal. Only time is taken into account, i.e.
+		 * hour, minute, second, milis (without year, month, and day)
+		 * @param date1
+		 * @param date2
+		 * @return true if dates are equal
+		 */
+		public boolean sameDayTime(DateTime date1, DateTime date2) {
+
+			if (date1 == null || date2 == null)
+				  return false;
+
+			if (date1.getMillisOfDay() != date2.getMillisOfDay())
+				return false;
+			
+			return true;
+		}
+		
+		/**
+		 * Check whether a period, whose length is equal duration, is after specific date. Only time is taken into account, i.e.
+		 * hour, minute, second, milis (without year, month, and day)
+		 * @param date1
+		 * @param date2
+		 * @return true if date1 is after date2
+		 */
+		public boolean afterDayTime(DateTime date1, DateTime date2) {
+			return beforeDayTime(date2, date1);
+		}
+
+		/**
+		 * Check whether a period, whose length is equal duration, is after specific date. Only time is taken into account, i.e.
+		 * hour, minute, second, milis (without year, month, and day)
+		 * @param date1
+		 * @param duration - duration of a period to be checked
+		 * @param date2
+		 * @return true if date1 + duration is after date2
+		 */
+		public boolean afterDayTime(DateTime date1, long duration, DateTime date2) {
+
+			if (date1 == null || date2 == null)
+				  return false;
+
+			date1 = date1.plus(duration + timeDelta);
+			
+			return afterDayTime(date1, date2);
+		}
+		
+		//end of comparisons
+		
+		//Operations on date and time
+
+		/**
+		 * Copy date from newDate DateTime object into date DateTime object.
+		 * Time (hour, minutes, seconds, milis) is not copied.
+		 * @return DateTime object representing new date
+		 */
+		public DateTime setDate(DateTime date, DateTime newDate) {
+			
+			if (date == null || newDate == null)
+				return date;
+			
+			return new DateTime(newDate.getYear(), 
+								newDate.getMonthOfYear(), 
+								newDate.getDayOfMonth(), 
+								date.getHourOfDay(), 
+								date.getMinuteOfHour(), 
+								date.getSecondOfMinute(), 
+								date.getMillisOfSecond());
+			
+		}
+		
+		
+		/**
+		 * Set time within a day from newTime Calendar object into date Calendar object.
+		 * Date (year, month, day) is not set.
+		 * @return Calendar object representing new time
+		 */
+		public DateTime setDayTime(DateTime date, DateTime newTime) {
+			
+			if (date == null || newTime == null)
+				return date;
+			
+			return new DateTime(date.getYear(),
+								date.getMonthOfYear(),
+								date.getDayOfMonth(),
+								newTime.getHourOfDay(),
+								newTime.getMinuteOfHour(),
+								newTime.getSecondOfMinute(),
+								newTime.getMillisOfSecond());
+			
+		}
+
+		//end of operations on date and time
+		
+		
+		//Operations on periods
+
+		/**
+		 * Calculate period duration in milis
+		 * @param start
+		 * @param end
+		 * @return period duration in milis
+		 */
+		public long periodDuration(DateTime start, DateTime end) {
+			
+			if (start == null || end == null)
+				  return 0;
+			
+			return end.getMillis() - start.getMillis();
+		}
+
+		/**
+		 * Calculate period duration in milis taking into account time only, i.e.
+		 * hour, minute, second, milis (without year, month, and day)
+		 * @param start
+		 * @param end
+		 * @return period duration in milis
+		 */
+		public long periodDayTimeDuration(DateTime start, DateTime end) {
+
+			if (start == null && end == null)
+				  return TWENTY_FOUR_HOURS;
+
+			if (start == null) {
+				start = new DateTime(end.getYear(),
+									end.getMonthOfYear(),
+									end.getDayOfMonth(),
+									0, 0, 0, 0);
+			}
+			
+			if (end == null) {
+				end = new DateTime(start.getYear(),
+									start.getMonthOfYear(),
+									start.getDayOfMonth(),
+									23, 59, 59, 999);
+			}	
+			
+			//setting the same date
+			DateTime newEnd = new DateTime(start.getYear(),
+											start.getMonthOfYear(),
+											start.getDayOfMonth(),
+											end.getHourOfDay(),
+											end.getMinuteOfHour(),
+											end.getSecondOfMinute(),
+											end.getMillisOfSecond()
+										);
+
+			if (beforeDayTime(start, newEnd))
+				return newEnd.getMillis() - start.getMillis();
+			else
+				return TWENTY_FOUR_HOURS - (start.getMillis() - newEnd.getMillis()); 
+		}
+		
+		/**
+		 * Check whether date is before given period. Only time is taken into account, i.e.
+		 * hour, minute, second, milis (without year, month, and day)
+		 * @param date - date to be checked
+		 * @param start - begin of period
+		 * @param end - end of period
+		 * @return true if date is before a period; false otherwise
+		 */
+		public boolean beforePeriodDayTime(DateTime date, DateTime start, DateTime end) {
+
+		  	if (date == null)
+		  		return false;
+
+		  	if (start == null)
+		  		return false;
+		  	
+		  	if (end == null)
+		  		return beforeDayTime(date, start);
+		  	
+		  	//date is not before start
+		  	if(!beforeDayTime(date, start))
+		  		return false;
+		  	
+		  	//end of period is next day
+		  	if(afterDayTime(start, end))
+		  		if(!afterDayTime(date, end))
+		  			return false;
+		  	
+		  	return true;
+		}
+		
+		/**
+		 * Check whether a period, whose length is given by duration, is within a period
+		 * defined by start and end. 
+		 * @param date - date to be checked
+		 * @param duration - duration of a period to be checked
+		 * @param start - begin of period
+		 * @param end - end of period
+		 * @return true if a period is within the period <start, end>; false otherwise
+		 */
+		public boolean withinPeriod(DateTime date, long duration, DateTime start, DateTime end) {
+
+			if (date == null)
+		  		return false;
+
+		  	if (start == null || end == null)
+		  		return true;
+		  
+		  	if (date.isBefore(start) || (date.getMillis() + duration + timeDelta > end.getMillis()))
+		  		  	return false;
+			
+		    return true;
+		}
+
+		/**
+		 * Check whether a period, whose length is given by duration, is within a period
+		 * defined by start and end. 
+		 * @param duration - duration of a period to be checked
+		 * @param start - begin of period
+		 * @param end - end of period
+		 * @return true if a period is within the period <start, end>; false otherwise
+		 */
+		public boolean withinPeriod(long duration, DateTime start, DateTime end) {
+
+		  	if (start == null || end == null)
+		  		return true;
+		  
+		  	if (start.getMillis() + duration + timeDelta > end.getMillis())
+		  		  	return false;
+			
+		    return true;
+		}
+		
+		/**
+		 * Check whether date is within a period
+		 * defined by start and end. Only time is taken into account, i.e.
+		 * hour, minute, second, milis (without year, month, and day)
+		 * @param date - date to be checked
+		 * @param start - begin of period
+		 * @param end - end of period
+		 * @return true if date is within the period <start, end>; false otherwise
+		 */
+		public boolean withinPeriodDayTime(DateTime date, DateTime start, DateTime end) {
+
+			if (date == null)
+		  		return false;
+
+		  	if (start == null && end == null)
+		  		return false;
+		  	
+		  	if (start == null)
+		  		return !afterDayTime(date, end);
+		  	
+		  	if (end == null)
+		  		return !beforeDayTime(date, start);
+
+		  	if (afterDayTime(start, end)){
+		  		if (beforeDayTime(date, start) && afterDayTime(date, end))
+		  		  	return false;
+		  	} 
+		  	else {
+		  		if (beforeDayTime(date, start) || afterDayTime(date, end))
+		  			return false;
+		  	}
+			
+		    return true;
+		}
+
+		/**
+		 * Check whether a period, whose length is given by duration, is within a period
+		 * defined by start and end. Only time is taken into account, i.e.
+		 * hour, minute, second, milis (without year, month, and day)
+		 * @param date - date to be checked
+		 * @param duration - duration of a period to be checked
+		 * @param start - begin of period
+		 * @param end - end of period
+		 * @return true if a period is within the period <start, end>; false otherwise
+		 */
+		public boolean withinPeriodDayTime(DateTime date, long duration, DateTime start, DateTime end) {
+
+			if (date == null)
+		  		return false;
+
+			if (start == null && end == null)
+				return true;
+			
+		  	if (start == null)
+		  		return !afterDayTime(date, duration, end);
+		  	
+		  	if (end == null)
+		  		return !beforeDayTime(date, duration, start);
+		  	
+		  	if (afterDayTime(start, end)){
+		  		if (beforeDate(date, start) && afterDayTime(date, duration, end))
+		  		  	return false;
+		  	}
+		  	else {
+		  		if (beforeDate(date, start) || afterDayTime(date, duration, end))
+		  			return false;
+		  	}
+			
+		    return true;
+		}
+
+		/**
+		 * Check whether a period, whose length is given by duration, overlaps a period
+		 * defined by start and end. Only time is taken into account, i.e.
+		 * hour, minute, second, milis (without year, month, and day)
+		 * @param date - date to be checked
+		 * @param duration - duration of a period to be checked
+		 * @param start - begin of period
+		 * @param end - end of period
+		 * @return true if a period overlaps with the period <start, end>; false otherwise
+		 */
+		public boolean overlapPeriodDayTime(DateTime date, long duration, DateTime start, DateTime end) {
+
+			if (date == null)
+		  		return false;
+
+			if (start == null && end == null)
+				return true;
+			
+			if (start == null)
+				return beforeDayTime(date, end);
+		  	
+		  	if (end == null)
+		  		return !beforeDayTime(date, duration, start);
+		  	
+		  	if (afterDayTime(start, end)){
+		  		if (!beforeDate(date, end) && !afterDayTime(date, duration, start))
+		  		  	return false;
+		  	} 
+		  	else {
+		  		if (!beforeDate(date, end) || !afterDayTime(date, duration, start))
+		  			return false;
+		  	}
+			
+		    return true;
+		}
+		
+		/**
+		 * Check whether date is after given period. Only time is taken into account, i.e.
+		 * hour, minute, second, milis (without year, month, and day)
+		 * @param date - date to be checked
+		 * @param start - begin of period
+		 * @param end - end of period
+		 * @return true if date is after a period; false otherwise
+		 */
+		public boolean afterPeriodDayTime(DateTime date, DateTime start, DateTime end) {
+
+			if (date == null)
+		  		return false;
+
+		  	if (end == null)
+		  		return false;
+		  	
+		  	if (start == null)
+		  		return afterDayTime(date, end);
+		  	
+		  	//date is not after end
+		  	if (!afterDayTime(date, end))
+		  		return false;
+		  	
+		  	//end of period is next day
+		  	if (afterDayTime(start, end))
+		  		if (!beforeDate(date, start))
+		  		  	return false;
+
+		  	return true;
+		}
+
+		//end of operations on periods
+		
+		
+		//Operations on lists of dates
+
+		/**
+		 * Find date in list of dates
+		 * @param date - date to be found
+		 * @param days - Vector containing Calendar objects
+		 * @return true if data is found; false otherwise
+		 */
+		public boolean findDate(DateTime date, ArrayList<DateTime> days) {
+		    
+		    if (days == null)
+		      return false;
+			  
+		    for (int i=0; i < days.size(); i++) {
+		      DateTime vDate = days.get(i);
+			      
+		      if (!sameDate(date, vDate))
+		    	  continue;
+			    	  
+		      return true;
+		    }
+			    
+		    return false;
+		  }
+
+		  /**
+		   * Find the latest date in inclDates that is not found in exclDates
+		   * @param inclDates
+		   * @param exclDates
+		   * @return the latest date
+		   */
+		  public DateTime findLatestDate(ArrayList <DateTime>inclDates, ArrayList<DateTime> exclDates) {
+			  	
+			  if (inclDates == null)
+				  return null;
+			  
+			  DateTime latest = new DateTime(); //Calendar.getInstance();
+			  
+			  for (int i=0; i < inclDates.size(); i++)
+				if (beforeDate(latest, inclDates.get(i)))
+					if (!findDate(inclDates.get(i), exclDates))
+						latest = inclDates.get(i);
+					
+			  return latest;
+		  }
+		  
+		//end of operations on lists of dates
+		  
+		/**
+		 * Get DateTime object representing current time
+		 * This method can be overloaded to return logic time, e.g. in simulations
+		 * @return current time
+		 */
+		public DateTime getTime() {
+			return new DateTime();
+		}
+
+}
+
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 477)
@@ -0,0 +1,749 @@
+package schedframe.scheduling.policy.local;
+
+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 java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+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.joda.time.DateTimeUtilsExt;
+import org.qcg.broker.schemas.schedulingplan.types.AllocationStatus;
+
+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;
+import schedframe.exceptions.ResourceException;
+import schedframe.resources.computing.ComputingResource;
+import schedframe.resources.computing.profiles.energy.EnergyEvent;
+import schedframe.resources.computing.profiles.energy.EnergyEventType;
+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.UsedResourceList;
+import schedframe.scheduling.WorkloadUnitHandler;
+import schedframe.scheduling.WorkloadUnitListImpl;
+import schedframe.scheduling.manager.resources.LocalResourceManager;
+import schedframe.scheduling.manager.resources.ManagedResources;
+import schedframe.scheduling.manager.resources.ResourceManager;
+import schedframe.scheduling.plan.AllocationInterface;
+import schedframe.scheduling.plan.ScheduledTaskInterface;
+import schedframe.scheduling.plan.SchedulingPlanInterface;
+import schedframe.scheduling.plugin.SchedulingPlugin;
+import schedframe.scheduling.plugin.estimation.ExecutionTimeEstimationPlugin;
+import schedframe.scheduling.plugin.grid.ModuleListImpl;
+import schedframe.scheduling.plugin.grid.ModuleType;
+import schedframe.scheduling.policy.AbstractManagementSystem;
+import schedframe.scheduling.queue.TaskQueueList;
+import schedframe.scheduling.tasks.AbstractProcesses;
+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.utils.DoubleMath;
+
+public class LocalManagementSystem extends AbstractManagementSystem {
+
+	private Log log = LogFactory.getLog(LocalManagementSystem.class);
+
+	protected double lastUpdateTime;
+
+	protected Accumulator accTotalLoad;
+
+	public LocalManagementSystem(String providerId, String entityName, SchedulingPlugin schedPlugin,
+			ExecutionTimeEstimationPlugin execTimeEstimationPlugin, TaskQueueList queues)
+			throws Exception {
+
+		super(providerId, entityName, execTimeEstimationPlugin, queues);
+
+		//schedulingPlugin = (LocalSchedulingPlugin) InstanceFactory.createInstance(schedulingPluginClassName, LocalSchedulingPlugin.class);
+		
+		if (schedPlugin == null) {
+			throw new Exception("Can not create local scheduling plugin instance.");
+		}
+		this.schedulingPlugin =  schedPlugin;
+		accTotalLoad = new Accumulator();
+		moduleList = new ModuleListImpl(1);
+
+	}
+
+	public void init(Scheduler sched, ManagedResources managedResources) {
+		super.init(sched, managedResources);
+		//scheduler = sched;
+		//resourceManager = ResourceManagerFactory.createResourceManager(scheduler);
+		double load = 0;
+		accTotalLoad.add(load);
+	}
+
+	public void processEvent(Sim_event ev) {
+
+		updateProcessingProgress();
+
+		int tag = ev.get_tag();
+		Object obj;
+
+		switch (tag) {
+
+		case WormsTags.TIMER:
+			if (pluginSupportsEvent(tag)) {
+				SchedulingEvent event = new SchedulingEvent(SchedulingEventType.TIMER);
+				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);
+				if (pluginSupportsEvent(tag)) {
+					SchedulingEvent event = new StartTaskExecutionEvent(data.getJobId(), data.getId());
+					SchedulingPlanInterface decision =  schedulingPlugin.schedule(event,
+							queues,  getJobRegistry(), getResourceManager(), moduleList);
+					executeSchedulingPlan(decision);
+				}
+			} catch (Exception e) {
+				e.printStackTrace();
+			}
+			break;
+
+		case WormsTags.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));
+				}
+				SubTaskFilter filter = new SubTaskFilter(task.getGridletID(), GssimTags.TASK_REQUESTED_TIME_EXPIRED);
+				scheduler.sim_cancel(filter, null);
+				super.sendFinishJob((Executable) task.getGridlet());*/
+			}
+			if (pluginSupportsEvent(tag)) {
+				SchedulingEvent event = new TaskFinishedEvent(task.getJobId(), task.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:
+			updateProcessingTimes(ev);
+			break;
+		}
+	}
+	
+
+	public void notifyReturnedWorkloadUnit(WorkloadUnit<?> wu) {
+		if (pluginSupportsEvent(WormsTags.TASK_EXECUTION_FINISHED)) {
+			SchedulingEvent event = new SchedulingEvent(SchedulingEventType.TASK_FINISHED);
+			SchedulingPlanInterface decision =  schedulingPlugin.schedule(event,
+					queues, getJobRegistry(), getResourceManager(), moduleList);
+			executeSchedulingPlan(decision);
+		}
+		//if(scheduler.getParent() != null){
+			sendFinishedWorkloadUnit(wu);
+		//}
+	}
+
+	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();
+		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;
+				}
+
+				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;
+		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();
+		log.debug(task.getJobId() + "_" + task.getId() + " starts executing on " + new DateTime()
+				+ " will finish after " + time);
+
+		if (time < 0.0)
+			return;
+
+		submittedTask.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);
+
+		try {
+			long expectedDuration = submittedTask.getExpectedDuration().getMillis() / 1000;
+			scheduler.sendInternal(expectedDuration, WormsTags.TASK_REQUESTED_TIME_EXPIRED, submittedTask);
+		} 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()));
+		
+		PEUnit peUnit = (PEUnit)choosenResources.get(StandardResourceUnitName.PE);
+		if(peUnit instanceof ProcessingElements){
+			ProcessingElements pes = (ProcessingElements) peUnit;
+			for (ComputingResource resource : pes) {
+				resource.handleEvent(new EnergyEvent(EnergyEventType.TASK_FINISHED, submittedTask));
+			}
+		} else {
+			ComputingResource resource = null;
+			try {
+				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));
+		}*/
+
+		/*for(ExecTaskInterface etask : jobRegistry.getRunningTasks()){
+			System.out.println(etask.getJobId());
+			for(String taskId: etask.getVisitedResources())
+				System.out.println("====="+taskId);
+		}*/
+	}
+	
+	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);
+		scheduler.sim_cancel(filter, null);
+		
+		Executable executable = (Executable) subTask.getGridlet();
+		Job job = jobRegistry.get(executable.getJobId());
+
+		Task task = null;
+		try {
+			task = job.getTask(executable.getTaskId());
+		} catch (NoSuchFieldException e) {
+			e.printStackTrace();
+		}
+		if(executable.getProcessesId() == null){
+			try {
+				task.setStatus(executable.getStatus());
+			} catch (Exception e) {
+				e.printStackTrace();
+			}
+		} else {
+			List<AbstractProcesses> processesList = task.getProcesses();
+			for(int i = 0; i < processesList.size(); i++){
+				AbstractProcesses processes = processesList.get(i);
+				if(processes.getId().equals(executable.getProcessesId())){
+					processes.setStatus(executable.getStatus());
+					break;
+				}
+			}
+		}
+		//sendFinishedWorkloadUnit(executable);
+	}
+	
+	protected void updateProcessingProgress() {
+		double timeSpan = DoubleMath.subtract(Sim_system.clock(), lastUpdateTime);
+		if (timeSpan <= 0.0) {
+			// don't update when nothing changed
+			return;
+		}
+		lastUpdateTime = Sim_system.clock();
+		Iterator<ExecTask> iter = jobRegistry.getRunningTasks().iterator();
+		while (iter.hasNext()) {
+			ExecTask task = iter.next();
+			SubmittedTask subTask = (SubmittedTask)task;
+			UsedResourceList<ResourceHistoryItem> usedResourcesList = subTask.getUsedResources();
+			ResourceUnit unit = usedResourcesList.getLast().getResourceUnits()
+					.get(StandardResourceUnitName.PE);
+
+			double load = getMIShare(timeSpan, (PEUnit) unit);
+			subTask.updateGridletFinishedSoFar(load);
+			addTotalLoad(load);
+		}
+	}
+
+	private double getMIShare(double timeSpan, PEUnit pes) {
+		double localLoad;
+		ResourceCalendar resCalendar = (ResourceCalendar) moduleList.getModule(ModuleType.RESOURCE_CALENDAR);
+		if (resCalendar == null)
+			localLoad = 0;
+		else
+			// 1 - localLoad_ = available MI share percentage
+			localLoad = resCalendar.getCurrentLoad();
+
+		int speed = pes.getSpeed();
+		int cnt = pes.getAmount();
+
+		double totalMI = speed * cnt * timeSpan * (1 - localLoad);
+		return totalMI;
+	}
+
+	protected void updateProcessingTimes(Sim_event ev) {
+		updateProcessingProgress();
+		for (ExecTask task : jobRegistry.getRunningTasks()) {
+			SubmittedTask subTask = (SubmittedTask)task;
+			List<String> visitedResource = subTask.getVisitedResources();
+			String originResource = ev.get_data().toString();
+			if(!ArrayUtils.contains(visitedResource.toArray(new String[visitedResource.size()]), originResource)){
+				continue;
+			}
+			
+			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())) {
+				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);
+			scheduler.sim_cancel(filter, null);
+			scheduler.sendInternal(time, WormsTags.TASK_EXECUTION_FINISHED, task);
+
+		}
+	}	
+
+	public double calculateTotalLoad(int size) {
+		// background load, defined during initialization
+		double load;
+		ResourceCalendar resCalendar = (ResourceCalendar) moduleList.getModule(ModuleType.RESOURCE_CALENDAR);
+		if (resCalendar == null)
+			load = 0;
+		else
+			load = resCalendar.getCurrentLoad();
+
+		int numberOfPE = 0;
+		try {
+			for(ResourceUnit resUnit : getResourceManager().getPE()){
+				numberOfPE = numberOfPE + resUnit.getAmount();
+			}
+			//numberOfPE = getResourceManager().getPE().size();
+		} catch (Exception e) {
+			numberOfPE = 1;
+		}
+		double tasksPerPE = (double) size / numberOfPE;
+		load += Math.min(1.0 - load, tasksPerPE);
+
+		return load;
+	}
+
+	public Accumulator getTotalLoad() {
+		return accTotalLoad;
+	}
+
+	protected void addTotalLoad(double load) {
+		accTotalLoad.add(load);
+	}
+	
+	private Map<ResourceUnitName, ResourceUnit> chooseResourcesForExecution(String resourceName,
+			ExecTask task) {
+
+		ResourceManager resourceManager = this.resourceManager;
+		if(resourceName != null){
+			ComputingResource resource = null;
+			try {
+				resource = resourceManager.getResourceByName(resourceName);
+			} catch (ResourceException e) {
+				return null;
+			}
+
+			resourceManager = new LocalResourceManager(resource);
+		}
+		Map<ResourceUnitName, ResourceUnit> map = new HashMap<ResourceUnitName, ResourceUnit>();
+
+
+		int cpuRequest;
+		try {
+			cpuRequest = Double.valueOf(task.getCpuCntRequest()).intValue();
+		} catch (NoSuchFieldException e) {
+			cpuRequest = 1;
+		}
+
+		//PEUnit processingUnits = null;
+		if (cpuRequest != 0) {
+			
+			List<ResourceUnit> availableUnits = null;
+			try {
+				availableUnits = getResourceManager().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);
+				if(peUnit.getFreeAmount() > 0){
+					int  allocPE = Math.min(peUnit.getFreeAmount(), cpuRequest);
+					cpuRequest = cpuRequest - allocPE;
+					choosenPEUnits.add(peUnit.replicate(allocPE));	
+				}	
+			}
+			
+			if(cpuRequest > 0){
+				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) {
+		updateProcessingProgress();
+		registerWorkloadUnit(job);
+	}
+
+	private void registerWorkloadUnit(WorkloadUnit<?> wu){
+		if(!wu.isRegistered()){
+			wu.register(jobRegistry);
+		}
+		wu.accept(getWorkloadUnitHandler());
+	}
+	
+	class LocalWorkloadUnitHandler implements WorkloadUnitHandler{
+		
+		public void handleJob(Job job){
+
+			if (log.isInfoEnabled())
+				log.info("Received job " + job.getId() + " at " + new DateTime(DateTimeUtilsExt.currentTimeMillis()));
+
+			List<JobInterface<?>> jobsList = new ArrayList<JobInterface<?>>();
+			jobsList.add(job);
+			WorkloadUnitListImpl readyTasks = new WorkloadUnitListImpl();
+			for(Task task: jobRegistry.getReadyTasks(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){
+				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());
+					registerWorkloadUnit(exec);
+				}
+			}
+		}
+		
+		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());
+			Scheduler parentScheduler = scheduler.getParent();
+			while (parentScheduler != null && !exec.getVisitedResources().contains(parentScheduler.get_name())) {
+				exec.visitResource(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) {
+				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);
+			}
+		}
+	}
+
+	public WorkloadUnitHandler getWorkloadUnitHandler() {
+		return new LocalWorkloadUnitHandler();
+	}
+	
+	
+	public LocalResourceManager getResourceManager() {
+		if (resourceManager instanceof ResourceManager)
+			return (LocalResourceManager) resourceManager;
+		else
+			return null;
+	}
+	
+}
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 477)
@@ -0,0 +1,67 @@
+package schedframe.scheduling.policy.global;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import schedframe.scheduling.GridResourceDiscovery;
+import schedframe.scheduling.Scheduler;
+import schedframe.scheduling.manager.resources.ManagedResources;
+import schedframe.scheduling.plugin.SchedulingPlugin;
+import schedframe.scheduling.plugin.estimation.ExecutionTimeEstimationPlugin;
+import schedframe.scheduling.plugin.grid.ModuleListImpl;
+import schedframe.scheduling.queue.TaskQueueList;
+
+public class GridBroker extends GlobalManagementSystem { 
+
+	
+	private static Log log = LogFactory.getLog(GridBroker.class);
+
+	protected Set<Integer> otherGridSchedulersIds;
+
+
+	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);
+	}
+
+	public List<Integer> getMyGridResources() {
+		List<Integer> providerIds = new ArrayList<Integer>();
+		for(Scheduler sched: scheduler.getChildren()){
+			providerIds.add(sched.get_id());
+		}
+		return providerIds;
+		//return GridSim.getGridResourceList();
+	}
+
+	public void addOtherGridSchedulerId(int id){
+		otherGridSchedulersIds.add(id);
+	}
+	
+
+}
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 477)
@@ -0,0 +1,306 @@
+package schedframe.scheduling.policy.global;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.exolab.castor.types.Duration;
+import org.joda.time.DateTime;
+import org.joda.time.DateTimeUtilsExt;
+import org.qcg.broker.schemas.schedulingplan.types.AllocationStatus;
+
+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.WorkloadUnitHandler;
+import schedframe.scheduling.WorkloadUnitListImpl;
+import schedframe.scheduling.plan.AllocationInterface;
+import schedframe.scheduling.plan.ScheduledTaskInterface;
+import schedframe.scheduling.plan.SchedulingPlanInterface;
+import schedframe.scheduling.plugin.SchedulingPlugin;
+import schedframe.scheduling.plugin.estimation.ExecutionTimeEstimationPlugin;
+import schedframe.scheduling.policy.AbstractManagementSystem;
+import schedframe.scheduling.queue.TaskQueueList;
+import schedframe.scheduling.tasks.AbstractProcesses;
+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;
+
+public class GlobalManagementSystem extends AbstractManagementSystem {
+
+	private static Log log = LogFactory.getLog(GlobalManagementSystem.class);
+
+	public GlobalManagementSystem(String providerId, String entityName, SchedulingPlugin schedPlugin,
+			ExecutionTimeEstimationPlugin execTimeEstimationPlugin, TaskQueueList queues)
+			throws Exception {
+		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");
+		}
+		
+		this.schedulingPlugin =  schedPlugin;
+	}
+
+	public void processEvent(Sim_event ev) {
+
+		int tag = ev.get_tag();
+		switch (tag) {
+
+		case WormsTags.TIMER:
+			if (pluginSupportsEvent(WormsTags.TIMER)) {
+				TimerEvent event = new  TimerEvent();
+				SchedulingPlanInterface decision =  schedulingPlugin.schedule(event, 
+						queues,  getJobRegistry(), getResourceManager(), moduleList);
+				executeSchedulingPlan(decision);
+			}
+			sendTimerEvent();
+			break;
+		}
+	}
+	
+	public void notifySubmittedWorkloadUnit(WorkloadUnit<?> wu, boolean ack) {
+		if (!pluginSupportsEvent(GridSimTags.GRIDLET_SUBMIT)) {
+			log.error("Plugin " + schedulingPlugin.getClass()
+					+ " does not provide support for TASK_ARRIVED event.\n"
+					+ "Check plugin configuration or use default one.");
+			return;
+		}
+		
+		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());*/
+
+	}
+	
+	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;
+
+			executeSchedulingPlan(decision);
+
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+	}
+	
+	public void notifyReturnedWorkloadUnit(WorkloadUnit<?> wu) {
+		Executable exec = (Executable) wu;
+
+		long duration = Double.valueOf(exec.getFinishTime() - exec.getExecStartTime()).longValue();
+		log.debug("Executable " + exec.getJobId() + "_" + exec.getId() + "\nstart time:  " + 
+				new java.util.Date(Double.valueOf(exec.getExecStartTime()).longValue() * 1000) 
+		+ "\nfinish time: " + new java.util.Date(Double.valueOf(exec.getFinishTime()).longValue() * 1000)
+		+ "\nduration: " + new Duration(duration * 1000));
+		
+		try {
+			Job job = jobRegistry.get(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 {
+				List<AbstractProcesses> processesList = task.getProcesses();
+				for(int i = 0; i < processesList.size(); i++){
+					AbstractProcesses processes = processesList.get(i);
+					if(processes.getId().equals(exec.getProcessesId())){
+						processes.setStatus(exec.getStatus());
+						break;
+					}
+				}
+			}*/
+			
+			if(job.isFinished()){
+				scheduler.send(job.getSenderId(), GridSimTags.SCHEDULE_NOW, GridSimTags.GRIDLET_RETURN, job);
+			}
+			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());*/
+			}
+			
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+
+	}
+
+	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();
+		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) {
+
+		String providerName = allocation.getProviderName();
+		if (providerName == null) {
+			return;
+		}
+		TaskInterface<?> task = (TaskInterface<?>) job;
+		removeFromQueue(task);
+		
+		int resID = GridSim.getEntityId(providerName);
+		IO_data data = new IO_data(job, 0, resID);
+		scheduler.send(scheduler.getOutputPort(), GridSimTags.SCHEDULE_NOW, GridSimTags.GRIDLET_SUBMIT, data);	
+		
+		//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();
+			}
+	}
+
+	class GlobalWorkloadUnitHandler implements  WorkloadUnitHandler{
+
+		public void handleJob(Job job){
+
+			jobRegistry.addJob(job);
+			if (log.isInfoEnabled())
+				log.info("Received job " + job.getId() + " at " + new DateTime(DateTimeUtilsExt.currentTimeMillis()));
+
+			scheduleReadyTasks(job);
+		}
+		
+		public void handleTask(TaskInterface<?> task) {
+			throw new RuntimeException("Not implemented since it isn't expected that tasks are send directly to the global scheduler.");
+		}
+
+		public void handleExecutable(ExecTask task) {
+			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.");
+		}
+	}
+
+	public WorkloadUnitHandler getWorkloadUnitHandler() {
+		return new GlobalWorkloadUnitHandler();
+	}
+	
+
+
+}
Index: DCWoRMS/trunk/build/classes/schedframe/scheduling/policy/ManagementSystem.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/scheduling/policy/ManagementSystem.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/scheduling/policy/ManagementSystem.java	(revision 477)
@@ -0,0 +1,15 @@
+package schedframe.scheduling.policy;
+
+import schedframe.Plugin;
+
+public interface ManagementSystem {
+
+	public Plugin getPlugin();
+	
+	public void notifySubmittedTask();
+	
+	public void notifyCanceledTask();
+	
+	public void notifyReturnedTask();
+
+}
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 477)
@@ -0,0 +1,264 @@
+package schedframe.scheduling.policy;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.joda.time.DateTimeUtilsExt;
+
+import schedframe.PluginConfiguration;
+import schedframe.events.scheduling.SchedulingEventType;
+import schedframe.resources.units.StandardResourceUnitName;
+import schedframe.scheduling.Scheduler;
+import schedframe.scheduling.WorkloadUnitHandler;
+import schedframe.scheduling.manager.resources.ManagedResources;
+import schedframe.scheduling.manager.resources.ResourceManager;
+import schedframe.scheduling.manager.resources.ResourceManagerFactory;
+import schedframe.scheduling.manager.tasks.JobRegistryImpl;
+import schedframe.scheduling.manager.tasks.JobRegistry;
+import schedframe.scheduling.plan.AllocationInterface;
+import schedframe.scheduling.plan.SchedulingPlanInterface;
+import schedframe.scheduling.plugin.SchedulingPlugin;
+import schedframe.scheduling.plugin.estimation.ExecutionTimeEstimationPlugin;
+import schedframe.scheduling.plugin.grid.ModuleList;
+import schedframe.scheduling.plugin.local.ResourceAllocationInterface;
+import schedframe.scheduling.queue.TaskQueue;
+import schedframe.scheduling.queue.TaskQueueList;
+import schedframe.scheduling.tasks.Job;
+import schedframe.scheduling.tasks.WorkloadUnit;
+import simulator.WormsConstants;
+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;
+
+public abstract class AbstractManagementSystem {
+
+	private Log log = LogFactory.getLog(AbstractManagementSystem.class);
+	
+	protected String name;
+
+	protected ResourceManager resourceManager;
+
+	protected TaskQueueList queues;
+
+	protected SchedulingPlugin schedulingPlugin;
+
+	protected ExecutionTimeEstimationPlugin execTimeEstimationPlugin;
+
+	protected ModuleList moduleList;
+	
+	protected JobRegistryImpl jobRegistry;
+	
+
+	public AbstractManagementSystem(String providerId, String entityName,
+			ExecutionTimeEstimationPlugin execTimeEstPlugin, TaskQueueList queues) {
+		
+		this.name = entityName + "@" + providerId;
+		this.queues = queues;
+		this.jobRegistry = new JobRegistryImpl(name);
+		this.execTimeEstimationPlugin = execTimeEstPlugin;
+	}
+	
+	public void processEvent(Sim_event ev) {
+		processOtherEvent(ev);
+	}
+
+	protected void processOtherEvent(Sim_event ev) {
+		if (ev == null) {
+			System.out.println(name + ".processOtherEvent(): " + "Error - an event is null.");
+			return;
+		}
+
+		log.error(name + ".processOtherEvent(): Unable to "
+				+ "handle request from an event with a tag number " + ev.get_tag());
+	}
+	
+	public String getName() {
+		return name;
+	}
+
+	public PluginConfiguration getSchedulingPluginConfiguration() {
+		return schedulingPlugin.getConfiguration();
+	}
+	
+	public ResourceManager getResourceManager() {
+		if (resourceManager instanceof ResourceManager)
+			return (ResourceManager) resourceManager;
+		else
+			return null;
+	}
+
+	public ResourceAllocationInterface getAllocationManager() {
+		if (resourceManager instanceof ResourceAllocationInterface)
+			return (ResourceAllocationInterface) resourceManager;
+		else
+			return null;
+	}
+
+	protected JobRegistry getJobRegistry(){
+		return jobRegistry;
+	}
+
+	public boolean pluginSupportsEvent(int eventType){
+		return true;
+	}
+
+	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);
+
+
+
+	//POPRAWIC  (ale co? bo teraz chyba jest ok)
+	protected void submitWorkloadUnit(WorkloadUnit<?> wu, 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) {
+		
+		Executable exec = (Executable) wu;
+		if(scheduler.getParent() == null)
+		{
+			Job job = jobRegistry.get(exec.getJobId());
+
+			if(job.isFinished()){
+				scheduler.send(job.getSenderId(), GridSimTags.SCHEDULE_NOW, GridSimTags.GRIDLET_RETURN, job);
+				return true;
+			}else return true;
+		}
+	
+        IO_data obj = new IO_data(exec, 0, /*task.getGridletOutputSize(),*/ GridSim.getEntityId(scheduler.getParent().get_name()));
+        scheduler.send(scheduler.getOutputPort(), 0.0, GridSimTags.GRIDLET_RETURN, obj);
+		return true;
+	}
+
+	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;
+		try {
+			long expectedStartTime = exec.getExecutionStartTime().getMillis() / 1000;
+			long currentTime = DateTimeUtilsExt.currentTimeMillis() / 1000;
+			delay = expectedStartTime - currentTime;
+			if (delay < 0)
+				delay = 0;
+		} catch (NoSuchFieldException e) {
+			delay = 0;
+		}
+
+		scheduler.sendInternal(Long.valueOf(delay).doubleValue(), WormsTags.TASK_READY_FOR_EXECUTION,
+				exec);
+	}
+	
+	protected void sendTimerEvent() {
+		PluginConfiguration pluginConfig = schedulingPlugin.getConfiguration();
+		if (pluginConfig != null) {
+			Map<SchedulingEventType, Object> events = pluginConfig.getServedEvents();
+			if (events != null) {
+				Object obj = events.get(SchedulingEventType.TIMER);
+				if (obj != null) {
+					int delay = (Integer) obj;
+					scheduler.sendInternal(delay, WormsTags.TIMER, null);
+				}
+			}
+		}
+	}
+	
+	protected boolean removeFromQueue(WorkloadUnit<?> wu) {
+		for(TaskQueue queue : queues){
+			if(queue.contains(wu)){
+				queue.remove(wu);
+				return true;
+			}
+		}
+		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();
+
+}
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 477)
@@ -0,0 +1,17 @@
+package schedframe.scheduling;
+
+import schedframe.scheduling.tasks.Job;
+import schedframe.scheduling.tasks.SubmittedTask;
+import schedframe.scheduling.tasks.TaskInterface;
+import gssim.schedframe.scheduling.ExecTask;
+
+public 	interface WorkloadUnitHandler{
+	
+	public void handleJob(Job 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 477)
@@ -0,0 +1,41 @@
+package schedframe.scheduling;
+
+import java.util.List;
+import java.util.Map;
+
+import schedframe.resources.ResourceType;
+import schedframe.resources.providers.LocalSystem;
+import schedframe.resources.units.ResourceUnit;
+import schedframe.resources.units.ResourceUnitName;
+import schedframe.scheduling.manager.resources.ManagedResources;
+import schedframe.scheduling.policy.AbstractManagementSystem;
+import eduni.simjava.Sim_event;
+import gridsim.GridSimTags;
+import gridsim.IO_data;
+import gridsim.gssim.WormsTags;
+
+public class Cluster extends Scheduler{
+	
+	public Cluster(AbstractManagementSystem manSys, ResourceType schedType, ManagedResources managedResources) throws Exception {
+		super(manSys, schedType, managedResources);
+	}
+
+	protected void processOtherRequest(Sim_event ev) {
+		switch (ev.get_tag()) {
+		case WormsTags.QUERY_RESOURCE_DESC:
+			SchedulerDescription desc = new SchedulerDescription(new LocalSystem(get_name(), null, null));
+			Map<ResourceUnitName, List<ResourceUnit>> units = managementSystem.getResourceManager().getSharedResourceUnits();
+			desc.addResourceUnitList(units);
+			desc.addQueuesDescription(getQueuesDescription());
+
+			IO_data data = new IO_data(desc, 0, ev.get_src());
+			send(ev.get_src(), GridSimTags.SCHEDULE_NOW, WormsTags.QUERY_RESOURCE_DESC_RESULT, data);
+			break;
+
+		default:
+			managementSystem.processEvent(ev);
+			break;
+		}
+	}
+	
+}
Index: DCWoRMS/trunk/build/classes/schedframe/scheduling/SchedulerDescription.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/scheduling/SchedulerDescription.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/scheduling/SchedulerDescription.java	(revision 477)
@@ -0,0 +1,64 @@
+package schedframe.scheduling;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import schedframe.resources.StandardResourceType;
+import schedframe.resources.computing.description.ExecutingResourceDescription;
+import schedframe.resources.providers.ResourceProvider;
+import schedframe.resources.units.AbstractResourceUnit;
+import schedframe.resources.units.ResourceUnit;
+import schedframe.resources.units.ResourceUnitName;
+import schedframe.scheduling.queue.QueueDescription;
+
+public class SchedulerDescription extends ExecutingResourceDescription{
+
+	protected ResourceProvider provider;
+	protected List<QueueDescription> accesQueues;
+
+	public SchedulerDescription(ResourceProvider provider){
+		super(StandardResourceType.ResourceProvider);
+		this.id = provider.getProviderId();
+		this.provider = provider;
+		this.resUnits = new HashMap<ResourceUnitName, List<ResourceUnit>>();
+		this.accesQueues = new ArrayList<QueueDescription>(1);
+	}
+	
+	public SchedulerDescription(String id){
+		super(StandardResourceType.ResourceProvider);
+		this.id = id;
+		this.provider = new ResourceProvider(id, null, null, null);
+		this.resUnits = new HashMap<ResourceUnitName, List<ResourceUnit>>();
+		this.accesQueues = new ArrayList<QueueDescription>(1);
+	}
+	
+	public void addQueueDescription(QueueDescription queue){
+		accesQueues.add(queue);
+	}
+	
+	public void addQueuesDescription(List<QueueDescription> queue){
+		accesQueues.addAll(queue);
+	}
+	
+	public List<QueueDescription> getAvailableQueues(){
+		return this.accesQueues;
+	}
+	
+	public void addResourceUnit(Map<ResourceUnitName, ResourceUnit> allUnits){
+		Iterator<ResourceUnit> itr = allUnits.values().iterator();
+		while(itr.hasNext()){
+			addResourceUnit(itr.next());
+		}
+	}
+	
+	public void addResourceUnitList(Map<ResourceUnitName, List<ResourceUnit>> allUnits){
+		this.resUnits.putAll(allUnits);
+	}
+
+	public ResourceProvider getProvider() {
+		return provider;
+	}
+}
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 477)
@@ -0,0 +1,162 @@
+package schedframe.scheduling;
+
+import eduni.simjava.Sim_event;
+import eduni.simjava.Sim_type_p;
+import gridsim.GridSimTags;
+import gridsim.IO_data;
+import gridsim.gssim.WormsTags;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+
+import schedframe.exceptions.ResourceException;
+import schedframe.resources.ResourceStatus;
+import schedframe.resources.ResourceType;
+import schedframe.resources.computing.ComputingResource;
+import schedframe.resources.providers.ResourceProvider;
+import schedframe.resources.units.ResourceUnit;
+import schedframe.resources.units.ResourceUnitName;
+import schedframe.scheduling.manager.resources.ResourceManager;
+import schedframe.scheduling.plugin.grid.ModuleType;
+import schedframe.scheduling.plugin.grid.ResourceDiscovery;
+import schedframe.scheduling.tasks.requirements.AbstractResourceRequirements;
+
+public class  GridResourceDiscovery implements ResourceManager, ResourceDiscovery {
+
+	protected Scheduler gridBroker;
+	
+	public GridResourceDiscovery(Scheduler broker){
+		this.gridBroker = broker;
+	}
+	
+	public List<String> getAdministrationDomains(SecurityContext secContext) {
+		throw new RuntimeException("Not implemented.");
+	}
+
+	public List<ResourceProvider> getProviders(SecurityContext secContext) {
+		throw new RuntimeException("Not implemented.");
+	}
+
+	public List<ResourceProvider> getProviders(String admDomain, SecurityContext secContext) {
+		throw new RuntimeException("Not implemented.");
+	}
+
+	public List<ResourceProvider> getProviders(
+			AbstractResourceRequirements<?> reqDesc, SecurityContext secContext) {
+		throw new RuntimeException("Not implemented.");
+	}
+	
+	public List<SchedulerDescription> getResources(
+			AbstractResourceRequirements<?> reqDesc, SecurityContext secContext) {
+		throw new RuntimeException("Not implemented.");
+	}
+
+	public List<SchedulerDescription> getResources(SecurityContext secContext) {
+		List <Scheduler> resourceList = gridBroker.getChildren();
+		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);
+		}
+		
+		//filter only the query response messages
+		Sim_type_p pred = new Sim_type_p(WormsTags.QUERY_RESOURCE_DESC_RESULT);
+		Sim_event ev = new Sim_event();
+		
+		List<SchedulerDescription> result = new ArrayList<SchedulerDescription>(resourceList.size());
+		for (int i = 0; i < resourceList.size(); ++i) {
+			gridBroker.sim_get_next(pred , ev);
+			IO_data ioData  = (IO_data) ev.get_data();
+			SchedulerDescription resDesc = (SchedulerDescription) ioData.getData();
+			result.add(resDesc);
+		} 
+		
+		return result;
+	}
+	
+	public List<SchedulerDescription> getResources() {
+
+		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);
+		}
+		
+		//filter only the query response messages
+		Sim_type_p pred = new Sim_type_p(WormsTags.QUERY_RESOURCE_DESC_RESULT);
+		Sim_event ev = new Sim_event();
+		
+		List<SchedulerDescription> result = new ArrayList<SchedulerDescription>(gridBroker.getChildren().size());
+		for (int i = 0; i < gridBroker.getChildren().size(); ++i) {
+			gridBroker.sim_get_next(pred , ev);
+			IO_data ioData  = (IO_data) ev.get_data();
+			SchedulerDescription resDesc = (SchedulerDescription) ioData.getData();
+			result.add(resDesc);
+		} 
+		
+		return result;
+	}
+
+	public List<Scheduler> getSchedulers() {
+		return gridBroker.getChildren();
+	}
+
+	@Override
+	public boolean areResourcesAchievable(ResourceType type) {
+		throw new UnsupportedOperationException("Not available at Grid level. Please use getResources() method instead to explore available resource providers");
+	}
+
+	@Override
+	public List<? extends ComputingResource> getResourcesOfType(ResourceType type) throws ResourceException {
+		throw new UnsupportedOperationException("Not available at Grid level. Please use getResources() method instead to explore available resource providers");
+	}
+
+	@Override
+	public ComputingResource getResourceByName(String resourceName) {
+		throw new UnsupportedOperationException("Not available at Grid level. Please use getResources() method instead to explore available resource providers");
+	}
+
+	@Override
+	public List<? extends ComputingResource> getResourcesByTypeWithStatus(ResourceType type, ResourceStatus status)
+			throws ResourceException {
+		throw new UnsupportedOperationException("Not available at Grid level. Please use getResources() method instead to explore available resource providers");
+	}
+
+	/*@Override
+	public ResourceCharacteristics getResourceCharacteristic() {
+		throw new UnsupportedOperationException("Not available at Grid level. Please use getResources() method instead to explore available resource providers");
+	}*/
+
+	@Override
+	public Map<ResourceUnitName, List<ResourceUnit>> getSharedResourceUnits() {
+		throw new UnsupportedOperationException("Not available at Grid level. Please use getResources() method instead to explore available resource providers");
+	}
+	
+	@Override
+	public List<ResourceUnit> getDistributedResourceUnits(ResourceUnitName unitName) {
+		throw new UnsupportedOperationException("Not available at Grid level. Please use getResources() method instead to explore available resource providers");
+	}
+	
+	@Override
+	public List<ComputingResource> filterResources(Properties properties) {
+		throw new UnsupportedOperationException("Not available at Grid level. Please use getResources() method instead to explore available resource providers");
+	}
+
+	@Override
+	public String getSchedulerName(String resourceName) {
+		throw new UnsupportedOperationException("Not available at Grid level. Please use getResources() method instead to explore available resource providers");
+	}
+
+	
+	public void dispose() {
+	}
+
+	public ModuleType getType() {
+		return ModuleType.RESOURCE_DISCOVERY;
+	}
+
+	public void init(Properties properties) {
+	}
+
+
+}
Index: DCWoRMS/trunk/build/classes/schedframe/scheduling/ResourceHistoryItem.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/scheduling/ResourceHistoryItem.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/scheduling/ResourceHistoryItem.java	(revision 477)
@@ -0,0 +1,33 @@
+package schedframe.scheduling;
+
+import java.util.Map;
+
+import org.joda.time.DateTime;
+
+import schedframe.resources.units.ResourceUnit;
+import schedframe.resources.units.ResourceUnitName;
+
+public class ResourceHistoryItem {
+
+	protected Map<ResourceUnitName, ResourceUnit> usedResources;
+	protected DateTime timeStamp;
+	
+	/**
+	 * 
+	 * @param map hash map of resource units, which should be remembered
+	 * @param time the moment in time when this resource configuration was created  
+	 */
+	public ResourceHistoryItem(Map<ResourceUnitName, ResourceUnit> map, DateTime time){
+		this.usedResources = map;
+		this.timeStamp = time;
+	}
+	
+	public Map<ResourceUnitName, ResourceUnit> getResourceUnits(){
+		return usedResources;
+	}
+	
+	public DateTime getTimeStamp(){
+		return timeStamp;
+	}
+	
+}
Index: DCWoRMS/trunk/build/classes/schedframe/scheduling/manager/resources/ResourceManagerFactory.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/scheduling/manager/resources/ResourceManagerFactory.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/scheduling/manager/resources/ResourceManagerFactory.java	(revision 477)
@@ -0,0 +1,32 @@
+package schedframe.scheduling.manager.resources;
+
+import schedframe.scheduling.GridResourceDiscovery;
+import schedframe.scheduling.Scheduler;
+
+public class ResourceManagerFactory {
+
+	public static ResourceManager createResourceManager(Scheduler scheduler, ManagedResources managedResources){
+
+		ManagedComputingResources managedResource = scheduler.getCompResources();
+		
+		if(managedResource.getType().getName().equals("DataCenter"))
+			return new GridResourceDiscovery(scheduler);
+		else if (managedResource.getType().getName().equals("Rack"))
+			return new ClusterResourceManager(scheduler.getCompResources(), scheduler.getChildren(), managedResources);
+		else if (managedResource.getType().getName().equals("ComputingNode"))
+			return new ClusterResourceManager(scheduler.getCompResources(), scheduler.getChildren(), managedResources);
+		else if (managedResource.getType().getName().equals("Processor"))
+			return new ClusterResourceManager(scheduler.getCompResources(), scheduler.getChildren(), managedResources);
+		else return new ClusterResourceManager(scheduler.getCompResources(), scheduler.getChildren(), managedResources);
+		//throw new IllegalArgumentException("ResourceType " + managedResource.getType() + " is not supported.");
+		
+		/*switch(managedResource.getType()){
+			case DataCenter: return new GridResourceDiscovery(scheduler);
+			case Rack: return new ClusterResourceManager(scheduler.getResources(), scheduler.getChildren());
+			case ComputingNode: return new ClusterResourceManager(scheduler.getResources(), scheduler.getChildren());
+			case Processor: return new ClusterResourceManager(scheduler.getResources(), scheduler.getChildren());
+		default:
+			throw new IllegalArgumentException("ResourceType " + managedResource.getType() + " is not supported.");
+		}*/
+	}
+}
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 477)
@@ -0,0 +1,369 @@
+package schedframe.scheduling.manager.resources;
+
+import gridsim.GridSim;
+
+import java.util.ArrayDeque;
+import java.util.ArrayList;
+import java.util.Deque;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+import java.util.Stack;
+
+import schedframe.exceptions.ResourceException;
+import schedframe.resources.ResourceStatus;
+import schedframe.resources.ResourceType;
+import schedframe.resources.StandardResourceType;
+import schedframe.resources.computing.ComputingResource;
+import schedframe.resources.computing.ResourceCharacteristics;
+import schedframe.resources.computing.validator.ResourcePropertiesValidator;
+import schedframe.resources.computing.validator.ResourceValidator;
+import schedframe.resources.units.PEUnit;
+import schedframe.resources.units.ProcessingElements;
+import schedframe.resources.units.ResourceUnit;
+import schedframe.resources.units.ResourceUnitName;
+import schedframe.resources.units.ResourceUnitState;
+import schedframe.resources.units.StandardResourceUnitName;
+import schedframe.scheduling.Scheduler;
+import schedframe.scheduling.plugin.local.ResourceAllocationInterface;
+
+
+public class LocalResourceManager implements ResourceAllocationInterface, ResourceManager {
+
+	//private Log log = LogFactory.getLog(ResourceManager.class);
+
+	protected List<ComputingResource> computingResources;
+	protected List<Scheduler> schedulers;
+	//protected ResourceCharacteristics resourceCharacteristic;
+	protected Map<ResourceUnitName, List<ResourceUnit>> resourceUnits;
+
+	public LocalResourceManager(List<ComputingResource> resources, List<Scheduler> schedulers, Map<ResourceUnitName, List<ResourceUnit>> resourceUnits) {
+		this.computingResources = resources;
+		this.schedulers = schedulers;
+		this.resourceUnits = resourceUnits;
+
+		//initSharedResourceUnits(computingResources);
+	}
+
+	public LocalResourceManager(ComputingResource compResource) {
+		this.computingResources = compResource.getChildren();
+
+		initSharedResourceUnits(compResource);
+	}
+
+	public void initSharedResourceUnits(ComputingResource compResource){
+		this.resourceUnits = new HashMap<ResourceUnitName, List<ResourceUnit>>();
+		List<ResourceUnit> list;
+
+		ComputingResource parent = compResource.getParent();
+		while(parent != null){
+			Map<ResourceUnitName, List<ResourceUnit>> resUnits = parent.getResourceCharacteristic().getResourceUnits();
+			for(ResourceUnitName run : resUnits.keySet()){
+				for(ResourceUnit resUnit : resUnits.get(run)){
+					if((resourceUnits.get(run) == null)){
+						list = new ArrayList<ResourceUnit>(1);
+						resourceUnits.put(resUnit.getName(), list);
+						list.add(resUnit);
+					} else if(!resourceUnits.get(run).contains(resUnit)){
+						list = resourceUnits.get(resUnit.getName());
+						list.add(resUnit);
+					} 
+				}
+			}
+			parent = parent.getParent();
+		}
+	}
+	
+	public List<ComputingResource> getResources() {
+		return computingResources;
+	}
+
+	public boolean areResourcesAchievable(ResourceType type) {
+		if (computingResources != null) {
+			Deque<ComputingResource> toExamine = new ArrayDeque<ComputingResource>();
+			for (ComputingResource resource : computingResources){
+				toExamine.push(resource);	
+			}
+			
+			while (!toExamine.isEmpty()) {
+				ComputingResource resource = toExamine.pop();
+				if(resource.getType() == type)
+					return true;
+				List<ComputingResource> resources = resource.getChildren();
+				/*if (resources == null)
+					continue;*/
+				int numberOfResComp = resources.size();
+				for (int i = 0; i < numberOfResComp; i++) {
+					ComputingResource resourceChild = resources.get(i);
+					if (resourceChild.getType() == type) {
+						return true;
+					} else
+						toExamine.push(resourceChild);
+				}
+			}
+		}
+		return false;
+	}
+
+	public List<? extends ComputingResource> getResourcesOfType(ResourceType type) throws ResourceException {
+		List<ComputingResource> resourcesOfType = new ArrayList<ComputingResource>();
+		for (ComputingResource resource : computingResources) {
+			if (resource.getType() == type) {
+				resourcesOfType.add(resource);
+			} else
+				resourcesOfType.addAll(resource.getDescendantsByType(type));
+		}
+		return resourcesOfType;
+	}
+
+	public List<? extends ComputingResource> getResourcesByTypeWithStatus(ResourceType type, ResourceStatus status)
+			throws ResourceException {
+
+		List<ComputingResource> resourcesOfType = new ArrayList<ComputingResource>();
+		for (ComputingResource resource : computingResources) {
+			if (resource.getType() == type) {
+				if (resource.getStatus() == status) {
+					resourcesOfType.add(resource);
+				}
+			} else
+				resourcesOfType.addAll(resource.getDescendantsByTypeAndStatus(type, status));
+		}
+		return resourcesOfType;
+	}
+
+	public ComputingResource getResourceByName(String resourceName) throws ResourceException {
+		ComputingResource resourceWithName = null;
+		for (int i = 0; i < computingResources.size() && resourceWithName == null; i++) {
+			ComputingResource resource = computingResources.get(i);
+			if (resource.getName().equals(resourceName))
+				resourceWithName = resource;
+			else
+				resourceWithName = resource.getDescendantByName(resourceName);
+		}
+		return resourceWithName;
+	}
+
+	public List<ResourceUnit> getDistributedResourceUnits(ResourceUnitName unitName)  {
+		List<ResourceUnit> resourceUnit = new ArrayList<ResourceUnit>();
+		if (computingResources != null) {
+			Deque<ComputingResource> toExamine = new ArrayDeque<ComputingResource>();
+			for (ComputingResource resource : computingResources)
+				toExamine.push(resource);
+			while (!toExamine.isEmpty()) {
+				ComputingResource resource = toExamine.pop();
+				ResourceCharacteristics resourceCharacteristic = resource.getResourceCharacteristic();
+				List<ResourceUnit> units = null;
+				units = resourceCharacteristic.getResourceUnits().get(unitName);
+				if (units != null)
+					resourceUnit.addAll(units);
+				// else {
+				List<ComputingResource> resources = resource.getChildren();
+				/*if (resources == null)
+					continue;*/
+				int numberOfResComp = resources.size();
+				for (int i = 0; i < numberOfResComp; i++) {
+					ComputingResource resourceChild = resources.get(i);
+					toExamine.push(resourceChild);
+				}
+				// }
+			}
+		}
+		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) {
+		List<ComputingResource> descendants = new ArrayList<ComputingResource>();
+		for (ComputingResource resource : computingResources) {
+			ResourceValidator resourceValidator =  new ResourcePropertiesValidator(properties);
+			if (resourceValidator.validate(resource))
+				descendants.add(resource);
+			else
+				descendants.addAll(resource.filterDescendants(properties));
+		}
+		return descendants;
+	}
+
+	public Map<ResourceUnitName, List<ResourceUnit>> getSharedResourceUnits() {
+		
+		/*Map<ResourceUnitName, List<ResourceUnit>> sharedResourceUnits = new HashMap<ResourceUnitName, List<ResourceUnit>>();
+		List<ResourceUnit> list;
+		for(ComputingResource resource : compResources){
+			boolean resourceNotVisited = true;
+			ComputingResource parent = resource.getParent();
+			while(parent != null && resourceNotVisited){
+				Map<ResourceUnitName, List<ResourceUnit>> resUnits = parent.getResourceCharacteristic().getResourceUnits();
+				for(ResourceUnitName run : resUnits.keySet()){
+					for(ResourceUnit resUnit : resUnits.get(run)){
+						if((sharedResourceUnits.get(run) == null)){
+							list = new ArrayList<ResourceUnit>(1);
+							sharedResourceUnits.put(resUnit.getName(), list);
+							list.add(resUnit);
+						} else if(!sharedResourceUnits.get(run).contains(resUnit)){
+							list = sharedResourceUnits.get(resUnit.getName());
+							list.add(resUnit);
+						} else {
+							resourceNotVisited = false;
+						}
+					}
+				}
+				parent = parent.getParent();
+			}
+		}
+		return sharedResourceUnits;*/
+		return resourceUnits;
+	}
+		
+	public List<Scheduler> getSchedulers() {
+		return schedulers;
+	}
+	
+	@SuppressWarnings("unchecked")
+	public List<ResourceUnit> getPE() throws ResourceException{
+		
+		List<ResourceUnit> peUnits = null;
+		List<ComputingResource> computingResources = null;
+		if(areResourcesAchievable(StandardResourceType.Core)){
+			try {
+				computingResources = (List<ComputingResource>) getResourcesOfType(StandardResourceType.Core);
+			} catch (ResourceException e) {
+				throw new RuntimeException("GSSIM internal error");
+			}
+			PEUnit peUnit = new ProcessingElements(computingResources);
+			peUnits = new ArrayList<ResourceUnit>();
+			peUnits.add(peUnit);			
+		}
+
+		else if(areResourcesAchievable(StandardResourceType.Processor)){
+			try {
+				computingResources = (List<ComputingResource>) getResourcesOfType(StandardResourceType.Processor);
+			} catch (ResourceException e) {
+				throw new RuntimeException("GSSIM internal error");
+			}
+			PEUnit peUnit = new ProcessingElements(computingResources);
+			peUnits = new ArrayList<ResourceUnit>();
+			peUnits.add(peUnit);			
+		}
+
+		else if (getDistributedResourceUnits(StandardResourceUnitName.PE).size() > 0){
+			peUnits = getDistributedResourceUnits(StandardResourceUnitName.PE);
+		} 
+		
+		else if(getSharedResourceUnits().get(StandardResourceUnitName.PE) != null){
+				peUnits = getSharedResourceUnits().get(StandardResourceUnitName.PE);
+		}
+		if(peUnits == null)
+			throw new ResourceException("Processing Elements are not defined");
+		return peUnits;
+	}
+	
+	public String getSchedulerName(String resName){
+		if(GridSim.getEntityId(resName) != -1){
+			return resName;
+		}
+		ComputingResource resourceWithName = null;
+		for(int i = 0 ; i < computingResources.size() && resourceWithName == null; i++){
+			ComputingResource resource = computingResources.get(i);
+			if(resource.getName().equals(resName))
+				resourceWithName = resource;
+			else
+				try {
+					resourceWithName = resource.getDescendantByName(resName);
+				} catch (ResourceException e) {
+					return null;
+				}
+		}
+		if(resourceWithName == null)
+			return null;
+		List<ComputingResource> children = resourceWithName.getChildren();
+		Set<Scheduler> childrenSchedulers = new HashSet<Scheduler>();
+		if(children.isEmpty())
+			return null;
+		for(ComputingResource child: children) {
+			childrenSchedulers.add(child.getScheduler());
+		}	
+
+		Set<Scheduler> tempChildrenSchedulers = new HashSet<Scheduler>(childrenSchedulers);
+		while(childrenSchedulers.size() > 1){
+			childrenSchedulers = new HashSet<Scheduler>();
+			for(Scheduler s: tempChildrenSchedulers){
+				childrenSchedulers.add(s.getParent());
+			}
+			tempChildrenSchedulers = new HashSet<Scheduler>(childrenSchedulers);
+		}
+		Iterator<Scheduler> it = childrenSchedulers.iterator();
+		Scheduler potentialScheduler = it.next();
+		if(potentialScheduler.getCompResources().containsAll(children))
+			return potentialScheduler.get_name();
+		return null;
+	}
+	
+	public boolean allocateResources(Map<ResourceUnitName, ResourceUnit> resources) {
+		
+		if (resources == null) {
+			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()){
+			ResourceUnit resUnit = resources.get(resUnitName);
+			resUnit.getProvisioner().setState(ResourceUnitState.BUSY);
+		}
+		return true;
+	}
+
+
+	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);
+			resUnit.getProvisioner().setState(ResourceUnitState.FREE);
+		}
+	}
+
+
+}
Index: DCWoRMS/trunk/build/classes/schedframe/scheduling/manager/resources/ManagedComputingResources.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/scheduling/manager/resources/ManagedComputingResources.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/scheduling/manager/resources/ManagedComputingResources.java	(revision 477)
@@ -0,0 +1,30 @@
+package schedframe.scheduling.manager.resources;
+
+import java.util.ArrayList;
+
+import schedframe.resources.ResourceType;
+import schedframe.resources.StandardResourceType;
+import schedframe.resources.computing.ComputingResource;
+
+public class ManagedComputingResources extends ArrayList<ComputingResource>{
+	
+	private static final long serialVersionUID = 1L;
+
+	private ResourceType type;
+	
+	public boolean add(ComputingResource compRes){
+		if(type == null){
+			type = compRes.getType();
+		}
+		if(type.getName().equals(compRes.getType().getName()))
+			return super.add(compRes);
+		return false;
+	}
+
+	public ResourceType getType() {
+		if (type == null)
+			return StandardResourceType.Undefined;
+		return type;
+	}
+
+}
Index: DCWoRMS/trunk/build/classes/schedframe/scheduling/manager/resources/ResourceAllocation.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/scheduling/manager/resources/ResourceAllocation.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/scheduling/manager/resources/ResourceAllocation.java	(revision 477)
@@ -0,0 +1,13 @@
+package schedframe.scheduling.manager.resources;
+
+import java.util.List;
+
+import schedframe.resources.computing.ComputingResource;
+
+public interface ResourceAllocation {
+	public void allocateResources(List<ComputingResource> resources);
+
+
+	public void freeResources(List<ComputingResource> resources);
+	
+}
Index: DCWoRMS/trunk/build/classes/schedframe/scheduling/manager/resources/utils/ResourceManagerUtils.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/scheduling/manager/resources/utils/ResourceManagerUtils.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/scheduling/manager/resources/utils/ResourceManagerUtils.java	(revision 477)
@@ -0,0 +1,108 @@
+package schedframe.scheduling.manager.resources.utils;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import schedframe.resources.ResourceStatus;
+import schedframe.resources.computing.ComputingResource;
+import schedframe.resources.units.Memory;
+import schedframe.resources.units.PEUnit;
+import schedframe.resources.units.ProcessingElements;
+import schedframe.resources.units.ResourceUnit;
+import schedframe.resources.units.ResourceUnitName;
+import schedframe.resources.units.ResourceUnitState;
+import schedframe.resources.units.StandardResourceUnitName;
+
+public class ResourceManagerUtils {
+	
+	public static void clearPendingResources(Map<ResourceUnitName, ResourceUnit> choosenResources){
+
+		ProcessingElements processingElements = (ProcessingElements)choosenResources.get(StandardResourceUnitName.PE);
+		if(processingElements != null) {
+			for (int i = 0; i < processingElements.size(); i++) {
+				ComputingResource pe = processingElements.get(i);
+				if (pe.getStatus() == ResourceStatus.PENDING) {
+					pe.setStatus(ResourceStatus.FREE);
+				}
+			}
+		}
+		Memory memory = (Memory)choosenResources.get(StandardResourceUnitName.MEMORY);
+		if(memory != null){
+			if(memory.getProvisioner().getState()==ResourceUnitState.PENDING)
+				memory.getProvisioner().setState(ResourceUnitState.FREE);
+		}
+	}
+	
+	public static void setPendingResources(Map<ResourceUnitName, ResourceUnit> choosenResources){
+
+		/*ProcessingElements processingElements = (ProcessingElements)choosenResources.get(StandardResourceUnitName.PE);
+		if(processingElements != null) {
+			for (int i = 0; i < processingElements.size(); i++) {
+				ComputingResource pe = processingElements.get(i);
+				if (pe.getStatus() == ResourceStatus.FREE) {
+					pe.setStatus(ResourceStatus.PENDING);
+				}
+			}
+		}*/
+		
+		PEUnit processingElements = (PEUnit)choosenResources.get(StandardResourceUnitName.PE);
+		if(processingElements != null) {
+			if(processingElements.getProvisioner().getState()==ResourceUnitState.FREE)
+				processingElements.getProvisioner().setState(ResourceUnitState.PENDING);
+		}
+		
+		Memory memory = (Memory)choosenResources.get(StandardResourceUnitName.MEMORY);
+		if(memory != null){
+			if(memory.getProvisioner().getState()==ResourceUnitState.FREE)
+				memory.getProvisioner().setState(ResourceUnitState.PENDING);
+		}
+	}
+	
+	public static ComputingResource getCommonParent(List<ComputingResource> resources){
+
+		Set<ComputingResource> parents = new HashSet<ComputingResource>(resources);
+		while(parents.size() != 1){
+			parents = new HashSet<ComputingResource>();
+			for(ComputingResource resource: resources){
+				parents.add(resource.getParent());
+			}
+			resources = new ArrayList<ComputingResource>(parents);
+		}
+		return resources.get(0);
+	}
+
+	public static Map<ResourceUnitName, List<ResourceUnit>> getSharedResourceUnits(List<ComputingResource> compResources) {
+		
+		Map<ResourceUnitName, List<ResourceUnit>> sharedResourceUnits = new HashMap<ResourceUnitName, List<ResourceUnit>>();
+		List<ResourceUnit> list;
+		for(ComputingResource resource : compResources){
+			boolean resourceNotVisited = true;
+			ComputingResource parent = resource.getParent();
+			while(parent != null && resourceNotVisited){
+				Map<ResourceUnitName, List<ResourceUnit>> resUnits = parent.getResourceCharacteristic().getResourceUnits();
+				for(ResourceUnitName run : resUnits.keySet()){
+					for(ResourceUnit resUnit : resUnits.get(run)){
+						if((sharedResourceUnits.get(run) == null)){
+							list = new ArrayList<ResourceUnit>(1);
+							sharedResourceUnits.put(resUnit.getName(), list);
+							list.add(resUnit);
+						} else if(!sharedResourceUnits.get(run).contains(resUnit)){
+							list = sharedResourceUnits.get(resUnit.getName());
+							list.add(resUnit);
+						} else {
+							resourceNotVisited = false;
+						}
+					}
+				}
+				parent = parent.getParent();
+			}
+		}
+		return sharedResourceUnits;
+		//return resourceUnits;
+	}
+
+}
Index: DCWoRMS/trunk/build/classes/schedframe/scheduling/manager/resources/ResourceManager.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/scheduling/manager/resources/ResourceManager.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/scheduling/manager/resources/ResourceManager.java	(revision 477)
@@ -0,0 +1,36 @@
+package schedframe.scheduling.manager.resources;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+
+import schedframe.exceptions.ResourceException;
+import schedframe.resources.ResourceStatus;
+import schedframe.resources.ResourceType;
+import schedframe.resources.computing.ComputingResource;
+import schedframe.resources.units.ResourceUnit;
+import schedframe.resources.units.ResourceUnitName;
+import schedframe.scheduling.Scheduler;
+
+public interface ResourceManager {
+
+	public boolean areResourcesAchievable(ResourceType type);
+	
+	public List<? extends ComputingResource> getResourcesOfType(ResourceType type) throws ResourceException;
+
+	public ComputingResource getResourceByName(String resourceName) throws ResourceException;
+
+	public List<? extends ComputingResource> getResourcesByTypeWithStatus(ResourceType type, ResourceStatus status) throws ResourceException;
+
+	//public ResourceCharacteristics getResourceCharacteristic();
+	
+	public Map<ResourceUnitName, List<ResourceUnit>> getSharedResourceUnits();
+	
+	public List<ResourceUnit> getDistributedResourceUnits(ResourceUnitName unitName);
+	
+	public List<? extends ComputingResource> filterResources(Properties properties);
+	
+	public List<Scheduler> getSchedulers();
+
+	public String getSchedulerName(String resourceName);
+}
Index: DCWoRMS/trunk/build/classes/schedframe/scheduling/manager/resources/ClusterResourceManager.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/scheduling/manager/resources/ClusterResourceManager.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/scheduling/manager/resources/ClusterResourceManager.java	(revision 477)
@@ -0,0 +1,47 @@
+package schedframe.scheduling.manager.resources;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+
+import schedframe.exceptions.ResourceException;
+import schedframe.resources.StandardResourceType;
+import schedframe.resources.computing.ComputingNode;
+import schedframe.resources.computing.ComputingResource;
+import schedframe.resources.computing.Processor;
+import schedframe.scheduling.Scheduler;
+
+
+public class ClusterResourceManager extends LocalResourceManager {
+
+	public ClusterResourceManager(List<ComputingResource> resources, List<Scheduler> schedulers, ManagedResources managedResources) {
+		super(resources, schedulers, managedResources.getResourceUnits());
+		// TODO Auto-generated constructor stub
+	}
+
+	@SuppressWarnings("unchecked")
+	public List<ComputingNode> getComputingNodes(){
+		try {
+			return (List<ComputingNode>) getResourcesOfType(StandardResourceType.ComputingNode);
+		} catch (ResourceException e) {
+			return new ArrayList<ComputingNode>();
+		}
+	}
+	
+	@SuppressWarnings("unchecked")
+	public List<Processor> getProcessors(){
+		try {
+			return (List<Processor>) getResourcesOfType(StandardResourceType.Processor);
+		} catch (Exception e) {
+			return new ArrayList<Processor>();
+		}
+	}
+
+	@SuppressWarnings("unchecked")
+	public List<ComputingNode> getComputingNodes(Properties properties){
+		properties.setProperty("type", StandardResourceType.ComputingNode.toString());
+		return (List<ComputingNode>) filterResources(properties);
+
+	}
+
+}
Index: DCWoRMS/trunk/build/classes/schedframe/scheduling/manager/resources/ManagedResources.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/scheduling/manager/resources/ManagedResources.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/scheduling/manager/resources/ManagedResources.java	(revision 477)
@@ -0,0 +1,28 @@
+package schedframe.scheduling.manager.resources;
+
+import java.util.List;
+import java.util.Map;
+
+import schedframe.resources.computing.ComputingResource;
+import schedframe.resources.units.ResourceUnit;
+import schedframe.resources.units.ResourceUnitName;
+
+public class ManagedResources {
+	
+	protected List<ComputingResource> computingResources;
+	protected Map<ResourceUnitName, List<ResourceUnit>> resourceUnits;
+	
+	public ManagedResources(List<ComputingResource> computingResources,
+			Map<ResourceUnitName, List<ResourceUnit>> resourceUnits) {
+		this.computingResources = computingResources;
+		this.resourceUnits = resourceUnits;
+	}
+	
+	public List<ComputingResource> getComputingResources() {
+		return computingResources;
+	}
+	
+	public Map<ResourceUnitName, List<ResourceUnit>> getResourceUnits() {
+		return resourceUnits;
+	}
+}
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 477)
@@ -0,0 +1,40 @@
+package schedframe.scheduling.manager.tasks;
+
+import gssim.schedframe.scheduling.ExecTask;
+
+import java.util.List;
+
+import schedframe.scheduling.tasks.JobInterface;
+import schedframe.scheduling.tasks.TaskInterface;
+
+
+public interface JobRegistry {
+
+	//public List<JobInterface<?>> getActiveJobs();
+
+	//public List<TaskInterface<?>> getActiveTasks();
+	
+	public JobInterface<?> getJobInfo(String jobId);
+
+	public TaskInterface<?> getTaskInfo(String jobId, String taskId);
+
+	
+	public List<ExecTask> getTasks(int status) ;
+
+	public List<ExecTask> getQueuedTasks() ;
+	
+	public List<ExecTask> getRunningTasks() ;
+	
+	public List<ExecTask> getReadyTasks() ;
+	
+	public List<ExecTask> getFinishedTasks();
+
+
+	//public List<SubmittedTask> getSubmittedTasks();
+	
+	public ExecTask getSubmittedTask(String jobId, String taskId);
+
+	
+	public List<? extends TaskInterface<?>> getReadyTasks(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 477)
@@ -0,0 +1,382 @@
+package schedframe.scheduling.manager.tasks;
+
+import gridsim.Gridlet;
+import gssim.schedframe.scheduling.ExecTask;
+import gssim.schedframe.scheduling.Executable;
+
+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 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.scheduling.tasks.JobInterface;
+import schedframe.scheduling.tasks.SubmittedTask;
+import schedframe.scheduling.tasks.Task;
+import simulator.WormsConstants;
+
+public class JobRegistryImpl extends AbstractJobRegistry {
+	
+	private static final long serialVersionUID = 8030555906990767342L;
+
+	private static Log log = LogFactory.getLog(JobRegistryImpl.class);
+
+	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>();
+
+	public JobRegistryImpl(String context_) {
+		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);
+			}
+			return true;
+		}
+		return false;
+	}
+
+	public List<ExecTask> getTasks(int status) {
+		List<ExecTask> taskList = new ArrayList<ExecTask>();
+		synchronized (submittedTasks)  {
+			for (ExecTask task: submittedTasks) {
+				if (task.getStatus() == status) {
+					//SubmittedTask subTask = (SubmittedTask) task;
+					List<String> visitedResource = task.getVisitedResources();
+					if(ArrayUtils.contains(visitedResource.toArray(new String[visitedResource.size()]), context)){
+						taskList.add(task);
+					}
+					/*if(subTask.getVisitedResources().contains(context)){
+						taskList.add(subTask);
+					}*/
+				}
+			}
+		}
+		return taskList;
+	}
+
+	public List<ExecTask> getQueuedTasks() {
+		return getTasks(Gridlet.QUEUED);
+	}
+	
+	public List<ExecTask> getRunningTasks() {
+		return getTasks(Gridlet.INEXEC);
+	}
+	
+	public List<ExecTask> getReadyTasks() {
+		return getTasks(Gridlet.READY);
+	}
+	
+	public List<ExecTask> getFinishedTasks() {
+		return getTasks(Gridlet.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) {
+					return task;
+				}
+			}
+		}
+		return null;
+	}
+	
+
+	@SuppressWarnings("unchecked")
+	public List<Task> getReadyTasks(List<JobInterface<?>> wuList) {
+		List<Task> readyTasks = new ArrayList<Task>();
+		List<Task> waitingTasks = new ArrayList<Task>();
+		
+		for(int i = 0; i < wuList.size(); i++){
+			JobInterface<?> wu  = (JobInterface<?>)wuList.get(i);
+			waitingTasks.addAll((List<Task>)wu.getTask());
+		}
+
+		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;
+	}
+
+
+	/**************************************/
+	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){
+		
+		/*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> readyTasks = new ArrayList<Task>();
+
+		int size = tasks.size();
+		for(int i = 0; i < size; i++){
+			int parCnt;
+			int previousTaskReadyCnt = 0;
+			Task task = tasks.get(i);
+			if(task.getStatus() != (int)BrokerConstants.TASK_STATUS_UNSUBMITTED)
+				continue;
+			try{		
+				parCnt = task.getDescription().getWorkflow().getParentCount();
+			} catch(Exception e){
+				parCnt = 0;
+				//e.printStackTrace();
+			}
+			if(parCnt == 0)
+			{
+				readyTasks.add(task);
+			}
+			else
+			{
+				for(int j = 0; j < parCnt; j++){
+					ParentType par = task.getDescription().getWorkflow().getParent(j);
+					if(par.getTriggerState().compareTo(TaskStatesName.FINISHED) == 0){
+						if(!checkTaskCompletion(task.getJobId(), par.getContent())){
+							break;
+						}
+					}
+					previousTaskReadyCnt++;
+				}
+				
+				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);
+			}
+		}		
+		return readyTasks;
+	}
+	
+	private boolean checkTaskCompletion(String jobID, String taskID){
+		JobInterface<?> job = getJobInfo(jobID);
+		try {
+			if(job.getTask(taskID).isFinished())
+				return true;
+		} catch (NoSuchFieldException e) {
+			//e.printStackTrace();
+		}
+		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 477)
@@ -0,0 +1,83 @@
+package schedframe.scheduling.manager.tasks;
+
+
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import schedframe.scheduling.tasks.Job;
+import schedframe.scheduling.tasks.JobInterface;
+import schedframe.scheduling.tasks.Task;
+import schedframe.scheduling.tasks.TaskInterface;
+
+
+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 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;
+		}
+		return true;
+	}
+
+	public boolean addTask(TaskInterface<?> task) {
+		if(jobs.containsKey(task.getJobId())){
+			jobs.get(task.getJobId()).add((Task)task);
+			return true;
+		} else {
+			return false;
+		}
+	}
+
+	public Job get(String jobId){
+		return jobs.get(jobId);
+	}
+	
+	public JobInterface<?> getJobInfo(String jobID) {
+		return jobs.get(jobID);
+	}
+
+	public TaskInterface<?> getTaskInfo(String jobID, String taskId) {
+		Task task = null;
+		Job job = jobs.get(jobID);
+		
+		if(job == null)
+			return null;
+		
+		try {
+			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 List<TaskInterface<?>> getActiveTasks() {
+		log.error("getActiveTasks() not implemented.");
+		return null;
+	}*/
+
+
+	
+
+}
Index: DCWoRMS/trunk/build/classes/schedframe/scheduling/TaskSecurityContext.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/scheduling/TaskSecurityContext.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/scheduling/TaskSecurityContext.java	(revision 477)
@@ -0,0 +1,56 @@
+package schedframe.scheduling;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+public class TaskSecurityContext implements SecurityContext {
+
+	protected String jobId;
+	protected String taskId;
+	protected String processesSetId;
+	protected Object certificate;
+	protected String currentUserDN;
+	
+	public String getUserIdentity() {
+		return this.currentUserDN;
+	}
+	
+	public void setCurrentUserIdentity(String dn){
+		this.currentUserDN = dn;
+	}
+	
+	public String getJobId() {
+		return jobId;
+	}
+	
+	public void setJobId(String jobId) {
+		this.jobId = jobId;
+	}
+	
+	public String getTaskId() {
+		return taskId;
+	}
+	
+	public void setTaskId(String taskId) {
+		this.taskId = taskId;
+	}
+	
+	public String getProcessesSetId() {
+		return processesSetId;
+	}
+	
+	public void setProcessesSetId(String processesSetId) {
+		this.processesSetId = processesSetId;
+	}
+	
+	public Object getCertificate(){
+		return this.certificate;
+	}
+	
+	public void setCertificate(Object cert){
+		this.certificate = cert;
+	}
+
+}
Index: DCWoRMS/trunk/build/classes/schedframe/scheduling/WorkloadUnitListImpl.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/scheduling/WorkloadUnitListImpl.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/scheduling/WorkloadUnitListImpl.java	(revision 477)
@@ -0,0 +1,19 @@
+package schedframe.scheduling;
+
+import java.util.ArrayList;
+
+import schedframe.scheduling.tasks.WorkloadUnit;
+
+
+public class WorkloadUnitListImpl extends ArrayList<WorkloadUnit<?>> implements WorkloadUnitList {
+
+	private static final long serialVersionUID = -3824600938144742457L;
+
+	public WorkloadUnitListImpl(){
+		super();
+	}
+	
+	public WorkloadUnitListImpl(int initialSize){
+		super(initialSize);
+	}	
+}
Index: DCWoRMS/trunk/build/classes/schedframe/scheduling/queue/QueueList.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/scheduling/queue/QueueList.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/scheduling/queue/QueueList.java	(revision 477)
@@ -0,0 +1,9 @@
+package schedframe.scheduling.queue;
+
+import java.util.List;
+
+public interface QueueList<T> extends List<T>{
+
+
+
+}
Index: DCWoRMS/trunk/build/classes/schedframe/scheduling/queue/TaskQueueList.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/scheduling/queue/TaskQueueList.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/scheduling/queue/TaskQueueList.java	(revision 477)
@@ -0,0 +1,17 @@
+package schedframe.scheduling.queue;
+
+import java.util.ArrayList;
+
+public class TaskQueueList extends ArrayList<TaskQueue> implements QueueList<TaskQueue> {
+
+	private static final long serialVersionUID = -3824600938144742457L;
+
+	public TaskQueueList(){
+		super();
+	}
+	
+	public TaskQueueList(int initialSize){
+		super(initialSize);
+	}
+	
+}
Index: DCWoRMS/trunk/build/classes/schedframe/scheduling/queue/Queue.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/scheduling/queue/Queue.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/scheduling/queue/Queue.java	(revision 477)
@@ -0,0 +1,44 @@
+package schedframe.scheduling.queue;
+
+import java.util.List;
+
+import org.joda.time.DateTime;
+
+public interface Queue <K> extends List<K> {
+
+	/**
+	 * Gets a queue name
+	 * @return name
+	 */
+	public String getName();
+
+	/**
+	 * Sets a queue name
+	 * @param name the name to set
+	 */
+	public void setName(String name);
+	
+	/**
+	 * Gets a queue priority
+	 * @return priority
+	 */
+	public int getPriority();
+	
+	
+	public boolean supportReservations();
+	
+	/**
+	 * Sets a queue priority
+	 * @param priority the priority to set
+	 */
+	public void setPriority(int priority);
+		
+	/**
+	 * Gets arrival time of the object at position pos in a queue.
+	 * @param pos the position of the object
+	 * @return time when the object at position pos in queue was added to the queue; 
+	 * @throws IndexOutOfBoundsException if pos id out of the queue range
+	 */
+	public DateTime getArrivalTime(int pos) throws IndexOutOfBoundsException;
+
+}
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 477)
@@ -0,0 +1,103 @@
+package schedframe.scheduling.queue;
+
+import gridsim.Gridlet;
+import gssim.schedframe.scheduling.queues.AbstractStatsSupportingQueue;
+
+import org.joda.time.DateTime;
+
+import schedframe.scheduling.tasks.WorkloadUnit;
+
+public class TaskQueue extends AbstractStatsSupportingQueue<WorkloadUnit<?>> implements Queue<WorkloadUnit<?>>{
+
+
+	private static final long serialVersionUID = 6576299222910508209L;
+
+	protected String name;
+	protected int priority;
+	protected boolean supportReservation;
+	
+	
+	public TaskQueue (boolean supportReservation){
+		name = "Queue";
+		priority = 0;
+		this.supportReservation = supportReservation;
+
+	}
+	
+	public boolean add(WorkloadUnit<?> wu){
+		try {
+			wu.setStatus(Gridlet.QUEUED);
+		} catch(Exception e){
+			throw new RuntimeException(e);
+		}
+		//updateStats();
+		return super.add(wu);
+	}
+	
+	public void add(int pos, WorkloadUnit<?> wu){
+		try {
+			wu.setStatus(Gridlet.QUEUED);
+		} catch(Exception e){
+			throw new RuntimeException(e);
+		}
+		//updateStats();
+		 super.add(pos, wu);
+	}
+	
+	public DateTime getArrivalTime(int pos) throws IndexOutOfBoundsException {
+		//return get(pos).getSubmissionTimeToBroker();
+		return null;
+	}
+
+	public String getName() {
+		return name;
+	}
+
+	public int getPriority() {
+		return priority;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	public void setPriority(int priority) {
+		this.priority = priority;
+	}
+
+	public boolean supportReservations() {
+		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/queue/QueueDescription.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/scheduling/queue/QueueDescription.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/scheduling/queue/QueueDescription.java	(revision 477)
@@ -0,0 +1,32 @@
+package schedframe.scheduling.queue;
+
+public class QueueDescription {
+	
+	protected String name;
+	protected int priority;
+	protected boolean reservation;
+	protected long load;
+	
+	public QueueDescription(String name, int priority, boolean reservation, long load) {
+		this.name = name;
+		this.priority = priority;
+		this.reservation = reservation;
+		this.load = load;
+	}
+	
+	public String getName() {
+		return name;
+	}
+	
+	public int getPriority() {
+		return priority;
+	}
+	
+	public boolean supportReservation() {
+		return reservation;
+	}
+	
+	public long getLoad() {
+		return load;
+	}
+}
Index: DCWoRMS/trunk/build/classes/schedframe/scheduling/UsedResourceList.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/scheduling/UsedResourceList.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/scheduling/UsedResourceList.java	(revision 477)
@@ -0,0 +1,12 @@
+package schedframe.scheduling;
+
+import java.util.LinkedList;
+
+public class UsedResourceList<E> extends LinkedList<E>{
+
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 1L;
+	
+}
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 477)
@@ -0,0 +1,509 @@
+package schedframe.scheduling.tasks;
+
+import org.qcg.broker.schemas.resreqs.ComputingResource;
+import org.qcg.broker.schemas.resreqs.ComputingResourceBaseTypeItem;
+import org.qcg.broker.schemas.resreqs.ComputingResourceExtType;
+import org.qcg.broker.schemas.resreqs.ComputingResourceParameterType;
+import org.qcg.broker.schemas.resreqs.ExecutionTimeType;
+import org.qcg.broker.schemas.resreqs.ProcessesResourceRequirements;
+import org.qcg.broker.schemas.resreqs.Requirements;
+import org.qcg.broker.schemas.resreqs.TaskResourceRequirements;
+import org.qcg.broker.schemas.resreqs.TimePeriod;
+import org.qcg.broker.schemas.resreqs.TimePeriodChoice;
+import org.qcg.broker.schemas.resreqs.Topology;
+import org.qcg.broker.schemas.resreqs.types.ComputingResourceParameterTypeNameType;
+
+import java.io.StringReader;
+import java.io.StringWriter;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.exolab.castor.xml.Marshaller;
+import org.exolab.castor.xml.ResolverException;
+import org.exolab.castor.xml.Unmarshaller;
+import org.exolab.castor.xml.XMLContext;
+import org.joda.time.DateTime;
+import org.joda.time.Duration;
+import org.joda.time.MutableDateTime;
+import org.joda.time.ReadableDuration;
+
+import schedframe.scheduling.WorkloadUnitHandler;
+import schedframe.scheduling.manager.tasks.JobRegistryImpl;
+import schedframe.scheduling.policy.AbstractManagementSystem;
+import schedframe.scheduling.tasks.requirements.ResourceParameterName;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+public class Task /*extends AbstractTask*/ implements TaskInterface<org.qcg.broker.schemas.resreqs.Task> {
+	
+	protected static Unmarshaller unmarshaller;
+	protected static Marshaller marshaller;
+	protected boolean isRegistered;
+	
+	static {
+		XMLContext context = new XMLContext();
+		try {
+			context.addClass(org.qcg.broker.schemas.resreqs.Task.class);
+			unmarshaller = context.createUnmarshaller();
+			marshaller = context.createMarshaller();
+		} catch (ResolverException e) {
+			e.printStackTrace();
+			unmarshaller = null;
+			marshaller = null;
+		}
+	}
+	
+	protected org.qcg.broker.schemas.resreqs.Task task;
+	/*
+	 * The values for following variables are obtained from native Task
+	 * object. This should significantly speed up access to task details.
+	 */
+	private DateTime startTime;
+	private DateTime endTime;
+	private DateTime brokerSubmitTime;
+	private ReadableDuration duration;
+	private List<AbstractProcessesGroup> groups;
+	private List<AbstractProcesses> processes;
+	private long length;
+	private int status;
+	private int senderId;
+	private long workloadLogWaitTime;
+	//String resPathHistory;
+	
+	public Task(org.qcg.broker.schemas.resreqs.Task task){
+		this.task = task;
+		this.startTime = null;
+		this.endTime = null;
+		this.brokerSubmitTime = null;
+		this.duration = null;
+	//	this.gridletID_ = (getJobId() + "_" + getId()).hashCode();
+		prepareTopology();
+	}
+	
+	public Task(String task) throws Exception{
+		StringReader reader = new StringReader(task);
+		this.task = (org.qcg.broker.schemas.resreqs.Task) unmarshaller.unmarshal(reader);
+		this.startTime = null;
+		this.endTime = null;
+		this.brokerSubmitTime = null;
+		this.duration = null;
+	//	this.gridletID_ = (getJobId() + getId()).hashCode();
+		prepareTopology();
+	}
+
+	public DateTime getExecutionStartTime() throws NoSuchFieldException {
+		if(this.startTime != null)
+			return this.startTime;
+		
+		ExecutionTimeType execTime = this.task.getExecutionTime();
+		if(execTime == null)
+			throw new NoSuchFieldException("Execution Time for job " + getJobId() 
+										+ " task "+ getId() + " is not defined.");
+		
+		TimePeriod timePeriod = execTime.getTimePeriod();
+		if(timePeriod == null)
+			throw new NoSuchFieldException("Time Period for job " + getJobId() 
+					+ " task "+ getId() + " is not defined.");
+		
+		this.startTime = new DateTime(timePeriod.getPeriodStart());
+		return this.startTime;
+	}
+
+	public DateTime getExecutionEndTime() throws NoSuchFieldException {
+		if(this.endTime != null)
+			return this.endTime;
+		
+		ExecutionTimeType execTime = this.task.getExecutionTime();
+		if(execTime == null)
+			throw new NoSuchFieldException("Execution Time for job " + getJobId() 
+										+ " task "+ getId() + " is not defined.");
+		
+		TimePeriod timePeriod = execTime.getTimePeriod();
+		if(timePeriod == null)
+			throw new NoSuchFieldException("Time Period for job " + getJobId() 
+					+ " task "+ getId() + " is not defined.");
+		
+		TimePeriodChoice periodChoice = timePeriod.getTimePeriodChoice();
+		if(periodChoice == null)
+			throw new NoSuchFieldException("Period End and Period Duration for job " + getJobId() 
+					+ " task "+ getId() + " are not defined.");
+		
+		java.util.Date periodEnd = periodChoice.getPeriodEnd();
+		if(periodEnd != null) {
+			this.endTime = new DateTime(periodEnd);
+			return this.endTime;
+		}
+		
+		org.exolab.castor.types.Duration duration = periodChoice.getPeriodDuration();
+		if(duration == null)
+			throw new NoSuchFieldException("Period Duration for job " + getJobId() 
+					+ " task "+ getId() + " is not defined.");
+		
+		DateTime periodStart = getExecutionStartTime();
+		MutableDateTime m_periodEnd = periodStart.toMutableDateTime();
+		m_periodEnd.add(duration.toLong());
+
+		this.endTime = m_periodEnd.toDateTime();
+		periodChoice.setPeriodDuration(null);
+		periodChoice.setPeriodEnd(this.endTime.toDate());
+		
+		return this.endTime;
+	}
+
+	public ReadableDuration getExpectedDuration() throws NoSuchFieldException {
+		if(this.duration != null)
+			return this.duration;
+		
+		ExecutionTimeType execTime = this.task.getExecutionTime();
+		if(execTime == null)
+			throw new NoSuchFieldException("Execution Time for job " + getJobId() 
+										+ " task "+ getId() + " is not defined.");
+		
+		org.exolab.castor.types.Duration d = execTime.getExecutionDuration();
+		if(d == null)
+			throw new NoSuchFieldException("Execution Duration for job " + getJobId() 
+					+ " task "+ getId() + " is not defined.");
+
+		this.duration = new Duration(d.toLong());
+		return this.duration;
+	}
+
+	public String getJobId() {
+		return this.task.getJobId();
+	}
+
+	public double getParameterDoubleValue(ResourceParameterName parameterName)
+			throws NoSuchFieldException, IllegalArgumentException {
+		
+		ComputingResourceParameterTypeNameType name = ComputingResourceParameterTypeNameType.valueOf(parameterName.value().toUpperCase());
+		
+		switch (name) {
+			case APPLICATION:
+			case CPUARCH:
+			case HOSTNAME:
+			case LOCALRESOURCEMANAGER:
+			case OSNAME:
+			case OSRELEASE:
+			case OSTYPE:
+			case OSVERSION:
+			case REMOTESUBMISSIONINTERFACE:
+				throw new IllegalArgumentException("For " + parameterName + " use getParameterStringValue() method.");
+		}
+
+		ComputingResourceBaseTypeItem item[] = getComputingResourceRequirements();
+		
+		double returnValue = 0;
+		boolean notFound = true;
+		
+		for(int i = 0; i < item.length && notFound; i++){
+			ComputingResourceParameterType hostParameter = item[i].getHostParameter();
+			if(hostParameter == null)
+				continue;
+			
+			if(name == hostParameter.getName()) {
+				returnValue = hostParameter.getParameterTypeChoice().getParameterTypeChoiceItem(0).getParameterValue().getContent();
+				notFound = false;
+			}
+		}
+		
+		if(notFound)
+			throw new NoSuchFieldException(parameterName + " for job " + getJobId() 
+					+ " task "+ getId() + " is not defined.");
+		
+		return returnValue;
+	}
+
+	public String getParameterStringValue(ResourceParameterName parameterName)
+			throws NoSuchFieldException, IllegalArgumentException {
+		ComputingResourceParameterTypeNameType name = ComputingResourceParameterTypeNameType.valueOf(parameterName.value().toUpperCase());
+		
+		switch (name) {
+			case CPUCOUNT:
+			case GPUCOUNT:
+			case CPUSPEED:
+			case DISKSPACE:
+			case FREECPUS:
+			case FREEDISKSPACE:
+			case FREEMEMORY:
+			case MEMORY:
+				throw new IllegalArgumentException("For " + parameterName + " use getParameterDoubleValue() method.");
+		}
+		
+		ComputingResourceBaseTypeItem item[] = getComputingResourceRequirements();
+		
+		String returnValue = null;
+		boolean notFound = true;
+		
+		for(int i = 0; i < item.length && notFound; i++){
+			ComputingResourceParameterType hostParameter = item[i].getHostParameter();
+			if(hostParameter == null)
+				continue;
+			
+			if(name == hostParameter.getName()) {
+				returnValue = hostParameter.getStringValue(0).getValue();
+				notFound = false;
+			}
+		}
+		
+		if(notFound)
+			throw new NoSuchFieldException(parameterName + " for job " + getJobId() 
+					+ " task "+ getId() + " is not defined.");
+		
+		return returnValue;
+	}
+
+	public DateTime getSubmissionTimeToBroker() {
+		if(this.brokerSubmitTime != null)
+			return this.brokerSubmitTime;
+		
+		this.brokerSubmitTime = new DateTime(this.task.getSubmissionTime());
+		
+		return this.brokerSubmitTime;
+	}
+
+	public String getId() {
+		return this.task.getTaskId();
+	}
+
+	public String getUserDn() {
+		return this.task.getUserDN();
+	}
+
+	public org.qcg.broker.schemas.resreqs.Task getDescription() {
+		return this.task;
+	}
+
+	public String getDocument() throws Exception {
+		StringWriter writer = new StringWriter();
+		
+		marshaller.marshal(this.task, writer);
+		
+		return writer.toString();
+	}
+	
+	protected ComputingResourceBaseTypeItem[] getComputingResourceRequirements() throws NoSuchFieldException{
+		
+		Requirements req = this.task.getRequirements();
+		if(req == null)
+			throw new NoSuchFieldException("Requierements section for job " + getJobId() 
+										+ " task "+ getId() + " is not defined.");
+		
+		TaskResourceRequirements taskReq = req.getTaskResourceRequirements();
+		if(taskReq == null)
+			throw new NoSuchFieldException("Task resource requirements section for job " + getJobId() 
+					+ " task "+ getId() + " is not defined.");
+		
+		ComputingResource computingResource = taskReq.getComputingResource(0);
+		if(computingResource == null)
+			throw new NoSuchFieldException("Computing resource requirement for job " + getJobId() 
+					+ " task "+ getId() + " is not defined.");
+		
+		ComputingResourceBaseTypeItem item[] = computingResource.getComputingResourceBaseTypeItem();
+		if(item == null || item.length == 0)
+			throw new NoSuchFieldException("Computing resource requirement is empty for job " + getJobId() 
+					+ " task "+ getId());
+	
+		return item;
+	}
+	
+	public void setValue(ResourceParameterName parameterName, Object newValue) throws NoSuchFieldException{
+		boolean notFound = true;
+		
+		ComputingResourceParameterTypeNameType name = ComputingResourceParameterTypeNameType.valueOf(parameterName.value().toUpperCase());
+		
+		ComputingResourceBaseTypeItem item[] = getComputingResourceRequirements();
+		
+		for(int i = 0; i < item.length && notFound; i++){
+			ComputingResourceParameterType hostParameter = item[i].getHostParameter();
+			if(hostParameter == null)
+				continue;
+			
+			if(name == hostParameter.getName()) {
+				hostParameter.
+						getParameterTypeChoice().
+						getParameterTypeChoiceItem(0).
+						getParameterValue().
+						setContent(((Integer)newValue).doubleValue());
+				notFound = false;
+			}
+		}
+		
+		if(notFound)
+			throw new NoSuchFieldException(parameterName + " for job " + getJobId() 
+					+ " task "+ getId() + " is not defined.");
+	}
+
+	public List<AbstractProcessesGroup> getProcessesGroups() {
+		return this.groups;
+	}
+	
+	public List<AbstractProcesses> getProcesses(){
+		return this.processes;
+	}
+	
+	public List<AbstractProcesses> getProcesses(AbstractProcessesGroup processGroup){
+		if(this.processes == null)
+			return null;
+		
+		List<AbstractProcesses> ret = new ArrayList<AbstractProcesses>();
+		
+		for(int i = 0; i < processes.size(); i++){
+			AbstractProcesses p = processes.get(i);
+			if(p.belongsTo(processGroup))
+				ret.add(p);
+		}
+		
+		return ret;
+	}
+	
+	protected void prepareTopology(){
+		if(this.task.getRequirements() == null)
+			return;
+		
+		if(this.task.getRequirements().getTopologyCount() < 1)
+			return;
+		
+		Topology topology = this.task.getRequirements().getTopology(0);
+		
+		if(topology.getGroupCount() > 0){
+			this.groups = new ArrayList<AbstractProcessesGroup>(topology.getGroupCount());
+		}
+		
+		for(int i = 0; i < topology.getGroupCount(); i++){
+			this.groups.add(new ProcessesGroup(topology.getGroup(i)));
+		}
+
+		if(topology.getProcessesCount() > 0){
+			this.processes = new ArrayList<AbstractProcesses>(topology.getProcessesCount());
+		}
+
+		for(int i = 0; i < topology.getProcessesCount(); i++){
+			org.qcg.broker.schemas.resreqs.Processes p = topology.getProcesses(i);
+			if(p.getProcessesResourceRequirements() == null){
+				TaskResourceRequirements trr = this.task.getRequirements().getTaskResourceRequirements();
+				if(trr != null) {
+					ProcessesResourceRequirements prr = new ProcessesResourceRequirements();
+					
+					for(int cridx = 0; cridx < trr.getComputingResourceCount(); cridx++){
+						ComputingResourceExtType cre = new ComputingResourceExtType();
+						ComputingResource cr = trr.getComputingResource(cridx);
+						
+						for(int j = 0; j < cr.getComputingResourceBaseTypeItemCount(); j++){
+							cre.addComputingResourceBaseTypeItem(cr.getComputingResourceBaseTypeItem(j));
+						}
+						
+						prr.addComputingResource(cre);
+					}
+					
+					p.setProcessesResourceRequirements(prr);
+				}
+			}
+			
+			this.processes.add(new Processes(p));
+		}
+	}
+
+	public double getCpuCntRequest() throws NoSuchFieldException {
+		return getParameterDoubleValue(ResourceParameterName.CPUCOUNT);
+	}
+
+	public double getMemoryRequest() throws NoSuchFieldException {
+		return getParameterDoubleValue(ResourceParameterName.MEMORY);
+	}
+	
+	public long getLength() {
+		return this.length;
+	}
+
+	public int getStatus() {
+		return this.status;
+	}
+
+	public void setLength(long length) {
+		this.length = length;
+	}
+
+	public void setStatus(int status){
+		this.status = status;
+	}
+	
+	public void setSenderId(int id){
+		this.senderId = id;
+	}
+	
+	public int getSenderId(){
+		return this.senderId;
+	}
+	
+	public boolean isFinished(){
+		if(processes == null)
+			return (status > 3 && status <= 6);
+		
+		for(int i = 0; i < processes.size(); i++){
+			if(!processes.get(i).isFinished())
+				return false;
+		}
+		
+		return true;
+	}
+	
+	public long getWorkloadLogWaitTime() {
+		return workloadLogWaitTime;
+	}
+
+	public void setWorkloadLogWaitTime(long waitTime) {
+		this.workloadLogWaitTime = waitTime;
+	}
+	
+	/*public void addToResPath(String resName){
+		if(resPathHistory == null)
+			resPathHistory = new String();
+		resPathHistory = new StringBuffer(resPathHistory).append(resName).append("_").toString();
+
+	}
+	
+	public String getResPath(){
+		return this.resPathHistory;
+
+	}*/
+
+	@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() {
+		// TODO Auto-generated method stub
+		return 0;
+	}
+
+	@Override
+	public int getUserID() {
+		// TODO Auto-generated method stub
+		return 0;
+	}
+
+	public boolean isRegistered() {
+		return isRegistered;
+	}
+
+	public void register(JobRegistryImpl jobRegistry) {
+		isRegistered = true;
+	}
+
+	public void accept(WorkloadUnitHandler wuh) {
+		wuh.handleTask(this);
+	}
+}
Index: DCWoRMS/trunk/build/classes/schedframe/scheduling/tasks/requirements/AbstractTimeRequirements.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/scheduling/tasks/requirements/AbstractTimeRequirements.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/scheduling/tasks/requirements/AbstractTimeRequirements.java	(revision 477)
@@ -0,0 +1,28 @@
+package schedframe.scheduling.tasks.requirements;
+
+import org.joda.time.MutableInterval;
+import org.joda.time.ReadableDuration;
+
+import schedframe.DescriptionContainer;
+
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ * @param <T>
+ */
+public abstract class AbstractTimeRequirements<T> extends MutableInterval implements DescriptionContainer<T> {
+
+
+	private static final long serialVersionUID = 414381664327908536L;
+
+	protected T timeRequirements;
+	
+	protected ReadableDuration expectedDuration;
+	
+	public ReadableDuration getExpectedDuration(){
+		return this.expectedDuration;
+	}
+
+}
Index: DCWoRMS/trunk/build/classes/schedframe/scheduling/tasks/requirements/ResourceParameterName.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/scheduling/tasks/requirements/ResourceParameterName.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/scheduling/tasks/requirements/ResourceParameterName.java	(revision 477)
@@ -0,0 +1,144 @@
+package schedframe.scheduling.tasks.requirements;
+
+
+public enum ResourceParameterName {
+
+	/**
+     * Constant OSNAME
+     */
+    OSNAME("osname"),
+    /**
+     * Constant OSTYPE
+     */
+    OSTYPE("ostype"),
+    /**
+     * Constant CPUARCH
+     */
+    CPUARCH("cpuarch"),
+    /**
+     * Constant OSVERSION
+     */
+    OSVERSION("osversion"),
+    /**
+     * Constant OSRELEASE
+     */
+    OSRELEASE("osrelease"),
+    /**
+     * Constant MEMORY
+     */
+    MEMORY("Memory"),
+    /**
+     * Constant FREEMEMORY
+     */
+    FREEMEMORY("freememory"),
+    /**
+     * Constant CPUCOUNT
+     */
+    CPUCOUNT("cpucount"),
+    
+    /**
+     * Constant CPUCOUNT
+     */
+    GPUCOUNT("gpucount"),
+    
+    /**
+     * Constant FREECPUS
+     */
+    FREECPUS("freecpus"),
+    /**
+     * Constant CPUSPEED
+     */
+    CPUSPEED("cpuspeed"),
+    /**
+     * Constant APPLICATION
+     */
+    APPLICATION("application"),
+    /**
+     * Constant DISKSPACE
+     */
+    DISKSPACE("Storage"),
+    /**
+     * Constant FREEDISKSPACE
+     */
+    FREEDISKSPACE("freediskspace"),
+    /**
+     * Constant REMOTESUBMISSIONINTERFACE
+     */
+    REMOTESUBMISSIONINTERFACE("remoteSubmissionInterface"),
+    /**
+     * Constant LOCALRESOURCEMANAGER
+     */
+    LOCALRESOURCEMANAGER("localResourceManager"),
+    /**
+     * Constant HOSTNAME
+     */
+    HOSTNAME("hostname"),
+    
+    COST("cost");
+    
+ //   PROCESSINGELEMENTS("processingElements");
+
+      //--------------------------/
+     //- Class/Member Variables -/
+    //--------------------------/
+
+    /**
+     * Field value.
+     */
+    private final java.lang.String value;
+
+
+      //----------------/
+     //- Constructors -/
+    //----------------/
+
+    private ResourceParameterName(final java.lang.String value) {
+        this.value = value;
+    }
+
+
+      //-----------/
+     //- Methods -/
+    //-----------/
+
+    /**
+     * Method fromValue.
+     * 
+     * @param value
+     * @return the constant for this value
+     */
+    public static ResourceParameterName fromValue(final java.lang.String value) {
+        for (ResourceParameterName c: ResourceParameterName.values()) {
+            if (c.value.equals(value)) {
+                return c;
+            }
+        }
+        throw new IllegalArgumentException(value);
+    }
+
+    /**
+     * 
+     * 
+     * @param value
+     */
+    public void setValue(final java.lang.String value) {
+    }
+
+    /**
+     * Method toString.
+     * 
+     * @return the value of this constant
+     */
+    public java.lang.String toString() {
+        return this.value;
+    }
+
+    /**
+     * Method value.
+     * 
+     * @return the value of this constant
+     */
+    public java.lang.String value() {
+        return this.value;
+    }
+}
Index: DCWoRMS/trunk/build/classes/schedframe/scheduling/tasks/requirements/ResourceRequirements.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/scheduling/tasks/requirements/ResourceRequirements.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/scheduling/tasks/requirements/ResourceRequirements.java	(revision 477)
@@ -0,0 +1,67 @@
+package schedframe.scheduling.tasks.requirements;
+
+import java.io.StringWriter;
+import java.io.Writer;
+
+import org.exolab.castor.xml.Marshaller;
+import org.exolab.castor.xml.ResolverException;
+import org.exolab.castor.xml.XMLContext;
+
+
+import schedframe.scheduling.tasks.TaskInterface;
+import org.qcg.broker.schemas.resreqs.Task;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+public class ResourceRequirements extends AbstractResourceRequirements<Task>{
+
+	protected static Marshaller marshaller;
+	static {
+		XMLContext context = new XMLContext();
+		try {
+			context.addClass(org.qcg.broker.schemas.resreqs.Task.class);
+			marshaller = context.createMarshaller();
+		} catch (ResolverException e) {
+			e.printStackTrace();
+			marshaller = null;
+		}
+	}
+	
+	protected TaskInterface<?> task;
+	
+	public ResourceRequirements(Task task){
+		this.task = new schedframe.scheduling.tasks.Task(task);
+		this.resourceRequirements = task;
+	}
+	
+	public ResourceRequirements(TaskInterface<?> task){
+		this.task = task;
+		this.resourceRequirements = (Task) task.getDescription();
+	}
+	
+	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 Task getDescription() {
+		return this.resourceRequirements;
+	}
+
+	public String getDocument() throws Exception {
+		Writer w = new StringWriter();
+		
+		marshaller.marshal(this.resourceRequirements, w);
+
+		return w.toString();
+	}
+
+}
Index: DCWoRMS/trunk/build/classes/schedframe/scheduling/tasks/requirements/AbstractResourceRequirements.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/scheduling/tasks/requirements/AbstractResourceRequirements.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/scheduling/tasks/requirements/AbstractResourceRequirements.java	(revision 477)
@@ -0,0 +1,62 @@
+package schedframe.scheduling.tasks.requirements;
+
+import schedframe.DescriptionContainer;
+
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ * @param <T>
+ */
+public abstract class AbstractResourceRequirements<T> implements DescriptionContainer<T> {
+
+	protected T resourceRequirements;
+	protected boolean isBestEffort;
+	
+	
+	protected AbstractResourceRequirements(){
+		this.isBestEffort = true;
+	}
+	/**
+	 * 
+	 * @param parameterName name of the task resource requirement
+	 * @return value of the numeral parameter which describes task resource requirement
+	 * @throws NoSuchFieldException if such parameter is not defined
+	 * @throws IllegalArgumentException if requested parameter is String value
+	 */
+	public abstract double getParameterDoubleValue(ResourceParameterName parameterName)
+		throws NoSuchFieldException, IllegalArgumentException;
+	
+	/**
+	 * 
+	 * @param parameterName name of the task resource requirement
+	 * @return value of the String parameter which describes task resource requirement
+	 * @throws NoSuchFieldException if such parameter is not defined
+	 * @throws IllegalArgumentException if requested parameter is Double value
+	 */
+	public abstract String getParameterStringValue(ResourceParameterName parameterName)
+		throws NoSuchFieldException, IllegalArgumentException;
+	
+	
+	public double getCpuCntRequest() throws NoSuchFieldException{
+		return getParameterDoubleValue(ResourceParameterName.CPUCOUNT);
+	}
+	
+	public double getMemoryRequest() throws NoSuchFieldException{
+		return getParameterDoubleValue(ResourceParameterName.MEMORY);
+	}
+	
+	public int getProcessesCount(){
+		return 1;
+	}
+	
+	public boolean isBestEffort(){
+		return this.isBestEffort;
+	}
+	
+	public void setBestEffort(boolean value){
+		this.isBestEffort = value;
+	}
+	
+}
Index: DCWoRMS/trunk/build/classes/schedframe/scheduling/tasks/requirements/ProcessesResourceRequirements.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/scheduling/tasks/requirements/ProcessesResourceRequirements.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/scheduling/tasks/requirements/ProcessesResourceRequirements.java	(revision 477)
@@ -0,0 +1,51 @@
+package schedframe.scheduling.tasks.requirements;
+
+import java.io.StringWriter;
+import java.io.Writer;
+
+import org.qcg.broker.schemas.resreqs.Processes;
+
+import schedframe.scheduling.tasks.AbstractProcesses;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+public class ProcessesResourceRequirements extends AbstractResourceRequirements<org.qcg.broker.schemas.resreqs.Processes> {
+
+	protected AbstractProcesses processes;
+	
+	public ProcessesResourceRequirements(AbstractProcesses processes){
+		this.processes = processes;
+	}
+	
+	public ProcessesResourceRequirements(org.qcg.broker.schemas.resreqs.Processes processes){
+		this.processes = new schedframe.scheduling.tasks.Processes(processes);
+	}
+	
+	public double getParameterDoubleValue(ResourceParameterName parameterName)
+			throws NoSuchFieldException, IllegalArgumentException {
+		return this.processes.getParameterDoubleValue(parameterName);
+	}
+
+	public String getParameterStringValue(ResourceParameterName parameterName)
+			throws NoSuchFieldException, IllegalArgumentException {
+		return this.processes.getParameterStringValue(parameterName);
+	}
+
+	public int getProcessesCount(){
+		return this.processes.getProcessesCount();
+	}
+	
+	public Processes getDescription() {
+		return this.resourceRequirements;
+	}
+
+	public String getDocument() throws Exception {
+		Writer w = new StringWriter();
+		this.resourceRequirements.marshal(w);
+		return w.toString();
+	}
+
+}
Index: DCWoRMS/trunk/build/classes/schedframe/scheduling/tasks/requirements/TimeRequirements.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/scheduling/tasks/requirements/TimeRequirements.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/scheduling/tasks/requirements/TimeRequirements.java	(revision 477)
@@ -0,0 +1,215 @@
+package schedframe.scheduling.tasks.requirements;
+
+import java.io.StringWriter;
+import java.io.Writer;
+import java.util.Iterator;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.joda.time.DateTime;
+import org.joda.time.Duration;
+import org.joda.time.ReadableDuration;
+
+
+import org.qcg.broker.schemas.resreqs.ExecutionTimeType;
+import org.qcg.broker.schemas.resreqs.Task;
+
+import schedframe.scheduling.tasks.TaskInterface;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+public class TimeRequirements extends AbstractTimeRequirements<ExecutionTimeType>{
+	
+	protected static Log log = LogFactory.getLog(TimeRequirements.class);
+
+	private static final long serialVersionUID = -4011141375443906415L;
+
+	protected TimeRequirements(){
+	}
+	
+	public TimeRequirements(ExecutionTimeType execTimeType) throws NoSuchFieldException{
+		this.timeRequirements = execTimeType;
+		DateTime startTime = null;
+		DateTime endTime = null;
+
+		org.exolab.castor.types.Duration cd = execTimeType.getExecutionDuration();
+		this.expectedDuration = new Duration(cd.toLong());
+
+		
+		try {
+			startTime = new DateTime(execTimeType.getTimePeriod().getPeriodStart().getTime());
+		} catch (Exception e){
+			startTime = new DateTime();
+			log.warn("Period start is not defined.\n" + e.getMessage() + " Using current time: " + startTime);
+		}
+		
+		try {
+			endTime = new DateTime(execTimeType.getTimePeriod().getTimePeriodChoice().getPeriodEnd().getTime());
+		} catch (Exception e){
+			log.warn("Period end is not defined. Trying period duration...\n" + e.getMessage());
+			try {
+				org.exolab.castor.types.Duration duration = execTimeType.getTimePeriod().
+														getTimePeriodChoice().getPeriodDuration();
+				endTime = new DateTime(startTime.getMillis() + duration.toLong());
+			} catch(Exception e1){
+				endTime = new DateTime(Long.MAX_VALUE);
+				log.warn("Period duration is not defined.\n" + e1.getMessage() + " Using infinity: " + endTime);
+			}
+		}
+		
+		setEnd(endTime);
+		setStart(startTime);
+		
+	}
+	
+	public TimeRequirements(TaskInterface<?> task) throws NoSuchFieldException{
+
+		this.expectedDuration = task.getExpectedDuration();
+		
+		DateTime startTime = null;
+		DateTime endTime = null;
+		
+		try {
+			startTime = task.getExecutionStartTime();
+		} catch (NoSuchFieldException e) {
+			startTime = new DateTime();
+			log.warn(e.getMessage() + " Using current time as Start Time " + startTime);
+		}
+		
+		try {
+			endTime = task.getExecutionEndTime();
+		} catch(NoSuchFieldException e){
+			endTime = new DateTime(Long.MAX_VALUE);
+			log.warn(e.getMessage() + " Using infinity as End Time " + endTime);
+		}
+		
+		setEnd(endTime);
+		setStart(startTime);
+		
+		this.timeRequirements = ((Task)task.getDescription()).getExecutionTime();
+		
+	}
+	
+	public TimeRequirements(TaskInterface<?> task, long startInterval, long endInterval) throws NoSuchFieldException{
+		long taskLength = task.getLength();
+		long reqCpu = (long)task.getCpuCntRequest();
+		long taskDuration = taskLength/reqCpu;
+		long workloadLogWaitTime = task.getWorkloadLogWaitTime();
+		long workloadLogStartTime = task.getSubmissionTimeToBroker().getMillis()/1000 + workloadLogWaitTime;
+		long possibleStartTime = workloadLogStartTime - Math.min(workloadLogWaitTime, startInterval);
+
+		DateTime startTime = null;
+		DateTime endTime = null;
+				
+		try {
+			startTime = task.getExecutionStartTime();
+		} catch (NoSuchFieldException e) {
+			startTime = new DateTime(possibleStartTime * 1000);
+			log.warn(e.getMessage() + " Using current time as Start Time " + startTime);
+		}
+
+		try {
+			endTime = task.getExecutionEndTime();
+		} catch(NoSuchFieldException e){
+			endTime = new DateTime(startTime.getMillis() + (int)taskDuration * 1000 + endInterval * 1000);
+			log.warn(e.getMessage() + " Using " + endTime + " as End Time");
+		}
+		
+		setEnd(endTime);
+		setStart(startTime);
+		
+		this.timeRequirements = ((Task)task.getDescription()).getExecutionTime();
+		
+	}
+
+	public void setExpectedDuration(ReadableDuration duration){
+		this.expectedDuration = duration;
+	}
+	
+	public ExecutionTimeType getDescription() {
+		return this.timeRequirements;
+	}
+	
+	public String getDocument() throws Exception {
+		Writer w = new StringWriter();
+		this.timeRequirements.marshal(w);
+		return w.toString();
+	}
+	
+	public Iterator<AbstractTimeRequirements<?>> iterator(long interval){
+		return new TimeIntervalItr(this, interval);
+	}
+	
+	
+	protected class LocalTimeRequirements extends AbstractTimeRequirements<Object> {
+
+		private static final long serialVersionUID = 5132710437273933809L;
+
+		public LocalTimeRequirements(DateTime startTime, DateTime endTime, ReadableDuration duration){
+			setEnd(endTime);
+			setStart(startTime);
+			this.expectedDuration = duration;
+		}
+		
+		public Object getDescription() {
+			throw new RuntimeException("Not implementd.");
+		}
+
+		public String getDocument() throws Exception {
+			throw new RuntimeException("Not implemented.");
+		}
+		
+	}
+	
+	protected class TimeIntervalItr implements Iterator<AbstractTimeRequirements<?>> {
+
+		protected long interval;
+		protected ReadableDuration duration;
+		protected long endTime;
+		protected AbstractTimeRequirements<?> next;
+		
+		public TimeIntervalItr(AbstractTimeRequirements<?> timeReq, long interval){
+			this.interval = interval;
+			this.endTime = timeReq.getEndMillis();
+			this.duration = timeReq.getExpectedDuration();
+			
+			DateTime start = timeReq.getStart();
+			DateTime end = start.plus(timeReq.getExpectedDuration());
+			
+			this.next = new LocalTimeRequirements(start, end, this.duration);
+		}
+		
+		public boolean hasNext() {
+			
+			long intervalEnd = this.next.getEndMillis();
+			
+			return (intervalEnd <= endTime); 
+			
+		}
+
+		public AbstractTimeRequirements<?> next() {
+			AbstractTimeRequirements<?> ret = this.next;
+			
+			if(interval == 0) {
+				endTime = 0;
+			} else {
+				DateTime start = this.next.getStart().plus(interval);
+				DateTime end = this.next.getEnd().plus(interval);
+				
+				this.next = new LocalTimeRequirements(start, end, this.duration);
+			}
+			
+			return ret;
+			
+		}
+
+		public void remove() {
+			throw new RuntimeException("Not implemented.");
+		}
+		
+	}
+
+}
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 477)
@@ -0,0 +1,255 @@
+package schedframe.scheduling.tasks;
+
+import java.util.List;
+
+import org.qcg.broker.schemas.resreqs.ComputingResourceBaseTypeItem;
+import org.qcg.broker.schemas.resreqs.ComputingResourceExtType;
+import org.qcg.broker.schemas.resreqs.ComputingResourceParameterType;
+import org.qcg.broker.schemas.resreqs.CountType;
+import org.qcg.broker.schemas.resreqs.ProcessesChoice;
+import org.qcg.broker.schemas.resreqs.ProcessesMapType;
+import org.qcg.broker.schemas.resreqs.ProcessesResourceRequirements;
+import org.qcg.broker.schemas.resreqs.types.ComputingResourceParameterTypeNameType;
+
+import schedframe.scheduling.WorkloadUnitHandler;
+import schedframe.scheduling.manager.tasks.JobRegistryImpl;
+import schedframe.scheduling.tasks.requirements.ResourceParameterName;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+public class Processes extends AbstractProcesses{
+
+	protected org.qcg.broker.schemas.resreqs.Processes pr;
+	protected int status;
+	
+	protected Processes(){
+		this.pr = null;
+	}
+	
+	public Processes(org.qcg.broker.schemas.resreqs.Processes qcgProcesses){
+		this.pr = qcgProcesses;
+	}
+
+	public String getId() {
+		return this.pr.getProcessesId();
+	}
+
+	public int getProcessesCount() {
+		ProcessesChoice choice = this.pr.getProcessesChoice();
+		
+		CountType countType = choice.getProcessesCount();
+		if(countType != null) {
+			return countType.getValue().getContent().intValue();
+		} 
+		
+		ProcessesMapType mapType = choice.getProcessesMap();
+		if(mapType != null) {
+			int slots = mapType.getSlotsPerNode();
+			int processesPerNode = mapType.getProcessesPerNodeCount();
+			return slots * processesPerNode;
+		}
+		
+		return 0;
+	}
+	
+	public int[] getProcessesMap(){
+		if(this.pr.getProcessesChoice().getProcessesMap() == null)
+			return null;
+		
+		return this.pr.getProcessesChoice().getProcessesMap().getProcessesPerNode();
+	}
+	
+	public int getSlotsPerNode(){
+		if(this.pr.getProcessesChoice().getProcessesMap() == null)
+			return 0;
+		
+		return this.pr.getProcessesChoice().getProcessesMap().getSlotsPerNode();
+		
+	}
+	
+	public double getParameterDoubleValue(ResourceParameterName parameterName)
+			throws NoSuchFieldException, IllegalArgumentException {
+		ComputingResourceParameterTypeNameType name = ComputingResourceParameterTypeNameType.valueOf(parameterName.value().toUpperCase());
+		
+		switch (name) {
+			case APPLICATION:
+			case CPUARCH:
+			case HOSTNAME:
+			case LOCALRESOURCEMANAGER:
+			case OSNAME:
+			case OSRELEASE:
+			case OSTYPE:
+			case OSVERSION:
+			case REMOTESUBMISSIONINTERFACE:
+				throw new IllegalArgumentException("For " + parameterName + " use getParameterStringValue() method.");
+		}
+
+		ComputingResourceBaseTypeItem item[] = getComputingResourceRequirements();
+		
+		double returnValue = 0;
+		boolean notFound = true;
+		
+		for(int i = 0; i < item.length && notFound; i++){
+			ComputingResourceParameterType hostParameter = item[i].getHostParameter();
+			if(hostParameter == null)
+				continue;
+			
+			if(name == hostParameter.getName()) {
+				returnValue = hostParameter.getParameterTypeChoice().getParameterTypeChoiceItem(0).getParameterValue().getContent();
+				notFound = false;
+			}
+		}
+		
+		if(notFound)
+			throw new NoSuchFieldException(parameterName + " for processes " + getId() 
+					+ " is not defined.");
+		
+		return returnValue;
+	}
+
+	public String getParameterStringValue(ResourceParameterName parameterName)
+			throws NoSuchFieldException, IllegalArgumentException {
+		ComputingResourceParameterTypeNameType name = ComputingResourceParameterTypeNameType.valueOf(parameterName.value().toUpperCase());
+		
+		switch (name) {
+			case CPUCOUNT:
+			case GPUCOUNT:
+			case CPUSPEED:
+			case DISKSPACE:
+			case FREECPUS:
+			case FREEDISKSPACE:
+			case FREEMEMORY:
+			case MEMORY:
+				throw new IllegalArgumentException("For " + parameterName + " use getParameterDoubleValue() method.");
+		}
+		
+		ComputingResourceBaseTypeItem item[] = getComputingResourceRequirements();
+		
+		String returnValue = null;
+		boolean notFound = true;
+		
+		for(int i = 0; i < item.length && notFound; i++){
+			ComputingResourceParameterType hostParameter = item[i].getHostParameter();
+			if(hostParameter == null)
+				continue;
+			
+			if(name == hostParameter.getName()) {
+				returnValue = hostParameter.getStringValue(0).getValue();
+				notFound = false;
+			}
+		}
+		
+		if(notFound)
+			throw new NoSuchFieldException(parameterName + " for processes " + getId() + " is not defined.");
+		
+		
+		return returnValue;
+	}
+	
+	public boolean belongsTo(AbstractProcessesGroup group) {
+		for(int i = 0; i < this.pr.getGroupIdReferenceCount(); i++){
+			String idRef = this.pr.getGroupIdReference(i);
+			if(idRef.equals(group.getId())){
+				return true;
+			}
+		}
+		
+		return false;
+	}
+
+	protected ComputingResourceBaseTypeItem[] getComputingResourceRequirements() throws NoSuchFieldException{
+		
+		ProcessesResourceRequirements req = this.pr.getProcessesResourceRequirements();
+		if(req == null)
+			throw new NoSuchFieldException("Requierements section for processes " + getId() 
+										+ " is not defined.");
+		
+		ComputingResourceExtType computingResource = req.getComputingResource(0);
+		if(computingResource == null)
+			throw new NoSuchFieldException("Computing resource requirement for processes " + getId() 
+										+ " is not defined.");
+		
+		ComputingResourceBaseTypeItem item[] = computingResource.getComputingResourceBaseTypeItem();
+		if(item == null || item.length == 0)
+			throw new NoSuchFieldException("Computing resource requirement is empty for processes " + getId());
+	
+		return item;
+	}
+	
+	public void setStatus(int status){
+		this.status = status;
+	}
+	
+	public boolean isFinished(){
+		return (this.status > 3 && this.status <= 6);
+	}
+	
+	public boolean isDivisible(){
+		return this.pr.getDivisible();
+	}
+	
+	public void setDivisible(boolean value){
+		this.pr.setDivisible(value);
+	}
+
+	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() {
+		// 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
+	public boolean isRegistered() {
+		// TODO Auto-generated method stub
+		return false;
+	}
+
+	@Override
+	public void register(JobRegistryImpl jobRegistry) {
+		// TODO Auto-generated method stub
+		
+	}
+
+	@Override
+	public void accept(WorkloadUnitHandler wuh) {
+		// TODO Auto-generated method stub
+		
+	}
+}
Index: DCWoRMS/trunk/build/classes/schedframe/scheduling/tasks/AbstractProcessesGroup.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/scheduling/tasks/AbstractProcessesGroup.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/scheduling/tasks/AbstractProcessesGroup.java	(revision 477)
@@ -0,0 +1,22 @@
+package schedframe.scheduling.tasks;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+public abstract class AbstractProcessesGroup {
+
+	protected String groupId;
+	
+	protected AbstractProcessesGroup(){
+	}
+	
+	protected AbstractProcessesGroup(String groupId){
+		this.groupId = groupId;
+	}
+	
+	public String getId(){
+		return this.groupId;
+	}
+}
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 477)
@@ -0,0 +1,250 @@
+package schedframe.scheduling.tasks;
+
+
+import org.qcg.broker.schemas.resreqs.ParentType;
+import org.qcg.broker.schemas.resreqs.ResourceRequirements;
+import org.qcg.broker.schemas.resreqs.types.TaskStatesName;
+
+import java.io.StringWriter;
+import java.io.Writer;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.joda.time.DateTime;
+
+import qcg.shared.constants.BrokerConstants;
+
+import schedframe.scheduling.WorkloadUnitHandler;
+import schedframe.scheduling.manager.tasks.JobRegistryImpl;
+import schedframe.scheduling.policy.AbstractManagementSystem;
+
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+public class Job implements JobInterface<ResourceRequirements> {
+
+	protected List<Task> tasks;
+	protected int senderId;
+	protected boolean isRegistered;
+	
+	public Job(String id){
+		tasks = new ArrayList<Task>();
+	}
+	
+	public Job(ResourceRequirements resourceRequirements) throws Exception{
+		org.qcg.broker.schemas.resreqs.Task task[] = resourceRequirements.getTask();
+		if(task == null || task.length == 0)
+			throw new NoSuchFieldException("No tasks are defined for job.");
+		
+		this.tasks = new ArrayList<Task>();
+		
+		for(int i = 0; i < task.length; i++){
+			this.tasks.add(new Task(task[i]));
+		}
+		
+		isRegistered = true;
+	}
+
+	public void add(Task task) {
+		this.tasks.add(task);
+	}
+	
+	public String getId() {
+		if(this.tasks.size() == 0)
+			throw new RuntimeException("No tasks are defined for job, so it is not possible to obtain job id.");
+		
+		return this.tasks.get(0).getJobId();
+	}
+	
+	public List<Task> getTask() {
+		return this.tasks;
+	}
+	
+	public Task getTask(String taskId) throws NoSuchFieldException {
+		if(taskId == null)
+			throw new IllegalArgumentException("TaskId can not be null. Specify appropriate taskId.");
+		
+		if(this.tasks == null || this.tasks.size() == 0)
+			throw new NoSuchFieldException("No tasks are defined for job.");
+		
+		Task retTask = null;
+		
+		Iterator<Task> itr = this.tasks.iterator();
+		while(itr.hasNext() && retTask == null){
+			Task task = itr.next();
+			if(taskId.equals(task.getId())){
+				retTask = task;
+			}
+		}
+
+		if(retTask == null)
+			throw new NoSuchFieldException("Task "+taskId + " is not available in job " + getId());
+		
+		return retTask;
+	}
+	
+	public int getTaskCount() {
+		return this.tasks.size();
+	}
+
+	
+	public ResourceRequirements getDescription() {
+		
+		ResourceRequirements resReq = new ResourceRequirements();
+		if(this.tasks == null)
+			return resReq;
+		
+		Iterator<Task> itr = this.tasks.iterator();
+		
+		while(itr.hasNext()){
+			Task task = (Task) itr.next();
+			resReq.addTask(task.getDescription());
+		}
+		
+		return resReq;
+	}
+
+	public String getDocument() throws Exception {
+		ResourceRequirements resReq = getDescription();
+		Writer writer = new StringWriter();
+		
+		resReq.marshal(writer);
+		
+		return writer.toString();
+	}
+
+	public boolean isFinished(){
+		
+		for(int i = 0; i < tasks.size(); i++){
+			//if(tasks.get(i).getStatus() != BrokerConstants.TASK_STATUS_FINISHED)
+			//	return false;
+			if(!tasks.get(i).isFinished())
+				return false;
+		}
+		return true;
+	}
+	
+	public DateTime getSubmissionTimeToBroker(){
+		return tasks.get(0).getSubmissionTimeToBroker();
+	}
+	
+	public int getStatus(){
+		boolean isForAll = true;
+		int baseStatus = tasks.get(0).getStatus();
+		
+		for(int i = 1; i < tasks.size() && isForAll; i++){
+			Task t = tasks.get(i);
+			isForAll = (t.getStatus() == baseStatus);
+			switch(t.getStatus()){
+				case (int)BrokerConstants.TASK_STATUS_QUEUED: 
+					return (int)BrokerConstants.TASK_STATUS_QUEUED;
+				case (int)BrokerConstants.TASK_STATUS_UNSUBMITTED:
+					return (int)BrokerConstants.TASK_STATUS_UNSUBMITTED;
+			}
+		}
+		
+		if(isForAll && baseStatus == BrokerConstants.TASK_STATUS_FINISHED)
+			return (int)BrokerConstants.JOB_STATUS_FINISHED;
+		
+		return -1;
+	}
+	
+	public boolean setStatus(String taskId, int status){
+		boolean found = false;
+		for(int i = 0; i < tasks.size() && !found; i++){
+			Task t = tasks.get(i);
+			if(taskId.equals(t.getId())){
+				try {
+					t.setStatus(status);
+				} catch (Exception e) {
+					// TODO Auto-generated catch block
+					e.printStackTrace();
+				}
+				found = true;
+			}
+		}
+		return found;
+	}
+	
+	public void setSenderId(int id){
+		this.senderId = id;
+	}
+	
+	public int getSenderId(){
+		return this.senderId;
+	}
+	
+	public int getUserID(){
+		return this.senderId;
+	}
+
+	public void setStatus(int status) throws Exception{
+
+	}
+
+	public boolean isRegistered() {
+		return isRegistered;
+	}
+
+	public void register(JobRegistryImpl jobRegistry) {
+		isRegistered = jobRegistry.addJob(this);
+		
+	}
+	
+	@Override
+	public void accept(WorkloadUnitHandler wuh) {
+		wuh.handleJob(this);
+	}
+	
+	private List<Task> getReadyTasks(){
+		
+		List<Task> readyTasks = new ArrayList<Task>();
+
+		int size = tasks.size();
+		for(int i = 0; i < size; i++){
+			int parCnt;
+			int previousTaskReadyCnt = 0;
+			Task task = tasks.get(i);
+			if(task.getStatus() != (int)BrokerConstants.TASK_STATUS_UNSUBMITTED)
+				continue;
+			try{		
+				parCnt = task.getDescription().getWorkflow().getParentCount();
+			} catch(Exception e){
+				parCnt = 0;
+				//e.printStackTrace();
+			}
+			if(parCnt == 0)
+			{
+				readyTasks.add(task);
+			}
+			else
+			{
+				for(int j = 0; j < parCnt; j++){
+					ParentType par = task.getDescription().getWorkflow().getParent(j);
+					if(par.getTriggerState().compareTo(TaskStatesName.FINISHED) == 0){
+						try {
+							if(!getTask(par.getContent()).isFinished()){
+								break;
+							}
+						} catch (NoSuchFieldException e) {
+							// TODO Auto-generated catch block
+							e.printStackTrace();
+						}
+					}
+					previousTaskReadyCnt++;
+				}
+				
+				if(previousTaskReadyCnt == parCnt && task.getDescription().getWorkflow().getAnd() != null)
+						readyTasks.add(task);
+				else if(previousTaskReadyCnt > 0 && task.getDescription().getWorkflow().getOr() != null)
+					readyTasks.add(task);
+			}
+		}		
+		return readyTasks;
+	}
+	
+}
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 477)
@@ -0,0 +1,57 @@
+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> {
+
+	/**
+	 * 
+	 * @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;
+	
+	/**
+	 * 
+	 * @return list of tasks which belongs to this job
+	 */
+	public abstract List<? extends TaskInterface<?>> getTask();
+	
+	/**
+	 * 
+	 * @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();
+
+	public void register(JobRegistryImpl jobRegistry);
+	
+	public void accept(WorkloadUnitHandler wuh);
+
+}
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 477)
@@ -0,0 +1,121 @@
+package schedframe.scheduling.tasks;
+
+import java.util.List;
+
+import org.joda.time.DateTime;
+import org.joda.time.ReadableDuration;
+
+import schedframe.scheduling.tasks.requirements.ResourceParameterName;
+
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+public interface TaskInterface<T> extends WorkloadUnit<T> {
+	
+	/**
+	 * 
+	 * @return task identifier
+	 */
+	public abstract String getId();
+	
+	/**
+	 * 
+	 * @return job identifier. This is the id of the job which contains this task
+	 */
+	public abstract String getJobId();
+	
+	/**
+	 * 
+	 * @return user identifier. This is id (distinguish name) of the user who has
+	 * submitted this task. 
+	 */
+	public abstract String getUserDn();
+	
+	/**
+	 * 
+	 * @return time when this task was submitted
+	 */
+	public abstract DateTime getSubmissionTimeToBroker();
+	
+	/**
+	 * 
+	 * @return the earliest time when the execution of this task can be started
+	 * @throws NoSuchFieldException if value is not specified
+	 */
+	public abstract DateTime getExecutionStartTime() throws NoSuchFieldException;
+	
+	/**
+	 * 
+	 * @return the latest time when the execution of this task must be ended
+	 * @throws NoSuchFieldException if value is not specified
+	 */
+	public abstract DateTime getExecutionEndTime() throws NoSuchFieldException;
+	
+	/**
+	 * 
+	 * @return user expectation about how long it will take to execute this task
+	 * @throws NoSuchFieldException if value is not specified
+	 */
+	public abstract ReadableDuration getExpectedDuration() throws NoSuchFieldException;
+	
+	/**
+	 * 
+	 * @param parameterName name of the task resource requirement
+	 * @return value of the numeral parameter which describes task resource requirement
+	 * @throws NoSuchFieldException if such parameter is not defined
+	 * @throws IllegalArgumentException if requested parameter is String value
+	 */
+	public abstract double getParameterDoubleValue(ResourceParameterName parameterName)
+		throws NoSuchFieldException, IllegalArgumentException;
+	
+	/**
+	 * 
+	 * @param parameterName name of the task resource requirement
+	 * @return value of the String parameter which describes task resource requirement
+	 * @throws NoSuchFieldException if such parameter is not defined
+	 * @throws IllegalArgumentException if requested parameter is Double value
+	 */
+	public abstract String getParameterStringValue(ResourceParameterName parameterName)
+		throws NoSuchFieldException, IllegalArgumentException;
+	
+	/**
+	 * 
+	 * @return length measured in instructions.
+	 */
+	public long getLength();
+	
+	/**
+	 * 
+	 * @param length measured in instructions.
+	 */
+	public void setLength(long length);
+	
+	/**
+	 * 
+	 * @return constant which represent current task status
+	 */
+	public int getStatus();
+	
+	
+	public List<AbstractProcessesGroup> getProcessesGroups();
+	
+	public List<AbstractProcesses> getProcesses();
+	
+	public List<AbstractProcesses> getProcesses(AbstractProcessesGroup processGroup);
+	
+	public void setStatus(int status) throws Exception;
+	
+	public double getCpuCntRequest() throws NoSuchFieldException;
+	
+	public double getMemoryRequest() throws NoSuchFieldException;
+	
+	public long getWorkloadLogWaitTime();
+	
+	//public void addToResPath(String resName);
+	
+	//public String getResPath();
+		
+}
Index: DCWoRMS/trunk/build/classes/schedframe/scheduling/tasks/ProcessesGroup.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/scheduling/tasks/ProcessesGroup.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/scheduling/tasks/ProcessesGroup.java	(revision 477)
@@ -0,0 +1,16 @@
+package schedframe.scheduling.tasks;
+
+import org.qcg.broker.schemas.resreqs.Group;
+
+
+/**
+ * @author Marcin Krystek
+ */
+
+public class ProcessesGroup extends AbstractProcessesGroup {
+
+	public ProcessesGroup(Group group){
+		super(group.getGroupId());
+	}
+	
+}
Index: DCWoRMS/trunk/build/classes/schedframe/scheduling/tasks/SubmittedTask.java
===================================================================
--- DCWoRMS/trunk/build/classes/schedframe/scheduling/tasks/SubmittedTask.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/schedframe/scheduling/tasks/SubmittedTask.java	(revision 477)
@@ -0,0 +1,286 @@
+package schedframe.scheduling.tasks;
+
+import gridsim.GridSim;
+import gridsim.Gridlet;
+import gridsim.ResGridlet;
+import gssim.schedframe.scheduling.ExecTask;
+import gssim.schedframe.scheduling.Executable;
+
+import java.util.List;
+
+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.UsedResourceList;
+import schedframe.scheduling.WorkloadUnitHandler;
+import schedframe.scheduling.manager.tasks.JobRegistryImpl;
+import schedframe.scheduling.tasks.requirements.ResourceParameterName;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+public class SubmittedTask extends ResGridlet implements ExecTask{
+
+	protected Executable task;
+	protected int estimatedDuration;
+	protected UsedResourceList<ResourceHistoryItem> usedResources;
+	//protected List<String> visitedResources;
+	
+	public SubmittedTask(Executable exec) {
+		super(exec);
+		task = exec;
+		this.usedResources = new UsedResourceList<ResourceHistoryItem>();
+		if(exec.requireReservation())
+			this.reservID_ = Integer.valueOf(exec.getReservationId());
+		//this.visitedResources = new ArrayList<String>();
+	}
+
+	public double getCpuCntRequest() throws NoSuchFieldException {
+		return task.getCpuCntRequest();
+	}
+
+	public DateTime getExecutionEndTime() throws NoSuchFieldException {
+		return task.getExecutionEndTime();
+	}
+
+	public DateTime getExecutionStartTime() throws NoSuchFieldException {
+		return task.getExecutionStartTime();
+	}
+
+	public ReadableDuration getExpectedDuration() throws NoSuchFieldException {
+		return task.getExpectedDuration();
+	}
+
+	public int getEstimatedDuration(){
+		return this.estimatedDuration;
+	}
+	
+	public void setEstimatedDuration(int value){
+		this.estimatedDuration = value;
+	}
+	
+	public String getId() {
+		return task.getId();
+	}
+
+	public String getJobId() {
+		return task.getJobId();
+	}
+
+	public long getLength() {
+		return task.getLength();
+	}
+
+	public double getMemoryRequest() throws NoSuchFieldException {
+		return task.getMemoryRequest();
+	}
+
+	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 List<AbstractProcessesGroup> getProcessesGroups() {
+		throw new RuntimeException("Not implemented");
+	}
+	
+	public List<AbstractProcesses> getProcesses(){
+		throw new RuntimeException("Not implemented");
+	}
+	
+	public List<AbstractProcesses> getProcesses(AbstractProcessesGroup processGroup){
+		throw new RuntimeException("Not implemented");
+	}
+
+	public int getStatus() {
+		return task.getStatus();
+	}
+
+	public DateTime getSubmissionTimeToBroker() {
+		return task.getSubmissionTimeToBroker();
+	}
+
+	public String getUserDn() {
+		return task.getUserDn();
+	}
+
+	public void setLength(long length) {
+		throw new RuntimeException("Task length should not be changed here.");
+	}
+
+	public void setStatus(int status) throws Exception {
+		task.setStatus(status);
+	}
+
+	public org.qcg.broker.schemas.resreqs.Task getDescription() {
+		return (org.qcg.broker.schemas.resreqs.Task) task.getDescription();
+	}
+
+	public String getDocument() throws Exception {
+		return task.getDocument();
+	}
+	
+	public boolean expectSpecificResource(ResourceParameterName resourceName){
+		return task.expectSpecificResource(resourceName);
+	}
+	
+	public Object getExpectedSpecificResource(ResourceParameterName resourceName){
+		return task.getExpectedSpecificResource(resourceName);
+	}
+
+	public long getWorkloadLogWaitTime() {
+		return task.getWorkloadLogWaitTime();
+	}
+	
+	public void addUsedResources(ResourceHistoryItem usedResources){
+		this.usedResources.add(usedResources);
+	}
+	
+	//public List<Map<ResourceParameterName, ResourceUnit>> getUsedResources(){
+	public UsedResourceList<ResourceHistoryItem> getUsedResources(){
+		return this.usedResources;
+	}
+	
+	public boolean setGridletStatus(int status)
+    {
+        // gets Gridlet's previous status
+        int prevStatus = gridlet_.getGridletStatus();
+
+        // if the status of a Gridlet is the same as last time, then ignore
+        if (prevStatus == status) {
+            return false;
+        }
+
+        boolean success = true;
+        try
+        {
+            double clock = GridSim.clock();   // gets the current clock
+            long sec = DateTimeUtilsExt.currentTimeMillis() / 1000; // time in seconds 
+            clock = Long.valueOf(sec).doubleValue();
+            
+            // sets Gridlet's current status
+            gridlet_.setGridletStatus(status);
+
+            // if a previous Gridlet status is INEXEC
+            if (prevStatus == Gridlet.INEXEC)
+            {
+                // and current status is either CANCELED, PAUSED or SUCCESS
+                if (status == Gridlet.CANCELED || status == Gridlet.PAUSED ||
+                    status == Gridlet.SUCCESS)
+                {
+                    // then update the Gridlet completion time
+                    totalCompletionTime_ += (clock - startExecTime_);
+                    index_ = 0;
+                    return true;
+                }
+            }
+
+            if (prevStatus == Gridlet.RESUMED && status == Gridlet.SUCCESS)
+            {
+                // then update the Gridlet completion time
+                totalCompletionTime_ += (clock - startExecTime_);
+                return true;
+            }
+
+            // if a Gridlet is now in execution
+            if (status == Gridlet.INEXEC ||
+                (prevStatus == Gridlet.PAUSED && status == Gridlet.RESUMED) )
+            {
+            	
+                startExecTime_ = clock;
+                gridlet_.setExecStartTime(startExecTime_);
+        		ProcessingElements pes = (ProcessingElements) getUsedResources().getLast().getResourceUnits().get(StandardResourceUnitName.PE);
+        		for (ComputingResource resource : pes) {
+
+        			visitResource(resource.getName());
+        			ComputingResource parent = resource.getParent();
+
+					List<String> visitedResource = getVisitedResources();
+        			while (parent != null && !ArrayUtils.contains(visitedResource.toArray(new String[visitedResource.size()]), parent.getName())) {
+        				visitResource(parent.getName());
+        				parent = parent.getParent();
+        			}
+        		}
+            }
+        }
+        catch(Exception e) {
+            success = false;
+        }
+
+        return success;
+    }
+	
+	
+	protected void init() {
+		super.init();
+		double time =  DateTimeUtilsExt.getDateTimeAt(arrivalTime_).getMillis() / 1000;
+		this.gridlet_.setSubmissionTime(time);
+	 }
+
+	@Override
+	public List<Task> 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() {
+		// TODO Auto-generated method stub
+		return 0;
+	}
+
+	@Override
+	public boolean isFinished() {
+		// TODO Auto-generated method stub
+		return false;
+	}
+	
+	/*public void addToResPath(String resName){
+		task.addToResPath(resName);
+	}
+	
+	public String getResPath(){
+		return task.getResPath();
+	}*/
+	
+	public void visitResource(String resName){
+		task.visitResource(resName);
+	}
+	
+	public List<String> getVisitedResources(){
+		return task.getVisitedResources();
+	}
+	
+	public boolean isRegistered() {
+		return task.isRegistered();
+	}
+
+	public void register(JobRegistryImpl jobRegistry) {
+		task.register(jobRegistry);
+		//jobRegistry.addTask(this);
+	}
+	
+	@Override
+	public void accept(WorkloadUnitHandler wuh) {
+		wuh.handleSubmittedTask(this);
+	}
+}
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 477)
@@ -0,0 +1,29 @@
+package schedframe.scheduling.tasks;
+
+import schedframe.scheduling.tasks.requirements.ResourceParameterName;
+
+public abstract class AbstractProcesses<T> implements WorkloadUnit<T>{
+	
+	
+	public abstract String getId();
+	
+	public abstract int getProcessesCount();
+	
+	public abstract int[] getProcessesMap();
+	
+	public abstract int getSlotsPerNode();
+	
+	public abstract boolean belongsTo(AbstractProcessesGroup group);
+	
+	public abstract double getParameterDoubleValue(ResourceParameterName parameterName)
+		throws NoSuchFieldException, IllegalArgumentException;
+
+	public abstract String getParameterStringValue(ResourceParameterName parameterName)
+		throws NoSuchFieldException, IllegalArgumentException;
+	
+	public abstract boolean isFinished();
+	
+	public abstract void setStatus(int status);
+	
+	public abstract boolean isDivisible();
+}
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 477)
@@ -0,0 +1,49 @@
+package schedframe.scheduling.tasks;
+
+import java.util.List;
+
+import schedframe.DescriptionContainer;
+
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+public interface JobInterface<T> extends WorkloadUnit<T> {
+
+	/**
+	 * 
+	 * @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;
+	
+	/**
+	 * 
+	 * @return list of tasks which belongs to this job
+	 */
+	public abstract List<? extends TaskInterface<?>> getTask();
+	
+	/**
+	 * 
+	 * @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 int getUserID();
+}
Index: DCWoRMS/trunk/build/classes/gssim/schedframe/scheduling/plugin/local/WormsTimeOperations.java
===================================================================
--- DCWoRMS/trunk/build/classes/gssim/schedframe/scheduling/plugin/local/WormsTimeOperations.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/gssim/schedframe/scheduling/plugin/local/WormsTimeOperations.java	(revision 477)
@@ -0,0 +1,25 @@
+package gssim.schedframe.scheduling.plugin.local;
+
+import org.joda.time.DateTime;
+
+import schedframe.scheduling.plugin.local.TimeOperations;
+
+public class WormsTimeOperations extends TimeOperations {
+
+	public WormsTimeOperations(){
+		this(0);
+	}
+	
+	public WormsTimeOperations(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/gssim/schedframe/scheduling/utils/TaskDescription.java
===================================================================
--- DCWoRMS/trunk/build/classes/gssim/schedframe/scheduling/utils/TaskDescription.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/gssim/schedframe/scheduling/utils/TaskDescription.java	(revision 477)
@@ -0,0 +1,108 @@
+package gssim.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/gssim/schedframe/scheduling/utils/JobDescription.java
===================================================================
--- DCWoRMS/trunk/build/classes/gssim/schedframe/scheduling/utils/JobDescription.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/gssim/schedframe/scheduling/utils/JobDescription.java	(revision 477)
@@ -0,0 +1,73 @@
+package gssim.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/gssim/schedframe/scheduling/Executable.java
===================================================================
--- DCWoRMS/trunk/build/classes/gssim/schedframe/scheduling/Executable.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/gssim/schedframe/scheduling/Executable.java	(revision 477)
@@ -0,0 +1,311 @@
+package gssim.schedframe.scheduling;
+
+
+import gridsim.Gridlet;
+
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.joda.time.DateTime;
+import org.joda.time.DateTimeUtilsExt;
+import org.joda.time.ReadableDuration;
+
+import schedframe.scheduling.WorkloadUnitHandler;
+import schedframe.scheduling.manager.tasks.JobRegistryImpl;
+import schedframe.scheduling.policy.AbstractManagementSystem;
+import schedframe.scheduling.tasks.AbstractProcesses;
+import schedframe.scheduling.tasks.AbstractProcessesGroup;
+import schedframe.scheduling.tasks.Task;
+import schedframe.scheduling.tasks.TaskInterface;
+import schedframe.scheduling.tasks.requirements.ResourceParameterName;
+
+/**
+ * 
+ * @author Marcin Krystek
+ *
+ */
+public class Executable extends Gridlet implements ExecTask{
+
+	protected Task task;
+	protected String processesSetId;
+	
+	protected List<String> visitedResources;
+	
+
+	
+	public Executable(Task t){
+		super(0, 0, 0, 0);
+		this.task = t;
+		super.gridletID_ = (t.getJobId() + "_" + t.getId()).hashCode();
+		reservationId = null;
+		this.visitedResources = new ArrayList<String>();
+		setUserID(task.getSenderId());
+	}
+	
+	public Executable(Task t, AbstractProcesses procesesSet){
+		super(0, 0, 0, 0);
+		this.task = t;
+		this.processesSetId = procesesSet.getId(); 
+		super.gridletID_ = (t.getJobId() + "_" + t.getId() + "_" + processesSetId).hashCode();
+		this.visitedResources = new ArrayList<String>();
+		setUserID(task.getSenderId());
+	}
+	
+	public DateTime getExecutionEndTime() throws NoSuchFieldException {
+		return task.getExecutionEndTime();
+	}
+
+	public DateTime getExecutionStartTime() throws NoSuchFieldException {
+		return task.getExecutionStartTime();
+	}
+
+	public ReadableDuration getExpectedDuration() throws NoSuchFieldException {
+		return task.getExpectedDuration();
+	}
+
+	public String getId() {
+		if(processesSetId == null)
+			return task.getId();
+		else 
+			return task.getId() + "_" + processesSetId;
+	}
+
+	public String getJobId() {
+		return task.getJobId();
+	}
+
+	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 DateTime getSubmissionTimeToBroker() {
+		return task.getSubmissionTimeToBroker();
+	}
+
+	public String getUserDn() {
+		return task.getUserDn();
+	}
+
+	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 void setReservationId(String reservationId){
+		this.reservationId = reservationId;
+	}
+	
+	public String getProcessesId(){
+		return this.processesSetId;
+	}
+	
+	public String getTaskId(){
+		return this.task.getId();
+	}
+	
+	public void addSpecificResource(ResourceParameterName resourceName, Object value){
+		if(this.chosenResources == null)
+			this.chosenResources = new HashMap<ResourceParameterName, Object>();
+		
+		this.chosenResources.put(resourceName, value);
+	}
+
+	public long getWorkloadLogWaitTime() {
+		return task.getWorkloadLogWaitTime();
+	}
+
+	@Override
+	public List<TaskInterface<?>> 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() {
+		// TODO Auto-generated method stub
+		return 0;
+	}
+	
+	
+	/*public void addToResPath(String resName){
+		task.addToResPath(resName);
+	}
+	
+	public String getResPath(){
+		return task.getResPath();
+	}
+	*/
+	
+	public void visitResource(String resName){
+		visitedResources.add(resName);
+	}
+	
+	public List<String> getVisitedResources(){
+		return visitedResources;
+	}
+	
+	
+	protected String reservationId;
+	
+	public boolean requireReservation(){
+		return (reservationId != null);
+	}
+	
+	public String getReservationId(){
+		return this.reservationId;
+	}
+	
+	
+	public boolean equals(Object obj){
+		if(obj instanceof Executable){
+			Executable t = (Executable) obj;
+			return getId().equals(t.getId());
+		}
+		return false;
+	}
+	
+	public void setGridletStatus(int newStatus) throws Exception {
+		if(status_ == newStatus)
+			return;
+		
+		super.setGridletStatus(newStatus);
+		
+		if (newStatus == Gridlet.SUCCESS || newStatus == Gridlet.CANCELED) {
+            finishTime_ = DateTimeUtilsExt.currentTimeMillis() / 1000;
+        }
+	}
+
+	/**
+	 * @return the sum of the actual CPU time values for every gird resource, 
+	 * that this sub task has been executed on
+	 */
+	public double getTotalProcessingTime() {
+		double totalProcessingTime = 0.0;
+		for (Object resObj : resList_) {
+			Resource res = (Resource) resObj;
+			totalProcessingTime += res.actualCPUTime;
+		}
+		return totalProcessingTime;
+	}
+	
+
+	protected Map<ResourceParameterName, Object> chosenResources;
+
+	
+	/**
+	 * 
+	 * @return length measured in instructions.
+	 */
+	public long getLength() {
+		return Double.valueOf(getGridletLength()).longValue();
+	}
+	
+	/**
+	 * 
+	 * @param length measured in instructions.
+	 */
+	public void setLength(long length){
+		setGridletLength(Long.valueOf(length).doubleValue());
+	}
+	
+	/**
+	 * 
+	 * @return constant which represent current task status
+	 */
+	public int getStatus() {
+		return getGridletStatus();
+	}
+	
+	/**
+	 * 
+	 * @param status constant which describes current new task status
+	 */
+	public void setStatus(int status) throws Exception {
+		setGridletStatus(status);
+	}
+	
+	public double getCpuCntRequest() throws NoSuchFieldException{
+		return getParameterDoubleValue(ResourceParameterName.CPUCOUNT);
+	}
+	
+	public double getMemoryRequest() throws NoSuchFieldException{
+		return getParameterDoubleValue(ResourceParameterName.MEMORY);
+	}
+	
+	public boolean isFinished()
+    {
+        if (index_ == -1) {
+            return false;
+        }
+
+        boolean completed = false;
+
+        // if result is 0 or -ve then this Gridlet has finished
+        double finish = ( (Resource) resList_.get(index_) ).finishedSoFar;
+        double result = gridletLength_ - finish;
+        if (result <= 0.001) {
+            completed = true;
+        }
+
+        return completed;
+    }
+	
+	public boolean expectSpecificResource(ResourceParameterName resourceName){
+		if(this.chosenResources == null)
+			return false;
+
+		return this.chosenResources.containsKey(resourceName);
+	}
+	
+	public Object getExpectedSpecificResource(ResourceParameterName resourceName){
+		if(this.chosenResources == null)
+			return null;
+		
+		return this.chosenResources.get(resourceName);
+	}
+	
+	public boolean isRegistered() {
+		return task.isRegistered();
+	}
+
+	public void register(JobRegistryImpl jobRegistry) {
+		task.register(jobRegistry);
+
+	}
+	
+	@Override
+	public void accept(WorkloadUnitHandler wuh) {
+		wuh.handleExecutable(this);
+	}
+}
Index: DCWoRMS/trunk/build/classes/gssim/schedframe/scheduling/ExecTask.java
===================================================================
--- DCWoRMS/trunk/build/classes/gssim/schedframe/scheduling/ExecTask.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/gssim/schedframe/scheduling/ExecTask.java	(revision 477)
@@ -0,0 +1,18 @@
+package gssim.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 addToResPath(String resName);
+	//public String getResPath();
+	
+	public void visitResource(String resName);
+	public List<String> getVisitedResources();
+}
Index: DCWoRMS/trunk/build/classes/gssim/schedframe/scheduling/queues/AbstractStatsSupportingQueue.java
===================================================================
--- DCWoRMS/trunk/build/classes/gssim/schedframe/scheduling/queues/AbstractStatsSupportingQueue.java	(revision 477)
+++ DCWoRMS/trunk/build/classes/gssim/schedframe/scheduling/queues/AbstractStatsSupportingQueue.java	(revision 477)
@@ -0,0 +1,106 @@
+package gssim.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/.classpath
===================================================================
--- DCWoRMS/trunk/.classpath	(revision 477)
+++ DCWoRMS/trunk/.classpath	(revision 477)
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry excluding="test/kikas/generator/create/|test/kikas/generator/supplement/|test/inputs/|test/outputs/|test/xml/|test/queueingsystem/workload/|test/generator/newWorkload/|test/generator/supplement/|test/slotsJoin/workload_1/|test/ariel/workload/|test/pluginsReferecnce/workload/|simulator/workload/generator/ResourceGeneratorInterface.java|simulator/workload/generator/impl/ResourceGenerator.java|simulator/workload/generator/validators/XMLValidator.java|simulator/workload/generator/validators/ResourceConfigValidator.java|schedframe2/JobInterface.java|schedframe2/TaskInterface.java|schedframe2/TimeInterval.java|schedframe2/Duration.java|schedframe2/resources/RequestedResourceDescription.java|schedframe2/resUnits/ContinuousResourceUnit.java|schedframe2/resUnits/DiscreteResourceUnit.java|simulator/factory/QueueingSystemFactory.java|simulator/factory/ResourcesRandomNumbersFactory.java|simulator/factory/SingleResourceFactory.java|simulator/utils/GssimTimeOperations.java|test/schedframe2/expermient/workload/|gridsim/gssim/GssimGridlet.java|simulator/JobGridlet.java|simulator/TaskGridlet.java|simulator/SubTaskGridlet.java|simulator/GridSchedulerInterface.java|grms/broker/BrokerUtils.java|simulator/gridresource/|simulator/lists/JobGridletList.java|simulator/lists/ResourceUsageDynamic.java|simulator/SubmittedTask.java|simulator/lists/ResourceUsage.java|simulator/lists/ResGridletPausedMap.java|gridsim/gssim/GssimARGridResource.java|gridsim/gssim/GssimResGridlet.java|gridsim/gssim/GssimAllocPolicy.java|gridsim/gssim/GssimGridResource.java|gridsim/gssim/GssimARAllocPolicy.java|simulator/GridScheduler.java|plugins/|test/schedframe2/experiment/workload/|simulator/lists/ResGridletListInExecution.java|simulator/lists/ResGridletListWithStatistics.java|simulator/lists/ReservationList.java|simulator/plugin/|gridsim/gssim_arch/|schedframe_arch/|gridsim/gssim2/network/sim/NetworkGSSimUsers.java|test/schedframe2/experiment/workload2/|test/net/experiment2/workload/|test/schedframe2/experiment/refworkload12/|test/schedframe2/experiment/refworkload2/|test/schedframe2/experiment/refworkoad1/|test/schedframe2/experiment/refworkload1/|test/schedframe2/experiment/refworkload1_net/|test/schedframe2/experiment/refworkload2_net/|test/schedframe2/experiment/refworkload1_2/|test/schedframe2/experiment/refworkload1_2_net/|test/schedframe2/experiment/refworkload3/|test/schedframe2/experiment/refworkload3_net/|test/schedframe2/experiment/localplugin/workload2/|gssim/schedframe/scheduling/AbstractJob.java|test/arch/" kind="src" path="src"/>
+	<classpathentry excluding="workload/|experiment1_result/|workloadAR/|experiment2_result/|experiment3_result/|workloadARNR/|workloadARNR2/|tomek/|tomek/|workloads/" kind="src" path="example"/>
+	<classpathentry kind="lib" path="jars/commons-logging.jar"/>
+	<classpathentry kind="lib" path="jars/jfreechart-1.0.6.jar"/>
+	<classpathentry kind="lib" path="jars/junit-4.4.jar"/>
+	<classpathentry kind="lib" path="jars/log4j-1.2.13.jar"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+	<classpathentry kind="lib" path="properties"/>
+	<classpathentry kind="lib" path="jars/joda-time/joda-time-1.6.jar" sourcepath="jars/joda-time/joda-time-1.6-sources.jar"/>
+	<classpathentry kind="lib" path="jars/gridsim.jar"/>
+	<classpathentry kind="lib" path="jars/simjava.jar"/>
+	<classpathentry kind="lib" path="jars/qcg_schemas_tools.jar"/>
+	<classpathentry kind="lib" path="jars/qcg-broker_schemas.jar"/>
+	<classpathentry kind="lib" path="jars/schemas.jar"/>
+	<classpathentry kind="lib" path="jars/guava-13.0.jar"/>
+	<classpathentry kind="lib" path="jars/colt.jar"/>
+	<classpathentry kind="lib" path="jars/bsh-2.0b4.jar"/>
+	<classpathentry kind="lib" path="jars/gssim_workload3g.jar"/>
+	<classpathentry kind="lib" path="jars/jcommon-1.0.10.jar"/>
+	<classpathentry kind="lib" path="jars/TimetableChart.jar"/>
+	<classpathentry kind="lib" path="jars/castor-1.3.3-RC1/castor-1.3.3-RC1-codegen.jar"/>
+	<classpathentry kind="lib" path="jars/castor-1.3.3-RC1/castor-1.3.3-RC1-core.jar"/>
+	<classpathentry kind="lib" path="jars/castor-1.3.3-RC1/castor-1.3.3-RC1-xml-schema.jar"/>
+	<classpathentry kind="lib" path="jars/castor-1.3.3-RC1/castor-1.3.3-RC1.jar"/>
+	<classpathentry kind="lib" path="jars/castor-1.3.3-RC1/castor-1.3.3-RC1-xml.jar"/>
+	<classpathentry kind="lib" path="jars/castor_snapshot/castor-xml-1.2.1-SNAPSHOT.jar"/>
+	<classpathentry kind="lib" path="jars/commons-lang-2.6.jar"/>
+	<classpathentry kind="lib" path="jars/xalan-2.6.jar"/>
+	<classpathentry kind="lib" path="jars/xerces/xerces-2_9_0/xercesImpl.jar"/>
+	<classpathentry kind="lib" path="jars/xerces/xerces-2_9_0/xml-apis.jar"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>
Index: DCWoRMS/trunk/start-gssim-bash.sh
===================================================================
--- DCWoRMS/trunk/start-gssim-bash.sh	(revision 477)
+++ DCWoRMS/trunk/start-gssim-bash.sh	(revision 477)
@@ -0,0 +1,9 @@
+#! /bin/bash
+
+CP="/opt/app/gssim/gssim.jar:/opt/app/gssim/properties/";
+for i in `find /opt/app/gssim/jars -iname "*.jar"`
+do
+	CP=$CP:$i;
+done
+
+java -Xmx1536m -Dgssim.install.dir="/opt/app/gssim/" -classpath $CP simulator.GridSchedulingSimulator $*
Index: DCWoRMS/trunk/sim_trace
===================================================================
--- DCWoRMS/trunk/sim_trace	(revision 477)
+++ DCWoRMS/trunk/sim_trace	(revision 477)
@@ -0,0 +1,426 @@
+u: GridSimShutdown at 0.0: waiting for an event
+u: GridStatistics at 0.0: waiting for an event
+u: GridInformationService at 0.0: waiting for an event
+u: Input_GridInformationService at 0.0: waiting for an event
+u: Output_GridInformationService at 0.0: waiting for an event
+u: ManagementSystem@cluster at 0.0: waiting for an event
+u: Input_ManagementSystem@cluster at 0.0: waiting for an event
+u: Output_ManagementSystem@cluster at 0.0: waiting for an event
+u: BROKER@grid at 0.0: waiting for an event
+u: Input_BROKER@grid at 0.0: waiting for an event
+u: Output_BROKER@grid at 0.0: waiting for an event
+u: Input_Users at 0.0: waiting for an event
+u: Output_Users at 0.0: waiting for an event
+u: Users at 0.0: scheduling event type 21 for BROKER@grid with delay 0.0
+u: Users at 0.0: scheduling event type 21 for BROKER@grid with delay 0.0
+u: Users at 0.0: scheduling event type 21 for BROKER@grid with delay 0.0
+u: Users at 0.0: scheduling event type 21 for BROKER@grid with delay 0.0
+u: Users at 0.0: scheduling event type 21 for BROKER@grid with delay 0.0
+u: Users at 0.0: scheduling event type 21 for BROKER@grid with delay 0.0
+u: Users at 0.0: scheduling event type 21 for BROKER@grid with delay 0.0
+u: Users at 0.0: scheduling event type 21 for BROKER@grid with delay 0.0
+u: Users at 0.0: scheduling event type 21 for BROKER@grid with delay 3600.0
+u: Users at 0.0: scheduling event type 21 for BROKER@grid with delay 21600.0
+u: Users at 0.0: scheduling event type 21 for BROKER@grid with delay 25200.0
+u: Users at 0.0: scheduling event type 21 for BROKER@grid with delay 39600.0
+u: Users at 0.0: scheduling event type 21 for BROKER@grid with delay 46800.0
+u: Users at 0.0: waiting for an event
+u: BROKER@grid at 0.0: scheduling event type 604 for ManagementSystem@cluster with delay 0.0
+u: BROKER@grid at 0.0: waiting for an event
+u: ManagementSystem@cluster at 0.0: scheduling event type 605 for BROKER@grid with delay 0.0
+u: ManagementSystem@cluster at 0.0: waiting for an event
+u: BROKER@grid at 0.0: scheduling event type 21 for Output_BROKER@grid with delay 0.0
+u: BROKER@grid at 0.0: selected event type 21 (event time was 0.0)
+u: BROKER@grid at 0.0: scheduling event type 604 for ManagementSystem@cluster with delay 0.0
+u: BROKER@grid at 0.0: waiting for an event
+u: Output_BROKER@grid at 0.0: scheduling event type 21 for Input_ManagementSystem@cluster with delay 0.0
+u: ManagementSystem@cluster at 0.0: scheduling event type 605 for BROKER@grid with delay 0.0
+u: ManagementSystem@cluster at 0.0: waiting for an event
+u: Output_BROKER@grid at 0.0: start processing
+u: Input_ManagementSystem@cluster at 0.0: start processing
+u: Output_BROKER@grid at 0.0: waiting for an event
+u: BROKER@grid at 0.0: scheduling event type 21 for Output_BROKER@grid with delay 0.0
+u: BROKER@grid at 0.0: selected event type 21 (event time was 0.0)
+u: BROKER@grid at 0.0: scheduling event type 604 for ManagementSystem@cluster with delay 0.0
+u: BROKER@grid at 0.0: waiting for an event
+u: Input_ManagementSystem@cluster at 0.0: scheduling event type 21 for ManagementSystem@cluster with delay 0.0
+u: Input_ManagementSystem@cluster at 0.0: waiting for an event
+u: Output_BROKER@grid at 0.0: scheduling event type 21 for Input_ManagementSystem@cluster with delay 0.0
+u: Output_BROKER@grid at 0.0: start processing
+u: ManagementSystem@cluster at 0.0: scheduling event type 605 for BROKER@grid with delay 0.0
+u: ManagementSystem@cluster at 0.0: waiting for an event
+u: Input_ManagementSystem@cluster at 0.0: start processing
+u: BROKER@grid at 0.0: scheduling event type 21 for Output_BROKER@grid with delay 0.0
+u: BROKER@grid at 0.0: selected event type 21 (event time was 0.0)
+u: BROKER@grid at 0.0: scheduling event type 604 for ManagementSystem@cluster with delay 0.0
+u: BROKER@grid at 0.0: waiting for an event
+u: Output_BROKER@grid at 0.0: waiting for an event
+u: ManagementSystem@cluster at 0.0: scheduling event type 602 for ManagementSystem@cluster with delay 0.0
+u: ManagementSystem@cluster at 0.0: waiting for an event
+u: Output_BROKER@grid at 0.0: scheduling event type 21 for Input_ManagementSystem@cluster with delay 0.0
+u: Output_BROKER@grid at 0.0: start processing
+u: Input_ManagementSystem@cluster at 0.0: scheduling event type 21 for ManagementSystem@cluster with delay 0.0
+u: Input_ManagementSystem@cluster at 0.0: waiting for an event
+u: ManagementSystem@cluster at 0.0: scheduling event type 605 for BROKER@grid with delay 0.0
+u: ManagementSystem@cluster at 0.0: selected event type 602 (event time was 0.0)
+u: ManagementSystem@cluster at 0.0: scheduling event type 603 for ManagementSystem@cluster with delay 7200.0
+u: ManagementSystem@cluster at 0.0: scheduling event type 606 for ManagementSystem@cluster with delay 7200.0
+u: ManagementSystem@cluster at 0.0: waiting for an event
+u: Input_ManagementSystem@cluster at 0.0: start processing
+u: Output_BROKER@grid at 0.0: waiting for an event
+u: BROKER@grid at 0.0: scheduling event type 21 for Output_BROKER@grid with delay 0.0
+u: ManagementSystem@cluster at 0.0: scheduling event type 602 for ManagementSystem@cluster with delay 0.0
+u: ManagementSystem@cluster at 0.0: waiting for an event
+u: BROKER@grid at 0.0: selected event type 21 (event time was 0.0)
+u: BROKER@grid at 0.0: scheduling event type 604 for ManagementSystem@cluster with delay 0.0
+u: BROKER@grid at 0.0: waiting for an event
+u: Input_ManagementSystem@cluster at 0.0: scheduling event type 21 for ManagementSystem@cluster with delay 0.0
+u: Input_ManagementSystem@cluster at 0.0: waiting for an event
+u: Output_BROKER@grid at 0.0: scheduling event type 21 for Input_ManagementSystem@cluster with delay 0.0
+u: Output_BROKER@grid at 0.0: start processing
+u: ManagementSystem@cluster at 0.0: scheduling event type 603 for ManagementSystem@cluster with delay 7200.0
+u: ManagementSystem@cluster at 0.0: scheduling event type 606 for ManagementSystem@cluster with delay 7200.0
+u: ManagementSystem@cluster at 0.0: selected event type 604 (event time was 0.0)
+u: ManagementSystem@cluster at 0.0: scheduling event type 605 for BROKER@grid with delay 0.0
+u: ManagementSystem@cluster at 0.0: waiting for an event
+u: Input_ManagementSystem@cluster at 0.0: start processing
+u: BROKER@grid at 0.0: scheduling event type 21 for Output_BROKER@grid with delay 0.0
+u: BROKER@grid at 0.0: selected event type 21 (event time was 0.0)
+u: ManagementSystem@cluster at 0.0: scheduling event type 602 for ManagementSystem@cluster with delay 0.0
+u: ManagementSystem@cluster at 0.0: waiting for an event
+u: Output_BROKER@grid at 0.0: waiting for an event
+u: BROKER@grid at 0.0: scheduling event type 604 for ManagementSystem@cluster with delay 0.0
+u: BROKER@grid at 0.0: waiting for an event
+u: Input_ManagementSystem@cluster at 0.0: scheduling event type 21 for ManagementSystem@cluster with delay 0.0
+u: Input_ManagementSystem@cluster at 0.0: waiting for an event
+u: Output_BROKER@grid at 0.0: scheduling event type 21 for Input_ManagementSystem@cluster with delay 0.0
+u: Output_BROKER@grid at 0.0: start processing
+u: ManagementSystem@cluster at 0.0: scheduling event type 603 for ManagementSystem@cluster with delay 7200.0
+u: ManagementSystem@cluster at 0.0: scheduling event type 606 for ManagementSystem@cluster with delay 7200.0
+u: ManagementSystem@cluster at 0.0: selected event type 604 (event time was 0.0)
+u: ManagementSystem@cluster at 0.0: scheduling event type 605 for BROKER@grid with delay 0.0
+u: ManagementSystem@cluster at 0.0: waiting for an event
+u: Input_ManagementSystem@cluster at 0.0: start processing
+u: BROKER@grid at 0.0: scheduling event type 21 for Output_BROKER@grid with delay 0.0
+u: BROKER@grid at 0.0: selected event type 21 (event time was 0.0)
+u: BROKER@grid at 0.0: scheduling event type 604 for ManagementSystem@cluster with delay 0.0
+u: BROKER@grid at 0.0: waiting for an event
+u: Output_BROKER@grid at 0.0: waiting for an event
+u: ManagementSystem@cluster at 0.0: scheduling event type 602 for ManagementSystem@cluster with delay 0.0
+u: ManagementSystem@cluster at 0.0: waiting for an event
+u: Output_BROKER@grid at 0.0: scheduling event type 21 for Input_ManagementSystem@cluster with delay 0.0
+u: Output_BROKER@grid at 0.0: start processing
+u: Input_ManagementSystem@cluster at 0.0: scheduling event type 21 for ManagementSystem@cluster with delay 0.0
+u: Input_ManagementSystem@cluster at 0.0: waiting for an event
+u: ManagementSystem@cluster at 0.0: scheduling event type 605 for BROKER@grid with delay 0.0
+u: ManagementSystem@cluster at 0.0: selected event type 602 (event time was 0.0)
+u: ManagementSystem@cluster at 0.0: scheduling event type 603 for ManagementSystem@cluster with delay 7200.0
+u: ManagementSystem@cluster at 0.0: scheduling event type 606 for ManagementSystem@cluster with delay 7200.0
+u: ManagementSystem@cluster at 0.0: waiting for an event
+u: Input_ManagementSystem@cluster at 0.0: start processing
+u: BROKER@grid at 0.0: scheduling event type 21 for Output_BROKER@grid with delay 0.0
+u: Output_BROKER@grid at 0.0: waiting for an event
+u: ManagementSystem@cluster at 0.0: scheduling event type 602 for ManagementSystem@cluster with delay 0.0
+u: ManagementSystem@cluster at 0.0: waiting for an event
+u: BROKER@grid at 0.0: selected event type 21 (event time was 0.0)
+u: BROKER@grid at 0.0: scheduling event type 604 for ManagementSystem@cluster with delay 0.0
+u: BROKER@grid at 0.0: waiting for an event
+u: Input_ManagementSystem@cluster at 0.0: scheduling event type 21 for ManagementSystem@cluster with delay 0.0
+u: Input_ManagementSystem@cluster at 0.0: waiting for an event
+u: Output_BROKER@grid at 0.0: scheduling event type 21 for Input_ManagementSystem@cluster with delay 0.0
+u: Output_BROKER@grid at 0.0: start processing
+u: ManagementSystem@cluster at 0.0: scheduling event type 603 for ManagementSystem@cluster with delay 7200.0
+u: ManagementSystem@cluster at 0.0: scheduling event type 606 for ManagementSystem@cluster with delay 7200.0
+u: ManagementSystem@cluster at 0.0: selected event type 604 (event time was 0.0)
+u: ManagementSystem@cluster at 0.0: scheduling event type 605 for BROKER@grid with delay 0.0
+u: ManagementSystem@cluster at 0.0: waiting for an event
+u: Input_ManagementSystem@cluster at 0.0: start processing
+u: BROKER@grid at 0.0: scheduling event type 21 for Output_BROKER@grid with delay 0.0
+u: BROKER@grid at 0.0: waiting for an event
+u: Output_BROKER@grid at 0.0: waiting for an event
+u: ManagementSystem@cluster at 0.0: scheduling event type 602 for ManagementSystem@cluster with delay 0.0
+u: ManagementSystem@cluster at 0.0: waiting for an event
+u: Output_BROKER@grid at 0.0: scheduling event type 21 for Input_ManagementSystem@cluster with delay 0.0
+u: Output_BROKER@grid at 0.0: start processing
+u: Input_ManagementSystem@cluster at 0.0: scheduling event type 21 for ManagementSystem@cluster with delay 0.0
+u: Input_ManagementSystem@cluster at 0.0: waiting for an event
+u: ManagementSystem@cluster at 0.0: scheduling event type 603 for ManagementSystem@cluster with delay 5400.0
+u: ManagementSystem@cluster at 0.0: scheduling event type 606 for ManagementSystem@cluster with delay 5400.0
+u: ManagementSystem@cluster at 0.0: waiting for an event
+u: Output_BROKER@grid at 0.0: waiting for an event
+u: Input_ManagementSystem@cluster at 0.0: start processing
+u: ManagementSystem@cluster at 0.0: scheduling event type 602 for ManagementSystem@cluster with delay 0.0
+u: ManagementSystem@cluster at 0.0: waiting for an event
+u: Input_ManagementSystem@cluster at 0.0: scheduling event type 21 for ManagementSystem@cluster with delay 0.0
+u: Input_ManagementSystem@cluster at 0.0: waiting for an event
+u: ManagementSystem@cluster at 0.0: scheduling event type 603 for ManagementSystem@cluster with delay 7200.0
+u: ManagementSystem@cluster at 0.0: scheduling event type 606 for ManagementSystem@cluster with delay 7200.0
+u: ManagementSystem@cluster at 0.0: waiting for an event
+u: ManagementSystem@cluster at 0.0: scheduling event type 602 for ManagementSystem@cluster with delay 0.0
+u: ManagementSystem@cluster at 0.0: waiting for an event
+u: ManagementSystem@cluster at 0.0: scheduling event type 603 for ManagementSystem@cluster with delay 14400.0
+u: ManagementSystem@cluster at 0.0: scheduling event type 606 for ManagementSystem@cluster with delay 14400.0
+u: ManagementSystem@cluster at 0.0: waiting for an event
+u: BROKER@grid at 3600.0: scheduling event type 604 for ManagementSystem@cluster with delay 0.0
+u: BROKER@grid at 3600.0: waiting for an event
+u: ManagementSystem@cluster at 3600.0: scheduling event type 605 for BROKER@grid with delay 0.0
+u: ManagementSystem@cluster at 3600.0: waiting for an event
+u: BROKER@grid at 3600.0: scheduling event type 21 for Output_BROKER@grid with delay 0.0
+u: BROKER@grid at 3600.0: waiting for an event
+u: Output_BROKER@grid at 3600.0: scheduling event type 21 for Input_ManagementSystem@cluster with delay 0.0
+u: Output_BROKER@grid at 3600.0: start processing
+u: Input_ManagementSystem@cluster at 3600.0: start processing
+u: Output_BROKER@grid at 3600.0: waiting for an event
+u: Input_ManagementSystem@cluster at 3600.0: scheduling event type 21 for ManagementSystem@cluster with delay 0.0
+u: Input_ManagementSystem@cluster at 3600.0: waiting for an event
+u: ManagementSystem@cluster at 3600.0: scheduling event type 602 for ManagementSystem@cluster with delay 0.0
+u: ManagementSystem@cluster at 3600.0: waiting for an event
+u: ManagementSystem@cluster at 3600.0: scheduling event type 603 for ManagementSystem@cluster with delay 7200.0
+u: ManagementSystem@cluster at 3600.0: scheduling event type 606 for ManagementSystem@cluster with delay 7200.0
+u: ManagementSystem@cluster at 3600.0: waiting for an event
+u: ManagementSystem@cluster at 5400.0: no event cancelled
+u: ManagementSystem@cluster at 5400.0: scheduling event type 20 for Output_ManagementSystem@cluster with delay 0.0
+u: ManagementSystem@cluster at 5400.0: selected event type 606 (event time was 5400.0)
+u: ManagementSystem@cluster at 5400.0: waiting for an event
+u: Output_ManagementSystem@cluster at 5400.0: scheduling event type 20 for Input_BROKER@grid with delay 0.0
+u: Output_ManagementSystem@cluster at 5400.0: start processing
+u: Output_ManagementSystem@cluster at 5400.0: waiting for an event
+u: Input_BROKER@grid at 5400.0: start processing
+u: Input_BROKER@grid at 5400.0: scheduling event type 20 for BROKER@grid with delay 0.0
+u: Input_BROKER@grid at 5400.0: waiting for an event
+u: BROKER@grid at 5400.0: scheduling event type 20 for Users with delay 0.0
+u: BROKER@grid at 5400.0: waiting for an event
+u: Users at 5400.0: waiting for an event
+u: ManagementSystem@cluster at 7200.0: no event cancelled
+u: ManagementSystem@cluster at 7200.0: scheduling event type 20 for Output_ManagementSystem@cluster with delay 0.0
+u: ManagementSystem@cluster at 7200.0: selected event type 606 (event time was 7200.0)
+u: ManagementSystem@cluster at 7200.0: selected event type 603 (event time was 7200.0)
+u: ManagementSystem@cluster at 7200.0: no event cancelled
+u: ManagementSystem@cluster at 7200.0: scheduling event type 20 for Output_ManagementSystem@cluster with delay 0.0
+u: ManagementSystem@cluster at 7200.0: selected event type 606 (event time was 7200.0)
+u: ManagementSystem@cluster at 7200.0: selected event type 603 (event time was 7200.0)
+u: ManagementSystem@cluster at 7200.0: no event cancelled
+u: ManagementSystem@cluster at 7200.0: scheduling event type 20 for Output_ManagementSystem@cluster with delay 0.0
+u: ManagementSystem@cluster at 7200.0: selected event type 606 (event time was 7200.0)
+u: ManagementSystem@cluster at 7200.0: selected event type 603 (event time was 7200.0)
+u: ManagementSystem@cluster at 7200.0: no event cancelled
+u: ManagementSystem@cluster at 7200.0: scheduling event type 20 for Output_ManagementSystem@cluster with delay 0.0
+u: ManagementSystem@cluster at 7200.0: selected event type 606 (event time was 7200.0)
+u: ManagementSystem@cluster at 7200.0: selected event type 603 (event time was 7200.0)
+u: ManagementSystem@cluster at 7200.0: no event cancelled
+u: ManagementSystem@cluster at 7200.0: scheduling event type 20 for Output_ManagementSystem@cluster with delay 0.0
+u: ManagementSystem@cluster at 7200.0: selected event type 606 (event time was 7200.0)
+u: ManagementSystem@cluster at 7200.0: selected event type 603 (event time was 7200.0)
+u: ManagementSystem@cluster at 7200.0: no event cancelled
+u: ManagementSystem@cluster at 7200.0: scheduling event type 20 for Output_ManagementSystem@cluster with delay 0.0
+u: ManagementSystem@cluster at 7200.0: selected event type 606 (event time was 7200.0)
+u: ManagementSystem@cluster at 7200.0: waiting for an event
+u: Output_ManagementSystem@cluster at 7200.0: scheduling event type 20 for Input_BROKER@grid with delay 0.0
+u: Output_ManagementSystem@cluster at 7200.0: start processing
+u: Output_ManagementSystem@cluster at 7200.0: selected event type 20 (event time was 7200.0)
+u: Output_ManagementSystem@cluster at 7200.0: scheduling event type 20 for Input_BROKER@grid with delay 0.0
+u: Output_ManagementSystem@cluster at 7200.0: start processing
+u: Input_BROKER@grid at 7200.0: start processing
+u: Output_ManagementSystem@cluster at 7200.0: selected event type 20 (event time was 7200.0)
+u: Output_ManagementSystem@cluster at 7200.0: scheduling event type 20 for Input_BROKER@grid with delay 0.0
+u: Output_ManagementSystem@cluster at 7200.0: start processing
+u: Input_BROKER@grid at 7200.0: scheduling event type 20 for BROKER@grid with delay 0.0
+u: Input_BROKER@grid at 7200.0: selected event type 20 (event time was 7200.0)
+u: Input_BROKER@grid at 7200.0: start processing
+u: Output_ManagementSystem@cluster at 7200.0: selected event type 20 (event time was 7200.0)
+u: Output_ManagementSystem@cluster at 7200.0: scheduling event type 20 for Input_BROKER@grid with delay 0.0
+u: BROKER@grid at 7200.0: scheduling event type 20 for Users with delay 0.0
+u: BROKER@grid at 7200.0: waiting for an event
+u: Input_BROKER@grid at 7200.0: scheduling event type 20 for BROKER@grid with delay 0.0
+u: Input_BROKER@grid at 7200.0: selected event type 20 (event time was 7200.0)
+u: Output_ManagementSystem@cluster at 7200.0: start processing
+u: Input_BROKER@grid at 7200.0: start processing
+u: Output_ManagementSystem@cluster at 7200.0: selected event type 20 (event time was 7200.0)
+u: Output_ManagementSystem@cluster at 7200.0: scheduling event type 20 for Input_BROKER@grid with delay 0.0
+u: Output_ManagementSystem@cluster at 7200.0: start processing
+u: Input_BROKER@grid at 7200.0: scheduling event type 20 for BROKER@grid with delay 0.0
+u: Input_BROKER@grid at 7200.0: selected event type 20 (event time was 7200.0)
+u: Input_BROKER@grid at 7200.0: start processing
+u: BROKER@grid at 7200.0: scheduling event type 20 for Users with delay 0.0
+u: BROKER@grid at 7200.0: waiting for an event
+u: Users at 7200.0: waiting for an event
+u: Output_ManagementSystem@cluster at 7200.0: selected event type 20 (event time was 7200.0)
+u: Output_ManagementSystem@cluster at 7200.0: scheduling event type 20 for Input_BROKER@grid with delay 0.0
+u: BROKER@grid at 7200.0: scheduling event type 20 for Users with delay 0.0
+u: BROKER@grid at 7200.0: waiting for an event
+u: Input_BROKER@grid at 7200.0: scheduling event type 20 for BROKER@grid with delay 0.0
+u: Input_BROKER@grid at 7200.0: selected event type 20 (event time was 7200.0)
+u: Input_BROKER@grid at 7200.0: start processing
+u: Users at 7200.0: waiting for an event
+u: Output_ManagementSystem@cluster at 7200.0: start processing
+u: Input_BROKER@grid at 7200.0: scheduling event type 20 for BROKER@grid with delay 0.0
+u: Input_BROKER@grid at 7200.0: selected event type 20 (event time was 7200.0)
+u: Input_BROKER@grid at 7200.0: start processing
+u: Output_ManagementSystem@cluster at 7200.0: waiting for an event
+u: Users at 7200.0: waiting for an event
+u: BROKER@grid at 7200.0: scheduling event type 20 for Users with delay 0.0
+u: BROKER@grid at 7200.0: waiting for an event
+u: Input_BROKER@grid at 7200.0: scheduling event type 20 for BROKER@grid with delay 0.0
+u: Input_BROKER@grid at 7200.0: waiting for an event
+u: Users at 7200.0: waiting for an event
+u: BROKER@grid at 7200.0: scheduling event type 20 for Users with delay 0.0
+u: BROKER@grid at 7200.0: waiting for an event
+u: Users at 7200.0: waiting for an event
+u: BROKER@grid at 7200.0: scheduling event type 20 for Users with delay 0.0
+u: BROKER@grid at 7200.0: waiting for an event
+u: Users at 7200.0: waiting for an event
+u: ManagementSystem@cluster at 10800.0: no event cancelled
+u: ManagementSystem@cluster at 10800.0: scheduling event type 20 for Output_ManagementSystem@cluster with delay 0.0
+u: ManagementSystem@cluster at 10800.0: selected event type 606 (event time was 10800.0)
+u: ManagementSystem@cluster at 10800.0: waiting for an event
+u: Output_ManagementSystem@cluster at 10800.0: scheduling event type 20 for Input_BROKER@grid with delay 0.0
+u: Output_ManagementSystem@cluster at 10800.0: start processing
+u: Output_ManagementSystem@cluster at 10800.0: waiting for an event
+u: Input_BROKER@grid at 10800.0: start processing
+u: Input_BROKER@grid at 10800.0: scheduling event type 20 for BROKER@grid with delay 0.0
+u: Input_BROKER@grid at 10800.0: waiting for an event
+u: BROKER@grid at 10800.0: scheduling event type 20 for Users with delay 0.0
+u: BROKER@grid at 10800.0: waiting for an event
+u: Users at 10800.0: waiting for an event
+u: ManagementSystem@cluster at 14400.0: no event cancelled
+u: ManagementSystem@cluster at 14400.0: scheduling event type 20 for Output_ManagementSystem@cluster with delay 0.0
+u: ManagementSystem@cluster at 14400.0: selected event type 606 (event time was 14400.0)
+u: ManagementSystem@cluster at 14400.0: waiting for an event
+u: Output_ManagementSystem@cluster at 14400.0: scheduling event type 20 for Input_BROKER@grid with delay 0.0
+u: Output_ManagementSystem@cluster at 14400.0: start processing
+u: Output_ManagementSystem@cluster at 14400.0: waiting for an event
+u: Input_BROKER@grid at 14400.0: start processing
+u: Input_BROKER@grid at 14400.0: scheduling event type 20 for BROKER@grid with delay 0.0
+u: Input_BROKER@grid at 14400.0: waiting for an event
+u: BROKER@grid at 14400.0: scheduling event type 20 for Users with delay 0.0
+u: BROKER@grid at 14400.0: waiting for an event
+u: Users at 14400.0: waiting for an event
+u: BROKER@grid at 21600.0: scheduling event type 604 for ManagementSystem@cluster with delay 0.0
+u: BROKER@grid at 21600.0: waiting for an event
+u: ManagementSystem@cluster at 21600.0: scheduling event type 605 for BROKER@grid with delay 0.0
+u: ManagementSystem@cluster at 21600.0: waiting for an event
+u: BROKER@grid at 21600.0: scheduling event type 21 for Output_BROKER@grid with delay 0.0
+u: BROKER@grid at 21600.0: waiting for an event
+u: Output_BROKER@grid at 21600.0: scheduling event type 21 for Input_ManagementSystem@cluster with delay 0.0
+u: Output_BROKER@grid at 21600.0: start processing
+u: Output_BROKER@grid at 21600.0: waiting for an event
+u: Input_ManagementSystem@cluster at 21600.0: start processing
+u: Input_ManagementSystem@cluster at 21600.0: scheduling event type 21 for ManagementSystem@cluster with delay 0.0
+u: Input_ManagementSystem@cluster at 21600.0: waiting for an event
+u: ManagementSystem@cluster at 21600.0: scheduling event type 602 for ManagementSystem@cluster with delay 0.0
+u: ManagementSystem@cluster at 21600.0: waiting for an event
+u: ManagementSystem@cluster at 21600.0: scheduling event type 603 for ManagementSystem@cluster with delay 10800.0
+u: ManagementSystem@cluster at 21600.0: scheduling event type 606 for ManagementSystem@cluster with delay 10800.0
+u: ManagementSystem@cluster at 21600.0: waiting for an event
+u: BROKER@grid at 25200.0: scheduling event type 604 for ManagementSystem@cluster with delay 0.0
+u: BROKER@grid at 25200.0: waiting for an event
+u: ManagementSystem@cluster at 25200.0: scheduling event type 605 for BROKER@grid with delay 0.0
+u: ManagementSystem@cluster at 25200.0: waiting for an event
+u: BROKER@grid at 25200.0: scheduling event type 21 for Output_BROKER@grid with delay 0.0
+u: BROKER@grid at 25200.0: waiting for an event
+u: Output_BROKER@grid at 25200.0: scheduling event type 21 for Input_ManagementSystem@cluster with delay 0.0
+u: Output_BROKER@grid at 25200.0: start processing
+u: Output_BROKER@grid at 25200.0: waiting for an event
+u: Input_ManagementSystem@cluster at 25200.0: start processing
+u: Input_ManagementSystem@cluster at 25200.0: scheduling event type 21 for ManagementSystem@cluster with delay 0.0
+u: Input_ManagementSystem@cluster at 25200.0: waiting for an event
+u: ManagementSystem@cluster at 25200.0: scheduling event type 602 for ManagementSystem@cluster with delay 0.0
+u: ManagementSystem@cluster at 25200.0: waiting for an event
+u: ManagementSystem@cluster at 25200.0: scheduling event type 603 for ManagementSystem@cluster with delay 12600.0
+u: ManagementSystem@cluster at 25200.0: scheduling event type 606 for ManagementSystem@cluster with delay 12600.0
+u: ManagementSystem@cluster at 25200.0: waiting for an event
+u: ManagementSystem@cluster at 32400.0: no event cancelled
+u: ManagementSystem@cluster at 32400.0: scheduling event type 20 for Output_ManagementSystem@cluster with delay 0.0
+u: ManagementSystem@cluster at 32400.0: selected event type 606 (event time was 32400.0)
+u: ManagementSystem@cluster at 32400.0: waiting for an event
+u: Output_ManagementSystem@cluster at 32400.0: scheduling event type 20 for Input_BROKER@grid with delay 0.0
+u: Output_ManagementSystem@cluster at 32400.0: start processing
+u: Output_ManagementSystem@cluster at 32400.0: waiting for an event
+u: Input_BROKER@grid at 32400.0: start processing
+u: Input_BROKER@grid at 32400.0: scheduling event type 20 for BROKER@grid with delay 0.0
+u: Input_BROKER@grid at 32400.0: waiting for an event
+u: BROKER@grid at 32400.0: scheduling event type 20 for Users with delay 0.0
+u: BROKER@grid at 32400.0: waiting for an event
+u: Users at 32400.0: waiting for an event
+u: ManagementSystem@cluster at 37800.0: no event cancelled
+u: ManagementSystem@cluster at 37800.0: scheduling event type 20 for Output_ManagementSystem@cluster with delay 0.0
+u: ManagementSystem@cluster at 37800.0: selected event type 606 (event time was 37800.0)
+u: ManagementSystem@cluster at 37800.0: waiting for an event
+u: Output_ManagementSystem@cluster at 37800.0: scheduling event type 20 for Input_BROKER@grid with delay 0.0
+u: Output_ManagementSystem@cluster at 37800.0: start processing
+u: Output_ManagementSystem@cluster at 37800.0: waiting for an event
+u: Input_BROKER@grid at 37800.0: start processing
+u: Input_BROKER@grid at 37800.0: scheduling event type 20 for BROKER@grid with delay 0.0
+u: Input_BROKER@grid at 37800.0: waiting for an event
+u: BROKER@grid at 37800.0: scheduling event type 20 for Users with delay 0.0
+u: BROKER@grid at 37800.0: waiting for an event
+u: Users at 37800.0: waiting for an event
+u: BROKER@grid at 39600.0: scheduling event type 604 for ManagementSystem@cluster with delay 0.0
+u: BROKER@grid at 39600.0: waiting for an event
+u: ManagementSystem@cluster at 39600.0: scheduling event type 605 for BROKER@grid with delay 0.0
+u: ManagementSystem@cluster at 39600.0: waiting for an event
+u: BROKER@grid at 39600.0: scheduling event type 21 for Output_BROKER@grid with delay 0.0
+u: BROKER@grid at 39600.0: waiting for an event
+u: Output_BROKER@grid at 39600.0: scheduling event type 21 for Input_ManagementSystem@cluster with delay 0.0
+u: Output_BROKER@grid at 39600.0: start processing
+u: Output_BROKER@grid at 39600.0: waiting for an event
+u: Input_ManagementSystem@cluster at 39600.0: start processing
+u: Input_ManagementSystem@cluster at 39600.0: scheduling event type 21 for ManagementSystem@cluster with delay 0.0
+u: Input_ManagementSystem@cluster at 39600.0: waiting for an event
+u: ManagementSystem@cluster at 39600.0: scheduling event type 602 for ManagementSystem@cluster with delay 0.0
+u: ManagementSystem@cluster at 39600.0: waiting for an event
+u: ManagementSystem@cluster at 39600.0: scheduling event type 603 for ManagementSystem@cluster with delay 7200.0
+u: ManagementSystem@cluster at 39600.0: scheduling event type 606 for ManagementSystem@cluster with delay 7200.0
+u: ManagementSystem@cluster at 39600.0: waiting for an event
+u: ManagementSystem@cluster at 46800.0: no event cancelled
+u: ManagementSystem@cluster at 46800.0: scheduling event type 20 for Output_ManagementSystem@cluster with delay 0.0
+u: ManagementSystem@cluster at 46800.0: selected event type 606 (event time was 46800.0)
+u: ManagementSystem@cluster at 46800.0: waiting for an event
+u: BROKER@grid at 46800.0: scheduling event type 604 for ManagementSystem@cluster with delay 0.0
+u: BROKER@grid at 46800.0: waiting for an event
+u: ManagementSystem@cluster at 46800.0: scheduling event type 605 for BROKER@grid with delay 0.0
+u: ManagementSystem@cluster at 46800.0: waiting for an event
+u: Output_ManagementSystem@cluster at 46800.0: scheduling event type 20 for Input_BROKER@grid with delay 0.0
+u: Output_ManagementSystem@cluster at 46800.0: start processing
+u: Output_ManagementSystem@cluster at 46800.0: waiting for an event
+u: Input_BROKER@grid at 46800.0: start processing
+u: BROKER@grid at 46800.0: scheduling event type 21 for Output_BROKER@grid with delay 0.0
+u: BROKER@grid at 46800.0: waiting for an event
+u: Input_BROKER@grid at 46800.0: scheduling event type 20 for BROKER@grid with delay 0.0
+u: Input_BROKER@grid at 46800.0: waiting for an event
+u: Output_BROKER@grid at 46800.0: scheduling event type 21 for Input_ManagementSystem@cluster with delay 0.0
+u: Output_BROKER@grid at 46800.0: start processing
+u: Input_ManagementSystem@cluster at 46800.0: start processing
+u: BROKER@grid at 46800.0: scheduling event type 20 for Users with delay 0.0
+u: BROKER@grid at 46800.0: waiting for an event
+u: Output_BROKER@grid at 46800.0: waiting for an event
+u: Input_ManagementSystem@cluster at 46800.0: scheduling event type 21 for ManagementSystem@cluster with delay 0.0
+u: Input_ManagementSystem@cluster at 46800.0: waiting for an event
+u: Users at 46800.0: waiting for an event
+u: ManagementSystem@cluster at 46800.0: scheduling event type 602 for ManagementSystem@cluster with delay 0.0
+u: ManagementSystem@cluster at 46800.0: waiting for an event
+u: ManagementSystem@cluster at 46800.0: scheduling event type 603 for ManagementSystem@cluster with delay 5400.0
+u: ManagementSystem@cluster at 46800.0: scheduling event type 606 for ManagementSystem@cluster with delay 5400.0
+u: ManagementSystem@cluster at 46800.0: waiting for an event
+u: ManagementSystem@cluster at 52200.0: no event cancelled
+u: ManagementSystem@cluster at 52200.0: scheduling event type 20 for Output_ManagementSystem@cluster with delay 0.0
+u: ManagementSystem@cluster at 52200.0: selected event type 606 (event time was 52200.0)
+u: ManagementSystem@cluster at 52200.0: waiting for an event
+u: Output_ManagementSystem@cluster at 52200.0: scheduling event type 20 for Input_BROKER@grid with delay 0.0
+u: Output_ManagementSystem@cluster at 52200.0: start processing
+u: Output_ManagementSystem@cluster at 52200.0: waiting for an event
+u: Input_BROKER@grid at 52200.0: start processing
+u: Input_BROKER@grid at 52200.0: scheduling event type 20 for BROKER@grid with delay 0.0
+u: Input_BROKER@grid at 52200.0: waiting for an event
+u: BROKER@grid at 52200.0: scheduling event type 20 for Users with delay 0.0
+u: BROKER@grid at 52200.0: waiting for an event
+u: Users at 52200.0: scheduling event type -1 for GridStatistics with delay 0.0
+u: Users at 52200.0: scheduling event type -1 for Input_Users with delay 0.0
+u: Users at 52200.0: scheduling event type -1 for Output_Users with delay 0.0
+u: Users at 52200.0: scheduling event type -1 for GridSimShutdown with delay 0.0
+u: GridSimShutdown at 52200.0: scheduling event type -1 for GridInformationService with delay 0.0
+u: GridSimShutdown at 52200.0: scheduling event type -1 for GridStatistics with delay 0.0
+u: GridInformationService at 52200.0: scheduling event type -1 for ManagementSystem@cluster with delay 0.0
+u: GridInformationService at 52200.0: scheduling event type -1 for BROKER@grid with delay 0.0
+u: GridInformationService at 52200.0: scheduling event type -1 for Input_GridInformationService with delay 0.0
+u: GridInformationService at 52200.0: scheduling event type -1 for Output_GridInformationService with delay 0.0
Index: DCWoRMS/trunk/run.sh
===================================================================
--- DCWoRMS/trunk/run.sh	(revision 477)
+++ DCWoRMS/trunk/run.sh	(revision 477)
@@ -0,0 +1,10 @@
+#! /bin/bash
+
+CP="build/classes:properties/";
+for i in `find jars -iname *.jar`
+do
+	CP=$CP:$i;
+done
+
+java -Xmx1536m -XX:+UseSerialGC -classpath $CP $*
+
Index: DCWoRMS/trunk/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- DCWoRMS/trunk/.settings/org.eclipse.jdt.core.prefs	(revision 477)
+++ DCWoRMS/trunk/.settings/org.eclipse.jdt.core.prefs	(revision 477)
@@ -0,0 +1,270 @@
+#Wed Nov 30 08:39:03 CET 2011
+eclipse.preferences.version=1
+org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_assignment=0
+org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
+org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
+org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
+org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
+org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
+org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_after_package=1
+org.eclipse.jdt.core.formatter.blank_lines_before_field=0
+org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
+org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
+org.eclipse.jdt.core.formatter.blank_lines_before_method=1
+org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
+org.eclipse.jdt.core.formatter.blank_lines_before_package=0
+org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
+org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
+org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
+org.eclipse.jdt.core.formatter.comment.format_block_comments=true
+org.eclipse.jdt.core.formatter.comment.format_header=false
+org.eclipse.jdt.core.formatter.comment.format_html=true
+org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
+org.eclipse.jdt.core.formatter.comment.format_line_comments=true
+org.eclipse.jdt.core.formatter.comment.format_source_code=true
+org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
+org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
+org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
+org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
+org.eclipse.jdt.core.formatter.comment.line_length=80
+org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
+org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
+org.eclipse.jdt.core.formatter.compact_else_if=true
+org.eclipse.jdt.core.formatter.continuation_indentation=2
+org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
+org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
+org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
+org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
+org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
+org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_empty_lines=false
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
+org.eclipse.jdt.core.formatter.indentation.size=4
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
+org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.join_lines_in_comments=true
+org.eclipse.jdt.core.formatter.join_wrapped_lines=true
+org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.lineSplit=120
+org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
+org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
+org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
+org.eclipse.jdt.core.formatter.tabulation.char=tab
+org.eclipse.jdt.core.formatter.tabulation.size=4
+org.eclipse.jdt.core.formatter.use_on_off_tags=false
+org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
+org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
+org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
Index: DCWoRMS/trunk/.settings/org.eclipse.jdt.ui.prefs
===================================================================
--- DCWoRMS/trunk/.settings/org.eclipse.jdt.ui.prefs	(revision 477)
+++ DCWoRMS/trunk/.settings/org.eclipse.jdt.ui.prefs	(revision 477)
@@ -0,0 +1,4 @@
+#Wed Nov 30 08:38:43 CET 2011
+eclipse.preferences.version=1
+formatter_profile=_wojtek
+formatter_settings_version=11
Index: DCWoRMS/trunk/simulator/xslt/jsdl_qcg.xslt
===================================================================
--- DCWoRMS/trunk/simulator/xslt/jsdl_qcg.xslt	(revision 477)
+++ DCWoRMS/trunk/simulator/xslt/jsdl_qcg.xslt	(revision 477)
@@ -0,0 +1,463 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<xsl:stylesheet version="1.0" 
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:jsdl="http://schemas.ggf.org/jsdl/2005/11/jsdl" 
+	xmlns:jsdl-posix="http://schemas.ggf.org/jsdl/2005/11/jsdl-posix"
+	xmlns:msxsl="urn:schemas-microsoft-com:xslt" 
+	xmlns:xalan="http://xml.apache.org/xalan"
+	extension-element-prefixes="msxsl">
+
+	<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
+
+	<xsl:variable name="FILE_URL_PREFIX">file:///</xsl:variable>	
+	
+	<xsl:key name="FILESYSTEMS" match="/jsdl:JobDefinition/jsdl:JobDescription/jsdl:Resources/jsdl:FileSystem" use="@name"/>
+	
+	<xsl:template match="/">
+			<xsl:if test="(
+				not(jsdl:JobDefinition/jsdl:JobDescription/jsdl:Application/jsdl-posix:POSIXApplication/jsdl-posix:Executable/text()) and 
+				not(jsdl:JobDefinition/jsdl:JobDescription/jsdl:Application/jsdl:ApplicationName/text())
+			) or (
+				jsdl:JobDefinition/jsdl:JobDescription/jsdl:Application/jsdl:ApplicationName/text() and 
+				jsdl:JobDefinition/jsdl:JobDescription/jsdl:Application/jsdl-posix:POSIXApplication/jsdl-posix:Executable/text()
+			)">
+			<xsl:message terminate="no">
+				Either ApplicationName or Executable can be specified in the same time
+			</xsl:message>			
+		</xsl:if>
+		
+		<xsl:apply-templates select="jsdl:JobDefinition/jsdl:JobDescription"/>		
+	</xsl:template>
+	
+	<xsl:template match="jsdl:JobDescription">
+		<xsl:element name="qcgJob">
+
+			<xsl:attribute name="appid">
+				<xsl:value-of select="jsdl:JobIdentification/jsdl:JobName/text()"/>
+			</xsl:attribute>
+			
+			<xsl:if test="jsdl:JobIdentification/jsdl:JobProject">
+				<xsl:attribute name="project">
+					<xsl:value-of select="jsdl:JobIdentification/jsdl:JobProject"/>
+				</xsl:attribute>
+			
+				<xsl:if test="count(jsdl:JobIdentification/jsdl:JobProject) &gt; 1">
+					<xsl:message terminate="no">
+						Job can belong to ONE project at the most
+					</xsl:message>
+				</xsl:if>	
+		</xsl:if>
+		
+		<xsl:apply-templates select="jsdl:JobIdentifier/jsdl:Description"/>
+		
+		<xsl:call-template name="TASK_TEMPLATE"/>
+			
+		</xsl:element>
+	</xsl:template>
+	
+	<xsl:template match="jsdl:Description" mode="JOB_MODE">
+		<xsl:element name="JobNode">
+			<xsl:value-of select="jsdl:Description"/>
+		</xsl:element>
+	</xsl:template>
+	
+	<xsl:template name="TASK_TEMPLATE">
+		<xsl:element name="task">
+		
+			<xsl:attribute name="taskid">
+				<xsl:choose>
+					<xsl:when test="jsdl:JobIdentifier/jsdl:JobIdentification/jsdl:JobName">
+						<xsl:value-of select="jsdl:JobIdentifier/jsdl:JobIdentification/jsdl:JobName"/>
+					</xsl:when>
+					<xsl:otherwise>task</xsl:otherwise>
+				</xsl:choose>
+			</xsl:attribute>
+			
+			<xsl:if test="count(jsdl:DataStaging/jsdl:DeleteOnTermination[text() = 'false']) &gt; 0">
+					<xsl:attribute name="persistent">true</xsl:attribute>
+			</xsl:if>
+			
+			<xsl:apply-templates select="jsdl:Resources/jsdl:CandidateHosts"/>
+						
+			<xsl:if test="jsdl:Application/jsdl:ApplicationName or jsdl:Resources">
+				<xsl:element name="resource">
+					<xsl:apply-templates select="jsdl:Resources" mode="RESOURCES_MODE"/>		
+					<xsl:if test="jsdl:Application/ApplicationName">
+						<xsl:element name="applications">
+							<xsl:apply-templates select="jsdl:ApplicationName">
+								<xsl:with-param name="VERSION">
+									<xsl:value-of select="jsdl:ApplicationVersion"/>
+								</xsl:with-param>
+							</xsl:apply-templates>
+						</xsl:element>
+					</xsl:if>			
+				</xsl:element>
+			</xsl:if>
+			
+			<xsl:if test="jsdl:Resources/jsdl:IndividualCPUSpeed or
+			                    jsdl:Resources/jsdl:IndividualCPUCount or
+			                    jsdl:Resources/jsdl:IndividualNetworkBandwidth or
+			                    jsdl:Resources/jsdl:IndividualPhysicalMemory or
+			                    jsdl:Resources/jsdl:IndividualDiskSpace">
+				<xsl:element name="hardConstraints">
+					<xsl:apply-templates select="jsdl:Resources/jsdl:IndividualCPUSpeed"/>
+					<xsl:apply-templates select="jsdl:Resources/jsdl:IndividualCPUCount"/>
+					<xsl:apply-templates select="jsdl:Resources/jsdl:IndividualNetworkBandwidth"/>
+					<xsl:apply-templates select="jsdl:Resources/jsdl:IndividualPhysicalMemory"/>
+					<xsl:apply-templates select="jsdl:Resources/jsdl:IndividualDiskSpace"/>
+				</xsl:element>
+			</xsl:if>
+
+			<xsl:element name="executable">
+				<xsl:attribute name="type">single</xsl:attribute>
+				
+				<xsl:apply-templates select="jsdl:Application/jsdl:ApplicationName">
+					<xsl:with-param name="VERSION">
+						<xsl:value-of select="jsdl:Application/jsdl:ApplicationVersion"/>
+					</xsl:with-param>
+				</xsl:apply-templates>
+				
+				<xsl:apply-templates select="jsdl:Application/jsdl-posix:POSIXApplication/jsdl-posix:Executable"/>
+			
+				<xsl:if test="jsdl:Application/jsdl-posix:POSIXApplication/jsdl-posix:Argument or jsdl:DataStaging">
+					<xsl:element name="arguments">
+						<xsl:apply-templates select="jsdl:Application/jsdl-posix:POSIXApplication/jsdl-posix:Argument"/>
+						<xsl:apply-templates select="jsdl:DataStaging"/>
+					</xsl:element>
+				</xsl:if>	
+				
+				<xsl:if test="jsdl:Application/jsdl-posix:POSIXApplication/jsdl-posix:Input">
+					<xsl:element name="stdin">
+						<xsl:element name="url">
+							<xsl:call-template name="FILESYSTEM_VALUE">
+								<xsl:with-param name="FILESYSTEM_NAME">
+									<xsl:value-of select="jsdl:Application/jsdl-posix:POSIXApplication/jsdl-posix:Input/@filesystemName"/>
+								</xsl:with-param>
+								<xsl:with-param name="VALUE">
+									<xsl:value-of select="jsdl:Application/jsdl-posix:POSIXApplication/jsdl-posix:Input"/>
+								</xsl:with-param>
+							</xsl:call-template>
+						</xsl:element>	
+					</xsl:element>
+				</xsl:if>
+	
+				<xsl:if test="jsdl:Application/jsdl-posix:POSIXApplication/jsdl-posix:Output">
+					<xsl:element name="stdout">
+						<xsl:element name="url">
+							<xsl:call-template name="FILESYSTEM_VALUE">
+								<xsl:with-param name="FILESYSTEM_NAME">
+									<xsl:value-of select="jsdl:Application/jsdl-posix:POSIXApplication/jsdl-posix:Output/@filesystemName"/>
+								</xsl:with-param>
+								<xsl:with-param name="VALUE">
+									<xsl:value-of select="jsdl:Application/jsdl-posix:POSIXApplication/jsdl-posix:Output"/>
+								</xsl:with-param>
+							</xsl:call-template>
+						</xsl:element>	
+					</xsl:element>
+				</xsl:if>
+	
+				<xsl:if test="jsdl:Application/jsdl-posix:POSIXApplication/jsdl-posix:Error">
+					<xsl:element name="stderr">
+						<xsl:element name="url">
+							<xsl:call-template name="FILESYSTEM_VALUE">
+								<xsl:with-param name="FILESYSTEM_NAME">
+									<xsl:value-of select="jsdl:Application/jsdl-posix:POSIXApplication/jsdl-posix:Error/@filesystemName"/>
+								</xsl:with-param>
+								<xsl:with-param name="VALUE">
+									<xsl:value-of select="jsdl:Application/jsdl-posix:POSIXApplication/jsdl-posix:Error"/>
+								</xsl:with-param>
+							</xsl:call-template>
+						</xsl:element>	
+					</xsl:element>
+				</xsl:if>
+				
+				<xsl:if test="jsdl:Application/jsdl-posix:POSIXApplication/jsdl-posix:Environment">
+					<xsl:element name="environment">
+						<xsl:apply-templates select="jsdl:Application/jsdl-posix:POSIXApplication/jsdl-posix:Environment"/>
+					</xsl:element>
+				</xsl:if>
+			
+			</xsl:element>
+			
+		</xsl:element>
+	</xsl:template>
+	
+	<xsl:template match="jsdl:CandidateHosts">
+		<xsl:element name="candidateHosts">
+			<xsl:for-each select="jsdl:HostName">
+				<xsl:element name="hostName">
+					<xsl:value-of select="."/>
+				</xsl:element>
+			</xsl:for-each>
+		</xsl:element>
+	</xsl:template>
+	
+	<xsl:template match="jsdl:ApplicationName">
+		<xsl:param name="VERSION"/>
+		<xsl:element name="application">
+			<xsl:if test="$VERSION">
+				<xsl:attribute name="version">
+					<xsl:value-of select="$VERSION"/>
+				</xsl:attribute>
+			</xsl:if>
+		</xsl:element>
+	</xsl:template>
+
+	<xsl:template match="jsdl:Resources" mode="RESOURCES_MODE">
+		<xsl:apply-templates select="jsdl:OperatingSystem/jsdl:OperatingSystemType"/>
+		<xsl:apply-templates select="jsdl:OperatingSystem/jsdl:OperatingSystemVersion"/>
+	</xsl:template>
+		
+	<xsl:template match="jsdl-posix:Executable">
+		<xsl:element name="execfile">
+			<xsl:attribute name="name">
+				<xsl:call-template name="GET_FILE_NAME">
+					<xsl:with-param name="FILE_PATH">
+						<xsl:value-of select="."/>
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:attribute>
+			<xsl:element name="url">
+				<xsl:call-template name="FILESYSTEM_VALUE">
+					<xsl:with-param name="FILESYSTEM_NAME">
+						<xsl:value-of select="@filesystemName"/>
+					</xsl:with-param>
+					<xsl:with-param name="VALUE">
+						<xsl:value-of select="."/>
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:element>
+		</xsl:element>
+	</xsl:template>
+	
+	<xsl:template match="jsdl-posix:Argument">
+		<xsl:element name="value">
+			<xsl:call-template name="FILESYSTEM_VALUE">
+				<xsl:with-param name="FILESYSTEM_NAME">
+					<xsl:value-of select="@filesystemName"/>
+				</xsl:with-param>
+				<xsl:with-param name="VALUE">
+					<xsl:value-of select="."/>
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:element>
+	</xsl:template>
+	
+	<xsl:template match="jsdl:DataStaging">
+		<xsl:element name="file">
+			<xsl:attribute name="name">
+				<xsl:call-template name="FILESYSTEM_VALUE">
+					<xsl:with-param name="FILESYSTEM_NAME">
+						<xsl:value-of select="jsdl:FilesystemName"/>
+					</xsl:with-param>
+					<xsl:with-param name="VALUE">
+						<xsl:value-of select="jsdl:FileName"/>
+					</xsl:with-param>
+				</xsl:call-template>
+			</xsl:attribute>
+			
+			<xsl:attribute name="type">
+				<xsl:choose>
+					<xsl:when test="jsdl:Source/jsdl:URI">in</xsl:when>
+					<xsl:when test="jsdl:Target/jsdl:URI">out</xsl:when>
+					<xsl:otherwise>
+						<xsl:message terminate="no">
+							Source or Target URI is missing
+						</xsl:message>
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:attribute>
+			
+			<xsl:if test="jsdl:CreationFlag = 'append'">
+				<xsl:attribute name="append">true</xsl:attribute>
+			</xsl:if>
+			
+			<xsl:element name="url">
+				<xsl:choose>
+					<xsl:when test="jsdl:Source/jsdl:URI">
+						<xsl:value-of select="jsdl:Source/jsdl:URI"/>
+					</xsl:when>
+					<xsl:when test="jsdl:Target/jsdl:URI">
+						<xsl:value-of select="jsdl:Target/jsdl:URI"/>
+					</xsl:when>
+				</xsl:choose>
+			</xsl:element>
+			
+		</xsl:element>
+	</xsl:template>
+	
+	<xsl:template match="jsdl-posix:Environment">
+		<xsl:element name="variable">
+			<xsl:attribute name="name">
+				<xsl:value-of select="@name"/>
+			</xsl:attribute>
+			<xsl:call-template name="FILESYSTEM_VALUE">
+				<xsl:with-param name="FILESYSTEM_NAME">
+					<xsl:value-of select="@filesystemName"/>
+				</xsl:with-param>
+				<xsl:with-param name="VALUE">
+					<xsl:value-of select="."/>
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:element>
+	</xsl:template>
+	
+	<xsl:template match="jsdl:OperatingSystemType">
+		<xsl:element name="ostype">
+			<xsl:value-of select="jsdl:OperatingSystemName"/>
+		</xsl:element>
+	</xsl:template>
+
+	<xsl:template match="jsdl:OperatingSystemVersion">
+		<xsl:element name="osversion">
+			<xsl:value-of select="."/>
+		</xsl:element>
+	</xsl:template>
+	
+	<xsl:template match="jsdl:IndividualCPUSpeed">
+		<xsl:call-template name="HARD_CONSTRAINT_TEMPLATE">
+			<xsl:with-param name="NAME">cpuspeed</xsl:with-param>
+			<xsl:with-param name="VALUES" select="*"/>
+			<xsl:with-param name="FACTOR">0.001</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
+	
+	<xsl:template match="jsdl:IndividualCPUCount">
+		<xsl:call-template name="HARD_CONSTRAINT_TEMPLATE">
+			<xsl:with-param name="NAME">cpucount</xsl:with-param>
+			<xsl:with-param name="VALUES" select="*"/>
+			<xsl:with-param name="FACTOR">1</xsl:with-param>
+		</xsl:call-template>
+	</xsl:template>
+	
+	<xsl:template match="jsdl:IndividualNetworkBandwidth">
+		<xsl:call-template name="HARD_CONSTRAINT_TEMPLATE">
+			<xsl:with-param name="NAME">bandwidth</xsl:with-param>
+			<xsl:with-param name="VALUES" select="*"/>
+			<xsl:with-param name="FACTOR">
+				<xsl:value-of select="1 div (8 * 1024)"/>
+			</xsl:with-param>
+		</xsl:call-template>	
+	</xsl:template>
+	
+	<xsl:template match="jsdl:IndividualPhysicalMemory">
+		<xsl:call-template name="HARD_CONSTRAINT_TEMPLATE">
+			<xsl:with-param name="NAME">memory</xsl:with-param>
+			<xsl:with-param name="VALUES" select="*"/>
+			<xsl:with-param name="FACTOR">
+				<xsl:value-of select="1 div 1024"/>
+			</xsl:with-param>
+		</xsl:call-template>	
+	</xsl:template>
+	
+	<xsl:template match="jsdl:IndividualDiskSpace">
+		<xsl:call-template name="HARD_CONSTRAINT_TEMPLATE">
+			<xsl:with-param name="NAME">diskspace</xsl:with-param>
+			<xsl:with-param name="VALUES" select="*"/>
+			<xsl:with-param name="FACTOR">1</xsl:with-param>
+		</xsl:call-template>	
+	</xsl:template>
+
+	
+	<xsl:template name="HARD_CONSTRAINT_TEMPLATE">
+		<xsl:param name="NAME"/>
+		<xsl:param name="VALUES"/>
+		<xsl:param name="FACTOR"/>
+		<xsl:element name="parameter">
+			<xsl:attribute name="name">
+				<xsl:value-of select="$NAME"/>
+			</xsl:attribute>
+<!--		<xsl:apply-templates select="msxsl:node-set($VALUES)"> 
+-->
+		<xsl:apply-templates select="xalan:nodeset($VALUES)">
+				<xsl:with-param name="FACTOR" select="$FACTOR"/>
+			</xsl:apply-templates>
+		</xsl:element>
+	</xsl:template>
+	
+	<xsl:template match="jsdl:UpperBoundedRange">
+		<xsl:param name="FACTOR"/>
+		<xsl:element name="range">
+			<xsl:element name="max">
+				<xsl:value-of select=". * $FACTOR"/>
+			</xsl:element>
+		</xsl:element>
+	</xsl:template>
+
+	<xsl:template match="jsdl:LowerBoundedRange">
+		<xsl:param name="FACTOR"/>
+		<xsl:element name="range">
+			<xsl:element name="min">
+				<xsl:value-of select=". * $FACTOR"/>
+			</xsl:element>
+		</xsl:element>
+	</xsl:template>
+
+	<xsl:template match="jsdl:Exact">
+		<xsl:param name="FACTOR"/>
+		<xsl:element name="value">
+			<xsl:value-of select=". * $FACTOR"/>
+		</xsl:element>
+	</xsl:template>
+
+	<xsl:template match="jsdl:Range">
+		<xsl:param name="FACTOR"/>
+		<xsl:element name="range">
+			<xsl:element name="min">
+				<xsl:value-of select="jsdl:LowerBound * $FACTOR"/>
+			</xsl:element>
+			<xsl:element name="max">
+				<xsl:value-of select="jsdl:UpperBound * $FACTOR"/>
+			</xsl:element>
+		</xsl:element>
+	</xsl:template>
+
+
+
+	
+<xsl:template name="FILESYSTEM_VALUE">
+	<xsl:param name="FILESYSTEM_NAME"/>
+	<xsl:param name="VALUE"/>
+	<xsl:choose>
+		<xsl:when test="$FILESYSTEM_NAME and $FILESYSTEM_NAME != ''">
+			<xsl:variable name="FILESYSTEM"  select="key('FILESYSTEMS', string($FILESYSTEM_NAME))"/>
+			<xsl:choose>
+				<xsl:when test="$FILESYSTEM">
+					<xsl:value-of select="$FILESYSTEM/jsdl:MountPoint"/>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:message terminate="no">
+						Delcaration of following filesystem is missing: <xsl:value-of select="$FILESYSTEM_NAME"/>
+					</xsl:message>
+				</xsl:otherwise>
+			</xsl:choose>
+			<xsl:value-of select="$VALUE"/>
+		</xsl:when>
+		<xsl:otherwise>
+			<xsl:if test="starts-with($VALUE, '/')">
+				<xsl:value-of select="$FILE_URL_PREFIX"/>
+			</xsl:if>
+			<xsl:value-of select="$VALUE"/>
+		</xsl:otherwise>
+	</xsl:choose>
+</xsl:template>
+
+<xsl:template name="GET_FILE_NAME">
+	<xsl:param name="FILE_PATH"/>
+		
+	<xsl:choose>
+		<xsl:when test="not(contains($FILE_PATH,'/'))">
+			<xsl:value-of select="$FILE_PATH"/>
+		</xsl:when>
+		<xsl:otherwise>
+			<xsl:call-template name="GET_FILE_NAME">
+				<xsl:with-param name="FILE_PATH">
+					<xsl:value-of select="substring-after($FILE_PATH,'/')"/>
+				</xsl:with-param>
+			</xsl:call-template>
+		</xsl:otherwise>
+	</xsl:choose>
+</xsl:template>
+		
+</xsl:stylesheet>
Index: DCWoRMS/trunk/simulator/xslt/task2resreq.xslt
===================================================================
--- DCWoRMS/trunk/simulator/xslt/task2resreq.xslt	(revision 477)
+++ DCWoRMS/trunk/simulator/xslt/task2resreq.xslt	(revision 477)
@@ -0,0 +1,127 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+							    xmlns:xalan="http://xml.apache.org/xalan"
+                               			   extension-element-prefixes="xalan">
+		<xsl:strip-space elements="*"/>
+		<xsl:output method="xml" version="1.0" encoding="UTF-8" omit-xml-declaration="yes" indent="yes"/>
+		
+		<xsl:param name="JOB_ID"/>
+		<xsl:param name="USER_DN"/>
+		<xsl:param name="SUBMISSION_TIME"/>	
+<!--		<xsl:param name="DOMAIN"/> -->
+		<!-- =====================================================================================================================-->
+		<xsl:variable name="DEFAULT_FAULT_TOLERANCE" select="/task/faultTolerance"/>
+		<xsl:variable name="COMP_RES_TEMPLATE" select="/task/requirements/resourceTemplates/computingResourceTemplate"/>
+		<xsl:variable name="NET_RES_TEMPLATE" select="/task/requirements/resourceTemplates/networkResourceTemplate"/>
+	<!-- =====================================================================================================================-->
+	<xsl:template match="/">
+		
+			<xsl:apply-templates select="task"/>
+		  
+	</xsl:template>
+	<!-- =====================================================================================================================-->
+	<xsl:template match="task">
+		<xsl:element name="task">
+		
+			<xsl:attribute name="jobId"><xsl:value-of select="$JOB_ID"/></xsl:attribute>
+			<xsl:attribute name="taskId"><xsl:value-of select="@taskId"/></xsl:attribute>
+			<xsl:attribute name="userDN"><xsl:value-of select="$USER_DN"/></xsl:attribute>
+			<xsl:attribute name="submissionTime"><xsl:value-of select="$SUBMISSION_TIME"/></xsl:attribute>
+<!--			<xsl:attribute name="domain"><xsl:value-of select="$DOMAIN"/></xsl:attribute> -->
+			<xsl:if test="@extension">
+				<xsl:attribute name="extension"><xsl:value-of select="@extension"/></xsl:attribute>
+			</xsl:if>
+			<xsl:if test="@priority">
+				<xsl:attribute name="priority"><xsl:value-of select="@priority"/></xsl:attribute>
+			</xsl:if>
+			
+			<xsl:apply-templates select="description" mode="COPY_OF_MODE"/>
+			<xsl:apply-templates select="proxyInfo" mode="COPY_OF_MODE"/>
+			<xsl:apply-templates select="candidateHosts" mode="COPY_OF_MODE"/>
+			
+			<xsl:apply-templates select="requirements" mode="COPY_OF_MODE"/>
+			
+			<xsl:apply-templates select="execution" mode="COPY_OF_MODE"/>
+						
+			<xsl:apply-templates select="executionTime" mode="COPY_OF_MODE"/>
+			<xsl:apply-templates select="workflow" mode="COPY_OF_MODE"/>
+		</xsl:element>
+	</xsl:template>
+	<!-- =====================================================================================================================-->
+	<xsl:template match="requirements" mode="COPY_OF_MODE">
+		<xsl:element name="requirements">
+			<xsl:apply-templates select="resourceRequirements" mode="COPY_OF_MODE"/>
+			<xsl:apply-templates select="topology" mode="COPY_OF_MODE"/>
+		</xsl:element>
+	</xsl:template> 
+	<!-- =====================================================================================================================-->
+	<xsl:template match="computingResource" mode="COPY_OF_MODE">
+		<xsl:element name="computingResource">
+			<xsl:attribute name="resourceId"><xsl:value-of select="@resourceId"/></xsl:attribute>
+			<xsl:apply-templates mode="COPY_OF_MODE"/>
+			<xsl:if test="not(faultTolerance)">
+				<xsl:apply-templates select="$DEFAULT_FAULT_TOLERANCE" mode="COPY_OF_MODE"/>
+			</xsl:if>
+		</xsl:element>
+	</xsl:template>
+	<!-- =====================================================================================================================-->
+	<xsl:template match="templateIdReference" mode="COPY_OF_MODE">
+		<xsl:variable name="TEMPLATE_ID" select="."/>
+		<xsl:choose>
+			<xsl:when test="name(..) = 'computingResource'">
+				<xsl:apply-templates select="$COMP_RES_TEMPLATE[@templateId = $TEMPLATE_ID]/*" mode="COPY_OF_MODE"/>
+			</xsl:when>
+			<xsl:when test="name(..) = 'networkResource'">
+				<xsl:apply-templates select="$NET_RES_TEMPLATE[@templateId = $TEMPLATE_ID]/*" mode="COPY_OF_MODE"/>
+			</xsl:when>
+		</xsl:choose>
+	</xsl:template>
+	<!-- =====================================================================================================================-->
+	<xsl:template match="execution" mode="COPY_OF_MODE">
+		<xsl:if test="stageInOut">
+			<xsl:element name="execution">
+				<xsl:apply-templates select="stageInOut" mode="COPY_OF_MODE"/>
+			</xsl:element>
+		</xsl:if>
+	</xsl:template> 
+	<!-- =====================================================================================================================-->
+	<xsl:template match="stageInOut" mode="COPY_OF_MODE">
+		<xsl:element name="stageInOut">
+			<xsl:apply-templates select="*" mode="COPY_OF_MODE"/>
+		</xsl:element>
+	</xsl:template>
+	<!-- =====================================================================================================================-->
+	<xsl:template match="file | directory" mode="COPY_OF_MODE">
+		<xsl:element name="{name()}">
+			<xsl:attribute name="name">
+				<xsl:value-of select="@name"/>
+			</xsl:attribute>
+			<xsl:attribute name="type">
+				<xsl:value-of select="@type"/>
+			</xsl:attribute>			
+			<xsl:if test="@size">
+				<xsl:attribute name="size">
+					<xsl:value-of select="@size"/>
+				</xsl:attribute>
+			</xsl:if>
+			<xsl:if test="@required">
+				<xsl:attribute name="required">
+					<xsl:value-of select="@required"/>
+				</xsl:attribute>
+			</xsl:if>
+			<xsl:apply-templates select="*" mode="COPY_OF_MODE"/>
+		</xsl:element>
+	</xsl:template> 
+	<!-- =====================================================================================================================-->
+	<xsl:template match="*" mode="COPY_OF_MODE">
+	       <xsl:choose>
+		  <xsl:when test="node()"><xsl:element name="{name()}"><xsl:copy-of select="@*"/><xsl:apply-templates select="node()" mode="COPY_OF_MODE"/></xsl:element></xsl:when>
+		  <xsl:otherwise><xsl:element name="{name()}"><xsl:copy-of select="@*"/></xsl:element></xsl:otherwise>
+		</xsl:choose>	
+	</xsl:template>
+	<!-- =====================================================================================================================-->
+	<xsl:template match="*">
+	!!! BRAK OBSLUGI DLA <xsl:value-of select="name()"/> !!!
+	</xsl:template>
+	<!-- =====================================================================================================================-->
+</xsl:transform>
Index: DCWoRMS/trunk/simulator/xslt/ext_job_desc.xslt
===================================================================
--- DCWoRMS/trunk/simulator/xslt/ext_job_desc.xslt	(revision 477)
+++ DCWoRMS/trunk/simulator/xslt/ext_job_desc.xslt	(revision 477)
@@ -0,0 +1,127 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:set="http://exslt.org/sets" exclude-result-prefixes="set">
+	<xsl:strip-space elements="*"/>
+	<xsl:output method="xml" version="1.0" encoding="UTF-8" omit-xml-declaration="yes" indent="yes"/>
+	<!-- =====================================================================================================================-->
+		<xsl:variable name="GLOBAL_COMP_RES_TEMPLATES" select="/grmsJob/resourceTemplates/computingResourceTemplate"/>
+		<xsl:variable name="GLOBAL_NET_RES_TEMPLATES" select="/grmsJob/resourceTemplates/networkResourceTemplate"/>		
+	<!-- =====================================================================================================================-->
+	<xsl:template match="/">
+		<xsl:apply-templates select="*" mode="COPY_OF_MODE"/>
+	</xsl:template>
+	<!-- =====================================================================================================================-->
+	<xsl:template match="tasksDefaults" mode="COPY_OF_MODE">
+	</xsl:template>
+	<!-- =====================================================================================================================-->
+	<xsl:template match="resourceTemplates" mode="COPY_OF_MODE">
+	</xsl:template>
+	<!-- =====================================================================================================================-->
+	<xsl:template match="task" mode="COPY_OF_MODE">
+		<xsl:element name="task">
+			<xsl:copy-of select="@*"/>
+			<xsl:apply-templates select="description" mode="COPY_OF_MODE"/>
+			<xsl:apply-templates select="descriptionVariables" mode="COPY_OF_MODE"/>
+			
+			<xsl:call-template name="USE_DEFAULT_IF_NEEDED">
+				<xsl:with-param name="VALUE" select="proxyInfo"/>
+				<xsl:with-param name="DEFAULT" select="../tasksDefaults/proxyInfo"/>
+			</xsl:call-template>
+			<xsl:call-template name="USE_DEFAULT_IF_NEEDED">
+				<xsl:with-param name="VALUE" select="candidatHosts"/>
+				<xsl:with-param name="DEFAULT" select="../tasksDefaults/candidateHosts"/>
+			</xsl:call-template>
+			<xsl:call-template name="USE_DEFAULT_IF_NEEDED">
+				<xsl:with-param name="VALUE" select="requirements"/>
+				<xsl:with-param name="DEFAULT" select="../tasksDefaults/requirements"/>
+			</xsl:call-template>
+			
+			<xsl:apply-templates select="execution" mode="COPY_OF_MODE"/>
+			<xsl:apply-templates select="postResumeExecution" mode="COPY_OF_MODE"/>
+
+			<xsl:call-template name="USE_DEFAULT_IF_NEEDED">
+				<xsl:with-param name="VALUE" select="executionTime"/>
+				<xsl:with-param name="DEFAULT" select="../tasksDefaults/executionTime"/>
+			</xsl:call-template>
+			
+			<xsl:apply-templates select="workflow" mode="COPY_OF_MODE"/>
+			<xsl:apply-templates select="parameterSweep" mode="COPY_OF_MODE"/>			
+
+			<xsl:call-template name="USE_DEFAULT_IF_NEEDED">
+				<xsl:with-param name="VALUE" select="faultTolerance"/>
+				<xsl:with-param name="DEFAULT" select="../tasksDefaults/faultTolerance"/>
+			</xsl:call-template>
+			<xsl:apply-templates select="other" mode="COPY_OF_MODE"/>
+		</xsl:element>
+	</xsl:template>
+	<!-- =====================================================================================================================-->
+	<xsl:template match="requirements" mode="COPY_OF_MODE">
+		<xsl:element name="requirements">
+		
+			<xsl:if test="resourcesTemplates or .//templateIdReference">
+				<xsl:element name="resourceTemplates">
+					<xsl:apply-templates select="resourceTemplates/*" mode="COPY_OF_MODE"/>
+					
+					<xsl:call-template name="ADD_TEMPLATE_IF_NEEDED">
+						<xsl:with-param name="REFERENCED" select="set:distinct(.//computingResource/templateIdReference)"/>
+						<xsl:with-param name="LOCAL_TEMPLATES" select="resourceTemplates/computingResourceTemplate"/>
+						<xsl:with-param name="GLOBAL_TEMPLATES" select="$GLOBAL_COMP_RES_TEMPLATES"/>
+					</xsl:call-template>
+		
+					<xsl:call-template name="ADD_TEMPLATE_IF_NEEDED">
+						<xsl:with-param name="REFERENCED" select=".//networkResource/templateIdReference"/>
+						<xsl:with-param name="LOCAL_TEMPLATES" select="resourceTemplates/networkResourceTemplate"/>
+						<xsl:with-param name="GLOBAL_TEMPLATES" select="$GLOBAL_NET_RES_TEMPLATES"/>
+					</xsl:call-template>
+				</xsl:element>	
+			</xsl:if>
+	
+			<xsl:apply-templates select="resourceRequirements" mode="COPY_OF_MODE"/>
+			<xsl:apply-templates select="topology" mode="COPY_OF_MODE"/>
+		</xsl:element>
+	</xsl:template>
+	<!-- =====================================================================================================================-->
+	<xsl:template name="USE_DEFAULT_IF_NEEDED">
+		<xsl:param name="VALUE"/>
+		<xsl:param name="DEFAULT"/>
+		<xsl:choose>
+			<xsl:when test="$VALUE">
+				<xsl:apply-templates select="$VALUE" mode="COPY_OF_MODE"/>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:apply-templates select="$DEFAULT" mode="COPY_OF_MODE"/>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<!-- =====================================================================================================================-->
+		<xsl:template name="ADD_TEMPLATE_IF_NEEDED">
+			<xsl:param name="REFERENCED"/>
+			<xsl:param name="LOCAL_TEMPLATES"/>
+			<xsl:param name="GLOBAL_TEMPLATES"/>
+						
+			<xsl:for-each select="$REFERENCED">
+				<xsl:variable name="CURRENT" select="."/>
+				<xsl:if test="not($LOCAL_TEMPLATES[@templateId = $CURRENT])">
+					<xsl:apply-templates select="$GLOBAL_TEMPLATES[@templateId = $CURRENT]" mode="COPY_OF_MODE"/>
+				</xsl:if>
+			</xsl:for-each>
+
+		</xsl:template>
+	<!-- =====================================================================================================================-->
+	<!-- =====================================================================================================================-->
+	<xsl:template match="*" mode="COPY_OF_MODE">
+		<xsl:choose>
+			<xsl:when test="node()">
+				<xsl:element name="{name()}">
+					<xsl:copy-of select="@*"/>
+					<xsl:apply-templates select="node()" mode="COPY_OF_MODE"/>
+				</xsl:element>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:element name="{name()}">
+					<xsl:copy-of select="@*"/>
+				</xsl:element>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+	<!-- =====================================================================================================================-->
+</xsl:transform>
Index: DCWoRMS/trunk/simulator/xslt/date.add.template.xsl
===================================================================
--- DCWoRMS/trunk/simulator/xslt/date.add.template.xsl	(revision 477)
+++ DCWoRMS/trunk/simulator/xslt/date.add.template.xsl	(revision 477)
@@ -0,0 +1,397 @@
+<?xml version="1.0"?>
+<xsl:stylesheet version="1.0"
+                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:date="http://exslt.org/dates-and-times"
+                extension-element-prefixes="date">
+ 
+<date:month-lengths>
+   <date:month>31</date:month>
+   <date:month>28</date:month>
+   <date:month>31</date:month>
+   <date:month>30</date:month>
+   <date:month>31</date:month>
+   <date:month>30</date:month>
+   <date:month>31</date:month>
+   <date:month>31</date:month>
+   <date:month>30</date:month>
+   <date:month>31</date:month>
+   <date:month>30</date:month>
+   <date:month>31</date:month>
+</date:month-lengths>
+
+<xsl:template name="date:add">
+	<xsl:param name="date-time" />
+   <xsl:param name="duration" />
+   <xsl:variable name="dt-neg" select="starts-with($date-time, '-')" />
+   <xsl:variable name="dt-no-neg">
+      <xsl:choose>
+         <xsl:when test="$dt-neg or starts-with($date-time, '+')">
+            <xsl:value-of select="substring($date-time, 2)" />
+         </xsl:when>
+         <xsl:otherwise>
+            <xsl:value-of select="$date-time" />
+         </xsl:otherwise>
+      </xsl:choose>
+   </xsl:variable>
+   <xsl:variable name="dt-no-neg-length" select="string-length($dt-no-neg)" />
+   <xsl:variable name="timezone">
+      <xsl:choose>
+         <xsl:when test="substring($dt-no-neg, $dt-no-neg-length) = 'Z'">Z</xsl:when>
+         <xsl:otherwise>
+            <xsl:variable name="tz" select="substring($dt-no-neg, $dt-no-neg-length - 5)" />
+            <xsl:if test="(substring($tz, 1, 1) = '-' or 
+                           substring($tz, 1, 1) = '+') and
+                          substring($tz, 4, 1) = ':'">
+               <xsl:value-of select="$tz" />
+            </xsl:if>
+         </xsl:otherwise>
+      </xsl:choose>
+   </xsl:variable>
+   <xsl:variable name="new-dt">
+      <xsl:if test="not(string($timezone)) or
+                    $timezone = 'Z' or 
+                    (substring($timezone, 2, 2) &lt;= 23 and
+                     substring($timezone, 5, 2) &lt;= 59)">
+         <xsl:variable name="dt" select="substring($dt-no-neg, 1, $dt-no-neg-length - string-length($timezone))" />
+         <xsl:variable name="dt-length" select="string-length($dt)" />
+         <xsl:variable name="du-neg" select="starts-with($duration, '-')" />
+         <xsl:variable name="du">
+            <xsl:choose>
+               <xsl:when test="$du-neg"><xsl:value-of select="substring($duration, 2)" /></xsl:when>
+               <xsl:otherwise><xsl:value-of select="$duration" /></xsl:otherwise>
+            </xsl:choose>
+         </xsl:variable>
+         <xsl:if test="starts-with($du, 'P') and
+                       not(translate($du, '0123456789PYMDTHS.', ''))">
+            <xsl:variable name="du-date">
+               <xsl:choose>
+                  <xsl:when test="contains($du, 'T')"><xsl:value-of select="substring-before(substring($du, 2), 'T')" /></xsl:when>
+                  <xsl:otherwise><xsl:value-of select="substring($du, 2)" /></xsl:otherwise>
+               </xsl:choose>
+            </xsl:variable>
+            <xsl:variable name="du-time">
+               <xsl:if test="contains($du, 'T')"><xsl:value-of select="substring-after($du, 'T')" /></xsl:if>
+            </xsl:variable>
+            <xsl:if test="(not($du-date) or
+                           (not(translate($du-date, '0123456789YMD', '')) and
+                            not(substring-after($du-date, 'D')) and
+                            (contains($du-date, 'D') or 
+                             (not(substring-after($du-date, 'M')) and
+                              (contains($du-date, 'M') or
+                               not(substring-after($du-date, 'Y'))))))) and
+                          (not($du-time) or
+                           (not(translate($du-time, '0123456789HMS.', '')) and
+                            not(substring-after($du-time, 'S')) and
+                            (contains($du-time, 'S') or
+                             not(substring-after($du-time, 'M')) and
+                             (contains($du-time, 'M') or
+                              not(substring-after($du-time, 'Y'))))))">
+               <xsl:variable name="duy-str">
+                  <xsl:choose>
+                     <xsl:when test="contains($du-date, 'Y')"><xsl:value-of select="substring-before($du-date, 'Y')" /></xsl:when>
+                     <xsl:otherwise>0</xsl:otherwise>
+                  </xsl:choose>
+               </xsl:variable>
+               <xsl:variable name="dum-str">
+                  <xsl:choose>
+                     <xsl:when test="contains($du-date, 'M')">
+                        <xsl:choose>
+                           <xsl:when test="contains($du-date, 'Y')"><xsl:value-of select="substring-before(substring-after($du-date, 'Y'), 'M')" /></xsl:when>
+                           <xsl:otherwise><xsl:value-of select="substring-before($du-date, 'M')" /></xsl:otherwise>
+                        </xsl:choose>
+                     </xsl:when>
+                     <xsl:otherwise>0</xsl:otherwise>
+                  </xsl:choose>
+               </xsl:variable>
+               <xsl:variable name="dud-str">
+                  <xsl:choose>
+                     <xsl:when test="contains($du-date, 'D')">
+                        <xsl:choose>
+                           <xsl:when test="contains($du-date, 'M')"><xsl:value-of select="substring-before(substring-after($du-date, 'M'), 'D')" /></xsl:when>
+                           <xsl:when test="contains($du-date, 'Y')"><xsl:value-of select="substring-before(substring-after($du-date, 'Y'), 'D')" /></xsl:when>
+                           <xsl:otherwise><xsl:value-of select="substring-before($du-date, 'D')" /></xsl:otherwise>
+                        </xsl:choose>
+                     </xsl:when>
+                     <xsl:otherwise>0</xsl:otherwise>
+                  </xsl:choose>
+               </xsl:variable>
+               <xsl:variable name="duh-str">
+                  <xsl:choose>
+                     <xsl:when test="contains($du-time, 'H')"><xsl:value-of select="substring-before($du-time, 'H')" /></xsl:when>
+                     <xsl:otherwise>0</xsl:otherwise>
+                  </xsl:choose>
+               </xsl:variable>
+               <xsl:variable name="dumin-str">
+                  <xsl:choose>
+                     <xsl:when test="contains($du-time, 'M')">
+                        <xsl:choose>
+                           <xsl:when test="contains($du-time, 'H')"><xsl:value-of select="substring-before(substring-after($du-time, 'H'), 'M')" /></xsl:when>
+                           <xsl:otherwise><xsl:value-of select="substring-before($du-time, 'M')" /></xsl:otherwise>
+                        </xsl:choose>
+                     </xsl:when>
+                     <xsl:otherwise>0</xsl:otherwise>
+                  </xsl:choose>
+               </xsl:variable>
+               <xsl:variable name="dus-str">
+                  <xsl:choose>
+                     <xsl:when test="contains($du-time, 'S')">
+                        <xsl:choose>
+                           <xsl:when test="contains($du-time, 'M')"><xsl:value-of select="substring-before(substring-after($du-time, 'M'), 'S')" /></xsl:when>
+                           <xsl:when test="contains($du-time, 'H')"><xsl:value-of select="substring-before(substring-after($du-time, 'H'), 'S')" /></xsl:when>
+                           <xsl:otherwise><xsl:value-of select="substring-before($du-time, 'S')" /></xsl:otherwise>
+                        </xsl:choose>
+                     </xsl:when>
+                     <xsl:otherwise>0</xsl:otherwise>
+                  </xsl:choose>
+               </xsl:variable>
+               <xsl:variable name="mult" select="($du-neg * -2) + 1" />
+               <xsl:variable name="duy" select="$duy-str * $mult" />
+               <xsl:variable name="dum" select="$dum-str * $mult" />
+               <xsl:variable name="dud" select="$dud-str * $mult" />
+               <xsl:variable name="duh" select="$duh-str * $mult" />
+               <xsl:variable name="dumin" select="$dumin-str * $mult" />
+               <xsl:variable name="dus" select="$dus-str * $mult" />
+
+               <xsl:variable name="year" select="substring($dt, 1, 4) * (($dt-neg * -2) + 1)" />
+               <xsl:choose>
+                  <xsl:when test="$year and
+                                  string($duy) = 'NaN' or 
+                                  string($dum) = 'NaN' or 
+                                  string($dud) = 'NaN' or 
+                                  string($duh) = 'NaN' or 
+                                  string($dumin) = 'NaN' or 
+                                  string($dus) = 'NaN'" />
+                  <xsl:when test="$dt-length > 4 or
+                                  $dum or $dud or $duh or $dumin or $dus">
+                     <xsl:variable name="month">
+                        <xsl:choose>
+                           <xsl:when test="$dt-length > 4">
+                              <xsl:if test="substring($dt, 5, 1) = '-'">
+                                 <xsl:value-of select="substring($dt, 6, 2)" />
+                              </xsl:if>
+                           </xsl:when>
+                           <xsl:otherwise>1</xsl:otherwise>
+                        </xsl:choose>
+                     </xsl:variable>
+                     <xsl:choose>
+                        <xsl:when test="not($month) or $month > 12" />
+                        <xsl:when test="$dt-length > 7 or
+                                        $dud or $duh or $dumin or $dus">
+                           <xsl:variable name="day">
+                              <xsl:choose>
+                                 <xsl:when test="$dt-length > 7">
+                                    <xsl:if test="substring($dt, 8, 1) = '-'">
+                                       <xsl:value-of select="substring($dt, 9, 2)" />
+                                    </xsl:if>
+                                 </xsl:when>
+                                 <xsl:otherwise>1</xsl:otherwise>
+                              </xsl:choose>
+                           </xsl:variable>
+                           <xsl:choose>
+                              <xsl:when test="not($day) or $day > 31" />
+                              <xsl:when test="$dt-length > 10 or
+                                              $duh or $dumin or $dus">
+                                 <xsl:if test="$dt-length = 10 or
+                                               (substring($dt, 11, 1) = 'T' and
+                                                substring($dt, 14, 1) = ':' and
+                                                substring($dt, 17, 1) = ':')">
+                                    <xsl:variable name="hour">
+                                       <xsl:choose>
+                                          <xsl:when test="$dt-length > 10"><xsl:value-of select="substring($dt, 12, 2)" /></xsl:when>
+                                          <xsl:otherwise>0</xsl:otherwise>
+                                       </xsl:choose>
+                                    </xsl:variable>
+                                    <xsl:variable name="minute">
+                                       <xsl:choose>
+                                          <xsl:when test="$dt-length > 10"><xsl:value-of select="substring($dt, 15, 2)" /></xsl:when>
+                                          <xsl:otherwise>0</xsl:otherwise>
+                                       </xsl:choose>
+                                    </xsl:variable>
+                                    <xsl:variable name="second">
+                                       <xsl:choose>
+                                          <xsl:when test="$dt-length > 10"><xsl:value-of select="substring($dt, 18)" /></xsl:when>
+                                          <xsl:otherwise>0</xsl:otherwise>
+                                       </xsl:choose>
+                                    </xsl:variable>
+                                    <xsl:if test="$hour &lt;= 23 and $minute &lt;= 59 and $second &lt;= 60">
+                                       <xsl:variable name="new-second" select="$second + $dus" />
+                                       <xsl:variable name="new-minute" select="$minute + $dumin + floor($new-second div 60)" />
+                                       <xsl:variable name="new-hour" select="$hour + $duh + floor($new-minute div 60)" />
+                                       <xsl:variable name="new-month" select="$month + $dum" />
+                                       <xsl:call-template name="date:_add-days">
+                                          <xsl:with-param name="year" select="$year + $duy + floor(($new-month - 1) div 12)" />
+                                          <xsl:with-param name="month">
+                                             <xsl:variable name="m">
+                                                <xsl:choose>
+                                                   <xsl:when test="$new-month &lt; 1"><xsl:value-of select="$new-month + 12" /></xsl:when>
+                                                   <xsl:otherwise><xsl:value-of select="$new-month" /></xsl:otherwise>
+                                                </xsl:choose>
+                                             </xsl:variable>
+                                             <xsl:choose>
+                                                <xsl:when test="$m mod 12">
+                                                   <xsl:value-of select="format-number($m mod 12, '00')" />
+                                                </xsl:when>
+                                                <xsl:otherwise>12</xsl:otherwise>
+                                             </xsl:choose>
+                                          </xsl:with-param>
+                                          <xsl:with-param name="day" select="$day" />
+                                          <xsl:with-param name="days" select="$dud + floor($new-hour div 24)" />
+                                       </xsl:call-template>
+                                       <xsl:text>T</xsl:text>
+                                       <xsl:value-of select="format-number(($new-hour + 24) mod 24, '00')" />
+                                       <xsl:text>:</xsl:text>
+                                       <xsl:value-of select="format-number($new-minute mod 60, '00')" />
+                                       <xsl:text>:</xsl:text>
+                                       <xsl:if test="$new-second mod 60 &lt; 10">0</xsl:if>
+                                       <xsl:value-of select="$new-second mod 60" />
+                                       <xsl:value-of select="$timezone" />
+                                    </xsl:if>
+                                 </xsl:if>
+                              </xsl:when>
+                              <xsl:otherwise>
+                                 <xsl:variable name="new-month" select="$month + $dum" />
+                                 <xsl:call-template name="date:_add-days">
+                                    <xsl:with-param name="year" select="$year + $duy + floor(($new-month - 1) div 12)" />
+                                    <xsl:with-param name="month">
+                                       <xsl:variable name="m">
+                                          <xsl:choose>
+                                             <xsl:when test="$new-month &lt; 1"><xsl:value-of select="$new-month + 12" /></xsl:when>
+                                             <xsl:otherwise><xsl:value-of select="$new-month" /></xsl:otherwise>
+                                          </xsl:choose>
+                                       </xsl:variable>
+                                       <xsl:choose>
+                                          <xsl:when test="$m mod 12">
+                                             <xsl:value-of select="format-number($m mod 12, '00')" />
+                                          </xsl:when>
+                                          <xsl:otherwise>12</xsl:otherwise>
+                                       </xsl:choose>
+                                    </xsl:with-param>
+                                    <xsl:with-param name="day" select="$day" />
+                                    <xsl:with-param name="days" select="$dud" />
+                                 </xsl:call-template>
+                                 <xsl:value-of select="$timezone" />
+                              </xsl:otherwise>
+                           </xsl:choose>
+                        </xsl:when>
+                        <xsl:otherwise>
+                           <xsl:variable name="new-month" select="$month + $dum" />
+                           <xsl:value-of select="format-number($year + $duy + floor(($new-month - 1) div 12), '0000')" />
+                           <xsl:text>-</xsl:text>
+                           <xsl:variable name="m">
+                              <xsl:choose>
+                                 <xsl:when test="$new-month &lt; 1"><xsl:value-of select="$new-month + 12" /></xsl:when>
+                                 <xsl:otherwise><xsl:value-of select="$new-month" /></xsl:otherwise>
+                              </xsl:choose>
+                           </xsl:variable>
+                           <xsl:choose>
+                              <xsl:when test="$m mod 12">
+                                 <xsl:value-of select="format-number($m mod 12, '00')" />
+                              </xsl:when>
+                              <xsl:otherwise>12</xsl:otherwise>
+                           </xsl:choose>
+                           <xsl:value-of select="$timezone" />
+                        </xsl:otherwise>
+                     </xsl:choose>
+                  </xsl:when>
+                  <xsl:otherwise>
+                     <xsl:value-of select="format-number($year + $duy, '0000')" />
+                     <xsl:value-of select="$timezone" />
+                  </xsl:otherwise>
+               </xsl:choose>
+            </xsl:if>
+         </xsl:if>
+      </xsl:if>
+   </xsl:variable>
+   <xsl:choose>
+     <xsl:when test="string-length($date-time) > 10">
+       <xsl:value-of select="$new-dt" />
+     </xsl:when>
+     <xsl:otherwise>
+       <xsl:value-of select="substring($new-dt, 1, string-length($date-time))" />
+     </xsl:otherwise>
+   </xsl:choose>
+</xsl:template>
+
+<xsl:template name="date:_add-days">
+   <xsl:param name="year" />
+   <xsl:param name="month" />
+   <xsl:param name="day" />
+   <xsl:param name="days" />
+   <xsl:param name="new-day" select="'NaN'" />
+   <xsl:variable name="leap" select="(not($year mod 4) and $year mod 100) or not($year mod 400)" />
+   <xsl:variable name="month-days" select="document('')/*/date:month-lengths/date:month" />
+   <xsl:variable name="days-in-month">
+      <xsl:choose>
+         <xsl:when test="$month = 2 and $leap">
+            <xsl:value-of select="$month-days[number($month)] + 1" />
+         </xsl:when>
+         <xsl:otherwise>
+            <xsl:value-of select="$month-days[number($month)]" />
+         </xsl:otherwise>
+      </xsl:choose>
+   </xsl:variable>
+   <xsl:choose>
+      <xsl:when test="$new-day = 'NaN'">
+         <xsl:call-template name="date:_add-days">
+            <xsl:with-param name="year" select="$year" />
+            <xsl:with-param name="month" select="$month" />
+            <xsl:with-param name="new-day">
+               <xsl:choose>
+                  <xsl:when test="$day > $days-in-month">
+                     <xsl:value-of select="$days-in-month + $days" />
+                  </xsl:when>
+                  <xsl:otherwise><xsl:value-of select="$day + $days" /></xsl:otherwise>
+               </xsl:choose>
+            </xsl:with-param>
+         </xsl:call-template>
+      </xsl:when>
+      <xsl:otherwise>
+         <xsl:choose>
+            <xsl:when test="$new-day &lt; 1">
+               <xsl:call-template name="date:_add-days">
+                  <xsl:with-param name="year" select="$year - ($month = 1)" />
+                  <xsl:with-param name="month">
+                     <xsl:choose>
+                        <xsl:when test="$month = 1">12</xsl:when>
+                        <xsl:otherwise><xsl:value-of select="$month - 1" /></xsl:otherwise>
+                     </xsl:choose>
+                  </xsl:with-param>
+                  <xsl:with-param name="new-day">
+                     <xsl:variable name="days-in-new-month">
+                        <xsl:choose>
+                           <xsl:when test="$leap and $month = 3">29</xsl:when>
+                           <xsl:when test="$month = 1">31</xsl:when>
+                           <xsl:otherwise>
+                              <xsl:value-of select="$month-days[$month - 1]" />
+                           </xsl:otherwise>
+                        </xsl:choose>
+                     </xsl:variable>                     
+                     <xsl:value-of select="$new-day + $days-in-new-month" />
+                  </xsl:with-param>
+               </xsl:call-template>
+            </xsl:when>
+            <xsl:when test="$new-day > $days-in-month">
+               <xsl:call-template name="date:_add-days">
+                  <xsl:with-param name="year" select="$year + ($month = 12)" />
+                  <xsl:with-param name="month">
+                     <xsl:choose>
+                        <xsl:when test="$month = 12">1</xsl:when>
+                        <xsl:otherwise><xsl:value-of select="$month + 1" /></xsl:otherwise>
+                     </xsl:choose>
+                  </xsl:with-param>
+                  <xsl:with-param name="new-day" select="$new-day - $days-in-month" />
+               </xsl:call-template>
+            </xsl:when>
+            <xsl:otherwise>
+               <xsl:value-of select="format-number($year, '0000')" />
+               <xsl:text>-</xsl:text>
+               <xsl:value-of select="format-number($month, '00')" />
+               <xsl:text>-</xsl:text>
+               <xsl:value-of select="format-number($new-day, '00')" />
+            </xsl:otherwise>
+         </xsl:choose>
+      </xsl:otherwise>
+   </xsl:choose>
+</xsl:template>
+
+</xsl:stylesheet>
Index: DCWoRMS/trunk/simulator/xslt/job_postprocessing.xslt
===================================================================
--- DCWoRMS/trunk/simulator/xslt/job_postprocessing.xslt	(revision 477)
+++ DCWoRMS/trunk/simulator/xslt/job_postprocessing.xslt	(revision 477)
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:transform version="1.0" 
+				xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+				xmlns:date="http://exslt.org/dates-and-times">
+	
+	<xsl:output method="xml" version="1.0" encoding="UTF-8" omit-xml-declaration="yes" indent="yes"/>
+	
+	<xsl:include href="date.add.template.xsl"/>
+	
+	<xsl:param name="TASK_ID"/>
+	<xsl:param name="EXEC_DURATION_VALUE"/>
+	
+	<xsl:strip-space elements="*"/>
+	<xsl:output method="xml" version="1.0" encoding="UTF-8" omit-xml-declaration="yes" indent="yes"/>
+	
+	<xsl:template match="/">
+		<xsl:apply-templates select="*" mode="COPY_OF_MODE"/>
+	</xsl:template>
+	
+	<xsl:template match="//task[@taskId=$TASK_ID]" mode="COPY_OF_MODE">
+		<xsl:element name="task">
+			<xsl:copy-of select="@*"/>
+			<xsl:apply-templates select="requirements" mode="COPY_OF_MODE"/>
+			
+			<xsl:if test="executionTime">
+				<xsl:element name="executionTime">
+					
+					<xsl:if test="executionTime/executionDuration">
+						<xsl:element name="executionDuration">
+							<xsl:value-of select="$EXEC_DURATION_VALUE"/>
+						</xsl:element>
+					</xsl:if>
+					
+					<xsl:if test="executionTime/timePeriod">
+						<xsl:element name="timePeriod">
+						<xsl:copy-of select="executionTime/timePeriod/periodStart"/>
+							<xsl:element name="periodEnd">
+								<xsl:call-template name="date:add">
+								   <xsl:with-param name="date-time" select="executionTime/timePeriod/periodEnd" />
+								   <xsl:with-param name="duration" select="$EXEC_DURATION_VALUE" />
+								</xsl:call-template>
+							</xsl:element>
+						</xsl:element>
+					</xsl:if>
+					
+				</xsl:element>
+			
+			</xsl:if>
+		
+		</xsl:element>
+		
+	</xsl:template>
+	
+	<xsl:template match="*" mode="COPY_OF_MODE">
+		<xsl:choose>
+			<xsl:when test="node()">
+				<xsl:element name="{name()}">
+					<xsl:copy-of select="@*"/>
+					<xsl:apply-templates select="node()" mode="COPY_OF_MODE"/>
+				</xsl:element>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:element name="{name()}">
+					<xsl:copy-of select="@*"/>
+				</xsl:element>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+
+</xsl:transform>
Index: DCWoRMS/trunk/simulator/xslt/host_params2rtg.xslt
===================================================================
--- DCWoRMS/trunk/simulator/xslt/host_params2rtg.xslt	(revision 477)
+++ DCWoRMS/trunk/simulator/xslt/host_params2rtg.xslt	(revision 477)
@@ -0,0 +1,425 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- TO_DO:
+ODTWORZYC LINKI
+-->
+
+<xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+			     xmlns="http://www.QosCosGrid.org/resourceDescription"
+			     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+			     xmlns:set="http://exslt.org/sets" 
+			     exclude-result-prefixes="set">
+                             
+	<xsl:strip-space elements="*"/>
+	
+	<xsl:output method="xml" version="1.0" encoding="UTF-8" omit-xml-declaration="yes" indent="yes"/>
+	
+	<xsl:variable name="AD_IDENTIFIER">AD_ID</xsl:variable>
+	<xsl:variable name="RES_IDENTIFIER">RES_ID</xsl:variable>
+	<xsl:variable name="GROUP_IDENTIFIER">GROUP_ID</xsl:variable>
+	<xsl:variable name="GATEWAY">GATEWAY</xsl:variable>
+	<xsl:variable name="GRID_DOMAIN_IDENTIFIER">GRID</xsl:variable>
+	
+	<xsl:key name="AD_RESOURCES" match="/hostParameters/resources/computingResource" use="additionalProperties/property[@name=$AD_IDENTIFIER]"/>
+	<xsl:key name="AD_GROUPS" match="/hostParameters/topology/resourcesGroup" use="additionalProperties/property[@name=$AD_IDENTIFIER]"/>
+	<xsl:variable name="DOMAINS" select="set:distinct(.//additionalProperties/property[@name=$AD_IDENTIFIER])"/>
+	
+<!-- =====================================================  ====================================================== -->
+	<xsl:template match="/">
+		<xsl:apply-templates select="/hostParameters"/>
+	</xsl:template>	
+<!-- =====================================================  ====================================================== -->
+	<xsl:template match="hostParameters">
+		<xsl:element name="rtg">
+			<xsl:call-template name="CONTEXT_TEMPLATE"/>
+			
+			<xsl:call-template name="INTRA_AD_INFOS_TEMPLATE"/>
+			
+			<xsl:call-template name="GRID_LEVEL_TEMPLATE"/>
+		</xsl:element>	 
+	</xsl:template>	
+<!-- =====================================================  ====================================================== -->
+	<xsl:template name="CONTEXT_TEMPLATE">
+		<xsl:element name="context">
+			<xsl:attribute name="rtgType">GridTopologyRtg</xsl:attribute>
+			<xsl:attribute name="isComplete">true</xsl:attribute>
+						
+			<xsl:if test="validity/timeSlot">
+				<xsl:element name="defaultTimeInterval">
+					<xsl:apply-templates select="validity/timeSlot[1]"/>
+				</xsl:element>
+			</xsl:if>
+		</xsl:element>
+	</xsl:template>
+<!-- =====================================================  ====================================================== -->
+	<xsl:template match="timeSlot">
+		<xsl:element name="lowerBoundedRange">
+			<xsl:value-of select="slotStart"/>
+		</xsl:element>
+		<xsl:choose>
+			<xsl:when test="slotEnd">
+				<xsl:element name="upperBoundedRange">
+					<xsl:value-of select="slotEnd"/>
+				</xsl:element>
+			</xsl:when>
+			<xsl:when test="slotDuration">
+				<xsl:element name="duration">
+					<xsl:value-of select="slotDuration"/>
+				</xsl:element>
+			</xsl:when>
+		</xsl:choose>
+	</xsl:template>
+<!-- =====================================================  ====================================================== -->
+	<xsl:template name="INTRA_AD_INFOS_TEMPLATE">
+		<xsl:variable name="CURRENT" select="."/>
+		<xsl:for-each select="$DOMAINS">
+			<xsl:element name="intraADInfo">
+				<xsl:attribute name="adId">
+					<xsl:value-of select="."/>
+				</xsl:attribute>
+				<xsl:apply-templates select="key('AD_RESOURCES',.)" mode="TEMPLATE_MODE"/>
+				<xsl:apply-templates select="key('AD_GROUPS',.)" mode="TEMPLATE_MODE"/>
+				
+				<xsl:apply-templates select="key('AD_RESOURCES',.)" mode="RESOURCE_MODE"/>
+				<xsl:apply-templates select="key('AD_GROUPS',.)" mode="RESOURCE_MODE"/>
+				
+				<xsl:apply-templates select="key('AD_GROUPS',.)" mode="GROUP_MODE"/>
+				
+				<xsl:apply-templates select="key('AD_RESOURCES',.)" mode="AVAILABILITY_MODE"/>
+			</xsl:element>
+		</xsl:for-each>
+	</xsl:template>
+<!-- =====================================================  ====================================================== -->
+	<xsl:template match="computingResource" mode="TEMPLATE_MODE">
+		<xsl:element name="compResourceTemplate">
+			<xsl:attribute name="id">
+				<xsl:value-of select="additionalProperties/property[@name=$RES_IDENTIFIER]"/>
+			</xsl:attribute>
+			<xsl:apply-templates select="machineParameters/hostParameter" mode="PARAMETER_MODE"/>
+		</xsl:element>
+	</xsl:template>
+<!-- =====================================================  ====================================================== -->
+	<xsl:template match="*" mode="PARAMETER_MODE">
+		<xsl:choose>
+			<xsl:when test="@name='cpucount'">
+				<xsl:call-template name="PARAMETER_TEMPLATE">
+					<xsl:with-param name="ELEMENT">metric</xsl:with-param>
+					<xsl:with-param name="METRIC_TYPE">cpuCount</xsl:with-param>
+					<xsl:with-param name="METRIC_UNIT">null</xsl:with-param>
+					<xsl:with-param name="VALUE_TYPE">NUMERIC</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:when test="@name='cpuspeed'">
+				<xsl:call-template name="PARAMETER_TEMPLATE">
+					<xsl:with-param name="ELEMENT">metric</xsl:with-param>
+					<xsl:with-param name="METRIC_TYPE">cpuSpeed</xsl:with-param>
+					<xsl:with-param name="METRIC_UNIT">MHz</xsl:with-param>
+					<xsl:with-param name="VALUE_TYPE">NUMERIC</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:when test="@name='memory'">
+				<xsl:call-template name="PARAMETER_TEMPLATE">
+					<xsl:with-param name="ELEMENT">metric</xsl:with-param>
+					<xsl:with-param name="METRIC_TYPE">memoryTotal</xsl:with-param>
+					<xsl:with-param name="METRIC_UNIT">MB</xsl:with-param>
+					<xsl:with-param name="VALUE_TYPE">NUMERIC</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:when test="@name='diskspace'">
+				<xsl:call-template name="PARAMETER_TEMPLATE">
+					<xsl:with-param name="ELEMENT">metric</xsl:with-param>
+					<xsl:with-param name="METRIC_TYPE">diskTotal</xsl:with-param>
+					<xsl:with-param name="METRIC_UNIT">MB</xsl:with-param>
+					<xsl:with-param name="VALUE_TYPE">NUMERIC</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:when test="@name='cpuarch'">
+				<xsl:call-template name="PARAMETER_TEMPLATE">
+					<xsl:with-param name="ELEMENT">metric</xsl:with-param>
+					<xsl:with-param name="METRIC_TYPE">cpuType</xsl:with-param>
+					<xsl:with-param name="VALUE_TYPE">STRING</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:when test="@name='osname'">
+				<xsl:call-template name="PARAMETER_TEMPLATE">
+					<xsl:with-param name="ELEMENT">metric</xsl:with-param>
+					<xsl:with-param name="METRIC_TYPE">osName</xsl:with-param>
+					<xsl:with-param name="VALUE_TYPE">STRING</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:when test="@name='osversion'">
+				<xsl:call-template name="PARAMETER_TEMPLATE">
+					<xsl:with-param name="ELEMENT">metric</xsl:with-param>
+					<xsl:with-param name="METRIC_TYPE">osVersion</xsl:with-param>
+					<xsl:with-param name="VALUE_TYPE">STRING</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:when test="@name='freememory'">
+				<xsl:call-template name="PARAMETER_TEMPLATE">
+					<xsl:with-param name="ELEMENT">metric</xsl:with-param>
+					<xsl:with-param name="METRIC_TYPE">memoryFree</xsl:with-param>
+					<xsl:with-param name="METRIC_UNIT">MB</xsl:with-param>
+					<xsl:with-param name="VALUE_TYPE">NUMERIC</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:when test="@name='freediskspace'">
+				<xsl:call-template name="PARAMETER_TEMPLATE">
+					<xsl:with-param name="ELEMENT">metric</xsl:with-param>
+					<xsl:with-param name="METRIC_TYPE">diskFree</xsl:with-param>
+					<xsl:with-param name="METRIC_UNIT">MB</xsl:with-param>
+					<xsl:with-param name="VALUE_TYPE">NUMERIC</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:when test="@name='bandwidth'">
+				<xsl:call-template name="PARAMETER_TEMPLATE">
+					<xsl:with-param name="ELEMENT">metric</xsl:with-param>
+					<xsl:with-param name="METRIC_TYPE">bandwidth</xsl:with-param>
+					<xsl:with-param name="METRIC_UNIT">MB/sec</xsl:with-param>
+					<xsl:with-param name="VALUE_TYPE">NUMERIC</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:when test="@name='latency'">
+				<xsl:call-template name="PARAMETER_TEMPLATE">
+					<xsl:with-param name="ELEMENT">metric</xsl:with-param>
+					<xsl:with-param name="METRIC_TYPE">latency</xsl:with-param>
+					<xsl:with-param name="METRIC_UNIT">sec</xsl:with-param>
+					<xsl:with-param name="VALUE_TYPE">NUMERIC</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+		</xsl:choose>		
+	</xsl:template>
+<!-- =====================================================  ====================================================== -->
+	<xsl:template name="PARAMETER_TEMPLATE">
+		<xsl:param name="ELEMENT"/>
+		<xsl:param name="METRIC_TYPE" select="FALSE"/>
+		<xsl:param name="METRIC_UNIT" select="FALSE"/>
+		<xsl:param name="VALUE_TYPE"/>
+
+		<xsl:element name="{$ELEMENT}">
+			<xsl:if test="$METRIC_UNIT">
+				<xsl:attribute name="unit">
+					<xsl:value-of select="$METRIC_UNIT"/>
+				</xsl:attribute>
+			</xsl:if>
+			<xsl:if test="$METRIC_TYPE">
+				<xsl:attribute name="type" namespace="http://www.w3.org/2001/XMLSchema-instance">
+					<xsl:value-of select="$METRIC_TYPE"/>
+				</xsl:attribute>
+			</xsl:if>
+		
+			<xsl:apply-templates select="paramValue[1]" mode="PARAMETER_VALUE_MODE">
+				<xsl:with-param name="VALUE_TYPE">
+					<xsl:value-of select="$VALUE_TYPE"/>
+				</xsl:with-param>
+			</xsl:apply-templates>
+		</xsl:element>
+		
+	</xsl:template>
+<!-- =====================================================  ====================================================== -->
+	<xsl:template match="paramValue" mode="PARAMETER_VALUE_MODE">
+		<xsl:param name="VALUE_TYPE"/>
+		
+		<xsl:choose>
+			<xsl:when test="$VALUE_TYPE='NUMERIC'">
+				<xsl:element name="rangeValue">
+					<xsl:element name="value">
+						<xsl:value-of select="."/>
+					</xsl:element>
+					<xsl:element name="min">
+						<xsl:value-of select="."/>
+					</xsl:element>
+					<xsl:element name="max">
+						<xsl:value-of select="."/>
+					</xsl:element>
+				</xsl:element>
+			</xsl:when>
+			<xsl:when test="$VALUE_TYPE='STRING'">
+				<xsl:element name="value">
+					<xsl:value-of select="."/>
+				</xsl:element>
+			</xsl:when>
+		</xsl:choose>
+	</xsl:template>
+<!-- =====================================================  ====================================================== -->
+	<xsl:template match="computingResource" mode="RESOURCE_MODE">
+		<xsl:variable name="ID" select="additionalProperties/property[@name=$RES_IDENTIFIER]"/>
+		
+		<xsl:element name="compResource">
+			<xsl:attribute name="id">
+				<xsl:value-of select="$ID"/>
+			</xsl:attribute>
+			<xsl:attribute name="templateIdRef">
+				<xsl:value-of select="$ID"/>
+			</xsl:attribute>
+			<xsl:attribute name="isGateway">
+				<xsl:value-of select="additionalProperties/property[@name=$GATEWAY]"/>
+			</xsl:attribute>
+			<xsl:apply-templates select="machineParameters/hostParameter[@name='hostname']" mode="SPECIFIC_PARAMETER_MODE">
+				<xsl:with-param name="METRIC_TYPE">hostName</xsl:with-param>
+			</xsl:apply-templates>
+		</xsl:element>
+	</xsl:template>
+<!-- =====================================================  ====================================================== -->
+	<xsl:template match="*" mode="SPECIFIC_PARAMETER_MODE">
+		<xsl:param name="METRIC_TYPE"/>
+		
+			<xsl:call-template name="PARAMETER_TEMPLATE">
+					<xsl:with-param name="ELEMENT">resourceSpecificMetric</xsl:with-param>
+					<xsl:with-param name="METRIC_TYPE">
+						<xsl:value-of select="$METRIC_TYPE"/>
+					</xsl:with-param>
+					<xsl:with-param name="VALUE_TYPE">STRING</xsl:with-param>
+			</xsl:call-template>
+	</xsl:template>
+<!-- =====================================================  ====================================================== -->
+	<xsl:template match="resourcesGroup" mode="TEMPLATE_MODE">
+		<xsl:element name="netResourceTemplate">
+			<xsl:attribute name="id">
+				<xsl:value-of select="@groupId"/>
+			</xsl:attribute>
+			<xsl:apply-templates select="networkParamsInsideGroup/*" mode="PARAMETER_MODE"/>
+		</xsl:element>
+	</xsl:template>
+<!-- =====================================================  ====================================================== -->
+	<xsl:template match="resourcesGroup" mode="RESOURCE_MODE">
+		<xsl:element name="netResource">
+			<xsl:attribute name="id">
+				<xsl:value-of select="@groupId"/>
+			</xsl:attribute>
+			<xsl:attribute name="templateIdRef">
+				<xsl:value-of select="@groupId"/>
+			</xsl:attribute>
+		</xsl:element>
+	</xsl:template>	
+<!-- =====================================================  ====================================================== -->
+	<xsl:template match="resourcesGroup" mode="GROUP_MODE">
+		<xsl:element name="resourcesCommunicationGroup">
+			<xsl:attribute name="providerAdIdRef">
+				<xsl:value-of select="additionalProperties/property[@name=$AD_IDENTIFIER]"/>
+			</xsl:attribute>		
+			<xsl:attribute name="netResourceIdRef">
+				<xsl:value-of select="@groupId"/>
+			</xsl:attribute>
+			<xsl:attribute name="groupId">
+				<xsl:value-of select="additionalProperties/property[@name=$GROUP_IDENTIFIER]"/>
+			</xsl:attribute>
+			<xsl:attribute name="isGateway">
+				<xsl:value-of select="additionalProperties/property[@name=$GATEWAY]"/>
+			</xsl:attribute>
+			<xsl:for-each select="resources/computingResourceIdRef">
+				<xsl:element name="resourceIdRef">
+					<xsl:value-of select="."/>
+				</xsl:element>
+			</xsl:for-each>
+		</xsl:element>
+	</xsl:template>	
+<!-- =====================================================  ====================================================== -->
+	<xsl:template match="computingResource" mode="AVAILABILITY_MODE">
+		<xsl:if test="availability or machineParameters/../availability">
+			<xsl:element name="resourceAvailability">
+				<xsl:attribute name="resourceIdRef">
+					<xsl:value-of select="additionalProperties/property[@name=$RES_IDENTIFIER]"/>
+				</xsl:attribute>
+				
+				<xsl:apply-templates select="availability/timeSlot" mode="RESOURCE_AVAILABILITY_MODE"/>
+				
+				<xsl:apply-templates select="machineParameters/hostParameter/availability/timeSlot" mode="PARAMETER_AVAILABILITY_MODE"/>
+				
+			</xsl:element>
+		</xsl:if>
+	</xsl:template>
+<!-- =====================================================  ====================================================== -->	
+	<xsl:template match="timeSlot" mode="RESOURCE_AVAILABILITY_MODE">
+		<xsl:element name="resourceState">
+			<xsl:element name="resourceState">
+				<xsl:value-of select="@state"/>
+			</xsl:element>
+			<xsl:element name="timeInterval">
+				<xsl:apply-templates select="."/>
+			</xsl:element>
+		</xsl:element>
+	</xsl:template>
+<!-- =====================================================  ====================================================== -->	
+	<xsl:template match="timeSlot" mode="PARAMETER_AVAILABILITY_MODE">
+		<xsl:element name="resourceState">
+			<xsl:element name="timeInterval">
+				<xsl:apply-templates select="."/>
+			</xsl:element>
+			<xsl:element name="metricAvailability">
+				<xsl:apply-templates select="../.." mode="PARAMETER_MODE"/>
+				<xsl:element name="state">
+					<xsl:value-of select="@state"/>
+				</xsl:element>
+			</xsl:element>
+		</xsl:element>
+	</xsl:template>
+<!-- =====================================================  ====================================================== -->	
+	<xsl:template name="GRID_LEVEL_TEMPLATE">
+		<xsl:variable name="GROUP2GROUP" select="topology/resourcesGroup/networkParamsToGroup"/>
+		<xsl:if test="$GROUP2GROUP">
+			<xsl:element name="intraADInfo">
+				<xsl:attribute name="adId"><xsl:value-of select="$GRID_DOMAIN_IDENTIFIER"/></xsl:attribute>
+				<xsl:apply-templates select="$GROUP2GROUP" mode="GRID_DOMAIN_TEMPLATE_MODE"/>	
+				<xsl:apply-templates select="$GROUP2GROUP" mode="GRID_DOMAIN_RESOURCE_MODE"/>	
+			</xsl:element>
+			
+			<xsl:element name="interADInfo">
+				<xsl:attribute name="isSymmetric">
+					<xsl:value-of select="topology/resourcesGroup/networkParamsToGroup[1]/@isSymmetric"/>
+				</xsl:attribute>
+				<xsl:apply-templates select="$GROUP2GROUP" mode="GRID_LINKS_MODE"/>
+			</xsl:element>		
+		</xsl:if>
+	</xsl:template>
+<!-- =====================================================  ====================================================== -->	
+	<xsl:template match="networkParamsToGroup" mode="GRID_DOMAIN_TEMPLATE_MODE">
+		<xsl:element name="netResourceTemplate">
+			<xsl:attribute name="id">
+				<xsl:value-of select="../@groupId"/>-<xsl:value-of select="@groupId"/>-<xsl:value-of select="generate-id()"/>
+			</xsl:attribute>
+			<xsl:apply-templates  mode="PARAMETER_MODE"/>
+		</xsl:element>
+	</xsl:template>
+<!-- =====================================================  ====================================================== -->	
+	<xsl:template match="networkParamsToGroup" mode="GRID_DOMAIN_RESOURCE_MODE">
+		<xsl:element name="netResource">
+			<xsl:attribute name="id">
+				<xsl:value-of select="../@groupId"/>-<xsl:value-of select="@groupId"/>-<xsl:value-of select="generate-id()"/>
+			</xsl:attribute>
+			<xsl:attribute name="templateIdRef">
+				<xsl:value-of select="../@groupId"/>-<xsl:value-of select="@groupId"/>-<xsl:value-of select="generate-id()"/>
+			</xsl:attribute>			
+		</xsl:element>
+	</xsl:template>
+<!-- =====================================================  ====================================================== -->	
+	<xsl:template match="networkParamsToGroup" mode="GRID_LINKS_MODE">
+		<xsl:element name="link">
+			<xsl:attribute name="adIdRef">
+				<xsl:value-of select="$GRID_DOMAIN_IDENTIFIER"/>
+			</xsl:attribute>
+			<xsl:attribute name="fromAdId">
+				<xsl:value-of select="../additionalProperties/property[@name=$AD_IDENTIFIER]"/>
+			</xsl:attribute>			
+			<xsl:attribute name="fromGroupId">
+				<xsl:value-of select="../additionalProperties/property[@name=$GROUP_IDENTIFIER]"/>
+			</xsl:attribute>			
+			<xsl:attribute name="toAdId">
+				<xsl:value-of select="additionalProperties/property[@name=$AD_IDENTIFIER]"/>
+			</xsl:attribute>			
+			<xsl:attribute name="toGroupId">
+				<xsl:value-of select="additionalProperties/property[@name=$GROUP_IDENTIFIER]"/>
+			</xsl:attribute>			
+			<xsl:attribute name="netResourceIdRef">
+				<xsl:value-of select="../@groupId"/>-<xsl:value-of select="@groupId"/>-<xsl:value-of select="generate-id()"/>
+			</xsl:attribute>			
+		</xsl:element>
+	</xsl:template>
+<!-- =====================================================  ====================================================== -->	
+
+<!-- =====================================================  ====================================================== -->	
+<!-- =====================================================  ====================================================== -->	
+	<xsl:template match="*">
+		!!! missing support for <xsl:value-of select="name()"/> !!!
+	</xsl:template>
+<!-- =====================================================  ====================================================== -->	
+</xsl:transform>
Index: DCWoRMS/trunk/simulator/xslt/rtg2host_params.xslt
===================================================================
--- DCWoRMS/trunk/simulator/xslt/rtg2host_params.xslt	(revision 477)
+++ DCWoRMS/trunk/simulator/xslt/rtg2host_params.xslt	(revision 477)
@@ -0,0 +1,388 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+TO_DO:
+-->
+
+
+<xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+			     xmlns:rtg="http://www.QosCosGrid.org/resourceDescription"
+			     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+                             
+	<xsl:strip-space elements="*"/>
+	
+	<xsl:output method="xml" version="1.0" encoding="UTF-8" omit-xml-declaration="yes" indent="yes"/>
+	
+<!-- =====================================================  ====================================================== -->	
+	<xsl:variable name="AD_IDENTIFIER">AD_ID</xsl:variable>
+	<xsl:variable name="RES_IDENTIFIER">RES_ID</xsl:variable>
+	<xsl:variable name="GROUP_IDENTIFIER">GROUP_ID</xsl:variable>
+	<xsl:variable name="GATEWAY">GATEWAY</xsl:variable>
+<!-- =====================================================  ====================================================== -->
+	<xsl:template match="/">
+		<xsl:apply-templates select="/rtg:rtg"/>
+	</xsl:template>	
+<!-- =====================================================  ====================================================== -->
+	<xsl:template match="rtg:rtg">
+		<xsl:element name="hostParameters">
+		
+			<xsl:if test="rtg:context/rtg:defaultTimeInterval">
+				<xsl:element name="validity">
+					<xsl:call-template name="TIME_STATUS_TEMPLATE">
+						<xsl:with-param name="TIME_INTERVAL" select="rtg:context/rtg:defaultTimeInterval"/>
+					</xsl:call-template>
+				</xsl:element>
+			</xsl:if>
+		
+			<xsl:if test="rtg:intraADInfo/rtg:compResource">
+				<xsl:element name="resources">
+					<xsl:apply-templates select="rtg:intraADInfo/rtg:compResource"/>
+				</xsl:element>
+			</xsl:if>
+			
+			<xsl:if test="rtg:intraADInfo/rtg:resourcesCommunicationGroup">
+				<xsl:element name="topology">
+					<xsl:apply-templates select="rtg:intraADInfo/rtg:resourcesCommunicationGroup"/>
+				</xsl:element>
+			</xsl:if>
+		</xsl:element>	 
+	</xsl:template>	
+<!-- =====================================================  ====================================================== -->
+	<xsl:template match="rtg:compResource">
+		<xsl:element name="computingResource">
+			<xsl:attribute name="resourceId">
+				<xsl:call-template name="IDENTIFIER_TEMPLATE">
+					<xsl:with-param name="AD_ID" select="../@adId"/>
+					<xsl:with-param name="ID" select="@id"/>
+				</xsl:call-template>	
+			</xsl:attribute>
+			
+			<xsl:element name="machineParameters">
+				<xsl:apply-templates select="rtg:resourceSpecificMetric" mode="METRIC_MODE"/>
+				
+				<xsl:variable name="TEMPLATE_ID" select="@templateIdRef"/>				
+ 				<xsl:apply-templates select="../rtg:compResourceTemplate[@id=$TEMPLATE_ID]/rtg:metric" mode="METRIC_MODE">
+ 					<xsl:with-param name="RES_ID">
+ 						<xsl:value-of select="@id"/>
+ 					</xsl:with-param>
+ 				</xsl:apply-templates>
+			</xsl:element>
+
+			<xsl:variable name="RES_ID" select="@id"/>			
+			
+			<xsl:if test="../rtg:resourceAvailability[@resourceIdRef=$RES_ID]/rtg:resourceState[rtg:resourceState]">
+			    <xsl:element name="availability">
+				<xsl:apply-templates select="../rtg:resourceAvailability[@resourceIdRef=$RES_ID]/rtg:resourceState[rtg:resourceState]"/>
+			    </xsl:element>
+			</xsl:if>
+			
+			<xsl:element name="additionalProperties">
+				<xsl:element name="property">
+					<xsl:attribute name="name">
+						<xsl:value-of select="$AD_IDENTIFIER"/>
+					</xsl:attribute>
+					<xsl:value-of select="../@adId"/>
+				</xsl:element>
+				
+				<xsl:element name="property">
+					<xsl:attribute name="name">
+						<xsl:value-of select="$RES_IDENTIFIER"/>
+					</xsl:attribute>
+					<xsl:value-of select="@id"/>
+				</xsl:element>
+				
+				<xsl:element name="property">
+					<xsl:attribute name="name">
+						<xsl:value-of select="$GATEWAY"/>
+					</xsl:attribute>
+					<xsl:value-of select="@isGateway"/>
+				</xsl:element>	
+			</xsl:element>
+
+		</xsl:element>
+	</xsl:template>
+<!-- =====================================================  ====================================================== -->
+	<xsl:template match="*" mode="METRIC_MODE">
+		<xsl:param name="RES_ID"/>
+
+		<xsl:choose>
+			<xsl:when test="@xsi:type='cpuCount'">
+				<xsl:call-template name="PARAMETER_TEMPLATE">
+					<xsl:with-param name="TYPE">hostParameter</xsl:with-param>
+					<xsl:with-param name="NAME">cpucount</xsl:with-param>
+					<xsl:with-param name="RES_ID"><xsl:value-of select="$RES_ID"/></xsl:with-param>
+					<xsl:with-param name="METRIC">cpuCount</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:when test="@xsi:type='cpuSpeed'">
+				<xsl:call-template name="PARAMETER_TEMPLATE">
+					<xsl:with-param name="TYPE">hostParameter</xsl:with-param>
+					<xsl:with-param name="NAME">cpuspeed</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:when test="@xsi:type='memoryTotal'">
+				<xsl:call-template name="PARAMETER_TEMPLATE">
+					<xsl:with-param name="TYPE">hostParameter</xsl:with-param>
+					<xsl:with-param name="NAME">memory</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:when test="@xsi:type='diskTotal'">
+				<xsl:call-template name="PARAMETER_TEMPLATE">
+					<xsl:with-param name="TYPE">hostParameter</xsl:with-param>
+					<xsl:with-param name="NAME">diskspace</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:when test="@xsi:type='swapTotal'">
+				<xsl:call-template name="PARAMETER_TEMPLATE">
+					<xsl:with-param name="TYPE">otherParameter</xsl:with-param>
+					<xsl:with-param name="NAME">swap</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>			
+			
+			<xsl:when test="@xsi:type='cpuType'">
+				<xsl:call-template name="PARAMETER_TEMPLATE">
+					<xsl:with-param name="TYPE">hostParameter</xsl:with-param>
+					<xsl:with-param name="NAME">cpuarch</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>			
+			<xsl:when test="@xsi:type='osName'">
+				<xsl:call-template name="PARAMETER_TEMPLATE">
+					<xsl:with-param name="TYPE">hostParameter</xsl:with-param>
+					<xsl:with-param name="NAME">osname</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>			
+			<xsl:when test="@xsi:type='osVersion'">
+				<xsl:call-template name="PARAMETER_TEMPLATE">
+					<xsl:with-param name="TYPE">hostParameter</xsl:with-param>
+					<xsl:with-param name="NAME">osversion</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>			
+			<xsl:when test="@xsi:type='hostName'">
+				<xsl:call-template name="PARAMETER_TEMPLATE">
+					<xsl:with-param name="TYPE">hostParameter</xsl:with-param>
+					<xsl:with-param name="NAME">hostname</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>			
+			<xsl:when test="@xsi:type='ip'">
+				<xsl:call-template name="PARAMETER_TEMPLATE">
+					<xsl:with-param name="TYPE">otherParameter</xsl:with-param>
+					<xsl:with-param name="NAME">ip</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>			
+
+			<xsl:when test="@xsi:type='bandwidth'">
+				<xsl:call-template name="PARAMETER_TEMPLATE">
+					<xsl:with-param name="TYPE">networkParameter</xsl:with-param>
+					<xsl:with-param name="NAME">bandwidth</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>			
+			<xsl:when test="@xsi:type='latency'">
+				<xsl:call-template name="PARAMETER_TEMPLATE">
+					<xsl:with-param name="TYPE">networkParameter</xsl:with-param>
+					<xsl:with-param name="NAME">latency</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>			
+						
+			<xsl:otherwise>
+				<xsl:call-template name="PARAMETER_TEMPLATE">
+					<xsl:with-param name="TYPE">otherParameter</xsl:with-param>
+					<xsl:with-param name="NAME"><xsl:value-of select="@xsi:type"/></xsl:with-param>
+				</xsl:call-template>
+			</xsl:otherwise>
+			
+		</xsl:choose>			
+	</xsl:template>
+<!-- =====================================================  ====================================================== -->
+	<xsl:template name="PARAMETER_TEMPLATE">
+		<xsl:param name="TYPE"/>
+		<xsl:param name="NAME"/>
+		<xsl:param name="RES_ID" select="FALSE"/>
+		<xsl:param name="METRIC" select="FALSE"/>
+		
+		<xsl:element name="{$TYPE}">
+			<xsl:attribute name="name">
+				<xsl:value-of select="$NAME"/>
+			</xsl:attribute>
+	
+			<xsl:apply-templates mode="PARAMETER_VALUE_MODE"/>
+			
+			<xsl:if test="$RES_ID">
+				<xsl:apply-templates select="../../rtg:resourceAvailability[@resourceIdRef=$RES_ID]/rtg:resourceState/rtg:metricAvailability[rtg:metric/@xsi:type=$METRIC]"/>
+			</xsl:if>
+						
+		</xsl:element>
+	</xsl:template>
+<!-- =====================================================  ====================================================== -->
+	<xsl:template match="rtg:rangeValue" mode="PARAMETER_VALUE_MODE">
+		<xsl:element name="paramValue">
+			<xsl:value-of select="rtg:value"/>
+		</xsl:element>
+	</xsl:template>
+<!-- =====================================================  ====================================================== -->
+	<xsl:template match="rtg:value" mode="PARAMETER_VALUE_MODE">
+		<xsl:element name="paramValue">
+			<xsl:value-of select="."/>
+		</xsl:element>
+	</xsl:template>
+<!-- =====================================================  ====================================================== -->
+	<xsl:template match="rtg:resourceState">
+		<xsl:call-template name="TIME_STATUS_TEMPLATE">
+			<xsl:with-param name="STATUS" select="rtg:resourceState"/>
+			<xsl:with-param name="TIME_INTERVAL" select="rtg:timeInterval"/>
+		</xsl:call-template>
+	</xsl:template>
+<!-- =====================================================  ====================================================== -->
+	<xsl:template name="TIME_STATUS_TEMPLATE">
+		<xsl:param name="STATUS" select="FALSE"/>
+		<xsl:param name="TIME_INTERVAL"/>
+		
+		<xsl:if test="$TIME_INTERVAL">
+			<xsl:element name="timeSlot">
+				<xsl:if test="$STATUS">
+					<xsl:attribute name="state">
+						<xsl:value-of select="$STATUS"/>
+					</xsl:attribute>
+				</xsl:if>
+				<xsl:apply-templates select="$TIME_INTERVAL" mode="TIME_INTERVAL_MODE"/>
+			</xsl:element>
+		</xsl:if>
+	</xsl:template>
+<!-- =====================================================  ====================================================== -->
+	<xsl:template match="*" mode="TIME_INTERVAL_MODE">
+		<xsl:element name="slotStart">
+			<xsl:value-of select="rtg:lowerBoundedRange"/>
+		</xsl:element>
+		<xsl:choose>
+			<xsl:when test="rtg:upperBoundedRange">
+				<xsl:element name="slotEnd">
+					<xsl:value-of select="rtg:upperBoundedRange"/>
+				</xsl:element>
+			</xsl:when>
+			<xsl:when test="rtg:duration">
+				<xsl:element name="slotDuration">
+					<xsl:value-of select="rtg:duration"/>
+				</xsl:element>
+			</xsl:when>
+		</xsl:choose>
+	</xsl:template>
+<!-- =====================================================  ====================================================== -->
+	<xsl:template match="rtg:metricAvailability">
+		<xsl:element name="availability">
+			<xsl:call-template name="TIME_STATUS_TEMPLATE">
+				<xsl:with-param name="STATUS" select="rtg:state"/>
+				<xsl:with-param name="TIME_INTERVAL" select="../rtg:timeInterval"/>
+			</xsl:call-template>
+		</xsl:element>
+	</xsl:template>	
+<!-- =====================================================  ====================================================== -->
+<!-- =====================================================  ====================================================== -->
+	<xsl:template match="rtg:resourcesCommunicationGroup">
+		<xsl:element name="resourcesGroup">
+			<xsl:attribute name="groupId">
+				<xsl:call-template name="IDENTIFIER_TEMPLATE">
+					<xsl:with-param name="AD_ID" select="../@adId"/>
+					<xsl:with-param name="ID" select="@groupId"/>
+				</xsl:call-template>
+			</xsl:attribute>
+			
+			<xsl:element name="resources">
+				<xsl:apply-templates select="rtg:resourceIdRef">
+				</xsl:apply-templates>
+			</xsl:element>
+			
+			<xsl:element name="networkParamsInsideGroup">
+				<xsl:variable name="NET_ID" select="@netResourceIdRef"/>
+				<xsl:apply-templates select="../rtg:netResource[@id=$NET_ID]"/>
+			</xsl:element>
+			
+			<xsl:variable name="AD_ID" select="../@adId"/>
+			<xsl:variable name="GROUP_ID" select="@groupId"/>
+			<xsl:apply-templates select="/rtg:rtg/rtg:interADInfo/rtg:link[@fromAdId=$AD_ID and @fromGroupId=$GROUP_ID]"/>
+			
+			<xsl:element name="additionalProperties">
+				<xsl:element name="property">
+					<xsl:attribute name="name">
+						<xsl:value-of select="$AD_IDENTIFIER"/>
+					</xsl:attribute>
+					<xsl:value-of select="$AD_ID"/>
+				</xsl:element>
+				<xsl:element name="property">
+					<xsl:attribute name="name">
+						<xsl:value-of select="$GROUP_IDENTIFIER"/>
+					</xsl:attribute>
+					<xsl:value-of select="$GROUP_ID"/>
+				</xsl:element>
+				<xsl:element name="property">
+					<xsl:attribute name="name">
+						<xsl:value-of select="$GATEWAY"/>
+					</xsl:attribute>
+					<xsl:value-of select="@isGateway"/>
+				</xsl:element>
+
+
+			</xsl:element>
+			
+		</xsl:element>
+	</xsl:template>
+<!-- =====================================================  ====================================================== -->
+	<xsl:template match="rtg:resourceIdRef">
+		
+		<xsl:element name="computingResourceIdRef">
+			<xsl:value-of select="."/>
+		</xsl:element>
+	</xsl:template>
+<!-- =====================================================  ====================================================== -->
+	<xsl:template match="rtg:netResource">
+		<xsl:variable name="TEMPLATE_ID" select="@templateIdRef"/>
+		<xsl:apply-templates select="../rtg:netResourceTemplate[@id=$TEMPLATE_ID]/rtg:metric" mode="METRIC_MODE"/>
+	</xsl:template>
+<!-- =====================================================  ====================================================== -->
+	<xsl:template match="rtg:link">
+		<xsl:element name="networkParamsToGroup">
+			<xsl:attribute name="groupId">
+				<xsl:call-template name="IDENTIFIER_TEMPLATE">
+					<xsl:with-param name="AD_ID" select="@toAdId"/>
+					<xsl:with-param name="ID" select="@toGroupId"/>
+				</xsl:call-template>
+			</xsl:attribute>
+			<xsl:attribute name="isSymmetric">
+				<xsl:value-of select="../@isSymmetric"/>
+			</xsl:attribute>
+			
+			<xsl:variable name="NET_AD_ID" select="@adIdRef"/>
+			<xsl:variable name="NET_ID" select="@netResourceIdRef"/>
+			<xsl:apply-templates select="/rtg:rtg/rtg:intraADInfo[@adId=$NET_AD_ID]/rtg:netResource[@id=$NET_ID]"/>
+			
+			<xsl:element name="additionalProperties">
+				<xsl:element name="property">
+					<xsl:attribute name="name">
+						<xsl:value-of select="$AD_IDENTIFIER"/>
+					</xsl:attribute>
+					<xsl:value-of select="@toAdId"/>
+				</xsl:element>
+				<xsl:element name="property">
+					<xsl:attribute name="name">
+						<xsl:value-of select="$GROUP_IDENTIFIER"/>
+					</xsl:attribute>
+					<xsl:value-of select="@toGroupId"/>
+				</xsl:element>
+			</xsl:element>
+			
+		</xsl:element>
+	</xsl:template>
+<!-- =====================================================  ====================================================== -->
+<!-- =====================================================  ====================================================== -->
+	<xsl:template name="IDENTIFIER_TEMPLATE">
+		<xsl:param name="AD_ID"/>
+		<xsl:param name="ID"/>
+		
+		<xsl:value-of select="$AD_ID"/>
+		<xsl:value-of select="'-'"/>
+		<xsl:value-of select="$ID"/>
+	</xsl:template>
+<!-- =====================================================  ====================================================== -->
+	<xsl:template match="*">
+		BRAK OBSLUGI DLA = <xsl:value-of select="name()"/>
+	</xsl:template>
+<!-- =====================================================  ====================================================== -->
+</xsl:transform>
Index: DCWoRMS/trunk/simulator/xslt/extract_job_id.xslt
===================================================================
--- DCWoRMS/trunk/simulator/xslt/extract_job_id.xslt	(revision 477)
+++ DCWoRMS/trunk/simulator/xslt/extract_job_id.xslt	(revision 477)
@@ -0,0 +1,10 @@
+<xsl:transform version="1.0" 
+				xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+	
+	<xsl:output method="xml" version="1.0" encoding="UTF-8" omit-xml-declaration="yes" indent="yes"/>
+
+	<xsl:template match="/">
+ 		<xsl:value-of select="qcgJob/@appId"/>
+	</xsl:template>
+		
+</xsl:transform>
Index: DCWoRMS/trunk/simulator/xslt/resreq2rtg.xslt
===================================================================
--- DCWoRMS/trunk/simulator/xslt/resreq2rtg.xslt	(revision 477)
+++ DCWoRMS/trunk/simulator/xslt/resreq2rtg.xslt	(revision 477)
@@ -0,0 +1,662 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- 
+LIMITATIONS:
+- zaklada sie ze nie mozna definiowac licznosci grupy procesow dla konkretnych wymagan zasobowych. brak odpowiednika w RTG
+-->
+
+<xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+							 xmlns:xalan="http://xml.apache.org/xalan"
+							 extension-element-prefixes="xalan">
+                             
+	<xsl:strip-space elements="*"/>
+	
+	<xsl:output method="xml" version="1.0" encoding="UTF-8" omit-xml-declaration="yes" indent="yes"/>
+		
+	<xsl:variable name="GRID_AD">Grid</xsl:variable>
+	<xsl:variable name="EMPTY_TEMPLATE_ID">EMPTY</xsl:variable>
+
+<!-- ========================   ========================= -->
+<!-- =====================================================  ====================================================== -->
+	<xsl:template match="/">
+		<xsl:element name="rtg">
+			<xsl:call-template name="CONTEXT_TEMPLATE"/>
+			<xsl:call-template name="INTRA_AD_INFO_TEMPLATE"/>
+			<xsl:call-template name="TASK_MAPPINGS_TEMPLATE"/> 
+		</xsl:element>	 
+	</xsl:template>	
+<!-- =====================================================  ====================================================== -->
+<!-- =====================================================  ====================================================== -->
+	<xsl:template name="CONTEXT_TEMPLATE">
+		<xsl:element name="context">
+			<xsl:attribute name="rtgType">ResourceRequirementsRtg</xsl:attribute>
+			<xsl:attribute name="isComplete">true</xsl:attribute>
+
+			<xsl:element name="providerAdId">
+				<xsl:value-of select="$GRID_AD"/>
+			</xsl:element>
+		</xsl:element>			
+	</xsl:template>
+<!-- =====================================================  ====================================================== -->
+<!-- =====================================================  ====================================================== -->
+	<xsl:template name="INTRA_AD_INFO_TEMPLATE">
+		<xsl:element name="intraADInfo">
+			<xsl:attribute name="adId">
+				<xsl:value-of select="$GRID_AD"/>
+			</xsl:attribute>
+			
+			<xsl:variable name="COMP_RES_VARIABLE" select="//resourceRequirements/computingResource"/>
+			<xsl:variable name="NET_RES_VARIABLE" select="//processesConnection/networkResource[1] | //groupConnection/networkResource[1]"/>
+			
+			<!-- needed for resources having no others requirements then hostname -->
+			<xsl:call-template name="EMPTY_RES_TEMPLATE"/>
+			
+			<xsl:apply-templates select="$COMP_RES_VARIABLE" mode="TEMPLATE_MODE">
+				<xsl:with-param name="TEMPLATE_TYPE">compResourceTemplate</xsl:with-param>
+			</xsl:apply-templates>
+			
+			<xsl:apply-templates select="$NET_RES_VARIABLE" mode="TEMPLATE_MODE">
+				<xsl:with-param name="TEMPLATE_TYPE">netResourceTemplate</xsl:with-param>
+			</xsl:apply-templates>
+
+			<xsl:apply-templates select="/resourceRequirements/task" mode="RESOURCE_MODE"/>
+			
+			<xsl:apply-templates select="$NET_RES_VARIABLE" mode="RESOURCE_MODE"/>
+						
+		</xsl:element>
+	</xsl:template>
+<!-- =====================================================  ====================================================== -->
+	<xsl:template name="EMPTY_RES_TEMPLATE">
+		<xsl:element name="compResourceTemplate">
+			<xsl:attribute name="id">
+				<xsl:value-of select="$EMPTY_TEMPLATE_ID"/>
+			</xsl:attribute>
+		</xsl:element>
+	</xsl:template>
+<!-- =====================================================  ====================================================== -->
+	<xsl:template match="*" mode="TEMPLATE_MODE">
+		<xsl:param name="TEMPLATE_TYPE"/>
+		<xsl:element name="{$TEMPLATE_TYPE}">
+			<xsl:attribute name="id">
+				<xsl:value-of select="generate-id()"/>
+			</xsl:attribute>
+			<xsl:choose>
+				<xsl:when test="name()='computingResource'">
+					<xsl:apply-templates select="hostParameter" mode="PARAMETER_MODE"/>
+				</xsl:when>
+				<xsl:when test="name()='networkResource'">
+					<xsl:apply-templates select="networkParameter" mode="PARAMETER_MODE"/>
+				</xsl:when>
+			</xsl:choose>
+		</xsl:element>
+	</xsl:template>
+<!-- =====================================================  ====================================================== -->
+	<xsl:template match="*" mode="PARAMETER_MODE">
+		<xsl:choose>
+			<xsl:when test="@name='cpucount'">
+				<xsl:call-template name="PARAMETER_TEMPLATE">
+					<xsl:with-param name="TYPE">cpuCount</xsl:with-param>
+					<xsl:with-param name="UNIT">null</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:when test="@name='cpuspeed'">
+				<xsl:call-template name="PARAMETER_TEMPLATE">
+					<xsl:with-param name="TYPE">cpuSpeed</xsl:with-param>
+					<xsl:with-param name="UNIT">MHz</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:when test="@name='memory'">
+				<xsl:call-template name="PARAMETER_TEMPLATE">
+					<xsl:with-param name="TYPE">memoryTotal</xsl:with-param>
+					<xsl:with-param name="UNIT">MB</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:when test="@name='diskspace'">
+				<xsl:call-template name="PARAMETER_TEMPLATE">
+					<xsl:with-param name="TYPE">diskTotal</xsl:with-param>
+					<xsl:with-param name="UNIT">MB</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:when test="@name='cpuarch'">
+				<xsl:call-template name="PARAMETER_TEMPLATE">
+					<xsl:with-param name="TYPE">cpuType</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:when test="@name='osname'">
+				<xsl:call-template name="PARAMETER_TEMPLATE">
+					<xsl:with-param name="TYPE">osName</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:when test="@name='osversion'">
+				<xsl:call-template name="PARAMETER_TEMPLATE">
+					<xsl:with-param name="TYPE">osVersion</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:when test="@name='freememory'">
+				<xsl:call-template name="PARAMETER_TEMPLATE">
+					<xsl:with-param name="TYPE">memoryFree</xsl:with-param>
+					<xsl:with-param name="UNIT">MB</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:when test="@name='freediskspace'">
+				<xsl:call-template name="PARAMETER_TEMPLATE">
+					<xsl:with-param name="TYPE">diskFree</xsl:with-param>
+					<xsl:with-param name="UNIT">MB</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:when test="@name='bandwidth'">
+				<xsl:call-template name="PARAMETER_TEMPLATE">
+					<xsl:with-param name="TYPE">bandwidth</xsl:with-param>
+					<xsl:with-param name="UNIT">MB/sec</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+			<xsl:when test="@name='latency'">
+				<xsl:call-template name="PARAMETER_TEMPLATE">
+					<xsl:with-param name="TYPE">latency</xsl:with-param>
+					<xsl:with-param name="UNIT">sec</xsl:with-param>
+				</xsl:call-template>
+			</xsl:when>
+		</xsl:choose>
+	</xsl:template>
+<!-- =====================================================  ====================================================== -->
+	<xsl:template name="PARAMETER_TEMPLATE">
+		<xsl:param name="TYPE"/>
+		<xsl:param name="UNIT" select="FALSE"/>
+		
+		<xsl:element name="metric">
+			<xsl:if test="$UNIT">
+				<xsl:attribute name="unit">
+					<xsl:value-of select="$UNIT"/>
+				</xsl:attribute>
+			</xsl:if>
+			<xsl:attribute name="type" namespace="http://www.w3.org/2001/XMLSchema-instance">
+				<xsl:value-of select="$TYPE"/>
+			</xsl:attribute>
+			<xsl:apply-templates select="*" mode="PARAMETER_VALUE_MODE"/>
+		</xsl:element>
+	</xsl:template>
+<!-- =====================================================  ====================================================== -->
+	<xsl:template match="stringValue" mode="PARAMETER_VALUE_MODE">
+		<xsl:element name="value">
+			<xsl:value-of select="@value"/>
+		</xsl:element>
+	</xsl:template>
+<!-- =====================================================  ====================================================== -->
+	<xsl:template match="value" mode="PARAMETER_VALUE_MODE">
+		<xsl:element name="rangeValue">
+			<xsl:element name="value">
+				<xsl:value-of select="."/>
+			</xsl:element>
+			<xsl:element name="min">
+				<xsl:value-of select="."/>
+			</xsl:element>
+			<xsl:element name="max">
+				<xsl:value-of select="."/>
+			</xsl:element>
+		</xsl:element>
+	</xsl:template>
+<!-- =====================================================  ====================================================== -->
+	<xsl:template match="range" mode="PARAMETER_VALUE_MODE">
+		<xsl:element name="rangeValue">
+			<xsl:element name="min">
+				<xsl:value-of select="min"/>
+			</xsl:element>
+			<xsl:element name="max">
+				<xsl:value-of select="max"/>
+			</xsl:element>
+		</xsl:element>
+	</xsl:template>
+<!-- =====================================================  ====================================================== -->
+	<xsl:template match="min" mode="PARAMETER_VALUE_MODE">
+		<xsl:element name="rangeValue">
+			<xsl:element name="min">
+				<xsl:value-of select="."/>
+			</xsl:element>
+		</xsl:element>
+	</xsl:template>
+<!-- =====================================================  ====================================================== -->
+	<xsl:template match="max" mode="PARAMETER_VALUE_MODE">
+		<xsl:element name="rangeValue">
+			<xsl:element name="max">
+				<xsl:value-of select="."/>
+			</xsl:element>
+		</xsl:element>
+	</xsl:template>		
+<!-- =====================================================  ====================================================== -->
+<!-- =====================================================  ====================================================== -->
+	<xsl:template match="task" mode="RESOURCE_MODE">
+		<xsl:choose>
+			<xsl:when test="candidateHosts">
+				<xsl:variable name="RESOURCES" select=".//resourceRequirements/computingResource"/>
+				
+				<xsl:choose>
+					<xsl:when test="$RESOURCES">
+						<xsl:apply-templates select="$RESOURCES" mode="HOSTS_RESOURCE_MODE">
+							<xsl:with-param name="CANDIDATE_HOSTS" select="candidateHosts/hostName"/>
+						</xsl:apply-templates>
+					</xsl:when>
+					<xsl:otherwise>
+						<xsl:apply-templates select="candidateHosts/hostName" mode="HOSTS_RESOURCE_MODE"/>
+					</xsl:otherwise>
+				</xsl:choose>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:apply-templates select=".//resourceRequirements/computingResource | .//processes/resourceRequirements/computingResource" mode="RESOURCE_MODE"/>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>	
+<!-- =====================================================  ====================================================== -->
+	<xsl:template match="computingResource" mode="HOSTS_RESOURCE_MODE">
+		<xsl:param name="CANDIDATE_HOSTS"/>
+		<xsl:variable name="RESOURCE" select="."/>
+		
+		<xsl:for-each select="$CANDIDATE_HOSTS">
+			<xsl:apply-templates select="$RESOURCE" mode="RESOURCE_MODE">
+				<xsl:with-param name="HOST" select="."/>
+			</xsl:apply-templates>
+		</xsl:for-each>
+	</xsl:template>
+<!-- =====================================================  ====================================================== -->
+	<xsl:template match="hostName" mode="HOSTS_RESOURCE_MODE">
+		<xsl:element name="compResource">
+			<xsl:attribute name="id">
+				<xsl:value-of select="$EMPTY_TEMPLATE_ID"/>
+				<xsl:value-of select="'-'"/>
+				<xsl:value-of select="."/>
+			</xsl:attribute>
+			<xsl:attribute name="templateIdRef">
+				<xsl:value-of select="$EMPTY_TEMPLATE_ID"/>
+			</xsl:attribute>
+			<xsl:attribute name="isGateway">false</xsl:attribute>
+			<xsl:apply-templates select="." mode="RESOURCE_METRIC_MODE"/>
+		</xsl:element>
+	</xsl:template>	
+<!-- =====================================================  ====================================================== -->
+	<xsl:template match="computingResource" mode="RESOURCE_MODE">
+		<xsl:param name="HOST" select="FALSE"/>
+		<xsl:element name="compResource">
+			<xsl:attribute name="id">
+				<xsl:value-of select="generate-id()"/>
+				<xsl:if test="$HOST">
+					<xsl:value-of select="'-'"/>
+					<xsl:value-of select="$HOST"/>
+				</xsl:if>
+			</xsl:attribute>
+			<xsl:attribute name="templateIdRef">
+				<xsl:value-of select="generate-id()"/>
+			</xsl:attribute>
+			<xsl:attribute name="isGateway">false</xsl:attribute>
+			
+			<xsl:apply-templates select="$HOST" mode="RESOURCE_METRIC_MODE"/>
+		</xsl:element>
+	</xsl:template>
+<!-- =====================================================  ====================================================== -->
+	<xsl:template match="hostName" mode="RESOURCE_METRIC_MODE">
+		<xsl:element name="resourceSpecificMetric">
+			<xsl:attribute name="type" namespace="http://www.w3.org/2001/XMLSchema-instance">hostName</xsl:attribute>
+			<xsl:element name="value">
+				<xsl:value-of select="."/>
+			</xsl:element>
+		</xsl:element>
+	</xsl:template>
+<!-- =====================================================  ====================================================== -->
+	<xsl:template match="networkResource" mode="RESOURCE_MODE">
+		<xsl:element name="netResource">
+			<xsl:attribute name="id">
+				<xsl:value-of select="generate-id()"/>
+			</xsl:attribute>
+			<xsl:attribute name="templateIdRef">
+				<xsl:value-of select="generate-id()"/>
+			</xsl:attribute>
+		</xsl:element>
+	</xsl:template>
+<!-- =====================================================  ====================================================== -->
+	<xsl:template name="TASK_MAPPINGS_TEMPLATE">
+		<xsl:apply-templates select="/resourceRequirements/task" mode="MAPPINGS_MODE"/>
+	</xsl:template>
+<!-- =====================================================  ====================================================== -->
+	<xsl:template match="task" mode="MAPPINGS_MODE">
+		
+			<xsl:choose>
+				<xsl:when test="requirements/topology/processes">
+					<xsl:apply-templates select="requirements/topology">
+						<xsl:with-param name="JOB_ID">
+							<xsl:value-of select="@jobId"/>
+						</xsl:with-param>
+						<xsl:with-param name="TASK_ID">
+							<xsl:value-of select="@taskId"/>
+						</xsl:with-param>
+						<xsl:with-param name="USER_DN">
+							<xsl:value-of select="@userDN"/>
+						</xsl:with-param>
+						<xsl:with-param name="SUBMISSION_TIME">
+							<xsl:value-of select="@submissionTime"/>
+						</xsl:with-param>
+					</xsl:apply-templates>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:call-template name="MAPPED_TO_TEMPLATE">
+						<xsl:with-param name="REQUIREMENTS" select="requirements/resourceRequirements/computingResource"/>
+						<xsl:with-param name="HOSTS" select="candidateHosts/hostName"/>
+					</xsl:call-template>
+				</xsl:otherwise>
+			</xsl:choose>						
+		
+	</xsl:template>
+<!-- =====================================================  ====================================================== -->	
+	<xsl:template name="MAPPED_TO_TEMPLATE">
+		<xsl:param name="REQUIREMENTS" select="FALSE"/>
+		<xsl:param name="HOSTS" select="FALSE"/>
+		
+		<xsl:element name="taskMapping">
+			<xsl:attribute name="consumerAdId">
+				<xsl:value-of select="$GRID_AD"/>
+			</xsl:attribute>
+			<xsl:attribute name="jobId">
+				<xsl:value-of select="@jobId"/>
+			</xsl:attribute>
+			<xsl:attribute name="taskId">
+				<xsl:value-of select="@taskId"/>
+			</xsl:attribute>
+			<xsl:attribute name="userId">
+				<xsl:value-of select="@userDN"/>
+			</xsl:attribute>
+			<xsl:attribute name="submissionTime">
+				<xsl:value-of select="@submissionTime"/>
+			</xsl:attribute>
+			<xsl:attribute name="allocationStatus">Requested</xsl:attribute>
+			
+			<xsl:apply-templates select="executionTime"/>
+			
+			<xsl:choose>
+				<xsl:when test="$REQUIREMENTS and $HOSTS">
+					<xsl:for-each select="$HOSTS">
+						<xsl:apply-templates select="$REQUIREMENTS" mode="MAPPED_TO_MODE">
+							<xsl:with-param name="HOST" select="."/>
+						</xsl:apply-templates>
+					</xsl:for-each>
+				</xsl:when>
+				<xsl:when test="$REQUIREMENTS and not($HOSTS)">
+					<xsl:apply-templates select="$REQUIREMENTS" mode="MAPPED_TO_MODE"/>
+				</xsl:when>
+				<xsl:when test="not($REQUIREMENTS) and $HOSTS">
+					<xsl:apply-templates select="$HOSTS" mode="MAPPED_TO_MODE"/>
+				</xsl:when>
+				<xsl:when test="not($REQUIREMENTS) and not($HOSTS)">
+					<xsl:call-template name="EMPTY_MAPPED_TO_TEMPLATE"/>
+				</xsl:when>
+			</xsl:choose>
+		</xsl:element>
+	</xsl:template>
+<!-- =====================================================  ====================================================== -->
+	<xsl:template name="EMPTY_MAPPED_TO_TEMPLATE">
+	</xsl:template>	
+<!-- =====================================================  ====================================================== -->
+	<xsl:template match="computingResource" mode="MAPPED_TO_MODE">
+		<xsl:param name="HOST" select="FALSE"/>
+
+		<xsl:element name="mappedTo">
+			<xsl:attribute name="providerAdIdRef">
+				<xsl:value-of select="$GRID_AD"/>
+			</xsl:attribute>
+			<xsl:attribute name="providerResourceIdRef">
+				<xsl:value-of select="generate-id()"/>
+				<xsl:if test="$HOST">
+					<xsl:value-of select="'-'"/>
+					<xsl:value-of select="$HOST"/>
+				</xsl:if>
+			</xsl:attribute>
+			<xsl:attribute name="isCandidateHost">
+				<xsl:choose>
+					<xsl:when test="$HOST">true</xsl:when>
+					<xsl:otherwise>false</xsl:otherwise>
+				</xsl:choose>
+			</xsl:attribute>
+			<xsl:attribute name="isRequirement">true</xsl:attribute>
+		</xsl:element>
+	</xsl:template>
+<!-- =====================================================  ====================================================== -->	
+	<xsl:template match="hostName" mode="MAPPED_TO_MODE">
+
+		<xsl:element name="mappedTo">
+			<xsl:attribute name="providerAdIdRef">
+				<xsl:value-of select="$GRID_AD"/>
+			</xsl:attribute>
+			<xsl:attribute name="providerResourceIdRef">
+				<xsl:value-of select="$EMPTY_TEMPLATE_ID"/>
+				<xsl:value-of select="'-'"/>
+				<xsl:value-of select="."/>
+			</xsl:attribute>
+			<xsl:attribute name="isCandidateHost">true</xsl:attribute>
+			<xsl:attribute name="isRequirement">true</xsl:attribute>
+		</xsl:element>
+	</xsl:template>
+<!-- =====================================================  ====================================================== -->	
+	
+	
+	
+	
+<!-- =====================================================  ====================================================== -->	
+	<xsl:template match="topology">
+		<xsl:param name="JOB_ID"/>
+		<xsl:param name="TASK_ID"/>
+		<xsl:param name="USER_DN"/>
+		<xsl:param name="SUBMISSION_TIME"/>
+
+		<xsl:element name="taskMapping">
+			<xsl:attribute name="consumerAdId">
+				<xsl:value-of select="$GRID_AD"/>
+			</xsl:attribute>
+			<xsl:attribute name="jobId">
+				<xsl:value-of select="$JOB_ID"/>
+			</xsl:attribute>
+			<xsl:attribute name="taskId">
+				<xsl:value-of select="$TASK_ID"/>
+			</xsl:attribute>
+			<xsl:attribute name="userId">
+				<xsl:value-of select="$USER_DN"/>
+			</xsl:attribute>
+			<xsl:attribute name="submissionTime">
+				<xsl:value-of select="$SUBMISSION_TIME"/>
+			</xsl:attribute>
+			<xsl:attribute name="allocationStatus">Requested</xsl:attribute>
+			<xsl:attribute name="priority">
+				<xsl:value-of select="count(preceding-sibling::topology)"/>
+			</xsl:attribute>
+		
+			<xsl:apply-templates select="../../executionTime"/>
+			
+			<xsl:variable name="PROCESSES_VARIABLE" select="processes"/>
+			<xsl:variable name="GROUPS_VARIABLE" select="group"/>
+					
+			<xsl:apply-templates select="$PROCESSES_VARIABLE" mode="PROCESSES_GROUP_MODE"/>
+			<xsl:apply-templates select="$PROCESSES_VARIABLE" mode="PROCESSES_GROUP_HOSTS_MAPPING_MODE">
+				<xsl:with-param name="HOSTS" select="../../candidateHosts/hostName"/>
+			</xsl:apply-templates>
+			
+			<xsl:apply-templates select="$GROUPS_VARIABLE">
+				<xsl:with-param name="PROCESSES_VARIABLE" select="$PROCESSES_VARIABLE"/>
+			</xsl:apply-templates>
+		</xsl:element>
+	</xsl:template>	
+<!-- =====================================================  ====================================================== -->
+	<xsl:template match="executionTime">
+		<xsl:element name="timeInterval">
+			<xsl:if test="timePeriod/periodStart">
+				<xsl:element name="lowerBoundedRange">
+					<xsl:value-of select="timePeriod/periodStart"/>
+				</xsl:element>
+			</xsl:if>
+			
+			<xsl:if test="timePeriod/periodEnd">
+				<xsl:element name="upperBoundedRange">
+					<xsl:value-of select="timePeriod/periodEnd"/>
+				</xsl:element>
+			</xsl:if>
+			
+			<xsl:element name="duration">
+				<xsl:value-of select="executionDuration"/>
+			</xsl:element>
+
+		</xsl:element>
+	</xsl:template>
+<!-- =====================================================  ====================================================== -->
+	<xsl:template match="processes" mode="PROCESSES_GROUP_MODE">			
+		<xsl:element name="processesGroup">
+		
+			<xsl:attribute name="processesGroupId">
+				<xsl:value-of select="generate-id()"/>
+			</xsl:attribute>
+			
+			<xsl:apply-templates select="processesCount"/>
+				
+		</xsl:element>
+
+	</xsl:template>
+<!-- =====================================================  ====================================================== -->
+	<xsl:template match="processes" mode="PROCESSES_GROUP_HOSTS_MAPPING_MODE">
+		<xsl:param name="HOSTS" select="FALSE"/>
+		
+		<xsl:variable name="PROCESSES" select="."/>
+		<xsl:choose>
+			<xsl:when test="$HOSTS">
+				<xsl:for-each select="$HOSTS">
+					<xsl:apply-templates select="$PROCESSES/resourceRequirements/computingResource" mode="PROCESSES_GROUP_MAPPING_MODE">
+						<xsl:with-param name="HOST" select="."/>
+					</xsl:apply-templates>
+				</xsl:for-each>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:apply-templates select="$PROCESSES/resourceRequirements/computingResource" mode="PROCESSES_GROUP_MAPPING_MODE"/>
+			</xsl:otherwise>
+		</xsl:choose>
+	</xsl:template>
+<!-- =====================================================  ====================================================== -->
+	<xsl:template match="computingResource" mode="PROCESSES_GROUP_MAPPING_MODE">
+		<xsl:param name="HOST" select="FALSE"/>
+		
+		<xsl:element name="processesGroupMapping">
+			<xsl:attribute name="providerAdIdRef">
+				<xsl:value-of select="$GRID_AD"/>
+			</xsl:attribute>
+						
+			<xsl:attribute name="providerResourceIdRef">
+				<xsl:apply-templates select="." mode="RESOURCE_ID_MODE"/>				
+				<xsl:if test="$HOST">
+					<xsl:value-of select="'-'"/>
+					<xsl:value-of select="$HOST"/>
+				</xsl:if>
+			</xsl:attribute>	
+			<xsl:attribute name="isRequirement">true</xsl:attribute>
+			<xsl:attribute name="processesGroupIdRef">
+				<xsl:value-of select="generate-id(../..)"/>
+			</xsl:attribute>
+			<xsl:attribute name="isCandidateHost">
+				<xsl:choose>
+					<xsl:when test="$HOST">true</xsl:when>
+					<xsl:otherwise>false</xsl:otherwise>
+				</xsl:choose>
+			</xsl:attribute>
+		</xsl:element>
+	</xsl:template>
+<!-- =====================================================  ====================================================== -->
+	<xsl:template match="*" mode="RESOURCE_ID_MODE">
+		<xsl:value-of select="generate-id()"/>
+	</xsl:template>
+<!-- =====================================================  ====================================================== -->
+	<xsl:template match="processesCount">
+		<xsl:element name="processesQty">
+			<xsl:choose>
+				<xsl:when test="value">
+					<xsl:element name="value">
+						<xsl:value-of select="value"/>
+					</xsl:element>
+				</xsl:when>
+				<xsl:when test="min">
+					<xsl:element name="min">
+						<xsl:value-of select="min"/>
+					</xsl:element>
+				</xsl:when>
+				<xsl:when test="max">
+					<xsl:element name="max">
+						<xsl:value-of select="max"/>
+					</xsl:element>
+				</xsl:when>
+				<xsl:when test="range">
+					<xsl:element name="min">
+						<xsl:value-of select="range/min"/>
+					</xsl:element>
+					<xsl:element name="max">
+						<xsl:value-of select="range/max"/>
+					</xsl:element>
+				</xsl:when>
+			</xsl:choose>
+		</xsl:element>
+	</xsl:template>
+<!-- =====================================================  ====================================================== -->
+	<xsl:template match="group">
+		<xsl:param name="PROCESSES_VARIABLE"/>
+		<xsl:apply-templates select="processesConnection">
+			<xsl:with-param name="PROCESSES_VARIABLE" select="$PROCESSES_VARIABLE"/>
+		</xsl:apply-templates>
+		<xsl:apply-templates select="groupConnection">
+			<xsl:with-param name="PROCESSES_VARIABLE" select="$PROCESSES_VARIABLE"/>
+		</xsl:apply-templates>		
+	</xsl:template>
+<!-- =====================================================  ====================================================== -->
+	<xsl:template match="processesConnection">
+		<xsl:param name="PROCESSES_VARIABLE"/>
+		<xsl:element name="processesCommunicationGroup">
+			<xsl:attribute name="providerAdIdRef">
+				<xsl:value-of select="$GRID_AD"/>
+			</xsl:attribute>
+			<xsl:attribute name="netResourceIdRef">
+				<xsl:apply-templates select="networkResource[1]" mode="RESOURCE_ID_MODE"/>
+			</xsl:attribute>
+			<xsl:attribute name="groupId">
+				<xsl:value-of select="generate-id()"/>
+			</xsl:attribute>
+			<xsl:variable name="GROUP_ID_VARIABLE" select="../@groupId"/>
+			<xsl:for-each select="$PROCESSES_VARIABLE[groupIdReference=$GROUP_ID_VARIABLE]">
+				<xsl:element name="processesGroupIdRef">
+					<xsl:value-of select="generate-id()"/>
+				</xsl:element>
+			</xsl:for-each>
+		</xsl:element>
+	</xsl:template>
+<!-- =====================================================  ====================================================== -->
+	<xsl:template match="groupConnection">
+			<xsl:param name="PROCESSES_VARIABLE"/>
+		<xsl:variable name="FROM_GROUP_ID_VARIABLE" select="../@groupId"/>
+		<xsl:variable name="TO_GROUP_ID_VARIABLE" select="@endpointGroupId"/>
+		<xsl:variable name="NET_RESOURCE_ID">
+			<xsl:apply-templates select="networkResource[1]" mode="RESOURCE_ID_MODE"/>
+		</xsl:variable>
+		
+		<xsl:for-each select="$PROCESSES_VARIABLE[groupIdReference=$FROM_GROUP_ID_VARIABLE]">
+			<xsl:variable name="PROCESS_1" select="."/>
+			<xsl:for-each select="$PROCESSES_VARIABLE[groupIdReference=$TO_GROUP_ID_VARIABLE]">
+				<xsl:if test="generate-id(.)  != generate-id($PROCESS_1)">
+					<xsl:element name="processesCommunicationGroup">
+						<xsl:attribute name="providerAdIdRef">
+							<xsl:value-of select="$GRID_AD"/>
+						</xsl:attribute>
+						<xsl:attribute name="netResourceIdRef">
+							<xsl:value-of select="$NET_RESOURCE_ID"/>
+						</xsl:attribute>
+						<xsl:attribute name="groupId">
+							<xsl:value-of select="generate-id($PROCESS_1)"/>-<xsl:value-of select="generate-id()"/>
+						</xsl:attribute>
+						<xsl:element name="processesGroupIdRef">
+							<xsl:value-of select="generate-id($PROCESS_1)"/>
+						</xsl:element>
+						<xsl:element name="processesGroupIdRef">
+							<xsl:value-of select="generate-id()"/>
+						</xsl:element>
+					</xsl:element>	
+				</xsl:if>
+			</xsl:for-each>
+		</xsl:for-each>
+	</xsl:template>
+<!-- =====================================================  ====================================================== -->
+</xsl:transform>
Index: DCWoRMS/trunk/simulator/xslt/schedulingPlan.xslt
===================================================================
--- DCWoRMS/trunk/simulator/xslt/schedulingPlan.xslt	(revision 477)
+++ DCWoRMS/trunk/simulator/xslt/schedulingPlan.xslt	(revision 477)
@@ -0,0 +1,242 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+			     xmlns:rtg="http://www.QosCosGrid.org/resourceDescription"
+			     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+                             
+	<xsl:strip-space elements="*"/>
+	
+	<xsl:output method="xml" version="1.0" encoding="UTF-8" omit-xml-declaration="yes" indent="yes"/>
+	
+	<xsl:variable name="AD_IDENTIFIER">AD_ID</xsl:variable>
+	<xsl:variable name="RESOURCE_IDENTIFIER">RES_ID</xsl:variable>
+	<xsl:variable name="CONSUMER_AD_IDENTIFIER">CONSUMER_AD_ID</xsl:variable>
+	<xsl:variable name="PGM_IDENTIFIER">PGM_ID</xsl:variable>
+
+
+	
+<!-- =====================================================  ====================================================== -->
+	<xsl:template match="/">
+		<xsl:apply-templates select="/rtg:rtg"/>
+	</xsl:template>	
+<!-- =====================================================  ====================================================== -->
+	<xsl:template match="rtg:rtg">
+		<xsl:element name="schedulingPlan">
+			<xsl:apply-templates select="rtg:taskMapping"/>
+		</xsl:element>	 
+	</xsl:template>	
+<!-- =====================================================  ====================================================== -->
+	<xsl:template match="rtg:taskMapping">	
+		<xsl:apply-templates select="rtg:mappedTo[@isRequirement='false']"/>
+		
+		<xsl:apply-templates select="rtg:processesGroupMapping[@isRequirement='false']">
+			<xsl:with-param name="GROUPS" select="rtg:processesGroup"/>
+		</xsl:apply-templates>				
+	</xsl:template>
+<!-- =====================================================  ====================================================== -->
+	<xsl:template match="rtg:mappedTo">
+	
+		<xsl:variable name="ADID" select="@providerAdIdRef"/>
+		<xsl:variable name="RESID" select="@providerResourceIdRef"/>
+		<xsl:variable name="RESOURCE" select="/rtg:rtg/rtg:intraADInfo[@adId=$ADID]/rtg:compResource[@id=$RESID]/rtg:resourceSpecificMetric[@xsi:type='hostName']"/>
+
+		<xsl:if test="$RESOURCE">
+			<xsl:element name="taskAllocation">
+				<xsl:attribute name="jobID">
+					<xsl:value-of select="../@jobId"/>
+				</xsl:attribute>
+				<xsl:attribute name="taskID">
+					<xsl:value-of select="../@taskId"/>
+				</xsl:attribute>
+				
+				<xsl:if test="@allocationStatus or ../@allocationStatus">
+					<xsl:attribute name="allocationStatus">
+						<xsl:call-template name="ALLOCATION_STATUS_MAPPING_TEMPLATE">
+							<xsl:with-param name="STATUS">
+								<xsl:choose>
+									<xsl:when test="@allocationStaus">
+										<xsl:value-of select="@allocationStatus"/>
+									</xsl:when>
+									<xsl:when test="../@allocationStatus">
+										<xsl:value-of select="../@allocationStatus"/>
+									</xsl:when>
+								</xsl:choose>
+							</xsl:with-param>
+						</xsl:call-template>
+					</xsl:attribute>
+				</xsl:if>
+				
+				<xsl:apply-templates select="$RESOURCE"/>
+				
+				<xsl:call-template name="TIME_INTERVAL_TEMPLATE"/>
+				
+				<xsl:element name="additionalProperties">
+					<xsl:element name="property">
+						<xsl:attribute name="name">
+							<xsl:value-of select="$AD_IDENTIFIER"/>
+						</xsl:attribute>
+						<xsl:value-of select="$ADID"/>
+					</xsl:element>
+					<xsl:element name="property">
+						<xsl:attribute name="name">
+							<xsl:value-of select="$RESOURCE_IDENTIFIER"/>
+						</xsl:attribute>
+						<xsl:value-of select="$RESID"/>
+					</xsl:element>
+					<xsl:element name="property">
+						<xsl:attribute name="name">
+							<xsl:value-of select="$CONSUMER_AD_IDENTIFIER"/>
+						</xsl:attribute>
+						<xsl:value-of select="../@consumerAdId"/>
+					</xsl:element>
+
+				</xsl:element>
+			</xsl:element>
+		</xsl:if>
+	</xsl:template>
+<!-- =====================================================  ====================================================== -->
+	<xsl:template name="TIME_INTERVAL_TEMPLATE">
+			<xsl:choose>
+				<xsl:when test="rtg:timeInterval">
+					<xsl:apply-templates select="rtg:timeInterval" mode="TIME_INTERVAL_MODE"/>
+				</xsl:when>
+				<xsl:when test="../rtg:timeInterval">
+					<xsl:apply-templates select="../rtg:timeInterval" mode="TIME_INTERVAL_MODE"/>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:apply-templates select="/rtg:rtg/rtg:context/rtg:defaultTimeInterval" mode="TIME_INTERVAL_MODE"/>
+				</xsl:otherwise>
+			</xsl:choose>
+	</xsl:template>
+<!-- =====================================================  ====================================================== -->	
+	<xsl:template match="rtg:processesGroupMapping">
+		<xsl:param name="GROUPS" select="FALSE"/>
+		
+		<xsl:variable name="ADID" select="@providerAdIdRef"/>
+		<xsl:variable name="RESID" select="@providerResourceIdRef"/>
+		<xsl:variable name="RESOURCE" select="/rtg:rtg/rtg:intraADInfo[@adId=$ADID]/rtg:compResource[@id=$RESID]/rtg:resourceSpecificMetric[@xsi:type='hostName']"/>
+		
+		<xsl:if test="$RESOURCE">
+			<xsl:element name="taskAllocation">
+				<xsl:attribute name="jobID">
+					<xsl:value-of select="../@jobId"/>
+				</xsl:attribute>
+				<xsl:attribute name="taskID">
+					<xsl:value-of select="../@taskId"/>
+				</xsl:attribute>
+				<xsl:attribute name="processGroupID">
+					<xsl:value-of select="@processesGroupIdRef"/>
+				</xsl:attribute>
+				
+				<xsl:if test="@allocationStatus or ../@allocationStatus">
+					<xsl:attribute name="allocationStatus">
+						<xsl:call-template name="ALLOCATION_STATUS_MAPPING_TEMPLATE">
+							<xsl:with-param name="STATUS">
+								<xsl:choose>
+									<xsl:when test="@allocationStaus">
+										<xsl:value-of select="@allocationStatus"/>
+									</xsl:when>
+									<xsl:when test="../@allocationStatus">
+										<xsl:value-of select="../@allocationStatus"/>
+									</xsl:when>
+								</xsl:choose>
+							</xsl:with-param>
+						</xsl:call-template>
+					</xsl:attribute>
+				</xsl:if>
+				
+				<xsl:attribute name="processQuantity">
+					<xsl:choose>
+						<xsl:when test="rtg:processesQty">
+							<xsl:apply-templates select="rtg:processesQty"/>
+						</xsl:when>
+						<xsl:otherwise>
+							<xsl:variable name="PROCESSESID" select="@processesGroupIdRef"/>
+							<xsl:apply-templates select="$GROUPS[@processesGroupId=$PROCESSESID]/rtg:processesQty"/>
+						</xsl:otherwise>
+					</xsl:choose>
+				</xsl:attribute>
+				
+				<xsl:apply-templates select="$RESOURCE"/>
+	
+				<xsl:call-template name="TIME_INTERVAL_TEMPLATE"/>	
+				
+				<xsl:element name="additionalProperties">
+					<xsl:element name="property">
+						<xsl:attribute name="name">
+							<xsl:value-of select="$AD_IDENTIFIER"/>
+						</xsl:attribute>
+						<xsl:value-of select="$ADID"/>
+					</xsl:element>
+					<xsl:element name="property">
+						<xsl:attribute name="name">
+							<xsl:value-of select="$RESOURCE_IDENTIFIER"/>
+						</xsl:attribute>
+						<xsl:value-of select="$RESID"/>
+					</xsl:element>
+					<xsl:element name="property">
+						<xsl:attribute name="name">
+							<xsl:value-of select="$CONSUMER_AD_IDENTIFIER"/>
+						</xsl:attribute>
+						<xsl:value-of select="../@consumerAdId"/>
+					</xsl:element>
+					<xsl:element name="property">
+						<xsl:attribute name="name">
+							<xsl:value-of select="$PGM_IDENTIFIER"/>
+						</xsl:attribute>
+						<xsl:value-of select="@id"/>
+					</xsl:element>
+				</xsl:element>				
+			</xsl:element>
+		</xsl:if>
+	</xsl:template>
+<!-- =====================================================  ====================================================== -->
+	<xsl:template match="rtg:resourceSpecificMetric">
+		<xsl:element name="host">
+			<xsl:attribute name="hostname">
+				<xsl:value-of select="."/>
+			</xsl:attribute>
+		</xsl:element>
+	</xsl:template>
+<!-- =====================================================  ====================================================== -->
+	<xsl:template match="rtg:processesQty">
+		<xsl:value-of select="round(rtg:value)"/>
+	</xsl:template>
+<!-- =====================================================  ====================================================== -->
+	<xsl:template match="*" mode="TIME_INTERVAL_MODE">
+		<xsl:element name="timeSlot">
+			<xsl:element name="startTime">
+				<xsl:value-of select="rtg:lowerBoundedRange"/>
+			</xsl:element>
+			
+			<xsl:if test="rtg:upperBoundedRange">
+				<xsl:element name="endTime">
+					<xsl:value-of select="rtg:upperBoundedRange"/>
+				</xsl:element>
+			</xsl:if>
+
+			<xsl:if test="rtg:duration">
+				<xsl:element name="duration">
+					<xsl:value-of select="rtg:duration"/>
+				</xsl:element>
+			</xsl:if>
+			
+		</xsl:element>
+	</xsl:template>
+<!-- =====================================================  ====================================================== -->
+	<xsl:template  name="ALLOCATION_STATUS_MAPPING_TEMPLATE">
+		<xsl:param name="STATUS"/>
+		
+		<xsl:choose>
+			<xsl:when test="$STATUS='Requested'">REQUESTED</xsl:when>
+			<xsl:when test="$STATUS='Reserved'">RESERVED</xsl:when>
+			<xsl:when test="$STATUS='PartiallyReserved'">PARTIALLY_RESERVED</xsl:when>
+			<xsl:when test="$STATUS='insufficientResourcesRejection'">INSUFFICIENT_RESOURCES_REJECTION</xsl:when>
+			<xsl:when test="$STATUS='insufficientBudgetRejection'">INSUFFICIENT_BUDGET_REJECTION</xsl:when>
+			<xsl:when test="$STATUS='Pending'">PENDING</xsl:when>
+			<xsl:when test="$STATUS='Allocated'">ALLOCATED</xsl:when>
+			<xsl:when test="$STATUS='PartiallyAllocated'">PARTIALLY_ALLOCATED</xsl:when>
+			<xsl:when test="$STATUS='NotAllocated'">NOT_ALLOCATED</xsl:when>
+		</xsl:choose>
+	</xsl:template>
+<!-- =====================================================  ====================================================== -->
+</xsl:transform>
Index: DCWoRMS/trunk/simulator/schemas/WorkloadSchema.xsd
===================================================================
--- DCWoRMS/trunk/simulator/schemas/WorkloadSchema.xsd	(revision 477)
+++ DCWoRMS/trunk/simulator/schemas/WorkloadSchema.xsd	(revision 477)
@@ -0,0 +1,212 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- edited with XMLSpy v2005 U (http://www.xmlspy.com) by Ariel Oleksiak (PSNC) 
+     fondled with Eclipse by Marcin Krystek (PSNC)
+-->
+<xs:schema 
+	xmlns:xs="http://www.w3.org/2001/XMLSchema" 
+	xmlns:tns="http://www.man.poznan.pl/WorkloadSchema" 
+	targetNamespace="http://www.man.poznan.pl/WorkloadSchema">
+	
+	<xs:annotation>
+		<xs:documentation>
+			Workload generator parameters for experiment simulator
+		</xs:documentation>
+	</xs:annotation>
+	
+	<xs:element name="WorkloadConfiguration">
+		<xs:complexType>
+			<xs:sequence>
+				<xs:element name="SimulationStartTime" type="tns:Date" minOccurs="0"/>
+				<xs:choice>
+					<xs:element name="JobCount" type="tns:RandParams"/>
+					<xs:element name="SimulationTime" type="tns:Duration"/>
+				</xs:choice>
+
+				<xs:element name="TaskCount" type="tns:RandParams"/>
+				<xs:element name="TaskLength" type="tns:RandParams"/>
+				<xs:element name="JobPackageLength" type="tns:RandParams"/>
+				<xs:element name="JobInterval" type="tns:RandParams"/>
+				
+				<xs:element name="HardConstraint" minOccurs="0" maxOccurs="unbounded">
+					<xs:complexType>
+						<xs:sequence>
+							<xs:element name="value" type="tns:RandParams" minOccurs="0" maxOccurs="unbounded"/>
+							<xs:element name="range" minOccurs="0" maxOccurs="unbounded">
+								<xs:complexType>
+									<xs:sequence>
+										<xs:element name="min" minOccurs="0" type="tns:RandParams"/>
+										<xs:element name="max" minOccurs="0" type="tns:RandParams"/>
+									</xs:sequence>
+								</xs:complexType>
+							</xs:element>
+						</xs:sequence>
+						<xs:attribute name="metric" type="xs:string" use="required"/>
+					</xs:complexType>
+				</xs:element>
+				
+				<xs:element name="TimeConstraints" minOccurs="0">
+					<xs:complexType>
+						<xs:sequence>
+							<xs:element name="execDuration" type="tns:RandParams" minOccurs="0"/>
+							<xs:element name="periodStart" type="tns:RandParams" minOccurs="0"/>
+							<xs:choice>
+								<xs:element name="periodEnd" type="tns:RandParams" minOccurs="0"/>
+								<xs:element name="periodDuration" type="tns:RandParams" minOccurs="0"/>
+							</xs:choice>
+						</xs:sequence>
+					</xs:complexType>
+				</xs:element>
+	
+				<!-- TODO change the softConstraints element as a type to use it here 				<xs:element ref="gms:softConstraints"/> -->
+				<xs:element name="SoftConstraints" minOccurs="0">
+					<xs:complexType>
+						<xs:sequence>
+							<xs:element name="constraint" type="tns:softConstraintType" maxOccurs="unbounded"/>
+						</xs:sequence>
+						<xs:attribute name="preferenceType" use="required">
+							<xs:simpleType>
+								<xs:restriction base="xs:string">
+									<xs:enumeration value="PRIORITY"/>
+									<xs:enumeration value="RANKING"/>
+								</xs:restriction>
+							</xs:simpleType>
+						</xs:attribute>
+					</xs:complexType>
+				</xs:element>
+								
+				<xs:element name="PrecedingConstraints" minOccurs="0">
+					<xs:complexType>
+						<xs:sequence>
+							<xs:element name="parentCard" type="tns:RandParams"/>
+							<xs:element name="workflowLevel" type="tns:RandParams"/>
+							<xs:element name="outputFileSize" type="tns:RandParams" minOccurs="0"/>
+							<xs:element name="parentStates_OR" type="tns:RandParams" minOccurs="0"/>
+							<xs:element name="runSameHost" type="tns:RandParams" minOccurs="0"/>
+							<xs:element name="triggers" minOccurs="0">
+								<xs:complexType>
+									<xs:sequence>
+										<xs:element name="trigger" minOccurs="1" maxOccurs="unbounded">
+											<xs:complexType>
+												<xs:complexContent>
+													<xs:extension base="tns:RandParams">
+														<xs:attribute name="name" use="required"/>
+													</xs:extension>
+												</xs:complexContent>
+											</xs:complexType>
+										</xs:element>
+									</xs:sequence>
+								</xs:complexType>
+							</xs:element>
+						</xs:sequence>
+					</xs:complexType>
+				</xs:element>
+
+				
+			</xs:sequence>
+		</xs:complexType>
+	</xs:element>
+	
+	
+	<!-- Types' definitons -->
+	<xs:complexType name="softConstraintType">
+		<xs:sequence>
+			<xs:element name="parameter" type="xs:string"/>
+			<xs:element name="endpoint" type="xs:string" minOccurs="0"/>
+			<xs:element name="indiffThreshold" type="tns:RandParams" minOccurs="0" />
+			<xs:element name="importance" type="tns:RandParams"/>
+		</xs:sequence>
+		<xs:attribute name="optimizationType" use="required">
+			<xs:simpleType>
+				<xs:restriction base="xs:string">
+					<xs:enumeration value="GAIN"/>
+					<xs:enumeration value="COST"/>
+				</xs:restriction>
+			</xs:simpleType>
+		</xs:attribute>
+	</xs:complexType>
+	
+	<xs:attributeGroup name="ParameterAttributes">
+		<xs:attribute name="id" type="xs:string">
+			<xs:annotation>
+				<xs:documentation>
+					This is unique identifier of current element. It is used to resolve element dependencies - see refElementId
+					attribute description. It must be unique in range of whole document.
+				</xs:documentation>
+			</xs:annotation>
+		</xs:attribute>
+		<xs:attribute name="refElementId" type="xs:string">
+			<xs:annotation>
+				<xs:documentation>
+					Value of this attribute should be the id of the element on which value of current element should based on.
+					If refElemenentId attribute is used, then unique value for id attribute must also be set.
+				</xs:documentation>
+			</xs:annotation>
+		</xs:attribute>
+		<xs:attribute name="expr" type="xs:string">
+			<xs:annotation>
+				<xs:documentation>
+					How value of your current element should be depended on refElement.
+					Example: if value of your current element should be two times plus three graither then value of TaskLength, then
+					set attribute refElement="TaskLength" and expr="2*x+3".
+				</xs:documentation>
+			</xs:annotation>
+		</xs:attribute>
+		<xs:attribute name="avg" type="xs:double"/>
+		<xs:attribute name="stdev" type="xs:double" default="1.0"/>
+		<xs:attribute name="min" type="xs:double"/>
+		<xs:attribute name="max" type="xs:double"/>
+		<xs:attribute name="seed" type="xs:long"/>
+		<xs:attribute name="distribution" default="normal">
+			<xs:simpleType>
+				<xs:restriction base="xs:string">
+					<xs:enumeration value="constant"/>
+					<xs:enumeration value="normal"/>
+					<xs:enumeration value="poisson"/>
+					<xs:enumeration value="uniform"/>
+					<xs:enumeration value="exponential"/>
+					<xs:enumeration value="gamma"/>
+					<xs:enumeration value="harmonic"/>
+				</xs:restriction>
+			</xs:simpleType>
+		</xs:attribute>
+		
+	</xs:attributeGroup>
+
+	<xs:simpleType name="Date">
+		<xs:restriction base="xs:dateTime"></xs:restriction>
+	</xs:simpleType>
+
+	<xs:simpleType name="Duration">
+		<xs:restriction base="xs:duration"></xs:restriction>
+	</xs:simpleType>
+
+	<xs:complexType name="TemporaryParamsType">
+		<xs:sequence>
+			<xs:element name="BeginValidTime" type="tns:Date"/>
+			<xs:element name="EndValidTime" type="tns:Date"/>
+		</xs:sequence>
+		<xs:attributeGroup ref="tns:ParameterAttributes"/>
+	</xs:complexType>
+
+	<xs:complexType name="MultiDistributionType">
+		<xs:sequence>
+			<xs:element name="dist" minOccurs="1" maxOccurs="unbounded">
+				<xs:complexType mixed="true">
+					<xs:attributeGroup ref="tns:ParameterAttributes"/>
+				</xs:complexType>
+			</xs:element>
+		</xs:sequence>
+	</xs:complexType>
+	
+	<xs:complexType name="RandParams">
+		<xs:choice>
+			<xs:sequence>
+				<xs:element name="PeriodicValidValues" type="tns:TemporaryParamsType" minOccurs="0" maxOccurs="unbounded"/>
+			</xs:sequence>
+			<xs:element name="MultiDistribution" type="tns:MultiDistributionType" minOccurs="0" maxOccurs="1"/>
+		</xs:choice>
+		
+		<xs:attributeGroup ref="tns:ParameterAttributes"/>
+	</xs:complexType>
+	
+</xs:schema>
Index: DCWoRMS/trunk/simulator/schemas/WorkloadSchema3g.xsd
===================================================================
--- DCWoRMS/trunk/simulator/schemas/WorkloadSchema3g.xsd	(revision 477)
+++ DCWoRMS/trunk/simulator/schemas/WorkloadSchema3g.xsd	(revision 477)
@@ -0,0 +1,219 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<xs:schema 
+	xmlns:xs="http://www.w3.org/2001/XMLSchema" 
+	xmlns:tns="http://www.man.poznan.pl/WorkloadSchema" 
+	targetNamespace="http://www.man.poznan.pl/WorkloadSchema">
+	
+	<xs:annotation>
+		<xs:documentation>
+			Workload generator parameters for experiment simulator
+		</xs:documentation>
+	</xs:annotation>
+	
+	<xs:element name="WorkloadConfiguration">
+		<xs:complexType>
+			<xs:sequence>
+				<xs:element name="SimulationStartTime" type="tns:Date" minOccurs="0"/>
+				<xs:choice>
+					<xs:element name="JobCount" type="tns:RandParams"/>
+					<xs:element name="SimulationTime" type="tns:Duration"/>
+				</xs:choice>
+
+				<xs:element name="TaskCount" type="tns:RandParams"/>
+				<xs:element name="TaskLength" type="tns:RandParams"/>
+				<xs:element name="JobPackageLength" type="tns:RandParams"/>
+				<xs:element name="JobInterval" type="tns:RandParams"/>
+				
+				<xs:element name="ComputingResourceHostParameter" minOccurs="0" maxOccurs="unbounded">
+					<xs:complexType>
+						<xs:sequence>
+							<xs:element name="value" type="tns:RandParams" minOccurs="0" maxOccurs="unbounded"/>
+							<xs:element name="range" minOccurs="0" maxOccurs="unbounded">
+								<xs:complexType>
+									<xs:sequence>
+										<xs:element name="min" minOccurs="0" type="tns:RandParams"/>
+										<xs:element name="max" minOccurs="0" type="tns:RandParams"/>
+									</xs:sequence>
+								</xs:complexType>
+							</xs:element>
+						</xs:sequence>
+						<xs:attribute name="metric" type="xs:string" use="required"/>
+					</xs:complexType>
+				</xs:element>
+				
+				<xs:element name="Preferences" minOccurs="0">
+					<xs:complexType>
+						<xs:sequence>
+							<xs:element name="parameter" type="tns:preferenceParameterType" maxOccurs="unbounded"/>
+						</xs:sequence>
+						<xs:attribute name="preferenceType" use="required">
+							<xs:simpleType>
+								<xs:restriction base="xs:string">
+									<xs:enumeration value="PRIORITY"/>
+									<xs:enumeration value="RANKING"/>
+								</xs:restriction>
+							</xs:simpleType>
+						</xs:attribute>
+					</xs:complexType>
+				</xs:element>
+				
+				<xs:element name="ExecutionTime" minOccurs="0">
+					<xs:complexType>
+						<xs:sequence>
+							<xs:element name="execDuration" type="tns:RandParams" minOccurs="0"/>
+							<xs:element name="periodStart" type="tns:RandParams" minOccurs="0"/>
+							<xs:choice>
+								<xs:element name="periodEnd" type="tns:RandParams" minOccurs="0"/>
+								<xs:element name="periodDuration" type="tns:RandParams" minOccurs="0"/>
+							</xs:choice>
+						</xs:sequence>
+					</xs:complexType>
+				</xs:element>
+				
+				<xs:element name="PrecedingConstraints" minOccurs="0">
+					<xs:complexType>
+						<xs:sequence>
+							<xs:element name="parentCard" type="tns:RandParams"/>
+							<xs:element name="workflowLevel" type="tns:RandParams"/>
+							<xs:element name="outputFileSize" type="tns:RandParams" minOccurs="0"/>
+							<xs:element name="parentStates_OR" type="tns:RandParams" minOccurs="0"/>
+							<xs:element name="runSameHost" type="tns:RandParams" minOccurs="0"/>
+							<xs:element name="triggers" minOccurs="0">
+								<xs:complexType>
+									<xs:sequence>
+										<xs:element name="trigger" minOccurs="1" maxOccurs="unbounded">
+											<xs:complexType>
+												<xs:complexContent>
+													<xs:extension base="tns:RandParams">
+														<xs:attribute name="name" use="required"/>
+													</xs:extension>
+												</xs:complexContent>
+											</xs:complexType>
+										</xs:element>
+									</xs:sequence>
+								</xs:complexType>
+							</xs:element>
+						</xs:sequence>
+					</xs:complexType>
+				</xs:element>
+				
+			</xs:sequence>
+		</xs:complexType>
+	</xs:element>
+	
+	
+	
+	<!-- Types definitions -->
+	
+	
+	<xs:complexType name="preferenceParameterType">
+		<xs:sequence>
+			<xs:element name="name" type="xs:string"/>
+			<xs:element name="endpoint" type="xs:string" minOccurs="0"/>
+			<xs:element name="importance" type="tns:RandParams"/>
+			<xs:element name="optimizationType">
+				<xs:simpleType>
+					<xs:restriction base="xs:string">
+						<xs:enumeration value="GAIN"/>
+						<xs:enumeration value="COST"/>
+					</xs:restriction>
+				</xs:simpleType>
+			</xs:element>
+			<xs:element name="value" minOccurs="0" type="tns:RandParams"/>
+			<xs:element name="range" minOccurs="0" maxOccurs="unbounded">
+				<xs:complexType>
+					<xs:sequence>
+						<xs:element name="min" minOccurs="0" type="tns:RandParams"/>
+						<xs:element name="max" minOccurs="0" type="tns:RandParams"/>
+					</xs:sequence>
+				</xs:complexType>
+			</xs:element>
+		</xs:sequence>
+	</xs:complexType>
+	
+	<xs:attributeGroup name="ParameterAttributes">
+		<xs:attribute name="id" type="xs:string">
+			<xs:annotation>
+				<xs:documentation>
+					This is unique identifier of current element. It is used to resolve element dependencies - see refElementId
+					attribute description. It must be unique in range of whole document.
+				</xs:documentation>
+			</xs:annotation>
+		</xs:attribute>
+		<xs:attribute name="refElementId" type="xs:string">
+			<xs:annotation>
+				<xs:documentation>
+					Value of this attribute should be the id of the element on which value of current element should based on.
+					If refElemenentId attribute is used, then unique value for id attribute must also be set.
+				</xs:documentation>
+			</xs:annotation>
+		</xs:attribute>
+		<xs:attribute name="expr" type="xs:string">
+			<xs:annotation>
+				<xs:documentation>
+					How value of your current element should be depended on refElement.
+					Example: if value of your current element should be two times plus three graither then value of TaskLength, then
+					set attribute refElement="TaskLength" and expr="2*x+3".
+				</xs:documentation>
+			</xs:annotation>
+		</xs:attribute>
+		<xs:attribute name="avg" type="xs:double"/>
+		<xs:attribute name="stdev" type="xs:double" default="1.0"/>
+		<xs:attribute name="min" type="xs:double"/>
+		<xs:attribute name="max" type="xs:double"/>
+		<xs:attribute name="seed" type="xs:long"/>
+		<xs:attribute name="distribution" default="normal">
+			<xs:simpleType>
+				<xs:restriction base="xs:string">
+					<xs:enumeration value="constant"/>
+					<xs:enumeration value="normal"/>
+					<xs:enumeration value="poisson"/>
+					<xs:enumeration value="uniform"/>
+					<xs:enumeration value="exponential"/>
+					<xs:enumeration value="gamma"/>
+					<xs:enumeration value="harmonic"/>
+				</xs:restriction>
+			</xs:simpleType>
+		</xs:attribute>
+		
+	</xs:attributeGroup>
+
+	<xs:simpleType name="Date">
+		<xs:restriction base="xs:dateTime"></xs:restriction>
+	</xs:simpleType>
+
+	<xs:simpleType name="Duration">
+		<xs:restriction base="xs:duration"></xs:restriction>
+	</xs:simpleType>
+
+	<xs:complexType name="TemporaryParamsType">
+		<xs:sequence>
+			<xs:element name="BeginValidTime" type="tns:Date"/>
+			<xs:element name="EndValidTime" type="tns:Date"/>
+		</xs:sequence>
+		<xs:attributeGroup ref="tns:ParameterAttributes"/>
+	</xs:complexType>
+
+	<xs:complexType name="MultiDistributionType">
+		<xs:sequence>
+			<xs:element name="dist" minOccurs="1" maxOccurs="unbounded">
+				<xs:complexType mixed="true">
+					<xs:attributeGroup ref="tns:ParameterAttributes"/>
+				</xs:complexType>
+			</xs:element>
+		</xs:sequence>
+	</xs:complexType>
+	
+	<xs:complexType name="RandParams">
+		<xs:choice>
+			<xs:sequence>
+				<xs:element name="PeriodicValidValues" type="tns:TemporaryParamsType" minOccurs="0" maxOccurs="unbounded"/>
+			</xs:sequence>
+			<xs:element name="MultiDistribution" type="tns:MultiDistributionType" minOccurs="0" maxOccurs="1"/>
+		</xs:choice>
+		
+		<xs:attributeGroup ref="tns:ParameterAttributes"/>
+	</xs:complexType>
+	
+</xs:schema>
Index: DCWoRMS/trunk/simulator/schemas/resources/WormsAlternativeResSchema.xsd
===================================================================
--- DCWoRMS/trunk/simulator/schemas/resources/WormsAlternativeResSchema.xsd	(revision 477)
+++ DCWoRMS/trunk/simulator/schemas/resources/WormsAlternativeResSchema.xsd	(revision 477)
@@ -0,0 +1,540 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	elementFormDefault="qualified" attributeFormDefault="unqualified">
+		
+		<xs:complexType name="pluginType">
+		<xs:annotation>
+			<xs:documentation>Base plugin type. 
+			Plugins allow configuring and adapting the simulation framework to his/her experiment 
+			starting from modeling job performance, through method of calculating energy estimation up to implementation of scheduling policies
+			Name of the plugin specifies the JAVA class that implements dedicated interface.</xs:documentation>
+		</xs:annotation>
+		<xs:sequence>
+			<xs:element name="name" type="xs:string"></xs:element>
+			<xs:element name="parameter" type="parameterType" minOccurs="0" maxOccurs="unbounded"></xs:element>
+		</xs:sequence>
+	</xs:complexType>
+	
+	<xs:complexType name="timeEstimationPluginType">
+		<xs:annotation>
+			<xs:documentation>TimeEstimationPlugin derived from pluginType. 
+			Time estimation plugin provides means to include specific application performance models during simulations
+			and allows introducing specific ways of calculating task execution time.</xs:documentation>
+		</xs:annotation>
+		<xs:complexContent>
+			<xs:restriction base="pluginType">
+				<xs:sequence>
+					<xs:element name="name" type="xs:string" default="ExecTimeEstimationPlugin"></xs:element>
+					<xs:element name="parameter" type="parameterType" minOccurs="0" maxOccurs="unbounded"></xs:element>
+				</xs:sequence>
+			</xs:restriction>
+		</xs:complexContent>	
+	</xs:complexType>
+	
+	<xs:complexType name="resourceType">
+		<xs:annotation>
+			<xs:documentation>Base resource type. 
+			It allows to define simulation entities like computing resources, devices, schedulers.
+			Attributes: class - determines the component of the architecture i.e. rack, processor, memory, storage etc.
+			type - type of resource; for instance, continuous for memory, bandwidth, etc. and discrete for processors
+			name - unique resource identifier, if not specified it will be generated by the simulator in the following manner: class + "_" + subsequent_natural_number
+			</xs:documentation>
+		</xs:annotation>
+		<xs:sequence>
+			<xs:element name="description" type="xs:string" minOccurs="0"></xs:element>
+		</xs:sequence>
+		<xs:attribute name="type" type="xs:string" use="optional"/>
+		<xs:attribute name="name" type="xs:ID" use="optional"/>
+	</xs:complexType>
+
+	<xs:complexType name="computingResourceType">
+		<xs:annotation>
+			<xs:documentation>ComputingResourceTemplate derived from resourceType.
+			It allows user to define model of computing resource component that may constitute other computing resources
+			Computing resource templates can be then referred in computing resource definition</xs:documentation>
+		</xs:annotation>
+		<xs:complexContent>
+			<xs:extension base="resourceType">
+				<xs:choice>
+					<xs:sequence>
+						<xs:element name="resourceUnit" type="resourceUnitType" minOccurs="0" maxOccurs="unbounded"></xs:element>
+						<xs:element name="parameter" type="parameterType" minOccurs="0" maxOccurs="unbounded"></xs:element>
+						<xs:element name="profile" type="profileType" minOccurs="0" maxOccurs="1"></xs:element>
+						<xs:element name="location" type="locationType" minOccurs="0" maxOccurs="1"></xs:element>
+					</xs:sequence>
+					<xs:sequence>
+						<xs:element name="templateId" type="xs:IDREF"/>
+						<xs:element name="location" type="locationType" minOccurs="0" maxOccurs="1"></xs:element>
+					</xs:sequence>
+				</xs:choice>
+				<xs:attribute name="groupId" type="xs:integer" use="optional"/>			
+				<xs:attribute name="count" type="xs:integer" use="optional"/>
+			</xs:extension>
+		</xs:complexContent>
+	</xs:complexType>
+	
+	<xs:complexType name="genericComputingResourceType">
+		<xs:complexContent>
+			<xs:extension base="computingResourceType">
+				<xs:choice>
+					<xs:element name="computingResource" type="genericComputingResourceType" minOccurs="0" maxOccurs="unbounded"></xs:element>
+					<xs:element name="dataCenter" type="dataCenterType" minOccurs="0" maxOccurs="unbounded"></xs:element>
+					<xs:element name="rack" type="rackType" minOccurs="0" maxOccurs="unbounded"></xs:element>
+					<xs:element name="computingNode" type="computingNodeType" minOccurs="0" maxOccurs="unbounded"></xs:element>
+					<xs:element name="processor" type="processorType" minOccurs="0" maxOccurs="unbounded"></xs:element>
+					<xs:element name="core" type="coreType" minOccurs="0" maxOccurs="unbounded"></xs:element>
+				</xs:choice>
+				<xs:attribute name="class" type="xs:string" use="required"/>
+			</xs:extension>
+		</xs:complexContent>
+	</xs:complexType>
+	
+	<xs:complexType name="dataCenterType">
+		<xs:complexContent>
+			<xs:extension base="computingResourceType">
+				<xs:choice>
+					<xs:element name="computingResource" type="genericComputingResourceType" minOccurs="0" maxOccurs="unbounded"></xs:element>
+					<xs:element name="rack" type="rackType" minOccurs="0" maxOccurs="unbounded"></xs:element>
+				</xs:choice>
+			</xs:extension>
+		</xs:complexContent>
+	</xs:complexType>
+	
+	<xs:complexType name="rackType">
+		<xs:complexContent>
+			<xs:extension base="computingResourceType">
+				<xs:choice>
+					<xs:element name="computingResource" type="genericComputingResourceType" minOccurs="0" maxOccurs="unbounded"></xs:element>
+					<xs:element name="computingNode" type="computingNodeType" minOccurs="0" maxOccurs="unbounded"></xs:element>
+				</xs:choice>
+			</xs:extension>
+		</xs:complexContent>
+	</xs:complexType>
+	
+	<xs:complexType name="computingNodeType">
+		<xs:complexContent>
+			<xs:extension base="computingResourceType">
+				<xs:choice>
+					<xs:element name="computingResource" type="genericComputingResourceType" minOccurs="0" maxOccurs="unbounded"></xs:element>
+					<xs:element name="processor" type="processorType" minOccurs="0" maxOccurs="unbounded"></xs:element>
+				</xs:choice>
+			</xs:extension>
+		</xs:complexContent>
+	</xs:complexType>
+	
+	<xs:complexType name="processorType">
+		<xs:complexContent>
+			<xs:extension base="resourceType">
+				<xs:sequence>
+					<xs:choice>
+						<xs:sequence>
+							<xs:element name="resourceUnit" type="resourceUnitType" minOccurs="0" maxOccurs="unbounded"></xs:element>
+							<xs:element name="parameter" type="parameterType" minOccurs="0" maxOccurs="unbounded"></xs:element>
+							<xs:element name="profile" type="cpuProfileType" minOccurs="0" maxOccurs="1"></xs:element>
+							<xs:element name="location" type="locationType" minOccurs="0" maxOccurs="1"></xs:element>
+						</xs:sequence>
+						<xs:sequence>
+							<xs:element name="templateId" type="xs:IDREF"/>
+							<xs:element name="location" type="locationType" minOccurs="0" maxOccurs="1"></xs:element>
+						</xs:sequence>
+					</xs:choice>
+					<xs:choice>
+						<xs:element name="computingResource" type="genericComputingResourceType" minOccurs="0" maxOccurs="unbounded"></xs:element>
+						<xs:element name="core" type="coreType" minOccurs="0" maxOccurs="unbounded"></xs:element>
+					</xs:choice>
+				</xs:sequence>
+				<xs:attribute name="groupId" type="xs:integer" use="optional"/>			
+				<xs:attribute name="count" type="xs:integer" use="optional"/>
+			</xs:extension>
+		</xs:complexContent>
+	</xs:complexType>
+	
+	<xs:complexType name="coreType">
+		<xs:complexContent>
+			<xs:extension base="computingResourceType">
+				<xs:choice>
+					<xs:element name="computingResource" type="genericComputingResourceType" minOccurs="0" maxOccurs="unbounded"></xs:element>
+				</xs:choice>
+			</xs:extension>
+		</xs:complexContent>
+	</xs:complexType>
+	
+	<xs:complexType name="computingResourceTemplateType">
+		<xs:annotation>
+			<xs:documentation>ComputingResourceTemplate derived from resourceType.
+			It allows user to define model of computing resource component that may constitute other computing resources
+			Computing resource templates can be then referred in computing resource definition</xs:documentation>
+		</xs:annotation>
+		<xs:complexContent>
+			<xs:extension base="resourceType">
+				<xs:sequence>
+					<xs:element name="resourceUnit" type="resourceUnitType" minOccurs="0" maxOccurs="unbounded"></xs:element>
+					<xs:element name="parameter" type="parameterType" minOccurs="0" maxOccurs="unbounded"></xs:element>
+					<xs:element name="profile" type="profileType" minOccurs="0" maxOccurs="1"></xs:element>
+					<xs:choice>
+						<xs:element name="computingResource" type="genericComputingResourceType" minOccurs="0" maxOccurs="unbounded"></xs:element>
+						<xs:element name="dataCenter" type="dataCenterType" minOccurs="0" maxOccurs="unbounded"></xs:element>
+						<xs:element name="rack" type="rackType" minOccurs="0" maxOccurs="unbounded"></xs:element>
+						<xs:element name="computingNode" type="computingNodeType" minOccurs="0" maxOccurs="unbounded"></xs:element>
+						<xs:element name="processor" type="processorType" minOccurs="0" maxOccurs="unbounded"></xs:element>
+						<xs:element name="core" type="coreType" minOccurs="0" maxOccurs="unbounded"></xs:element>
+					</xs:choice>
+				</xs:sequence>
+				<xs:attribute name="class" type="xs:string" use="optional"/>
+			</xs:extension>
+		</xs:complexContent>
+	</xs:complexType>
+			
+				
+	<xs:complexType name="ComputingResourceTemplateType">
+		<xs:annotation>
+			<xs:documentation>ComputingResourceTemplate derived from resourceType.
+			It allows user to define model of computing resource component that may constitute other computing resources
+			Computing resource templates can be then referred in computing resource definition</xs:documentation>
+		</xs:annotation>
+		<xs:complexContent>
+			<xs:extension base="resourceType">
+				<xs:sequence>
+					<xs:sequence>
+						<xs:element name="resourceUnit" type="resourceUnitType" minOccurs="0" maxOccurs="unbounded"></xs:element>
+						<xs:element name="parameter" type="parameterType" minOccurs="0" maxOccurs="unbounded"></xs:element>
+						<xs:element name="profile" type="profileType" minOccurs="0" maxOccurs="1"></xs:element>
+					</xs:sequence>
+					<xs:choice>
+						<xs:element name="computingResource" type="genericComputingResourceType" minOccurs="0" maxOccurs="unbounded"></xs:element>
+						<xs:element name="dataCenter" type="dataCenterType" minOccurs="0" maxOccurs="unbounded"></xs:element>
+						<xs:element name="rack" type="rackType" minOccurs="0" maxOccurs="unbounded"></xs:element>
+						<xs:element name="computingNode" type="computingNodeType" minOccurs="0" maxOccurs="unbounded"></xs:element>
+						<xs:element name="processor" type="processorType" minOccurs="0" maxOccurs="unbounded"></xs:element>
+						<xs:element name="core" type="coreType" minOccurs="0" maxOccurs="unbounded"></xs:element>
+					</xs:choice>
+				</xs:sequence>	
+				<xs:attribute name="count" type="xs:integer" use="optional"/>
+			</xs:extension>
+		</xs:complexContent>
+	</xs:complexType>	
+	
+	<xs:complexType name="schedulerType">
+		<xs:annotation>
+			<xs:documentation>Scheduler derived from resourceType.
+			It allows to model scheduling entity responsible for managing resources.</xs:documentation>
+		</xs:annotation>
+		<xs:complexContent>
+			<xs:extension base="resourceType">
+				<xs:sequence>
+					<xs:element name="schedulingPlugin" type="schedulingPluginType" minOccurs="0" maxOccurs="1"></xs:element>
+					<xs:choice minOccurs="1" maxOccurs="unbounded">
+						<xs:element name="scheduler" type="schedulerType"></xs:element>
+						<xs:element name="managedComputingResources" type="managedComputingResourcesType"></xs:element>
+					</xs:choice>
+					<xs:element name="parameter" type="parameterType" minOccurs="0" maxOccurs="unbounded"></xs:element>
+				</xs:sequence>
+				<xs:attribute name="class" type="xs:string" use="optional"/>
+			</xs:extension>
+		</xs:complexContent>
+	</xs:complexType>
+	
+	<xs:complexType name="schedulingPluginType">
+		<xs:annotation>
+			<xs:documentation>SchedulingPlugin derived from pluginType. 
+			Scheduling plugins allow plugging scheduling algorithms into the simulated environment.
+			Elements: frequency - is used to enable scheduling periodically; it specifies the time interval (in seconds by default) between subsequent scheduling invocations
+			</xs:documentation>
+		</xs:annotation>
+		<xs:complexContent>
+			<xs:extension base="pluginType">
+				<xs:sequence>
+					<xs:element name="frequency" type="doubleValueWithUnitType" minOccurs="0" maxOccurs="1"></xs:element>
+				</xs:sequence>
+			</xs:extension>
+		</xs:complexContent>
+	</xs:complexType>
+	
+	<xs:complexType name="resourceUnitType">
+		<xs:annotation>
+			<xs:documentation>Resource unit is used to define non-computing resource like memory, storage etc.
+			Elements: amount - represents concrete amount (values) of specific resource unit</xs:documentation>
+		</xs:annotation>
+		<xs:complexContent>
+			<xs:extension base="resourceType">
+				<xs:sequence>
+					<xs:element name="amount" type="doubleValueWithUnitType"/>
+					<xs:element name="parameter" type="parameterType" minOccurs="0" maxOccurs="unbounded"></xs:element>
+				</xs:sequence>
+				<xs:attribute name="class" type="xs:string" use="required"/>
+			</xs:extension>
+		</xs:complexContent>
+	</xs:complexType>
+
+	<xs:complexType name="doubleValueWithUnitType">
+		<xs:annotation>
+			<xs:documentation>DoubleValueWitUnit derived from double. Allows providing units in which the given value is expressed
+			Attributes: unit - indicates appropriate units, for instance: seconds, watts, bytes etc. </xs:documentation>
+		</xs:annotation>
+		<xs:simpleContent>
+			<xs:extension base="xs:double">
+				<xs:attribute name="unit" type="xs:string" use="optional"/>
+			</xs:extension>	
+		</xs:simpleContent>	
+	</xs:complexType>
+	
+	<xs:complexType name="stringValueWithUnitType">
+		<xs:annotation>
+			<xs:documentation>StringValueWitUnit derived from string. Allows providing units in which the given value is expressed
+			Attributes: unit - indicates appropriate units. </xs:documentation>
+		</xs:annotation>
+		<xs:simpleContent>
+			<xs:extension base="xs:string">
+				<xs:attribute name="unit" type="xs:string" use="optional"/>
+			</xs:extension>	
+		</xs:simpleContent>	
+	</xs:complexType>
+	
+	<xs:complexType name="managedComputingResourcesType">
+		<xs:annotation>
+			<xs:documentation>ManagedComputingResource type specifies computing resources controlled by scheduler.
+			They can be provided either by listing their names or listing the group ids which they belong to.
+			Attributes: include - specifies whether the given resource layer (listed resources) can be allocated by the scheduler
+			In other words, false (default) value indicates that scheduler maneges only the subcomponents of the listed resources;
+			true value determines that also listed resources will be under the control of the defined scheduler</xs:documentation>
+		</xs:annotation>
+		<xs:choice>
+			<xs:element name="resourceName" type="xs:string" minOccurs="1" maxOccurs="unbounded"></xs:element>
+			<xs:element name="resourceGroupId" type="xs:string" minOccurs="1" maxOccurs="unbounded"></xs:element>
+		</xs:choice>
+		<xs:attribute name="include" type="xs:boolean" default="false"/>
+	</xs:complexType>
+
+	<xs:complexType name="energyEstimationPluginType">
+		<xs:annotation>
+			<xs:documentation>EnergyEstimationPlugin derived from pluginType. 
+			Energy estimation plugin is used to estimate energy consumption of the given computing resource. 
+			It has access to the detailed resource description including power and air throughput profiles
+			and application characteristics running on a given resource</xs:documentation>
+		</xs:annotation>
+		<xs:complexContent>
+			<xs:extension base="pluginType"/>
+		</xs:complexContent>
+	</xs:complexType>
+	
+	<xs:complexType name="profileType">
+		<xs:annotation>
+			<xs:documentation>Profile acts as a container for resource profiles: power and air throughput</xs:documentation>
+		</xs:annotation>
+		<xs:sequence>
+			<xs:element name="powerProfile" type="powerProfileType" minOccurs="0"></xs:element>
+			<xs:element name="airThroughputProfile" type="airThroughputProfileType" minOccurs="0"></xs:element>
+		</xs:sequence>
+	</xs:complexType>
+	
+	<xs:complexType name="powerProfileType">
+		<xs:annotation>
+			<xs:documentation>Power profile provides energyEstimation plugin, powerStates and other power-related parameters definition</xs:documentation>
+		</xs:annotation>
+		<xs:sequence>
+			<xs:element name="energyEstimationPlugin" type="energyEstimationPluginType" minOccurs="0" maxOccurs="1"></xs:element>
+			<xs:element name="powerStates" type="powerStatesType" minOccurs="0"></xs:element>
+			<xs:element name="parameter" type="parameterType" minOccurs="0" maxOccurs="unbounded"></xs:element>
+		</xs:sequence>
+	</xs:complexType>
+	
+	<xs:complexType name="powerStatesType">
+		<xs:annotation>
+			<xs:documentation>PowerState type act as a container for power states. It contains energy-related characteristics of the computing resource</xs:documentation>
+		</xs:annotation>
+		<xs:sequence>
+			<xs:element name="powerState" type="powerStateType" minOccurs="1" maxOccurs="unbounded"></xs:element>
+		</xs:sequence>
+	</xs:complexType>
+	
+	<xs:complexType name="powerStateType">
+		<xs:annotation>
+			<xs:documentation>Power state defines available (for computing resource) power states.
+			Elements: name - denotes name of the given power state
+			powerUsage - defines power consumption in the given state
+			transition - specifies possible power states transitions form the given power state</xs:documentation>
+		</xs:annotation>
+		<xs:sequence>
+			<xs:element name="name" type="xs:string"></xs:element>
+			<xs:element name="powerUsage" type="doubleValueWithUnitType" minOccurs="0" maxOccurs="1"></xs:element>
+			<xs:element name="transition" type="powerStatesTransitionType" minOccurs="0" maxOccurs="unbounded"></xs:element>
+			<xs:element name="parameter" type="parameterType" minOccurs="0" maxOccurs="unbounded"></xs:element>
+		</xs:sequence>
+	</xs:complexType>
+	
+	<xs:complexType name="powerStatesTransitionType">
+		<xs:annotation>
+			<xs:documentation>Description of power states transtition
+			Elements: to - denotes name of target power state
+			powerUsage - defines transition cost in the form of power consumption
+			time - specifies transition time</xs:documentation>
+		</xs:annotation>
+		<xs:sequence>
+			<xs:element name="to" type="xs:string"></xs:element>
+			<xs:element name="powerUsage" type="doubleValueWithUnitType"></xs:element>
+			<xs:element name="time" type="doubleValueWithUnitType"></xs:element>
+			<xs:element name="parameter" type="parameterType" minOccurs="0" maxOccurs="unbounded"></xs:element>
+		</xs:sequence>
+	</xs:complexType>
+	
+	<xs:complexType name="cpuProfileType">
+		<xs:annotation>
+			<xs:documentation>Profile acts as a container for resource profiles: power and air throughput</xs:documentation>
+		</xs:annotation>
+		<xs:sequence>
+			<xs:element name="powerProfile" type="cpuPowerProfileType" minOccurs="0"></xs:element>
+			<xs:element name="airThroughputProfile" type="airThroughputProfileType" minOccurs="0"></xs:element>
+		</xs:sequence>
+	</xs:complexType>
+	
+	
+	<xs:complexType name="cpuPowerProfileType">
+		<xs:annotation>
+			<xs:documentation>Power profile provides energyEstimation plugin, powerStates and other power-related parameters definition</xs:documentation>
+		</xs:annotation>
+		<xs:sequence>
+			<xs:element name="energyEstimationPlugin" type="energyEstimationPluginType" minOccurs="0" maxOccurs="1"></xs:element>
+			<xs:element name="powerStates" type="powerStatesType" minOccurs="0"></xs:element>
+			<xs:element name="pStates" type="pStatesType" minOccurs="0"></xs:element>
+			<xs:element name="parameter" type="parameterType" minOccurs="0" maxOccurs="unbounded"></xs:element>
+		</xs:sequence>
+	</xs:complexType>
+	
+	<xs:complexType name="pStatesType">
+		<xs:annotation>
+			<xs:documentation>Definition of supported  p-states</xs:documentation>
+		</xs:annotation>
+		<xs:sequence minOccurs="1" maxOccurs="unbounded">
+			<xs:element name="pState" type="pStateType"></xs:element>
+		</xs:sequence>
+	</xs:complexType>
+	
+	<xs:complexType name="pStateType">
+		<xs:annotation>
+			<xs:documentation>Definition of the p-state</xs:documentation>
+		</xs:annotation>
+		<xs:sequence>
+			<xs:element name="name" type="xs:string"></xs:element>
+			<xs:element name="frequency" type="doubleValueWithUnitType"></xs:element>
+			<xs:element name="voltage" type="doubleValueWithUnitType"></xs:element>
+			<xs:element name="powerUsage" type="doubleValueWithUnitType"></xs:element>
+		</xs:sequence>
+	</xs:complexType>
+	
+	<xs:complexType name="airThroughputEstimationPluginType">
+		<xs:annotation>
+			<xs:documentation>AirThroughputEstimationPlugin derived from pluginType. 
+			Air Throughput plugin is used to estimate air flow value based on the defined air throughput states</xs:documentation>
+		</xs:annotation>
+		<xs:complexContent>
+			<xs:extension base="pluginType"/>
+		</xs:complexContent>
+	</xs:complexType>
+	
+	<xs:complexType name="airThroughputProfileType">
+		<xs:annotation>
+			<xs:documentation>AirThrouhputProfile provides airThroughputEstimation plugin, airThroughputStates and other airThroughput-related parameters definition</xs:documentation>
+		</xs:annotation>
+		<xs:sequence>
+			<xs:element name="airThroughputEstimationPlugin" type="airThroughputEstimationPluginType" minOccurs="0" maxOccurs="1"></xs:element>
+			<xs:element name="airThroughputStates" type="airThroughputStatesType" minOccurs="1" maxOccurs="unbounded"></xs:element>
+			<xs:element name="parameter" type="parameterType" minOccurs="0" maxOccurs="unbounded"></xs:element>
+		</xs:sequence>
+	</xs:complexType>
+	
+		<xs:complexType name="airThroughputStatesType">
+		<xs:annotation>
+			<xs:documentation>AirThroughputStates type act as a container for air throughput states.</xs:documentation>
+		</xs:annotation>
+		<xs:sequence>
+			<xs:element name="airThroughputState" type="airThroughputStateType" minOccurs="1" maxOccurs="unbounded"></xs:element>
+		</xs:sequence>
+	</xs:complexType>
+	
+	<xs:complexType name="airThroughputStateType">
+		<xs:annotation>
+			<xs:documentation>Air througput state provides means to define air flow level. 
+			It can represent, for instance, a fan working state</xs:documentation>
+		</xs:annotation>
+		<xs:sequence>
+			<xs:element name="name" type="xs:string"></xs:element>
+			<xs:element name="value" type="doubleValueWithUnitType"></xs:element>
+			<xs:element name="powerUsage" type="doubleValueWithUnitType" minOccurs="0"></xs:element>
+			<xs:element name="parameter" type="parameterType" minOccurs="0" maxOccurs="unbounded"></xs:element>
+		</xs:sequence>
+	</xs:complexType>
+	
+	<xs:complexType name="locationType">
+		<xs:annotation>
+			<xs:documentation>The location type describes placement of the computing resource using 3 coordinates</xs:documentation>
+		</xs:annotation>
+		<xs:sequence>
+			<xs:element name="horizontal" type="xs:long"/>
+			<xs:element name="vertical" type="xs:long"/>
+			<xs:element name="depth" type="xs:long"/>
+			<xs:element name="parameter" type="parameterType" minOccurs="0" maxOccurs="unbounded"></xs:element>
+		</xs:sequence>
+	</xs:complexType>
+	
+	<xs:complexType name="parameterType">
+		<xs:annotation>
+			<xs:documentation>Parameter of resource. Allows defining additional resource parameters.
+			Contains a list of parameter values or a list of key-value pairs.
+			Attribute : name - denotes parameter name</xs:documentation>
+		</xs:annotation>
+		<xs:choice>
+			<xs:element name="value" type="stringValueWithUnitType" minOccurs="0" maxOccurs="unbounded"/>
+			<xs:sequence>
+				<xs:element name="property" minOccurs="0" maxOccurs="unbounded">
+					<xs:complexType>
+						<xs:annotation>
+							<xs:documentation>Property of parameter. Allows defining additional properties of parameter as a list of values.
+							Attribute : name - denotes property name</xs:documentation>
+						</xs:annotation>
+						<xs:sequence>
+							<xs:element name="value" type="stringValueWithUnitType" minOccurs="0" maxOccurs="unbounded"/>
+						</xs:sequence>
+						<xs:attribute name="name" type="xs:string" use="required"/>
+					</xs:complexType>
+				</xs:element>
+			</xs:sequence>
+		</xs:choice>
+		<xs:attribute name="name" type="xs:string" use="required"/>
+	</xs:complexType>
+	
+	<xs:element name="environment">
+		<xs:annotation>
+			<xs:documentation>Schema describing simulation environment</xs:documentation>
+		</xs:annotation>
+		<xs:complexType>
+			<xs:sequence>
+				<xs:element name="description" type="xs:string" minOccurs="0" ></xs:element>
+				<xs:element name="timeEstimationPlugin" type="timeEstimationPluginType" minOccurs="0" maxOccurs="1"></xs:element>
+				<xs:element name="resources">
+					<xs:annotation>
+						<xs:documentation>Description of resources</xs:documentation>
+					</xs:annotation>
+					<xs:complexType>
+						<xs:sequence>
+							<xs:element name="description" type="xs:string" minOccurs="0" ></xs:element>
+							<xs:element name="dataCenter" type="dataCenterType" maxOccurs="unbounded"/>
+							<xs:element name="scheduler" type="schedulerType" maxOccurs="unbounded"/>
+						</xs:sequence>
+					</xs:complexType>
+				</xs:element>
+				<xs:element name="templates" minOccurs="0">
+					<xs:annotation>
+						<xs:documentation>Definition of computing resource templates that can/will be used in resource description section </xs:documentation>
+					</xs:annotation>
+					<xs:complexType>
+						<xs:sequence>
+							<xs:element name="description" type="xs:string" minOccurs="0" ></xs:element>
+							<xs:element name="computingResourceTemplate" type="computingResourceTemplateType" maxOccurs="unbounded"/>
+						</xs:sequence>
+					</xs:complexType>
+				</xs:element>
+			</xs:sequence>
+		</xs:complexType>
+	</xs:element>
+
+</xs:schema>
Index: DCWoRMS/trunk/simulator/schemas/resources/WormsResSchema.xsd
===================================================================
--- DCWoRMS/trunk/simulator/schemas/resources/WormsResSchema.xsd	(revision 477)
+++ DCWoRMS/trunk/simulator/schemas/resources/WormsResSchema.xsd	(revision 477)
@@ -0,0 +1,401 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	elementFormDefault="qualified" attributeFormDefault="unqualified">
+		
+		<xs:complexType name="pluginType">
+		<xs:annotation>
+			<xs:documentation>Base plugin type. 
+			Plugins allow configuring and adapting the simulation framework to his/her experiment 
+			starting from modeling job performance, through method of calculating energy estimation up to implementation of scheduling policies
+			Name of the plugin specifies the JAVA class that implements dedicated interface.</xs:documentation>
+		</xs:annotation>
+		<xs:sequence>
+			<xs:element name="name" type="xs:string"></xs:element>
+			<xs:element name="parameter" type="parameterType" minOccurs="0" maxOccurs="unbounded"></xs:element>
+		</xs:sequence>
+	</xs:complexType>
+	
+	<xs:complexType name="timeEstimationPluginType">
+		<xs:annotation>
+			<xs:documentation>TimeEstimationPlugin derived from pluginType. 
+			Time estimation plugin provides means to include specific application performance models during simulations
+			and allows introducing specific ways of calculating task execution time.</xs:documentation>
+		</xs:annotation>
+		<xs:complexContent>
+			<xs:restriction base="pluginType">
+				<xs:sequence>
+					<xs:element name="name" type="xs:string" default="ExecTimeEstimationPlugin"></xs:element>
+					<xs:element name="parameter" type="parameterType" minOccurs="0" maxOccurs="unbounded"></xs:element>
+				</xs:sequence>
+			</xs:restriction>
+		</xs:complexContent>	
+	</xs:complexType>
+	
+	<xs:complexType name="resourceType">
+		<xs:annotation>
+			<xs:documentation>Base resource type. 
+			It allows to define simulation entities like computing resources, devices, schedulers.
+			Attributes: class - determines the component of the architecture i.e. rack, processor, memory, storage etc.
+			type - type of resource; for instance, continuous for memory, bandwidth, etc. and discrete for processors
+			name - unique resource identifier, if not specified it will be generated by the simulator in the following manner: class + "_" + subsequent_natural_number
+			</xs:documentation>
+		</xs:annotation>
+		<xs:sequence>
+			<xs:element name="description" type="xs:string" minOccurs="0"></xs:element>
+		</xs:sequence>
+		<xs:attribute name="class" type="xs:string" use="required"/>
+		<xs:attribute name="type" type="xs:string" use="optional"/>
+		<xs:attribute name="name" type="xs:ID" use="optional"/>
+	</xs:complexType>
+
+	<xs:complexType name="computingResourceType">
+		<xs:annotation>
+			<xs:documentation> ComputingResource derived from resourceType
+			Computing resource specifies resources that are able to perform computing operations. 
+			From the simulator point of view computing resource is everything that is/contains processing element.
+			Hence, all entities like core, processor, computing node, as well as those which aggregate them (like shelf, rack, container etc.)
+			should be define using this type. This way of description provides flexibility in defining system architecture
+			and allows to build hierarchy of resources that corresponds to real world.
+			Attributes: groupId - allows to group resources of the given class in the logical structures that can be used during binding them with schedulers
+			count - defines number of resources of the given class</xs:documentation>
+		</xs:annotation>
+		<xs:complexContent>
+			<xs:extension base="resourceType">
+				<xs:sequence>
+					<xs:choice>
+						<xs:sequence>
+							<xs:element name="resourceUnit" type="resourceUnitType" minOccurs="0" maxOccurs="unbounded"></xs:element>
+							<xs:element name="parameter" type="parameterType" minOccurs="0" maxOccurs="unbounded"></xs:element>
+							<xs:element name="profile" type="profileType" minOccurs="0" maxOccurs="1"></xs:element>
+							<xs:element name="location" type="locationType" minOccurs="0" maxOccurs="1"></xs:element>
+							<xs:element name="computingResource" type="computingResourceType" minOccurs="0" maxOccurs="unbounded"></xs:element>
+						</xs:sequence>
+						<xs:sequence>
+							<xs:element name="templateId" type="xs:IDREF"/>
+							<xs:element name="location" type="locationType" minOccurs="0" maxOccurs="1"></xs:element>
+						</xs:sequence>
+					</xs:choice>
+				</xs:sequence>
+				<xs:attribute name="groupId" type="xs:integer" use="optional"/>			
+				<xs:attribute name="count" type="xs:integer" use="optional"/>
+			</xs:extension>
+		</xs:complexContent>
+	</xs:complexType>
+	
+	<xs:complexType name="computingResourceTemplateType">
+		<xs:annotation>
+			<xs:documentation>ComputingResourceTemplate derived from resourceType.
+			It allows user to define model of computing resource component that may constitute other computing resources
+			Computing resource templates can be then referred in computing resource definition</xs:documentation>
+		</xs:annotation>
+		<xs:complexContent>
+			<xs:extension base="resourceType">
+				<xs:sequence>
+					<xs:element name="resourceUnit" type="resourceUnitType" minOccurs="0" maxOccurs="unbounded"></xs:element>
+					<xs:element name="parameter" type="parameterType" minOccurs="0" maxOccurs="unbounded"></xs:element>
+					<xs:element name="profile" type="profileType" minOccurs="0" maxOccurs="1"></xs:element>
+					<xs:element name="computingResource" type="computingResourceType" minOccurs="0" maxOccurs="unbounded"></xs:element>
+				</xs:sequence>
+			</xs:extension>
+		</xs:complexContent>
+	</xs:complexType>
+
+	<xs:complexType name="schedulerType">
+		<xs:annotation>
+			<xs:documentation>Scheduler derived from resourceType.
+			It allows to model scheduling entity responsible for managing resources.</xs:documentation>
+		</xs:annotation>
+		<xs:complexContent>
+			<xs:extension base="resourceType">
+				<xs:sequence>
+					<xs:element name="schedulingPlugin" type="schedulingPluginType" minOccurs="0" maxOccurs="1"></xs:element>
+					<xs:element name="queues" type="queueListType" minOccurs="0"></xs:element>
+					<xs:choice minOccurs="1" maxOccurs="unbounded">
+						<xs:element name="scheduler" type="schedulerType"></xs:element>
+						<xs:element name="managedComputingResources" type="managedComputingResourcesType"></xs:element>
+					</xs:choice>
+					<xs:element name="parameter" type="parameterType" minOccurs="0" maxOccurs="unbounded"></xs:element>
+				</xs:sequence>
+			</xs:extension>
+		</xs:complexContent>
+	</xs:complexType>
+	
+	<xs:complexType name="schedulingPluginType">
+		<xs:annotation>
+			<xs:documentation>SchedulingPlugin derived from pluginType. 
+			Scheduling plugins allow plugging scheduling algorithms into the simulated environment.
+			Elements: frequency - is used to enable scheduling periodically; it specifies the time interval (in seconds by default) between subsequent scheduling invocations
+			</xs:documentation>
+		</xs:annotation>
+		<xs:complexContent>
+			<xs:extension base="pluginType">
+				<xs:sequence>
+					<xs:element name="frequency" type="doubleValueWithUnitType" minOccurs="0" maxOccurs="1"></xs:element>
+				</xs:sequence>
+			</xs:extension>
+		</xs:complexContent>
+	</xs:complexType>
+	
+	<xs:complexType name="resourceUnitType">
+		<xs:annotation>
+			<xs:documentation>Resource unit is used to define non-computing resource like memory, storage etc.
+			Elements: amount - represents concrete amount (values) of specific resource unit</xs:documentation>
+		</xs:annotation>
+		<xs:complexContent>
+			<xs:extension base="resourceType">
+				<xs:sequence>
+					<xs:element name="amount" type="doubleValueWithUnitType"/>
+					<xs:element name="parameter" type="parameterType" minOccurs="0" maxOccurs="unbounded"></xs:element>
+				</xs:sequence>
+			</xs:extension>
+		</xs:complexContent>
+	</xs:complexType>
+
+	<xs:complexType name="doubleValueWithUnitType">
+		<xs:annotation>
+			<xs:documentation>DoubleValueWitUnit derived from double. Allows providing units in which the given value is expressed
+			Attributes: unit - indicates appropriate units, for instance: seconds, watts, bytes etc. </xs:documentation>
+		</xs:annotation>
+		<xs:simpleContent>
+			<xs:extension base="xs:double">
+				<xs:attribute name="unit" type="xs:string" use="optional"/>
+			</xs:extension>	
+		</xs:simpleContent>	
+	</xs:complexType>
+	
+	<xs:complexType name="stringValueWithUnitType">
+		<xs:annotation>
+			<xs:documentation>StringValueWitUnit derived from string. Allows providing units in which the given value is expressed
+			Attributes: unit - indicates appropriate units. </xs:documentation>
+		</xs:annotation>
+		<xs:simpleContent>
+			<xs:extension base="xs:string">
+				<xs:attribute name="unit" type="xs:string" use="optional"/>
+			</xs:extension>	
+		</xs:simpleContent>	
+	</xs:complexType>
+	
+	<xs:complexType name="queueListType">
+		<xs:annotation>
+			<xs:documentation>Profile acts as a container for resource profiles: power and air throughput</xs:documentation>
+		</xs:annotation>
+		<xs:sequence>
+			<xs:element name="queue" type="queueType" minOccurs="1" maxOccurs="unbounded"></xs:element>
+		</xs:sequence>
+	</xs:complexType>
+	
+	<xs:complexType name="queueType">
+		<xs:annotation>
+			<xs:documentation>Profile acts as a container for resource profiles: power and air throughput</xs:documentation>
+		</xs:annotation>
+		<xs:sequence>
+			<xs:element name="name" type="xs:string"></xs:element>
+			<xs:element name="priority" type="xs:int" minOccurs="0"></xs:element>
+			<xs:element name="reservation" type="xs:boolean" minOccurs="0" ></xs:element>
+		</xs:sequence>
+	</xs:complexType>
+	
+	<xs:complexType name="managedComputingResourcesType">
+		<xs:annotation>
+			<xs:documentation>ManagedComputingResource type specifies computing resources controlled by scheduler.
+			They can be provided either by listing their names or listing the group ids which they belong to.
+			Attributes: include - specifies whether the given resource layer (listed resources) can be allocated by the scheduler
+			In other words, false (default) value indicates that scheduler maneges only the subcomponents of the listed resources;
+			true value determines that also listed resources will be under the control of the defined scheduler</xs:documentation>
+		</xs:annotation>
+		<xs:choice>
+			<xs:element name="resourceName" type="xs:string" minOccurs="1" maxOccurs="unbounded"></xs:element>
+			<xs:element name="resourceGroupId" type="xs:string" minOccurs="1" maxOccurs="unbounded"></xs:element>
+		</xs:choice>
+		<xs:attribute name="include" type="xs:boolean" default="false"/>
+	</xs:complexType>
+
+	<xs:complexType name="energyEstimationPluginType">
+		<xs:annotation>
+			<xs:documentation>EnergyEstimationPlugin derived from pluginType. 
+			Energy estimation plugin is used to estimate energy consumption of the given computing resource. 
+			It has access to the detailed resource description including power and air throughput profiles
+			and application characteristics running on a given resource</xs:documentation>
+		</xs:annotation>
+		<xs:complexContent>
+			<xs:extension base="pluginType"/>
+		</xs:complexContent>
+	</xs:complexType>
+	
+	<xs:complexType name="profileType">
+		<xs:annotation>
+			<xs:documentation>Profile acts as a container for resource profiles: power and air throughput</xs:documentation>
+		</xs:annotation>
+		<xs:sequence>
+			<xs:element name="powerProfile" type="powerProfileType" minOccurs="0"></xs:element>
+			<xs:element name="airThroughputProfile" type="airThroughputProfileType" minOccurs="0"></xs:element>
+		</xs:sequence>
+	</xs:complexType>
+	
+	<xs:complexType name="powerProfileType">
+		<xs:annotation>
+			<xs:documentation>Power profile provides energyEstimation plugin, powerStates and other power-related parameters definition</xs:documentation>
+		</xs:annotation>
+		<xs:sequence>
+			<xs:element name="energyEstimationPlugin" type="energyEstimationPluginType" minOccurs="0"></xs:element>
+			<xs:element name="powerStates" type="powerStatesType" minOccurs="0"></xs:element>
+			<xs:element name="parameter" type="parameterType" minOccurs="0" maxOccurs="unbounded"></xs:element>
+		</xs:sequence>
+	</xs:complexType>
+	
+	<xs:complexType name="powerStatesType">
+		<xs:annotation>
+			<xs:documentation>PowerState type act as a container for power states. It contains energy-related characteristics of the computing resource</xs:documentation>
+		</xs:annotation>
+		<xs:sequence>
+			<xs:element name="powerState" type="powerStateType" minOccurs="1" maxOccurs="unbounded"></xs:element>
+		</xs:sequence>
+	</xs:complexType>
+	
+	<xs:complexType name="powerStateType">
+		<xs:annotation>
+			<xs:documentation>Power state defines available (for computing resource) power states.
+			Elements: name - denotes name of the given power state
+			powerUsage - defines power consumption in the given state
+			transition - specifies possible power states transitions from the given power state</xs:documentation>
+		</xs:annotation>
+		<xs:sequence>
+			<xs:element name="name" type="xs:string"></xs:element>
+			<xs:element name="powerUsage" type="doubleValueWithUnitType" minOccurs="0" maxOccurs="1"></xs:element>
+			<xs:element name="transition" type="powerStatesTransitionType" minOccurs="0" maxOccurs="unbounded"></xs:element>
+			<xs:element name="parameter" type="parameterType" minOccurs="0" maxOccurs="unbounded"></xs:element>
+		</xs:sequence>
+	</xs:complexType>
+	
+	<xs:complexType name="powerStatesTransitionType">
+		<xs:annotation>
+			<xs:documentation>Description of power states transtition
+			Elements: to - denotes name of target power state
+			powerUsage - defines transition cost in the form of power consumption
+			time - specifies transition time</xs:documentation>
+		</xs:annotation>
+		<xs:sequence>
+			<xs:element name="to" type="xs:string"></xs:element>
+			<xs:element name="powerUsage" type="doubleValueWithUnitType"></xs:element>
+			<xs:element name="time" type="doubleValueWithUnitType"></xs:element>
+			<xs:element name="parameter" type="parameterType" minOccurs="0" maxOccurs="unbounded"></xs:element>
+		</xs:sequence>
+	</xs:complexType>
+	
+	<xs:complexType name="airThroughputEstimationPluginType">
+		<xs:annotation>
+			<xs:documentation>AirThroughputEstimationPlugin derived from pluginType. 
+			Air Throughput plugin is used to estimate air flow value based on the defined air throughput states</xs:documentation>
+		</xs:annotation>
+		<xs:complexContent>
+			<xs:extension base="pluginType"/>
+		</xs:complexContent>
+	</xs:complexType>
+	
+	<xs:complexType name="airThroughputProfileType">
+		<xs:annotation>
+			<xs:documentation>AirThrouhputProfile provides airThroughputEstimation plugin, airThroughputStates and other airThroughput-related parameters definition</xs:documentation>
+		</xs:annotation>
+		<xs:sequence>
+			<xs:element name="airThroughputEstimationPlugin" type="airThroughputEstimationPluginType" minOccurs="0"></xs:element>
+			<xs:element name="airThroughputStates" type="airThroughputStatesType" minOccurs="0"></xs:element>
+			<xs:element name="parameter" type="parameterType" minOccurs="0" maxOccurs="unbounded"></xs:element>
+		</xs:sequence>
+	</xs:complexType>
+	
+	<xs:complexType name="airThroughputStatesType">
+		<xs:annotation>
+			<xs:documentation>AirThroughputStates type act as a container for air throughput states.</xs:documentation>
+		</xs:annotation>
+		<xs:sequence>
+			<xs:element name="airThroughputState" type="airThroughputStateType" minOccurs="1" maxOccurs="unbounded"></xs:element>
+		</xs:sequence>
+	</xs:complexType>
+	
+	<xs:complexType name="airThroughputStateType">
+		<xs:annotation>
+			<xs:documentation>Air througput state provides means to define air flow level. 
+			It can represent, for instance, a fan working state</xs:documentation>
+		</xs:annotation>
+		<xs:sequence>
+			<xs:element name="name" type="xs:string"></xs:element>
+			<xs:element name="value" type="doubleValueWithUnitType"></xs:element>
+			<xs:element name="powerUsage" type="doubleValueWithUnitType" minOccurs="0"></xs:element>
+			<xs:element name="parameter" type="parameterType" minOccurs="0" maxOccurs="unbounded"></xs:element>
+		</xs:sequence>
+	</xs:complexType>
+	
+	<xs:complexType name="locationType">
+		<xs:annotation>
+			<xs:documentation>The location type describes placement of the computing resource using 3 coordinates</xs:documentation>
+		</xs:annotation>
+		<xs:sequence>
+			<xs:element name="horizontal" type="xs:long"/>
+			<xs:element name="vertical" type="xs:long"/>
+			<xs:element name="depth" type="xs:long"/>
+			<xs:element name="parameter" type="parameterType" minOccurs="0" maxOccurs="unbounded"></xs:element>
+		</xs:sequence>
+	</xs:complexType>
+	
+	<xs:complexType name="parameterType">
+		<xs:annotation>
+			<xs:documentation>Parameter of resource. Allows defining additional resource parameters.
+			Contains a list of parameter values or a list of key-value pairs.
+			Attribute : name - denotes parameter name</xs:documentation>
+		</xs:annotation>
+		<xs:choice>
+			<xs:element name="value" type="stringValueWithUnitType" minOccurs="0" maxOccurs="unbounded"/>
+			<xs:sequence>
+				<xs:element name="property" minOccurs="0" maxOccurs="unbounded">
+					<xs:complexType>
+						<xs:annotation>
+							<xs:documentation>Property of parameter. Allows defining additional properties of parameter as a list of values.
+							Attribute : name - denotes property name</xs:documentation>
+						</xs:annotation>
+						<xs:sequence>
+							<xs:element name="value" type="stringValueWithUnitType" minOccurs="0" maxOccurs="unbounded"/>
+						</xs:sequence>
+						<xs:attribute name="name" type="xs:string" use="required"/>
+					</xs:complexType>
+				</xs:element>
+			</xs:sequence>
+		</xs:choice>
+		<xs:attribute name="name" type="xs:string" use="required"/>
+	</xs:complexType>
+	
+	<xs:element name="environment">
+		<xs:annotation>
+			<xs:documentation>Schema describing simulation environment</xs:documentation>
+		</xs:annotation>
+		<xs:complexType>
+			<xs:sequence>
+				<xs:element name="description" type="xs:string" minOccurs="0" ></xs:element>
+				<xs:element name="timeEstimationPlugin" type="timeEstimationPluginType" minOccurs="0" maxOccurs="1"></xs:element>
+				<xs:element name="resources">
+					<xs:annotation>
+						<xs:documentation>Description of resources</xs:documentation>
+					</xs:annotation>
+					<xs:complexType>
+						<xs:sequence>
+							<xs:element name="description" type="xs:string" minOccurs="0" ></xs:element>
+							<xs:element name="computingResource" type="computingResourceType" maxOccurs="unbounded"/>
+							<xs:element name="scheduler" type="schedulerType" maxOccurs="unbounded"/>
+						</xs:sequence>
+					</xs:complexType>
+				</xs:element>
+				<xs:element name="templates" minOccurs="0">
+					<xs:annotation>
+						<xs:documentation>Definition of computing resource templates that can/will be used in resource description section </xs:documentation>
+					</xs:annotation>
+					<xs:complexType>
+						<xs:sequence>
+							<xs:element name="description" type="xs:string" minOccurs="0" ></xs:element>
+							<xs:element name="computingResourceTemplate" type="computingResourceTemplateType" maxOccurs="unbounded"/>
+						</xs:sequence>
+					</xs:complexType>
+				</xs:element>
+			</xs:sequence>
+		</xs:complexType>
+	</xs:element>
+
+</xs:schema>
Index: DCWoRMS/trunk/simulator/schemas/resources/example/example7.xml
===================================================================
--- DCWoRMS/trunk/simulator/schemas/resources/example/example7.xml	(revision 477)
+++ DCWoRMS/trunk/simulator/schemas/resources/example/example7.xml	(revision 477)
@@ -0,0 +1,216 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<environment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+	xsi:noNamespaceSchemaLocation="../XSSimResSchema.xsd">
+	
+	<timeEstimationPlugin>
+		<name>ExecTimeEstimationPlugin</name>
+	</timeEstimationPlugin>
+	
+	<!-- Opis dla data center z uwzglednieniem szablonow i przejsc miedzy stanami energetycznymi -->
+	<resources>
+		<computingResource class="DataCenter" name="compRes1">
+			<computingResource class="Rack" name="rack1">
+				<computingResource class="ComputingNode" name="node11">
+				</computingResource>
+				<computingResource class="ComputingNode" name="node12">
+				</computingResource>
+			</computingResource>	
+			<computingResource class="Rack" name="rack2">
+				<computingResource class="ComputingNode" name="node21">
+					<templateId>modelNodeA</templateId>
+				</computingResource>
+				<computingResource class="ComputingNode" name="node22">
+					<computingResource class="Processor" count="8">
+						<templateId>modelProcessorB</templateId>
+					</computingResource>
+				</computingResource>
+			</computingResource>
+		</computingResource>	
+		<scheduler class="Cluster" name="cluster1">
+			<schedulingPlugin>
+				<name>FCFSLocalSchedulingPlugin</name>
+			</schedulingPlugin>		
+			<managedComputingResources include="false">
+				<resourceName>compRes1</resourceName>
+			</managedComputingResources>
+		</scheduler>
+	</resources>
+	
+	<templates>
+		<computingResourceTemplate class="ComputingNode" name="modelNodeA">
+			<computingResource class="Processor" count="4">
+				<templateId>modelProcessorA</templateId>
+			</computingResource>
+		</computingResourceTemplate>	
+		<computingResourceTemplate class="Processor" name="modelProcessorA">
+			<profile>
+				<powerProfile>
+					<energyEstimationPlugin>
+						<name>CPUEnergyEstimationPlugin</name>
+					</energyEstimationPlugin>
+					<powerStates>
+						<powerState>
+							<name>ON</name>
+							<powerUsage>20</powerUsage>
+							<transition>
+								<to>OFF</to>
+								<powerUsage>30</powerUsage>
+								<time>30</time>
+							</transition>
+						</powerState>
+						<powerState>
+							<name>OFF</name>
+							<powerUsage>0</powerUsage>
+							<transition>
+								<to>ON</to>
+								<powerUsage>40</powerUsage>
+								<time>60</time>
+							</transition>
+						</powerState>
+					</powerStates>
+					<parameter name="pState">
+						<property name="name">
+							<value>P0</value>
+						</property>	
+						<property name="frequency">
+							<value>3000</value>
+						</property>		
+						<property name="voltage">
+							<value>1.3</value>
+						</property>
+						<property name="powerUsage">
+							<value>14</value>
+						</property>						
+					</parameter>
+					<parameter name="pState">
+						<property name="name">
+							<value>P1</value>
+						</property>	
+						<property name="frequency">
+							<value>2660</value>
+						</property>		
+						<property name="voltage">
+							<value>1.2</value>
+						</property>
+						<property name="powerUsage">
+							<value>12</value>
+						</property>						
+					</parameter>
+					<parameter name="pState">
+						<property name="name">
+							<value>P2</value>
+						</property>	
+						<property name="frequency">
+							<value>2330</value>
+						</property>		
+						<property name="voltage">
+							<value>1.1</value>
+						</property>
+						<property name="powerUsage">
+							<value>10</value>
+						</property>						
+					</parameter>
+					<parameter name="pState">
+						<property name="name">
+							<value>P3</value>
+						</property>	
+						<property name="frequency">
+							<value>2000</value>
+						</property>		
+						<property name="voltage">
+							<value>1.0</value>
+						</property>
+						<property name="powerUsage">
+							<value>8</value>
+						</property>						
+					</parameter>							
+				</powerProfile>
+			</profile>
+		</computingResourceTemplate>
+		<computingResourceTemplate class="Processor" name="modelProcessorB">
+			<profile>
+				<powerProfile>
+				 	<energyEstimationPlugin>
+						<name>CPUEnergyEstimationPlugin</name>
+					</energyEstimationPlugin>
+					<powerStates>
+						<powerState>
+							<name>ON</name>
+							<powerUsage>20</powerUsage>
+							<transition>
+								<to>OFF</to>
+								<powerUsage>30</powerUsage>
+								<time>30</time>
+							</transition>
+						</powerState>
+						<powerState>
+							<name>OFF</name>
+							<powerUsage>0</powerUsage>
+							<transition>
+								<to>ON</to>
+								<powerUsage>40</powerUsage>
+								<time>60</time>
+							</transition>
+						</powerState>
+					</powerStates>
+					<parameter name="pState">
+						<property name="name">
+							<value>P0</value>
+						</property>	
+						<property name="frequency">
+							<value>2200</value>
+						</property>		
+						<property name="voltage">
+							<value>1.3</value>
+						</property>
+						<property name="powerUsage">
+							<value>20</value>
+						</property>						
+					</parameter>
+					<parameter name="pState">
+						<property name="name">
+							<value>P1</value>
+						</property>	
+						<property name="frequency">
+							<value>2000</value>
+						</property>		
+						<property name="voltage">
+							<value>1.2</value>
+						</property>
+						<property name="powerUsage">
+							<value>17</value>
+						</property>						
+					</parameter>
+					<parameter name="pState">
+						<property name="name">
+							<value>P2</value>
+						</property>	
+						<property name="frequency">
+							<value>1800</value>
+						</property>		
+						<property name="voltage">
+							<value>1.1</value>
+						</property>
+						<property name="powerUsage">
+							<value>16</value>
+						</property>						
+					</parameter>
+					<parameter name="pState">
+						<property name="name">
+							<value>P3</value>
+						</property>	
+						<property name="frequency">
+							<value>1000</value>
+						</property>		
+						<property name="voltage">
+							<value>1.0</value>
+						</property>
+						<property name="powerUsage">
+							<value>10</value>
+						</property>						
+					</parameter>
+				</powerProfile>
+			</profile>
+		</computingResourceTemplate>
+	</templates>
+</environment>
Index: DCWoRMS/trunk/simulator/schemas/resources/example/coolemall_alaternative/example1.xml
===================================================================
--- DCWoRMS/trunk/simulator/schemas/resources/example/coolemall_alaternative/example1.xml	(revision 477)
+++ DCWoRMS/trunk/simulator/schemas/resources/example/coolemall_alaternative/example1.xml	(revision 477)
@@ -0,0 +1,64 @@
+<environment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+	xsi:noNamespaceSchemaLocation="../../XSSimAlternativeResSchema.xsd">
+
+	<!-- Plugin defined in class ExecTimeEstimationPlugin will be used to estimate task execution time -->
+	<timeEstimationPlugin>
+		<name>ExecTimeEstimationPlugin</name>
+	</timeEstimationPlugin>
+
+	<resources>
+		<description>
+		This basic example defines simple resource hierarchy within a single data center (named dataCenter). It consists of 4 racks
+		(with names created according to the name attribute and subsequent natural number: rack_0, rack_1, rack_2 and rack_3). 
+		Each of them contains 64 computing nodes (names will be generated using resource class and subsequent natural number: 
+		ComputingNode_0, ComputingNode_1,...ComputingNode_255) with 2 processors. Speed of every processor is equal 2. 
+		All computing nodes have 12GB of memory and 4TB storage.
+		Task are submitted to the single cluster built on top of the data center. It is under the control of local scheduler
+		with FCFS scheduling policy. The commented out cluster definition is equal to the one above it 
+		(it demonstrates alternative way of defining managed computing resources using "include" attribute).
+		</description>
+		
+		<dataCenter name="dataCenter">
+			<rack count="4" name="rack">
+				<computingNode count="64">
+					<resourceUnit class="Memory">
+						<amount unit="MB">12288</amount>
+					</resourceUnit>
+					<resourceUnit class="Storage">
+						<amount unit="MB">4194304</amount>
+					</resourceUnit>
+					<processor count="2">
+						<parameter name="speed">
+							<value>2</value>
+						</parameter>
+					</processor>
+				</computingNode>
+			</rack>
+		</dataCenter>
+
+		<scheduler class="Cluster" name="cluster">
+			<schedulingPlugin>
+				<name>FCFSLocalSchedulingPlugin</name>
+			</schedulingPlugin>	
+			<managedComputingResources include="false">
+				<resourceName>dataCenter</resourceName>
+			</managedComputingResources>
+		</scheduler>
+		
+		<!-- 
+		<scheduler class="Cluster" id="cluster">
+			<schedulingPlugin>
+				<name>FCFSLocalSchedulingPlugin</name>
+			</schedulingPlugin>		
+			<managedComputingResource include="true">
+				<resourceId>rack_0</resourceId>
+				<resourceId>rack_1</resourceId>
+				<resourceId>rack_2</resourceId>
+				<resourceId>rack_3</resourceId>
+			</managedComputingResource>
+		</scheduler>
+		 -->
+
+	</resources>
+	
+</environment>
Index: DCWoRMS/trunk/simulator/schemas/resources/example/coolemall_alaternative/example2.xml
===================================================================
--- DCWoRMS/trunk/simulator/schemas/resources/example/coolemall_alaternative/example2.xml	(revision 477)
+++ DCWoRMS/trunk/simulator/schemas/resources/example/coolemall_alaternative/example2.xml	(revision 477)
@@ -0,0 +1,139 @@
+<environment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+	xsi:noNamespaceSchemaLocation="../../XSSimAlternativeResSchema.xsd">
+	
+	<resources>
+		<description>
+		This example aims to show how to introduce energy-related parameters to the simulation environment 
+		Simulated architecture consists of data center with 4 racks. Each of them contains 64 computing nodes with 2 processors. 
+		Speed of every processor is equal 2. All computing nodes have 12GB of memory and 4TB storage.
+		For the detailed energy characteristics description, see the following comments. 
+		Task are submitted to the single cluster built on top of the data center. It is under the control of local scheduler
+		with FCFS scheduling policy.
+		</description>
+		
+		<dataCenter name="dataCenter">
+			<rack count="4" name="rack">
+				<computingNode count="64">
+					<profile>
+						<!-- Definition of computing node power profile
+						According to it, there are two supported power states: ON and OFF
+						Computing node in ON state consumes 20 watts, while in OFF state 0.
+						Transition between ON and OFF state takes 30 seconds and consumes 30 watts, 
+						while in the opposite direction energy consumption rate is equal 40 watts over 60 seconds.
+						 -->
+						<powerProfile>
+							<!-- ComputingNodeEnergyEstimationPlugin will be used to customize estimation of energy consumptions to
+							specific applications and hardware on computing node level-->
+							<energyEstimationPlugin>
+								<name>ComputingNodeEnergyEstimationPlugin</name>
+							</energyEstimationPlugin>
+							<powerStates>
+								<powerState>
+									<name>ON</name>
+									<powerUsage unit="W">20</powerUsage>
+									<transition>
+										<to>OFF</to>
+										<powerUsage unit="W">30</powerUsage>
+										<time unit="s">30</time>
+									</transition>
+								</powerState>
+								<powerState>
+									<name>OFF</name>
+									<powerUsage unit="W">0</powerUsage>
+									<transition>
+										<to>ON</to>
+										<powerUsage unit="W">40</powerUsage>
+										<time unit="s">60</time>
+									</transition>
+								</powerState>
+							</powerStates>
+						</powerProfile>
+						<!-- Definition of computing node air throughput profile (for instance fan related with the given node)
+						There are 4 states, characterized by name, air flow value and power draw.
+						 -->
+						<airThroughputProfile>
+							<airThroughputStates>
+								<airThroughputState>
+									<name>mode1</name>
+									<value unit="m3/h">105</value>
+									<powerUsage unit="W">10.3</powerUsage>
+								</airThroughputState>
+								<airThroughputState>
+									<name>mode2</name>
+									<value unit="m3/h">110</value>
+									<powerUsage unit="W">10.9</powerUsage>
+								</airThroughputState>
+								<airThroughputState>
+									<name>mode3</name>
+									<value unit="m3/h">115</value>
+									<powerUsage unit="W">11.4</powerUsage>
+								</airThroughputState>
+								<airThroughputState>
+									<name>mode4</name>
+									<value unit="m3/h">120</value>
+									<powerUsage unit="W">12.1</powerUsage>
+								</airThroughputState>
+							</airThroughputStates>
+						</airThroughputProfile>
+					</profile>
+					<processor count="2">
+						<profile>
+							 <!-- Definition of processor power profile
+							 According to it, processor can operate in two p-states: P0 and P1
+                             P0 p-state is characterized by operating frequency - 3000,
+                             voltage level - 1.3 and power usage - 35. 
+                             Next p-state - P1 has the following values: 2666, 1.1, 30, respectively.
+							 -->
+							<powerProfile>
+								<!-- CPUEnergyEstimationPlugin will be used to estimate energy consumption on processor level.-->
+								<energyEstimationPlugin>
+									<name>CPUEnergyEstimationPlugin</name>
+								</energyEstimationPlugin>
+								
+								<pStates>
+									<pState>
+										<name>P0</name>
+										<frequency unit="Hz">3000</frequency>
+										<voltage unit="V">1.3</voltage>
+										<powerUsage unit="W">35</powerUsage>
+									</pState>
+									<pState>
+										<name>P1</name>
+										<frequency unit="Hz">2666</frequency>
+										<voltage unit="V">1.1</voltage>
+										<powerUsage unit="W">30</powerUsage>
+									</pState>
+									<pState>
+										<name>P2</name>
+										<frequency unit="Hz">3200</frequency>
+										<voltage unit="V">1.3</voltage>
+										<powerUsage unit="W">85</powerUsage>
+									</pState>
+									<pState>
+										<name>P3</name>
+										<frequency unit="Hz">3000</frequency>
+										<voltage unit="V">1.25</voltage>
+										<powerUsage unit="W">76</powerUsage>
+									</pState>
+								</pStates>	
+							</powerProfile>
+						</profile>
+					</processor>
+				</computingNode>
+			</rack>
+		</dataCenter>
+		
+		<scheduler class="Cluster" name="cluster">
+			<schedulingPlugin>
+				<name>FCFSLocalSchedulingPlugin</name>
+			</schedulingPlugin>		
+			<managedComputingResources include="true">
+				<resourceName>rack_0</resourceName>
+				<resourceName>rack_1</resourceName>
+				<resourceName>rack_2</resourceName>
+				<resourceName>rack_3</resourceName>
+			</managedComputingResources>
+		</scheduler>
+
+	</resources>
+</environment>
Index: DCWoRMS/trunk/simulator/schemas/resources/example/coolemall_alaternative/example3.xml
===================================================================
--- DCWoRMS/trunk/simulator/schemas/resources/example/coolemall_alaternative/example3.xml	(revision 477)
+++ DCWoRMS/trunk/simulator/schemas/resources/example/coolemall_alaternative/example3.xml	(revision 477)
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<environment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+	xsi:noNamespaceSchemaLocation="../../XSSimAlternativeResSchema.xsd">
+	
+	<resources>
+		<description>
+        This short example presents how to describe computing resource location.
+        Simulated architecture consists of data center with 2 racks named rack1 and rack2, respectively.
+        Location of rack1 is defined using vector (4, 0, 2), while rack2 using vector (6, 0, 2)
+		Rack1 contains 2 computing nodes - node11 and node12. Appropriate coordinates for node11 are (0, 0, 0)
+		and for node12 (0, 1, 0). Rack2 contains 2 computing nodes named node21 and node22. Their location is defined as follows:
+		(0, 0, 0) for node21 and (1, 0, 0) for node22.
+		Using 3 coordinates allows to express location in various ways. It can be interpreted as a absolute placement in 3D, as well as the
+		relative position according to the parent computing resource. Moreover, it is possible to define only the arrangement of
+		the computing resources by increasing only the value of one coordinate.
+		In the following example, racks location is defined using relative positions (with respect to the data center), while
+		for nodes the order of appearance is specified (with additional direction in which the order tends
+		(node12 is located after node11 and placed above it, while node22 is located on the right side of node21)
+		It has to be stressed that simulator only stores the location parameters and does not process them. Hence, their interpretation should be done by user.
+		</description>
+		<dataCenter name="dataCenter">
+			<rack  name="rack1">
+				<location>
+					<horizontal>4</horizontal>
+					<vertical>0</vertical>
+					<depth>2</depth>
+				</location>
+				<computingNode name="node11">
+					<location>
+						<horizontal>0</horizontal>
+						<vertical>0</vertical>
+						<depth>0</depth>
+					</location>
+				</computingNode>
+				<computingNode  name="node12">
+					<location>
+						<horizontal>0</horizontal>
+						<vertical>1</vertical>
+						<depth>0</depth>
+					</location>
+				</computingNode>
+			</rack>	
+			<rack name="rack2">
+				<location>
+					<horizontal>6</horizontal>
+					<vertical>0</vertical>
+					<depth>2</depth>
+				</location>
+				<computingNode name="node21">
+					<location>
+						<horizontal>0</horizontal>
+						<vertical>0</vertical>
+						<depth>0</depth>
+					</location>
+				</computingNode>
+				<computingNode name="node22">
+					<location>
+						<horizontal>1</horizontal>
+						<vertical>0</vertical>
+						<depth>0</depth>
+					</location>
+				</computingNode>
+			</rack>
+		</dataCenter>	
+		<scheduler class="Cluster" name="cluster">
+			<schedulingPlugin>
+				<name>FCFSLocalSchedulingPlugin</name>
+			</schedulingPlugin>		
+			<managedComputingResources include="false">
+				<resourceName>dataCenter</resourceName>
+			</managedComputingResources>
+		</scheduler>
+	</resources>
+</environment>
Index: DCWoRMS/trunk/simulator/schemas/resources/example/coolemall_alaternative/example4.xml
===================================================================
--- DCWoRMS/trunk/simulator/schemas/resources/example/coolemall_alaternative/example4.xml	(revision 477)
+++ DCWoRMS/trunk/simulator/schemas/resources/example/coolemall_alaternative/example4.xml	(revision 477)
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<environment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+	xsi:noNamespaceSchemaLocation="../../XSSimAlternativeResSchema.xsd">
+	
+	<resources>
+		<description>
+		The goal of this example is to introduce the templates usage. 
+		It focuses on showing that appropriate templates may be included on various computing resource levels and moreover can be formed using other templates.
+		Simulated architecture consists of data center with 2 racks named rack1 and rack2 respectively.
+		Rack1 contains 2 computing nodes - node11 and node12, described in common way.
+		Nodes in rack2 are defined using template. Node21 refers to template modelNodeA and, 
+		thus will be created with respect to the specification given in that template (node will have 4 processors with speed 2).
+		Node22 contains 8 processors which definition is included in modeProcessorB template.
+		</description>
+		<dataCenter name="dataCenter">
+			<rack name="rack1">
+				<computingNode name="node11">
+				</computingNode>
+				<computingNode name="node12">
+				</computingNode>
+			</rack>	
+			<rack name="rack2">
+				<computingResource class="ComputingNode" name="node21">
+					<templateId>modelNodeA</templateId>
+				</computingResource>
+				<computingResource class="ComputingNode" name="node22">
+					<computingResource class="Processor" count="8">
+						<templateId>modelProcessorB</templateId>
+					</computingResource>
+				</computingResource>
+			</rack>
+		</dataCenter>	
+		<scheduler class="Cluster" name="cluster">
+			<schedulingPlugin>
+				<name>FCFSLocalSchedulingPlugin</name>
+			</schedulingPlugin>		
+			<managedComputingResources include="false">
+				<resourceName>dataCenter</resourceName>
+			</managedComputingResources>
+		</scheduler>
+	</resources>
+	
+	<templates>
+		<description>
+		There are two processor templates named modelProcessorA (with cpu speed 2) and modelProcessorB (with cpu speed 1).
+		There is also one computing node template denoted as modelNodeA, which contains 4 processors that refer to modelProcessorA template.
+		That means that the given processors will be created according to the characteristics defined in template modelProcessorA (they will have speed equal 2).
+		</description>
+		<computingResourceTemplate class="ComputingNode" name="modelNodeA">
+			<processor count="4">
+				<templateId>modelProcessorA</templateId>
+			</processor>
+		</computingResourceTemplate>	
+		<computingResourceTemplate class="Processor" name="modelProcessorA">
+			<parameter name="speed">
+				<value>2</value>
+			</parameter>
+		</computingResourceTemplate>
+		<computingResourceTemplate class="Processor" name="modelProcessorB">
+			<parameter name="speed">
+				<value>1</value>
+			</parameter>
+		</computingResourceTemplate>
+	</templates>
+</environment>
Index: DCWoRMS/trunk/simulator/schemas/resources/example/coolemall_alaternative/example5.xml
===================================================================
--- DCWoRMS/trunk/simulator/schemas/resources/example/coolemall_alaternative/example5.xml	(revision 477)
+++ DCWoRMS/trunk/simulator/schemas/resources/example/coolemall_alaternative/example5.xml	(revision 477)
@@ -0,0 +1,252 @@
+<environment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+	xsi:noNamespaceSchemaLocation="../../XSSimAlternativeResSchema.xsd">
+
+	
+	<!-- CoolEmAll testbed description 
+	P-States characteristics are fabricated-->
+	<resources>
+		<dataCenter count="0">
+			<rack name="rack">
+				<resourceUnit class="Storage">
+					<amount unit="MB">4915200</amount>
+					<parameter name=""></parameter>
+				</resourceUnit>
+				<parameter name="PSU">
+					<property name="powerUsage">
+						<value unit="W">180</value>
+					</property>
+				</parameter>
+				<computingResource class="RECS" name="recs1">
+					<location>
+						<horizontal>0</horizontal>
+						<vertical>0</vertical>
+						<depth>0</depth>
+					</location>
+					<computingNode>
+						<resourceUnit class="Memory">
+							<amount unit="MB">16384</amount>
+						</resourceUnit>
+						<profile>
+							<powerProfile>
+								<powerStates>
+									<powerState>
+										<name>ON</name>
+										<powerUsage unit="W">400</powerUsage>
+									</powerState>
+									<powerState>
+										<name>OFF</name>
+										<powerUsage unit="W">0</powerUsage>
+									</powerState>
+								</powerStates>
+							</powerProfile>
+						</profile>
+						<processor>
+							<parameter name="speed">
+								<value>2</value>
+							</parameter>
+							<profile>
+								<powerProfile>
+									<pStates>
+										<pState>
+											<name>P0</name>
+											<frequency unit="Hz">3600</frequency>
+											<voltage unit="V">1.4</voltage>
+											<powerUsage unit="W">103</powerUsage>
+										</pState>
+										<pState>
+											<name>P1</name>
+											<frequency unit="Hz">3400</frequency>
+											<voltage unit="V">1.35</voltage>
+											<powerUsage unit="W">94</powerUsage>
+										</pState>
+										<pState>
+											<name>P2</name>
+											<frequency unit="Hz">3200</frequency>
+											<voltage unit="V">1.3</voltage>
+											<powerUsage unit="W">85</powerUsage>
+										</pState>
+										<pState>
+											<name>P3</name>
+											<frequency unit="Hz">3000</frequency>
+											<voltage unit="V">1.25</voltage>
+											<powerUsage unit="W">76</powerUsage>
+										</pState>
+									</pStates>	
+								</powerProfile>
+							</profile>
+							<core count="4"/>
+						</processor>
+					</computingNode>
+				</computingResource>
+				<computingResource class="RECS" name="recs2">
+					<location>
+						<horizontal>0</horizontal>
+						<vertical>1</vertical>
+						<depth>0</depth>
+					</location>
+					<computingNode count="18">
+						<resourceUnit class="Memory">
+							<amount unit="MB">4096</amount>
+						</resourceUnit>
+						<profile>
+							<powerProfile>
+								<powerStates>
+									<powerState>
+										<name>ON</name>
+										<powerUsage unit="W">360</powerUsage>
+									</powerState>
+									<powerState>
+										<name>OFF</name>
+										<powerUsage unit="W">0</powerUsage>
+									</powerState>
+								</powerStates>
+							</powerProfile>
+						</profile>
+						<processor type="Atom">
+							<profile>
+								<powerProfile>
+									<pStates>
+										<pState>
+											<name>P0</name>
+											<frequency unit="Hz">1100</frequency>
+											<voltage unit="V">1.16</voltage>
+											<powerUsage unit="W">45</powerUsage>
+										</pState>
+										<pState>
+											<name>P1</name>
+											<frequency unit="Hz">1000</frequency>
+											<voltage unit="V">1.14</voltage>
+											<powerUsage unit="W">40</powerUsage>
+										</pState>
+										<pState>
+											<name>P2</name>
+											<frequency unit="Hz">900</frequency>
+											<voltage unit="V">1.12</voltage>
+											<powerUsage unit="W">35</powerUsage>
+										</pState>
+										<pState>
+											<name>P3</name>
+											<frequency unit="Hz">800</frequency>
+											<voltage unit="V">1.1</voltage>
+											<powerUsage unit="W">30</powerUsage>
+										</pState>
+									</pStates>		
+								</powerProfile>
+							</profile>
+							<core count="2"/>
+						</processor>
+					</computingNode>
+				</computingResource>
+				<computingResource class="RECS" name="recs3">
+					<location>
+						<horizontal>0</horizontal>
+						<vertical>2</vertical>
+						<depth>0</depth>
+					</location>
+					<computingNode count="18">
+						<resourceUnit class="Memory">
+							<amount unit="MB">2048</amount>
+						</resourceUnit>
+						<profile>
+							<powerProfile>
+								<powerStates>
+									<powerState>
+										<name>ON</name>
+										<powerUsage unit="W">300</powerUsage>
+									</powerState>
+									<powerState>
+										<name>OFF</name>
+										<powerUsage unit="W">0</powerUsage>
+									</powerState>
+								</powerStates>
+							</powerProfile>
+						</profile>
+						<processor type="AMD Fusion">
+							<profile>
+								<powerProfile>
+									<pStates>
+										<pState>
+											<name>P0</name>
+											<frequency unit="Hz">1000</frequency>
+											<voltage unit="V">1.15</voltage>
+											<powerUsage unit="W">30</powerUsage>
+										</pState>
+										<pState>
+											<name>P1</name>
+											<frequency unit="Hz">866</frequency>
+											<voltage unit="V">1.1</voltage>
+											<powerUsage unit="W">25</powerUsage>
+										</pState>
+									</pStates>	
+								</powerProfile>
+							</profile>
+							<core count="2"/>
+						</processor>
+					</computingNode>
+				</computingResource>
+				<computingResource class="RECS" name="recs4">
+				 	<location>
+						<horizontal>0</horizontal>
+						<vertical>3</vertical>
+						<depth>0</depth>
+					</location>
+					<computingNode count="18">
+						<resourceUnit class="Memory">
+							<amount unit="MB">2048</amount>
+						</resourceUnit>
+						<profile>
+							<powerProfile>
+								<powerStates>
+									<powerState>
+										<name>ON</name>
+										<powerUsage unit="W">100</powerUsage>
+									</powerState>
+									<powerState>
+										<name>HIBERNATE</name>
+										<powerUsage unit="W">20</powerUsage>
+									</powerState>
+									<powerState>
+										<name>OFF</name>
+										<powerUsage unit="W">0</powerUsage>
+									</powerState>
+								</powerStates>
+							</powerProfile>
+						</profile>
+						<processor type="ARM">
+							<profile>
+								<powerProfile>
+									<pStates>
+										<pState>
+											<name>P0</name>
+											<frequency unit="Hz">1000</frequency>
+											<voltage unit="V">1.05</voltage>
+											<powerUsage unit="W">6</powerUsage>
+										</pState>
+										<pState>
+											<name>P1</name>
+											<frequency unit="Hz">866</frequency>
+											<voltage unit="V">1.01</voltage>
+											<powerUsage unit="W">4</powerUsage>
+										</pState>
+									</pStates>			
+								</powerProfile>
+							</profile>
+							<core/>
+						</processor>
+					</computingNode>
+				</computingResource>
+			</rack>
+		</dataCenter>
+			
+		<scheduler class="Cluster" name="cluster">
+			<schedulingPlugin>
+				<name>FCFSLocalSchedulingPlugin</name>
+			</schedulingPlugin>		
+			<managedComputingResources include="false">
+				<resourceName>rack</resourceName>
+			</managedComputingResources>
+		</scheduler>
+
+	</resources>
+	
+</environment>
Index: DCWoRMS/trunk/simulator/schemas/resources/example/coolemall/example1.xml
===================================================================
--- DCWoRMS/trunk/simulator/schemas/resources/example/coolemall/example1.xml	(revision 477)
+++ DCWoRMS/trunk/simulator/schemas/resources/example/coolemall/example1.xml	(revision 477)
@@ -0,0 +1,64 @@
+<environment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+	xsi:noNamespaceSchemaLocation="../../XSSimResSchema.xsd">
+
+	<!-- Plugin defined in class ExecTimeEstimationPlugin will be used to estimate task execution time -->
+	<timeEstimationPlugin>
+		<name>ExecTimeEstimationPlugin</name>
+	</timeEstimationPlugin>
+
+	<resources>
+		<description>
+		This basic example defines simple resource hierarchy within a single data center (named dataCenter). It consists of 4 racks
+		(with names created according to the name attribute and subsequent natural number: rack_0, rack_1, rack_2 and rack_3). 
+		Each of them contains 64 computing nodes (names will be generated using resource class and subsequent natural number: 
+		ComputingNode_0, ComputingNode_1,...ComputingNode_255) with 2 processors. Speed of every processor is equal 2. 
+		All computing nodes have 12GB of memory and 4TB storage.
+		Task are submitted to the single cluster built on top of the data center. It is under the control of local scheduler
+		with FCFS scheduling policy. The commented out cluster definition is equal to the one above it 
+		(it demonstrates alternative way of defining managed computing resources using "include" attribute).
+		</description>
+		
+		<computingResource class="DataCenter" name="dataCenter">
+			<computingResource class="Rack" count="4" name="rack">
+				<computingResource class="ComputingNode" count="64">
+					<resourceUnit class="Memory">
+						<amount unit="MB">12288</amount>
+					</resourceUnit>
+					<resourceUnit class="Storage">
+						<amount unit="MB">4194304</amount>
+					</resourceUnit>
+					<computingResource class="Processor" count="2">
+						<parameter name="speed">
+							<value>2</value>
+						</parameter>
+					</computingResource>
+				</computingResource>
+			</computingResource>
+		</computingResource>
+
+		<scheduler class="Cluster" name="cluster">
+			<schedulingPlugin>
+				<name>FCFSLocalSchedulingPlugin</name>
+			</schedulingPlugin>	
+			<managedComputingResources include="false">
+				<resourceName>dataCenter</resourceName>
+			</managedComputingResources>
+		</scheduler>
+		
+		<!-- 
+		<scheduler class="Cluster" name="cluster">
+			<schedulingPlugin>
+				<name>FCFSLocalSchedulingPlugin</name>
+			</schedulingPlugin>		
+			<managedComputingResources include="true">
+				<resourceName>rack_0</resourceName>
+				<resourceName>rack_1</resourceName>
+				<resourceName>rack_2</resourceName>
+				<resourceName>rack_3</resourceName>
+			</managedComputingResources>
+		</scheduler>
+		 -->
+
+	</resources>
+	
+</environment>
Index: DCWoRMS/trunk/simulator/schemas/resources/example/coolemall/example2.xml
===================================================================
--- DCWoRMS/trunk/simulator/schemas/resources/example/coolemall/example2.xml	(revision 477)
+++ DCWoRMS/trunk/simulator/schemas/resources/example/coolemall/example2.xml	(revision 477)
@@ -0,0 +1,141 @@
+<environment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+	xsi:noNamespaceSchemaLocation="../../XSSimResSchema.xsd">
+	
+	<resources>
+		<description>
+		This example aims to show how to introduce energy-related parameters to the simulation environment 
+		Simulated architecture consists of data center with 4 racks. Each of them contains 64 computing nodes with 2 processors. 
+		Speed of every processor is equal 2. All computing nodes have 12GB of memory and 4TB storage.
+		For the detailed energy characteristics description, see the following comments. 
+		Task are submitted to the single cluster built on top of the data center. It is under the control of local scheduler
+		with FCFS scheduling policy.
+		</description>
+		
+		<computingResource class="DataCenter" name="dataCenter">
+			<computingResource class="Rack" count="4" name="rack">
+				<computingResource class="ComputingNode" count="64">
+					<profile>
+						<!-- Definition of computing node power profile
+						According to it, there are two supported power states: ON and OFF
+						Computing node in ON state consumes 20 watts, while in OFF state 0.
+						Transition between ON and OFF state takes 30 seconds and consumes 30 watts, 
+						while in the opposite direction energy consumption rate is equal 40 watts over 60 seconds.
+						 -->
+						<powerProfile>
+							<!-- ComputingNodeEnergyEstimationPlugin will be used to customize estimation of energy consumptions to
+							specific applications and hardware on computing node level-->
+							<energyEstimationPlugin>
+								<name>example.energy.ComputingNodeEnergyEstimationPlugin</name>
+							</energyEstimationPlugin>
+							<powerStates>
+								<powerState>
+									<name>ON</name>
+									<powerUsage unit="W">20</powerUsage>
+										<powerUsage unit="W">20</powerUsage>
+									<transition>
+										<to>OFF</to>
+										<powerUsage unit="W">30</powerUsage>
+										<time unit="s">30</time>
+									</transition>
+								</powerState>
+								<powerState>
+									<name>OFF</name>
+									<powerUsage unit="W">0</powerUsage>
+									<transition>
+										<to>ON</to>
+										<powerUsage unit="W">40</powerUsage>
+										<time unit="s">60</time>
+									</transition>
+								</powerState>
+							</powerStates>
+						</powerProfile>
+						<!-- Definition of computing node air throughput profile (for instance fan related with the given node)
+						There are 4 states, characterized by name, air flow value and power draw.
+						 -->
+						<airThroughputProfile>
+							<airThroughputStates>
+								<airThroughputState>
+									<name>mode1</name>
+									<value unit="m3/h">105</value>
+									<powerUsage unit="W">10.3</powerUsage>
+								</airThroughputState>
+								<airThroughputState>
+									<name>mode2</name>
+									<value unit="m3/h">110</value>
+									<powerUsage unit="W">10.9</powerUsage>
+								</airThroughputState>
+								<airThroughputState>
+									<name>mode3</name>
+									<value unit="m3/h">115</value>
+									<powerUsage unit="W">11.4</powerUsage>
+								</airThroughputState>
+								<airThroughputState>
+									<name>mode4</name>
+									<value unit="m3/h">120</value>
+									<powerUsage unit="W">12.1</powerUsage>
+								</airThroughputState>
+							</airThroughputStates>
+						</airThroughputProfile>
+					</profile>
+					<computingResource class="Processor" count="2">
+						<profile>
+							 <!-- Definition of processor power profile
+							 According to it, processor can operate in two p-states: P0 and P1
+                             P0 p-state is characterized by operating frequency - 3000,
+                             voltage level - 1.3 and power usage - 35. 
+                             Next p-state - P1 has the following values: 2666, 1.1, 30, respectively.
+							 -->
+							<powerProfile>
+								<!-- CPUEnergyEstimationPlugin will be used to estimate energy consumption on processor level.-->
+								<energyEstimationPlugin>
+									<name>example.energy.CPUEnergyEstimationPlugin</name>
+								</energyEstimationPlugin>
+								<parameter name="pState">
+									<property name="name">
+										<value>P0</value>
+									</property>	
+									<property name="frequency">
+										<value unit="Hz">3000</value>
+									</property>		
+									<property name="voltage">
+										<value unit="V">1.3</value>
+									</property>
+									<property name="powerUsage">
+										<value unit="W">35</value>
+									</property>						
+								</parameter>
+								<parameter name="pState">
+									<property name="name">
+										<value>P1</value>
+									</property>	
+									<property name="frequency">
+										<value unit="H`">2666</value>
+									</property>		
+									<property name="voltage">
+										<value unit="V">1.1</value>
+									</property>
+									<property name="powerUsage">
+										<value unit="W">30</value>
+									</property>						
+								</parameter>	
+							</powerProfile>
+						</profile>
+					</computingResource>
+				</computingResource>
+			</computingResource>
+		</computingResource>
+		
+		<scheduler class="Cluster" name="cluster">
+			<schedulingPlugin>
+				<name>FCFSLocalSchedulingPlugin</name>
+			</schedulingPlugin>		
+			<managedComputingResources include="true">
+				<resourceName>rack_0</resourceName>
+				<resourceName>rack_1</resourceName>
+				<resourceName>rack_2</resourceName>
+				<resourceName>rack_3</resourceName>
+			</managedComputingResources>
+		</scheduler>
+
+	</resources>
+</environment>
Index: DCWoRMS/trunk/simulator/schemas/resources/example/coolemall/example3.xml
===================================================================
--- DCWoRMS/trunk/simulator/schemas/resources/example/coolemall/example3.xml	(revision 477)
+++ DCWoRMS/trunk/simulator/schemas/resources/example/coolemall/example3.xml	(revision 477)
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<environment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+	xsi:noNamespaceSchemaLocation="../../XSSimResSchema.xsd">
+	
+	<resources>
+		<description>
+        This short example presents how to describe computing resource location.
+        Simulated architecture consists of data center with 2 racks named rack1 and rack2, respectively.
+        Location of rack1 is defined using vector (4, 0, 2), while rack2 using vector (6, 0, 2)
+		Rack1 contains 2 computing nodes - node11 and node12. Appropriate coordinates for node11 are (0, 0, 0)
+		and for node12 (0, 1, 0). Rack2 contains 2 computing nodes named node21 and node22. Their location is defined as follows:
+		(0, 0, 0) for node21 and (1, 0, 0) for node22.
+		Using 3 coordinates allows to express location in various ways. It can be interpreted as a absolute placement in 3D, as well as the
+		relative position according to the parent computing resource. Moreover, it is possible to define only the arrangement of
+		the computing resources by increasing only the value of one coordinate.
+		In the following example, racks location is defined using relative positions (with respect to the data center), while
+		for nodes the order of appearance is specified (with additional direction in which the order tends
+		(node12 is located after node11 and placed above it, while node22 is located on the right side of node21)
+		It has to be stressed that simulator only stores the location parameters and does not process them. Hence, their interpretation should be done by user.
+		</description>
+		<computingResource class="DataCenter" name="dataCenter">
+			<computingResource class="Rack" name="rack1">
+				<location>
+					<horizontal>4</horizontal>
+					<vertical>0</vertical>
+					<depth>2</depth>
+				</location>
+				<computingResource class="ComputingNode" name="node11">
+					<location>
+						<horizontal>0</horizontal>
+						<vertical>0</vertical>
+						<depth>0</depth>
+					</location>
+				</computingResource>
+				<computingResource class="ComputingNode" name="node12">
+					<location>
+						<horizontal>0</horizontal>
+						<vertical>1</vertical>
+						<depth>0</depth>
+					</location>
+				</computingResource>
+			</computingResource>	
+			<computingResource class="Rack" name="rack2">
+				<location>
+					<horizontal>6</horizontal>
+					<vertical>0</vertical>
+					<depth>2</depth>
+				</location>
+				<computingResource class="ComputingNode" name="node21">
+					<location>
+						<horizontal>0</horizontal>
+						<vertical>0</vertical>
+						<depth>0</depth>
+					</location>
+				</computingResource>
+				<computingResource class="ComputingNode" name="node22">
+					<location>
+						<horizontal>1</horizontal>
+						<vertical>0</vertical>
+						<depth>0</depth>
+					</location>
+				</computingResource>
+			</computingResource>
+		</computingResource>	
+		<scheduler class="Cluster" name="cluster">
+			<schedulingPlugin>
+				<name>FCFSLocalSchedulingPlugin</name>
+			</schedulingPlugin>		
+			<managedComputingResources include="false">
+				<resourceName>dataCenter</resourceName>
+			</managedComputingResources>
+		</scheduler>
+	</resources>
+</environment>
Index: DCWoRMS/trunk/simulator/schemas/resources/example/coolemall/example4.xml
===================================================================
--- DCWoRMS/trunk/simulator/schemas/resources/example/coolemall/example4.xml	(revision 477)
+++ DCWoRMS/trunk/simulator/schemas/resources/example/coolemall/example4.xml	(revision 477)
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<environment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+	xsi:noNamespaceSchemaLocation="../../XSSimResSchema.xsd">
+	
+	<resources>
+		<description>
+		The goal of this example is to introduce the templates usage. 
+		It focuses on showing that appropriate templates may be included on various computing resource levels and moreover can be formed using other templates.
+		Simulated architecture consists of data center with 2 racks named rack1 and rack2 respectively.
+		Rack1 contains 2 computing nodes - node11 and node12, described in common way.
+		Nodes in rack2 are defined using template. Node21 refers to template modelNodeA and, 
+		thus will be created with respect to the specification given in that template (node will have 4 processors with speed 2).
+		Node22 contains 8 processors which definition is included in modeProcessorB template.
+		</description>
+		<computingResource class="DataCenter" name="dataCenter">
+			<computingResource class="Rack" name="rack1">
+				<computingResource class="ComputingNode" name="node11">
+				</computingResource>
+				<computingResource class="ComputingNode" name="node12">
+				</computingResource>
+			</computingResource>	
+			<computingResource class="Rack" name="rack2">
+				<computingResource class="ComputingNode" name="node21">
+					<templateId>modelNodeA</templateId>
+				</computingResource>
+				<computingResource class="ComputingNode" name="node22">
+					<computingResource class="Processor" count="8">
+						<templateId>modelProcessorB</templateId>
+					</computingResource>
+				</computingResource>
+			</computingResource>
+		</computingResource>	
+		<scheduler class="Cluster" name="cluster">
+			<schedulingPlugin>
+				<name>FCFSLocalSchedulingPlugin</name>
+			</schedulingPlugin>		
+			<managedComputingResources include="false">
+				<resourceName>dataCenter</resourceName>
+			</managedComputingResources>
+		</scheduler>
+	</resources>
+	
+	<templates>
+		<description>
+		There are two processor templates named modelProcessorA (with cpu speed 2) and modelProcessorB (with cpu speed 1).
+		There is also one computing node template denoted as modelNodeA, which contains 4 processors that refer to modelProcessorA template.
+		That means that the given processors will be created according to the characteristics defined in template modelProcessorA (they will have speed equal 2).
+		</description>
+		<computingResourceTemplate class="ComputingNode" name="modelNodeA">
+			<computingResource class="Processor" count="4">
+				<templateId>modelProcessorA</templateId>
+			</computingResource>
+		</computingResourceTemplate>	
+		<computingResourceTemplate class="Processor" name="modelProcessorA">
+			<parameter name="speed">
+				<value>2</value>
+			</parameter>
+		</computingResourceTemplate>
+		<computingResourceTemplate class="Processor" name="modelProcessorB">
+			<parameter name="speed">
+				<value>1</value>
+			</parameter>
+		</computingResourceTemplate>
+	</templates>
+</environment>
Index: DCWoRMS/trunk/simulator/schemas/resources/example/coolemall/example5.xml
===================================================================
--- DCWoRMS/trunk/simulator/schemas/resources/example/coolemall/example5.xml	(revision 477)
+++ DCWoRMS/trunk/simulator/schemas/resources/example/coolemall/example5.xml	(revision 477)
@@ -0,0 +1,434 @@
+<environment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+	xsi:noNamespaceSchemaLocation="../../XSSimResSchema.xsd">
+
+	
+	<!-- CoolEmAll testbed description 
+	P-States characteristics are fabricated-->
+	<resources>
+		<computingResource class="Rack" name="rack">
+			<resourceUnit class="Storage">
+				<amount unit="MB">4915200</amount>
+				<parameter name=""></parameter>
+			</resourceUnit>
+			<parameter name="PSU">
+				<property name="powerUsage">
+					<value unit="W">180</value>
+				</property>
+			</parameter>
+			<computingResource class="RECS" name="recs1">
+				<location>
+					<horizontal>0</horizontal>
+					<vertical>0</vertical>
+					<depth>0</depth>
+				</location>
+				<computingResource class="ComputingNode" count="18">
+					<resourceUnit class="Memory">
+						<amount unit="MB">16384</amount>
+					</resourceUnit>
+					<profile>
+						<powerProfile>
+							<powerStates>
+								<powerState>
+									<name>ON</name>
+									<powerUsage unit="W">400</powerUsage>
+								</powerState>
+								<powerState>
+									<name>OFF</name>
+									<powerUsage unit="W">0</powerUsage>
+								</powerState>
+							</powerStates>
+						</powerProfile>
+						<airThroughputProfile>
+							<airThroughputStates>
+								<airThroughputState>
+									<name>mode1</name>
+									<value unit="m3/h">105</value>
+									<powerUsage unit="W">10.3</powerUsage>
+								</airThroughputState>
+								<airThroughputState>
+									<name>mode2</name>
+									<value unit="m3/h">110</value>
+									<powerUsage unit="W">10.9</powerUsage>
+								</airThroughputState>
+								<airThroughputState>
+									<name>mode3</name>
+									<value unit="m3/h">115</value>
+									<powerUsage unit="W">11.4</powerUsage>
+								</airThroughputState>
+								<airThroughputState>
+									<name>mode4</name>
+									<value unit="m3/h">120</value>
+									<powerUsage unit="W">12.1</powerUsage>
+								</airThroughputState>
+							</airThroughputStates>
+						</airThroughputProfile>
+					</profile>
+					<computingResource class="Processor" type="i7">
+						<parameter name="speed">
+							<value>2</value>
+						</parameter>
+						<profile>
+							<powerProfile>
+								<parameter name="pState">
+									<property name="name">
+										<value>P0</value>
+									</property>	
+									<property name="frequency">
+										<value unit="Hz">3600</value>
+									</property>		
+									<property name="voltage">
+										<value unit="V">1.4</value>
+									</property>
+									<property name="powerUsage">
+										<value unit="W">103</value>
+									</property>						
+								</parameter>
+								<parameter name="pState">
+									<property name="name">
+										<value>P1</value>
+									</property>	
+									<property name="frequency">
+										<value unit="H`">3400</value>
+									</property>		
+									<property name="voltage">
+										<value unit="V">1.35</value>
+									</property>
+									<property name="powerUsage">
+										<value unit="W">94</value>
+									</property>						
+								</parameter>
+								<parameter name="pState">
+									<property name="name">
+										<value>P2</value>
+									</property>	
+									<property name="frequency">
+										<value unit="Hz">3200</value>
+									</property>		
+									<property name="voltage">
+										<value unit="V">1.3</value>
+									</property>
+									<property name="powerUsage">
+										<value unit="W">85</value>
+									</property>						
+								</parameter>
+								<parameter name="pState">
+									<property name="name">
+										<value>P3</value>
+									</property>	
+									<property name="frequency">
+										<value unit="H`">3000</value>
+									</property>		
+									<property name="voltage">
+										<value unit="V">1.25</value>
+									</property>
+									<property name="powerUsage">
+										<value unit="W">76</value>
+									</property>						
+								</parameter>		
+							</powerProfile>
+						</profile>
+						<computingResource class="Core" count="4"/>
+					</computingResource>
+				</computingResource>
+			</computingResource>
+			<computingResource class="RECS" name="recs2">
+				<location>
+					<horizontal>0</horizontal>
+					<vertical>1</vertical>
+					<depth>0</depth>
+				</location>
+				<computingResource class="ComputingNode" count="18">
+					<resourceUnit class="Memory">
+						<amount unit="MB">4096</amount>
+					</resourceUnit>
+					<profile>
+						<powerProfile>
+							<powerStates>
+								<powerState>
+									<name>ON</name>
+									<powerUsage unit="W">360</powerUsage>
+								</powerState>
+								<powerState>
+									<name>OFF</name>
+									<powerUsage unit="W">0</powerUsage>
+								</powerState>
+							</powerStates>
+						</powerProfile>
+						<airThroughputProfile>
+							<airThroughputStates>
+								<airThroughputState>
+									<name>mode1</name>
+									<value unit="m3/h">105</value>
+									<powerUsage unit="W">10.3</powerUsage>
+								</airThroughputState>
+								<airThroughputState>
+									<name>mode2</name>
+									<value unit="m3/h">110</value>
+									<powerUsage unit="W">10.9</powerUsage>
+								</airThroughputState>
+								<airThroughputState>
+									<name>mode3</name>
+									<value unit="m3/h">115</value>
+									<powerUsage unit="W">11.4</powerUsage>
+								</airThroughputState>
+								<airThroughputState>
+									<name>mode4</name>
+									<value unit="m3/h">120</value>
+									<powerUsage unit="W">12.1</powerUsage>
+								</airThroughputState>
+							</airThroughputStates>
+						</airThroughputProfile>
+					</profile>
+					<computingResource class="Processor" type="Atom">
+						<profile>
+							<powerProfile>
+								<parameter name="pState">
+									<property name="name">
+										<value>P0</value>
+									</property>	
+									<property name="frequency">
+										<value unit="Hz">1100</value>
+									</property>		
+									<property name="voltage">
+										<value unit="V">1.16</value>
+									</property>
+									<property name="powerUsage">
+										<value unit="W">45</value>
+									</property>						
+								</parameter>
+								<parameter name="pState">
+									<property name="name">
+										<value>P1</value>
+									</property>	
+									<property name="frequency">
+										<value unit="H`">1000</value>
+									</property>		
+									<property name="voltage">
+										<value unit="V">1.14</value>
+									</property>
+									<property name="powerUsage">
+										<value unit="W">40</value>
+									</property>						
+								</parameter>
+								<parameter name="pState">
+									<property name="name">
+										<value>P2</value>
+									</property>	
+									<property name="frequency">
+										<value unit="Hz">900</value>
+									</property>		
+									<property name="voltage">
+										<value unit="V">1.12</value>
+									</property>
+									<property name="powerUsage">
+										<value unit="W">35</value>
+									</property>						
+								</parameter>
+								<parameter name="pState">
+									<property name="name">
+										<value>P3</value>
+									</property>	
+									<property name="frequency">
+										<value unit="H`">800</value>
+									</property>		
+									<property name="voltage">
+										<value unit="V">1.1</value>
+									</property>
+									<property name="powerUsage">
+										<value unit="W">30</value>
+									</property>						
+								</parameter>		
+							</powerProfile>
+						</profile>
+						<computingResource class="Core" count="2"/>
+					</computingResource>
+				</computingResource>
+			</computingResource>
+			<computingResource class="RECS" name="recs3">
+				<location>
+					<horizontal>0</horizontal>
+					<vertical>2</vertical>
+					<depth>0</depth>
+				</location>
+				<computingResource class="ComputingNode" count="18">
+					<resourceUnit class="Memory">
+						<amount unit="MB">2048</amount>
+					</resourceUnit>
+					<profile>
+						<powerProfile>
+							<powerStates>
+								<powerState>
+									<name>ON</name>
+									<powerUsage unit="W">300</powerUsage>
+								</powerState>
+								<powerState>
+									<name>OFF</name>
+									<powerUsage unit="W">0</powerUsage>
+								</powerState>
+							</powerStates>
+						</powerProfile>
+						<airThroughputProfile>
+							<airThroughputStates>
+								<airThroughputState>
+									<name>mode1</name>
+									<value unit="m3/h">105</value>
+									<powerUsage unit="W">10.3</powerUsage>
+								</airThroughputState>
+								<airThroughputState>
+									<name>mode2</name>
+									<value unit="m3/h">110</value>
+									<powerUsage unit="W">10.9</powerUsage>
+								</airThroughputState>
+								<airThroughputState>
+									<name>mode3</name>
+									<value unit="m3/h">115</value>
+									<powerUsage unit="W">11.4</powerUsage>
+								</airThroughputState>
+								<airThroughputState>
+									<name>mode4</name>
+									<value unit="m3/h">120</value>
+									<powerUsage unit="W">12.1</powerUsage>
+								</airThroughputState>
+							</airThroughputStates>
+						</airThroughputProfile>
+					</profile>
+					<computingResource class="Processor" type="AMD Fusion">
+						<profile>
+							<powerProfile>
+								<parameter name="pState">
+									<property name="name">
+										<value>P0</value>
+									</property>	
+									<property name="frequency">
+										<value unit="Hz">1000</value>
+									</property>		
+									<property name="voltage">
+										<value unit="V">1.15</value>
+									</property>
+									<property name="powerUsage">
+										<value unit="W">30</value>
+									</property>						
+								</parameter>
+								<parameter name="pState">
+									<property name="name">
+										<value>P1</value>
+									</property>	
+									<property name="frequency">
+										<value unit="H`">866</value>
+									</property>		
+									<property name="voltage">
+										<value unit="V">1.1</value>
+									</property>
+									<property name="powerUsage">
+										<value unit="W">25</value>
+									</property>						
+								</parameter>		
+							</powerProfile>
+						</profile>
+						<computingResource class="Core" count="2"/>
+					</computingResource>
+				</computingResource>
+			</computingResource>
+			<computingResource class="RECS" name="recs4">
+			 	<location>
+					<horizontal>0</horizontal>
+					<vertical>3</vertical>
+					<depth>0</depth>
+				</location>
+				<computingResource class="ComputingNode" count="18">
+					<resourceUnit class="Memory">
+						<amount unit="MB">2048</amount>
+					</resourceUnit>
+					<profile>
+						<powerProfile>
+							<powerStates>
+								<powerState>
+									<name>ON</name>
+									<powerUsage unit="W">100</powerUsage>
+								</powerState>
+								<powerState>
+									<name>HIBERNATE</name>
+									<powerUsage unit="W">20</powerUsage>
+								</powerState>
+								<powerState>
+									<name>OFF</name>
+									<powerUsage unit="W">0</powerUsage>
+								</powerState>
+							</powerStates>
+						</powerProfile>
+						<airThroughputProfile>
+							<airThroughputStates>
+								<airThroughputState>
+									<name>mode1</name>
+									<value unit="m3/h">105</value>
+									<powerUsage unit="W">10.3</powerUsage>
+								</airThroughputState>
+								<airThroughputState>
+									<name>mode2</name>
+									<value unit="m3/h">110</value>
+									<powerUsage unit="W">10.9</powerUsage>
+								</airThroughputState>
+								<airThroughputState>
+									<name>mode3</name>
+									<value unit="m3/h">115</value>
+									<powerUsage unit="W">11.4</powerUsage>
+								</airThroughputState>
+								<airThroughputState>
+									<name>mode4</name>
+									<value unit="m3/h">120</value>
+									<powerUsage unit="W">12.1</powerUsage>
+								</airThroughputState>
+							</airThroughputStates>
+						</airThroughputProfile>
+					</profile>
+					<computingResource class="Processor" type="ARM">
+						<profile>
+							<powerProfile>
+								<parameter name="pState">
+									<property name="name">
+										<value>P0</value>
+									</property>	
+									<property name="frequency">
+										<value unit="Hz">1000</value>
+									</property>		
+									<property name="voltage">
+										<value unit="V">1.05</value>
+									</property>
+									<property name="powerUsage">
+										<value unit="W">6</value>
+									</property>						
+								</parameter>
+								<parameter name="pState">
+									<property name="name">
+										<value>P1</value>
+									</property>	
+									<property name="frequency">
+										<value unit="H`">866</value>
+									</property>		
+									<property name="voltage">
+										<value unit="V">1.01</value>
+									</property>
+									<property name="powerUsage">
+										<value unit="W">4</value>
+									</property>						
+								</parameter>		
+							</powerProfile>
+						</profile>
+						<computingResource class="Core"/>
+					</computingResource>
+				</computingResource>
+			</computingResource>
+		</computingResource>
+
+		<scheduler class="Cluster" name="cluster">
+			<schedulingPlugin>
+				<name>FCFSLocalSchedulingPlugin</name>
+			</schedulingPlugin>		
+			<managedComputingResources include="false">
+				<resourceName>rack</resourceName>
+			</managedComputingResources>
+		</scheduler>
+
+	</resources>
+	
+</environment>
Index: DCWoRMS/trunk/simulator/schemas/resources/example/example1.xml
===================================================================
--- DCWoRMS/trunk/simulator/schemas/resources/example/example1.xml	(revision 477)
+++ DCWoRMS/trunk/simulator/schemas/resources/example/example1.xml	(revision 477)
@@ -0,0 +1,36 @@
+<environment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+	xsi:noNamespaceSchemaLocation="../XSSimResSchema.xsd">
+	
+	<!-- Analogiczny opis zasobow jak do tej pory, dla srodowiska gridowego -->
+	<resources>
+		<computingResource class="DataCenter" name="compRes1">
+			<computingResource class="Processor" count="64"/>
+		</computingResource>	
+		<computingResource class="DataCenter" name="compRes2">
+			<computingResource class="Processor" count="64"/>
+		</computingResource>
+		<!-- Plugin dla Brokera
+		Definicja pluginu zostala przeniesiona z pliku z propertiesami ma byc tu czy w propertiesach, sciezki bezwzledne czy wzgledne z domyslnej lokalizacji (moga byc obie mozliwosci ale to juz na poziomie tworzenia zasobow)-->
+		<scheduler class="GridBroker" name="gridBroker">
+			<schedulingPlugin>
+				<name>GridFCFSLoadBalancingPlugin</name>
+			</schedulingPlugin>
+			<scheduler class="Cluster" name="cluster1">
+				<schedulingPlugin>
+					<name>FCFSLocalSchedulingPlugin</name>
+				</schedulingPlugin>	
+				<managedComputingResources include="false">
+					<resourceName>compRes1</resourceName>
+				</managedComputingResources>
+			</scheduler>
+			<scheduler class="Cluster" name="cluster2">
+				<schedulingPlugin>
+					<name>FCFSLocalSchedulingPlugin</name>
+				</schedulingPlugin>	
+				<managedComputingResources include="false">
+					<resourceName>compRes2</resourceName>
+				</managedComputingResources>
+			</scheduler>
+		</scheduler>	
+	</resources>
+</environment>
Index: DCWoRMS/trunk/simulator/schemas/resources/example/tomExp.xml
===================================================================
--- DCWoRMS/trunk/simulator/schemas/resources/example/tomExp.xml	(revision 477)
+++ DCWoRMS/trunk/simulator/schemas/resources/example/tomExp.xml	(revision 477)
@@ -0,0 +1,381 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<environment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+	xsi:noNamespaceSchemaLocation="../XSSimResSchema.xsd">
+	
+	<!-- Opis dla data center z uwzglednieniem aspektow energetycznych -->
+	<resources>
+		<computingResource class="DataCenter" name="compRes1">
+								<resourceUnit class="krasnoludek">
+						<amount>7</amount>
+				</resourceUnit>
+		<computingResource class="Rack">
+						<resourceUnit class="storage">
+						<amount>1000000</amount>
+				</resourceUnit>
+			<computingResource class="ComputingNode" count="2">
+				<resourceUnit class="memory">
+						<amount>12288</amount>
+				</resourceUnit>
+				<parameter name="category">
+						<value>A</value>
+				</parameter>
+				<profile>
+					<powerProfile>
+						<energyEstimationPlugin>
+							<name>example.energy.ComputingNodeEnergyEstimationPlugin</name>
+						</energyEstimationPlugin>	
+						<powerStates>
+							<powerState>
+								<name>ON</name>
+								<powerUsage>750</powerUsage>
+							</powerState>
+							<powerState>
+								<name>OFF</name>
+								<powerUsage>0</powerUsage>
+							</powerState>
+						</powerStates>				
+					</powerProfile>
+				</profile>
+
+				<computingResource class="Processor" count="4">
+					<parameter name="speed">
+						<value>1</value>
+					</parameter>
+					<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">3000</value>
+								</property>		
+								<property name="voltage">
+									<value unit="V">0</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`">2660</value>
+								</property>		
+								<property name="voltage">
+									<value unit="V">0</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`">2330</value>
+								</property>		
+								<property name="voltage">
+									<value unit="V">0</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`">2000</value>
+								</property>		
+								<property name="voltage">
+									<value unit="V">0</value>
+								</property>
+								<property name="powerUsage">
+									<value unit="W">330</value>
+								</property>						
+							</parameter>								
+						</powerProfile>
+					</profile>
+				</computingResource>
+			</computingResource>	
+			<computingResource class="ComputingNode" count="2">
+				<resourceUnit class="memory">
+						<amount>12288</amount>
+				</resourceUnit>
+				<parameter name="category">
+					<value>B</value>
+				</parameter>
+				<profile>
+					<powerProfile>
+						<energyEstimationPlugin>
+							<name>example.energy.ComputingNodeEnergyEstimationPlugin</name>
+						</energyEstimationPlugin>	
+						<powerStates>
+							<powerState>
+								<name>ON</name>
+								<powerUsage>750</powerUsage>
+							</powerState>
+							<powerState>
+								<name>OFF</name>
+								<powerUsage>0</powerUsage>
+							</powerState>
+						</powerStates>				
+					</powerProfile>
+				</profile>
+
+				<computingResource class="Processor" count="4">
+					<parameter name="speed">
+						<value>1</value>
+					</parameter>
+					<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">3000</value>
+								</property>		
+								<property name="voltage">
+									<value unit="V">0</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`">2660</value>
+								</property>		
+								<property name="voltage">
+									<value unit="V">0</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`">2330</value>
+								</property>		
+								<property name="voltage">
+									<value unit="V">0</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`">2000</value>
+								</property>		
+								<property name="voltage">
+									<value unit="V">0</value>
+								</property>
+								<property name="powerUsage">
+									<value unit="W">330</value>
+								</property>						
+							</parameter>								
+						</powerProfile>
+					</profile>
+				</computingResource>
+			</computingResource>	
+			<computingResource class="ComputingNode" count="2">
+				<resourceUnit class="memory">
+					<amount>12288</amount>
+				</resourceUnit>
+				<parameter name="category">
+					<value>C</value>
+				</parameter>
+				<profile>
+					<powerProfile>
+						<energyEstimationPlugin>
+							<name>example.energy.ComputingNodeEnergyEstimationPlugin</name>
+						</energyEstimationPlugin>	
+						<powerStates>
+							<powerState>
+								<name>ON</name>
+								<powerUsage>750</powerUsage>
+							</powerState>
+							<powerState>
+								<name>OFF</name>
+								<powerUsage>0</powerUsage>
+							</powerState>
+						</powerStates>				
+					</powerProfile>
+				</profile>
+
+				<computingResource class="Processor" count="4">
+					<parameter name="speed">
+						<value>1</value>
+					</parameter>
+					<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">3000</value>
+								</property>		
+								<property name="voltage">
+									<value unit="V">0</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`">2660</value>
+								</property>		
+								<property name="voltage">
+									<value unit="V">0</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`">2330</value>
+								</property>		
+								<property name="voltage">
+									<value unit="V">0</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`">2000</value>
+								</property>		
+								<property name="voltage">
+									<value unit="V">0</value>
+								</property>
+								<property name="powerUsage">
+									<value unit="W">330</value>
+								</property>						
+							</parameter>								
+						</powerProfile>
+					</profile>
+				</computingResource>
+			</computingResource>	
+			</computingResource>
+		</computingResource>
+		<scheduler class="Cluster" name="cluster1">
+			<schedulingPlugin>
+				<name>example.localplugin.FCFSRandomClusterLocalPlugin</name>
+				<!--  
+				<frequency>3600</frequency>
+				-->
+			</schedulingPlugin>		
+				<managedComputingResources include="false">
+					<resourceName>Rack_0</resourceName>
+				</managedComputingResources>
+		</scheduler>	
+	</resources>
+	
+	<!--  
+	<templates>
+		<computingResourceTemplate class="Processor" name="modelProcessorA">
+			<profile>
+				<powerProfile>
+					<energyEstimationPlugin>
+						<name>CPUEnergyEstimationPlugin</name>
+					</energyEstimationPlugin>
+					<parameter name="pState">
+						<property name="name">
+							<value>P0</value>
+						</property>	
+						<property name="frequency">
+							<value unit="Hz">3000</value>
+						</property>		
+						<property name="voltage">
+							<value unit="V">0</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`">2660</value>
+						</property>		
+						<property name="voltage">
+							<value unit="V">0</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`">2330</value>
+						</property>		
+						<property name="voltage">
+							<value unit="V">0</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`">2000</value>
+						</property>		
+						<property name="voltage">
+							<value unit="V">0</value>
+						</property>
+						<property name="powerUsage">
+							<value unit="W">330</value>
+						</property>						
+					</parameter>							
+				</powerProfile>
+			</profile>
+		</computingResourceTemplate>
+	</templates>
+	-->
+</environment>
Index: DCWoRMS/trunk/simulator/schemas/resources/example/example2.xml
===================================================================
--- DCWoRMS/trunk/simulator/schemas/resources/example/example2.xml	(revision 477)
+++ DCWoRMS/trunk/simulator/schemas/resources/example/example2.xml	(revision 477)
@@ -0,0 +1,39 @@
+<environment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+	xsi:noNamespaceSchemaLocation="../XSSimResSchema.xsd">
+	
+	<!-- Opis zasobow dla srodowiska gridowego -->
+	<resources>
+		<computingResource class="DataCenter" name="compRes1">
+			<computingResource class="Processor" count="64"/>
+		</computingResource>	
+		<computingResource class="DataCenter" name="compRes2">
+			<computingResource class="Processor" count="64"/>
+		</computingResource>
+		<!-- W tym przypadku Broker zarzadza dwoma klastrami (cluster1 i cluster2)
+		Kazdy z klastrow skojarzony jest z odpowiednimi zasobami (odpowiednio compRes1 i compRes2) tzn. sklada sie(zarzadza) wszystkimi zasobami znajdujacymi sie pod nimi
+		Patrz tez example3.xml -->
+		<scheduler class="GridBroker" name="gridBroker">
+			<schedulingPlugin>
+				<name>GridFCFSLoadBalancingPlugin</name>
+			</schedulingPlugin>
+			<scheduler class="Cluster" name="cluster1">
+				<schedulingPlugin>
+					<name>FCFSLocalSchedulingPlugin</name>
+					<frequency>600</frequency>
+				</schedulingPlugin>		
+				<managedComputingResources include="false">
+					<resourceName>compRes1</resourceName>
+				</managedComputingResources>
+			</scheduler>
+			<scheduler class="Cluster" name="cluster2">
+				<schedulingPlugin>
+					<name>FCFSLocalSchedulingPlugin</name>
+					<frequency>600</frequency>
+				</schedulingPlugin>	
+				<managedComputingResources include="false">
+					<resourceName>compRes2</resourceName>
+				</managedComputingResources>
+			</scheduler>
+		</scheduler>	
+	</resources>
+</environment>
Index: DCWoRMS/trunk/simulator/schemas/resources/example/example3.xml
===================================================================
--- DCWoRMS/trunk/simulator/schemas/resources/example/example3.xml	(revision 477)
+++ DCWoRMS/trunk/simulator/schemas/resources/example/example3.xml	(revision 477)
@@ -0,0 +1,70 @@
+<environment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+	xsi:noNamespaceSchemaLocation="../XSSimResSchema.xsd">
+	
+	<!-- Opis zasobow dla srodowiska gridowego -->
+	<resources>
+		<computingResource class="DataCenter" name="compRes1">
+			<computingResource class="ComputingNode" name="node11"/>
+			<computingResource class="ComputingNode" name="node12"/>
+			<computingResource class="ComputingNode" name="node13"/>
+			<computingResource class="ComputingNode" name="node14"/>
+			<computingResource class="ComputingNode" name="node15"/>
+			<computingResource class="ComputingNode" name="node16"/>
+		</computingResource>	
+		<computingResource class="DataCenter" name="compRes2">
+			<computingResource class="ComputingNode" name="node21"/>
+			<computingResource class="ComputingNode" name="node22"/>
+			<computingResource class="ComputingNode" name="node23"/>
+			<computingResource class="ComputingNode" name="node24"/>
+			<computingResource class="ComputingNode" name="node25"/>
+			<computingResource class="ComputingNode" name="node26"/>
+		</computingResource>
+		<!-- W tym przypadku Broker zarzadza czterema klastrami (cluter1, cluster2, cluster3, cluster4)
+		Kazdy z klastrow sklada sie(zarzadza) z 3 wezlow wylistowanych ponizej -->
+		<scheduler class="GridBroker" name="gridBroker">
+			<schedulingPlugin>
+				<name>GridFCFSLoadBalancingPlugin</name>
+			</schedulingPlugin>
+			<scheduler class="Cluster" name="cluster1">
+				<schedulingPlugin>
+					<name>FCFSLocalSchedulingPlugin</name>
+				</schedulingPlugin>	
+				<managedComputingResources include="true">
+					<resourceName>node11</resourceName>
+					<resourceName>node12</resourceName>
+					<resourceName>node13</resourceName>
+				</managedComputingResources>
+			</scheduler>
+			<scheduler class="Cluster" name="cluster2">
+				<schedulingPlugin>
+					<name>FCFSLocalSchedulingPlugin</name>
+				</schedulingPlugin>
+				<managedComputingResources include="true">
+					<resourceName>node14</resourceName>
+					<resourceName>node15</resourceName>
+					<resourceName>node16</resourceName>
+				</managedComputingResources>
+			</scheduler>
+			<scheduler class="Cluster" name="cluster3">
+				<schedulingPlugin>
+					<name>FCFSLocalSchedulingPlugin</name>
+				</schedulingPlugin>
+				<managedComputingResources include="true">
+					<resourceName>node21</resourceName>
+					<resourceName>node22</resourceName>
+					<resourceName>node23</resourceName>
+				</managedComputingResources>
+			</scheduler>
+			<scheduler class="Cluster" name="cluster4">
+				<schedulingPlugin>
+					<name>FCFSLocalSchedulingPlugin</name>
+				</schedulingPlugin>
+				<managedComputingResources include="true">
+					<resourceName>node24</resourceName>
+					<resourceName>node25</resourceName>
+					<resourceName>node26</resourceName>
+				</managedComputingResources>
+			</scheduler>
+		</scheduler>	
+	</resources>
+</environment>
Index: DCWoRMS/trunk/simulator/schemas/resources/example/tomExp2.xml
===================================================================
--- DCWoRMS/trunk/simulator/schemas/resources/example/tomExp2.xml	(revision 477)
+++ DCWoRMS/trunk/simulator/schemas/resources/example/tomExp2.xml	(revision 477)
@@ -0,0 +1,380 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<environment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+	xsi:noNamespaceSchemaLocation="../XSSimResSchema.xsd">
+	
+	<!-- Opis dla data center z uwzglednieniem aspektow energetycznych -->
+	<resources>
+		<computingResource class="DataCenter" name="compRes1">
+		<computingResource class="Rack" name="rack1">
+			<computingResource class="ComputingNode" count="2">
+				<resourceUnit class="memory">
+						<amount>12288</amount>
+				</resourceUnit>
+				<parameter name="category">
+						<value>A</value>
+				</parameter>
+				<profile>
+					<powerProfile>
+						<energyEstimationPlugin>
+							<name>example.energy.ComputingNodeEnergyEstimationPlugin</name>
+						</energyEstimationPlugin>	
+						<powerStates>
+							<powerState>
+								<name>ON</name>
+								<powerUsage>750</powerUsage>
+							</powerState>
+							<powerState>
+								<name>OFF</name>
+								<powerUsage>0</powerUsage>
+							</powerState>
+						</powerStates>				
+					</powerProfile>
+				</profile>
+
+				<computingResource class="Processor" count="4">
+					<parameter name="speed">
+						<value>1</value>
+					</parameter>
+					<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">3000</value>
+								</property>		
+								<property name="voltage">
+									<value unit="V">0</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`">2660</value>
+								</property>		
+								<property name="voltage">
+									<value unit="V">0</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`">2330</value>
+								</property>		
+								<property name="voltage">
+									<value unit="V">0</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`">2000</value>
+								</property>		
+								<property name="voltage">
+									<value unit="V">0</value>
+								</property>
+								<property name="powerUsage">
+									<value unit="W">330</value>
+								</property>						
+							</parameter>								
+						</powerProfile>
+					</profile>
+				</computingResource>
+			</computingResource>	
+			<computingResource class="ComputingNode" count="2">
+				<resourceUnit class="memory">
+						<amount>12288</amount>
+				</resourceUnit>
+				<parameter name="category">
+					<value>B</value>
+				</parameter>
+				<profile>
+					<powerProfile>
+						<energyEstimationPlugin>
+							<name>example.energy.ComputingNodeEnergyEstimationPlugin</name>
+						</energyEstimationPlugin>	
+						<powerStates>
+							<powerState>
+								<name>ON</name>
+								<powerUsage>750</powerUsage>
+							</powerState>
+							<powerState>
+								<name>OFF</name>
+								<powerUsage>0</powerUsage>
+							</powerState>
+						</powerStates>				
+					</powerProfile>
+				</profile>
+
+				<computingResource class="Processor" count="4">
+					<parameter name="speed">
+						<value>1</value>
+					</parameter>
+					<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">3000</value>
+								</property>		
+								<property name="voltage">
+									<value unit="V">0</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`">2660</value>
+								</property>		
+								<property name="voltage">
+									<value unit="V">0</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`">2330</value>
+								</property>		
+								<property name="voltage">
+									<value unit="V">0</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`">2000</value>
+								</property>		
+								<property name="voltage">
+									<value unit="V">0</value>
+								</property>
+								<property name="powerUsage">
+									<value unit="W">330</value>
+								</property>						
+							</parameter>								
+						</powerProfile>
+					</profile>
+				</computingResource>
+			</computingResource>	
+			<computingResource class="ComputingNode" count="2">
+				<resourceUnit class="memory">
+					<amount>12288</amount>
+				</resourceUnit>
+				<parameter name="category">
+					<value>C</value>
+				</parameter>
+				<profile>
+					<powerProfile>
+						<energyEstimationPlugin>
+							<name>example.energy.ComputingNodeEnergyEstimationPlugin</name>
+						</energyEstimationPlugin>	
+						<powerStates>
+							<powerState>
+								<name>ON</name>
+								<powerUsage>750</powerUsage>
+							</powerState>
+							<powerState>
+								<name>OFF</name>
+								<powerUsage>0</powerUsage>
+							</powerState>
+						</powerStates>				
+					</powerProfile>
+				</profile>
+
+				<computingResource class="Processor" count="4">
+					<parameter name="speed">
+						<value>1</value>
+					</parameter>
+					<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">3000</value>
+								</property>		
+								<property name="voltage">
+									<value unit="V">0</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`">2660</value>
+								</property>		
+								<property name="voltage">
+									<value unit="V">0</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`">2330</value>
+								</property>		
+								<property name="voltage">
+									<value unit="V">0</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`">2000</value>
+								</property>		
+								<property name="voltage">
+									<value unit="V">0</value>
+								</property>
+								<property name="powerUsage">
+									<value unit="W">330</value>
+								</property>						
+							</parameter>								
+						</powerProfile>
+					</profile>
+				</computingResource>
+			</computingResource>	
+		</computingResource>
+		</computingResource>
+		<scheduler class="Cluster" name="rackCluster1">
+			<schedulingPlugin>
+				<name>example.localplugin.RackLocalPlugin</name>
+			</schedulingPlugin>		
+			<managedComputingResources include="false">
+				<resourceName>compRes1</resourceName>
+			</managedComputingResources>
+			<scheduler class="Cluster" name="cluster1">
+				<schedulingPlugin>
+					<name>example.localplugin.FCFSRandomClusterLocalPlugin</name>
+				</schedulingPlugin>		
+				<managedComputingResources include="false">
+					<resourceName>rack1</resourceName>
+				</managedComputingResources>
+			</scheduler>	
+		</scheduler>	
+	</resources>
+	
+	<!--  
+	<templates>
+		<computingResourceTemplate class="Processor" name="modelProcessorA">
+			<profile>
+				<powerProfile>
+					<energyEstimationPlugin>
+						<name>CPUEnergyEstimationPlugin</name>
+					</energyEstimationPlugin>
+					<parameter name="pState">
+						<property name="name">
+							<value>P0</value>
+						</property>	
+						<property name="frequency">
+							<value unit="Hz">3000</value>
+						</property>		
+						<property name="voltage">
+							<value unit="V">0</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`">2660</value>
+						</property>		
+						<property name="voltage">
+							<value unit="V">0</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`">2330</value>
+						</property>		
+						<property name="voltage">
+							<value unit="V">0</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`">2000</value>
+						</property>		
+						<property name="voltage">
+							<value unit="V">0</value>
+						</property>
+						<property name="powerUsage">
+							<value unit="W">330</value>
+						</property>						
+					</parameter>							
+				</powerProfile>
+			</profile>
+		</computingResourceTemplate>
+	</templates>
+	-->
+</environment>
Index: DCWoRMS/trunk/simulator/schemas/resources/example/example4.xml
===================================================================
--- DCWoRMS/trunk/simulator/schemas/resources/example/example4.xml	(revision 477)
+++ DCWoRMS/trunk/simulator/schemas/resources/example/example4.xml	(revision 477)
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<environment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+	xsi:noNamespaceSchemaLocation="../XSSimResSchema.xsd">
+	
+	<!-- Opis dla data center z podstawowa charakterystyka zasobow -->
+	<resources>
+		<computingResource class="DataCenter" name="compRes1">
+			<computingResource class="ComputingNode" name="compNode1">
+				<resourceUnit class="memory">
+					<amount>12288</amount>
+				</resourceUnit>
+				<resourceUnit class="cost">
+					<amount>100</amount>
+				</resourceUnit>
+				<computingResource class="Processor" count="8"/>
+			</computingResource>	
+			<computingResource class="ComputingNode" name="compNode2">
+				<resourceUnit class="memory">
+					<amount>12288</amount>
+				</resourceUnit>
+				<resourceUnit class="cost">
+					<amount>60</amount>
+				</resourceUnit>
+				<computingResource class="Processor" count="8"/>
+			</computingResource>
+		</computingResource>
+		<scheduler class="Cluster" name="cluster1">
+			<schedulingPlugin>
+				<name>FCFSLocalSchedulingPlugin</name>
+			</schedulingPlugin>		
+				<managedComputingResources include="false">
+					<resourceName>compRes1</resourceName>
+				</managedComputingResources>
+		</scheduler>	
+	</resources>
+</environment>
Index: DCWoRMS/trunk/simulator/schemas/resources/example/tomExp3.xml
===================================================================
--- DCWoRMS/trunk/simulator/schemas/resources/example/tomExp3.xml	(revision 477)
+++ DCWoRMS/trunk/simulator/schemas/resources/example/tomExp3.xml	(revision 477)
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<environment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+	xsi:noNamespaceSchemaLocation="../XSSimResSchema.xsd">
+	
+	<!-- Opis dla data center z uwzglednieniem aspektow energetycznych -->
+	<resources>
+		<computingResource class="DataCenter" name="compRes1">
+			<resourceUnit class="krasnoludek">
+				<amount>7</amount>
+			</resourceUnit>
+			<computingResource class="Rack">
+						<resourceUnit class="storage">
+						<amount>1000000</amount>
+				</resourceUnit>
+			<computingResource class="ComputingNode">
+				<resourceUnit class="memory">
+						<amount>12288</amount>
+				</resourceUnit>
+				<resourceUnit class="cpu">
+					<amount>12</amount>
+				</resourceUnit>
+				<parameter name="category">
+						<value>A</value>
+				</parameter>
+				<profile>
+					<powerProfile>
+						<energyEstimationPlugin>
+							<name>example.energy.ComputingNodeEnergyEstimationPlugin</name>
+						</energyEstimationPlugin>	
+						<powerStates>
+							<powerState>
+								<name>ON</name>
+								<powerUsage>750</powerUsage>
+							</powerState>
+							<powerState>
+								<name>OFF</name>
+								<powerUsage>0</powerUsage>
+							</powerState>
+						</powerStates>				
+					</powerProfile>
+				</profile>
+			</computingResource>	
+
+			</computingResource>
+		</computingResource>
+		<scheduler class="Cluster" name="cluster1">
+			<schedulingPlugin>
+				<name>example.localplugin.RackLocalPlugin</name>
+
+			</schedulingPlugin>		
+				<managedComputingResources include="false">
+					<resourceName>Rack_0</resourceName>
+			</managedComputingResources>
+			<scheduler class="Cluster" name="clusterNode1">
+				<schedulingPlugin>
+					<name>example.localplugin.FCFSRandomClusterLocalPlugin</name>
+	
+				</schedulingPlugin>		
+				<managedComputingResources include="false">
+					<resourceName>ComputingNode_0</resourceName>
+				</managedComputingResources>
+		</scheduler>	
+		</scheduler>	
+	</resources>
+
+</environment>
Index: DCWoRMS/trunk/simulator/schemas/resources/example/example5.xml
===================================================================
--- DCWoRMS/trunk/simulator/schemas/resources/example/example5.xml	(revision 477)
+++ DCWoRMS/trunk/simulator/schemas/resources/example/example5.xml	(revision 477)
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<environment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+	xsi:noNamespaceSchemaLocation="../XSSimResSchema.xsd">
+	
+	<!-- Opis dla data center z uwzglednieniem aspektow energetycznych -->
+	<resources>
+		<computingResource class="DataCenter" name="compRes1">
+			<computingResource class="ComputingNode" count="57">
+				<profile>
+					<powerProfile>
+						<energyEstimationPlugin>
+							<name>ComputingNodeEnergyEstimationPlugin</name>
+						</energyEstimationPlugin>	
+					</powerProfile>
+				</profile>
+				<computingResource class="Processor" count="8">
+					<profile>
+						<powerProfile>
+							<energyEstimationPlugin>
+								<name>CPUEnergyEstimationPlugin</name>
+							</energyEstimationPlugin>
+							<powerStates>
+								<powerState>
+									<name>ON</name>
+									<powerUsage>20</powerUsage>
+								</powerState>
+								<powerState>
+									<name>OFF</name>
+									<powerUsage>0</powerUsage>
+								</powerState>
+							</powerStates>
+							<parameter name="pState">
+								<property name="name">
+									<value>P0</value>
+								</property>	
+								<property name="frequency">
+									<value>3000</value>
+								</property>		
+								<property name="voltage">
+									<value>1.3</value>
+								</property>
+								<property name="powerUsage">
+									<value>35</value>
+								</property>						
+							</parameter>
+							<parameter name="pState">
+								<property name="name">
+									<value>P1</value>
+								</property>	
+								<property name="frequency">
+									<value>2666</value>
+								</property>		
+								<property name="voltage">
+									<value>1.1</value>
+								</property>
+								<property name="powerUsage">
+									<value>30</value>
+								</property>						
+							</parameter>
+						</powerProfile>
+					</profile>
+				</computingResource>
+			</computingResource>	
+		</computingResource>
+		<scheduler class="Cluster" name="cluster1">
+			<schedulingPlugin>
+				<name>FCFSLocalSchedulingPlugin</name>
+			</schedulingPlugin>	
+			<managedComputingResources include="false">
+				<resourceName>compRes1</resourceName>
+			</managedComputingResources>
+		</scheduler>	
+	</resources>
+</environment>
Index: DCWoRMS/trunk/simulator/schemas/resources/example/example6.xml
===================================================================
--- DCWoRMS/trunk/simulator/schemas/resources/example/example6.xml	(revision 477)
+++ DCWoRMS/trunk/simulator/schemas/resources/example/example6.xml	(revision 477)
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<environment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+	xsi:noNamespaceSchemaLocation="../XSSimResSchema.xsd">
+	
+	<!-- Opis dla data center z uwzglednieniem rozmieszczenia zasobow -->
+	<resources>
+		<computingResource class="DataCenter" name="compRes1">
+			<location>
+				<horizontal>3</horizontal>
+				<vertical>4</vertical>
+				<depth>0</depth>
+			</location>
+			<computingResource class="Rack" name="rack1">
+				<computingResource class="ComputingNode" name="node11">
+				</computingResource>
+				<computingResource class="ComputingNode" name="node12">
+				</computingResource>
+			</computingResource>	
+			<computingResource class="Rack" name="rack2">
+				<location>
+					<horizontal>3</horizontal>
+					<vertical>6</vertical>					
+					<depth>0</depth>
+				</location>
+				<computingResource class="ComputingNode" name="node21">
+				</computingResource>
+				<computingResource class="ComputingNode" name="node22">
+				</computingResource>
+			</computingResource>
+		</computingResource>	
+		<scheduler class="Cluster" name="cluster1">
+			<schedulingPlugin>
+				<name>FCFSLocalSchedulingPlugin</name>
+			</schedulingPlugin>		
+			<managedComputingResources include="false">
+				<resourceName>compRes1</resourceName>
+			</managedComputingResources>
+		</scheduler>
+	</resources>
+</environment>
Index: DCWoRMS/trunk/simulator/schemas/grms3/GrmsResourceRequirementsSchema.xsd
===================================================================
--- DCWoRMS/trunk/simulator/schemas/grms3/GrmsResourceRequirementsSchema.xsd	(revision 477)
+++ DCWoRMS/trunk/simulator/schemas/grms3/GrmsResourceRequirementsSchema.xsd	(revision 477)
@@ -0,0 +1,646 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- edited with XMLSpy v2005 U (http://www.xmlspy.com) by Ariel Oleksiak (PSNC) -->
+<!-- edited with XMLSPY v5 rel. 4 U (http://www.xmlspy.com) by Tomasz Piontek (Instytut Chemii Bioorganicznej PAN) -->
+<!--Job Description Schema for Third Edition GRMS -->
+<!--version 0.1.0-->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
+	<xs:simpleType name="taskStatesName">
+		<xs:restriction base="xs:string">
+			<xs:enumeration value="QUEUED"/>
+			<xs:enumeration value="PREPROCESSING"/>
+			<xs:enumeration value="PENDING"/>
+			<xs:enumeration value="RUNNING"/>
+			<xs:enumeration value="STOPPED"/>
+			<xs:enumeration value="POSTPROCESSING"/>
+			<xs:enumeration value="SUSPENDED"/>
+			<xs:enumeration value="FINISHED"/>
+			<xs:enumeration value="CANCELED"/>
+			<xs:enumeration value="FAILED"/>
+		</xs:restriction>
+	</xs:simpleType>
+	<xs:element name="resourceRequirements">
+		<xs:annotation>
+			<xs:documentation>Resource Requirements for Gridge Resource Management System</xs:documentation>
+		</xs:annotation>
+		<xs:complexType>
+			<xs:sequence>
+				<xs:element name="task" maxOccurs="unbounded">
+					<xs:complexType>
+						<xs:sequence>
+							<xs:element name="description" type="xs:string" minOccurs="0"/>
+							<xs:element name="proxyInfo" type="proxyInfoType" minOccurs="0"/>
+							<xs:element name="candidateHosts" type="hostCandidatesType" minOccurs="0">
+								<xs:annotation>
+									<xs:documentation>List of hosts used by GRMS in resource discovery process</xs:documentation>
+								</xs:annotation>
+							</xs:element>
+							<xs:element name="requirements" minOccurs="0">
+								<xs:complexType>
+									<xs:sequence>
+										<xs:element name="resourceRequirements" minOccurs="0">
+											<xs:annotation>
+												<xs:documentation>Description of resources</xs:documentation>
+											</xs:annotation>
+											<xs:complexType>
+												<xs:sequence>
+													<xs:element name="computingResource" minOccurs="0" maxOccurs="unbounded">
+														<xs:annotation>
+															<xs:documentation>Computing resource requirements</xs:documentation>
+														</xs:annotation>
+														<xs:complexType>
+															<xs:complexContent>
+																<xs:extension base="computingResourceType"/>
+															</xs:complexContent>
+														</xs:complexType>
+													</xs:element>
+													<xs:element name="preferences" type="preferencesType" minOccurs="0"/>
+												</xs:sequence>
+											</xs:complexType>
+										</xs:element>
+										<xs:element name="topology" minOccurs="0" maxOccurs="unbounded">
+											<xs:annotation>
+												<xs:documentation>Processes topology definition</xs:documentation>
+											</xs:annotation>
+											<xs:complexType>
+												<xs:sequence>
+													<xs:element name="group" minOccurs="0" maxOccurs="unbounded">
+														<xs:annotation>
+															<xs:documentation>Groups of processes definition</xs:documentation>
+														</xs:annotation>
+														<xs:complexType>
+															<xs:sequence>
+																<xs:element name="processesConnection" minOccurs="0">
+																	<xs:annotation>
+																		<xs:documentation>Requirements for network parameters of connection among processes in group</xs:documentation>
+																	</xs:annotation>
+																	<xs:complexType>
+																		<xs:sequence>
+																			<xs:element name="networkResource" type="networkResourceType" maxOccurs="unbounded"/>
+																		</xs:sequence>
+																	</xs:complexType>
+																</xs:element>
+																<xs:element name="groupConnection" minOccurs="0" maxOccurs="unbounded">
+																	<xs:annotation>
+																		<xs:documentation>Requirements for network parameters of connection between current group and group with provided id</xs:documentation>
+																	</xs:annotation>
+																	<xs:complexType>
+																		<xs:sequence>
+																			<xs:element name="networkResource" type="networkResourceType" maxOccurs="unbounded"/>
+																		</xs:sequence>
+																		<xs:attribute name="endpointGroupId" type="xs:string" use="required"/>
+																	</xs:complexType>
+																</xs:element>
+															</xs:sequence>
+															<xs:attribute name="groupId" type="xs:string" use="required"/>
+														</xs:complexType>
+													</xs:element>
+													<xs:element name="processes" maxOccurs="unbounded">
+														<xs:annotation>
+															<xs:documentation>Processes definition</xs:documentation>
+														</xs:annotation>
+														<xs:complexType>
+															<xs:sequence>
+																<xs:element name="groupIdReference" type="xs:string" minOccurs="0" maxOccurs="unbounded">
+																	<xs:annotation>
+																		<xs:documentation>Ids of group that the process belongs</xs:documentation>
+																	</xs:annotation>
+																</xs:element>
+																<xs:element name="processesCount" type="countType" minOccurs="0">
+																	<xs:annotation>
+																		<xs:documentation>Number of process with specified resources requirements</xs:documentation>
+																	</xs:annotation>
+																</xs:element>
+																<xs:element name="resourceRequirements" minOccurs="0">
+																	<xs:annotation>
+																		<xs:documentation>Resource requirements of defined processes</xs:documentation>
+																	</xs:annotation>
+																	<xs:complexType>
+																		<xs:sequence>
+																			<xs:element name="computingResource" type="computingResourceExtType" minOccurs="0" maxOccurs="unbounded">
+																				<xs:annotation>
+																					<xs:documentation>Definition of resource reqiurements for processes</xs:documentation>
+																				</xs:annotation>
+																			</xs:element>
+																			<xs:element name="preferences" type="preferencesType" minOccurs="0"/>
+																		</xs:sequence>
+																	</xs:complexType>
+																</xs:element>
+															</xs:sequence>
+															<xs:attribute name="processesId" type="xs:string" use="optional"/>
+														</xs:complexType>
+													</xs:element>
+												</xs:sequence>
+											</xs:complexType>
+										</xs:element>
+									</xs:sequence>
+								</xs:complexType>
+							</xs:element>
+							<xs:element name="execution" type="executionType" minOccurs="0">
+							</xs:element>
+							<xs:element name="executionTime" type="executionTimeType" minOccurs="0"/>
+							<xs:element name="workflow" minOccurs="0">
+								<xs:complexType>
+									<xs:sequence>
+										<xs:element name="parent" maxOccurs="unbounded">
+											<xs:complexType>
+												<xs:simpleContent>
+													<xs:extension base="xs:string">
+														<xs:attribute name="runSameHost" type="xs:boolean" use="optional" default="false"/>
+														<xs:attribute name="triggerState" type="taskStatesName" use="optional" default="FINISHED"/>
+													</xs:extension>
+												</xs:simpleContent>
+											</xs:complexType>
+										</xs:element>
+									</xs:sequence>
+									<xs:attribute name="parentStates" use="optional" default="AND">
+										<xs:simpleType>
+											<xs:restriction base="xs:string">
+												<xs:enumeration value="AND"/>
+												<xs:enumeration value="OR"/>
+											</xs:restriction>
+										</xs:simpleType>
+									</xs:attribute>
+								</xs:complexType>
+							</xs:element>
+						</xs:sequence>
+						<xs:attribute name="jobId" type="xs:string" use="required"/>
+						<xs:attribute name="taskId" type="xs:string" use="required"/>
+						<xs:attribute name="submissionTime" type="xs:dateTime" use="required"/>
+						<xs:attribute name="userDN" type="xs:string" use="optional"/>
+						<xs:attribute name="extension" type="xs:string" use="optional"/>
+						<xs:attribute name="priority" type="xs:int" use="optional" default="0"/>
+						<xs:attribute name="domain" type="xs:string"/>
+					</xs:complexType>
+				</xs:element>
+			</xs:sequence>
+		</xs:complexType>
+	</xs:element>
+	<xs:complexType name="rangeType">
+		<xs:annotation>
+			<xs:documentation>Range of values definition</xs:documentation>
+		</xs:annotation>
+		<xs:sequence>
+			<xs:element name="min" type="parameterBoundaryType"/>
+			<xs:element name="max" type="parameterBoundaryType"/>
+		</xs:sequence>
+	</xs:complexType>
+	<xs:complexType name="parameterType">
+		<xs:annotation>
+			<xs:documentation>Description of parameter of resource</xs:documentation>
+		</xs:annotation>
+		<xs:choice>
+			<xs:choice maxOccurs="unbounded">
+				<xs:element name="value">
+					<xs:complexType>
+						<xs:simpleContent>
+							<xs:extension base="parameterValueType">
+								<xs:attribute name="exclude" type="xs:boolean" use="optional" default="false"/>
+							</xs:extension>
+						</xs:simpleContent>
+					</xs:complexType>
+				</xs:element>
+				<xs:element name="range">
+					<xs:complexType>
+						<xs:complexContent>
+							<xs:extension base="rangeType">
+								<xs:attribute name="exclude" type="xs:boolean" use="optional" default="false"/>
+							</xs:extension>
+						</xs:complexContent>
+					</xs:complexType>
+				</xs:element>
+			</xs:choice>
+			<xs:element name="min" type="parameterBoundaryType"/>
+			<xs:element name="max" type="parameterBoundaryType"/>
+			<xs:element name="stringValue" maxOccurs="unbounded">
+				<xs:complexType>
+					<xs:sequence>
+						<xs:element name="property" minOccurs="0" maxOccurs="unbounded">
+							<xs:complexType>
+								<xs:sequence>
+									<xs:element name="value" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+								</xs:sequence>
+								<xs:attribute name="name" type="xs:string" use="required"/>
+								<xs:attribute name="exclude" type="xs:boolean" use="optional" default="false"/>
+							</xs:complexType>
+						</xs:element>
+					</xs:sequence>
+					<xs:attribute name="value" type="xs:string" use="optional"/>
+					<xs:attribute name="exclude" type="xs:boolean" use="optional" default="false"/>
+				</xs:complexType>
+			</xs:element>
+		</xs:choice>
+	</xs:complexType>
+	<xs:complexType name="otherParameterType">
+		<xs:annotation>
+			<xs:documentation>Dynamically defined parameter of resource</xs:documentation>
+		</xs:annotation>
+		<xs:complexContent>
+			<xs:extension base="parameterType">
+				<xs:attribute name="name" type="xs:string" use="required"/>
+				<xs:attribute name="endpoint" type="xs:string" use="optional"/>
+			</xs:extension>
+		</xs:complexContent>
+	</xs:complexType>
+	<xs:complexType name="computingResourceNetParameterType">
+		<xs:annotation>
+			<xs:documentation>Network related prameter</xs:documentation>
+		</xs:annotation>
+		<xs:complexContent>
+			<xs:extension base="parameterType">
+				<xs:attribute name="name" use="required">
+					<xs:simpleType>
+						<xs:restriction base="xs:string">
+							<xs:enumeration value="bandwidth"/>
+							<xs:enumeration value="latency"/>
+							<xs:enumeration value="capacity"/>
+						</xs:restriction>
+					</xs:simpleType>
+				</xs:attribute>
+				<xs:attribute name="endpoint" type="xs:string" use="required"/>
+			</xs:extension>
+		</xs:complexContent>
+	</xs:complexType>
+	<xs:complexType name="computingResourceParameterType">
+		<xs:annotation>
+			<xs:documentation>Computational resource related parameter</xs:documentation>
+		</xs:annotation>
+		<xs:complexContent>
+			<xs:extension base="parameterType">
+				<xs:attribute name="name" use="required">
+					<xs:simpleType>
+						<xs:restriction base="xs:string">
+							<xs:enumeration value="osname"/>
+							<xs:enumeration value="ostype"/>
+							<xs:enumeration value="cpuarch"/>
+							<xs:enumeration value="osversion"/>
+							<xs:enumeration value="osrelease"/>
+							<xs:enumeration value="memory"/>
+							<xs:enumeration value="freememory"/>
+							<xs:enumeration value="cpucount"/>
+							<xs:enumeration value="freecpus"/>
+							<xs:enumeration value="cpuspeed"/>
+							<xs:enumeration value="application"/>
+							<xs:enumeration value="diskspace"/>
+							<xs:enumeration value="freediskspace"/>
+							<xs:enumeration value="remoteSubmissionInterface"/>
+							<xs:enumeration value="localResourceManager"/>
+							<xs:enumeration value="hostname"/>
+						</xs:restriction>
+					</xs:simpleType>
+				</xs:attribute>
+			</xs:extension>
+		</xs:complexContent>
+	</xs:complexType>
+	<xs:complexType name="countRangeType">
+		<xs:annotation>
+			<xs:documentation>Range of count parameter</xs:documentation>
+		</xs:annotation>
+		<xs:sequence>
+			<xs:element name="min" type="countBoundaryType"/>
+			<xs:element name="max" type="countBoundaryType"/>
+		</xs:sequence>
+	</xs:complexType>
+	<xs:complexType name="faultToleranceType">
+		<xs:annotation>
+			<xs:documentation>Fault tolerance description</xs:documentation>
+		</xs:annotation>
+		<xs:sequence>
+			<xs:element name="additionalCPUs" minOccurs="0">
+				<xs:complexType>
+					<xs:choice>
+						<xs:element name="count" type="countType"/>
+						<xs:element name="percentage" type="countType"/>
+					</xs:choice>
+				</xs:complexType>
+			</xs:element>
+		</xs:sequence>
+	</xs:complexType>
+	<xs:complexType name="hostCandidatesType">
+		<xs:annotation>
+			<xs:documentation>List of hosts used by GRMS in resource discovery process</xs:documentation>
+		</xs:annotation>
+		<xs:sequence>
+			<xs:element name="hostName" type="xs:string" maxOccurs="unbounded"/>
+		</xs:sequence>
+	</xs:complexType>
+	<xs:complexType name="otherNetParameterType">
+		<xs:annotation>
+			<xs:documentation>Additional - dynamically defined - parameters of network connection</xs:documentation>
+		</xs:annotation>
+		<xs:complexContent>
+			<xs:extension base="parameterType">
+				<xs:attribute name="name" type="xs:string" use="required"/>
+			</xs:extension>
+		</xs:complexContent>
+	</xs:complexType>
+	<xs:complexType name="networkResourceType">
+		<xs:annotation>
+			<xs:documentation>Description of network connection</xs:documentation>
+		</xs:annotation>
+		<xs:choice maxOccurs="unbounded">
+			<xs:element name="networkParameter" type="networkParameterType"/>
+			<xs:element name="otherParameter" type="otherNetParameterType"/>
+		</xs:choice>
+		<xs:attribute name="resourceId" type="xs:string" use="optional"/>
+	</xs:complexType>
+	<xs:complexType name="networkParameterType">
+		<xs:annotation>
+			<xs:documentation>Parameters of network connection</xs:documentation>
+		</xs:annotation>
+		<xs:complexContent>
+			<xs:extension base="parameterType">
+				<xs:attribute name="name" use="required">
+					<xs:simpleType>
+						<xs:restriction base="xs:string">
+							<xs:enumeration value="bandwidth"/>
+							<xs:enumeration value="latency"/>
+							<xs:enumeration value="capacity"/>
+						</xs:restriction>
+					</xs:simpleType>
+				</xs:attribute>
+			</xs:extension>
+		</xs:complexContent>
+	</xs:complexType>
+	<xs:complexType name="countType">
+		<xs:annotation>
+			<xs:documentation>Description of count element</xs:documentation>
+		</xs:annotation>
+		<xs:choice>
+			<xs:element name="value">
+				<xs:complexType>
+					<xs:simpleContent>
+						<xs:extension base="xs:int">
+							<xs:attribute name="indiffThreshold" type="xs:int" use="optional" default="0"/>
+						</xs:extension>
+					</xs:simpleContent>
+				</xs:complexType>
+			</xs:element>
+			<xs:element name="min" type="countBoundaryType"/>
+			<xs:element name="max" type="countBoundaryType"/>
+			<xs:element name="range" type="countRangeType"/>
+		</xs:choice>
+	</xs:complexType>
+	<xs:complexType name="computingResourceExtType">
+		<xs:annotation>
+			<xs:documentation>Extended computing resource description</xs:documentation>
+		</xs:annotation>
+		<xs:complexContent>
+			<xs:extension base="computingResourceType">
+				<xs:sequence>
+					<xs:element name="processesCount" type="countType" minOccurs="0"/>
+				</xs:sequence>
+			</xs:extension>
+		</xs:complexContent>
+	</xs:complexType>
+	<xs:complexType name="computingResourceBaseType">
+		<xs:annotation>
+			<xs:documentation>Base type for computing resource</xs:documentation>
+		</xs:annotation>
+		<xs:choice maxOccurs="unbounded">
+			<xs:element name="hostParameter" type="computingResourceParameterType"/>
+			<xs:element name="networkParameter" type="computingResourceNetParameterType"/>
+			<xs:element name="otherParameter" type="otherParameterType"/>
+		</xs:choice>
+		<xs:attribute name="resourceId" type="xs:string" use="optional"/>
+	</xs:complexType>
+	<xs:complexType name="computingResourceType">
+		<xs:annotation>
+			<xs:documentation>Coomputing resource</xs:documentation>
+		</xs:annotation>
+		<xs:complexContent>
+			<xs:extension base="computingResourceBaseType">
+				<xs:sequence>
+					<xs:element name="faultTolerance" type="faultToleranceType" minOccurs="0"/>
+				</xs:sequence>
+			</xs:extension>
+		</xs:complexContent>
+	</xs:complexType>
+	<xs:complexType name="parameterValueType">
+		<xs:annotation>
+			<xs:documentation>Value of the parameter</xs:documentation>
+		</xs:annotation>
+		<xs:simpleContent>
+			<xs:extension base="xs:double">
+				<xs:attribute name="indiffThreshold" type="xs:double" use="optional" default="0"/>
+			</xs:extension>
+		</xs:simpleContent>
+	</xs:complexType>
+	<xs:complexType name="parameterBoundaryType">
+		<xs:annotation>
+			<xs:documentation>Description of boundary for parameters</xs:documentation>
+		</xs:annotation>
+		<xs:simpleContent>
+			<xs:extension base="xs:double">
+				<xs:attribute name="exclusiveBound" type="xs:boolean" use="optional" default="false"/>
+			</xs:extension>
+		</xs:simpleContent>
+	</xs:complexType>
+	<xs:complexType name="countBoundaryType">
+		<xs:annotation>
+			<xs:documentation>Description of boundary for count</xs:documentation>
+		</xs:annotation>
+		<xs:simpleContent>
+			<xs:extension base="xs:int">
+				<xs:attribute name="exclusiveBound" type="xs:boolean" use="optional" default="false"/>
+			</xs:extension>
+		</xs:simpleContent>
+	</xs:complexType>
+	<xs:complexType name="executionTimeType">
+		<xs:annotation>
+			<xs:documentation>Description for time constraints of job execution</xs:documentation>
+		</xs:annotation>
+		<xs:sequence>
+			<xs:element name="timeSlot" minOccurs="0">
+				<xs:annotation>
+					<xs:documentation>Information when to start application</xs:documentation>
+				</xs:annotation>
+				<xs:complexType>
+					<xs:sequence>
+						<xs:element name="slotStart">
+							<xs:complexType>
+								<xs:simpleContent>
+									<xs:extension base="xs:time"/>
+								</xs:simpleContent>
+							</xs:complexType>
+						</xs:element>
+						<xs:choice>
+							<xs:element name="slotEnd" type="xs:time"/>
+							<xs:element name="slotDuration" type="xs:duration"/>
+						</xs:choice>
+					</xs:sequence>
+				</xs:complexType>
+			</xs:element>
+			<xs:element name="executionDuration" type="xs:duration">
+				<xs:annotation>
+					<xs:documentation>How long the Task is running</xs:documentation>
+				</xs:annotation>
+			</xs:element>
+			<xs:element name="timePeriod" minOccurs="0">
+				<xs:annotation>
+					<xs:documentation>Tme period where to look for time slot</xs:documentation>
+				</xs:annotation>
+				<xs:complexType>
+					<xs:sequence>
+						<xs:element name="periodStart" type="xs:dateTime" minOccurs="0"/>
+						<xs:choice>
+							<xs:element name="periodEnd" type="xs:dateTime"/>
+							<xs:element name="periodDuration" type="xs:duration"/>
+						</xs:choice>
+						<xs:element name="excluding" type="daysType" minOccurs="0"/>
+						<xs:element name="including" type="daysType" minOccurs="0"/>
+					</xs:sequence>
+				</xs:complexType>
+			</xs:element>
+		</xs:sequence>
+	</xs:complexType>
+	<xs:complexType name="daysType">
+		<xs:annotation>
+			<xs:documentation>Days of the week</xs:documentation>
+		</xs:annotation>
+		<xs:choice maxOccurs="unbounded">
+			<xs:element name="weekDay">
+				<xs:simpleType>
+					<xs:restriction base="xs:string">
+						<xs:enumeration value="Monday"/>
+						<xs:enumeration value="Tuesday"/>
+						<xs:enumeration value="Wednesday"/>
+						<xs:enumeration value="Thursday"/>
+						<xs:enumeration value="Friday"/>
+						<xs:enumeration value="Saturday"/>
+						<xs:enumeration value="Sunday"/>
+					</xs:restriction>
+				</xs:simpleType>
+			</xs:element>
+			<xs:element name="dateDay" type="xs:date"/>
+		</xs:choice>
+	</xs:complexType>
+	<xs:complexType name="preferencesType">
+		<xs:annotation>
+			<xs:documentation>User preferences concerning scheduling</xs:documentation>
+		</xs:annotation>
+		<xs:sequence>
+			<xs:element name="parameter" maxOccurs="unbounded">
+				<xs:complexType>
+					<xs:choice minOccurs="0">
+						<xs:choice>
+							<xs:element name="value" type="parameterValueType"/>
+							<xs:element name="min" type="parameterBoundaryType"/>
+							<xs:element name="max" type="parameterBoundaryType"/>
+							<xs:element name="range" type="rangeType"/>
+						</xs:choice>
+						<xs:element name="stringValue" type="xs:string"/>
+					</xs:choice>
+					<xs:attribute name="name" type="xs:string" use="required"/>
+					<xs:attribute name="optimizationType" use="required">
+						<xs:simpleType>
+							<xs:restriction base="xs:string">
+								<xs:enumeration value="GAIN"/>
+								<xs:enumeration value="COST"/>
+							</xs:restriction>
+						</xs:simpleType>
+					</xs:attribute>
+					<xs:attribute name="importance" type="xs:int" use="required"/>
+					<xs:attribute name="endpoint" type="xs:string" use="optional"/>
+				</xs:complexType>
+			</xs:element>
+		</xs:sequence>
+		<xs:attribute name="preferenceType" use="required">
+			<xs:simpleType>
+				<xs:restriction base="xs:string">
+					<xs:enumeration value="PRIORITY"/>
+					<xs:enumeration value="RANKING"/>
+				</xs:restriction>
+			</xs:simpleType>
+		</xs:attribute>
+	</xs:complexType>
+	<xs:complexType name="proxyInfoType">
+		<xs:annotation>
+			<xs:documentation>Descriprion of proxy certificate</xs:documentation>
+		</xs:annotation>
+		<xs:sequence>
+			<xs:element name="proxyName" maxOccurs="unbounded">
+				<xs:complexType>
+					<xs:simpleContent>
+						<xs:extension base="xs:string">
+							<xs:attribute name="lifetime" type="xs:int" use="optional"/>
+						</xs:extension>
+					</xs:simpleContent>
+				</xs:complexType>
+			</xs:element>
+		</xs:sequence>
+	</xs:complexType>
+	<xs:complexType name="executionType">
+		<xs:sequence>
+			<xs:element name="stageInOut" minOccurs="0">
+				<xs:annotation>
+					<xs:documentation>Description of files and directories to be stage out or in</xs:documentation>
+				</xs:annotation>
+				<xs:complexType>
+					<xs:choice maxOccurs="unbounded">
+						<xs:element name="file" type="fileType"/>
+						<xs:element name="directory" type="fileType"/>
+					</xs:choice>
+				</xs:complexType>
+			</xs:element>
+		</xs:sequence>
+	</xs:complexType>	
+	<xs:complexType name="fileType">
+		<xs:annotation>
+			<xs:documentation>Element that describes a file</xs:documentation>
+		</xs:annotation>
+		<xs:complexContent>
+			<xs:extension base="baseFileType">
+				<xs:attribute name="name" type="xs:string" use="required"/>
+				<xs:attribute name="type" use="required">
+					<xs:simpleType>
+						<xs:restriction base="xs:string">
+							<xs:enumeration value="in"/>
+							<xs:enumeration value="out"/>
+						</xs:restriction>
+					</xs:simpleType>
+				</xs:attribute>
+				<xs:attribute name="required" type="xs:boolean" use="optional" default="true"/>
+			</xs:extension>
+		</xs:complexContent>
+	</xs:complexType>
+	<xs:complexType name="baseFileType">
+		<xs:annotation>
+			<xs:documentation>Base element for file description</xs:documentation>
+		</xs:annotation>
+		<xs:sequence>
+			<xs:element name="location">
+				<xs:complexType>
+					<xs:simpleContent>
+						<xs:extension base="xs:string">
+							<xs:attribute name="type" type="locationTypes" use="required"/>
+						</xs:extension>
+					</xs:simpleContent>
+				</xs:complexType>
+			</xs:element>
+			<xs:element name="locationProperties" minOccurs="0">
+				<xs:complexType>
+					<xs:sequence>
+						<xs:element name="locationProperty">
+							<xs:complexType>
+								<xs:simpleContent>
+									<xs:extension base="xs:string">
+										<xs:attribute name="name" type="xs:string"/>
+									</xs:extension>
+								</xs:simpleContent>
+							</xs:complexType>
+						</xs:element>
+					</xs:sequence>
+				</xs:complexType>
+			</xs:element>
+		</xs:sequence>
+		<xs:attribute name="size" type="xs:double" use="optional"/>
+	</xs:complexType>
+	<xs:simpleType name="locationTypes">
+		<xs:restriction base="xs:string">
+			<xs:enumeration value="URL"/>
+			<xs:enumeration value="DMSID"/>
+			<xs:enumeration value="SRBID"/>
+			<xs:enumeration value="REFERENCE"/>
+		</xs:restriction>
+	</xs:simpleType>
+</xs:schema>
Index: DCWoRMS/trunk/simulator/schemas/grms3/GrmsSchedulingPlanSchema_binding.xml
===================================================================
--- DCWoRMS/trunk/simulator/schemas/grms3/GrmsSchedulingPlanSchema_binding.xml	(revision 477)
+++ DCWoRMS/trunk/simulator/schemas/grms3/GrmsSchedulingPlanSchema_binding.xml	(revision 477)
@@ -0,0 +1,25 @@
+<binding defaultBindingType="type">
+
+    <package>
+	<name>grms.types.schemas.schedulingplan</name>	
+	<namespace></namespace>
+    </package>
+    
+    <elementBinding name="/schedulingPlan/taskAllocation/timeSlot">
+                <java-class name="TaskTimeSlot">
+        </java-class>
+    </elementBinding>
+
+    <elementBinding name="/complexType:availabilityType/timeSlot">
+                <java-class name="AvailabilityTimeSlot">
+        </java-class>
+    </elementBinding>
+
+    <elementBinding name="/schedulingPlan/taskAllocation/additionalProperties/property">
+                <java-class name="TaskProperty">
+        </java-class>
+    </elementBinding>
+
+</binding>
+
+	 
Index: DCWoRMS/trunk/simulator/schemas/grms3/GrmsHostParametersSchema_binding.xml
===================================================================
--- DCWoRMS/trunk/simulator/schemas/grms3/GrmsHostParametersSchema_binding.xml	(revision 477)
+++ DCWoRMS/trunk/simulator/schemas/grms3/GrmsHostParametersSchema_binding.xml	(revision 477)
@@ -0,0 +1,24 @@
+<binding defaultBindingType="type">
+	<package>
+		<name>grms.types.schemas.hostparams</name>
+		<namespace/>
+	</package>
+	
+	<elementBinding name="/hostParameters/topology/resourcesGroup/resources">
+		<java-class name="GroupResources">
+        </java-class>
+	</elementBinding>
+
+	<elementBinding name="/complexType:additionalPropertiesType/property">
+		<java-class name="AdditionalProperty">
+        </java-class>
+	</elementBinding>
+
+	<elementBinding name="/complexType:availabilityType/timeSlot">
+		<java-class name="availabilityTimeSlot">
+        </java-class>
+	</elementBinding>
+	
+	
+
+</binding>
Index: DCWoRMS/trunk/simulator/schemas/grms3/GrmsJobDescriptionSchema.xsd
===================================================================
--- DCWoRMS/trunk/simulator/schemas/grms3/GrmsJobDescriptionSchema.xsd	(revision 477)
+++ DCWoRMS/trunk/simulator/schemas/grms3/GrmsJobDescriptionSchema.xsd	(revision 477)
@@ -0,0 +1,1047 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- edited with XMLSPY v5 rel. 4 U (http://www.xmlspy.com) by yulo (Instytut Chemii Bioorganicznej PAN) -->
+<!--Job Description Schema for Third Edition GRMS -->
+<!--version 0.1.0-->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified"
+  xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
+  jxb:version="1.0">
+  <xs:annotation>
+   <xs:appinfo>
+      <jxb:schemaBindings>
+         <jxb:package name="pl.psnc.qcg.grms.jobprofile"/>
+      </jxb:schemaBindings>
+   </xs:appinfo>
+  </xs:annotation>
+  <xs:simpleType name="computingParameterName">
+		<xs:restriction base="xs:string">
+			<xs:enumeration value="osname"/>
+			<xs:enumeration value="ostype"/>
+			<xs:enumeration value="cpuarch"/>
+			<xs:enumeration value="osversion"/>
+			<xs:enumeration value="osrelease"/>
+			<xs:enumeration value="memory"/>
+			<xs:enumeration value="freememory"/>
+			<xs:enumeration value="cpucount"/>
+			<xs:enumeration value="freecpus"/>
+			<xs:enumeration value="cpuspeed"/>
+			<xs:enumeration value="application"/>
+			<xs:enumeration value="diskspace"/>
+			<xs:enumeration value="freediskspace"/>
+			<xs:enumeration value="remoteSubmissionInterface"/>
+			<xs:enumeration value="localResourceManager"/>
+			<xs:enumeration value="hostname"/>
+		</xs:restriction>
+	</xs:simpleType>
+	<xs:simpleType name="networkParameterName">
+		<xs:restriction base="xs:string">
+			<xs:enumeration value="bandwidth"/>
+			<xs:enumeration value="latency"/>
+			<xs:enumeration value="capacity"/>
+		</xs:restriction>
+	</xs:simpleType>
+	<xs:simpleType name="taskStatesName">
+		<xs:restriction base="xs:string">
+			<xs:enumeration value="QUEUED"/>
+			<xs:enumeration value="PREPROCESSING"/>
+			<xs:enumeration value="PENDING"/>
+			<xs:enumeration value="RUNNING"/>
+			<xs:enumeration value="STOPPED"/>
+			<xs:enumeration value="POSTPROCESSING"/>
+			<xs:enumeration value="SUSPENDED"/>
+			<xs:enumeration value="FINISHED"/>
+			<xs:enumeration value="CANCELED"/>
+			<xs:enumeration value="FAILED"/>
+		</xs:restriction>
+	</xs:simpleType>
+	<xs:simpleType name="locationTypes">
+		<xs:restriction base="xs:string">
+			<xs:enumeration value="URL"/>
+			<xs:enumeration value="DMSID"/>
+			<xs:enumeration value="SRBID"/>
+			<xs:enumeration value="REFERENCE"/>
+		</xs:restriction>
+	</xs:simpleType>
+	<xs:element name="grmsJob">
+		<xs:annotation>
+			<xs:documentation>Job Description for Gridge Resource Management System</xs:documentation>
+		</xs:annotation>
+		<xs:complexType>
+			<xs:sequence>
+				<xs:element name="description" type="xs:string" minOccurs="0">
+					<xs:annotation>
+						<xs:documentation>User defined description of Job</xs:documentation>
+					</xs:annotation>
+				</xs:element>
+				<xs:element name="annotations" minOccurs="0">
+					<xs:annotation>
+						<xs:documentation>Annotations for Job Description in pair key/value format</xs:documentation>
+					</xs:annotation>
+					<xs:complexType>
+						<xs:sequence>
+							<xs:element name="annotation" maxOccurs="unbounded">
+								<xs:complexType>
+									<xs:simpleContent>
+										<xs:extension base="xs:string">
+											<xs:attribute name="name" type="xs:string" use="optional"/>
+										</xs:extension>
+									</xs:simpleContent>
+								</xs:complexType>
+							</xs:element>
+						</xs:sequence>
+					</xs:complexType>
+				</xs:element>
+				<xs:element name="descriptionVariables" type="descriptionVariablesType" minOccurs="0"/>
+				<xs:element name="resourceTemplates" type="resourceTemplatesType" minOccurs="0">
+					<xs:annotation>
+						<xs:documentation>Global templates for definitions of resources</xs:documentation>
+					</xs:annotation>
+				</xs:element>
+				<xs:element name="tasksDefaults" minOccurs="0">
+					<xs:annotation>
+						<xs:documentation>Default settings for all Tasks in Job Description - used when there is no other definitions in particular task description</xs:documentation>
+					</xs:annotation>
+					<xs:complexType>
+						<xs:sequence>
+							<xs:element name="proxyInfo" type="proxyInfoType" minOccurs="0"/>
+							<xs:element name="candidateHosts" type="hostCandidatesType" minOccurs="0"/>
+							<xs:element name="requirements" type="requirementsType" minOccurs="0"/>
+							<xs:element name="faultTolerance" type="faultToleranceType" minOccurs="0"/>
+							<xs:element name="executionTime" type="executionTimeType" minOccurs="0"/>
+						</xs:sequence>
+					</xs:complexType>
+					<xs:keyref name="deftemplidref" refer="deftemplId">
+						<xs:selector xpath="./resourcesDescription/resourceRequirements/computingResource | ./resourcesDescription/topology/group/processesConnection/networkResource  | ./resourcesDescription/topology/group/groupConnection/networkResource"/>
+						<xs:field xpath="templateIdReference"/>
+					</xs:keyref>
+					<xs:key name="defgroupid">
+						<xs:selector xpath="./resourcesDescription/resourceRequirements/topology/group"/>
+						<xs:field xpath="@groupId"/>
+					</xs:key>
+                                        <xs:keyref name="defgroupidref" refer="defgroupid">
+						<xs:selector xpath="./resourcesDescription/resourceRequirements/topology/processes"/>
+						<xs:field xpath="groupIdReference"/>
+					</xs:keyref>
+					<xs:key name="defresid">
+						<xs:selector xpath="./resourcesDescription/resourceRequirements/computingResource"/>
+						<xs:field xpath="@resourceId"/>
+					</xs:key>
+				</xs:element>
+				<xs:element name="task" maxOccurs="unbounded">
+					<xs:annotation>
+						<xs:documentation>Description of Tasks</xs:documentation>
+						<xs:documentation>Description of Simple Job</xs:documentation>
+					</xs:annotation>
+					<xs:complexType>
+						<xs:complexContent>
+							<xs:extension base="taskType"/>
+						</xs:complexContent>
+					</xs:complexType>
+					<xs:keyref name="taskidref" refer="taskId">
+						<xs:selector xpath="./workflow"/>
+						<xs:field xpath="parent"/>
+					</xs:keyref>
+					<xs:keyref name="ext" refer="taskId">
+						<xs:selector xpath="."/>
+						<xs:field xpath="@extension"/>
+					</xs:keyref>
+                                        <xs:key name="defprocessesid">
+						<xs:selector xpath=".//processes"/>
+						<xs:field xpath="@processesId"/>
+					</xs:key>
+                                        
+				</xs:element>
+				<xs:element name="executionTime" type="executionTimeType" minOccurs="0">
+					<xs:annotation>
+						<xs:documentation>Execution time definition for Job</xs:documentation>
+					</xs:annotation>
+				</xs:element>
+			</xs:sequence>
+			<xs:attribute name="appId" type="xs:string" use="required"/>
+			<xs:attribute name="project" type="xs:string" use="optional"/>
+			<xs:attribute name="commitWait" type="xs:boolean" use="optional" default="false"/>
+			<xs:attribute name="priority" type="xs:int" use="optional" default="0"/>
+		</xs:complexType>
+		<xs:key name="taskId">
+			<xs:selector xpath=".//task"/>
+			<xs:field xpath="@taskId"/>
+		</xs:key>
+		<xs:key name="templid">
+			<xs:selector xpath="./resourceTemplates/* | ./task/resourcesDescription/resourceTemplates/*"/>
+			<xs:field xpath="@templateId"/>
+		</xs:key>
+		<xs:key name="deftemplId">
+			<xs:selector xpath="./resourceTemplates/* | ./tasksDefaults/resourcesDescription/resourceTemplates/*"/>
+			<xs:field xpath="@templateId"/>
+		</xs:key>
+	</xs:element>
+	<xs:complexType name="taskType">
+		<xs:annotation>
+			<xs:documentation>Description of Task</xs:documentation>
+		</xs:annotation>
+		<xs:sequence>
+			<xs:element name="description" type="xs:string" minOccurs="0">
+				<xs:annotation>
+					<xs:documentation>User defined description of Task</xs:documentation>
+				</xs:annotation>
+			</xs:element>
+			<xs:element name="descriptionVariables" type="descriptionVariablesType" minOccurs="0"/>
+			<xs:element name="proxyInfo" type="proxyInfoType" minOccurs="0">
+				<xs:annotation>
+					<xs:documentation>Proxy used for task execution</xs:documentation>
+				</xs:annotation>
+			</xs:element>
+			<xs:element name="candidateHosts" type="hostCandidatesType" minOccurs="0">
+				<xs:annotation>
+					<xs:documentation>List of hosts used by GRMS in resource discovery process</xs:documentation>
+				</xs:annotation>
+			</xs:element>
+			<xs:element name="requirements" type="requirementsType" minOccurs="0">
+				<xs:annotation>
+					<xs:documentation>Description of resource requirements</xs:documentation>
+				</xs:annotation>
+				<xs:keyref name="templidref" refer="templid">
+					<xs:selector xpath="./resourceRequirements/computingResource"/>
+					<xs:field xpath="templateIdReference"/>
+				</xs:keyref>
+				<!--				
+				<xs:key name="resourceid">
+					<xs:selector xpath="./resourceRequirements/computingResource"/>
+					<xs:field xpath="@resourceId"/>
+				</xs:key>
+-->
+			</xs:element>
+			<xs:element name="execution" type="executionType" minOccurs="0">
+				<xs:annotation>
+					<xs:documentation>Application description section</xs:documentation>
+				</xs:annotation>
+				<!--				
+				<xs:key name="fileid">
+					<xs:selector xpath="*"/>
+					<xs:field xpath="@fileDirId"/>
+				</xs:key>
+				<xs:keyref name="fileidref" refer="fileid">
+					<xs:selector xpath="*"/>
+					<xs:field xpath="fileDirIdRef"/>
+				</xs:keyref>
+-->
+			</xs:element>
+			<xs:element name="postResumeExecution" type="executionType" minOccurs="0">
+				<xs:annotation>
+					<xs:documentation>Description of application execution after Resume call (or during migration process)</xs:documentation>
+				</xs:annotation>
+			</xs:element>
+			<xs:element name="executionTime" type="executionTimeType" minOccurs="0">
+				<xs:annotation>
+					<xs:documentation>Description of time constraints for task execution</xs:documentation>
+				</xs:annotation>
+			</xs:element>
+			<xs:element name="workflow" minOccurs="0">
+				<xs:annotation>
+					<xs:documentation>Workflow description</xs:documentation>
+				</xs:annotation>
+				<xs:complexType>
+					<xs:choice>
+						<xs:element name="parent" type="parentType" maxOccurs="unbounded"/>
+						<xs:element name="or" type="parentOpType"/>
+						<xs:element name="and" type="parentOpType"/>
+					</xs:choice>
+				</xs:complexType>
+			</xs:element>
+			<xs:element name="parametersSweep" minOccurs="0">
+				<xs:complexType>
+					<xs:sequence>
+						<xs:element name="parameter" type="parametersSweepParameter" maxOccurs="unbounded"/>
+					</xs:sequence>
+				</xs:complexType>
+			</xs:element>
+			<xs:element name="faultTolerance" type="faultToleranceType" minOccurs="0">
+				<xs:annotation>
+					<xs:documentation>Fault tolerance requirements</xs:documentation>
+				</xs:annotation>
+			</xs:element>
+			<xs:element name="other" type="extensionType" minOccurs="0">
+				<xs:annotation>
+					<xs:documentation>Additional parameters</xs:documentation>
+				</xs:annotation>
+			</xs:element>
+		</xs:sequence>
+		<xs:attribute name="taskId" type="xs:string" use="required"/>
+		<xs:attribute name="persistent" type="xs:boolean" use="optional" default="false"/>
+		<xs:attribute name="extension" type="xs:string" use="optional"/>
+		<xs:attribute name="crucial" type="xs:boolean" use="optional" default="true"/>
+		<xs:attribute name="commitWait" type="xs:boolean" use="optional" default="false"/>
+		<xs:attribute name="useScratchDir" type="xs:boolean" use="optional"/>
+		<xs:attribute name="priority" type="xs:int" use="optional" default="0"/>
+	</xs:complexType>
+	<xs:complexType name="fileType">
+		<xs:annotation>
+			<xs:documentation>Element that describes a file</xs:documentation>
+		</xs:annotation>
+		<xs:complexContent>
+			<xs:extension base="baseFileType">
+				<xs:attribute name="name" type="xs:string" use="required"/>
+				<xs:attribute name="type" use="required">
+					<xs:simpleType>
+						<xs:restriction base="xs:string">
+							<xs:enumeration value="in"/>
+							<xs:enumeration value="out"/>
+						</xs:restriction>
+					</xs:simpleType>
+				</xs:attribute>
+				<xs:attribute name="required" type="xs:boolean" use="optional" default="true"/>
+				<xs:attribute name="creationFlag" use="optional" default="OVERWRITE">
+					<xs:simpleType>
+						<xs:restriction base="xs:string">
+							<xs:enumeration value="APPEND"/>
+							<xs:enumeration value="OVERWRITE"/>
+							<xs:enumeration value="DONTOVERWRITE"/>
+						</xs:restriction>
+					</xs:simpleType>
+				</xs:attribute>
+			</xs:extension>
+		</xs:complexContent>
+	</xs:complexType>
+	<xs:complexType name="baseFileType">
+		<xs:annotation>
+			<xs:documentation>Base element for file description</xs:documentation>
+		</xs:annotation>
+		<xs:sequence>
+			<xs:element name="location">
+				<xs:complexType>
+					<xs:simpleContent>
+						<xs:extension base="xs:string">
+							<xs:attribute name="type" type="locationTypes" use="required"/>
+						</xs:extension>
+					</xs:simpleContent>
+				</xs:complexType>
+			</xs:element>
+			<xs:element name="locationProperties" minOccurs="0">
+				<xs:complexType>
+					<xs:sequence>
+						<xs:element name="property">
+							<xs:complexType>
+								<xs:simpleContent>
+									<xs:extension base="xs:string">
+										<xs:attribute name="name" type="xs:string"/>
+									</xs:extension>
+								</xs:simpleContent>
+							</xs:complexType>
+						</xs:element>
+					</xs:sequence>
+				</xs:complexType>
+			</xs:element>
+		</xs:sequence>
+		<xs:attribute name="proxyName" type="xs:string" use="optional"/>
+		<xs:attribute name="fileDirId" type="xs:string" use="optional"/>
+		<xs:attribute name="permissions" type="xs:string" use="optional"/>
+		<xs:attribute name="deleteOnTermination" type="xs:boolean" use="optional" default="false"/>
+		<xs:attribute name="size" type="xs:double" use="optional"/>
+	</xs:complexType>
+	<xs:complexType name="executionTimeType">
+		<xs:annotation>
+			<xs:documentation>Description for time constraints of job execution</xs:documentation>
+		</xs:annotation>
+		<xs:sequence>
+			<xs:element name="timeSlot" minOccurs="0">
+				<xs:annotation>
+					<xs:documentation>Information when to start application</xs:documentation>
+				</xs:annotation>
+				<xs:complexType>
+					<xs:sequence>
+						<xs:element name="slotStart">
+							<xs:complexType>
+								<xs:simpleContent>
+									<xs:extension base="xs:time"/>
+								</xs:simpleContent>
+							</xs:complexType>
+						</xs:element>
+						<xs:choice>
+							<xs:element name="slotEnd" type="xs:time"/>
+							<xs:element name="slotDuration" type="xs:duration"/>
+						</xs:choice>
+					</xs:sequence>
+				</xs:complexType>
+			</xs:element>
+			<xs:element name="executionDuration" type="xs:duration">
+				<xs:annotation>
+					<xs:documentation>How long the Task is running</xs:documentation>
+				</xs:annotation>
+			</xs:element>
+			<xs:element name="timePeriod" minOccurs="0">
+				<xs:annotation>
+					<xs:documentation>Time period where to look for time slot</xs:documentation>
+				</xs:annotation>
+				<xs:complexType>
+					<xs:sequence>
+						<xs:element name="periodStart" type="xs:dateTime" minOccurs="0"/>
+						<xs:choice>
+							<xs:element name="periodEnd" type="xs:dateTime"/>
+							<xs:element name="periodDuration" type="xs:duration"/>
+						</xs:choice>
+						<xs:element name="excluding" type="daysType" minOccurs="0"/>
+						<xs:element name="including" type="daysType" minOccurs="0"/>
+					</xs:sequence>
+				</xs:complexType>
+			</xs:element>
+		</xs:sequence>
+	</xs:complexType>
+	<xs:complexType name="extensionType">
+		<xs:annotation>
+			<xs:documentation>Dynamically defined extension to job description</xs:documentation>
+		</xs:annotation>
+		<xs:sequence>
+			<xs:any namespace="##any" processContents="skip" maxOccurs="unbounded"/>
+		</xs:sequence>
+	</xs:complexType>
+	<xs:complexType name="proxyInfoType">
+		<xs:annotation>
+			<xs:documentation>Description of proxy certificate</xs:documentation>
+		</xs:annotation>
+		<xs:sequence>
+			<xs:element name="proxyName" maxOccurs="unbounded">
+				<xs:complexType>
+					<xs:simpleContent>
+						<xs:extension base="xs:string">
+							<xs:attribute name="lifetime" type="xs:int" use="optional"/>
+						</xs:extension>
+					</xs:simpleContent>
+				</xs:complexType>
+			</xs:element>
+		</xs:sequence>
+	</xs:complexType>
+	<xs:complexType name="rangeType">
+		<xs:annotation>
+			<xs:documentation>Range of values definition</xs:documentation>
+		</xs:annotation>
+		<xs:sequence>
+			<xs:element name="min" type="parameterBoundaryType"/>
+			<xs:element name="max" type="parameterBoundaryType"/>
+		</xs:sequence>
+	</xs:complexType>
+	<xs:complexType name="parameterType">
+		<xs:annotation>
+			<xs:documentation>Description of parameter of resource</xs:documentation>
+		</xs:annotation>
+		<xs:choice>
+			<xs:choice maxOccurs="unbounded">
+				<xs:element name="value">
+					<xs:complexType>
+						<xs:simpleContent>
+							<xs:extension base="parameterValueType">
+								<xs:attribute name="exclude" type="xs:boolean" use="optional" default="false"/>
+							</xs:extension>
+						</xs:simpleContent>
+					</xs:complexType>
+				</xs:element>
+				<xs:element name="range">
+					<xs:complexType>
+						<xs:complexContent>
+							<xs:extension base="rangeType">
+								<xs:attribute name="exclude" type="xs:boolean" use="optional" default="false"/>
+							</xs:extension>
+						</xs:complexContent>
+					</xs:complexType>
+				</xs:element>
+			</xs:choice>
+			<xs:element name="min" type="parameterBoundaryType"/>
+			<xs:element name="max" type="parameterBoundaryType"/>
+			<xs:element name="stringValue" maxOccurs="unbounded">
+				<xs:complexType>
+					<xs:sequence>
+						<xs:element name="property" minOccurs="0" maxOccurs="unbounded">
+							<xs:complexType>
+								<xs:sequence>
+									<xs:element name="value" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+								</xs:sequence>
+								<xs:attribute name="name" type="xs:string" use="required"/>
+								<xs:attribute name="exclude" type="xs:boolean" use="optional" default="false"/>
+							</xs:complexType>
+						</xs:element>
+					</xs:sequence>
+					<xs:attribute name="value" type="xs:string" use="optional"/>
+					<xs:attribute name="exclude" type="xs:boolean" use="optional" default="false"/>
+				</xs:complexType>
+			</xs:element>
+		</xs:choice>
+	</xs:complexType>
+	<xs:complexType name="otherParameterType">
+		<xs:annotation>
+			<xs:documentation>Dynamically defined parameter of resource</xs:documentation>
+		</xs:annotation>
+		<xs:complexContent>
+			<xs:extension base="parameterType">
+				<xs:attribute name="name" type="xs:string" use="required"/>
+				<xs:attribute name="endpoint" type="xs:string" use="optional"/>
+			</xs:extension>
+		</xs:complexContent>
+	</xs:complexType>
+	<xs:complexType name="otherNetParameterType">
+		<xs:annotation>
+			<xs:documentation>Additional - dynamically defined - parameters of network connection</xs:documentation>
+		</xs:annotation>
+		<xs:complexContent>
+			<xs:extension base="parameterType">
+				<xs:attribute name="name" type="xs:string" use="required"/>
+			</xs:extension>
+		</xs:complexContent>
+	</xs:complexType>
+	<xs:complexType name="networkParameterType">
+		<xs:annotation>
+			<xs:documentation>Parameters of network connection</xs:documentation>
+		</xs:annotation>
+		<xs:complexContent>
+			<xs:extension base="parameterType">
+				<xs:attribute name="name" type="networkParameterName" use="required" />
+			</xs:extension>
+		</xs:complexContent>
+	</xs:complexType>
+	<xs:complexType name="computingResourceBaseType">
+		<xs:annotation>
+			<xs:documentation>Base type for computing resource</xs:documentation>
+		</xs:annotation>
+		<xs:choice>
+			<xs:choice maxOccurs="unbounded">
+				<xs:element name="hostParameter" type="computingResourceParameterType"/>
+				<xs:element name="networkParameter" type="computingResourceNetParameterType"/>
+				<xs:element name="otherParameter" type="otherParameterType"/>
+			</xs:choice>
+			<xs:element name="templateIdReference" type="xs:string"/>
+		</xs:choice>
+		<xs:attribute name="resourceId" type="xs:string" use="optional"/>
+	</xs:complexType>
+	<xs:complexType name="computingResourceType">
+		<xs:annotation>
+			<xs:documentation>Computing resource</xs:documentation>
+		</xs:annotation>
+		<xs:complexContent>
+			<xs:extension base="computingResourceBaseType">
+				<xs:sequence>
+					<xs:element name="faultTolerance" type="faultToleranceType" minOccurs="0"/>
+				</xs:sequence>
+			</xs:extension>
+		</xs:complexContent>
+	</xs:complexType>
+	<xs:complexType name="computingResourceExtType">
+		<xs:annotation>
+			<xs:documentation>Extended computing resource description</xs:documentation>
+		</xs:annotation>
+		<xs:complexContent>
+			<xs:extension base="computingResourceType">
+				<xs:sequence>
+					<xs:element name="processesCount" type="countType" minOccurs="0"/>
+				</xs:sequence>
+			</xs:extension>
+		</xs:complexContent>
+	</xs:complexType>
+	<xs:complexType name="computingResourceNetParameterType">
+		<xs:annotation>
+			<xs:documentation>Network related parameter</xs:documentation>
+		</xs:annotation>
+		<xs:complexContent>
+			<xs:extension base="parameterType">
+				<xs:attribute name="name" type="networkParameterName" use="required"/>
+				<xs:attribute name="endpoint" type="xs:string" use="required"/>
+			</xs:extension>
+		</xs:complexContent>
+	</xs:complexType>
+	<xs:complexType name="computingResourceParameterType">
+		<xs:annotation>
+			<xs:documentation>Computational resource related parameter</xs:documentation>
+		</xs:annotation>
+		<xs:complexContent>
+			<xs:extension base="parameterType">
+				<xs:attribute name="name" type="computingParameterName" use="required"/>
+			</xs:extension>
+		</xs:complexContent>
+	</xs:complexType>
+	<xs:complexType name="networkResourceType">
+		<xs:annotation>
+			<xs:documentation>Description of network connection</xs:documentation>
+		</xs:annotation>
+		<xs:choice>
+			<xs:choice maxOccurs="unbounded">
+				<xs:element name="networkParameter" type="networkParameterType"/>
+				<xs:element name="otherParameter" type="otherNetParameterType"/>
+			</xs:choice>
+			<xs:element name="templateIdReference" type="xs:string"/>
+		</xs:choice>
+		<xs:attribute name="resourceId" type="xs:string" use="optional"/>
+	</xs:complexType>
+	<xs:complexType name="executionType">
+		<xs:annotation>
+			<xs:documentation>Definition of program execution part of job description</xs:documentation>
+		</xs:annotation>
+		<xs:sequence>
+			<xs:element name="executable">
+				<xs:annotation>
+					<xs:documentation>Description of application executable</xs:documentation>
+				</xs:annotation>
+				<xs:complexType>
+					<xs:choice>
+						<xs:element name="application">
+							<xs:annotation>
+								<xs:documentation>Information about application installed on host</xs:documentation>
+							</xs:annotation>
+							<xs:complexType>
+								<xs:sequence>
+									<xs:element name="appProperty" minOccurs="0" maxOccurs="unbounded">
+										<xs:complexType>
+											<xs:simpleContent>
+												<xs:extension base="xs:string">
+													<xs:attribute name="name" type="xs:string" use="required"/>
+												</xs:extension>
+											</xs:simpleContent>
+										</xs:complexType>
+									</xs:element>
+								</xs:sequence>
+								<xs:attribute name="name" type="xs:string" use="required"/>
+							</xs:complexType>
+						</xs:element>
+						<xs:element name="execFile" maxOccurs="unbounded">
+							<xs:annotation>
+								<xs:documentation>Executable file description</xs:documentation>
+							</xs:annotation>
+							<xs:complexType>
+								<xs:sequence>
+									<xs:element name="execProperties" minOccurs="0">
+										<xs:annotation>
+											<xs:documentation>Properties of given executable</xs:documentation>
+										</xs:annotation>
+										<xs:complexType>
+											<xs:choice>
+												<xs:element name="resourceIdReference" type="xs:string"/>
+												<xs:choice maxOccurs="unbounded">
+													<xs:element name="hostParameter" type="computingResourceParameterType"/>
+													<xs:element name="otherParameter" type="otherParameterType"/>
+												</xs:choice>
+											</xs:choice>
+										</xs:complexType>
+									</xs:element>
+									<xs:element name="file">
+										<xs:annotation>
+											<xs:documentation>Exec file</xs:documentation>
+										</xs:annotation>
+										<xs:complexType>
+											<xs:complexContent>
+												<xs:extension base="baseFileType">
+													<xs:attribute name="name" type="xs:string" use="optional"/>
+												</xs:extension>
+											</xs:complexContent>
+										</xs:complexType>
+									</xs:element>
+								</xs:sequence>
+							</xs:complexType>
+						</xs:element>
+					</xs:choice>
+				</xs:complexType>
+			</xs:element>
+			<xs:element name="arguments" minOccurs="0">
+				<xs:annotation>
+					<xs:documentation>Arguments of executable</xs:documentation>
+				</xs:annotation>
+				<xs:complexType>
+					<xs:sequence>
+						<xs:element name="value" type="xs:string" maxOccurs="unbounded"/>
+					</xs:sequence>
+				</xs:complexType>
+			</xs:element>
+			<xs:element name="stdin" type="baseFileType" minOccurs="0">
+				<xs:annotation>
+					<xs:documentation>Standard input stream location</xs:documentation>
+				</xs:annotation>
+			</xs:element>
+			<xs:element name="stdout" type="baseFileType" minOccurs="0">
+				<xs:annotation>
+					<xs:documentation>Standard output stream location</xs:documentation>
+				</xs:annotation>
+			</xs:element>
+			<xs:element name="stderr" type="baseFileType" minOccurs="0">
+				<xs:annotation>
+					<xs:documentation>Standard error stream location</xs:documentation>
+				</xs:annotation>
+			</xs:element>
+			<xs:element name="stageInOut" minOccurs="0">
+				<xs:annotation>
+					<xs:documentation>Description of files and directories to be stage out or in</xs:documentation>
+				</xs:annotation>
+				<xs:complexType>
+					<xs:choice maxOccurs="unbounded">
+						<xs:element name="file" type="fileType"/>
+						<xs:element name="directory" type="fileType"/>
+					</xs:choice>
+				</xs:complexType>
+			</xs:element>
+			<xs:element name="environment" minOccurs="0">
+				<xs:annotation>
+					<xs:documentation>Environment variables</xs:documentation>
+				</xs:annotation>
+				<xs:complexType>
+					<xs:sequence>
+						<xs:element name="variable" maxOccurs="unbounded">
+							<xs:complexType>
+								<xs:simpleContent>
+									<xs:extension base="xs:string">
+										<xs:attribute name="name" type="xs:string" use="required"/>
+									</xs:extension>
+								</xs:simpleContent>
+							</xs:complexType>
+						</xs:element>
+					</xs:sequence>
+				</xs:complexType>
+			</xs:element>
+			<xs:element name="checkpoint" minOccurs="0">
+				<xs:annotation>
+					<xs:documentation>Checkpoint files location</xs:documentation>
+				</xs:annotation>
+				<xs:complexType>
+					<xs:choice maxOccurs="unbounded">
+						<xs:element name="file" type="fileType">
+							<xs:annotation>
+								<xs:documentation>Checkpoint files description</xs:documentation>
+							</xs:annotation>
+						</xs:element>
+						<xs:element name="directory" type="fileType"/>
+					</xs:choice>
+				</xs:complexType>
+			</xs:element>
+		</xs:sequence>
+		<xs:attribute name="type" use="required">
+			<xs:simpleType>
+				<xs:restriction base="xs:string">
+					<xs:enumeration value="single"/>
+					<xs:enumeration value="multiple"/>
+					<xs:enumeration value="mpi"/>
+					<xs:enumeration value="mpichg"/>
+					<xs:enumeration value="open_mpi"/>
+					<xs:enumeration value="proactive"/>
+				</xs:restriction>
+			</xs:simpleType>
+		</xs:attribute>
+		<xs:attribute name="checkpointable" type="xs:boolean" use="optional" default="false"/>
+	</xs:complexType>
+	<xs:complexType name="countRangeType">
+		<xs:annotation>
+			<xs:documentation>Range of count parameter</xs:documentation>
+		</xs:annotation>
+		<xs:sequence>
+			<xs:element name="min" type="countBoundaryType"/>
+			<xs:element name="max" type="countBoundaryType"/>
+		</xs:sequence>
+	</xs:complexType>
+	<xs:complexType name="faultToleranceType">
+		<xs:annotation>
+			<xs:documentation>Fault tolerance description</xs:documentation>
+		</xs:annotation>
+		<xs:sequence>
+			<xs:element name="additionalCPUs" minOccurs="0">
+				<xs:complexType>
+					<xs:choice>
+						<xs:element name="count" type="countType"/>
+						<xs:element name="percentage" type="countType"/>
+					</xs:choice>
+				</xs:complexType>
+			</xs:element>
+		</xs:sequence>
+	</xs:complexType>
+	<xs:complexType name="hostCandidatesType">
+		<xs:annotation>
+			<xs:documentation>List of hosts used by GRMS in resource discovery process</xs:documentation>
+		</xs:annotation>
+		<xs:sequence>
+			<xs:element name="hostName" type="xs:string" maxOccurs="unbounded"/>
+		</xs:sequence>
+	</xs:complexType>
+	<xs:complexType name="resourceTemplatesType">
+		<xs:annotation>
+			<xs:documentation>Templates for describing resources and network connections</xs:documentation>
+		</xs:annotation>
+		<xs:choice maxOccurs="unbounded">
+			<xs:element name="computingResourceTemplate" minOccurs="0">
+				<xs:complexType>
+					<xs:choice maxOccurs="unbounded">
+						<xs:element name="hostParameter" type="computingResourceParameterType"/>
+						<xs:element name="networkParameter" type="computingResourceNetParameterType"/>
+						<xs:element name="otherParameter" type="otherParameterType"/>
+					</xs:choice>
+					<xs:attribute name="templateId" type="xs:string" use="required"/>
+				</xs:complexType>
+			</xs:element>
+			<xs:element name="networkResourceTemplate" minOccurs="0">
+				<xs:complexType>
+					<xs:choice maxOccurs="unbounded">
+						<xs:element name="networkParameter" type="networkParameterType"/>
+						<xs:element name="otherParameter" type="otherNetParameterType"/>
+					</xs:choice>
+					<xs:attribute name="templateId" type="xs:string" use="required"/>
+				</xs:complexType>
+			</xs:element>
+		</xs:choice>
+	</xs:complexType>
+	<xs:complexType name="preferencesType">
+		<xs:annotation>
+			<xs:documentation>User preferences concerning scheduling</xs:documentation>
+		</xs:annotation>
+		<xs:sequence>
+			<xs:element name="parameter" maxOccurs="unbounded">
+				<xs:complexType>
+					<xs:choice minOccurs="0">
+						<xs:choice>
+							<xs:element name="value" type="parameterValueType"/>
+							<xs:element name="min" type="parameterBoundaryType"/>
+							<xs:element name="max" type="parameterBoundaryType"/>
+							<xs:element name="range" type="rangeType"/>
+						</xs:choice>
+						<xs:element name="stringValue" type="xs:string"/>
+					</xs:choice>
+					<xs:attribute name="name" type="xs:string" use="required"/>
+					<xs:attribute name="optimizationType" use="required">
+						<xs:simpleType>
+							<xs:restriction base="xs:string">
+								<xs:enumeration value="GAIN"/>
+								<xs:enumeration value="COST"/>
+							</xs:restriction>
+						</xs:simpleType>
+					</xs:attribute>
+					<xs:attribute name="importance" type="xs:int" use="required"/>
+					<xs:attribute name="endpoint" type="xs:string" use="optional"/>
+				</xs:complexType>
+			</xs:element>
+		</xs:sequence>
+		<xs:attribute name="preferenceType" use="required">
+			<xs:simpleType>
+				<xs:restriction base="xs:string">
+					<xs:enumeration value="PRIORITY"/>
+					<xs:enumeration value="RANKING"/>
+				</xs:restriction>
+			</xs:simpleType>
+		</xs:attribute>
+	</xs:complexType>
+	<xs:complexType name="requirementsType">
+		<xs:annotation>
+			<xs:documentation>Resource description</xs:documentation>
+		</xs:annotation>
+		<xs:sequence>
+			<xs:element name="resourceTemplates" type="resourceTemplatesType" minOccurs="0">
+				<xs:annotation>
+					<xs:documentation>Templates of resources description</xs:documentation>
+				</xs:annotation>
+			</xs:element>
+			<xs:element name="resourceRequirements" type="resourceRequirementsType" minOccurs="0">
+				<xs:annotation>
+					<xs:documentation>Computing resource requirements </xs:documentation>
+				</xs:annotation>
+			</xs:element>
+			<xs:element name="topology" minOccurs="0" maxOccurs="unbounded">
+				<xs:annotation>
+					<xs:documentation>Processes topology definition</xs:documentation>
+				</xs:annotation>
+				<xs:complexType>
+					<xs:sequence>
+						<xs:element name="group" minOccurs="0" maxOccurs="unbounded">
+							<xs:annotation>
+								<xs:documentation>Groups of processes definition</xs:documentation>
+							</xs:annotation>
+							<xs:complexType>
+								<xs:sequence>
+									<xs:element name="processesConnection" minOccurs="0">
+										<xs:annotation>
+											<xs:documentation>Requirements for network parameters of connection among processes in group</xs:documentation>
+										</xs:annotation>
+										<xs:complexType>
+											<xs:sequence>
+												<xs:element name="networkResource" type="networkResourceType" maxOccurs="unbounded"/>
+											</xs:sequence>
+										</xs:complexType>
+									</xs:element>
+									<xs:element name="groupConnection" minOccurs="0" maxOccurs="unbounded">
+										<xs:annotation>
+											<xs:documentation>Requirements for network parameters of connection between current group and group with provided id</xs:documentation>
+										</xs:annotation>
+										<xs:complexType>
+											<xs:sequence>
+												<xs:element name="networkResource" type="networkResourceType" maxOccurs="unbounded"/>
+											</xs:sequence>
+											<xs:attribute name="endpointGroupId" type="xs:string" use="required"/>
+										</xs:complexType>
+									</xs:element>
+								</xs:sequence>
+								<xs:attribute name="groupId" type="xs:string" use="required"/>
+							</xs:complexType>
+						</xs:element>
+						<xs:element name="processes" maxOccurs="unbounded">
+							<xs:annotation>
+								<xs:documentation>Processes definition</xs:documentation>
+							</xs:annotation>
+							<xs:complexType>
+								<xs:sequence>
+									<xs:element name="groupIdReference" type="xs:string" minOccurs="0" maxOccurs="unbounded">
+										<xs:annotation>
+											<xs:documentation>Ids of group that the process belongs</xs:documentation>
+										</xs:annotation>
+									</xs:element>
+									<xs:element name="processesCount" type="countType" minOccurs="0">
+										<xs:annotation>
+											<xs:documentation>Number of process with specified resources requirements</xs:documentation>
+										</xs:annotation>
+									</xs:element>
+									<xs:element name="resourceRequirements" minOccurs="0">
+										<xs:annotation>
+											<xs:documentation>Resource requirements of defined processes</xs:documentation>
+										</xs:annotation>
+										<xs:complexType>
+											<xs:sequence>
+												<xs:element name="computingResource" type="computingResourceExtType" minOccurs="0" maxOccurs="unbounded">
+													<xs:annotation>
+														<xs:documentation>Definition of resource reqiurements for processes</xs:documentation>
+													</xs:annotation>
+												</xs:element>
+												<xs:element name="preferences" type="preferencesType" minOccurs="0"/>
+											</xs:sequence>
+										</xs:complexType>
+									</xs:element>
+								</xs:sequence>
+								<xs:attribute name="processesId" type="xs:string" use="optional"/>
+								<xs:attribute name="masterGroup" type="xs:boolean" use="optional"/>
+							</xs:complexType>
+						</xs:element>
+					</xs:sequence>
+				</xs:complexType>
+			</xs:element>
+		</xs:sequence>
+	</xs:complexType>
+	<xs:complexType name="countType">
+		<xs:annotation>
+			<xs:documentation>Description of count element</xs:documentation>
+		</xs:annotation>
+		<xs:choice>
+			<xs:element name="value">
+				<xs:complexType>
+					<xs:simpleContent>
+						<xs:extension base="xs:int">
+							<xs:attribute name="indiffThreshold" type="xs:int" use="optional" default="0"/>
+						</xs:extension>
+					</xs:simpleContent>
+				</xs:complexType>
+			</xs:element>
+			<xs:element name="min" type="countBoundaryType"/>
+			<xs:element name="max" type="countBoundaryType"/>
+			<xs:element name="range" type="countRangeType"/>
+		</xs:choice>
+	</xs:complexType>
+	<xs:complexType name="daysType">
+		<xs:annotation>
+			<xs:documentation>Days of the week</xs:documentation>
+		</xs:annotation>
+		<xs:choice maxOccurs="unbounded">
+			<xs:element name="weekDay">
+				<xs:simpleType>
+					<xs:restriction base="xs:string">
+						<xs:enumeration value="Monday"/>
+						<xs:enumeration value="Tuesday"/>
+						<xs:enumeration value="Wednesday"/>
+						<xs:enumeration value="Thursday"/>
+						<xs:enumeration value="Friday"/>
+						<xs:enumeration value="Saturday"/>
+						<xs:enumeration value="Sunday"/>
+					</xs:restriction>
+				</xs:simpleType>
+			</xs:element>
+			<xs:element name="dateDay" type="xs:date"/>
+		</xs:choice>
+	</xs:complexType>
+	<xs:complexType name="parameterValueType">
+		<xs:annotation>
+			<xs:documentation>Value of the parameter</xs:documentation>
+		</xs:annotation>
+		<xs:simpleContent>
+			<xs:extension base="xs:double">
+				<xs:attribute name="indiffThreshold" type="xs:double" use="optional" default="0"/>
+			</xs:extension>
+		</xs:simpleContent>
+	</xs:complexType>
+	<xs:complexType name="networkResourceRefType">
+		<xs:annotation>
+			<xs:documentation>Reference to network Id</xs:documentation>
+		</xs:annotation>
+		<xs:attribute name="idRef" type="xs:IDREF" use="required"/>
+	</xs:complexType>
+	<xs:complexType name="parameterBoundaryType">
+		<xs:annotation>
+			<xs:documentation>Description of boundary for parameters</xs:documentation>
+		</xs:annotation>
+		<xs:simpleContent>
+			<xs:extension base="xs:double">
+				<xs:attribute name="exclusiveBound" type="xs:boolean" use="optional" default="false"/>
+			</xs:extension>
+		</xs:simpleContent>
+	</xs:complexType>
+	<xs:complexType name="countBoundaryType">
+		<xs:annotation>
+			<xs:documentation>Description of boundary for count</xs:documentation>
+		</xs:annotation>
+		<xs:simpleContent>
+			<xs:extension base="xs:int">
+				<xs:attribute name="exclusiveBound" type="xs:boolean" use="optional" default="false"/>
+			</xs:extension>
+		</xs:simpleContent>
+	</xs:complexType>
+	<xs:complexType name="descriptionVariablesType">
+		<xs:sequence>
+			<xs:element name="variable" type="xs:string"/>
+		</xs:sequence>
+	</xs:complexType>
+	<xs:complexType name="resourceRequirementsType">
+		<xs:sequence>
+			<xs:element name="computingResource" type="computingResourceType" minOccurs="0" maxOccurs="unbounded"/>
+			<xs:element name="preferences" type="preferencesType" minOccurs="0"/>
+		</xs:sequence>
+	</xs:complexType>
+	<xs:complexType name="parentOpType">
+		<xs:choice maxOccurs="unbounded">
+			<xs:element name="or" type="parentOpType"/>
+			<xs:element name="and" type="parentOpType"/>
+			<xs:element name="parent" type="parentType"/>
+		</xs:choice>
+	</xs:complexType>
+	<xs:complexType name="parentType">
+		<xs:simpleContent>
+			<xs:extension base="xs:string">
+				<xs:attribute name="triggerState" type="taskStatesName" use="optional" default="FINISHED"/>
+				<xs:attribute name="runSameHost" type="xs:boolean" use="optional" default="false"/>
+				<xs:attribute name="atEachIteration" type="xs:boolean" use="optional" default="false"/>
+			</xs:extension>
+		</xs:simpleContent>
+	</xs:complexType>
+	<xs:complexType name="parametersSweepParameter">
+		<xs:sequence>
+			<xs:element name="name" type="xs:string"/>
+			<xs:element name="value" type="parametersSweepParameterValue"/>
+			<xs:element name="parameter" type="parametersSweepParameter" minOccurs="0" maxOccurs="unbounded"/>
+		</xs:sequence>
+	</xs:complexType>
+	<xs:complexType name="parametersSweepParameterValue">
+		<xs:choice>
+			<xs:element name="loop" type="parametersSweepParameterLoop"/>
+			<xs:element name="set" type="parametersSweepParameterSet"/>
+		</xs:choice>
+	</xs:complexType>
+	<xs:complexType name="parametersSweepParameterLoop">
+		<xs:sequence>
+			<xs:element name="start" type="xs:double"/>
+			<xs:element name="end" type="xs:double"/>
+			<xs:element name="step" type="xs:double"/>
+			<xs:element name="except" minOccurs="0">
+				<xs:complexType>
+					<xs:sequence>
+						<xs:element name="value" type="xs:double" maxOccurs="unbounded"/>
+					</xs:sequence>
+				</xs:complexType>
+			</xs:element>
+		</xs:sequence>
+	</xs:complexType>
+	<xs:complexType name="parametersSweepParameterSet">
+		<xs:sequence>
+			<xs:element name="item" type="xs:string" maxOccurs="unbounded"/>
+		</xs:sequence>
+	</xs:complexType>
+</xs:schema>
Index: DCWoRMS/trunk/simulator/schemas/grms3/GrmsSchedulingPlanSchema.xsd
===================================================================
--- DCWoRMS/trunk/simulator/schemas/grms3/GrmsSchedulingPlanSchema.xsd	(revision 477)
+++ DCWoRMS/trunk/simulator/schemas/grms3/GrmsSchedulingPlanSchema.xsd	(revision 477)
@@ -0,0 +1,184 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- edited with XMLSPY v5 rel. 4 U (http://www.xmlspy.com) by Tomasz Piontek (Instytut Chemii Bioorganicznej PAN) -->
+<!-- edited with XMLSpy v2005 U (http://www.xmlspy.com) by Ariel Oleksiak (PSNC) -->
+<!--
+<xs:attribute name="state" type="resourceState" use="optional"/>
+-->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
+	<xs:annotation>
+		<xs:documentation>Scheduling Plan v2</xs:documentation>
+	</xs:annotation>
+	<!-- ========================Enum Types ====================== -->
+	<xs:simpleType name="computingParameterName">
+		<xs:restriction base="xs:string">
+			<xs:enumeration value="osname"/>
+			<xs:enumeration value="ostype"/>
+			<xs:enumeration value="cpuarch"/>
+			<xs:enumeration value="osversion"/>
+			<xs:enumeration value="osrelease"/>
+			<xs:enumeration value="memory"/>
+			<xs:enumeration value="freememory"/>
+			<xs:enumeration value="cpucount"/>
+			<xs:enumeration value="freecpus"/>
+			<xs:enumeration value="cpuspeed"/>
+			<xs:enumeration value="applications"/>
+			<xs:enumeration value="diskspace"/>
+			<xs:enumeration value="freediskspace"/>
+			<xs:enumeration value="remoteSubmissionInterface"/>
+			<xs:enumeration value="localResourceManager"/>
+			<xs:enumeration value="hostname"/>
+		</xs:restriction>
+	</xs:simpleType>
+	<xs:simpleType name="networkParameterName">
+		<xs:restriction base="xs:string">
+			<xs:enumeration value="bandwidth"/>
+			<xs:enumeration value="latency"/>
+			<xs:enumeration value="capacity"/>
+		</xs:restriction>
+	</xs:simpleType>
+	<xs:simpleType name="allocationStatus">
+		<xs:restriction base="xs:string">
+			<xs:enumeration value="SCHEDULED"/>
+			<xs:enumeration value="REJECTED"/>
+			<xs:enumeration value="REQUEUED"/>
+		</xs:restriction>
+	</xs:simpleType>
+	<xs:simpleType name="interfaceType">
+		<xs:restriction base="xs:string">
+			<xs:enumeration value="GRMS"/>
+			<xs:enumeration value="SMOA"/>
+			<xs:enumeration value="GT4"/>
+		</xs:restriction>
+	</xs:simpleType>
+	<!-- ========================  Complex Types =================== -->
+	<xs:complexType name="computingResourceType">
+		<xs:annotation>
+			<xs:documentation> Computing resource type</xs:documentation>
+		</xs:annotation>
+		<xs:choice maxOccurs="unbounded">
+			<xs:element name="hostParameter" type="computingResourceParameterType"/>
+			<xs:element name="otherParameter" type="otherParameterType"/>
+		</xs:choice>
+	</xs:complexType>
+	<xs:complexType name="computingResourceParameterType">
+		<xs:annotation>
+			<xs:documentation>Computational resource related parameter</xs:documentation>
+		</xs:annotation>
+		<xs:complexContent>
+			<xs:extension base="parameterType">
+				<xs:attribute name="name" type="computingParameterName" use="required"/>
+			</xs:extension>
+		</xs:complexContent>
+	</xs:complexType>
+	<xs:complexType name="otherParameterType">
+		<xs:annotation>
+			<xs:documentation>Dynamically defined parameter of resource</xs:documentation>
+		</xs:annotation>
+		<xs:complexContent>
+			<xs:extension base="parameterType">
+				<xs:attribute name="name" type="xs:string" use="required"/>
+				<xs:attribute name="endpoint" type="xs:string" use="optional"/>
+			</xs:extension>
+		</xs:complexContent>
+	</xs:complexType>
+	<xs:complexType name="parameterType">
+		<xs:annotation>
+			<xs:documentation>Description of parameter of resource</xs:documentation>
+		</xs:annotation>
+		<xs:sequence>
+			<xs:element name="paramValue" type="xs:string" maxOccurs="unbounded"/>
+			<xs:element name="property" minOccurs="0" maxOccurs="unbounded">
+				<xs:complexType>
+					<xs:sequence>
+						<xs:element name="value" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+					</xs:sequence>
+					<xs:attribute name="name" type="xs:string" use="required"/>
+					<xs:attribute name="exclude" type="xs:boolean" use="optional" default="false"/>
+				</xs:complexType>
+			</xs:element>
+		</xs:sequence>
+	</xs:complexType>
+	<xs:complexType name="timeSlotType"/>
+	<!-- ========================  Scheduling Plan =================== -->
+	<xs:element name="schedulingPlan">
+		<xs:annotation>
+			<xs:documentation>Description of Scheduling Plan</xs:documentation>
+		</xs:annotation>
+		<xs:complexType>
+			<xs:sequence>
+				<xs:element name="task" maxOccurs="unbounded">
+					<xs:complexType>
+						<xs:sequence>
+							<xs:element name="scheduledTime">
+								<xs:complexType>
+									<xs:complexContent>
+										<xs:extension base="timeSlotType">
+											<xs:sequence>
+												<xs:element name="start" type="xs:dateTime"/>
+												<xs:element name="end" type="xs:dateTime" minOccurs="0"/>
+											</xs:sequence>
+										</xs:extension>
+									</xs:complexContent>
+								</xs:complexType>
+							</xs:element>
+							<xs:element name="allocation" maxOccurs="unbounded">
+								<xs:complexType>
+									<xs:sequence>
+										<xs:element name="host">
+											<xs:annotation>
+												<xs:documentation>Submission host</xs:documentation>
+											</xs:annotation>
+											<xs:complexType>
+												<xs:sequence>
+													<xs:element name="machineParameters" type="computingResourceType" minOccurs="0"/>
+												</xs:sequence>
+												<xs:attribute name="hostname" type="xs:string" use="required"/>
+												<xs:attribute name="queue" type="xs:string" use="optional"/>
+											</xs:complexType>
+										</xs:element>
+										<xs:element name="providerInfo" minOccurs="0">
+											<xs:complexType>
+												<xs:sequence>
+													<xs:element name="type" type="interfaceType"/>
+													<xs:element name="location" type="xs:string"/>
+													<xs:element name="proxyName" type="xs:string" minOccurs="0"/>
+												</xs:sequence>
+											</xs:complexType>
+										</xs:element>
+										<xs:element name="reservationId" type="xs:string" minOccurs="0">
+											<xs:annotation>
+												<xs:documentation>Reservation identifier in local system </xs:documentation>
+											</xs:annotation>
+										</xs:element>
+										<xs:element name="additionalProperties" minOccurs="0">
+											<xs:complexType>
+												<xs:sequence>
+													<xs:element name="property" maxOccurs="unbounded">
+														<xs:complexType>
+															<xs:simpleContent>
+																<xs:extension base="xs:string">
+																	<xs:attribute name="name" type="xs:string" use="required"/>
+																</xs:extension>
+															</xs:simpleContent>
+														</xs:complexType>
+													</xs:element>
+												</xs:sequence>
+											</xs:complexType>
+										</xs:element>
+									</xs:sequence>
+									<xs:attribute name="processGroupId" type="xs:string" use="optional"/>
+									<xs:attribute name="processQuantity" type="xs:int" use="required"/>
+								</xs:complexType>
+							</xs:element>
+						</xs:sequence>
+						<xs:attribute name="jobId" type="xs:string" use="required"/>
+						<xs:attribute name="taskId" type="xs:string" use="required"/>
+						<xs:attribute name="status" type="allocationStatus" use="required"/>
+						<xs:attribute name="topology" type="xs:int" use="optional" default="0"/>
+						<xs:attribute name="statusDescription" type="xs:string" use="optional"/>
+					</xs:complexType>
+				</xs:element>
+			</xs:sequence>
+		</xs:complexType>
+	</xs:element>
+</xs:schema>
Index: DCWoRMS/trunk/simulator/schemas/grms3/GrmsHostParametersSchema.xsd
===================================================================
--- DCWoRMS/trunk/simulator/schemas/grms3/GrmsHostParametersSchema.xsd	(revision 477)
+++ DCWoRMS/trunk/simulator/schemas/grms3/GrmsHostParametersSchema.xsd	(revision 477)
@@ -0,0 +1,369 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- edited with XMLSPY v5 rel. 4 U (http://www.xmlspy.com) by Tomasz Piontek (Instytut Chemii Bioorganicznej PAN) -->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
+	<xs:simpleType name="computingParameterName">
+		<xs:restriction base="xs:string">
+			<xs:enumeration value="osname"/>
+			<xs:enumeration value="ostype"/>
+			<xs:enumeration value="cpuarch"/>
+			<xs:enumeration value="osversion"/>
+			<xs:enumeration value="osrelease"/>
+			<xs:enumeration value="memory"/>
+			<xs:enumeration value="freememory"/>
+			<xs:enumeration value="cpucount"/>
+			<xs:enumeration value="freecpus"/>
+			<xs:enumeration value="cpuload"/>
+			<xs:enumeration value="cpuspeed"/>
+			<xs:enumeration value="application"/>
+			<xs:enumeration value="diskspace"/>
+			<xs:enumeration value="freediskspace"/>
+			<xs:enumeration value="remoteSubmissionInterface"/>
+			<xs:enumeration value="localResourceManager"/>
+			<xs:enumeration value="hostname"/>
+		</xs:restriction>
+	</xs:simpleType>
+	<xs:simpleType name="networkParameterName">
+		<xs:restriction base="xs:string">
+			<xs:enumeration value="bandwidth"/>
+			<xs:enumeration value="latency"/>
+			<xs:enumeration value="capacity"/>
+		</xs:restriction>
+	</xs:simpleType>
+	<xs:simpleType name="queueParameterName">
+		<xs:restriction base="xs:string">
+			<xs:enumeration value="queueName"/>
+			<xs:enumeration value="priority"/>
+			<xs:enumeration value="dynamicPriority"/>
+			<xs:enumeration value="nice"/>
+			<xs:enumeration value="status"/>
+			<xs:enumeration value="maxJobs"/>
+			<xs:enumeration value="maxJobsRunning"/>
+			<xs:enumeration value="maxJobsPending"/>
+			<xs:enumeration value="maxWallTime"/>
+			<xs:enumeration value="maxCpuTime"/>
+			<xs:enumeration value="jobsCount"/>
+			<xs:enumeration value="runningJobsCount"/>
+			<xs:enumeration value="waitingJobsCount"/>
+			<xs:enumeration value="jobWaitingTime"/>
+		</xs:restriction>
+	</xs:simpleType>
+	<xs:complexType name="computingResourceType">
+		<xs:annotation>
+			<xs:documentation> Computing resource type</xs:documentation>
+		</xs:annotation>
+		<xs:choice maxOccurs="unbounded">
+			<xs:element name="hostParameter" type="computingResourceParameterType"/>
+			<xs:element name="networkParameter" type="computingResourceNetParameterType"/>
+			<xs:element name="otherParameter" type="otherParameterType"/>
+		</xs:choice>
+	</xs:complexType>
+	<xs:complexType name="computingResourceNetParameterType">
+		<xs:annotation>
+			<xs:documentation>Network related prameter</xs:documentation>
+		</xs:annotation>
+		<xs:complexContent>
+			<xs:extension base="parameterType">
+				<xs:attribute name="name" type="networkParameterName" use="required"/>
+				<xs:attribute name="endpoint" type="xs:string" use="required"/>
+			</xs:extension>
+		</xs:complexContent>
+	</xs:complexType>
+	<xs:complexType name="computingResourceParameterType">
+		<xs:annotation>
+			<xs:documentation>Computational resource related parameter</xs:documentation>
+		</xs:annotation>
+		<xs:complexContent>
+			<xs:extension base="parameterType">
+				<xs:attribute name="name" type="computingParameterName" use="required"/>
+			</xs:extension>
+		</xs:complexContent>
+	</xs:complexType>
+	<xs:complexType name="networkResourceType">
+		<xs:annotation>
+			<xs:documentation>Description of network connection</xs:documentation>
+		</xs:annotation>
+		<xs:choice maxOccurs="unbounded">
+			<xs:element name="networkParameter" type="networkParameterType"/>
+			<xs:element name="otherParameter" type="otherNetParameterType"/>
+		</xs:choice>
+	</xs:complexType>
+	<xs:complexType name="queueParameterType">
+		<xs:annotation>
+			<xs:documentation>Computational resource related parameter</xs:documentation>
+		</xs:annotation>
+		<xs:complexContent>
+			<xs:extension base="parameterType">
+				<xs:attribute name="name" type="queueParameterName" use="required"/>
+			</xs:extension>
+		</xs:complexContent>
+	</xs:complexType>
+	<xs:complexType name="parameterType">
+		<xs:annotation>
+			<xs:documentation>Description of parameter of resource</xs:documentation>
+		</xs:annotation>
+		<xs:sequence>
+			<xs:element name="paramValue" type="xs:string" maxOccurs="unbounded"/>
+			<xs:element name="property" minOccurs="0" maxOccurs="unbounded">
+				<xs:complexType>
+					<xs:sequence>
+						<xs:element name="value" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+					</xs:sequence>
+					<xs:attribute name="name" type="xs:string" use="required"/>
+					<xs:attribute name="exclude" type="xs:boolean" use="optional" default="false"/>
+				</xs:complexType>
+			</xs:element>
+			<xs:element name="availability" type="availabilityType" minOccurs="0"/>
+			<xs:element name="statValues" type="statValuesType" minOccurs="0" maxOccurs="unbounded"/>
+		</xs:sequence>
+	</xs:complexType>
+	<xs:complexType name="otherParameterType">
+		<xs:annotation>
+			<xs:documentation>Dynamically defined parameter of resource</xs:documentation>
+		</xs:annotation>
+		<xs:complexContent>
+			<xs:extension base="parameterType">
+				<xs:attribute name="name" type="xs:string" use="required"/>
+				<xs:attribute name="endpoint" type="xs:string" use="optional"/>
+			</xs:extension>
+		</xs:complexContent>
+	</xs:complexType>
+	<xs:complexType name="otherNetParameterType">
+		<xs:annotation>
+			<xs:documentation>Additional - dynamically defined - parameters of network connection</xs:documentation>
+		</xs:annotation>
+		<xs:complexContent>
+			<xs:extension base="parameterType">
+				<xs:attribute name="name" type="xs:string" use="required"/>
+			</xs:extension>
+		</xs:complexContent>
+	</xs:complexType>
+	<xs:complexType name="networkParameterType">
+		<xs:annotation>
+			<xs:documentation>Parameters of network connection</xs:documentation>
+		</xs:annotation>
+		<xs:complexContent>
+			<xs:extension base="parameterType">
+				<xs:attribute name="name" type="networkParameterName" use="required"/>
+			</xs:extension>
+		</xs:complexContent>
+	</xs:complexType>
+	<xs:complexType name="parameterValueType">
+		<xs:annotation>
+			<xs:documentation>Value of the parameter</xs:documentation>
+		</xs:annotation>
+		<xs:simpleContent>
+			<xs:extension base="xs:double"/>
+		</xs:simpleContent>
+	</xs:complexType>
+	<xs:complexType name="availabilityType">
+		<xs:sequence>
+			<xs:element name="timeSlot" minOccurs="0" maxOccurs="unbounded">
+				<xs:complexType>
+					<xs:sequence>
+						<xs:element name="slotStart" type="xs:dateTime"/>
+						<xs:choice>
+							<xs:element name="slotEnd" type="xs:dateTime"/>
+							<xs:element name="slotDuration" type="xs:duration"/>
+						</xs:choice>
+					</xs:sequence>
+					<xs:attribute name="state" type="xs:string" use="optional"/>
+				</xs:complexType>
+			</xs:element>
+		</xs:sequence>
+	</xs:complexType>
+	<xs:complexType name="statType">
+		<xs:sequence>
+			<xs:element name="statValues" type="statValuesType"/>
+		</xs:sequence>
+	</xs:complexType>
+	<xs:complexType name="timeSlotType">
+		<xs:choice>
+			<xs:sequence>
+				<xs:element name="timeSlot" minOccurs="0">
+					<xs:complexType>
+						<xs:sequence>
+							<xs:element name="startTime" type="xs:time"/>
+							<xs:choice>
+								<xs:element name="endTime" type="xs:time"/>
+								<xs:element name="duration" type="xs:duration"/>
+							</xs:choice>
+						</xs:sequence>
+					</xs:complexType>
+				</xs:element>
+				<xs:element name="timePeriod">
+					<xs:complexType>
+						<xs:sequence>
+							<xs:element name="startDateTime" type="xs:dateTime"/>
+							<xs:choice>
+								<xs:element name="endDateTime" type="xs:dateTime"/>
+								<xs:element name="duration" type="xs:duration"/>
+							</xs:choice>
+							<xs:element name="excluding" type="daysType" minOccurs="0"/>
+							<xs:element name="including" type="daysType" minOccurs="0"/>
+						</xs:sequence>
+					</xs:complexType>
+				</xs:element>
+			</xs:sequence>
+			<xs:element name="pastTime" type="xs:duration"/>
+		</xs:choice>
+	</xs:complexType>
+	<xs:complexType name="daysType">
+		<xs:choice maxOccurs="unbounded">
+			<xs:element name="weekDay">
+				<xs:simpleType>
+					<xs:restriction base="xs:string">
+						<xs:enumeration value="Monday"/>
+						<xs:enumeration value="Tuesday"/>
+						<xs:enumeration value="Wednesday"/>
+						<xs:enumeration value="Thursday"/>
+						<xs:enumeration value="Friday"/>
+						<xs:enumeration value="Saturday"/>
+						<xs:enumeration value="Sunday"/>
+					</xs:restriction>
+				</xs:simpleType>
+			</xs:element>
+			<xs:element name="dateDay" type="xs:date"/>
+		</xs:choice>
+	</xs:complexType>
+	<xs:complexType name="statValuesType">
+		<xs:all>
+			<xs:element name="max" type="xs:double" minOccurs="0"/>
+			<xs:element name="min" type="xs:double" minOccurs="0"/>
+			<xs:element name="avg" type="xs:double" minOccurs="0"/>
+			<xs:element name="sd" type="xs:double" minOccurs="0"/>
+			<xs:element name="time" type="timeSlotType"/>
+		</xs:all>
+	</xs:complexType>
+	<xs:complexType name="additionalPropertiesType">
+		<xs:sequence>
+			<xs:element name="property" maxOccurs="unbounded">
+				<xs:complexType>
+					<xs:simpleContent>
+						<xs:extension base="xs:string">
+							<xs:attribute name="name" type="xs:string" use="required"/>
+						</xs:extension>
+					</xs:simpleContent>
+				</xs:complexType>
+			</xs:element>
+		</xs:sequence>
+	</xs:complexType>
+	<xs:element name="hostParameters">
+		<xs:annotation>
+			<xs:documentation>Schema describing resources</xs:documentation>
+		</xs:annotation>
+		<xs:complexType>
+			<xs:sequence>
+				<xs:element name="validity" type="availabilityType" minOccurs="0"/>
+				<xs:element name="resources">
+					<xs:annotation>
+						<xs:documentation>Description of resurces</xs:documentation>
+					</xs:annotation>
+					<xs:complexType>
+						<xs:choice maxOccurs="unbounded">
+							<xs:element name="computingResource">
+								<xs:annotation>
+									<xs:documentation>Computing resources</xs:documentation>
+								</xs:annotation>
+								<xs:complexType>
+									<xs:sequence>
+										<xs:element name="machineParameters" type="computingResourceType" minOccurs="0">
+											<xs:annotation>
+												<xs:documentation>Parametrs of the computational node (physical)</xs:documentation>
+											</xs:annotation>
+										</xs:element>
+										<xs:element name="frontendInfo" minOccurs="0">
+											<xs:annotation>
+												<xs:documentation>Information concerning frontend role of the machine</xs:documentation>
+											</xs:annotation>
+											<xs:complexType>
+												<xs:sequence>
+													<xs:element name="interface" maxOccurs="unbounded">
+														<xs:complexType>
+															<xs:sequence>
+																<xs:element name="interfaceInfo" maxOccurs="unbounded">
+																	<xs:complexType>
+																		<xs:sequence>
+																			<xs:element name="interfaceType" type="xs:string"/>
+																			<xs:element name="interfaceAddress" type="xs:string"/>
+																			<xs:element name="proxyName" type="xs:string" minOccurs="0"/>
+																		</xs:sequence>
+																	</xs:complexType>
+																</xs:element>
+																<xs:element name="queueResourceIdRef" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+															</xs:sequence>
+														</xs:complexType>
+													</xs:element>
+												</xs:sequence>
+											</xs:complexType>
+										</xs:element>
+										<xs:element name="nodeInfo" minOccurs="0">
+											<xs:annotation>
+												<xs:documentation>Informatina concerning node role of the machine</xs:documentation>
+											</xs:annotation>
+											<xs:complexType>
+												<xs:sequence>
+													<xs:element name="frontendResourceIdRef" type="xs:string" maxOccurs="unbounded">
+														<xs:annotation>
+															<xs:documentation>Id of the frontend for this node</xs:documentation>
+														</xs:annotation>
+													</xs:element>
+													<xs:element name="queueResourceIdRef" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+												</xs:sequence>
+											</xs:complexType>
+										</xs:element>
+										<xs:element name="availability" type="availabilityType" minOccurs="0"/>
+										<xs:element name="additionalProperties" type="additionalPropertiesType" minOccurs="0"/>
+									</xs:sequence>
+									<xs:attribute name="resourceId" type="xs:string" use="optional"/>
+								</xs:complexType>
+							</xs:element>
+							<xs:element name="queueResource">
+								<xs:complexType>
+									<xs:sequence>
+										<xs:element name="queueParameter" type="queueParameterType" maxOccurs="unbounded"/>
+									</xs:sequence>
+									<xs:attribute name="resourceId" type="xs:string" use="required"/>
+								</xs:complexType>
+							</xs:element>
+						</xs:choice>
+					</xs:complexType>
+				</xs:element>
+				<xs:element name="topology" minOccurs="0">
+					<xs:complexType>
+						<xs:sequence>
+							<xs:element name="resourcesGroup" maxOccurs="unbounded">
+								<xs:complexType>
+									<xs:sequence>
+										<xs:element name="resources">
+											<xs:complexType>
+												<xs:sequence>
+													<xs:element name="computingResourceIdRef" type="xs:string" maxOccurs="unbounded"/>
+												</xs:sequence>
+											</xs:complexType>
+										</xs:element>
+										<xs:element name="networkParamsInsideGroup" type="networkResourceType"/>
+										<xs:element name="networkParamsToGroup" minOccurs="0" maxOccurs="unbounded">
+											<xs:complexType>
+												<xs:complexContent>
+													<xs:extension base="networkResourceType">
+														<xs:sequence>
+															<xs:element name="additionalProperties" type="additionalPropertiesType" minOccurs="0"/>
+														</xs:sequence>
+														<xs:attribute name="groupId" type="xs:string" use="required"/>
+														<xs:attribute name="isSymmetric" type="xs:boolean" use="optional" default="false"/>
+													</xs:extension>
+												</xs:complexContent>
+											</xs:complexType>
+										</xs:element>
+										<xs:element name="additionalProperties" type="additionalPropertiesType" minOccurs="0"/>
+									</xs:sequence>
+									<xs:attribute name="groupId" type="xs:string" use="required"/>
+								</xs:complexType>
+							</xs:element>
+						</xs:sequence>
+					</xs:complexType>
+				</xs:element>
+			</xs:sequence>
+		</xs:complexType>
+	</xs:element>
+</xs:schema>
Index: DCWoRMS/trunk/simulator/schemas/grms3/GrmsResourceRequirementsSchema_binding.xml
===================================================================
--- DCWoRMS/trunk/simulator/schemas/grms3/GrmsResourceRequirementsSchema_binding.xml	(revision 477)
+++ DCWoRMS/trunk/simulator/schemas/grms3/GrmsResourceRequirementsSchema_binding.xml	(revision 477)
@@ -0,0 +1,20 @@
+<binding defaultBindingType="type">
+	<package>
+		<name>grms.types.schemas.resreqs</name>
+		<namespace/>
+	</package>
+	<elementBinding name="/resourceRequirements/task/requirements/resourceRequirements">
+		<java-class name="TaskResourceRequirements">
+        </java-class>
+	</elementBinding>
+	<elementBinding name="/resourceRequirements/task/requirements/topology/processes/resourceRequirements">
+		<java-class name="ProcessesResourceRequirements">
+        </java-class>
+	</elementBinding>
+
+	<elementBinding name="/complexType:parameterType/value">
+		<java-class name="ParameterValue">
+        </java-class>
+	</elementBinding>
+		
+</binding>
Index: DCWoRMS/trunk/simulator/schemas/grms3/GrmsJobDescriptionSchema-OLD.xsd
===================================================================
--- DCWoRMS/trunk/simulator/schemas/grms3/GrmsJobDescriptionSchema-OLD.xsd	(revision 477)
+++ DCWoRMS/trunk/simulator/schemas/grms3/GrmsJobDescriptionSchema-OLD.xsd	(revision 477)
@@ -0,0 +1,621 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- edited with XMLSPY v5 rel. 4 U (http://www.xmlspy.com) by Tomasz Piontek (Instytut Chemii Bioorganicznej PAN) -->
+<!-- version 43-->
+<!-- recznie dodana enumeracja do typu zadania -> poprawka z xmlspya-->
+<!-- modyfikacja: usuniecie restriction na minLen-->
+<!-- usuniecie command-->
+<!-- zmiana w resources na integer-->
+<!-- zmiana: localrmname jest enumeracja (fork, lsf..)-->
+<!-- zmiana typu argumentu typu value - typ  zlozony  -->
+<!-- wydziedziczenie fileType z baseFileType -->
+<!-- zmiana collection na collectionfile -->
+<!-- dodana informacja workflow-->
+<!-- dodana trigger state do workflow-->
+<!-- zmiana w definiowaniu logicznych nazw plikow -->
+<!-- dodanie mozliwosci podawania kilku execow na rozne arch -->
+<!-- dodanie parametrow sieciowych -->
+<!-- dodanie katalogow -->
+<!-- zamiana wymagan zasobowych na wielokryterialny model ograniczen-->
+<!-- dodanie do execa atrybutu checkpiontable-->
+<!-- dodanie czasu wykonania-->
+<!--deodanie referencji do plikow-->
+<!--poprawione constraints-->
+<!--porawiony bug executionTime-->
+<!--wyrzucony relative z logicaId; dodanie parentStates do workflowu; applicationBaseType-->
+<!--zmiana w opisie execfile-->
+<!--dn-> user w file-->
+<!--zmiana w opisie pliku - problem z castorem-->
+<!--usuniecie typu inout dla pliku-->
+<!--wyrzucenie defaulta do triggerState-->
+<!--zmiany w constraints-->
+<!--atrybut do constraint w hardConsliterowki i smieci-->
+<!--tileSize dla hostname-->
+<!--atr 'crucial' dla taska-->
+<!--dodanie jobNote i taskNote-->
+<!--nowe atrybuty dla typu FileType-->
+<!--dodana unikalnosc atrybutu 'name' dla plikow i katakogow-->
+<!--dodanie 'commit' do taska i do joba-->
+<!--usuniecie unique dla 'name' plikow-->
+<!--wyrzucenie limitow z wymagan zasobowych (wallTime..)-->
+<!--dodanie typu 'mpichg'-->
+<!--zmiany w opisie zasobow (hardConstraints)-->
+<!--dodane wartosci domyslne dla parametrow optional-->
+<!--zmiana kolejnosci w executable-->
+<!--multicredential support-->
+<!--ability to specify remote interface-->
+<!--loadleveler added to  local rms list-->
+<!--change of "##any" i "skip" in extensionType -->
+<!--changes in hardConstraints defninition-->
+<!--new :definition of local res man system-->
+<!--new: attribute of task: useSctatchDir-->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
+	<xs:element name="grmsJob">
+		<xs:annotation>
+			<xs:documentation>Job Description for Gridlab Resource Management System</xs:documentation>
+		</xs:annotation>
+		<xs:complexType>
+			<xs:sequence>
+				<xs:element name="jobNote" type="xs:string" minOccurs="0"/>
+				<xs:element name="proxyInfo" type="proxyInfoType" minOccurs="0"/>
+				<xs:element name="task" maxOccurs="unbounded">
+					<xs:annotation>
+						<xs:documentation>Description of Task</xs:documentation>
+						<xs:documentation>Description of Simple Job</xs:documentation>
+					</xs:annotation>
+					<xs:complexType>
+						<xs:complexContent>
+							<xs:extension base="taskType"/>
+						</xs:complexContent>
+					</xs:complexType>
+				</xs:element>
+			</xs:sequence>
+			<xs:attribute name="appid" type="xs:string" use="required"/>
+			<xs:attribute name="project" type="xs:string" use="optional"/>
+			<xs:attribute name="commitWait" type="xs:boolean" use="optional" default="false"/>
+		</xs:complexType>
+		<xs:unique name="task">
+			<xs:selector xpath=".//task"/>
+			<xs:field xpath="@taskid"/>
+		</xs:unique>
+	</xs:element>
+	<xs:complexType name="taskType">
+		<xs:annotation>
+			<xs:documentation>Description of Simple Job</xs:documentation>
+		</xs:annotation>
+		<xs:sequence>
+			<xs:element name="taskNote" type="xs:string" minOccurs="0"/>
+			<xs:element name="proxyInfo" type="proxyInfoType" minOccurs="0"/>
+			<xs:element name="candidateHosts" minOccurs="0">
+				<xs:complexType>
+					<xs:sequence>
+						<xs:element name="hostName" type="xs:string" maxOccurs="unbounded"/>
+					</xs:sequence>
+				</xs:complexType>
+			</xs:element>
+			<xs:element name="resource" minOccurs="0" maxOccurs="unbounded">
+				<xs:annotation>
+					<xs:documentation>Resource requirement section</xs:documentation>
+				</xs:annotation>
+				<xs:complexType>
+					<xs:all>
+						<xs:element name="osname" type="xs:string" minOccurs="0">
+							<xs:annotation>
+								<xs:documentation>Operating sysem name</xs:documentation>
+							</xs:annotation>
+						</xs:element>
+						<xs:element name="ostype" type="xs:string" minOccurs="0">
+							<xs:annotation>
+								<xs:documentation>Operating system type</xs:documentation>
+							</xs:annotation>
+						</xs:element>
+						<xs:element name="osversion" type="xs:string" minOccurs="0">
+							<xs:annotation>
+								<xs:documentation>Operating system version</xs:documentation>
+							</xs:annotation>
+						</xs:element>
+						<xs:element name="osrelease" type="xs:string" minOccurs="0">
+							<xs:annotation>
+								<xs:documentation>Operating system release</xs:documentation>
+							</xs:annotation>
+						</xs:element>
+						<xs:element name="hostname" minOccurs="0">
+							<xs:annotation>
+								<xs:documentation>Host name</xs:documentation>
+							</xs:annotation>
+							<xs:complexType>
+								<xs:simpleContent>
+									<xs:extension base="xs:string">
+										<xs:attribute name="tileSize" type="xs:int" use="optional"/>
+									</xs:extension>
+								</xs:simpleContent>
+							</xs:complexType>
+						</xs:element>
+						<xs:element name="memory" type="xs:integer" minOccurs="0">
+							<xs:annotation>
+								<xs:documentation>Amount of memory required</xs:documentation>
+							</xs:annotation>
+						</xs:element>
+						<xs:element name="cpucount" type="xs:integer" minOccurs="0">
+							<xs:annotation>
+								<xs:documentation>Number of cpus required</xs:documentation>
+							</xs:annotation>
+						</xs:element>
+						<xs:element name="cpuspeed" type="xs:integer" minOccurs="0">
+							<xs:annotation>
+								<xs:documentation>Required cpu performace</xs:documentation>
+							</xs:annotation>
+						</xs:element>
+						<xs:element name="bandwidth" minOccurs="0">
+							<xs:complexType>
+								<xs:simpleContent>
+									<xs:extension base="xs:integer">
+										<xs:attribute name="hostname" type="xs:string" use="optional"/>
+									</xs:extension>
+								</xs:simpleContent>
+							</xs:complexType>
+						</xs:element>
+						<xs:element name="latency" minOccurs="0">
+							<xs:complexType>
+								<xs:simpleContent>
+									<xs:extension base="xs:integer">
+										<xs:attribute name="hostname" type="xs:string" use="optional"/>
+									</xs:extension>
+								</xs:simpleContent>
+							</xs:complexType>
+						</xs:element>
+						<xs:element name="capacity" minOccurs="0">
+							<xs:complexType>
+								<xs:simpleContent>
+									<xs:extension base="xs:integer">
+										<xs:attribute name="hostname" type="xs:string" use="optional"/>
+									</xs:extension>
+								</xs:simpleContent>
+							</xs:complexType>
+						</xs:element>
+						<xs:element name="applications" minOccurs="0">
+							<xs:complexType>
+								<xs:sequence>
+									<xs:element name="application" type="applicationType" maxOccurs="unbounded"/>
+								</xs:sequence>
+							</xs:complexType>
+						</xs:element>
+						<xs:element name="freememory" type="xs:integer" minOccurs="0"/>
+						<xs:element name="diskspace" type="xs:integer" minOccurs="0"/>
+						<xs:element name="freediskspace" type="xs:integer" minOccurs="0"/>
+						<xs:element name="freecpus" type="xs:integer" minOccurs="0"/>
+						<xs:element name="remoteSubmissionInterface" minOccurs="0">
+							<xs:simpleType>
+								<xs:restriction base="xs:string">
+									<xs:enumeration value="GT2"/>
+									<xs:enumeration value="GT4"/>
+									<xs:enumeration value="OpenDSP"/>
+									<xs:enumeration value="SGE"/>
+									<xs:enumeration value="UNICORE"/>
+								</xs:restriction>
+							</xs:simpleType>
+						</xs:element>
+						<xs:element name="localResourceManager" minOccurs="0">
+							<xs:complexType>
+								<xs:sequence>
+									<xs:element name="queueName" type="xs:string" minOccurs="0"/>
+									<xs:element name="property" minOccurs="0" maxOccurs="unbounded">
+										<xs:complexType>
+											<xs:sequence>
+												<xs:element name="value" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+											</xs:sequence>
+											<xs:attribute name="name" type="xs:string" use="required"/>
+										</xs:complexType>
+									</xs:element>
+								</xs:sequence>
+								<xs:attribute name="name" use="optional">
+									<xs:simpleType>
+										<xs:restriction base="xs:string">
+											<xs:enumeration value="FORK"/>
+											<xs:enumeration value="LSF"/>
+											<xs:enumeration value="PBS"/>
+											<xs:enumeration value="CONDOR"/>
+											<xs:enumeration value="SGE"/>
+											<xs:enumeration value="LOADLEVELER"/>
+											<xs:enumeration value="CCS"/>
+											<xs:enumeration value="queue"/>
+										</xs:restriction>
+									</xs:simpleType>
+								</xs:attribute>
+							</xs:complexType>
+						</xs:element>
+					</xs:all>
+				</xs:complexType>
+			</xs:element>
+			<xs:element name="hardConstraints" minOccurs="0">
+				<xs:complexType>
+					<xs:sequence>
+						<xs:element name="parameter" maxOccurs="unbounded">
+							<xs:complexType>
+								<xs:choice>
+									<xs:choice maxOccurs="unbounded">
+										<xs:element name="value" type="xs:double"/>
+										<xs:element name="range" type="rangeType"/>
+									</xs:choice>
+									<xs:element name="stringValue" maxOccurs="unbounded">
+										<xs:complexType>
+											<xs:sequence>
+												<xs:element name="property" minOccurs="0" maxOccurs="unbounded">
+													<xs:complexType>
+														<xs:simpleContent>
+															<xs:extension base="xs:string">
+																<xs:attribute name="name" type="xs:string" use="required"/>
+															</xs:extension>
+														</xs:simpleContent>
+													</xs:complexType>
+												</xs:element>
+											</xs:sequence>
+											<xs:attribute name="value" type="xs:string" use="optional"/>
+										</xs:complexType>
+									</xs:element>
+								</xs:choice>
+								<xs:attribute name="name" type="xs:string" use="required"/>
+								<xs:attribute name="indiffThreshold" type="xs:double" use="optional"/>
+								<xs:attribute name="endpoint" type="xs:string" use="optional"/>
+							</xs:complexType>
+						</xs:element>
+					</xs:sequence>
+				</xs:complexType>
+			</xs:element>
+			<xs:element name="softConstraints" minOccurs="0">
+				<xs:complexType>
+					<xs:sequence>
+						<xs:element name="parameter" maxOccurs="unbounded">
+							<xs:complexType>
+								<xs:choice>
+									<xs:choice>
+										<xs:element name="value" type="xs:double"/>
+										<xs:element name="range" type="rangeType"/>
+									</xs:choice>
+									<xs:element name="stringValue" type="xs:string"/>
+								</xs:choice>
+								<xs:attribute name="name" type="xs:string" use="required"/>
+								<xs:attribute name="optimizationType" use="required">
+									<xs:simpleType>
+										<xs:restriction base="xs:string">
+											<xs:enumeration value="GAIN"/>
+											<xs:enumeration value="COST"/>
+										</xs:restriction>
+									</xs:simpleType>
+								</xs:attribute>
+								<xs:attribute name="importance" type="xs:integer" use="required"/>
+								<xs:attribute name="indiffThreshold" type="xs:double" use="optional"/>
+								<xs:attribute name="endpoint" type="xs:string" use="optional"/>
+							</xs:complexType>
+						</xs:element>
+					</xs:sequence>
+					<xs:attribute name="preferenceType" use="required">
+						<xs:simpleType>
+							<xs:restriction base="xs:string">
+								<xs:enumeration value="PRIORITY"/>
+								<xs:enumeration value="RANKING"/>
+							</xs:restriction>
+						</xs:simpleType>
+					</xs:attribute>
+				</xs:complexType>
+			</xs:element>
+			<xs:element name="executable" type="executableType">
+				<xs:annotation>
+					<xs:documentation>Application description section</xs:documentation>
+				</xs:annotation>
+			</xs:element>
+			<xs:element name="resumeExecutable" type="executableType" minOccurs="0"/>
+			<xs:element name="executionTime" type="executionTimeType" minOccurs="0"/>
+			<xs:element name="workflow" minOccurs="0">
+				<xs:complexType>
+					<xs:sequence>
+						<xs:element name="parent" maxOccurs="unbounded">
+							<xs:complexType>
+								<xs:simpleContent>
+									<xs:extension base="xs:string">
+										<xs:attribute name="triggerState" use="optional" default="FINISHED">
+											<xs:simpleType>
+												<xs:restriction base="xs:string">
+													<xs:enumeration value="QUEUED"/>
+													<xs:enumeration value="PREPROCESSING"/>
+													<xs:enumeration value="PENDING"/>
+													<xs:enumeration value="RUNNING"/>
+													<xs:enumeration value="STOPPED"/>
+													<xs:enumeration value="POSTPROCESSING"/>
+													<xs:enumeration value="SUSPENDED"/>
+													<xs:enumeration value="FINISHED"/>
+													<xs:enumeration value="CANCELED"/>
+													<xs:enumeration value="FAILED"/>
+												</xs:restriction>
+											</xs:simpleType>
+										</xs:attribute>
+										<xs:attribute name="runSameHost" type="xs:boolean" use="optional" default="false"/>
+									</xs:extension>
+								</xs:simpleContent>
+							</xs:complexType>
+						</xs:element>
+					</xs:sequence>
+					<xs:attribute name="parentStates" use="optional" default="AND">
+						<xs:simpleType>
+							<xs:restriction base="xs:string">
+								<xs:enumeration value="AND"/>
+								<xs:enumeration value="OR"/>
+							</xs:restriction>
+						</xs:simpleType>
+					</xs:attribute>
+				</xs:complexType>
+			</xs:element>
+			<xs:element name="other" type="extensionType" minOccurs="0"/>
+		</xs:sequence>
+		<xs:attribute name="taskid" type="xs:string" use="required"/>
+		<xs:attribute name="persistent" type="xs:boolean" use="optional" default="false"/>
+		<xs:attribute name="extension" type="xs:string" use="optional"/>
+		<xs:attribute name="crucial" type="xs:boolean" use="optional" default="true"/>
+		<xs:attribute name="commitWait" type="xs:boolean" use="optional" default="false"/>
+		<xs:attribute name="useScratchDir" type="xs:boolean" use="optional"/>
+	</xs:complexType>
+	<xs:complexType name="fileType">
+		<xs:annotation>
+			<xs:documentation>Element that describes a file</xs:documentation>
+		</xs:annotation>
+		<xs:complexContent>
+			<xs:extension base="baseFileType">
+				<xs:attribute name="name" type="xs:string" use="required"/>
+				<xs:attribute name="type" use="required">
+					<xs:simpleType>
+						<xs:restriction base="xs:string">
+							<xs:enumeration value="in"/>
+							<xs:enumeration value="out"/>
+						</xs:restriction>
+					</xs:simpleType>
+				</xs:attribute>
+				<xs:attribute name="required" type="xs:boolean" use="optional" default="true"/>
+				<xs:attribute name="append" type="xs:boolean" use="optional" default="false"/>
+				<xs:attribute name="permissions" type="xs:string" use="optional"/>
+			</xs:extension>
+		</xs:complexContent>
+	</xs:complexType>
+	<xs:complexType name="valueType">
+		<xs:annotation>
+			<xs:documentation>Decribtion of value for arguments definition</xs:documentation>
+		</xs:annotation>
+		<xs:simpleContent>
+			<xs:extension base="xs:string"/>
+		</xs:simpleContent>
+	</xs:complexType>
+	<xs:complexType name="baseFileType">
+		<xs:annotation>
+			<xs:documentation>Base element for file describtion</xs:documentation>
+		</xs:annotation>
+		<xs:sequence>
+			<xs:choice minOccurs="0">
+				<xs:element name="logicalId">
+					<xs:complexType>
+						<xs:simpleContent>
+							<xs:extension base="xs:string">
+								<xs:attribute name="user" type="xs:string" use="optional"/>
+							</xs:extension>
+						</xs:simpleContent>
+					</xs:complexType>
+				</xs:element>
+				<xs:element name="url" type="xs:string"/>
+			</xs:choice>
+			<xs:element name="reference" type="xs:string" minOccurs="0"/>
+		</xs:sequence>
+		<xs:attribute name="proxyName" type="xs:string" use="optional"/>
+	</xs:complexType>
+	<xs:complexType name="executionTimeType">
+		<xs:sequence>
+			<xs:element name="timeSlot" minOccurs="0">
+				<xs:annotation>
+					<xs:documentation>Information when to start application</xs:documentation>
+				</xs:annotation>
+				<xs:complexType>
+					<xs:sequence>
+						<xs:element name="slotStart">
+							<xs:complexType>
+								<xs:simpleContent>
+									<xs:extension base="xs:time"/>
+								</xs:simpleContent>
+							</xs:complexType>
+						</xs:element>
+						<xs:choice>
+							<xs:element name="slotEnd" type="xs:time"/>
+							<xs:element name="slotDuration" type="xs:duration"/>
+						</xs:choice>
+					</xs:sequence>
+				</xs:complexType>
+			</xs:element>
+			<xs:element name="execDuration" type="xs:duration"/>
+			<xs:element name="timePeriod" minOccurs="0">
+				<xs:complexType>
+					<xs:sequence>
+						<xs:element name="periodStart" type="xs:dateTime" minOccurs="0"/>
+						<xs:choice>
+							<xs:element name="periodEnd" type="xs:dateTime"/>
+							<xs:element name="periodDuration" type="xs:duration"/>
+						</xs:choice>
+						<xs:element name="excluding" minOccurs="0">
+							<xs:complexType>
+								<xs:choice maxOccurs="unbounded">
+									<xs:element name="weekDay">
+										<xs:simpleType>
+											<xs:restriction base="xs:string">
+												<xs:enumeration value="Monday"/>
+												<xs:enumeration value="Tuesday"/>
+												<xs:enumeration value="Wednesday"/>
+												<xs:enumeration value="Thursday"/>
+												<xs:enumeration value="Friday"/>
+												<xs:enumeration value="Saturday"/>
+												<xs:enumeration value="Sunday"/>
+											</xs:restriction>
+										</xs:simpleType>
+									</xs:element>
+									<xs:element name="dateDay" type="xs:date"/>
+								</xs:choice>
+							</xs:complexType>
+						</xs:element>
+						<xs:element name="including" minOccurs="0">
+							<xs:complexType>
+								<xs:choice maxOccurs="unbounded">
+									<xs:element name="weekDay">
+										<xs:simpleType>
+											<xs:restriction base="xs:string">
+												<xs:enumeration value="Monday"/>
+												<xs:enumeration value="Tuesday"/>
+												<xs:enumeration value="Wednesday"/>
+												<xs:enumeration value="Thursday"/>
+												<xs:enumeration value="Friday"/>
+												<xs:enumeration value="Saturday"/>
+												<xs:enumeration value="Sunday"/>
+											</xs:restriction>
+										</xs:simpleType>
+									</xs:element>
+									<xs:element name="dateDay" type="xs:date"/>
+								</xs:choice>
+							</xs:complexType>
+						</xs:element>
+					</xs:sequence>
+				</xs:complexType>
+			</xs:element>
+		</xs:sequence>
+	</xs:complexType>
+	<xs:complexType name="applicationType">
+		<xs:simpleContent>
+			<xs:extension base="applicationBaseType">
+				<xs:attribute name="instanceCount" type="xs:integer" use="optional" default="1"/>
+			</xs:extension>
+		</xs:simpleContent>
+	</xs:complexType>
+	<xs:complexType name="applicationBaseType">
+		<xs:simpleContent>
+			<xs:extension base="xs:string">
+				<xs:attribute name="version" type="xs:string" use="optional"/>
+			</xs:extension>
+		</xs:simpleContent>
+	</xs:complexType>
+	<xs:complexType name="extensionType">
+		<xs:sequence>
+			<xs:any namespace="##any" processContents="skip" maxOccurs="unbounded"/>
+		</xs:sequence>
+	</xs:complexType>
+	<xs:complexType name="proxyInfoType">
+		<xs:sequence>
+			<xs:element name="proxyName" maxOccurs="unbounded">
+				<xs:complexType>
+					<xs:simpleContent>
+						<xs:extension base="xs:string">
+							<xs:attribute name="lifetime" type="xs:int" use="optional"/>
+						</xs:extension>
+					</xs:simpleContent>
+				</xs:complexType>
+			</xs:element>
+		</xs:sequence>
+	</xs:complexType>
+	<xs:complexType name="rangeType">
+		<xs:sequence>
+			<xs:element name="min" type="xs:double" minOccurs="0"/>
+			<xs:element name="max" type="xs:double" minOccurs="0"/>
+		</xs:sequence>
+	</xs:complexType>
+	<xs:complexType name="executableType">
+		<xs:sequence>
+			<xs:choice>
+				<xs:element name="application" type="applicationBaseType"/>
+				<xs:element name="execfile" maxOccurs="unbounded">
+					<xs:annotation>
+						<xs:documentation>Location of executable of application</xs:documentation>
+					</xs:annotation>
+					<xs:complexType>
+						<xs:complexContent>
+							<xs:extension base="baseFileType">
+								<xs:attribute name="name" type="xs:string" use="required"/>
+								<xs:attribute name="osname" type="xs:string" use="optional"/>
+								<xs:attribute name="ostype" type="xs:string" use="optional"/>
+								<xs:attribute name="osversion" type="xs:string" use="optional"/>
+								<xs:attribute name="osrelease" type="xs:string" use="optional"/>
+							</xs:extension>
+						</xs:complexContent>
+					</xs:complexType>
+				</xs:element>
+			</xs:choice>
+			<xs:element name="arguments" minOccurs="0">
+				<xs:annotation>
+					<xs:documentation>Arguments of execution</xs:documentation>
+				</xs:annotation>
+				<xs:complexType>
+					<xs:choice maxOccurs="unbounded">
+						<xs:element name="file" type="fileType"/>
+						<xs:element name="value" type="valueType"/>
+						<xs:element name="directory" type="fileType"/>
+					</xs:choice>
+				</xs:complexType>
+			</xs:element>
+			<xs:element name="stdin" type="baseFileType" minOccurs="0">
+				<xs:annotation>
+					<xs:documentation>Standard input stream location</xs:documentation>
+				</xs:annotation>
+			</xs:element>
+			<xs:element name="stdout" type="baseFileType" minOccurs="0">
+				<xs:annotation>
+					<xs:documentation>Standard output stream location</xs:documentation>
+				</xs:annotation>
+			</xs:element>
+			<xs:element name="stderr" type="baseFileType" minOccurs="0">
+				<xs:annotation>
+					<xs:documentation>Standard error stream location</xs:documentation>
+				</xs:annotation>
+			</xs:element>
+			<xs:element name="environment" minOccurs="0">
+				<xs:annotation>
+					<xs:documentation>Environment variables</xs:documentation>
+				</xs:annotation>
+				<xs:complexType>
+					<xs:sequence>
+						<xs:element name="variable" maxOccurs="unbounded">
+							<xs:complexType>
+								<xs:simpleContent>
+									<xs:extension base="xs:string">
+										<xs:attribute name="name" type="xs:string" use="required"/>
+									</xs:extension>
+								</xs:simpleContent>
+							</xs:complexType>
+						</xs:element>
+					</xs:sequence>
+				</xs:complexType>
+			</xs:element>
+			<xs:element name="checkpoint" minOccurs="0">
+				<xs:annotation>
+					<xs:documentation>Checkpint files location</xs:documentation>
+				</xs:annotation>
+				<xs:complexType>
+					<xs:choice maxOccurs="unbounded">
+						<xs:element name="file" type="fileType">
+							<xs:annotation>
+								<xs:documentation>Checkpoint files description</xs:documentation>
+							</xs:annotation>
+						</xs:element>
+						<xs:element name="directory" type="fileType"/>
+					</xs:choice>
+				</xs:complexType>
+			</xs:element>
+		</xs:sequence>
+		<xs:attribute name="type" use="required">
+			<xs:simpleType>
+				<xs:restriction base="xs:string">
+					<xs:enumeration value="single"/>
+					<xs:enumeration value="multiple"/>
+					<xs:enumeration value="mpi"/>
+					<xs:enumeration value="mpichg"/>
+				</xs:restriction>
+			</xs:simpleType>
+		</xs:attribute>
+		<xs:attribute name="count" use="optional" default="1">
+			<xs:simpleType>
+				<xs:restriction base="xs:int">
+					<xs:minInclusive value="1"/>
+				</xs:restriction>
+			</xs:simpleType>
+		</xs:attribute>
+		<xs:attribute name="checkpointable" type="xs:boolean" use="optional" default="false"/>
+	</xs:complexType>
+</xs:schema>
Index: DCWoRMS/trunk/simulator/schemas/grms3/GrmsJobDescriptionSchema_binding.xml
===================================================================
--- DCWoRMS/trunk/simulator/schemas/grms3/GrmsJobDescriptionSchema_binding.xml	(revision 477)
+++ DCWoRMS/trunk/simulator/schemas/grms3/GrmsJobDescriptionSchema_binding.xml	(revision 477)
@@ -0,0 +1,30 @@
+<binding defaultBindingType="type">
+
+    <package>
+        <name>grms.types.schemas.jobdesc</name>
+        <namespace></namespace>
+    </package>
+
+    <elementBinding name="/complexType:resourcesDescriptionType/topology/processes/resourceRequirements">
+	<java-class name="TopologyResourceRequirements">
+        </java-class>
+    </elementBinding>
+
+    <elementBinding name="/complexType:countType/value">
+	<java-class name="CountValue">
+        </java-class>
+    </elementBinding>
+    
+	<elementBinding name="/complexType:baseFileType/locationProperties/property">
+		<java-class name="LocationProperty">
+		</java-class>
+	</elementBinding>
+</binding>
+
+	 
+<!-- PO PRZEGENROWANIU TRZEBA ZMIENIC PLIKI:
+ComputingResourceBaseTypeDescriptor.java
+NetworkResourceTypeDescriptor.java
+
+ustawiajac: desc.setRequired(false);
+-->
Index: DCWoRMS/trunk/sim_report
===================================================================
--- DCWoRMS/trunk/sim_report	(revision 477)
+++ DCWoRMS/trunk/sim_report	(revision 477)
@@ -0,0 +1,89 @@
+############################################################
+#                                                          #
+#                    SIMULATION REPORT                     #
+#                                                          #
+############################################################
+
+Version: SimJava 2.0
+
+Simulation date:         October 1, 2012
+Simulation start time:   9:35:37 AM CEST
+Simulation end time:     9:35:38 AM CEST
+
+############################################################
+#            Overall simulation run information            #
+############################################################
+
+Total simulated time:    52200.0
+Total transient time:    0.0
+Total steady state time: 52200.0
+Transient condition:     None
+Termination condition:   None
+Output analysis method:  None
+
+############################################################
+#               Simulation run measurements                #
+############################################################
+
+----------------- ManagementSystem@cluster -----------------
+
+- Throughput
+
+Sample mean:          0.0
+Event count:          0
+
+- Resource's utilization
+
+Sample mean:          0.0
+Sample variance:      0.0
+Sample std deviation: 0.0
+Maximum:              0.0
+Minimum:              0.0
+
+- Mean queue task count_0
+
+Sample mean:          0.896551724137931
+Sample variance:      0.0927467300832342
+Sample std deviation: 0.30454347814923605
+Maximum:              1.0
+Minimum:              0.0
+
+- Paused tasks list length
+
+Sample mean:          0.0
+Sample variance:      0.0
+Sample std deviation: 0.0
+Maximum:              0.0
+Minimum:              0.0
+
+----------------------- BROKER@grid ------------------------
+
+- Throughput
+
+Sample mean:          0.0
+Event count:          0
+
+- Resource's utilization
+
+Sample mean:          0.0
+Sample variance:      0.0
+Sample std deviation: 0.0
+Maximum:              0.0
+Minimum:              0.0
+
+- Mean queue task count_0
+
+Sample mean:          0.896551724137931
+Sample variance:      0.0927467300832342
+Sample std deviation: 0.30454347814923605
+Maximum:              1.0
+Minimum:              0.0
+
+- Paused tasks list length
+
+Sample mean:          0.0
+Sample variance:      0.0
+Sample std deviation: 0.0
+Maximum:              0.0
+Minimum:              0.0
+
