Job.java

/** * Created by Lairai on 2018/1/14. */ public class Job { private String name; private Time et; //entry time private Time st; //start time private Time ft; //finish time private int ert; //expected running time private int rrt; //real running time private int ia; //initial address in memory private int nc; //needed capacity private int tt; //周转时间 private double wt; //带权周转时间public Job(String name, int entryHour, int entryMinute, int ert, int nc) { this.name = name; this.et = new Time(entryHour, entryMinute); this.ert = ert; this.nc = nc; rrt = 0; }/** * Calculates mt and wt when a job's execution is finished. */ public void calculateTurnover() { this.tt = Time.getInterval(et, ft); this.wt = (double)tt / (double)ert; }public boolean finished() { return (ert == rrt); }public void executeByMinite() { ++rrt; }public Time getFt() { return ft; }public String getName() { return name; }public Time getSt() { return st; }public int getErt() { return ert; }public int getIa() {return ia; }public int getNc() { return nc; }public int getTt() { return tt; }public double getWt() { return wt; }public Time getEt() { return et; }public void setSt(Time st) { this.st = st; }public void setIa(int ia) { this.ia = ia; }public void setFt(Time ft) { this.ft = ft; }}

    推荐阅读