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 481)
@@ -8,7 +8,7 @@
 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;
+9;14,400;7,200;3,600;10,800;7,200;-3,600;0;0;14,400;
+10;43,200;21,600;0;21,600;21,600;-21,600;0;0;43,200;
+11;50,400;25,200;0;25,200;25,200;-25,200;0;0;50,400;
+12;54,000;14,400;0;14,400;39,600;-39,600;0;0;54,000;
+13;57,600;10,800;0;10,800;46,800;-46,800;0;0;57,600;
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 481)
@@ -11,5 +11,5 @@
 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 waiting time;11,907.692;15,621.015;244,016,094.675;0;46,800;154,800;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 481)
@@ -8,7 +8,7 @@
 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];
+9;9;-1;ManagementSystem@cluster;1;1225674000;1225681200;1225681200;1225670400;1225666800;14400;7200;7200;3600;3600;10800;7200;-3600;0;0;0;0;[Processor_2];
+10;10;-1;ManagementSystem@cluster;1;1225688400;1225710000;1225710000;1225688400;1225666800;43200;21600;21600;21600;0;21600;21600;-21600;0;0;0;0;[Processor_0];
+11;11;-1;ManagementSystem@cluster;1;1225692000;1225717200;1225717200;1225692000;1225666800;50400;25200;25200;25200;0;25200;25200;-25200;0;0;0;0;[Processor_2];
+12;12;-1;ManagementSystem@cluster;1;1225706400;1225720800;1225720800;1225706400;1225666800;54000;39600;14400;39600;0;14400;39600;-39600;0;0;0;0;[Processor_1];
+13;13;-1;ManagementSystem@cluster;1;1225713600;1225724400;1225724400;1225713600;1225666800;57600;46800;10800;46800;0;10800;46800;-46800;0;0;0;0;[Processor_0];
Index: /DCWoRMS/trunk/example/tomekp/experiment1_result/Stats_Simulation 1_ResourceUtilization.txt
===================================================================
--- /DCWoRMS/trunk/example/tomekp/experiment1_result/Stats_Simulation 1_ResourceUtilization.txt	(revision 481)
+++ /DCWoRMS/trunk/example/tomekp/experiment1_result/Stats_Simulation 1_ResourceUtilization.txt	(revision 481)
@@ -0,0 +1,61 @@
+resourceName;timestamp;usage;
+ComputingNode_0;1225666800000;1;
+ComputingNode_0;1225674000000;8;
+ComputingNode_0;1225681200000;3;
+ComputingNode_0;1225684800000;2;
+ComputingNode_0;1225688400000;2;
+ComputingNode_0;1225692000000;3;
+ComputingNode_0;1225702800000;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.24479166666666666
+
+Processor_0;1225666800000;1;
+Processor_0;1225674000000;1;
+Processor_0;1225681200000;0;
+Processor_0;1225688400000;1;
+Processor_0;1225710000000;0;
+Processor_0;1225713600000;1;
+Processor_0;1225724400000;0;
+mean: 0.8125
+
+Processor_1;1225674000000;1;
+Processor_1;1225681200000;0;
+Processor_1;1225692000000;1;
+Processor_1;1225717200000;0;
+mean: 0.5625
+
+Processor_2;1225674000000;1;
+Processor_2;1225681200000;0;
+Processor_2;1225706400000;1;
+Processor_2;1225720800000;0;
+mean: 0.375
+
+Processor_3;1225674000000;1;
+Processor_3;1225681200000;0;
+mean: 0.125
+
+Processor_4;1225674000000;1;
+Processor_4;1225684800000;0;
+mean: 0.1875
+
+Processor_5;1225674000000;1;
+Processor_5;1225688400000;0;
+mean: 0.25
+
+Processor_6;1225674000000;1;
+Processor_6;1225702800000;0;
+mean: 0.5
+
+Processor_7;1225674000000;1;
+Processor_7;1225681200000;0;
+mean: 0.125
+
+
+
+
+
Index: /DCWoRMS/trunk/example/tomekp/experiment1_result/Stats_Simulation 1_Simulation.txt
===================================================================
--- /DCWoRMS/trunk/example/tomekp/experiment1_result/Stats_Simulation 1_Simulation.txt	(revision 481)
+++ /DCWoRMS/trunk/example/tomekp/experiment1_result/Stats_Simulation 1_Simulation.txt	(revision 481)
@@ -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,599;0;0;57,599;57,599;57,599;1;
+Resources queue length;0.812;0;0;0.812;0.812;0.812;1;
+Resources total load;0.245;0;0;0.245;0.245;0.245;1;
+Resources reservation load;?;?;?;?;?;?;0;
+Energy usage;750;0;0;750;750;750;1;
+Task completion time;24,092.692;15,363.608;236,040,454.828;7,200;57,599;313,205;13;
+Task execution time;9,415.769;3,610.859;13,038,305.716;7,200;18,001;122,405;13;
+Task start time;0;0;0;0;0;0;13;
+Task flow time;9,415.769;3,610.859;13,038,305.716;7,200;18,001;122,405;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/tomekp/experiment1_result/Stats_Simulation 1_Tasks.txt
===================================================================
--- /DCWoRMS/trunk/example/tomekp/experiment1_result/Stats_Simulation 1_Tasks.txt	(revision 481)
+++ /DCWoRMS/trunk/example/tomekp/experiment1_result/Stats_Simulation 1_Tasks.txt	(revision 481)
@@ -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@cluster1;1;1225666800;1225674000;1225674000;1225666800;1225666800;7200;0;7200;0;0;7200;0;0;0;0;0;0;[Processor_0];
+2;2;-1;ManagementSystem@cluster1;1;1225674000;1225681200;1225681200;1225674000;1225674000;14400;7200;7200;7200;0;7200;0;0;0;0;0;0;[Processor_0];
+3;3;-1;ManagementSystem@cluster1;1;1225674000;1225681200;1225681200;1225674000;1225674000;14400;7200;7200;7200;0;7200;0;0;0;0;0;0;[Processor_1];
+4;4;-1;ManagementSystem@cluster1;1;1225674000;1225681200;1225681200;1225674000;1225674000;14400;7200;7200;7200;0;7200;0;0;0;0;0;0;[Processor_2];
+5;5;-1;ManagementSystem@cluster1;1;1225674000;1225681200;1225681200;1225674000;1225674000;14400;7200;7200;7200;0;7200;0;0;0;0;0;0;[Processor_3];
+6;6;-1;ManagementSystem@cluster1;1;1225674000;1225681201;1225681201;1225674000;1225674000;14401;7200;7201;7200;0;7201;0;0;0;0;0;0;[Processor_4];
+7;7;-1;ManagementSystem@cluster1;1;1225674000;1225681201;1225681201;1225674000;1225674000;14401;7200;7201;7200;0;7201;0;0;0;0;0;0;[Processor_5];
+8;8;-1;ManagementSystem@cluster1;1;1225674000;1225688401;1225688401;1225674000;1225674000;21601;7200;14401;7200;0;14401;0;0;0;0;0;0;[Processor_6];
+9;9;-1;ManagementSystem@cluster1;1;1225674000;1225681200;1225681200;1225674000;1225674000;14400;7200;7200;7200;0;7200;0;0;0;0;0;0;[Processor_7];
+10;10;-1;ManagementSystem@cluster1;1;1225688400;1225706401;1225706401;1225688400;1225688400;39601;21600;18001;21600;0;18001;0;0;0;0;0;0;[Processor_0];
+11;11;-1;ManagementSystem@cluster1;1;1225692000;1225706401;1225706401;1225692000;1225692000;39601;25200;14401;25200;0;14401;0;0;0;0;0;0;[Processor_1];
+12;12;-1;ManagementSystem@cluster1;1;1225706400;1225713601;1225713601;1225706400;1225706400;46801;39600;7201;39600;0;7201;0;0;0;0;0;0;[Processor_2];
+13;13;-1;ManagementSystem@cluster1;1;1225713600;1225724399;1225724399;1225713600;1225713600;57599;46800;10799;46800;0;10799;0;0;0;0;0;0;[Processor_0];
Index: /DCWoRMS/trunk/example/tomekp/experiment1_result/Stats_Simulation 1_Energy.txt
===================================================================
--- /DCWoRMS/trunk/example/tomekp/experiment1_result/Stats_Simulation 1_Energy.txt	(revision 481)
+++ /DCWoRMS/trunk/example/tomekp/experiment1_result/Stats_Simulation 1_Energy.txt	(revision 481)
@@ -0,0 +1,17 @@
+resourceName;timestamp;usage;
+ComputingNode_0;1225666800000;750;
+ComputingNode_0;1225724400000;750;
+mean: 750.0 sum: 12000.0
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: /DCWoRMS/trunk/example/tomekp/experiment1_result/Stats_Simulation 1_Jobs.txt
===================================================================
--- /DCWoRMS/trunk/example/tomekp/experiment1_result/Stats_Simulation 1_Jobs.txt	(revision 481)
+++ /DCWoRMS/trunk/example/tomekp/experiment1_result/Stats_Simulation 1_Jobs.txt	(revision 481)
@@ -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;14,400;7,200;0;7,200;0;0;0;0;14,400;
+3;14,400;7,200;0;7,200;0;0;0;0;14,400;
+4;14,400;7,200;0;7,200;0;0;0;0;14,400;
+5;14,400;7,200;0;7,200;0;0;0;0;14,400;
+6;14,401;7,201;0;7,201;0;0;0;0;14,401;
+7;14,401;7,201;0;7,201;0;0;0;0;14,401;
+8;21,601;14,401;0;14,401;0;0;0;0;21,601;
+9;14,400;7,200;0;7,200;0;0;0;0;14,400;
+10;39,601;18,001;0;18,001;0;0;0;0;39,601;
+11;39,601;14,401;0;14,401;0;0;0;0;39,601;
+12;46,801;7,201;0;7,201;0;0;0;0;46,801;
+13;57,599;10,799;0;10,799;0;0;0;0;57,599;
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 481)
@@ -11,5 +11,5 @@
 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 waiting time;10,523.077;16,251.398;264,107,928.994;0;46,800;136,800;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 481)
@@ -8,7 +8,7 @@
 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];
+9;9;-1;ManagementSystem@cluster;1;1225670400;1225677600;1225677600;1225670400;1225666800;10800;3600;7200;3600;0;7200;3600;-3600;0;0;0;0;[Processor_10];
+10;10;-1;ManagementSystem@cluster;1;1225688400;1225699200;1225699200;1225688400;1225666800;32400;21600;10800;21600;0;10800;21600;-21600;0;0;0;0;[Processor_16];
+11;11;-1;ManagementSystem@cluster;1;1225692000;1225704600;1225704600;1225692000;1225666800;37800;25200;12600;25200;0;12600;25200;-25200;0;0;0;0;[Processor_18];
+12;12;-1;ManagementSystem@cluster;1;1225706400;1225713600;1225713600;1225706400;1225666800;46800;39600;7200;39600;0;7200;39600;-39600;0;0;0;0;[Processor_16];
+13;13;-1;ManagementSystem@cluster;1;1225713600;1225719000;1225719000;1225713600;1225666800;52200;46800;5400;46800;0;5400;46800;-46800;0;0;0;0;[Processor_16];
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 481)
@@ -8,7 +8,7 @@
 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;
+9;10,800;7,200;0;7,200;3,600;-3,600;0;0;10,800;
+10;32,400;10,800;0;10,800;21,600;-21,600;0;0;32,400;
+11;37,800;12,600;0;12,600;25,200;-25,200;0;0;37,800;
+12;46,800;7,200;0;7,200;39,600;-39,600;0;0;46,800;
+13;52,200;5,400;0;5,400;46,800;-46,800;0;0;52,200;
Index: /DCWoRMS/trunk/example/experiment3_result/Stats_Simulation 1_Simulation.txt
===================================================================
--- /DCWoRMS/trunk/example/experiment3_result/Stats_Simulation 1_Simulation.txt	(revision 481)
+++ /DCWoRMS/trunk/example/experiment3_result/Stats_Simulation 1_Simulation.txt	(revision 481)
@@ -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;0.812;0;0;0.812;0.812;0.812;1;
+Resources total load;0.184;0;0;0.184;0.184;0.184;1;
+Resources reservation load;?;?;?;?;?;?;0;
+Energy usage;1,009.234;250.917;62,959.13;750;1,364.75;4,036.938;4;
+Task completion time;23,538.462;19,546.14;382,051,597.633;7,200;57,600;306,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;0;0;0;0;0;0;13;
+Task flow time;13,015.385;7,274.174;52,913,609.467;7,200;28,800;169,200;13;
+Task waiting time;10,523.077;16,251.398;264,107,928.994;0;46,800;136,800;13;
+Task lateness;0;0;0;0;0;0;13;
+Task tardiness;0;0;0;0;0;0;13;
Index: /DCWoRMS/trunk/example/experiment3_result/Stats_Simulation 1_Tasks.txt
===================================================================
--- /DCWoRMS/trunk/example/experiment3_result/Stats_Simulation 1_Tasks.txt	(revision 481)
+++ /DCWoRMS/trunk/example/experiment3_result/Stats_Simulation 1_Tasks.txt	(revision 481)
@@ -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;1225666800;1225681200;1225681200;1225666800;1225666800;14400;0;14400;0;0;14400;0;0;0;0;0;0;[Processor_6];
+8;8;-1;ManagementSystem@cluster;1;1225666800;1225695600;1225695600;1225666800;1225666800;28800;0;28800;0;0;28800;0;0;0;0;0;0;[Processor_7];
+9;9;-1;ManagementSystem@cluster;1;1225670400;1225677600;1225677600;1225670400;1225666800;10800;3600;7200;3600;0;7200;3600;-3600;0;0;0;0;[Processor_8];
+10;10;-1;ManagementSystem@cluster;1;1225688400;1225710000;1225710000;1225688400;1225666800;43200;21600;21600;21600;0;21600;21600;-21600;0;0;0;0;[Processor_0];
+11;11;-1;ManagementSystem@cluster;1;1225692000;1225717200;1225717200;1225692000;1225666800;50400;25200;25200;25200;0;25200;25200;-25200;0;0;0;0;[Processor_1];
+12;12;-1;ManagementSystem@cluster;1;1225706400;1225720800;1225720800;1225706400;1225666800;54000;39600;14400;39600;0;14400;39600;-39600;0;0;0;0;[Processor_2];
+13;13;-1;ManagementSystem@cluster;1;1225713600;1225724400;1225724400;1225713600;1225666800;57600;46800;10800;46800;0;10800;46800;-46800;0;0;0;0;[Processor_0];
Index: /DCWoRMS/trunk/example/experiment3_result/Stats_Simulation 1_Jobs.txt
===================================================================
--- /DCWoRMS/trunk/example/experiment3_result/Stats_Simulation 1_Jobs.txt	(revision 481)
+++ /DCWoRMS/trunk/example/experiment3_result/Stats_Simulation 1_Jobs.txt	(revision 481)
@@ -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;14,400;14,400;0;14,400;0;0;0;0;14,400;
+8;28,800;28,800;0;28,800;0;0;0;0;28,800;
+9;10,800;7,200;0;7,200;3,600;-3,600;0;0;10,800;
+10;43,200;21,600;0;21,600;21,600;-21,600;0;0;43,200;
+11;50,400;25,200;0;25,200;25,200;-25,200;0;0;50,400;
+12;54,000;14,400;0;14,400;39,600;-39,600;0;0;54,000;
+13;57,600;10,800;0;10,800;46,800;-46,800;0;0;57,600;
Index: /DCWoRMS/trunk/sim_report
===================================================================
--- /DCWoRMS/trunk/sim_report	(revision 477)
+++ /DCWoRMS/trunk/sim_report	(revision 481)
@@ -7,7 +7,7 @@
 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
+Simulation date:         October 8, 2012
+Simulation start time:   10:36:10 AM CEST
+Simulation end time:     10:36:11 AM CEST
 
 ############################################################
@@ -15,7 +15,7 @@
 ############################################################
 
-Total simulated time:    52200.0
+Total simulated time:    57600.0
 Total transient time:    0.0
-Total steady state time: 52200.0
+Total steady state time: 57600.0
 Transient condition:     None
 Termination condition:   None
@@ -43,8 +43,16 @@
 - Mean queue task count_0
 
-Sample mean:          0.896551724137931
-Sample variance:      0.0927467300832342
-Sample std deviation: 0.30454347814923605
+Sample mean:          0.8125
+Sample variance:      0.15234375
+Sample std deviation: 0.3903123748998999
 Maximum:              1.0
+Minimum:              0.0
+
+- Mean queue task count_1
+
+Sample mean:          0.0
+Sample variance:      0.0
+Sample std deviation: 0.0
+Maximum:              0.0
 Minimum:              0.0
 
@@ -74,7 +82,7 @@
 - Mean queue task count_0
 
-Sample mean:          0.896551724137931
-Sample variance:      0.0927467300832342
-Sample std deviation: 0.30454347814923605
+Sample mean:          0.8125
+Sample variance:      0.15234375
+Sample std deviation: 0.3903123748998999
 Maximum:              1.0
 Minimum:              0.0
Index: /DCWoRMS/trunk/sim_trace
===================================================================
--- /DCWoRMS/trunk/sim_trace	(revision 477)
+++ /DCWoRMS/trunk/sim_trace	(revision 481)
@@ -10,6 +10,6 @@
 u: Input_BROKER@grid at 0.0: waiting for an event
 u: Output_BROKER@grid at 0.0: waiting for an event
+u: Output_Users 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
@@ -38,22 +38,22 @@
 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: 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: Input_ManagementSystem@cluster at 0.0: start processing
+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: Output_BROKER@grid 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: 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
@@ -67,9 +67,9 @@
 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: 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: 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
@@ -84,10 +84,10 @@
 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: 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: 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
@@ -102,23 +102,6 @@
 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: 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
@@ -135,30 +118,47 @@
 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: 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: 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 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: 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: 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: 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: 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 10800.0
+u: ManagementSystem@cluster at 0.0: scheduling event type 606 for ManagementSystem@cluster with delay 10800.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 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: 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 28800.0
+u: ManagementSystem@cluster at 0.0: scheduling event type 606 for ManagementSystem@cluster with delay 28800.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
@@ -170,6 +170,6 @@
 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: Output_BROKER@grid at 3600.0: waiting for an event
 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
@@ -179,21 +179,4 @@
 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
@@ -230,12 +213,4 @@
 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
@@ -244,14 +219,13 @@
 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: 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: 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: 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)
@@ -273,8 +247,18 @@
 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: selected event type 603 (event time was 10800.0)
+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: selected event type 20 (event time was 10800.0)
+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: Input_BROKER@grid at 10800.0: start processing
 u: Output_ManagementSystem@cluster at 10800.0: waiting for an event
+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: selected event type 20 (event time was 10800.0)
 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
@@ -282,4 +266,7 @@
 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: 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: Users at 10800.0: waiting for an event
 u: ManagementSystem@cluster at 14400.0: no event cancelled
@@ -310,6 +297,6 @@
 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: scheduling event type 603 for ManagementSystem@cluster with delay 21600.0
+u: ManagementSystem@cluster at 21600.0: scheduling event type 606 for ManagementSystem@cluster with delay 21600.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
@@ -327,33 +314,20 @@
 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: scheduling event type 603 for ManagementSystem@cluster with delay 25200.0
+u: ManagementSystem@cluster at 25200.0: scheduling event type 606 for ManagementSystem@cluster with delay 25200.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: ManagementSystem@cluster at 28800.0: no event cancelled
+u: ManagementSystem@cluster at 28800.0: scheduling event type 20 for Output_ManagementSystem@cluster with delay 0.0
+u: ManagementSystem@cluster at 28800.0: selected event type 606 (event time was 28800.0)
+u: ManagementSystem@cluster at 28800.0: waiting for an event
+u: Output_ManagementSystem@cluster at 28800.0: scheduling event type 20 for Input_BROKER@grid with delay 0.0
+u: Output_ManagementSystem@cluster at 28800.0: start processing
+u: Output_ManagementSystem@cluster at 28800.0: waiting for an event
+u: Input_BROKER@grid at 28800.0: start processing
+u: Input_BROKER@grid at 28800.0: scheduling event type 20 for BROKER@grid with delay 0.0
+u: Input_BROKER@grid at 28800.0: waiting for an event
+u: BROKER@grid at 28800.0: scheduling event type 20 for Users with delay 0.0
+u: BROKER@grid at 28800.0: waiting for an event
+u: Users at 28800.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
@@ -364,63 +338,89 @@
 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: Input_ManagementSystem@cluster 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: scheduling event type 603 for ManagementSystem@cluster with delay 14400.0
