说明

2018-06-08  本文已影响0人  Lairai

实现了FCFS和SJF两种调度算法,可以输入作业序列得到调度顺序和执行时间
使用姿势如下

import java.util.Scanner;

/**
 * Created by Lairai on 2018/1/15.
 */

public class Test {
    static final String PROMPT = "**********\n1 for FCSC\n2 for SJF\n**********";
    public static void main(String args[]) {
        Scanner scanner = new Scanner(System.in);
        System.out.print("Input memory size (in MB): ");
        int size = scanner.nextInt();
        System.out.println("Input the schedule algorithm:\n" + PROMPT);
        int algorithm = scanner.nextInt();
        Schedule schedule = new Schedule(size, algorithm);
        schedule.work();
        schedule.printScheduleInfo();
    }
}
上一篇下一篇

猜你喜欢

热点阅读