start of new file
[IRC.git] / Robust / src / Analysis / Scheduling / TransTaskSimulator.java
1 package Analysis.Scheduling;\r
2 \r
3 import java.util.Queue;\r
4 \r
5 public class TransTaskSimulator extends TaskSimulator {\r
6     private int targetCoreNum;\r
7     private Queue<ObjectInfo> newObjs;\r
8 \r
9     public TransTaskSimulator(CoreSimulator cs, int targetCoreNum, Queue<ObjectInfo> nobjs) {\r
10         super(null, cs);\r
11         this.targetCoreNum = targetCoreNum;\r
12         this.newObjs = nobjs;\r
13     }\r
14     \r
15     public void process() {\r
16         if(this.currentRun == null) {\r
17             this.currentRun = new ExeResult();\r
18         }\r
19 \r
20         this.currentRun.finishTime = 1 * sizeof(this.newObjs.peek().obj.getCd());\r
21     }\r
22     \r
23     public ObjectInfo refreshTask() {\r
24         return this.newObjs.poll();\r
25     }\r
26     \r
27     private int sizeof(Object obj) {\r
28         return 1;\r
29     }\r
30 \r
31     public boolean isFinished() {\r
32         return this.newObjs.isEmpty();\r
33     }\r
34 \r
35     public int getTargetCoreNum() {\r
36         return targetCoreNum;\r
37     }\r
38 }