[477] | 1 | package simulator.stats.implementation; |
---|
| 2 | |
---|
| 3 | import java.io.PrintStream; |
---|
| 4 | |
---|
| 5 | import simulator.stats.GSSAccumulator; |
---|
| 6 | import simulator.stats.implementation.out.StatsSerializer; |
---|
| 7 | |
---|
| 8 | /** |
---|
| 9 | * |
---|
| 10 | * @author Marcin Krystek |
---|
| 11 | * |
---|
| 12 | */ |
---|
| 13 | public class JobStats implements StatsInterface { |
---|
| 14 | |
---|
| 15 | protected String jobID; |
---|
| 16 | protected GSSAccumulator meanTaskCompletionTime; |
---|
| 17 | protected GSSAccumulator meanTaskExecutionTime; |
---|
| 18 | protected GSSAccumulator meanTaskStartTime; |
---|
| 19 | protected GSSAccumulator meanTaskFlowTime; |
---|
| 20 | protected GSSAccumulator meanTaskWaitingTime; |
---|
| 21 | protected GSSAccumulator meanTaskGQ_WaitingTime; |
---|
| 22 | protected GSSAccumulator lateness; |
---|
| 23 | protected GSSAccumulator tardiness; |
---|
| 24 | protected GSSAccumulator makespan; |
---|
| 25 | |
---|
| 26 | JobStats(String jobID) { |
---|
| 27 | this.jobID = jobID; |
---|
| 28 | init(); |
---|
| 29 | } |
---|
| 30 | |
---|
| 31 | private String[] headers = { "jobID", "meanTaskCompletionTime", |
---|
| 32 | "meanTaskExecutionTime", "meanTaskStartTime", "meanTaskFlowTime", |
---|
| 33 | "meanTaskWaitingTime", "meanTaskGQ_WaitingTime", "lateness", |
---|
| 34 | "tardiness", "makespan" }; |
---|
| 35 | |
---|
| 36 | private void init() { |
---|
| 37 | this.meanTaskCompletionTime = new GSSAccumulator(); |
---|
| 38 | this.meanTaskExecutionTime = new GSSAccumulator(); |
---|
| 39 | this.meanTaskStartTime = new GSSAccumulator(); |
---|
| 40 | this.meanTaskFlowTime = new GSSAccumulator(); |
---|
| 41 | this.meanTaskWaitingTime = new GSSAccumulator(); |
---|
| 42 | this.meanTaskGQ_WaitingTime = new GSSAccumulator(); |
---|
| 43 | this.lateness = new GSSAccumulator(); |
---|
| 44 | this.tardiness = new GSSAccumulator(); |
---|
| 45 | this.makespan = new GSSAccumulator(); |
---|
| 46 | } |
---|
| 47 | |
---|
| 48 | public String getJobID() { |
---|
| 49 | return jobID; |
---|
| 50 | } |
---|
| 51 | |
---|
| 52 | public GSSAccumulator getMeanTaskCompletionTime() { |
---|
| 53 | return meanTaskCompletionTime; |
---|
| 54 | } |
---|
| 55 | |
---|
| 56 | public GSSAccumulator getMeanTaskExecutionTime() { |
---|
| 57 | return meanTaskExecutionTime; |
---|
| 58 | } |
---|
| 59 | |
---|
| 60 | public GSSAccumulator getMeanTaskStartTime() { |
---|
| 61 | return meanTaskStartTime; |
---|
| 62 | } |
---|
| 63 | |
---|
| 64 | public GSSAccumulator getMeanTaskFlowTime() { |
---|
| 65 | return meanTaskFlowTime; |
---|
| 66 | } |
---|
| 67 | |
---|
| 68 | public GSSAccumulator getMeanTaskWaitingTime() { |
---|
| 69 | return meanTaskWaitingTime; |
---|
| 70 | } |
---|
| 71 | |
---|
| 72 | public GSSAccumulator getMeanTaskGQ_WaitingTime() { |
---|
| 73 | return meanTaskGQ_WaitingTime; |
---|
| 74 | } |
---|
| 75 | |
---|
| 76 | public GSSAccumulator getLateness() { |
---|
| 77 | return lateness; |
---|
| 78 | } |
---|
| 79 | |
---|
| 80 | public GSSAccumulator getTardiness() { |
---|
| 81 | return tardiness; |
---|
| 82 | } |
---|
| 83 | |
---|
| 84 | public GSSAccumulator getMakespan() { |
---|
| 85 | return makespan; |
---|
| 86 | } |
---|
| 87 | |
---|
| 88 | public Object serialize(StatsSerializer serializer) { |
---|
| 89 | return serializer.visit(this); |
---|
| 90 | } |
---|
| 91 | |
---|
| 92 | public String[] getHeaders() { |
---|
| 93 | return headers; |
---|
| 94 | } |
---|
| 95 | } |
---|