Job.java

作者: Lairai | 来源:发表于2018-06-08 12:06 被阅读0次
/**
 * 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;
    }

}

相关文章

  • Job.java

  • MapReduce

    提交 提交源码 Job.java 提交进JobSubmitter.java 切片 切片源码 JobSubmitte...

网友评论

      本文标题:Job.java

      本文链接:https://www.haomeiwen.com/subject/abaosftx.html