+u: ManagementSystem@cluster at 39600.0: scheduling event type 606 for ManagementSystem@cluster with delay 14400.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: ManagementSystem@cluster at 43200.0: no event cancelled
+u: ManagementSystem@cluster at 43200.0: scheduling event type 20 for Output_ManagementSystem@cluster with delay 0.0
+u: ManagementSystem@cluster at 43200.0: selected event type 606 (event time was 43200.0)
+u: ManagementSystem@cluster at 43200.0: waiting for an event
+u: Output_ManagementSystem@cluster at 43200.0: scheduling event type 20 for Input_BROKER@grid with delay 0.0
+u: Output_ManagementSystem@cluster at 43200.0: start processing
+u: Output_ManagementSystem@cluster 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@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: scheduling event type 603 for ManagementSystem@cluster with delay 10800.0
+u: ManagementSystem@cluster at 46800.0: scheduling event type 606 for ManagementSystem@cluster with delay 10800.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
+u: ManagementSystem@cluster at 50400.0: no event cancelled
+u: ManagementSystem@cluster at 50400.0: scheduling event type 20 for Output_ManagementSystem@cluster with delay 0.0
+u: ManagementSystem@cluster at 50400.0: selected event type 606 (event time was 50400.0)
+u: ManagementSystem@cluster at 50400.0: waiting for an event
+u: Output_ManagementSystem@cluster at 50400.0: scheduling event type 20 for Input_BROKER@grid with delay 0.0
+u: Output_ManagementSystem@cluster at 50400.0: start processing
+u: Output_ManagementSystem@cluster 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@cluster at 54000.0: no event cancelled
+u: ManagementSystem@cluster at 54000.0: scheduling event type 20 for Output_ManagementSystem@cluster with delay 0.0
+u: ManagementSystem@cluster at 54000.0: selected event type 606 (event time was 54000.0)
+u: ManagementSystem@cluster at 54000.0: waiting for an event
+u: Output_ManagementSystem@cluster at 54000.0: scheduling event type 20 for Input_BROKER@grid with delay 0.0
+u: Output_ManagementSystem@cluster at 54000.0: start processing
+u: Output_ManagementSystem@cluster 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@cluster at 57600.0: no event cancelled
+u: ManagementSystem@cluster at 57600.0: scheduling event type 20 for Output_ManagementSystem@cluster with delay 0.0
+u: ManagementSystem@cluster at 57600.0: selected event type 606 (event time was 57600.0)
+u: ManagementSystem@cluster at 57600.0: waiting for an event
+u: Output_ManagementSystem@cluster at 57600.0: scheduling event type 20 for Input_BROKER@grid with delay 0.0
+u: Output_ManagementSystem@cluster at 57600.0: start processing
+u: Output_ManagementSystem@cluster 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@cluster 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/src/gridsim/gssim/DCWormsTags.java
===================================================================
--- /DCWoRMS/trunk/src/gridsim/gssim/DCWormsTags.java	(revision 481)
+++ /DCWoRMS/trunk/src/gridsim/gssim/DCWormsTags.java	(revision 481)
@@ -0,0 +1,53 @@
+package gridsim.gssim;
+
+import gridsim.GridSimTags;
+
+/**
+ * @author Marcin Krystek
+ */
+public class DCWormsTags 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;
+
+	
+    public static final int CREATED = 0;
+
+    public static final int SUBMITTED = 1;
+    
+    public static final int READY = 2;
+
+    public static final int QUEUED = 3;
+
+    public static final int INEXEC = 4;
+
+    public static final int SUCCESS = 5;
+
+    public static final int FAILED = 6;
+
+    public static final int CANCELED = 7;
+
+    public static final int PAUSED = 8;
+
+    public static final int RESUMED = 9;
+
+    public static final int FAILED_RESOURCE_UNAVAILABLE = 10;
+
+}
Index: /DCWoRMS/trunk/src/gridsim/gssim/filter/ExecTaskFilter.java
===================================================================
--- /DCWoRMS/trunk/src/gridsim/gssim/filter/ExecTaskFilter.java	(revision 481)
+++ /DCWoRMS/trunk/src/gridsim/gssim/filter/ExecTaskFilter.java	(revision 481)
@@ -0,0 +1,45 @@
+package gridsim.gssim.filter;
+
+import eduni.simjava.Sim_event;
+import gridsim.filter.FilterResult;
+import gssim.schedframe.scheduling.Executable;
+
+/**
+ * @author wojtek
+ *
+ */
+public class ExecTaskFilter extends FilterResult {
+
+	public ExecTaskFilter(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 Executable) {
+
+					Executable exec = (Executable) obj;
+
+					if (exec.getUniqueId() == eventID_) {
+						result = true;
+					}
+				}
+			}
+		} catch (Exception e) {
+			result = false;
+		}
+
+		return result;
+	}
+
+}
Index: WoRMS/trunk/src/gridsim/gssim/filter/SubTaskFilter.java
===================================================================
--- /DCWoRMS/trunk/src/gridsim/gssim/filter/SubTaskFilter.java	(revision 477)
+++ 	(revision )
@@ -1,45 +1,0 @@
-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/simulator/DCWormsConstants.java
===================================================================
--- /DCWoRMS/trunk/src/simulator/DCWormsConstants.java	(revision 481)
+++ /DCWoRMS/trunk/src/simulator/DCWormsConstants.java	(revision 481)
@@ -0,0 +1,102 @@
+package simulator;
+
+import eduni.simjava.Sim_stat;
+
+public class DCWormsConstants {
+
+	public static final String START_TIME="start_time";
+	
+	public static final String END_TIME = "end_time";
+	
+	public static final String RESOURCES = "resources";
+
+	
+	/**
+	 * the links have the maximal baud rate - no delays
+	 */
+	public static final double DEFAULT_BAUD_RATE = Double.MAX_VALUE;
+	
+	/**
+	 * Default name suffix of the allocation policy for every resource
+	 */
+	public static final String DEFAULT_RESOURCE_MANAGER_NAME = "ResourceManager";
+	
+	/**
+	 * The cost of processing per time unit
+	 */
+	public static final float DEFAULT_RESOURCE_PROCESSING_COST = 1f;
+	
+	/**
+	 * The default number of tasks in a single job
+	 */
+	public static final int DEFAULT_TASK_COUNT_IN_SINGLE_JOB = 1;
+
+	/**
+	 * The name of the broker interface entity (the entity that invokes proper methods on the given plugin)
+	 */
+	public static final String BrokerInterfaceEntityName = "BrokerInterfaceEntity";
+	
+	/**
+	 * The name of the output file with generated graphs
+	 */
+	public static final String GraphsFileName = "GssGraphs.sjg";
+	
+	/**
+	 * The name of the file where the resources' statistical data are to be stored
+	 */
+	public static final String resourceStatisticsOutputFileName = "Stats_Resources.txt"; 
+	
+	/**
+	 * The name of the file where the tasks' statistical data are to be stored
+	 */
+	public static final String tasksStatisitcsOutputFileName = "Stats_Tasks.txt";  
+
+	
+	public static final String MANAGEMENT_SYSTEM = "ManagementSystem";
+
+	
+/*
+ *  
+ * STATISTICAL INFORMATION VARIABLES AND METHODS 
+ * 
+ */
+	
+	/**
+	 * The utilization measure name
+	 */
+	public static final String USAGE_MEASURE_NAME = "Resource's utilization";
+	
+	/**
+	 * The waiting tasks queue length measure name
+	 */
+	public static final String TASKS_QUEUE_LENGTH_MEASURE_NAME = "Mean queue task count";
+	
+	/**
+	 * The paused tasks list length measure name
+	 */
+	public static final String PAUSED_TASKS_LIST_LENGTH_MEASURE_NAME = "Paused tasks list length";
+	
+	/**
+	 * @param queuesCount the number of queues for which the measures are to be added
+	 * @return a Sim_stat object to be used in all resources
+	 */
+	public static Sim_stat getResourcesStatisticsObject(int queuesCount) {		
+		Sim_stat stat = new Sim_stat();
+		//stat.add_measure(Sim_stat.ARRIVAL_RATE);
+		//stat.add_measure(Sim_stat.QUEUE_LENGTH);
+		//stat.add_measure(Sim_stat.RESIDENCE_TIME);
+		//stat.add_measure(Sim_stat.SERVICE_TIME);
+		stat.add_measure(Sim_stat.THROUGHPUT);
+		//stat.add_measure(Sim_stat.UTILISATION);
+		//stat.add_measure(Sim_stat.WAITING_TIME);
+		
+		stat.add_measure(USAGE_MEASURE_NAME, Sim_stat.STATE_BASED, true); //continuous
+		for (int i = 0; i < queuesCount; ++i) {
+			stat.add_measure(TASKS_QUEUE_LENGTH_MEASURE_NAME+"_"+Integer.toString(i), Sim_stat.STATE_BASED, true); //continuous
+		}
+		stat.add_measure(PAUSED_TASKS_LIST_LENGTH_MEASURE_NAME, Sim_stat.STATE_BASED, true); //continuous
+		//stat.add_measure(TASKS_AR_QUEUE_LENGTH_MEASURE_NAME, Sim_stat.STATE_BASED, true); //continuous
+		return stat;
+	}
+
+}
Index: /DCWoRMS/trunk/src/simulator/DataCenterWorkloadSimulator.java
===================================================================
--- /DCWoRMS/trunk/src/simulator/DataCenterWorkloadSimulator.java	(revision 477)
+++ /DCWoRMS/trunk/src/simulator/DataCenterWorkloadSimulator.java	(revision 481)
@@ -26,5 +26,5 @@
 import simulator.reader.ResourceReader;
 import simulator.stats.AccumulatedStatistics;
-import simulator.stats.implementation.WormsStatistics;
+import simulator.stats.implementation.DCWormsStatistics;
 import simulator.utils.LogErrStream;
 import simulator.workload.WorkloadLoader;
