示例#1
0
文件: Job.java 项目: walikazi/CSE523
  public Job() {
    boolean empty = false;

    ResponseTime = 0.0;
    ArrivalTime = Scheduler.CurrentTime();

    empty = MachineShop.JobQ.IsEmpty();
    MachineShop.JobQ.Enqueue(this);
    MachineShop.TotalJobs++;

    if (empty && !MachineShop.M.Processing() && MachineShop.M.IsOperational()) {
      try {
        MachineShop.M.Activate();
      } catch (SimulationException e) {
      } catch (RestartException e) {
      }
    }
  }
示例#2
0
文件: Job.java 项目: walikazi/CSE523
 public void finished() {
   ResponseTime = Scheduler.CurrentTime() - ArrivalTime;
   MachineShop.TotalResponseTime += ResponseTime;
 }