/* Time Sharing Computer Using Discrete State Simulation Test Program 2 CS509 Assignment 2 Winter 1995 G. Lindstrom */ import sim.*; class my_job extends job { my_job(String s) { super(s); } void body() { run(10); scheduler.hold(5); // do some I/O run(20); scheduler.hold(15); // do some I/O run(30); scheduler.hold(25); // do some I/O remove_job(); terminate(); } } class CPU_gen extends process { CPU_gen(String s) { super(s); } void body() { scheduler.hold(7); global.peruvian = new CPU("peruvian", 0); scheduler.hold(37); global.asylum = new CPU("asylum", 10); scheduler.hold(53); global.lal = new CPU("lal", 5); terminate(); } } class global { static CPU peruvian; static CPU asylum; static CPU lal; public static void main(String av[]) { scheduler.activate(new my_job("payroll")); scheduler.activate(new my_job("taxes")); scheduler.activate(new my_job("billing")); scheduler.activate(new my_job("file save")); scheduler.activate(new my_job("doom")); scheduler.activate(new CPU_gen("CPU generator")); scheduler.run_simulation(); peruvian.remove_cpu(); asylum.remove_cpu(); lal.remove_cpu(); System.exit(0); } }