@@ -40,5 +40,5 @@
  * {@link #main(String[])} method used to invoke the program. This class also
  * provides second possibility to start the simulator, namely one may use the
- * {@link #performSimulation(ConfigurationOptions, WormsStatistics)} method.
+ * {@link #performSimulation(ConfigurationOptions, DCWormsStatistics)} method.
  * In this case, the input parameter, describing the simulation options, must be
  * earlier prepared. The results of the simulation can be acquired using the
@@ -269,5 +269,5 @@
 		rc.setInitList(null);
 		
-		WormsUsers wl = new WormsUsers("Users",
+		DCWormsUsers wl = new DCWormsUsers("Users",
 				rc.getScheduler().get_name(), workload);
 		
@@ -275,5 +275,5 @@
 		long stopSimulation = System.currentTimeMillis();
 
-		WormsStatistics stats = new WormsStatistics(simulationIdentifier,
+		DCWormsStatistics stats = new DCWormsStatistics(simulationIdentifier,
 				options, wl, statsOutputPath, rc);
 		accumulatedStatistics.add(stats);
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 481)
@@ -10,5 +10,5 @@
 import java.util.List;
 
-import simulator.stats.implementation.WormsStatistics;
+import simulator.stats.implementation.DCWormsStatistics;
 import gridsim.Accumulator;
 
Index: /DCWoRMS/trunk/src/simulator/stats/implementation/TaskStats.java
===================================================================
--- /DCWoRMS/trunk/src/simulator/stats/implementation/TaskStats.java	(revision 480)
+++ /DCWoRMS/trunk/src/simulator/stats/implementation/TaskStats.java	(revision 481)
@@ -49,11 +49,6 @@
 
 	public String getResName() {
-		String resNames[] = this.task.getAllResourceName();
-		String resName = "";
-		for (int i = 0; i < resNames.length; i++) {
-			resName += resNames[i];
-			if (resNames.length > 1)
-				resName += " ";
-		}
+		String resName = this.task.getSchedulerName();
+
 		return resName;
 	}
Index: /DCWoRMS/trunk/src/simulator/stats/implementation/DCWormsStatistics.java
===================================================================
--- /DCWoRMS/trunk/src/simulator/stats/implementation/DCWormsStatistics.java	(revision 481)
+++ /DCWoRMS/trunk/src/simulator/stats/implementation/DCWormsStatistics.java	(revision 481)
@@ -0,0 +1,1437 @@
+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.DateTimeUtilsExt;
+
+import schedframe.ExecutablesList;
+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.JobRegistry;
+import schedframe.scheduling.manager.tasks.JobRegistryImpl;
+import schedframe.scheduling.tasks.Job;
+import schedframe.scheduling.tasks.JobInterface;
+import simulator.ConfigurationOptions;
+import simulator.DCWormsConstants;
+import simulator.DataCenterWorkloadSimulator;
+import simulator.GenericUser;
+import simulator.stats.GSSAccumulator;
+import simulator.stats.SimulationStatistics;
+import simulator.stats.implementation.out.AbstractStringSerializer;
+import simulator.stats.implementation.out.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 DCWormsStatistics implements SimulationStatistics {
+
+	private Log log = LogFactory.getLog(DCWormsStatistics.class);
+
+	protected static float ALPHA = 0.5f;
+	protected static int GANTT_WIDTH = 1200;
+
+	//protected static final int 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 DCWormsStatistics(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) / MILLI_SEC));
+		
+		log.info("gatherTaskStatistics");
+		s = System.currentTimeMillis();
+		gatherTaskStatistics();
+		e = System.currentTimeMillis();
+		log.info("time in sec: " + ((e - s) / MILLI_SEC));
+
+		log.info("saveSimulationStatistics");
+		s = System.currentTimeMillis();
+		saveSimulationStatistics();
+		e = System.currentTimeMillis();
+		log.info("time in sec: " + ((e - s) / MILLI_SEC));
+	}
+
+
+	public String getOutputFolderName() {
+		return outputFolderName;
+	}
+
+	private void init() {
+
+		task_processorsMap = new HashMap<String, List<String>>();
+		accStats = new GSSAccumulatorsStats();
+		statsData = new HashMap<String, GSSAccumulator>();
+	}
+
+	public void saveSimulationStatistics() {
+		PrintStream simulationStatsFile = null;
+		if (configuration.createsimulationstatistics) {
+			try {
+				File file = new File(outputFolderName + STATS_FILE_NAME_PREFIX + simulationIdentifier + "_"
+						+ SIMULATION_STATISTICS_OUTPUT_FILE_NAME);
+				simulationStatsFile = new PrintStream(new FileOutputStream(file));
+			} catch (IOException e) {
+				e.printStackTrace();
+			}
+		}
+		if (simulationStatsFile != null) {
+			Object txt = accStats.serialize(this.serializer);
+			simulationStatsFile.println(txt);
+		}
+
+		if (simulationStatsFile != null) {
+			simulationStatsFile.close();
+		}
+
+	}
+
+
+
+	/************* RESOURCE STATISTICS SECTION **************/
+	private void gatherResourceStatistics() {
+		
+		
+		//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;
+		}
+		JobRegistry jr = new JobRegistryImpl("stats");
+		basicResStats = gatherPEStats(jr.getExecutableTasks());
+		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 * MILLI_SEC));
+						
+						EnergyExtension een = (EnergyExtension )(resource.getExtensionList().getExtension(ExtensionType.ENERGY_EXTENSION));
+						if(resourceController.getComputingResources().contains(resource)) {
+							if( een != null /*&& een.getPp() != null*/ ){
+								accStats.meanEnergyUsage.add(energyUsage.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 * MILLI_SEC) * 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(DCWormsConstants.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( ExecutablesList executables) {
+
+		
+		Map<String, List<ResStat>> basicResStats = new TreeMap<String, List<ResStat>>(new MapPEIdComparator());
+		//Map<Integer, Map<String, Object>> history
+		
+		for (ExecTask execTask:executables) {
+			Executable exec = (Executable) execTask;
+
+			List<ResourceHistoryItem> resHistItemList = exec.getUsedResources();
+			Map<ResourceUnitName, ResourceUnit> res = resHistItemList.get(resHistItemList.size() - 1).getResourceUnits();
+			ResourceUnit resUnit = res.get(StandardResourceUnitName.PE);
+			//ProcessingElements pes = (ProcessingElements) resUnit ;
+			if(resUnit instanceof ProcessingElements ){
+				ProcessingElements pes = (ProcessingElements) resUnit;
+				for(ComputingResource pe: pes){
+					String peName = pe.getName();
+					long startDate = Double.valueOf(exec.getExecStartTime()).longValue() * MILLI_SEC;
+					long endDate = Double.valueOf(exec.getFinishTime()).longValue() * MILLI_SEC;
+
+
+					String uniqueTaskID = execTask.getJobId() + "_" + execTask.getId();
+					
+					ResStat resStat = new ResStat(peName, pe.getType(), startDate, endDate, uniqueTaskID);
+					
+					List<ResStat> resStats = basicResStats.get(peName);
+					if (resStats == null) {
+						resStats = new ArrayList<ResStat>();
+						resStats.add(resStat);
+						basicResStats.put(peName, resStats);
+					} else {
+						resStats.add(resStat);
+					}
+
+					List<String> peNames = task_processorsMap.get(uniqueTaskID);
+					if (peNames == null) {
+						peNames = new ArrayList<String>();
+						peNames.add(peName);
+						task_processorsMap.put(uniqueTaskID, peNames);
+					} else {
+						peNames.add(peName);
+					}
+				}
+			} else if (resUnit instanceof PEUnit){
+				PEUnit peUnit = (PEUnit) resUnit ;
+			}
+
+		}
+		return basicResStats;
+	}
+	
+	private ResourceUsageStats gatherResourceLoadStats(ComputingResource resource, Map<String,List<ResStat>> basicStats) {
+		ResourceUsageStats usageStats = new ResourceUsageStats(resource.getName(), resource.getType(), "resourceLoadStats");
+		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 * MILLI_SEC);
+						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.getExecutableTasks().getJobExecutables(job.getId());
+			List<TaskStats> taskStatsList = new ArrayList<TaskStats>();
+
+			this.serializer.setFieldSeparator(TASK_SEPARATOR);
+
+			for (int j = 0; j < execList.size(); j++) {
+
+				Executable task = (Executable) execList.get(j);
+
+				TaskStats taskStats = createTaskStats(task);
+				if (taskStats != null && taskStatsFile != null) {
+					Object txt = taskStats.serialize(serializer);
+					taskStatsFile.println(txt);
+				}
+				if (taskStats != null && taskStats.getExecFinishDate() != -1) {
+					if (configuration.createsimulationstatistics) {
+						createAccumulatedTaskSimulationStatistic(taskStats);
+					}
+					allTasksFinished &= task.isFinished();
+					if (generateDiagrams) {
+						if (configuration.creatediagrams_tasks)
+							createTaskDiagramData(task);
+						if (configuration.creatediagrams_taskswaitingtime)
+							createTaskWaitingTimeDiagramData(task);
+					}
+					taskStatsList.add(taskStats);
+				}
+			}
+			if (configuration.createjobsstatistics && taskStatsList.size() > 0) {
+
+				this.serializer.setFieldSeparator(JOB_SEPARATOR);
+				JobStats jobStats = createJobStats(taskStatsList);
+				if (jobStatsFile != null) {
+					Object txt = jobStats.serialize(serializer);
+					jobStatsFile.println(txt);
+				}
+			}
+		}
+
+		if (configuration.createsimulationstatistics) {
+			accStats.makespan.add(maxCj);
+			accStats.delayedTasks.add(numOfdelayedTasks);
+			accStats.failedRequests.add(users.getAllSentTasks().size() - users.getFinishedTasksCount());
+			if(resourceController.getScheduler().getType().getName().equals("GS")){
+				for(Scheduler sched: resourceController.getScheduler().getChildren()){
+					accStats.meanQueueLength.add(getSchedulerQueueStats(sched));
+				}
+			}
+			else {
+				accStats.meanQueueLength.add(getSchedulerQueueStats(resourceController.getScheduler()));
+			}
+		}
+
+		saveTaskGanttDiagrams();
+
+		if (taskStatsFile != null) {
+			taskStatsFile.close();
+		}
+		if (jobStatsFile != null) {
+			jobStatsFile.close();
+		}
+	}
+
+	private TaskStats createTaskStats(Executable task) {
+		TaskStats taskStats = new TaskStats(task, startSimulationTime);
+		String uniqueTaskID = taskStats.getJobID() + "_" + taskStats.getTaskID();
+		taskStats.setProcessorsName(task_processorsMap.get(uniqueTaskID));
+		return taskStats;
+	}
+
+	private JobStats createJobStats(List<TaskStats> tasksStats) {
+
+		String jobID = ((TaskStats) tasksStats.get(0)).getJobID();
+		JobStats jobStats = new JobStats(jobID);
+		double maxCj = 0;
+
+		for (int i = 0; i < tasksStats.size(); i++) {
+
+			TaskStats task = (TaskStats) tasksStats.get(i);
+			jobStats.meanTaskStartTime.add(task.getStartTime());
+			jobStats.meanTaskCompletionTime.add(task.getCompletionTime());
+			maxCj = Math.max(maxCj, task.getCompletionTime());
+			jobStats.meanTaskExecutionTime.add(task.getExecutionTime());
+			jobStats.meanTaskWaitingTime.add(task.getWaitingTime());
+			jobStats.meanTaskFlowTime.add(task.getFlowTime());
+			jobStats.meanTaskGQ_WaitingTime.add(task.getGQ_WaitingTime());
+			jobStats.lateness.add(task.getLateness());
+			jobStats.tardiness.add(task.getTardiness());
+		}
+		jobStats.makespan.add(maxCj);
+
+		return jobStats;
+	}
+
+	private void createAccumulatedTaskSimulationStatistic(TaskStats taskStats) {
+		accStats.meanTaskFlowTime.add(taskStats.getFlowTime());
+		accStats.meanTaskExecutionTime.add(taskStats.getExecutionTime());
+		accStats.meanTaskCompletionTime.add(taskStats.getCompletionTime());
+		accStats.meanTaskWaitingTime.add(taskStats.getWaitingTime());
+		accStats.meanTaskStartTime.add(taskStats.getStartTime());
+
+		accStats.lateness.add(taskStats.getLateness());
+		accStats.tardiness.add(taskStats.getTardiness());
+
+		if (taskStats.getExecFinishDate() == -1) {
+			numOfNotExecutedTasks++;
+		}
+		if (taskStats.getTardiness() > 0.0) {
+			numOfdelayedTasks++;
+		}
+
+		maxCj = Math.max(maxCj, taskStats.getCompletionTime());
+	}
+
+	private void createTaskDiagramData(Executable task) {
+		String uniqueTaskID = task.getJobId() + "_" + task.getId();
+
+		String resID = task.getSchedulerName();
+
+		long execStartTime = Double.valueOf(task.getExecStartTime()).longValue() * MILLI_SEC;
+		long execEndTime = Double.valueOf(task.getFinishTime()).longValue() * MILLI_SEC;
+
+		TaskSeries taskRes = ganttDiagramTaskSeriesCollection.getSeries(resID);
+		if (taskRes == null) {
+			taskRes = new TaskSeries(resID);
+			ganttDiagramTaskSeriesCollection.add(taskRes);
+		}
+		org.jfree.data.gantt.Task ganttTask = new org.jfree.data.gantt.Task(uniqueTaskID, new Date(execStartTime),
+				new Date(execEndTime));
+		if (!task.isFinished()) {
+			ganttTask.setPercentComplete(1.0);
+		}
+		taskRes.add(ganttTask);
+	}
+
+	private void createTaskWaitingTimeDiagramData(Executable task) {
+		String uniqueTaskID = task.getJobId() + "_" + task.getId();
+
+		String resID = task.getSchedulerName();
+
+		long execStartTime = Double.valueOf(task.getExecStartTime()).longValue() * MILLI_SEC;
+		long execEndTime = Double.valueOf(task.getFinishTime()).longValue() * MILLI_SEC;
+
+		TaskSeries waitRes = ganttDiagramWaitingTimeSeriesCollection.getSeries(resID);
+		if (waitRes == null) {
+			waitRes = new TaskSeries(resID);
+			ganttDiagramWaitingTimeSeriesCollection.add(waitRes);
+		}
+
+		long sub = Double.valueOf(task.getSubmissionTime()).longValue() * MILLI_SEC;
+		org.jfree.data.gantt.Task wait_exec = new org.jfree.data.gantt.Task(uniqueTaskID, new Date(sub), new Date(
+				execEndTime));
+		org.jfree.data.gantt.Task exec = new org.jfree.data.gantt.Task(uniqueTaskID, new Date(execStartTime), new Date(
+				execEndTime));
+		if (!task.isFinished()) {
+			exec.setPercentComplete(1.0);
+		}
+		wait_exec.addSubtask(wait_exec);
+		wait_exec.addSubtask(exec);
+		waitRes.add(wait_exec);
+	}
+
+	private boolean saveTaskGanttDiagrams() {
+
+		JFreeChart taskDiagram = null;
+		JFreeChart waitingTimeDiagram = null;
+
+		if (!generateDiagrams)
+			return false;
+
+		String fileName = new File(outputFolderName, DIAGRAMS_FILE_NAME_PREFIX + simulationIdentifier + "_")
+				.getAbsolutePath();
+
+		String chartName = "Gantt diagram for " + DataCenterWorkloadSimulator.SIMULATOR_NAME;
+		String simulationTime = "Simulation time";
+		Title subtitle = new TextTitle("created for \"" + simulationIdentifier + "\" at "
+				+ Calendar.getInstance().getTime().toString());
+
+		if (configuration.creatediagrams_tasks) {
+			taskDiagram = getTaskDiagram(chartName, subtitle, simulationTime);
+			if (!saveCategoryChart(taskDiagram, fileName + "Tasks", null /* "{0}" */))
+				return false;
+		}
+
+		if (configuration.creatediagrams_taskswaitingtime) {
+			waitingTimeDiagram = getWaitingTimeDiagram(chartName, subtitle, simulationTime);
+			if (!saveCategoryChart(waitingTimeDiagram, fileName + "Waiting_Time", null /* "Task {1} at {0}" */))
+				return false;
+		}
+
+		return true;
+	}
+
+	private JFreeChart getTaskDiagram(String chartName, Title subtitle, String simulationTime) {
+		String tasks = "Tasks";
+		boolean urls = false;
+		boolean tooltip = true;
+		boolean legend = true;
+		JFreeChart chart = ChartFactory.createGanttChart(chartName, tasks, simulationTime,
+				ganttDiagramTaskSeriesCollection, legend, tooltip, urls);
+		chart.addSubtitle(subtitle);
+		GanttRenderer re = (GanttRenderer) chart.getCategoryPlot().getRenderer();
+		re.setCompletePaint(Color.black);
+		return chart;
+	}
+
+	private JFreeChart getWaitingTimeDiagram(String chartName, Title subtitle, String simulationTime) {
+		String tasks = "Tasks";
+		boolean urls = false;
+		boolean tooltip = true;
+		boolean legend = true;
+		JFreeChart chart = ChartFactory.createGanttChart(chartName, tasks, simulationTime,
+				ganttDiagramWaitingTimeSeriesCollection, legend, tooltip, urls);
+		chart.addSubtitle(subtitle);
+		chart.getPlot().setForegroundAlpha(ALPHA);
+		GanttRenderer re = (GanttRenderer) chart.getCategoryPlot().getRenderer();
+		re.setCompletePaint(Color.black);
+		return chart;
+	}
+
+	private boolean saveCategoryChart(JFreeChart c, String fileName, String labelFormat) {
+		c.setNotify(false);
+		c.setAntiAlias(true);
+		c.setTextAntiAlias(true);
+		c.setBorderVisible(false);
+
+		CategoryPlot categoryplot = (CategoryPlot) c.getPlot();
+		categoryplot.setDomainGridlinesVisible(true);
+
+		if (labelFormat != null) {
+			CategoryItemRenderer rend = categoryplot.getRenderer();
+			rend.setBaseItemLabelsVisible(true);
+			ItemLabelPosition position = new ItemLabelPosition(ItemLabelAnchor.CENTER, TextAnchor.CENTER);
+			rend.setBasePositiveItemLabelPosition(position);
+			NumberFormat nf = NumberFormat.getInstance();
+			CategoryItemLabelGenerator gen = new StandardCategoryItemLabelGenerator(labelFormat, nf);
+			rend.setBaseItemLabelGenerator(gen);
+		}
+
+		int rows = c.getCategoryPlot().getDataset().getColumnKeys().size();
+
+		int height = 900;
+		if (rows > 45) {
+			height = rows * 20;
+		}
+		int width = calculateChartWidth(c);
+		CategoryItemRenderer rend = c.getCategoryPlot().getRenderer();
+
+		for (int i = 0; i < c.getCategoryPlot().getDataset().getRowKeys().size(); i++) {
+			Paint collor = c.getCategoryPlot().getDrawingSupplier().getNextPaint();
+			rend.setSeriesOutlinePaint(i, collor);
+			rend.setSeriesPaint(i, collor);
+		}
+
+		ChartRenderingInfo info = new ChartRenderingInfo();
+		// info.setEntityCollection(null);
+		File f = new File(fileName + "." + ImageFormat.PNG);
+		final String 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: WoRMS/trunk/src/simulator/stats/implementation/StatsAbstractClass.java
===================================================================
--- /DCWoRMS/trunk/src/simulator/stats/implementation/StatsAbstractClass.java	(revision 477)
+++ 	(revision )
@@ -1,21 +1,0 @@
-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: WoRMS/trunk/src/simulator/stats/implementation/WormsStatistics.java
===================================================================
--- /DCWoRMS/trunk/src/simulator/stats/implementation/WormsStatistics.java	(revision 477)
+++ 	(revision )
@@ -1,1441 +1,0 @@
-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/DCWormsUsers.java
===================================================================
--- /DCWoRMS/trunk/src/simulator/DCWormsUsers.java	(revision 481)
+++ /DCWoRMS/trunk/src/simulator/DCWormsUsers.java	(revision 481)
@@ -0,0 +1,329 @@
+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.gssim.DCWormsTags;
+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 DCWormsUsers extends GridSim implements GenericUser {
+
+	/**A job generator, which produces jobs and tasks. These jobs are then sent by this entity */
+	protected WorkloadLoader workloadLoader;
+	
+	/** The name of the entity, to which the created tasks will be sent */
+	protected String destName;
+	
+	/** Indicates, that all tasks that returned to this object are finished */
+	protected boolean allTasksAreFinished;
+	
+	/** Stores the list of jobs, that have been returned to this object */
+	protected List<JobInterface<?>> returnedJobs;
+	protected Set<String> sendJobsIds;
+	protected Set<String> returnedJobsIds;
+	
+	protected XsltTransformations xsltTransformer;
+	
+	/**
+	 * Indicates, that an error has occurred - it is used for debug purposes
+	 */
+	protected boolean error;
+	
+	private static Log log = LogFactory.getLog(DCWormsUsers.class);
+	
+	/**
+	 * Constructs the users object with the given parameters
+	 * @param name the name of the users entity (must be unique across all entities in the whole simulation)
+	 * @param destinationName the name of the entity, to which the created tasks will be sent 
+	 * @param jobGenerator the job generator, which produces jobs and tasks, that will be sent by this class
+	 * @throws Exception if any occurs (see {@link GridSim#GridSim(String, double)})
+	 */
+	public DCWormsUsers(String name, String destinationName, WorkloadLoader workload) throws Exception {
+		super(name, DCWormsConstants.DEFAULT_BAUD_RATE);
+		this.workloadLoader = workload;
+		destName = destinationName;
+		allTasksAreFinished = true;
+		error = false;
+		
+		sendJobsIds = new HashSet<String>();
+		returnedJobsIds = new HashSet<String>();
+		
+		this.xsltTransformer = new XsltTransformations();
+	}
+
+	@Override
+	public void body() {
+		sendJobs();
+		collectJobs();
+
+		//GridSim dependent code for shutting down the simulation
+		shutdownGridStatisticsEntity();
+		terminateIOEntities();
+		shutdownUserEntity();
+	}
+
+	/**
+	 * Collects the jobs sent to broker(s)
+	 */
+	protected void collectJobs() {
+		final int FACTOR = Math.min(10, workloadLoader.getTaskCount()); //the refresh rate of the gauge: at most 10 times
+		final int denominator = workloadLoader.getTaskCount() / FACTOR;
+		allTasksAreFinished = true;
+		returnedJobs = new ArrayList<JobInterface<?>>();
+		int counter = 0;
+		int oldRemeinder = 0;
+		boolean hundredPercent = false;
+		
+		Sim_event ev = new Sim_event();
+		sim_get_next(ev);
+		while (Sim_system.running()) {
+			switch (ev.get_tag()) {
+			case GridSimTags.END_OF_SIMULATION:
+				//no action
+				break;
+			
+			case GridSimTags.INFOPKT_SUBMIT:
+				processPingRequest(ev);
+				break;
+				
+			case GridSimTags.GRIDLET_RETURN:
+				JobInterface<?> returnedJob = (JobInterface<?>) ev.get_data();
+				
+				String jobId = returnedJob.getId();
+
+				
+				if (returnedJobs.contains(returnedJob)) {
+					if(log.isErrorEnabled())
+						log.error("Received the same job twice (job ID " + jobId + ")");
+					error = true;
+					break;
+				} 
+				
+				returnedJobs.add(returnedJob);
+				returnedJobsIds.add(jobId);
+				
+				if(returnedJob.getStatus() == BrokerConstants.JOB_STATUS_FINISHED) {
+					if(log.isDebugEnabled())
+						log.debug("Received finished job " + jobId);
+					
+				} else {
+					if(returnedJob.getStatus() == BrokerConstants.JOB_STATUS_CANCELED) {
+						if(log.isWarnEnabled()){
+							String str = "Warning! An uncomplished job (Job ID: "+jobId+") has returned to users. Job was canceled.";
+							log.warn(str);
+						}
+					}
+					
+					allTasksAreFinished = false;
+				}
+				
+				counter += returnedJob.getTaskCount();
+				int remainder = (counter / denominator);
+				if (remainder != oldRemeinder) {
+					int gauge = ((counter * 100) / (workloadLoader.getTaskCount()));
+					if(log.isInfoEnabled())
+						log.info(gauge + "% ");
+					
+					oldRemeinder = remainder;
+					if (gauge == 100)
+						hundredPercent = true;
+				}
+			
+				break;
+			} 
+			
+			//if all the Gridlets have been collected
+			if (counter == workloadLoader.getTaskCount()) {
+				break;
+			}
+			
+			sim_get_next(ev);
+		}
+		
+		//if all the Gridlets have been collected
+		if (counter == workloadLoader.getTaskCount()) {
+			if (! hundredPercent) {
+				if(log.isInfoEnabled())
+					log.info("100%");
+			}
+			if(log.isInfoEnabled())
+				log.info(get_name() + ": Received all "+workloadLoader.getJobCount()+" jobs and " + counter + " tasks");			
+		} else {
+			if(log.isErrorEnabled())
+				log.error(get_name() + ": ERROR DID NOT RECEIVED all tasks - some tasks were not finished! (received "+counter+" of "+workloadLoader.getTaskCount()+")");
+		}
+		
+		Iterator <String> itr = sendJobsIds.iterator();
+		String jobId;
+		if(log.isInfoEnabled()){
+			log.info("Missing tasks: ");
+			while(itr.hasNext()){
+				jobId = itr.next();
+				if(!returnedJobsIds.contains(jobId)){
+					log.info(jobId + ", ");
+				}
+			}
+		}
+		
+	}
+
+	/**
+	 * Sends jobs to broker entities
+	 */
+	protected void sendJobs() {
+		
+		Map<Long, List<Job>> jobTimes = new TreeMap<Long, List<Job>>();
+		int destID = GridSim.getEntityId(destName);
+		//destID=GridSim.getEntityId("BROKER@COMPUTING_GRID_0");
+		List<JobDescription> jobs = workloadLoader.getJobs();
+		//TaskRequirements taskReq = new TaskRequirementsImpl();
+		//double values[] = null;
+
+		for (JobDescription job : jobs) {
+			long l_submissionTime = Long.MAX_VALUE;
+			//pick the lowest submission time
+			for (TaskDescription task : job) {
+				if (task.getSubmissionTime() < l_submissionTime)
+					l_submissionTime = task.getSubmissionTime();
+			}
+
+			//store the submission time expressed in seconds after the simulation start time
+			long submissionTime = l_submissionTime;
+			
+			Job newJob = prepareJob(job, submissionTime);
+			
+			List<Job> list = jobTimes.get(submissionTime);
+			if (list == null) {
+				list = new ArrayList<Job>();
+				jobTimes.put(submissionTime, list);
+			}
+			list.add(newJob);
+		}
+		for (Long submissionTime : jobTimes.keySet()) {
+			List<Job> list = jobTimes.get(submissionTime);
+			for(int i = 0; i < list.size(); i++){
+				this.sendJobsIds.add(list.get(i).getId());
+				send(destID, submissionTime, GridSimTags.GRIDLET_SUBMIT, list.get(i));
+			}
+			
+			//send(output, submissionTime, GridSimTags.GRIDLET_SUBMIT, new IO_data(list, GssConstants.DEFAULT_GRIDLET_SIZE, destID));
+			//send(destID, submissionTime, GridSimTags.GRIDLET_SUBMIT, list);
+			
+		}
+		System.out.println("finished sending jobs");
+	}
+	
+	public List<JobDescription> getAllSentJobs() {
+		return (List<JobDescription>) workloadLoader.getJobs();
+	}
+	
+	public List<TaskDescription> getAllSentTasks() {
+		List<TaskDescription> result = new ArrayList<TaskDescription>();
+		List<JobDescription> sentJobs = getAllSentJobs();
+		for (JobDescription job : sentJobs) {
+			result.addAll(job);
+		}
+		return result;
+	}
+	
+	public List<JobInterface<?>> getAllReceivedJobs() {
+		return returnedJobs;
+	}
+
+	public int getFinishedTasksCount() {
+		int result = 0;
+		for (JobInterface<?> job : returnedJobs) {
+			for (TaskInterface<?> task: job.getTask()) {
+				if(task.getStatus() == DCWormsTags.SUCCESS)
+					result++;
+			}
+		}
+		return result;
+	}
+	
+	public String getUserName() {
+		return get_name();
+	}
+	
+	public boolean isError() {
+		return error;
+	}
+	
+	/**
+	 * Performs action concerning a ping request to this entity
+	 * @param ev the event object
+	 */
+	protected void processPingRequest(Sim_event ev) {
+        InfoPacket pkt = (InfoPacket) ev.get_data();
+        pkt.setTag(GridSimTags.INFOPKT_RETURN);
+        pkt.setDestID(pkt.getSrcID());
+
+		// sends back to the sender
+		send(output, GridSimTags.SCHEDULE_NOW, GridSimTags.INFOPKT_RETURN,
+				new IO_data(pkt, pkt.getSize(), pkt.getSrcID()));
+    }
+		
+	protected Job prepareJob(JobDescription jobDescription, long submissionTime){
+
+		Job newJob = new Job(jobDescription.getJobId());
+		DateTime submitionTime = new DateTime();
+        submitionTime = submitionTime.plusMillis((int)submissionTime*1000);
+			try {
+				
+				// transform job description to resource requirements
+
+				newJob.setSenderId(this.get_id());
+				
+				for (TaskDescription taskDescription : jobDescription) {
+					
+					String xmlResReq = this.xsltTransformer.taskToResourceRequirements(
+										taskDescription.getDocument(),
+										jobDescription.getJobId(),
+										taskDescription.getUserDn(),
+										submitionTime);
+
+					Task newTask = new Task(xmlResReq);
+					newTask.setSenderId(this.get_id());
+					newTask.setStatus((int)BrokerConstants.TASK_STATUS_UNSUBMITTED);
+					newTask.setLength(taskDescription.getTaskLength());
+					newTask.setWorkloadLogWaitTime(taskDescription.getWorkloadLogWaitTime());
+			//		newTask.setSubmissionTime(taskDescription.getSubmissionTime());
+					
+					newJob.add(newTask);
+				}
+
+				jobDescription.discardUnused();
+				
+			} catch (Exception e){
+				log.error(e.getMessage());
+				e.printStackTrace();
+			}
+		
+		return newJob;
+	}
+}
Index: /DCWoRMS/trunk/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 481)
@@ -58,5 +58,5 @@
 import org.xml.sax.InputSource;
 
-import simulator.WormsConstants;
+import simulator.DCWormsConstants;
 import simulator.utils.GSSimXML;
 import simulator.utils.XsltTransformations;
@@ -259,5 +259,5 @@
 			
 			//initially - a standard value
-			taskCountToBeGenerated = WormsConstants.DEFAULT_TASK_COUNT_IN_SINGLE_JOB; 
+			taskCountToBeGenerated = DCWormsConstants.DEFAULT_TASK_COUNT_IN_SINGLE_JOB; 
 			
 			try {
Index: WoRMS/trunk/src/simulator/WormsUsers.java
===================================================================
--- /DCWoRMS/trunk/src/simulator/WormsUsers.java	(revision 477)
+++ 	(revision )
@@ -1,328 +1,0 @@
-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: WoRMS/trunk/src/simulator/WormsConstants.java
===================================================================
--- /DCWoRMS/trunk/src/simulator/WormsConstants.java	(revision 477)
+++ 	(revision )
@@ -1,102 +1,0 @@
-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/schedframe/ExecutablesList.java
===================================================================
--- /DCWoRMS/trunk/src/schedframe/ExecutablesList.java	(revision 481)
+++ /DCWoRMS/trunk/src/schedframe/ExecutablesList.java	(revision 481)
@@ -0,0 +1,154 @@
+package schedframe;
+
+import gssim.schedframe.scheduling.ExecTask;
+import gssim.schedframe.scheduling.Executable;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import java.util.ListIterator;
+
+public class ExecutablesList implements List<ExecTask> {
+
+	private List<ExecTask> executables;
+	public ExecutablesList (){
+		executables = Collections.synchronizedList(new ArrayList<ExecTask>());
+	}
+
+
+	public List<Executable> getJobExecutables(String jobId){
+		List<Executable> list = new ArrayList<Executable>();
+		synchronized (executables)  {
+			for(int i = 0; i < executables.size(); i++){
+				Executable exec = (Executable)executables.get(i);
+				
+				if(exec.getJobId().equals(jobId))
+					list.add(exec);
+			}
+		}
+		return list;
+	}
+	
+	public List<Executable> getTaskExecutables(String jobId, String taskId){
+		
+		List<Executable> list = new ArrayList<Executable>();
+		synchronized (executables)  {
+			for(int i = 0; i < executables.size(); i++){
+				Executable exec = (Executable)executables.get(i);
+				
+				if(exec.getJobId().equals(jobId) && exec.getId().equals(taskId))
+					list.add(exec);
+			}
+		}
+		return list;
+	}
+	
+	public Executable getTaskExecutable(Integer executableId){
+		synchronized (executables)  {
+			for (ExecTask task : executables) {
+				Executable exec = (Executable)task;
+				if (exec.getUniqueId() == executableId) {
+					return exec;
+				}
+			}
+		}
+		return null;
+	}
+	
+	
+	public boolean add(ExecTask arg0) {
+		return executables.add(arg0);
+	}
+
+	public void add(int arg0, ExecTask arg1) {
+		executables.add(arg0, arg1);
+	}
+
+	public boolean addAll(Collection<? extends ExecTask> arg0) {
+		return executables.addAll(arg0);
+	}
+
+	public boolean addAll(int arg0, Collection<? extends ExecTask> arg1) {
+		return executables.addAll(arg0, arg1);
+	}
+
+	public void clear() {
+		executables.clear();
+	}
+
+	public boolean contains(Object arg0) {
+		return executables.contains(arg0);
+	}
+
+	public boolean containsAll(Collection<?> arg0) {
+		return executables.containsAll(arg0);
+	}
+
+	public ExecTask get(int arg0) {
+		return executables.get(arg0);
+	}
+
+	public int indexOf(Object arg0) {
+		return indexOf(arg0);
+	}
+
+	public boolean isEmpty() {
+		return executables.isEmpty();
+	}
+
+	public Iterator<ExecTask> iterator() {
+		return executables.iterator();
+	}
+
+	public int lastIndexOf(Object arg0) {
+		return executables.lastIndexOf(arg0);
+	}
+
+	public ListIterator<ExecTask> listIterator() {
+		return executables.listIterator();
+	}
+
+	public ListIterator<ExecTask> listIterator(int arg0) {
+		return executables.listIterator(arg0);
+	}
+
+	public boolean remove(Object arg0) {
+		return executables.remove(arg0);
+	}
+
+	public ExecTask remove(int arg0) {
+		return executables.remove(arg0);
+	}
+
+	public boolean removeAll(Collection<?> arg0) {
+		return executables.removeAll(arg0);
+	}
+
+	public boolean retainAll(Collection<?> arg0) {
+		return executables.retainAll(arg0);
+	}
+
+	public ExecTask set(int arg0, ExecTask arg1) {
+		return executables.set(arg0, arg1);
+	}
+
+	public int size() {
+		return executables.size();
+	}
+
+	public List<ExecTask> subList(int arg0, int arg1) {
+		return executables.subList(arg0, arg1);
+	}
+
+	public Object[] toArray() {
+		return executables.toArray();
+	}
+
+	public <T> T[] toArray(T[] arg0) {
+		return executables.toArray(arg0);
+	}
+	
+}
+
Index: /DCWoRMS/trunk/src/schedframe/scheduling/Scheduler.java
===================================================================
--- /DCWoRMS/trunk/src/schedframe/scheduling/Scheduler.java	(revision 478)
+++ /DCWoRMS/trunk/src/schedframe/scheduling/Scheduler.java	(revision 481)
@@ -8,5 +8,5 @@
 import gridsim.GridSimTags;
 import gridsim.IO_data;
-import gridsim.gssim.WormsTags;
+import gridsim.gssim.DCWormsTags;
 
 import java.util.ArrayList;
@@ -28,6 +28,6 @@
 import schedframe.scheduling.manager.resources.ManagedResources;
 import schedframe.scheduling.policy.AbstractManagementSystem;
+import schedframe.scheduling.queue.QueueDescription;
 import schedframe.scheduling.queue.TaskQueue;
-import schedframe.scheduling.queue.QueueDescription;
 import schedframe.scheduling.tasks.WorkloadUnit;
 
@@ -117,5 +117,5 @@
 				if (obj != null) {
 					int delay = (Integer) obj;
-					send(this.get_id(), delay, WormsTags.TIMER);
+					send(this.get_id(), delay, DCWormsTags.TIMER);
 				}
 			}
@@ -174,5 +174,5 @@
 	protected void processOtherRequest(Sim_event ev) {
 		switch (ev.get_tag()) {
-		case WormsTags.QUERY_RESOURCE_DESC:
+		case DCWormsTags.QUERY_RESOURCE_DESC:
 			SchedulerDescription desc = new SchedulerDescription(new LocalSystem(get_name(), null, null));
 			Map<ResourceUnitName, List<ResourceUnit>> units = managementSystem.getResourceManager().getSharedResourceUnits();
@@ -181,5 +181,5 @@
 
 			IO_data data = new IO_data(desc, 0, ev.get_src());
-			send(ev.get_src(), GridSimTags.SCHEDULE_NOW, WormsTags.QUERY_RESOURCE_DESC_RESULT, data);
+			send(ev.get_src(), GridSimTags.SCHEDULE_NOW, DCWormsTags.QUERY_RESOURCE_DESC_RESULT, data);
 			break;
 
@@ -271,5 +271,5 @@
 	public List<QueueDescription> getQueuesDescription(){
 		List<QueueDescription> queues = new ArrayList<QueueDescription>();
-		for(TaskQueue queue: managementSystem.getAccessQueues()){
+		for(TaskQueue queue: managementSystem.getQueues()){
 			QueueDescription qd;
 			try {
Index: /DCWoRMS/trunk/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 481)
@@ -3,5 +3,5 @@
 import schedframe.Plugin;
 import schedframe.events.scheduling.SchedulingEvent;
-import schedframe.scheduling.WorkloadUnitListImpl;
+import schedframe.scheduling.TaskListImpl;
 import schedframe.scheduling.manager.resources.ResourceManager;
 import schedframe.scheduling.manager.tasks.JobRegistry;
@@ -12,5 +12,5 @@
 public interface SchedulingPlugin extends Plugin{
 
-	public int placeJobsInQueues(WorkloadUnitListImpl newJobs,
+	public int placeTasksInQueues(TaskListImpl newTasks,
 			TaskQueueList queues, 
 			ResourceManager resourceManager, ModuleList modules);
Index: /DCWoRMS/trunk/src/schedframe/scheduling/policy/AbstractManagementSystem.java
===================================================================
--- /DCWoRMS/trunk/src/schedframe/scheduling/policy/AbstractManagementSystem.java	(revision 480)
+++ /DCWoRMS/trunk/src/schedframe/scheduling/policy/AbstractManagementSystem.java	(revision 481)
@@ -10,5 +10,4 @@
 import schedframe.PluginConfiguration;
 import schedframe.events.scheduling.SchedulingEventType;
-import schedframe.resources.units.StandardResourceUnitName;
 import schedframe.scheduling.Scheduler;
 import schedframe.scheduling.WorkloadUnitHandler;
@@ -16,6 +15,6 @@
 import schedframe.scheduling.manager.resources.ResourceManager;
 import schedframe.scheduling.manager.resources.ResourceManagerFactory;
+import schedframe.scheduling.manager.tasks.JobRegistry;
 import schedframe.scheduling.manager.tasks.JobRegistryImpl;
-import schedframe.scheduling.manager.tasks.JobRegistry;
 import schedframe.scheduling.plan.AllocationInterface;
 import schedframe.scheduling.plan.SchedulingPlanInterface;
@@ -27,12 +26,12 @@
 import schedframe.scheduling.queue.TaskQueueList;
 import schedframe.scheduling.tasks.Job;
+import schedframe.scheduling.tasks.TaskInterface;
 import schedframe.scheduling.tasks.WorkloadUnit;
-import simulator.WormsConstants;
+import simulator.DCWormsConstants;
 import eduni.simjava.Sim_event;
 import gridsim.GridSim;
 import gridsim.GridSimTags;
-import gridsim.Gridlet;
 import gridsim.IO_data;
-import gridsim.gssim.WormsTags;
+import gridsim.gssim.DCWormsTags;
 import gssim.schedframe.scheduling.ExecTask;
 import gssim.schedframe.scheduling.Executable;
@@ -45,15 +44,13 @@
 	protected String name;
 
+	protected TaskQueueList queues;
 	protected ResourceManager resourceManager;
-
-	protected TaskQueueList queues;
-
+	protected JobRegistryImpl jobRegistry;
+	protected ModuleList moduleList;
+	
 	protected SchedulingPlugin schedulingPlugin;
-
 	protected ExecutionTimeEstimationPlugin execTimeEstimationPlugin;
 
-	protected ModuleList moduleList;
-	
-	protected JobRegistryImpl jobRegistry;
+	protected Scheduler scheduler;
 	
 
@@ -67,4 +64,17 @@
 	}
 	
+	public void init(Scheduler sched, ManagedResources managedResources) {
+		scheduler = sched;
+		resourceManager = ResourceManagerFactory.createResourceManager(scheduler, managedResources);
+		scheduler.set_stat(DCWormsConstants.getResourcesStatisticsObject(queues.size()));
+		for(int i = 0; i < queues.size(); i++){
+			TaskQueue q = queues.get(i);
+			if(q instanceof AbstractStatsSupportingQueue<?>){
+				AbstractStatsSupportingQueue<?> queue = (AbstractStatsSupportingQueue<?>) q;
+				queue.setStats(scheduler.get_stat(), DCWormsConstants.TASKS_QUEUE_LENGTH_MEASURE_NAME + "_" + Integer.toString(i));
+			}
+		}
+	}
+	
 	public void processEvent(Sim_event ev) {
 		processOtherEvent(ev);
@@ -81,10 +91,7 @@
 	}
 	
+	
 	public String getName() {
 		return name;
-	}
-
-	public PluginConfiguration getSchedulingPluginConfiguration() {
-		return schedulingPlugin.getConfiguration();
 	}
 	
@@ -106,4 +113,12 @@
 		return jobRegistry;
 	}
+	
+	public Scheduler getScheduler() {
+		return scheduler;
+	}
+	
+	public PluginConfiguration getSchedulingPluginConfiguration() {
+		return schedulingPlugin.getConfiguration();
+	}
 
 	public boolean pluginSupportsEvent(int eventType){
@@ -111,16 +126,18 @@
 	}
 
-	public abstract void notifySubmittedWorkloadUnit(WorkloadUnit wu, boolean ack);
-
-	public abstract void notifyCanceledWorkloadUnit(WorkloadUnit wu);
-
-	public abstract void notifyReturnedWorkloadUnit(WorkloadUnit wu);
-
-	protected abstract void executeSchedulingPlan(SchedulingPlanInterface decision);
-
-
-
+	public TaskQueueList getQueues(){
+		return queues;
+	}
+	
+	public Map<String, Integer> getQueuesSize() {
+		Map<String, Integer> queue_size = new HashMap<String, Integer>();
+		for (TaskQueue queue : queues) {
+			queue_size.put(queue.getName(), queue.size());
+		}
+		return queue_size;
+	}
+	
 	//POPRAWIC  (ale co? bo teraz chyba jest ok)
-	protected void submitWorkloadUnit(WorkloadUnit wu, AllocationInterface allocation) {
+	protected void submitTask(TaskInterface<?> task, AllocationInterface<?> allocation) {
 		String providerName = allocation.getProviderName();
 		if (providerName == null) {
@@ -128,38 +145,6 @@
 		}
 		//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;
+		removeFromQueue(task);
+		scheduler.send(providerName, GridSimTags.SCHEDULE_NOW, GridSimTags.GRIDLET_SUBMIT, task);	
 	}
 
@@ -184,10 +169,4 @@
 
 	protected void sendExecutableReadyEvent(ExecTask exec) {
-
-		/*if (wu instanceof JobInterface) {
-			scheduler.sendInternal(Long.valueOf(0).doubleValue(), GssimTags.TASK_READY_FOR_EXECUTION,
-					wu);
-			return;
-		}*/
 
 		long delay = 0;
@@ -202,5 +181,5 @@
 		}
 
-		scheduler.sendInternal(Long.valueOf(delay).doubleValue(), WormsTags.TASK_READY_FOR_EXECUTION,
+		scheduler.sendInternal(Long.valueOf(delay).doubleValue(), DCWormsTags.TASK_READY_FOR_EXECUTION,
 				exec);
 	}
@@ -214,5 +193,5 @@
 				if (obj != null) {
 					int delay = (Integer) obj;
-					scheduler.sendInternal(delay, WormsTags.TIMER, null);
+					scheduler.sendInternal(delay, DCWormsTags.TIMER, null);
 				}
 			}
@@ -229,37 +208,12 @@
 		return false;
 	}
-
-	public TaskQueueList getAccessQueues(){
-		return queues;
-	}
-	
-	public Map<String, Integer> getQueuesSize() {
-		Map<String, Integer> queue_size = new HashMap<String, Integer>();
-		for (TaskQueue queue : queues) {
-			queue_size.put(queue.getName(), queue.size());
-		}
-		return queue_size;
-	}
-
-	public void init(Scheduler sched, ManagedResources managedResources) {
-		scheduler = sched;
-		resourceManager = ResourceManagerFactory.createResourceManager(scheduler, managedResources);
-		scheduler.set_stat(WormsConstants.getResourcesStatisticsObject(queues.size()));
-		for(int i = 0; i < queues.size(); i++){
-			TaskQueue q = queues.get(i);
-			if(q instanceof AbstractStatsSupportingQueue<?>){
-				AbstractStatsSupportingQueue<?> queue = (AbstractStatsSupportingQueue<?>) q;
-				queue.setStats(scheduler.get_stat(), WormsConstants.TASKS_QUEUE_LENGTH_MEASURE_NAME + "_" + Integer.toString(i));
-			}
-		}
-	}
-
-	protected Scheduler scheduler;
-
-	public Scheduler getScheduler() {
-		return scheduler;
-	}
 	
 	public abstract WorkloadUnitHandler getWorkloadUnitHandler();
+	
+	public abstract void notifySubmittedWorkloadUnit(WorkloadUnit wu, boolean ack);
+
+	public abstract void notifyReturnedWorkloadUnit(WorkloadUnit wu);
+
+	protected abstract void executeSchedulingPlan(SchedulingPlanInterface<?> decision);
 
 }
Index: /DCWoRMS/trunk/src/schedframe/scheduling/policy/local/LocalManagementSystem.java
===================================================================
--- /DCWoRMS/trunk/src/schedframe/scheduling/policy/local/LocalManagementSystem.java	(revision 480)
+++ /DCWoRMS/trunk/src/schedframe/scheduling/policy/local/LocalManagementSystem.java	(revision 481)
@@ -4,9 +4,7 @@
 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 gridsim.gssim.DCWormsTags;
+import gridsim.gssim.filter.ExecTaskFilter;
 import gssim.schedframe.scheduling.ExecTask;
 import gssim.schedframe.scheduling.Executable;
@@ -27,9 +25,7 @@
 import qcg.shared.constants.BrokerConstants;
 import schedframe.ResourceController;
-import schedframe.events.scheduling.EventReason;
 import schedframe.events.scheduling.SchedulingEvent;
 import schedframe.events.scheduling.SchedulingEventType;
 import schedframe.events.scheduling.StartTaskExecutionEvent;
-import schedframe.events.scheduling.TaskCanceledEvent;
 import schedframe.events.scheduling.TaskFinishedEvent;
 import schedframe.events.scheduling.TaskRequestedTimeExpiredEvent;
@@ -45,7 +41,7 @@
 import schedframe.scheduling.ResourceHistoryItem;
 import schedframe.scheduling.Scheduler;
+import schedframe.scheduling.TaskListImpl;
 import schedframe.scheduling.UsedResourceList;
 import schedframe.scheduling.WorkloadUnitHandler;
-import schedframe.scheduling.WorkloadUnitListImpl;
 import schedframe.scheduling.manager.resources.LocalResourceManager;
 import schedframe.scheduling.manager.resources.ManagedResources;
@@ -63,9 +59,8 @@
 import schedframe.scheduling.tasks.Job;
 import schedframe.scheduling.tasks.JobInterface;
-import schedframe.scheduling.tasks.SubmittedTask;
 import schedframe.scheduling.tasks.Task;
 import schedframe.scheduling.tasks.TaskInterface;
 import schedframe.scheduling.tasks.WorkloadUnit;
-import simulator.WormsConstants;
+import simulator.DCWormsConstants;
 import simulator.utils.DoubleMath;
 
@@ -112,8 +107,8 @@
 		switch (tag) {
 
-		case WormsTags.TIMER:
+		case DCWormsTags.TIMER:
 			if (pluginSupportsEvent(tag)) {
 				SchedulingEvent event = new SchedulingEvent(SchedulingEventType.TIMER);
-				SchedulingPlanInterface decision =  schedulingPlugin.schedule(event, 
+				SchedulingPlanInterface<?> decision =  schedulingPlugin.schedule(event, 
 						queues,  getJobRegistry(), getResourceManager(), moduleList);
 				executeSchedulingPlan(decision);
@@ -123,12 +118,12 @@
 			break;
 
-		case WormsTags.TASK_READY_FOR_EXECUTION:
+		case DCWormsTags.TASK_READY_FOR_EXECUTION:
 			
 			ExecTask data = (ExecTask) ev.get_data();
 			try {
-				data.setStatus(Gridlet.READY);
+				data.setStatus(DCWormsTags.READY);
 				if (pluginSupportsEvent(tag)) {
 					SchedulingEvent event = new StartTaskExecutionEvent(data.getJobId(), data.getId());
-					SchedulingPlanInterface decision =  schedulingPlugin.schedule(event,
+					SchedulingPlanInterface<?> decision =  schedulingPlugin.schedule(event,
 							queues,  getJobRegistry(), getResourceManager(), moduleList);
 					executeSchedulingPlan(decision);
@@ -139,15 +134,15 @@
 			break;
 
-		case WormsTags.TASK_EXECUTION_FINISHED:
+		case DCWormsTags.TASK_EXECUTION_FINISHED:
 			obj = ev.get_data();
-			ExecTask task = (ExecTask) obj;
-			if (task.getStatus() == Gridlet.INEXEC) {
-				finalizeExecutable(task);
-				SubmittedTask subTask = (SubmittedTask)task;
-				sendFinishedWorkloadUnit((ExecTask)subTask.getGridlet());
+			ExecTask exec = (ExecTask) obj;
+			if (exec.getStatus() == DCWormsTags.INEXEC) {
+				finalizeExecutable(exec);
+
+				sendFinishedWorkloadUnit(exec);
 				//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()));
+				log.debug(exec.getJobId() + "_" + exec.getId() + " finished execution on " + new DateTime());
+				log.info(DCWormsConstants.USAGE_MEASURE_NAME + ": " + calculateTotalLoad(jobRegistry.getRunningTasks().size()));
 				/*UsedResourceList<ResourceHistoryItem> lastUsedList = task.getUsedResources();
 				Map<ResourceUnitName, AbstractResourceUnit> lastUsed = lastUsedList.getLast()
@@ -163,10 +158,10 @@
 			}
 			if (pluginSupportsEvent(tag)) {
-				SchedulingEvent event = new TaskFinishedEvent(task.getJobId(), task.getId());
-				SchedulingPlanInterface decision = schedulingPlugin.schedule(event,
+				SchedulingEvent event = new TaskFinishedEvent(exec.getJobId(), exec.getId());
+				SchedulingPlanInterface<?> decision = schedulingPlugin.schedule(event,
 						queues, getJobRegistry(), getResourceManager(), moduleList);
 				executeSchedulingPlan(decision);
 			}
-			Job job = jobRegistry.getJob(task.getJobId());
+			Job job = jobRegistry.getJob(exec.getJobId());
 			if(!job.isFinished()){
 				getWorkloadUnitHandler().handleJob(job);
@@ -174,10 +169,10 @@
 
 			break;
-		case WormsTags.TASK_REQUESTED_TIME_EXPIRED:
+		case DCWormsTags.TASK_REQUESTED_TIME_EXPIRED:
 			obj = ev.get_data();
-			task = (SubmittedTask) obj;
+			exec = (Executable) obj;
 			if (pluginSupportsEvent(tag)) {
-				SchedulingEvent event = new TaskRequestedTimeExpiredEvent(task.getJobId(), task.getId());
-				SchedulingPlanInterface decision = schedulingPlugin.schedule(event,
+				SchedulingEvent event = new TaskRequestedTimeExpiredEvent(exec.getJobId(), exec.getId());
+				SchedulingPlanInterface<?> decision = schedulingPlugin.schedule(event,
 						queues, getJobRegistry(), getResourceManager(), moduleList);
 				executeSchedulingPlan(decision);
@@ -185,5 +180,5 @@
 
 			break;
-		case WormsTags.UPDATE:
+		case DCWormsTags.UPDATE:
 			updateProcessingTimes(ev);
 			break;
@@ -193,7 +188,7 @@
 
 	public void notifyReturnedWorkloadUnit(WorkloadUnit wu) {
-		if (pluginSupportsEvent(WormsTags.TASK_EXECUTION_FINISHED)) {
+		if (pluginSupportsEvent(DCWormsTags.TASK_EXECUTION_FINISHED)) {
 			SchedulingEvent event = new SchedulingEvent(SchedulingEventType.TASK_FINISHED);
-			SchedulingPlanInterface decision =  schedulingPlugin.schedule(event,
+			SchedulingPlanInterface<?> decision =  schedulingPlugin.schedule(event,
 					queues, getJobRegistry(), getResourceManager(), moduleList);
 			executeSchedulingPlan(decision);
@@ -203,117 +198,47 @@
 		//}
 	}
-
-	public void notifyCanceledWorkloadUnit(WorkloadUnit job) {
-
-		if (!pluginSupportsEvent(GridSimTags.GRIDLET_CANCEL))
-			return;
-
-		Executable executable = (Executable) job;
-		String jobID = executable.getJobId();
-
-		SchedulingPlanInterface decision = null;
-
-		try {
-			executable.setStatus((int) BrokerConstants.JOB_STATUS_CANCELED);
-
-			TaskCanceledEvent event = new TaskCanceledEvent(executable.getJobId(), executable.getTaskId());
-			event.setReason(EventReason.RESERVATION_EXCEEDED);
-			decision = schedulingPlugin
-					.schedule(event, queues, getJobRegistry(), getResourceManager(), moduleList);
-
-			if (decision == null)
-				return;
-
-			executeSchedulingPlan(decision);
-
-		} catch (Exception e) {
-			log.error("Exception during scheduling. " + e.getMessage());
-			e.printStackTrace();
-		}
-	}
-	
-	protected void executeSchedulingPlan(SchedulingPlanInterface decision) {
-
-		ArrayList<ScheduledTaskInterface> taskSchedulingDecisions = decision.getTasks();
+	
+	protected void executeSchedulingPlan(SchedulingPlanInterface<?> decision) {
+
+		ArrayList<ScheduledTaskInterface<?>> taskSchedulingDecisions = decision.getTasks();
 		for (int i = 0; i < taskSchedulingDecisions.size(); i++) {
-			try {
-				ScheduledTaskInterface taskDecision = taskSchedulingDecisions.get(i);
-
-				// not scheduled again are returned to the user.
-				if (taskDecision.getStatus() == AllocationStatus.REJECTED) {
-					continue;
+			ScheduledTaskInterface<?> taskDecision = taskSchedulingDecisions.get(i);
+
+			if (taskDecision.getStatus() == AllocationStatus.REJECTED) {
+				continue;
+			}
+
+			ArrayList<AllocationInterface<?>> allocations = taskDecision.getAllocations();
+
+			TaskInterface<?> task = taskDecision.getTask();
+			for (int j = 0; j < allocations.size(); j++) {
+
+				AllocationInterface<?> allocation = allocations.get(j);
+				if (allocation.isProcessing()) {
+					ExecTask exec = (ExecTask) task;					
+					executeTask(exec, allocation.getRequestedResources());
+				} else if(resourceManager.getSchedulerName(allocation.getProviderName()) != null){
+					allocation.setProviderName(resourceManager.getSchedulerName(allocation.getProviderName()));
+					submitTask(task, allocation);
+				} else {
+					ExecTask exec = (ExecTask) task;
+					executeTask(exec, chooseResourcesForExecution(allocation.getProviderName(), (ExecTask)task));
 				}
-
-				ArrayList<AllocationInterface> allocations = taskDecision.getAllocations();
-
-				WorkloadUnit task = taskDecision.getTask();
-				for (int j = 0; j < allocations.size(); j++) {
-
-					AllocationInterface allocation = allocations.get(j);
-					if (allocation.isProcessing()) {
-						
-						ExecTask exec = (ExecTask) task;
-						
-
-						//Executable e = (Executable)task;
-						/*SubmittedTask submittedTask = jobRegistry.getSubmittedTask(e.getJobId(), e.getId());
-						if(submittedTask == null)
-						{	submittedTask = new SubmittedTask(e);
-							jobRegistry.addTask(submittedTask);
-						}*/
-
-						/*e.visitResource(scheduler.get_name());
-						Scheduler parentScheduler = scheduler.getParent();
-						while (parentScheduler != null && !e.getVisitedResources().contains(parentScheduler.get_name())) {
-							e.visitResource(parentScheduler.get_name());
-							parentScheduler = parentScheduler.getParent();
-						}*/
-						
-												
-						executeTask(exec, allocation.getRequestedResources());
-					//} else if(GridSim.getEntityId(allocation.getProviderName()) != -1 || scheduler.getScheduler(allocation.getProviderName())!=null){
-					} else if(resourceManager.getSchedulerName(allocation.getProviderName()) != null){
-						allocation.setProviderName(resourceManager.getSchedulerName(allocation.getProviderName()));
-						submitWorkloadUnit(task, allocation);
-					} else {
-
-						ExecTask exec = (ExecTask) task;
-						
-							//Executable exec = jobRegistry.createExecutable(t, allocation);
-							//exec.setResourceParameter(scheduler.get_id(), 1);
-						/*e.visitResource(scheduler.get_name());
-						Scheduler parentScheduler = scheduler.getParent();
-						while (parentScheduler != null && !e.getVisitedResources().contains(parentScheduler.get_name())) {
-							e.visitResource(parentScheduler.get_name());
-							parentScheduler = parentScheduler.getParent();
-						}*/
-						executeTask(exec, chooseResourcesForExecution(allocation.getProviderName(), (ExecTask)task));
-					}
-				}
-
-			} catch (Exception e) {
-				e.printStackTrace();
-			}
+			}
+
 		}
 	}
 
 	protected void executeTask(ExecTask task, Map<ResourceUnitName, ResourceUnit> choosenResources) {
-	//	Executable exec = (Executable) task;
-	
-		SubmittedTask submittedTask = (SubmittedTask)task;
+
+		Executable exec = (Executable)task;
 		boolean allocationStatus = getAllocationManager().allocateResources(choosenResources);
 		if(allocationStatus == false)
 			return;
 		removeFromQueue(task);
-		//SubmittedTask submittedTask = (SubmittedTask)task;
-		/* submittedTask = jobRegistry.getSubmittedTask(exec.getJobId(), exec.getId());
-		if(submittedTask == null)
-		{	submittedTask = new SubmittedTask(exec);
-			jobRegistry.addTask(submittedTask);
-		}*/
-		double completionPercentage = (submittedTask.getLength() - submittedTask.getRemainingGridletLength())/submittedTask.getLength();
+		//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();
+				execTimeEstimationPlugin.execTimeEstimation(event, task, choosenResources, exec.getCompletionPercentage())).intValue();
 		log.debug(task.getJobId() + "_" + task.getId() + " starts executing on " + new DateTime()
 				+ " will finish after " + time);
@@ -322,25 +247,27 @@
 			return;
 
-		submittedTask.setEstimatedDuration(time);
+		exec.setEstimatedDuration(time);
 		DateTime currentTime = new DateTime();
 		ResourceHistoryItem resHistItem = new ResourceHistoryItem(choosenResources, currentTime);
-		submittedTask.addUsedResources(resHistItem);
-		submittedTask.setFinishTime(currentTime.getMillis() / 1000);
-		
-		jobRegistry.saveHistory(submittedTask, time, choosenResources);
-		
-		scheduler.sendInternal(time, WormsTags.TASK_EXECUTION_FINISHED,
-				submittedTask);
+		exec.addUsedResources(resHistItem);
+
+		scheduler.sendInternal(time, DCWormsTags.TASK_EXECUTION_FINISHED,
+				exec);
 
 		try {
-			long expectedDuration = submittedTask.getExpectedDuration().getMillis() / 1000;
-			scheduler.sendInternal(expectedDuration, WormsTags.TASK_REQUESTED_TIME_EXPIRED, submittedTask);
+			long expectedDuration = exec.getExpectedDuration().getMillis() / 1000;
+			scheduler.sendInternal(expectedDuration, DCWormsTags.TASK_REQUESTED_TIME_EXPIRED, exec);
 		} catch (NoSuchFieldException e) {
-			double t = submittedTask.getEstimatedDuration();
-			scheduler.sendInternal(t, WormsTags.TASK_REQUESTED_TIME_EXPIRED, submittedTask);
-		}
-		
-		submittedTask.setGridletStatus(Gridlet.INEXEC);
-		log.info(WormsConstants.USAGE_MEASURE_NAME + ": " + calculateTotalLoad(jobRegistry.getRunningTasks().size()));
+			double t = exec.getEstimatedDuration();
+			scheduler.sendInternal(t, DCWormsTags.TASK_REQUESTED_TIME_EXPIRED, exec);
+		}
+		
+		try {
+			exec.setStatus(DCWormsTags.INEXEC);
+		} catch (Exception e1) {
+			// TODO Auto-generated catch block
+			e1.printStackTrace();
+		}
+		log.info(DCWormsConstants.USAGE_MEASURE_NAME + ": " + calculateTotalLoad(jobRegistry.getRunningTasks().size()));
 		
 		PEUnit peUnit = (PEUnit)choosenResources.get(StandardResourceUnitName.PE);
@@ -348,5 +275,5 @@
 			ProcessingElements pes = (ProcessingElements) peUnit;
 			for (ComputingResource resource : pes) {
-				resource.handleEvent(new EnergyEvent(EnergyEventType.TASK_FINISHED, submittedTask));
+				resource.handleEvent(new EnergyEvent(EnergyEventType.TASK_FINISHED, exec));
 			}
 		} else {
@@ -357,5 +284,5 @@
 				
 			}
-			resource.handleEvent(new EnergyEvent(EnergyEventType.TASK_FINISHED, submittedTask));
+			resource.handleEvent(new EnergyEvent(EnergyEventType.TASK_FINISHED, exec));
 		}
 		/*ProcessingElements pes = (ProcessingElements) choosenResources.get(StandardResourceUnitName.PE);
@@ -371,10 +298,15 @@
 	}
 	
-	public void finalizeExecutable(ExecTask exec){
-		
-		SubmittedTask subTask = (SubmittedTask)exec;
-		subTask.setGridletStatus(Gridlet.SUCCESS);
-		subTask.finalizeGridlet();
-		UsedResourceList<ResourceHistoryItem> lastUsedList = subTask.getUsedResources();
+	public void finalizeExecutable(ExecTask execTask){
+		
+		Executable exec = (Executable)execTask;
+		try {
+			exec.setStatus(DCWormsTags.SUCCESS);
+		} catch (Exception e1) {
+			// TODO Auto-generated catch block
+			e1.printStackTrace();
+		}
+		exec.finalizeExecutable();
+		UsedResourceList<ResourceHistoryItem> lastUsedList = exec.getUsedResources();
 		Map<ResourceUnitName, ResourceUnit> lastUsed = lastUsedList.getLast()
 				.getResourceUnits();
@@ -385,5 +317,5 @@
 			ProcessingElements pes = (ProcessingElements) peUnit;
 			for (ComputingResource resource : pes) {
-				resource.handleEvent(new EnergyEvent(EnergyEventType.TASK_FINISHED, subTask));
+				resource.handleEvent(new EnergyEvent(EnergyEventType.TASK_FINISHED, exec));
 			}
 		} else {
@@ -394,5 +326,5 @@
 				
 			}
-			resource.handleEvent(new EnergyEvent(EnergyEventType.TASK_FINISHED, subTask));
+			resource.handleEvent(new EnergyEvent(EnergyEventType.TASK_FINISHED, exec));
 		}
 		/*ProcessingElements pes = (ProcessingElements) lastUsed.get(StandardResourceUnitName.PE);
@@ -400,19 +332,19 @@
 			resource.handleEvent(new EnergyEvent(EnergyEventType.TASK_FINISHED, subTask));
 		}*/
-		SubTaskFilter filter = new SubTaskFilter(subTask.getGridletID(), WormsTags.TASK_REQUESTED_TIME_EXPIRED);
+		ExecTaskFilter filter = new ExecTaskFilter(exec.getUniqueId(), DCWormsTags.TASK_REQUESTED_TIME_EXPIRED);
 		scheduler.sim_cancel(filter, null);
 		
-		Executable executable = (Executable) subTask.getGridlet();
-		Job job = jobRegistry.getJob(executable.getJobId());
+
+		Job job = jobRegistry.getJob(exec.getJobId());
 
 		Task task = null;
 		try {
-			task = job.getTask(executable.getTaskId());
+			task = job.getTask(exec.getTaskId());
 		} catch (NoSuchFieldException e) {
 			e.printStackTrace();
 		}
-		if(executable.getProcessesId() == null){
+		if(exec.getProcessesId() == null){
 			try {
-				task.setStatus(executable.getStatus());
+				task.setStatus(exec.getStatus());
 			} catch (Exception e) {
 				e.printStackTrace();
@@ -422,6 +354,6 @@
 			for(int i = 0; i < processesList.size(); i++){
 				AbstractProcesses processes = processesList.get(i);
-				if(processes.getId().equals(executable.getProcessesId())){
-					processes.setStatus(executable.getStatus());
+				if(processes.getId().equals(exec.getProcessesId())){
+					processes.setStatus(exec.getStatus());
 					break;
 				}
@@ -441,11 +373,11 @@
 		while (iter.hasNext()) {
 			ExecTask task = iter.next();
-			SubmittedTask subTask = (SubmittedTask)task;
-			UsedResourceList<ResourceHistoryItem> usedResourcesList = subTask.getUsedResources();
+			Executable exec = (Executable)task;
+			UsedResourceList<ResourceHistoryItem> usedResourcesList = exec.getUsedResources();
 			ResourceUnit unit = usedResourcesList.getLast().getResourceUnits()
 					.get(StandardResourceUnitName.PE);
 
 			double load = getMIShare(timeSpan, (PEUnit) unit);
-			subTask.updateGridletFinishedSoFar(load);
+			exec.setCompletionPercentage(100 * timeSpan/exec.getEstimatedDuration());
 			addTotalLoad(load);
 		}
@@ -471,6 +403,6 @@
 		updateProcessingProgress();
 		for (ExecTask task : jobRegistry.getRunningTasks()) {
-			SubmittedTask subTask = (SubmittedTask)task;
-			List<String> visitedResource = subTask.getVisitedResources();
+			Executable exec = (Executable)task;
+			List<String> visitedResource = exec.getVisitedResources();
 			String originResource = ev.get_data().toString();
 			if(!ArrayUtils.contains(visitedResource.toArray(new String[visitedResource.size()]), originResource)){
@@ -478,8 +410,8 @@
 			}
 			
-			Map<ResourceUnitName, ResourceUnit> choosenResources = subTask.getUsedResources().getLast().getResourceUnits();
-			double completionPercentage = (task.getLength() - subTask.getRemainingGridletLength())/task.getLength();
+			Map<ResourceUnitName, ResourceUnit> choosenResources = exec.getUsedResources().getLast().getResourceUnits();
+			//double completionPercentage = (task.getLength() - subTask.getRemainingGridletLength())/task.getLength();
 			double time = execTimeEstimationPlugin.execTimeEstimation(new SchedulingEvent(SchedulingEventType.RESOURCE_STATE_CHANGED), 
-					task, choosenResources, completionPercentage);
+					task, choosenResources, exec.getCompletionPercentage());
 
 			/*if(!subTask.getVisitedResources().contains(ev.get_data().toString())) {
@@ -487,10 +419,10 @@
 			}*/
 			//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){
+			if( DoubleMath.subtract((exec.getExecStartTime() + exec.getEstimatedDuration()), (new DateTime().getMillis()/1000 + time)) == 0.0){
 				continue;
 			}
-			SubTaskFilter filter = new SubTaskFilter(subTask.getGridletID(), WormsTags.TASK_EXECUTION_FINISHED);
+			ExecTaskFilter filter = new ExecTaskFilter(exec.getUniqueId(), DCWormsTags.TASK_EXECUTION_FINISHED);
 			scheduler.sim_cancel(filter, null);
-			scheduler.sendInternal(time, WormsTags.TASK_EXECUTION_FINISHED, task);
+			scheduler.sendInternal(time, DCWormsTags.TASK_EXECUTION_FINISHED, task);
 
 		}
@@ -577,63 +509,13 @@
 			}
 
-			/*try {
-				List<? extends ComputingResource> processingElements = resourceManager.getResourcesOfType(StandardResourceType.Processor);
-				List<ComputingResource> choosenResources = new ArrayList<ComputingResource>();
-				int peSize = processingElements.size();
-				for (int i = 0; i < peSize && cpuRequest > 0; i++) {
-					if (processingElements.get(i).getStatus() == ResourceStatus.FREE) {
-						choosenResources.add(processingElements.get(i));
-						cpuRequest--;
-					}
-				}
-				if (cpuRequest > 0)
-				{	
-					return null;
-				}
-				processingUnits = new ProcessingElements(choosenResources);
-			} catch (Exception e) {
-	
-				List<ResourceUnit> procResUnit = resourceManager.getDistributedResourceUnits(StandardResourceUnitName.PE);
-
-				for(ResourceUnit resUnit: procResUnit){
-					if (resUnit.getFreeAmount() >= cpuRequest)
-					{	
-						processingUnits = new PEUnit(resUnit.getResourceId(), cpuRequest, cpuRequest);
-						break;
-					} 
-				}
-			}*/
 			map.put(StandardResourceUnitName.PE, choosenPEUnits.get(0));
 		}
-		/*int memoryRequest;
-		try {
-			memoryRequest = Double.valueOf(task.getMemoryRequest()).intValue();
-		} catch (NoSuchFieldException e) {
-			memoryRequest = 0;
-		}
-		if (memoryRequest != 0) {
-			List<ResourceUnit> resUnit = resourceManager.getSharedResourceUnits().get(StandardResourceUnitName.MEMORY);
-
-			Memory memory = null;
-			for (ResourceUnit memUnit : resUnit) {
-				Memory m = (Memory) memUnit;
-
-				if (m.getFreeAmount() >= memoryRequest) {	
-					System.out.println(m.getResourceId()+ ";"+m.getAmount()+";"+m.getFreeAmount());
-					memory = new Memory(m, memoryRequest, memoryRequest);
-				}
-			}
-			if(memory == null)
-				return null;
-			map.put(StandardResourceUnitName.MEMORY, memory);
-		}*/
+
 		return  map;
 	}
-
-
-	
-	public void notifySubmittedWorkloadUnit(WorkloadUnit job, boolean ack) {
+	
+	public void notifySubmittedWorkloadUnit(WorkloadUnit wu, boolean ack) {
 		updateProcessingProgress();
-		registerWorkloadUnit(job);
+		registerWorkloadUnit(wu);
 	}
 
@@ -654,6 +536,6 @@
 			List<JobInterface<?>> jobsList = new ArrayList<JobInterface<?>>();
 			jobsList.add(job);
-			WorkloadUnitListImpl readyTasks = new WorkloadUnitListImpl();
-			for(Task task: jobRegistry.getReadyTasks(jobsList)){
+			TaskListImpl readyTasks = new TaskListImpl();
+			for(Task task: jobRegistry.getAvailableTasks(jobsList)){
 				task.setStatus((int)BrokerConstants.TASK_STATUS_QUEUED);
 				readyTasks.add(task);
@@ -667,17 +549,13 @@
 		public void handleTask(TaskInterface<?> ti){
 			Task task = (Task)ti;
-			
-			if(task.getProcesses() == null){
+			List<AbstractProcesses> processes = task.getProcesses();
+
+			if(processes == null || processes.size() == 0){
 				Executable exec = new Executable(task);
-				exec.setUserID(task.getSenderId());
-				exec.setLength(task.getLength());
 				registerWorkloadUnit(exec);
 			} else {
-				List<AbstractProcesses> processesList = task.getProcesses();
-				for(int i = 0; i < processesList.size(); i++){	
-					AbstractProcesses processes = processesList.get(i);
-					Executable exec = new Executable(task, processes);
-					exec.setUserID(task.getSenderId());
-					exec.setLength(task.getLength());
+				for(int j = 0; j < processes.size(); j++){
+					AbstractProcesses procesesSet = processes.get(j);
+					Executable exec = new Executable(task, procesesSet);
 					registerWorkloadUnit(exec);
 				}
@@ -701,34 +579,13 @@
 			}
 			
-			exec.setResourceParameter(scheduler.get_id(), 1);
-			SubmittedTask subTask = new SubmittedTask(exec);
-			jobRegistry.addTask(subTask);
-			WorkloadUnitListImpl newTasks = new WorkloadUnitListImpl();
-			newTasks.add(subTask);
-		
-			schedulingPlugin.placeJobsInQueues(newTasks, queues, getResourceManager(), moduleList);
-
-			if (subTask.getStatus() == Gridlet.QUEUED) {
+			exec.setSchedulerName(scheduler.get_id());
+			jobRegistry.addExecTask(exec);
+			TaskListImpl newTasks = new TaskListImpl();
+			newTasks.add(exec);
+		
+			schedulingPlugin.placeTasksInQueues(newTasks, queues, getResourceManager(), moduleList);
+
+			if (exec.getStatus() == DCWormsTags.QUEUED) {
 				sendExecutableReadyEvent(exec);
-			}
-		}
-		
-		public void handleSubmittedTask(SubmittedTask task){
-
-			task.visitResource(scheduler.get_name());
-			Scheduler parentScheduler = scheduler.getParent();
-			while (parentScheduler != null && !task.getVisitedResources().contains(parentScheduler.get_name())) {
-				task.visitResource(parentScheduler.get_name());
-				parentScheduler = parentScheduler.getParent();
-			}
-
-			jobRegistry.addTask(task);
-			WorkloadUnitListImpl newTasks = new WorkloadUnitListImpl();
-			newTasks.add(task);
-		
-			schedulingPlugin.placeJobsInQueues(newTasks, queues, getResourceManager(), moduleList);
-
-			if (task.getStatus() == Gridlet.QUEUED) {
-				sendExecutableReadyEvent(task);
 			}
 		}
Index: /DCWoRMS/trunk/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 481)
@@ -19,5 +19,4 @@
 public class GridBroker extends GlobalManagementSystem { 
 
-	
 	private static Log log = LogFactory.getLog(GridBroker.class);
 
@@ -27,25 +26,11 @@
 	public GridBroker(String name, SchedulingPlugin schedulingPlugin, ExecutionTimeEstimationPlugin execTimeEstimationPlugin, TaskQueueList queues) throws Exception {
 		super(name, "BROKER",  schedulingPlugin, execTimeEstimationPlugin, queues);
-		
-		//make use of plug-in interface
-		
-		//Properties prop = new Properties();
-		//prop.put("plugin.name", name);
-		//prop.put("plugin.utils.timeoperations", "gssim.scheduling.plugin.local.GssimTimeOperations");
-		//schedulingPlugin.init(prop);
+
 		otherGridSchedulersIds = new HashSet<Integer>();
-		
 		moduleList = new ModuleListImpl(2);
-		//this.moduleList.add(new GridResourceDiscovery(this.getScheduler()));
-		//moduleList.add(new GridReservationManagerNew(this));
-		
-		if(log.isDebugEnabled())
-			log.debug(name + ": Creating a broker interface object");
 	}
 
 	public void init(Scheduler scheduler, ManagedResources managedResources) {
 		super.init(scheduler, managedResources);
-		//this.scheduler = scheduler;
-		//this.resourceManager = ResourceManagerFactory.createResourceManager(scheduler, managedResources);
 		this.moduleList.add((GridResourceDiscovery)resourceManager);
 	}
@@ -57,5 +42,4 @@
 		}
 		return providerIds;
-		//return GridSim.getGridResourceList();
 	}
 
Index: /DCWoRMS/trunk/src/schedframe/scheduling/policy/global/GlobalManagementSystem.java
===================================================================
--- /DCWoRMS/trunk/src/schedframe/scheduling/policy/global/GlobalManagementSystem.java	(revision 480)
+++ /DCWoRMS/trunk/src/schedframe/scheduling/policy/global/GlobalManagementSystem.java	(revision 481)
@@ -12,13 +12,9 @@
 
 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.TaskListImpl;
 import schedframe.scheduling.plan.AllocationInterface;
 import schedframe.scheduling.plan.ScheduledTaskInterface;
@@ -31,15 +27,12 @@
 import schedframe.scheduling.tasks.Job;
 import schedframe.scheduling.tasks.JobInterface;
-import schedframe.scheduling.tasks.SubmittedTask;
 import schedframe.scheduling.tasks.Task;
 import schedframe.scheduling.tasks.TaskInterface;
 import schedframe.scheduling.tasks.WorkloadUnit;
-
 import eduni.simjava.Sim_event;
 import gridsim.GridSim;
 import gridsim.GridSimTags;
-import gridsim.Gridlet;
 import gridsim.IO_data;
-import gridsim.gssim.WormsTags;
+import gridsim.gssim.DCWormsTags;
 import gssim.schedframe.scheduling.ExecTask;
 import gssim.schedframe.scheduling.Executable;
@@ -54,7 +47,4 @@
 		super(providerId, entityName,  execTimeEstimationPlugin, queues);
 
-		/*schedulingPlugin = (GlobalSchedulingPlugin) InstanceFactory.createInstance(
-				schedulingPluginClassName,
-				GlobalSchedulingPlugin.class);*/
 		if(schedPlugin == null){
 			throw new Exception("Can not create global scheduling plugin instance");
@@ -69,8 +59,8 @@
 		switch (tag) {
 
-		case WormsTags.TIMER:
-			if (pluginSupportsEvent(WormsTags.TIMER)) {
+		case DCWormsTags.TIMER:
+			if (pluginSupportsEvent(DCWormsTags.TIMER)) {
 				TimerEvent event = new  TimerEvent();
-				SchedulingPlanInterface decision =  schedulingPlugin.schedule(event, 
+				SchedulingPlanInterface<?> decision =  schedulingPlugin.schedule(event, 
 						queues,  getJobRegistry(), getResourceManager(), moduleList);
 				executeSchedulingPlan(decision);
@@ -114,11 +104,11 @@
 	
 
-	protected void scheduleReadyTasks(Job job){
+	protected void scheduleAvaialbleTasks(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);
-
+		TaskListImpl readyTasks = new TaskListImpl();
+		readyTasks.addAll(jobRegistry.getAvailableTasks(jobsList));
+		
+		schedulingPlugin.placeTasksInQueues(readyTasks, queues, getResourceManager(), moduleList);
 		schedule(new TaskArrivedEvent());
 	}
@@ -126,15 +116,8 @@
 	protected void schedule(SchedulingEvent schedulingEvent) {
 
-		try {
-			SchedulingPlanInterface decision = schedulingPlugin.schedule(
-					schedulingEvent, queues, getJobRegistry(),  getResourceManager(), moduleList);
-			if (decision == null)
-				return;
-
+		SchedulingPlanInterface<?> decision = schedulingPlugin.schedule(
+				schedulingEvent, queues, getJobRegistry(),  getResourceManager(), moduleList);
+		if (decision != null)
 			executeSchedulingPlan(decision);
-
-		} catch (Exception e) {
-			e.printStackTrace();
-		}
 	}
 	
@@ -173,5 +156,5 @@
 			}
 			else {
-				scheduleReadyTasks(job);
+				scheduleAvaialbleTasks(job);
 				/*List<JobInterface<?>> jobs = new ArrayList<JobInterface<?>>();
 				jobs.add(jobRegistry.getJobInfo(job.getId()));
@@ -189,67 +172,91 @@
 	}
 
-	public void notifyCanceledWorkloadUnit(WorkloadUnit wu){;
-
-		Executable task = (Executable) wu;
-		String jobID = task.getJobId();
-		String taskID = task.getId();
-		
-		if(log.isDebugEnabled())
-			log.debug("Received canceled job" + jobID + "_" + taskID);
-		
-		TaskInterface<?> ti = jobRegistry.getTaskInfo(jobID, taskID) ;
-		try {
-
-			ti.setStatus((int)BrokerConstants.JOB_STATUS_CANCELED);
-			
-			TaskCanceledEvent event = new TaskCanceledEvent(jobID, taskID);
-			event.setReason(EventReason.RESERVATION_EXCEEDED);
-			schedule(event);
-			
-		} catch (Exception e) {
-			log.error("Exception during scheduling. " + e.getMessage());
-			e.printStackTrace();
-		}
-	}
-	
-	protected void executeSchedulingPlan(SchedulingPlanInterface decision) {
-
-		ArrayList<ScheduledTaskInterface> taskSchedulingDecisions = decision.getTasks();
+	protected void executeSchedulingPlan(SchedulingPlanInterface<?> decision) {
+
+		ArrayList<ScheduledTaskInterface<?>> taskSchedulingDecisions = decision.getTasks();
 		for (int i = 0; i < taskSchedulingDecisions.size(); i++) {
 
-			try {
-				ScheduledTaskInterface taskDecision = taskSchedulingDecisions.get(i);
-	
-				//log.info(decision.getDocument());
-	
-				String jobID = taskDecision.getJobId();
-				String taskID = taskDecision.getTaskId();
-				
-				// Task allocations that were rejected because of lack of resources or which were canceled and 
-				// not scheduled again are returned to the user.
-				if(taskDecision.getStatus() == AllocationStatus.REJECTED){
-					Job job = jobRegistry.getJob(jobID);
-					scheduler.send(job.getSenderId(), GridSimTags.SCHEDULE_NOW, GridSimTags.GRIDLET_RETURN, job);
-					continue;
-				}
-				
-				ArrayList<AllocationInterface> allocations = taskDecision.getAllocations();
-
-				Task task = (Task) jobRegistry.getTaskInfo(jobID, taskID);
-				for (int j = 0; j < allocations.size(); j++) {
-
-					AllocationInterface allocation = allocations.get(j);
-					Executable exec = jobRegistry.createExecutable(task, allocation);
-					submitWorkloadUnit(exec, allocation);
-					task.setStatus((int)BrokerConstants.TASK_STATUS_QUEUED);
-				}								
-
-			}catch (Exception e){
-				e.printStackTrace();
-			}
-		}
-	}
-
-	protected void submitWorkloadUnit(WorkloadUnit job, AllocationInterface allocation) {
+			ScheduledTaskInterface<?> taskDecision = taskSchedulingDecisions.get(i);
+
+			//log.info(decision.getDocument());
+
+			String jobID = taskDecision.getJobId();
+			String taskID = taskDecision.getTaskId();
+			
+			// Task allocations that were rejected because of lack of resources or which were canceled and 
+			// not scheduled again are returned to the user.
+			if(taskDecision.getStatus() == AllocationStatus.REJECTED){
+				Job job = jobRegistry.getJob(jobID);
+				scheduler.send(job.getSenderId(), GridSimTags.SCHEDULE_NOW, GridSimTags.GRIDLET_RETURN, job);
+				continue;
+			}
+			
+			Task task = (Task) jobRegistry.getTaskInfo(jobID, taskID);
+			
+			ArrayList<AllocationInterface<?>> allocations = taskDecision.getAllocations();
+			for (int j = 0; j < allocations.size(); j++) {
+
+				AllocationInterface<?> allocation = allocations.get(j);
+				Executable exec = createExecutable(task, allocation);
+				submitTask(exec, allocation);
+				task.setStatus((int)BrokerConstants.TASK_STATUS_QUEUED);
+			}								
+		}
+	}
+
+	private Executable createExecutable(Task task, AllocationInterface<?> allocation) {
+
+		String refersTo = allocation.getProcessGroupId(); // null;//allocation.getRefersTo();
+		if(refersTo == null)
+			refersTo = task.getId();
+			
+		Executable exec = null;
+
+		if(refersTo.equals(task.getId())){
+			exec = new Executable(task);
+		} else {
+			List<AbstractProcesses> processes = task.getProcesses();
+			if(processes == null) {
+				try {
+					log.error("Allocation: " + allocation.getDocument() + "\nrefers to unknown task or processes set." +
+							" Set correct value (task id or prcesses set id) for allocation refersTo attribute.");
+				} catch (Exception e) {
+					e.printStackTrace();
+				}
+			}
+			boolean found = false;
+			for(int j = 0; j < processes.size() && !found; j++){
+				AbstractProcesses procesesSet = processes.get(j);
+				if(refersTo.equals(procesesSet.getId())){
+					exec = new Executable(task, procesesSet);
+					found = true;
+				}
+			}
+			if(!found){
+				log.error("Allocation refers to unknown proceses set.");
+			}
+		}
+
+		exec.setReservationId(allocation.getReservationId());
+			
+		/*HostInterface<?> host = allocation.getHost();
+		ComputingResourceTypeInterface<?> crt = host.getMachineParameters();
+		if(crt != null){
+			ComputingResourceTypeItemInterface<?> crti = crt.getComputingResourceTypeItem(0);
+			if(crti != null){
+				ParameterPropertyInterface<?> properties[] = crti.getHostParameter().getProperty();
+				for(int p = 0; p < properties.length; p++){
+					ParameterPropertyInterface<?> property = properties[p];
+					if("chosenCPUs".equals(property.getName())){
+						Object cpuNames = property.getValue();
+						exec.addSpecificResource(ResourceParameterName.FREECPUS, cpuNames);
+					}
+				}
+			}
+		}*/
+		return exec;
+	}
+	
+	protected void submitTask(TaskInterface<?> task, AllocationInterface<?> allocation) {
 
 		String providerName = allocation.getProviderName();
@@ -257,14 +264,13 @@
 			return;
 		}
-		TaskInterface<?> task = (TaskInterface<?>) job;
 		removeFromQueue(task);
 		
 		int resID = GridSim.getEntityId(providerName);
-		IO_data data = new IO_data(job, 0, resID);
+		IO_data data = new IO_data(task, 0, resID);
 		scheduler.send(scheduler.getOutputPort(), GridSimTags.SCHEDULE_NOW, GridSimTags.GRIDLET_SUBMIT, data);	
 		
 		//scheduler.send(providerName, GridSimTags.SCHEDULE_NOW, GridSimTags.GRIDLET_SUBMIT, job);			
 		if(log.isDebugEnabled())
-			log.debug("Submitted job " + job.getId() + " to " + providerName);
+			log.debug("Submitted job " + task.getId() + " to " + providerName);
 
 	}
@@ -274,9 +280,9 @@
 		public void handleJob(Job job){
 
-			jobRegistry.addJob(job);
 			if (log.isInfoEnabled())
 				log.info("Received job " + job.getId() + " at " + new DateTime(DateTimeUtilsExt.currentTimeMillis()));
 
-			scheduleReadyTasks(job);
+			jobRegistry.addJob(job);
+			scheduleAvaialbleTasks(job);
 		}
 		
@@ -289,7 +295,4 @@
 		}
 
-		public void handleSubmittedTask(SubmittedTask task) {
-			throw new RuntimeException("Not implemented since it isn't expected that tasks are send directly to the global scheduler.");
-		}
 	}
 
@@ -297,5 +300,4 @@
 		return new GlobalWorkloadUnitHandler();
 	}
-	
 
 
Index: /DCWoRMS/trunk/src/schedframe/scheduling/TaskListImpl.java
===================================================================
--- /DCWoRMS/trunk/src/schedframe/scheduling/TaskListImpl.java	(revision 481)
+++ /DCWoRMS/trunk/src/schedframe/scheduling/TaskListImpl.java	(revision 481)
@@ -0,0 +1,19 @@
+package schedframe.scheduling;
+
+import java.util.ArrayList;
+
+import schedframe.scheduling.tasks.TaskInterface;
+
+
+public class TaskListImpl extends ArrayList<TaskInterface<?>> implements TaskList {
+
+	private static final long serialVersionUID = -3824600938144742457L;
+
+	public TaskListImpl(){
+		super();
+	}
+	
+	public TaskListImpl(int initialSize){
+		super(initialSize);
+	}	
+}
Index: /DCWoRMS/trunk/src/schedframe/scheduling/WorkloadUnitHandler.java
===================================================================
--- /DCWoRMS/trunk/src/schedframe/scheduling/WorkloadUnitHandler.java	(revision 477)
+++ /DCWoRMS/trunk/src/schedframe/scheduling/WorkloadUnitHandler.java	(revision 481)
@@ -2,5 +2,5 @@
 
 import schedframe.scheduling.tasks.Job;
-import schedframe.scheduling.tasks.SubmittedTask;
+
 import schedframe.scheduling.tasks.TaskInterface;
 import gssim.schedframe.scheduling.ExecTask;
@@ -13,5 +13,4 @@
 	
 	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 481)
@@ -13,5 +13,5 @@
 import gridsim.GridSimTags;
 import gridsim.IO_data;
-import gridsim.gssim.WormsTags;
+import gridsim.gssim.DCWormsTags;
 
 public class Cluster extends Scheduler{
@@ -23,5 +23,5 @@
 	protected void processOtherRequest(Sim_event ev) {
 		switch (ev.get_tag()) {
-		case WormsTags.QUERY_RESOURCE_DESC:
+		case DCWormsTags.QUERY_RESOURCE_DESC:
 			SchedulerDescription desc = new SchedulerDescription(new LocalSystem(get_name(), null, null));
 			Map<ResourceUnitName, List<ResourceUnit>> units = managementSystem.getResourceManager().getSharedResourceUnits();
@@ -30,5 +30,5 @@
 
 			IO_data data = new IO_data(desc, 0, ev.get_src());
-			send(ev.get_src(), GridSimTags.SCHEDULE_NOW, WormsTags.QUERY_RESOURCE_DESC_RESULT, data);
+			send(ev.get_src(), GridSimTags.SCHEDULE_NOW, DCWormsTags.QUERY_RESOURCE_DESC_RESULT, data);
 			break;
 
Index: /DCWoRMS/trunk/src/schedframe/scheduling/GridResourceDiscovery.java
===================================================================
--- /DCWoRMS/trunk/src/schedframe/scheduling/GridResourceDiscovery.java	(revision 477)
+++ /DCWoRMS/trunk/src/schedframe/scheduling/GridResourceDiscovery.java	(revision 481)
@@ -5,5 +5,5 @@
 import gridsim.GridSimTags;
 import gridsim.IO_data;
-import gridsim.gssim.WormsTags;
+import gridsim.gssim.DCWormsTags;
 
 import java.util.ArrayList;
@@ -58,9 +58,9 @@
 		for(int i = 0; i < resourceList.size(); i++){
 			int resourceId = resourceList.get(i).get_id();
-			gridBroker.send(resourceId, GridSimTags.SCHEDULE_NOW, WormsTags.QUERY_RESOURCE_DESC, null);
+			gridBroker.send(resourceId, GridSimTags.SCHEDULE_NOW, DCWormsTags.QUERY_RESOURCE_DESC, null);
 		}
 		
 		//filter only the query response messages
-		Sim_type_p pred = new Sim_type_p(WormsTags.QUERY_RESOURCE_DESC_RESULT);
+		Sim_type_p pred = new Sim_type_p(DCWormsTags.QUERY_RESOURCE_DESC_RESULT);
 		Sim_event ev = new Sim_event();
 		
@@ -80,9 +80,9 @@
 		for(int i = 0; i < gridBroker.getChildren().size(); i++){
 			int resourceId = gridBroker.getChildren().get(i).get_id();
-			gridBroker.send(resourceId, GridSimTags.SCHEDULE_NOW, WormsTags.QUERY_RESOURCE_DESC, null);
+			gridBroker.send(resourceId, GridSimTags.SCHEDULE_NOW, DCWormsTags.QUERY_RESOURCE_DESC, null);
 		}
 		
 		//filter only the query response messages
-		Sim_type_p pred = new Sim_type_p(WormsTags.QUERY_RESOURCE_DESC_RESULT);
+		Sim_type_p pred = new Sim_type_p(DCWormsTags.QUERY_RESOURCE_DESC_RESULT);
 		Sim_event ev = new Sim_event();
 		
Index: /DCWoRMS/trunk/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 481)
@@ -5,4 +5,5 @@
 import java.util.List;
 
+import schedframe.ExecutablesList;
 import schedframe.scheduling.tasks.JobInterface;
 import schedframe.scheduling.tasks.TaskInterface;
@@ -11,8 +12,4 @@
 public interface JobRegistry {
 
-	//public List<JobInterface<?>> getActiveJobs();
-
-	//public List<TaskInterface<?>> getActiveTasks();
-	
 	public JobInterface<?> getJobInfo(String jobId);
 
@@ -31,10 +28,10 @@
 
 
-	//public List<SubmittedTask> getSubmittedTasks();
+	public ExecutablesList getExecutableTasks(); 
 	
-	public ExecTask getSubmittedTask(String jobId, String taskId);
+	public ExecTask getExecutable(String jobId, String taskId);
 
 	
-	public List<? extends TaskInterface<?>> getReadyTasks(List<JobInterface<?>> jobsList);
+	public List<? extends TaskInterface<?>> getAvailableTasks(List<JobInterface<?>> jobsList);
 
 }
Index: /DCWoRMS/trunk/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 481)
@@ -1,31 +1,20 @@
 package schedframe.scheduling.manager.tasks;
 
-import gridsim.Gridlet;
+import gridsim.gssim.DCWormsTags;
 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.ExecutablesList;
 import schedframe.scheduling.tasks.JobInterface;
-import schedframe.scheduling.tasks.SubmittedTask;
 import schedframe.scheduling.tasks.Task;
-import simulator.WormsConstants;
 
 public class JobRegistryImpl extends AbstractJobRegistry {
@@ -37,21 +26,17 @@
 	private String context;
 
-	//TO DO - change data structure
-	protected static final List<ExecTask> submittedTasks = Collections.synchronizedList(new ArrayList<ExecTask>());;
-	//protected static final List<ExecTaskInterface> submittedTasks = new CopyOnWriteArrayList<ExecTaskInterface>();
+	//TO DO - consider data structure
+	protected static final ExecutablesList executables = new ExecutablesList();
+	//protected static final List<ExecTask> executables = Collections.synchronizedList(new ArrayList<ExecTask>());;
+	//protected static final List<ExecTaskInterface> executables = new CopyOnWriteArrayList<ExecTaskInterface>();
 
-	public JobRegistryImpl(String context_) {
-		context = context_;
+	public JobRegistryImpl(String context) {
+		this.context = context;
 	}
 
-	/*protected void setContext(String context_) {
-		context = context_;
-	}*/
-
-	public boolean addTask(ExecTask newTask) {
-		if(getSubmittedTask(newTask.getJobId(), newTask.getId()) == null)
-		{
-			synchronized (submittedTasks)  {
-				submittedTasks.add(newTask);
+	public boolean addExecTask(ExecTask newTask) {
+		if(getExecutable(newTask.getJobId(), newTask.getId()) == null) {
+			synchronized (executables)  {
+				executables.add(newTask);
 			}
 			return true;
@@ -60,17 +45,16 @@
 	}
 
+	public ExecutablesList getExecutableTasks() {
+		return executables;
+	}
 	public List<ExecTask> getTasks(int status) {
 		List<ExecTask> taskList = new ArrayList<ExecTask>();
-		synchronized (submittedTasks)  {
-			for (ExecTask task: submittedTasks) {
+		synchronized (executables)  {
+			for (ExecTask task: executables) {
 				if (task.getStatus() == status) {
-					//SubmittedTask subTask = (SubmittedTask) task;
 					List<String> visitedResource = task.getVisitedResources();
-					if(ArrayUtils.contains(visitedResource.toArray(new String[visitedResource.size()]), context)){
+					if(ArrayUtils.contains(visitedResource.toArray(new String[visitedResource.size()]), context)) {
 						taskList.add(task);
 					}
-					/*if(subTask.getVisitedResources().contains(context)){
-						taskList.add(subTask);
-					}*/
 				}
 			}
@@ -80,48 +64,22 @@
 
 	public List<ExecTask> getQueuedTasks() {
-		return getTasks(Gridlet.QUEUED);
+		return getTasks(DCWormsTags.QUEUED);
 	}
 	
 	public List<ExecTask> getRunningTasks() {
-		return getTasks(Gridlet.INEXEC);
+		return getTasks(DCWormsTags.INEXEC);
 	}
 	
 	public List<ExecTask> getReadyTasks() {
-		return getTasks(Gridlet.READY);
+		return getTasks(DCWormsTags.READY);
 	}
 	
 	public List<ExecTask> getFinishedTasks() {
-		return getTasks(Gridlet.SUCCESS);
+		return getTasks(DCWormsTags.SUCCESS);
 	}
 	
-	
-	public List<ExecTask> getAllSubmittedTasks() {
-		List<ExecTask> taskList;
-		synchronized (submittedTasks)  {
-			taskList = new ArrayList<ExecTask>(submittedTasks);
-		}
-		return taskList;
-	}
-
-	public List<SubmittedTask> getSubmittedTasks() {
-		List<SubmittedTask> taskList = new ArrayList<SubmittedTask>();
-		synchronized (submittedTasks)  {
-			for (ExecTask task : submittedTasks) {
-				SubmittedTask subTask = (SubmittedTask) task;
-				List<String> visitedResource = subTask.getVisitedResources();
-				if(ArrayUtils.contains(visitedResource.toArray(new String[visitedResource.size()]), context)){
-					taskList.add(subTask);
-				}
-				/*if(subTask.getVisitedResources().contains(context)){
-					taskList.add(subTask);
-				}*/
-			}
-		}
-		return taskList;
-	}
-	
-	public ExecTask getSubmittedTask(String jobId, String taskId){
-		synchronized (submittedTasks)  {
-			for (ExecTask task : submittedTasks) {
+	public ExecTask getExecutable(String jobId, String taskId){
+		synchronized (executables)  {
+			for (ExecTask task : executables) {
 				if (task.getJobId().compareTo(jobId) == 0 && task.getId().compareTo(taskId)==0) {
 					return task;
@@ -131,9 +89,8 @@
 		return null;
 	}
-	
 
 	@SuppressWarnings("unchecked")
-	public List<Task> getReadyTasks(List<JobInterface<?>> wuList) {
-		List<Task> readyTasks = new ArrayList<Task>();
+	public List<Task> getAvailableTasks(List<JobInterface<?>> wuList) {
+		List<Task> availableTasks = new ArrayList<Task>();
 		List<Task> waitingTasks = new ArrayList<Task>();
 		
@@ -143,195 +100,17 @@
 		}
 
-		readyTasks.addAll(getPrecedenceConstrainedReadyTasks(waitingTasks));
-		return readyTasks;
-	}
-	
-	public Executable getTaskExecutable(Integer executableId){
-		synchronized (submittedTasks)  {
-			for (ExecTask task : submittedTasks) {
-				SubmittedTask subTask = (SubmittedTask) task;
-				Executable exec = (Executable)subTask.getGridlet();
-				if (exec.getGridletID() == executableId) {
-					return exec;
-				}
-			}
-		}
-		return null;
-	}
-	
-	public List<Executable> getJobExecutables(String jobId){
-		List<Executable> list = new ArrayList<Executable>();
-		synchronized (submittedTasks)  {
-			for(int i = 0; i < submittedTasks.size(); i++){
-				SubmittedTask subTask = (SubmittedTask) submittedTasks.get(i);
-				Executable exec = (Executable)subTask.getGridlet();
-				
-				if(exec.getJobId().equals(jobId))
-					list.add(exec);
-			}
-		}
-		return list;
-	}
-	
-	public JobRegistryImpl clone() {
-		JobRegistryImpl jr = null;
-		try {
-			jr = (JobRegistryImpl) super.clone();
-		} catch (CloneNotSupportedException e) {
-			// TODO Auto-generated catch block
-			e.printStackTrace();
-		}
-
-		return jr;
-	}
-
-	/*public AbstractExecutable getTaskExecutabls(String jobId, String taskId){
-		List<AbstractExecutable> list = new ArrayList<AbstractExecutable>();
-		synchronized (submittedTasks)  {
-			for(int i = 0; i < size(); i++){
-				SubmittedTask subTask = (SubmittedTask) submittedTasks.get(i);
-				AbstractExecutable exec = (AbstractExecutable)subTask.getGridlet();
-				
-				if(exec.getJobId().equals(jobId) && exec.getId().equals(taskId))
-					return exec;
-			}
-		}
-		return null;
-	}*/
-	
-	
-	public Executable createExecutable(Task task, AllocationInterface allocation) {
-
-		String refersTo = allocation.getProcessGroupId(); // null;//allocation.getRefersTo();
-		if(refersTo == null)
-			refersTo = task.getId();
-			
-		Executable exec = null;
-
-		if(refersTo.equals(task.getId())){
-			exec = new Executable(task);
-		} else {
-			List<AbstractProcesses> processes = task.getProcesses();
-			if(processes == null) {
-				try {
-					log.error("Allocation: " + allocation.getDocument() + "\nrefers to unknown task or processes set." +
-							" Set correct value (task id or prcesses set id) for allocation refersTo attribute.");
-				} catch (Exception e) {
-					e.printStackTrace();
-				}
-			}
-			boolean found = false;
-			for(int j = 0; j < processes.size() && !found; j++){
-				AbstractProcesses procesesSet = processes.get(j);
-				if(refersTo.equals(procesesSet.getId())){
-					exec = new Executable(task, procesesSet);
-					found = true;
-				}
-			}
-			if(!found){
-				log.error("Allocation refers to unknown proceses set.");
-			}
-		}
-		
-	//	exec.setUserID(task.getSenderId());
-		exec.setLength(task.getLength());
-		exec.setReservationId(allocation.getReservationId());
-			
-		/*HostInterface<?> host = allocation.getHost();
-		ComputingResourceTypeInterface<?> crt = host.getMachineParameters();
-		if(crt != null){
-			ComputingResourceTypeItemInterface<?> crti = crt.getComputingResourceTypeItem(0);
-			if(crti != null){
-				ParameterPropertyInterface<?> properties[] = crti.getHostParameter().getProperty();
-				for(int p = 0; p < properties.length; p++){
-					ParameterPropertyInterface<?> property = properties[p];
-					if("chosenCPUs".equals(property.getName())){
-						Object cpuNames = property.getValue();
-						exec.addSpecificResource(ResourceParameterName.FREECPUS, cpuNames);
-					}
-				}
-			}
-		}*/
-		return exec;
-	}
-	
-
-	public List<Executable> createExecutables(Task task) {
-
-		List<AbstractProcesses> processes = task.getProcesses();
-		
-		List<Executable> executables = new ArrayList<Executable>();
-
-		if(processes == null || processes.size()==0){
-			Executable exec = new Executable(task);
-			exec.setUserID(task.getSenderId());
-			exec.setLength(task.getLength());
-			executables.add(exec);
-		} else {
-
-			boolean found = false;
-			for(int j = 0; j < processes.size() && !found; j++){
-				AbstractProcesses procesesSet = processes.get(j);
-				Executable exec = new Executable(task, procesesSet);
-				exec.setUserID(task.getSenderId());
-				exec.setLength(task.getLength());
-				executables.add(exec);
-			}
-		}
-
-		return  executables;
+		availableTasks.addAll(getPrecedenceConstrainedAvailableTasks(waitingTasks));
+		return availableTasks;
 	}
 
 
-	/**************************************/
-	protected static Map<Integer, Map<String, Object>> history = new HashMap<Integer, Map<String,Object>>();
-	
-	public static Map<Integer, Map<String, Object>> getAllocationHistory(){
-		return history;
-	}
-	
-	public void saveHistory (SubmittedTask submittedTask, int estimatedTime, Map<ResourceUnitName, ResourceUnit> choosenResources){
+	private List<Task> getPrecedenceConstrainedAvailableTasks(List<Task> tasks){
 		
-		/*submittedTask.setEstimatedDuration(estimatedTime);
-
-		DateTime currentTime = new DateTime();
-		ResourceHistoryItem resHistItem = new ResourceHistoryItem(choosenResources, currentTime);
-		submittedTask.addUsedResources(resHistItem);*/
-
-		ResourceHistoryItem resHistItem = submittedTask.getUsedResources().getLast();
-		DateTime currentTime = new DateTime();
-		Map<String, Object> historyItem = new HashMap<String, Object>();
-		List<ResourceHistoryItem> list = new ArrayList<ResourceHistoryItem>(1);
-		list.add(resHistItem);
-		historyItem.put(WormsConstants.RESOURCES, list);
-		historyItem.put(WormsConstants.START_TIME, currentTime);
-		currentTime = currentTime.plusSeconds(estimatedTime);
-		historyItem.put(WormsConstants.END_TIME, currentTime);
-
-		history.put(Integer.valueOf(submittedTask.getGridletID()), historyItem);
-		/*ProcessingElements pes = (ProcessingElements) choosenResources.get(ResourceParameterName.PROCESSINGELEMENTS);
-		for (ComputingResource resource : pes) {
-			//submittedTask.addToResPath(resource.getName());
-			submittedTask.visitResource(resource.getName());
-			ComputingResource parent = resource.getParent();
-			while (parent != null && !submittedTask.getResPath().contains(parent.getName() + "_")) {
-				submittedTask.addToResPath(parent.getName());
-				parent = parent.getParent();
-			}
-			while (parent != null && !submittedTask.getVisitedResources().contains(parent.getName() + "_")) {
-				submittedTask.visitResource(parent.getName());
-				parent = parent.getParent();
-			}
-		}*/
-	}
-
-	private List<Task> getPrecedenceConstrainedReadyTasks(List<Task> tasks){
+		List<Task> availableTasks = new ArrayList<Task>();
+		int size = tasks.size();
 		
-		List<Task> readyTasks = new ArrayList<Task>();
-
-		int size = tasks.size();
 		for(int i = 0; i < size; i++){
 			int parCnt;
-			int previousTaskReadyCnt = 0;
+			int previousTaskSucceedCnt = 0;
 			Task task = tasks.get(i);
 			if(task.getStatus() != (int)BrokerConstants.TASK_STATUS_UNSUBMITTED)
@@ -341,12 +120,9 @@
 			} catch(Exception e){
 				parCnt = 0;
-				//e.printStackTrace();
 			}
-			if(parCnt == 0)
-			{
-				readyTasks.add(task);
+			if(parCnt == 0){
+				availableTasks.add(task);
 			}
-			else
-			{
+			else {
 				for(int j = 0; j < parCnt; j++){
 					ParentType par = task.getDescription().getWorkflow().getParent(j);
@@ -356,16 +132,16 @@
 						}
 					}
-					previousTaskReadyCnt++;
+					previousTaskSucceedCnt++;
 				}
 				
-				if(previousTaskReadyCnt == parCnt && task.getDescription().getWorkflow().getAnd() != null)
-					readyTasks.add(task);
-				else if(previousTaskReadyCnt > 0 && task.getDescription().getWorkflow().getOr() != null)
-					readyTasks.add(task);
-				else if (previousTaskReadyCnt == parCnt)
-					readyTasks.add(task);
+				if(previousTaskSucceedCnt == parCnt && task.getDescription().getWorkflow().getAnd() != null)
+					availableTasks.add(task);
+				else if(previousTaskSucceedCnt > 0 && task.getDescription().getWorkflow().getOr() != null)
+					availableTasks.add(task);
+				else if (previousTaskSucceedCnt == parCnt)
+					availableTasks.add(task);
 			}
 		}		
-		return readyTasks;
+		return availableTasks;
 	}
 	
@@ -380,3 +156,4 @@
 		return false;
 	}
+
 }
Index: /DCWoRMS/trunk/src/schedframe/scheduling/manager/tasks/AbstractJobRegistry.java
===================================================================
--- /DCWoRMS/trunk/src/schedframe/scheduling/manager/tasks/AbstractJobRegistry.java	(revision 480)
+++ /DCWoRMS/trunk/src/schedframe/scheduling/manager/tasks/AbstractJobRegistry.java	(revision 481)
@@ -13,18 +13,16 @@
 
 
-public abstract class AbstractJobRegistry /*extends ConcurrentHashMap<String, Job> */implements JobRegistry, Cloneable{
+public abstract class AbstractJobRegistry /*extends ConcurrentHashMap<String, Job>*/ implements JobRegistry, Cloneable{
 	
 	private static final long serialVersionUID = 8409060063583755824L;
+
 	
-	private static Log log = LogFactory.getLog(AbstractJobRegistry.class);
-	
-	protected static final ConcurrentHashMap<String, Job> jobs = new ConcurrentHashMap<String, Job>();
+	protected static final ConcurrentHashMap<String, JobInterface<?>> jobs = new ConcurrentHashMap<String, JobInterface<?>>();
 	
 	protected AbstractJobRegistry(){
-		//log.warn("Methods from JobRegistry interface are not implemented.");
 	}
 	
 	public boolean addJob(JobInterface<?> job) {
-		jobs.put(job.getId(), (Job) job);
+		jobs.put(job.getId(),  job);
 		return true;
 	}
@@ -32,5 +30,5 @@
 	public boolean addTask(TaskInterface<?> task) {
 		if(jobs.containsKey(task.getJobId())){
-			jobs.get(task.getJobId()).add((Task)task);
+			getJob(task.getJobId()).add((Task)task);
 			return true;
 		} else {
@@ -39,15 +37,11 @@
 	}
 
-	public Job getJob(String jobId){
+	public JobInterface<?> getJobInfo(String jobId) {
 		return jobs.get(jobId);
 	}
-	
-	public JobInterface<?> getJobInfo(String jobID) {
-		return jobs.get(jobID);
-	}
 
-	public TaskInterface<?> getTaskInfo(String jobID, String taskId) {
+	public TaskInterface<?> getTaskInfo(String jobId, String taskId) {
 		Task task = null;
-		Job job = jobs.get(jobID);
+		Job job = getJob(jobId);
 		
 		if(job == null)
@@ -57,18 +51,11 @@
 			task = job.getTask(taskId);
 		} catch (NoSuchFieldException e) {
-			log.error(e.getMessage());
 		}
 		return task;
 	}
 	
-	/*public List<JobInterface<?>> getActiveJobs() {
-		log.error("getActiveJobs() not implemented.");
-		return null;
+	public Job getJob(String jobId){
+		return (Job)jobs.get(jobId);
 	}
 
-	public List<TaskInterface<?>> getActiveTasks() {
-		log.error("getActiveTasks() not implemented.");
-		return null;
-	}*/
-
 }
Index: /DCWoRMS/trunk/src/schedframe/scheduling/TaskList.java
===================================================================
--- /DCWoRMS/trunk/src/schedframe/scheduling/TaskList.java	(revision 481)
+++ /DCWoRMS/trunk/src/schedframe/scheduling/TaskList.java	(revision 481)
@@ -0,0 +1,10 @@
+package schedframe.scheduling;
+
+import java.util.List;
+
+import schedframe.scheduling.tasks.TaskInterface;
+
+
+public interface TaskList extends List<TaskInterface<?>>{
+
+}
Index: /DCWoRMS/trunk/src/schedframe/scheduling/queue/TaskQueue.java
===================================================================
--- /DCWoRMS/trunk/src/schedframe/scheduling/queue/TaskQueue.java	(revision 478)
+++ /DCWoRMS/trunk/src/schedframe/scheduling/queue/TaskQueue.java	(revision 481)
@@ -1,13 +1,12 @@
 package schedframe.scheduling.queue;
 
-import gridsim.Gridlet;
+import gridsim.gssim.DCWormsTags;
 import gssim.schedframe.scheduling.queues.AbstractStatsSupportingQueue;
 
 import org.joda.time.DateTime;
 
-import schedframe.scheduling.tasks.WorkloadUnit;
+import schedframe.scheduling.tasks.TaskInterface;
 
-public class TaskQueue extends AbstractStatsSupportingQueue<WorkloadUnit> implements Queue<WorkloadUnit>{
-
+public class TaskQueue extends AbstractStatsSupportingQueue<TaskInterface<?>> implements Queue<TaskInterface<?>>{
 
 	private static final long serialVersionUID = 6576299222910508209L;
@@ -17,35 +16,30 @@
 	protected boolean supportReservation;
 	
-	
 	public TaskQueue (boolean supportReservation){
-		name = "Queue";
-		priority = 0;
+		this.name = "Queue";
+		this.priority = 0;
 		this.supportReservation = supportReservation;
-
 	}
 	
-	public boolean add(WorkloadUnit wu){
+	public boolean add(TaskInterface<?> task){
 		try {
-			wu.setStatus(Gridlet.QUEUED);
+			task.setStatus(DCWormsTags.QUEUED);
 		} catch(Exception e){
 			throw new RuntimeException(e);
 		}
-		//updateStats();
-		return super.add(wu);
+		return super.add(task);
 	}
 	
-	public void add(int pos, WorkloadUnit wu){
+	public void add(int pos, TaskInterface<?> task){
 		try {
-			wu.setStatus(Gridlet.QUEUED);
+			task.setStatus(DCWormsTags.QUEUED);
 		} catch(Exception e){
 			throw new RuntimeException(e);
 		}
-		//updateStats();
-		 super.add(pos, wu);
+		 super.add(pos, task);
 	}
 	
 	public DateTime getArrivalTime(int pos) throws IndexOutOfBoundsException {
-		//return get(pos).getSubmissionTimeToBroker();
-		return null;
+		return get(pos).getSubmissionTimeToBroker();
 	}
 
@@ -69,35 +63,3 @@
 		return supportReservation;
 	}
-	
-	
-	/*public boolean contains (WorkloadUnitInterface<?> wu) {
-		for(int i = 0; i< size();i++){
-			try {
-				if(get(i).getId().equals(wu.getId()))
-					return true;
-			} catch (NoSuchFieldException e) {
-				return false;
-			}
-		}
-		return false;
-	}
-	
-	public boolean remove (WorkloadUnitInterface<?> wu) {
-		boolean found = false;
-		int index = 0;
-		for(int i = 0; i< size() && !found;i++){
-			try {
-				if(get(i).getId().equals(wu.getId()))
-				{
-					found = true;
-					index = i;
-				}
-				
-			} catch (NoSuchFieldException e) {
-				return false;
-			}
-		}
-		remove(index);
-		return true;
-	}*/
 }
Index: /DCWoRMS/trunk/src/schedframe/scheduling/tasks/TaskInterface.java
===================================================================
--- /DCWoRMS/trunk/src/schedframe/scheduling/tasks/TaskInterface.java	(revision 480)
+++ /DCWoRMS/trunk/src/schedframe/scheduling/tasks/TaskInterface.java	(revision 481)
@@ -88,11 +88,5 @@
 	 */
 	public long getLength();
-	
-	/**
-	 * 
-	 * @param length measured in instructions.
-	 */
-	public void setLength(long length);
-	
+
 	/**
 	 * 
Index: /DCWoRMS/trunk/src/schedframe/scheduling/tasks/Processes.java
===================================================================
--- /DCWoRMS/trunk/src/schedframe/scheduling/tasks/Processes.java	(revision 480)
+++ /DCWoRMS/trunk/src/schedframe/scheduling/tasks/Processes.java	(revision 481)
@@ -199,5 +199,5 @@
 
 	@Override
-	public int getUserID() {
+	public int getUserId() {
 		// TODO Auto-generated method stub
 		return 0;
Index: /DCWoRMS/trunk/src/schedframe/scheduling/tasks/Job.java
===================================================================
--- /DCWoRMS/trunk/src/schedframe/scheduling/tasks/Job.java	(revision 480)
+++ /DCWoRMS/trunk/src/schedframe/scheduling/tasks/Job.java	(revision 481)
@@ -178,5 +178,5 @@
 	}
 	
-	public int getUserID(){
+	public int getUserId(){
 		return this.senderId;
 	}
Index: /DCWoRMS/trunk/src/schedframe/scheduling/tasks/Task.java
===================================================================
--- /DCWoRMS/trunk/src/schedframe/scheduling/tasks/Task.java	(revision 480)
+++ /DCWoRMS/trunk/src/schedframe/scheduling/tasks/Task.java	(revision 481)
@@ -471,5 +471,5 @@
 
 	@Override
-	public int getUserID() {
+	public int getUserId() {
 		// TODO Auto-generated method stub
 		return 0;
Index: /DCWoRMS/trunk/src/schedframe/scheduling/tasks/WorkloadUnit.java
===================================================================
--- /DCWoRMS/trunk/src/schedframe/scheduling/tasks/WorkloadUnit.java	(revision 480)
+++ /DCWoRMS/trunk/src/schedframe/scheduling/tasks/WorkloadUnit.java	(revision 481)
@@ -8,5 +8,5 @@
 	public String getId();
 	
-	public int getUserID();
+	public int getUserId();
 	
 	public int getStatus();
Index: WoRMS/trunk/src/schedframe/scheduling/tasks/SubmittedTask.java
===================================================================
--- /DCWoRMS/trunk/src/schedframe/scheduling/tasks/SubmittedTask.java	(revision 480)
+++ 	(revision )
@@ -1,269 +1,0 @@
-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/plan/ScheduledTaskInterface.java
===================================================================
--- /DCWoRMS/trunk/src/schedframe/scheduling/plan/ScheduledTaskInterface.java	(revision 478)
+++ /DCWoRMS/trunk/src/schedframe/scheduling/plan/ScheduledTaskInterface.java	(revision 481)
@@ -4,5 +4,5 @@
 
 import schedframe.DescriptionContainer;
-import schedframe.scheduling.tasks.WorkloadUnit;
+import schedframe.scheduling.tasks.TaskInterface;
 
 public interface ScheduledTaskInterface<T> extends DescriptionContainer<T> {
@@ -190,7 +190,7 @@
 	
 
-	public ArrayList<AllocationInterface> getAllocations();
+	public ArrayList<AllocationInterface<?>> getAllocations();
 	
-	public WorkloadUnit getTask();
+	public TaskInterface<?> getTask();
 
 }
Index: /DCWoRMS/trunk/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 481)
@@ -99,4 +99,4 @@
 
 
-	public ArrayList<ScheduledTaskInterface> getTasks();
+	public ArrayList<ScheduledTaskInterface<?>> getTasks();
 }
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 481)
@@ -18,10 +18,10 @@
 	public SchedulingPlan(){
 		sp = new org.qcg.broker.schemas.schedulingplan.SchedulingPlan();
-		taskList = new ArrayList<ScheduledTaskInterface>();
+		taskList = new ArrayList<ScheduledTaskInterface<?>>();
 	}
 	
 	public SchedulingPlan(org.qcg.broker.schemas.schedulingplan.SchedulingPlan value){
 		sp = value;
-		taskList = new ArrayList<ScheduledTaskInterface>();
+		taskList = new ArrayList<ScheduledTaskInterface<?>>();
 	}
 	
@@ -106,7 +106,7 @@
 
 	
-	protected ArrayList<ScheduledTaskInterface> taskList;
+	protected ArrayList<ScheduledTaskInterface<?>> taskList;
 
-	public ArrayList<ScheduledTaskInterface> getTasks() {
+	public ArrayList<ScheduledTaskInterface<?>> getTasks() {
 
 		return this.taskList;
Index: /DCWoRMS/trunk/src/schedframe/scheduling/plan/impl/ScheduledTask.java
===================================================================
--- /DCWoRMS/trunk/src/schedframe/scheduling/plan/impl/ScheduledTask.java	(revision 478)
+++ /DCWoRMS/trunk/src/schedframe/scheduling/plan/impl/ScheduledTask.java	(revision 481)
@@ -6,12 +6,10 @@
 import org.exolab.castor.xml.MarshalException;
 import org.exolab.castor.xml.ValidationException;
+import org.qcg.broker.schemas.schedulingplan.types.AllocationStatus;
 
 import schedframe.scheduling.plan.AllocationInterface;
 import schedframe.scheduling.plan.ScheduledTaskInterface;
 import schedframe.scheduling.plan.ScheduledTimeInterface;
-import schedframe.scheduling.tasks.WorkloadUnit;
-
-
-import org.qcg.broker.schemas.schedulingplan.types.AllocationStatus;
+import schedframe.scheduling.tasks.TaskInterface;
 
 public class ScheduledTask implements ScheduledTaskInterface<org.qcg.broker.schemas.schedulingplan.Task> {
@@ -22,10 +20,10 @@
 	public ScheduledTask(){
 		t = new org.qcg.broker.schemas.schedulingplan.Task();
-		allocationList = new ArrayList<AllocationInterface>();
+		allocationList = new ArrayList<AllocationInterface<?>>();
 	}
 	
 	public ScheduledTask(org.qcg.broker.schemas.schedulingplan.Task value){
 		t = value;
-		allocationList = new ArrayList<AllocationInterface>();
+		allocationList = new ArrayList<AllocationInterface<?>>();
 	}
 	
@@ -178,17 +176,17 @@
 	
 
-	protected WorkloadUnit task;
-	protected ArrayList<AllocationInterface> allocationList;
+	protected TaskInterface<?> task;
+	protected ArrayList<AllocationInterface<?>> allocationList;
 
-	public ScheduledTask(WorkloadUnit task){
+	public ScheduledTask(TaskInterface<?> task){
 		this();
 		this.task = task;
 	}
 
-	public ArrayList<AllocationInterface> getAllocations() {
+	public ArrayList<AllocationInterface<?>> getAllocations() {
 		return this.allocationList;
 	}
 	
-	public WorkloadUnit getTask(){
+	public TaskInterface<?> getTask(){
 		return this.task;
 	}
Index: /DCWoRMS/trunk/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 481)
@@ -2,5 +2,5 @@
 
 import gridsim.GridSimTags;
-import gridsim.gssim.WormsTags;
+import gridsim.gssim.DCWormsTags;
 
 import java.util.ArrayList;
@@ -275,5 +275,5 @@
 			if(scheduler != null && (parent != null && scheduler != parent.getScheduler())/*scheduler.getResources().contains(this)*/){
 				String src = event.getSource() != null ? event.getSource() : name;
-				scheduler.sendInternal(GridSimTags.SCHEDULE_NOW, WormsTags.UPDATE, src);
+				scheduler.sendInternal(GridSimTags.SCHEDULE_NOW, DCWormsTags.UPDATE, src);
 			} else if(parent != null)
 				parent.getEventHandler().handleSchedulingEvent(event);
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 481)
@@ -11,5 +11,5 @@
 import schedframe.scheduling.policy.local.LocalManagementSystem;
 import schedframe.scheduling.queue.TaskQueueList;
-import simulator.WormsConstants;
+import simulator.DCWormsConstants;
 
 
@@ -46,5 +46,5 @@
 			}
 			case LS: {
-				ms = new LocalManagementSystem(id, WormsConstants.MANAGEMENT_SYSTEM,
+				ms = new LocalManagementSystem(id, DCWormsConstants.MANAGEMENT_SYSTEM,
 						schedulingPlugin, execTimeEstimationPlugin, queues);
 				return new Scheduler(ms, type, managedResources);
@@ -52,5 +52,5 @@
 
 		default:{
-				ms = new LocalManagementSystem(id, WormsConstants.MANAGEMENT_SYSTEM,
+				ms = new LocalManagementSystem(id, DCWormsConstants.MANAGEMENT_SYSTEM,
 						schedulingPlugin, execTimeEstimationPlugin, queues);
 				return new Scheduler(ms, type, managedResources);
Index: /DCWoRMS/trunk/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 481)
@@ -10,8 +10,5 @@
 	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/plugin/local/DCWormsTimeOperations.java
===================================================================
--- /DCWoRMS/trunk/src/gssim/schedframe/scheduling/plugin/local/DCWormsTimeOperations.java	(revision 481)
+++ /DCWoRMS/trunk/src/gssim/schedframe/scheduling/plugin/local/DCWormsTimeOperations.java	(revision 481)
@@ -0,0 +1,25 @@
+package gssim.schedframe.scheduling.plugin.local;
+
+import org.joda.time.DateTime;
+
+import schedframe.scheduling.plugin.local.TimeOperations;
+
+public class DCWormsTimeOperations extends TimeOperations {
+
+	public DCWormsTimeOperations(){
+		this(0);
+	}
+	
+	public DCWormsTimeOperations(long timeDelta){
+		super(timeDelta);
+	}
+
+	/**
+	 * Get Calendar object representing current logic time
+	 * @return current time
+	 */
+	public DateTime getTime() {
+		return new DateTime();
+	}
+
+}
Index: WoRMS/trunk/src/gssim/schedframe/scheduling/plugin/local/WormsTimeOperations.java
===================================================================
--- /DCWoRMS/trunk/src/gssim/schedframe/scheduling/plugin/local/WormsTimeOperations.java	(revision 477)
+++ 	(revision )
@@ -1,25 +1,0 @@
-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/Executable.java
===================================================================
--- /DCWoRMS/trunk/src/gssim/schedframe/scheduling/Executable.java	(revision 480)
+++ /DCWoRMS/trunk/src/gssim/schedframe/scheduling/Executable.java	(revision 481)
@@ -2,5 +2,6 @@
 
 
-import gridsim.Gridlet;
+import gridsim.GridSim;
+import gridsim.gssim.DCWormsTags;
 
 import java.util.ArrayList;
@@ -9,8 +10,14 @@
 import java.util.Map;
 
+import org.apache.commons.lang.ArrayUtils;
 import org.joda.time.DateTime;
 import org.joda.time.DateTimeUtilsExt;
 import org.joda.time.ReadableDuration;
 
+import schedframe.resources.computing.ComputingResource;
+import schedframe.resources.units.ProcessingElements;
+import schedframe.resources.units.StandardResourceUnitName;
+import schedframe.scheduling.ResourceHistoryItem;
+import schedframe.scheduling.UsedResourceList;
 import schedframe.scheduling.WorkloadUnitHandler;
 import schedframe.scheduling.manager.tasks.JobRegistryImpl;
@@ -25,42 +32,69 @@
  *
  */
-public class Executable extends Gridlet implements ExecTask{
+public class Executable implements ExecTask{
 
 	protected Task task;
 	protected String processesSetId;
 	
+	protected int status; 
+	protected double length;
+	protected Map<ResourceParameterName, Object> specificResources;
+	
+	protected String reservationId;
+	protected double completionPercentage;
+	
+	protected int estimatedDuration;
+	//TO DO remove and benefit from visitedResources
+	protected String schedName;
+	protected UsedResourceList<ResourceHistoryItem> usedResources;
+	//TO DO consider removing
 	protected List<String> visitedResources;
 
+	protected double submissionTime;
+    protected double arrivalTime;
+	protected double execStartTime ;
+    protected double totalCompletionTime; 
+	protected double finishTime; 
 	
 	public Executable(Task t){
-		super(0, 0, 0, 0);
 		this.task = t;
-		super.gridletID_ = (t.getJobId() + "_" + t.getId()).hashCode();
-		reservationId = null;
+		this.status = DCWormsTags.CREATED;
+		
+		this.usedResources = new UsedResourceList<ResourceHistoryItem>();
 		this.visitedResources = new ArrayList<String>();
-		setUserID(task.getSenderId());
+		init();
 	}
 	
 	public Executable(Task t, AbstractProcesses procesesSet){
-		super(0, 0, 0, 0);
 		this.task = t;
+		this.status = DCWormsTags.CREATED;
 		this.processesSetId = procesesSet.getId(); 
-		super.gridletID_ = (t.getJobId() + "_" + t.getId() + "_" + processesSetId).hashCode();
+		
+		this.usedResources = new UsedResourceList<ResourceHistoryItem>();
 		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();
-	}
-
+		init();
+	}
+	
+	protected void init() {
+		double currentTime =  DateTimeUtilsExt.getDateTimeAt(arrivalTime).getMillis() / 1000;
+		this.submissionTime =  currentTime;
+        this.totalCompletionTime = 0.0;
+	 }
+	
+	public int getUserId() {
+		return task.getSenderId();
+	}
+	public String getUserDN() {
+		return task.getUserDN();
+	}
+
+	public String getJobId() {
+		return task.getJobId();
+	}
+	
+	public String getTaskId(){
+		return this.task.getId();
+	}
+	
 	public String getId() {
 		if(processesSetId == null)
@@ -69,7 +103,195 @@
 			return task.getId() + "_" + processesSetId;
 	}
-
-	public String getJobId() {
-		return task.getJobId();
+	
+	public String getProcessesId(){
+		return this.processesSetId;
+	}
+	
+    public int getUniqueId(){
+    	if(processesSetId == null){
+    		return (task.getJobId() + "_" + task.getId()).hashCode();
+    	} else {
+    		return (task.getJobId() + "_" + task.getId() + "_" + processesSetId).hashCode();
+    	}
+    }
+    
+	public List<AbstractProcesses> getProcesses() {
+		return task.getProcesses();
+	}
+
+	public List<AbstractProcesses> getProcesses(
+			AbstractProcessesGroup processGroup) {
+		return task.getProcesses(processGroup);
+	}
+
+	public List<AbstractProcessesGroup> getProcessesGroups() {
+		return task.getProcessesGroups();
+	}
+
+	public org.qcg.broker.schemas.resreqs.Task getDescription() {
+		return task.getDescription();
+	}
+
+	public String getDocument() throws Exception {
+		return task.getDocument();
+	}
+	
+	public long getLength() {
+		return task.getLength();
+	}
+
+	public int getStatus() {
+		return status;
+	}
+	
+	public boolean isFinished()
+    {
+		return task.isFinished();
+    }
+	
+	public void setStatus(int newStatus) throws Exception {
+		int prevStatus = status;
+	    
+        if (status == newStatus) {
+            return;
+        }
+
+        if (newStatus < DCWormsTags.CREATED || newStatus > DCWormsTags.FAILED_RESOURCE_UNAVAILABLE)
+        {
+            throw new Exception("Gridlet.setGridletStatus() : Error - " +
+                    "Invalid integer range for Gridlet status.");
+        }
+
+        status = newStatus;
+        double currentTime = DateTimeUtilsExt.currentTimeMillis() / 1000; // time in seconds 
+    
+		
+		if (newStatus == DCWormsTags.SUCCESS || newStatus == DCWormsTags.CANCELED) {
+            finishTime = DateTimeUtilsExt.currentTimeMillis() / 1000;
+        }
+		
+		if(newStatus == DCWormsTags.SUBMITTED){
+			 arrivalTime = GridSim.clock();
+		}
+
+        if (prevStatus == DCWormsTags.INEXEC)
+        {
+
+            if (status == DCWormsTags.CANCELED || status == DCWormsTags.PAUSED ||
+                status == DCWormsTags.SUCCESS)
+            {
+                totalCompletionTime += (currentTime -  execStartTime);
+            }
+        }
+
+        if (prevStatus == DCWormsTags.RESUMED && status == DCWormsTags.SUCCESS)
+        {
+            totalCompletionTime += (currentTime -  execStartTime);
+        }
+
+        if (status == DCWormsTags.INEXEC ||
+            (prevStatus == DCWormsTags.PAUSED && status == DCWormsTags.RESUMED) )
+        {
+        	execStartTime = currentTime;
+    		ProcessingElements pes = (ProcessingElements) getUsedResources().getLast().getResourceUnits().get(StandardResourceUnitName.PE);
+    		for (ComputingResource resource : pes) {
+
+    			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();
+    			}
+    		}
+        }
+	}
+	
+	public void addSpecificResource(ResourceParameterName resourceName, Object value){
+		if(this.specificResources == null)
+			this.specificResources = new HashMap<ResourceParameterName, Object>();
+		
+		this.specificResources.put(resourceName, value);
+	}
+
+	public boolean expectSpecificResource(ResourceParameterName resourceName){
+		if(this.specificResources == null)
+			return false;
+
+		return this.specificResources.containsKey(resourceName);
+	}
+	
+	public Object getExpectedSpecificResource(ResourceParameterName resourceName){
+		if(this.specificResources == null)
+			return null;
+		
+		return this.specificResources.get(resourceName);
+	}
+	
+	public void setReservationId(String reservationId){
+		this.reservationId = reservationId;
+	}
+	
+	public boolean requireReservation(){
+		return (reservationId != null);
+	}
+	
+	public String getReservationId(){
+		return this.reservationId;
+	}
+	
+	public double getCompletionPercentage() {
+		return completionPercentage;
+	}
+
+	public void setCompletionPercentage(double completionPercentage) {
+		this.completionPercentage = completionPercentage;
+	}
+
+	public void addUsedResources(ResourceHistoryItem usedResources){
+		this.usedResources.add(usedResources);
+	}
+	
+	public UsedResourceList<ResourceHistoryItem> getUsedResources(){
+		return this.usedResources;
+	}
+	
+    public void setSchedulerName(int resourceId)
+    {
+        this.schedName = GridSim.getEntityName(resourceId);
+    }
+
+    public String getSchedulerName()
+    {
+        return schedName;
+    }
+	
+	public int getEstimatedDuration(){
+		return this.estimatedDuration;
+	}
+	
+	public void setEstimatedDuration(int value){
+		this.estimatedDuration = value;
+	}
+
+	public boolean isRegistered() {
+		return task.isRegistered();
+	}
+
+	public void register(JobRegistryImpl jobRegistry) {
+		task.register(jobRegistry);
+	}
+	
+	public void visitResource(String resName){
+		visitedResources.add(resName);
+	}
+	
+	public List<String> getVisitedResources(){
+		return visitedResources;
+	}
+	
+	public ReadableDuration getExpectedDuration() throws NoSuchFieldException {
+		return task.getExpectedDuration();
 	}
 
@@ -83,4 +305,20 @@
 		return task.getParameterStringValue(parameterName);
 	}
+	
+	public double getCpuCntRequest() throws NoSuchFieldException{
+		return getParameterDoubleValue(ResourceParameterName.CPUCOUNT);
+	}
+	
+	public double getMemoryRequest() throws NoSuchFieldException{
+		return getParameterDoubleValue(ResourceParameterName.MEMORY);
+	}
+	
+	public DateTime getExecutionEndTime() throws NoSuchFieldException {
+		return task.getExecutionEndTime();
+	}
+
+	public DateTime getExecutionStartTime() throws NoSuchFieldException {
+		return task.getExecutionStartTime();
+	}
 
 	public DateTime getSubmissionTimeToBroker() {
@@ -88,82 +326,34 @@
 	}
 
-	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 double getExecStartTime() {
+        return execStartTime;
+    }
+
+    public double getFinishTime() {
+        return finishTime;
+    }
+
+    public double getSubmissionTime() {
+        return submissionTime;
+    }
+    
+    public double getWaitingTime()
+    {
+        return execStartTime - submissionTime;
+    }
+
+    
+    public void finalizeExecutable(){
+
+    }
+    
+	public void accept(WorkloadUnitHandler wuh) {
+		wuh.handleExecutable(this);
+	}
+    
 	public boolean equals(Object obj){
 		if(obj instanceof Executable){
@@ -173,117 +363,4 @@
 		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/example/localplugin/BaseLocalSchedulingPlugin.java
===================================================================
--- /DCWoRMS/trunk/src/example/localplugin/BaseLocalSchedulingPlugin.java	(revision 478)
+++ /DCWoRMS/trunk/src/example/localplugin/BaseLocalSchedulingPlugin.java	(revision 481)
@@ -10,5 +10,5 @@
 import schedframe.resources.units.ResourceUnit;
 import schedframe.resources.units.ResourceUnitName;
-import schedframe.scheduling.WorkloadUnitListImpl;
+import schedframe.scheduling.TaskListImpl;
 import schedframe.scheduling.manager.resources.ResourceManager;
 import schedframe.scheduling.manager.tasks.JobRegistryImpl;
@@ -22,5 +22,4 @@
 import schedframe.scheduling.queue.TaskQueueList;
 import schedframe.scheduling.tasks.TaskInterface;
-import schedframe.scheduling.tasks.WorkloadUnit;
 import schemas.StringValueWithUnit;
 
@@ -46,5 +45,5 @@
 	}
 	
-	public int placeJobsInQueues(WorkloadUnitListImpl newJobs,
+	public int placeTasksInQueues(TaskListImpl newTasks,
 			TaskQueueList queues, 
 			ResourceManager resourceManager, ModuleList moduleList) {
@@ -53,6 +52,6 @@
 		TaskQueue queue = queues.get(0);
 
-		for(int i = 0; i < newJobs.size(); i++){
-			WorkloadUnit task = newJobs.get(i);
+		for(int i = 0; i < newTasks.size(); i++){
+			TaskInterface<?> task = newTasks.get(i);
 			queue.add(task);
 		}
Index: /DCWoRMS/trunk/src/example/localplugin/RackLocalPlugin.java
===================================================================
--- /DCWoRMS/trunk/src/example/localplugin/RackLocalPlugin.java	(revision 478)
+++ /DCWoRMS/trunk/src/example/localplugin/RackLocalPlugin.java	(revision 481)
@@ -1,5 +1,5 @@
 package example.localplugin;
 
-import gridsim.Gridlet;
+import gridsim.gssim.DCWormsTags;
 import schedframe.events.scheduling.SchedulingEvent;
 import schedframe.scheduling.manager.resources.ClusterResourceManager;
@@ -19,5 +19,5 @@
 	}
 
-	public SchedulingPlanInterface schedule(SchedulingEvent event, TaskQueueList queues, JobRegistry jobRegistry,
+	public SchedulingPlanInterface<?> schedule(SchedulingEvent event, TaskQueueList queues, JobRegistry jobRegistry,
 			ResourceManager resManager, ModuleList modules) {
 
@@ -39,5 +39,5 @@
 				TaskInterface<?> task = (TaskInterface<?>) job;
 				// if status of the tasks in READY
-				if (task.getStatus() == Gridlet.READY) {
+				if (task.getStatus() == DCWormsTags.READY) {
 					System.out.println(resourceManager.getSchedulers().get(0).get_name());
 					String nodeName = resourceManager.getSchedulers().get(0).get_name();
Index: /DCWoRMS/trunk/src/example/localplugin/FCFSClusterLocalPlugin.java
===================================================================
--- /DCWoRMS/trunk/src/example/localplugin/FCFSClusterLocalPlugin.java	(revision 478)
+++ /DCWoRMS/trunk/src/example/localplugin/FCFSClusterLocalPlugin.java	(revision 481)
@@ -1,5 +1,5 @@
 package example.localplugin;
 
-import gridsim.Gridlet;
+import gridsim.gssim.DCWormsTags;
 
 import java.util.ArrayList;
@@ -52,5 +52,5 @@
 				TaskInterface<?> task = (TaskInterface<?>) job;
 				// if status of the tasks in READY
-				if (task.getStatus() == Gridlet.READY) {
+				if (task.getStatus() == DCWormsTags.READY) {
 					
 					/****************3 ways to schedule task****************/
Index: /DCWoRMS/trunk/src/example/localplugin/FCFSNodePowerManagementClusterLocalPlugin.java
===================================================================
--- /DCWoRMS/trunk/src/example/localplugin/FCFSNodePowerManagementClusterLocalPlugin.java	(revision 478)
+++ /DCWoRMS/trunk/src/example/localplugin/FCFSNodePowerManagementClusterLocalPlugin.java	(revision 481)
@@ -1,5 +1,5 @@
 package example.localplugin;
 
-import gridsim.Gridlet;
+import gridsim.gssim.DCWormsTags;
 
 import java.util.ArrayList;
@@ -35,5 +35,5 @@
 	}
 
-	public SchedulingPlanInterface schedule(SchedulingEvent event, TaskQueueList queues, JobRegistry jobRegistry,
+	public SchedulingPlanInterface<?> schedule(SchedulingEvent event, TaskQueueList queues, JobRegistry jobRegistry,
 			ResourceManager resManager, ModuleList modules) {
 
@@ -54,5 +54,5 @@
 				TaskInterface<?> task = (TaskInterface<?>) job;
 				// if status of the tasks in READY
-				if (task.getStatus() == Gridlet.READY) {
+				if (task.getStatus() == DCWormsTags.READY) {
 
 					Map<ResourceUnitName, ResourceUnit> choosenResources = chooseResourcesForExecution(resourceManager, task);
Index: /DCWoRMS/trunk/src/example/localplugin/FCFSRandomClusterLocalPlugin.java
===================================================================
--- /DCWoRMS/trunk/src/example/localplugin/FCFSRandomClusterLocalPlugin.java	(revision 478)
+++ /DCWoRMS/trunk/src/example/localplugin/FCFSRandomClusterLocalPlugin.java	(revision 481)
@@ -1,5 +1,5 @@
 package example.localplugin;
 
-import gridsim.Gridlet;
+import gridsim.gssim.DCWormsTags;
 
 import java.util.List;
@@ -47,5 +47,5 @@
 				TaskInterface<?> task = (TaskInterface<?>) job;
 				// if status of the tasks in READY
-				if (task.getStatus() == Gridlet.READY) {
+				if (task.getStatus() == DCWormsTags.READY) {
 					/*for(ResourceUnitName key:resManager.getSharedResourceUnits().keySet()){
 						System.out.println(key.getName());
Index: /DCWoRMS/trunk/src/example/localplugin/FCFS_BFLocalPlugin.java
===================================================================
--- /DCWoRMS/trunk/src/example/localplugin/FCFS_BFLocalPlugin.java	(revision 478)
+++ /DCWoRMS/trunk/src/example/localplugin/FCFS_BFLocalPlugin.java	(revision 481)
@@ -1,5 +1,5 @@
 package example.localplugin;
 
-import gridsim.Gridlet;
+import gridsim.gssim.DCWormsTags;
 import schedframe.events.scheduling.SchedulingEvent;
 import schedframe.scheduling.manager.resources.ResourceManager;
@@ -33,5 +33,5 @@
 				
 				// if status of the tasks in READY
-				if (task.getStatus() == Gridlet.READY) {
+				if (task.getStatus() == DCWormsTags.READY) {
 					addToSchedulingPlan(plan, task);
 				}
Index: /DCWoRMS/trunk/src/example/localplugin/FCFSConsolidationClusterLocalPlugin.java
===================================================================
--- /DCWoRMS/trunk/src/example/localplugin/FCFSConsolidationClusterLocalPlugin.java	(revision 478)
+++ /DCWoRMS/trunk/src/example/localplugin/FCFSConsolidationClusterLocalPlugin.java	(revision 481)
@@ -1,5 +1,5 @@
 package example.localplugin;
 
-import gridsim.Gridlet;
+import gridsim.gssim.DCWormsTags;
 
 import java.util.ArrayList;
@@ -35,5 +35,5 @@
 	}
 
-	public SchedulingPlanInterface schedule(SchedulingEvent event, TaskQueueList queues, JobRegistry jobRegistry,
+	public SchedulingPlanInterface<?> schedule(SchedulingEvent event, TaskQueueList queues, JobRegistry jobRegistry,
 			ResourceManager resManager, ModuleList modules) {
 
@@ -54,5 +54,5 @@
 				TaskInterface<?> task = (TaskInterface<?>) job;
 				// if status of the tasks in READY
-				if (task.getStatus() == Gridlet.READY) {
+				if (task.getStatus() == DCWormsTags.READY) {
 
 					Map<ResourceUnitName, ResourceUnit> choosenResources = null;
Index: /DCWoRMS/trunk/src/example/localplugin/FCFSCPUFreqScalingClusterLocalPlugin.java
===================================================================
--- /DCWoRMS/trunk/src/example/localplugin/FCFSCPUFreqScalingClusterLocalPlugin.java	(revision 478)
+++ /DCWoRMS/trunk/src/example/localplugin/FCFSCPUFreqScalingClusterLocalPlugin.java	(revision 481)
@@ -1,5 +1,6 @@
 package example.localplugin;
 
-import gridsim.Gridlet;
+import gridsim.gssim.DCWormsTags;
+import gssim.schedframe.scheduling.Executable;
 
 import java.util.ArrayList;
@@ -28,5 +29,4 @@
 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;
@@ -39,5 +39,5 @@
 	}
 
-	public SchedulingPlanInterface schedule(SchedulingEvent event, TaskQueueList queues, JobRegistry jobRegistry,
+	public SchedulingPlanInterface<?> schedule(SchedulingEvent event, TaskQueueList queues, JobRegistry jobRegistry,
 			ResourceManager resManager, ModuleList modules) {
 
@@ -58,5 +58,5 @@
 				TaskInterface<?> task = (TaskInterface<?>) job;
 				// if status of the tasks in READY
-				if (task.getStatus() == Gridlet.READY) {
+				if (task.getStatus() == DCWormsTags.READY) {
 
 					Map<ResourceUnitName, ResourceUnit> choosenResources = chooseResourcesForExecution(resourceManager, task);
@@ -76,6 +76,6 @@
 		case TASK_FINISHED:
 			TaskFinishedEvent finEvent = (TaskFinishedEvent) event;
-			SubmittedTask subTask = (SubmittedTask )jobRegistry.getSubmittedTask(finEvent.getJobId(), finEvent.getTaskId());
-			UsedResourceList<ResourceHistoryItem> usedResourcesList = subTask.getUsedResources();
+			Executable exec = (Executable) jobRegistry.getExecutable(finEvent.getJobId(), finEvent.getTaskId());
+			UsedResourceList<ResourceHistoryItem> usedResourcesList = exec.getUsedResources();
 			ProcessingElements pes = (ProcessingElements)usedResourcesList.getLast().getResourceUnits().get(StandardResourceUnitName.PE);
 			List<Processor> processors =  new ArrayList<Processor>();
@@ -89,6 +89,6 @@
 		case TASK_REQUESTED_TIME_EXPIRED:
 			TaskRequestedTimeExpiredEvent timExpEvent = (TaskRequestedTimeExpiredEvent) event;
-			 subTask = (SubmittedTask )jobRegistry.getSubmittedTask(timExpEvent.getJobId(), timExpEvent.getTaskId());
-			usedResourcesList = subTask.getUsedResources();
+			exec = (Executable) jobRegistry.getExecutable(timExpEvent.getJobId(), timExpEvent.getTaskId());
+			usedResourcesList = exec.getUsedResources();
 			pes = (ProcessingElements)usedResourcesList.getLast().getResourceUnits().get(StandardResourceUnitName.PE);
 			processors =  new ArrayList<Processor>();
@@ -101,5 +101,5 @@
 				TaskInterface<?> task = (TaskInterface<?>) job;
 				// if status of the tasks in READY
-				if (task.getStatus() == Gridlet.READY) {
+				if (task.getStatus() == DCWormsTags.READY) {
 
 					Map<ResourceUnitName, ResourceUnit> choosenResources = chooseResourcesForExecution(resourceManager, task);
Index: /DCWoRMS/trunk/src/example/localplugin/FCFSEnergyAwareClusterLocalPlugin.java
===================================================================
--- /DCWoRMS/trunk/src/example/localplugin/FCFSEnergyAwareClusterLocalPlugin.java	(revision 478)
+++ /DCWoRMS/trunk/src/example/localplugin/FCFSEnergyAwareClusterLocalPlugin.java	(revision 481)
@@ -1,5 +1,5 @@
 package example.localplugin;
 
-import gridsim.Gridlet;
+import gridsim.gssim.DCWormsTags;
 
 import java.util.ArrayList;
@@ -26,5 +26,5 @@
 	}
 
-	public SchedulingPlanInterface schedule(SchedulingEvent event, TaskQueueList queues, JobRegistry jobRegistry,
+	public SchedulingPlanInterface<?> schedule(SchedulingEvent event, TaskQueueList queues, JobRegistry jobRegistry,
 			ResourceManager resManager, ModuleList modules) {
 
@@ -45,5 +45,5 @@
 				TaskInterface<?> task = (TaskInterface<?>) job;
 				// if status of the tasks in READY
-				if (task.getStatus() == Gridlet.READY) {
+				if (task.getStatus() == DCWormsTags.READY) {
 
 					String nodeName = chooseProviderForExecution(resourceManager, task);
Index: /DCWoRMS/trunk/src/example/globalplugin/GridFCFSLoadBalancingPlugin.java
===================================================================
--- /DCWoRMS/trunk/src/example/globalplugin/GridFCFSLoadBalancingPlugin.java	(revision 478)
+++ /DCWoRMS/trunk/src/example/globalplugin/GridFCFSLoadBalancingPlugin.java	(revision 481)
@@ -19,6 +19,6 @@
 import schedframe.scheduling.plugin.grid.ModuleList;
 import schedframe.scheduling.plugin.grid.ResourceDiscovery;
+import schedframe.scheduling.queue.QueueDescription;
 import schedframe.scheduling.queue.TaskQueue;
-import schedframe.scheduling.queue.QueueDescription;
 import schedframe.scheduling.queue.TaskQueueList;
 import schedframe.scheduling.tasks.TaskInterface;
@@ -29,5 +29,5 @@
 	private Log log = LogFactory.getLog(GridFCFSLoadBalancingPlugin.class);
 	
-	public SchedulingPlanInterface schedule(SchedulingEvent event,
+	public SchedulingPlanInterface<?> schedule(SchedulingEvent event,
 			TaskQueueList queues, 
 			JobRegistry jobRegistry,
@@ -83,7 +83,7 @@
 	
 	private int findLeastLoadedResourceIdx(List<SchedulerDescription> availableResources){
-		
 		int resourceIdx = -1;
 		long minLoad = Long.MAX_VALUE;
+		
 		for(int i = 0; i < availableResources.size(); i++){
 			SchedulerDescription sd = availableResources.get(i);
Index: /DCWoRMS/trunk/src/example/globalplugin/BaseGlobalPlugin.java
===================================================================
--- /DCWoRMS/trunk/src/example/globalplugin/BaseGlobalPlugin.java	(revision 478)
+++ /DCWoRMS/trunk/src/example/globalplugin/BaseGlobalPlugin.java	(revision 481)
@@ -4,5 +4,5 @@
 import schedframe.PluginConfiguration;
 import schedframe.events.scheduling.SchedulingEventType;
-import schedframe.scheduling.WorkloadUnitListImpl;
+import schedframe.scheduling.TaskListImpl;
 import schedframe.scheduling.manager.resources.ResourceManager;
 import schedframe.scheduling.plugin.SchedulingPluginConfiguration;
@@ -11,5 +11,5 @@
 import schedframe.scheduling.queue.TaskQueue;
 import schedframe.scheduling.queue.TaskQueueList;
-import schedframe.scheduling.tasks.WorkloadUnit;
+import schedframe.scheduling.tasks.TaskInterface;
 import schemas.StringValueWithUnit;
 
@@ -22,5 +22,5 @@
 	}
 	
-	public int placeJobsInQueues(WorkloadUnitListImpl newJobs, TaskQueueList queues, ResourceManager resourceManager,
+	public int placeTasksInQueues(TaskListImpl newTasks, TaskQueueList queues, ResourceManager resourceManager,
 			ModuleList moduleList) {
 
@@ -28,6 +28,6 @@
 		TaskQueue queue = queues.get(0);
 
-		for (int i = 0; i < newJobs.size(); i++) {
-			WorkloadUnit task = newJobs.get(i);
+		for (int i = 0; i < newTasks.size(); i++) {
+			TaskInterface<?> task = newTasks.get(i);
 			queue.add(task);
 		}
Index: WoRMS/trunk/start-gssim.sh
===================================================================
--- /DCWoRMS/trunk/start-gssim.sh	(revision 477)
+++ 	(revision )
@@ -1,3 +1,0 @@
-#! /bin/bash
-module load gssim/1.0
-java -Xmx1536m -Dgssim.install.dir=$GSSIM_INSTALL_DIR simulator.GridSchedulingSimulator $*
Index: WoRMS/trunk/start-gssim-bash.sh
===================================================================
--- /DCWoRMS/trunk/start-gssim-bash.sh	(revision 477)
+++ 	(revision )
@@ -1,9 +1,0 @@
-#! /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 $*
