├── .gitignore ├── input ├── input-6.txt ├── input-1.txt ├── input-7.txt ├── input-2.txt ├── input-3.txt ├── input-5.txt └── input-4.txt ├── scheduling lab specs.pdf ├── output ├── rr-output-1.txt ├── sjf-output-1.txt ├── fcfs-output-1.txt ├── hprn-output-1.txt ├── rr-output-2.txt ├── sjf-output-2.txt ├── fcfs-output-2.txt ├── hprn-output-2.txt ├── rr-output-3.txt ├── rr-output-6.txt ├── sjf-output-3.txt ├── sjf-output-6.txt ├── fcfs-output-3.txt ├── fcfs-output-6.txt ├── hprn-output-3.txt ├── hprn-output-6.txt ├── rr-output-7.txt ├── sjf-output-7.txt ├── rr-output-5.txt ├── sjf-output-5.txt ├── fcfs-output-7.txt ├── hprn-output-7.txt ├── fcfs-output-5.txt ├── hprn-output-5.txt ├── rr-output-4.txt ├── sjf-output-4.txt ├── fcfs-output-4.txt └── hprn-output-4.txt ├── src ├── glb.py ├── scheduler.py ├── util.py ├── algorithms.py └── process.py ├── output_verbose ├── rr-output-1-detailed.txt ├── sjf-output-1-detailed.txt ├── fcfs-output-1-detailed.txt ├── hprn-output-1-detailed.txt ├── rr-output-2-detailed.txt ├── sjf-output-2-detailed.txt ├── fcfs-output-2-detailed.txt ├── hprn-output-2-detailed.txt ├── rr-output-3-detailed.txt ├── fcfs-output-3-detailed.txt ├── hprn-output-3-detailed.txt ├── sjf-output-3-detailed.txt ├── rr-output-6-detailed.txt ├── fcfs-output-6-detailed.txt ├── hprn-output-6-detailed.txt ├── sjf-output-6-detailed.txt ├── rr-output-7-detailed.txt ├── fcfs-output-7-detailed.txt ├── hprn-output-7-detailed.txt ├── sjf-output-7-detailed.txt ├── fcfs-output-5-detailed.txt ├── hprn-output-5-detailed.txt ├── rr-output-5-detailed.txt └── sjf-output-5-detailed.txt ├── output_show-random ├── rr-output-1-show-random.txt ├── sjf-output-1-show-random.txt ├── fcfs-output-1-show-random.txt ├── hprn-output-1-show-random.txt ├── rr-output-2-show-random.txt ├── sjf-output-2-show-random.txt ├── fcfs-output-2-show-random.txt ├── hprn-output-2-show-random.txt ├── rr-output-3-show-random.txt ├── fcfs-output-3-show-random.txt ├── hprn-output-3-show-random.txt ├── sjf-output-3-show-random.txt ├── rr-output-6-show-random.txt ├── fcfs-output-6-show-random.txt ├── hprn-output-6-show-random.txt ├── sjf-output-6-show-random.txt ├── rr-output-7-show-random.txt ├── fcfs-output-7-show-random.txt ├── hprn-output-7-show-random.txt ├── sjf-output-7-show-random.txt ├── fcfs-output-5-show-random.txt ├── hprn-output-5-show-random.txt └── rr-output-5-show-random.txt ├── README.md └── download.sh /.gitignore: -------------------------------------------------------------------------------- 1 | __pycache__/ 2 | -------------------------------------------------------------------------------- /input/input-6.txt: -------------------------------------------------------------------------------- 1 | 3 0 1 5 1 0 1 5 1 0 1 10 1 2 | -------------------------------------------------------------------------------- /input/input-1.txt: -------------------------------------------------------------------------------- 1 | 1 0 1 5 1 about as easy as possible 2 | -------------------------------------------------------------------------------- /input/input-7.txt: -------------------------------------------------------------------------------- 1 | 3 0 1 20 1 0 1 20 1 10 1 10 1 2 | -------------------------------------------------------------------------------- /input/input-2.txt: -------------------------------------------------------------------------------- 1 | 2 0 1 5 1 0 1 5 1 should alternate with FCFS 2 | -------------------------------------------------------------------------------- /input/input-3.txt: -------------------------------------------------------------------------------- 1 | 3 0 1 5 1 0 1 5 1 3 1 5 1 still ``desk checkable'' 2 | -------------------------------------------------------------------------------- /input/input-5.txt: -------------------------------------------------------------------------------- 1 | 3 1 5 30 2 1 5 30 2 0 5 30 2 the last has highest priority 2 | -------------------------------------------------------------------------------- /input/input-4.txt: -------------------------------------------------------------------------------- 1 | 5 0 3 200 3 0 9 500 2 0 20 500 1 100 1 100 3 100 100 500 1 2 | -------------------------------------------------------------------------------- /scheduling lab specs.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simonseo/schedulinglab/HEAD/scheduling lab specs.pdf -------------------------------------------------------------------------------- /output/rr-output-1.txt: -------------------------------------------------------------------------------- 1 | The original input was: 1 (0 1 5 1) 2 | The (sorted) input is: 1 (0 1 5 1) 3 | 4 | The scheduling algorithm used was Round Robbin 5 | 6 | Process 0: 7 | (A,B,C,M) = (0,1,5,1) 8 | Finishing time: 9 9 | Turnaround time: 9 10 | I/O time: 4 11 | Waiting time: 0 12 | 13 | Summary Data: 14 | Finishing time: 9 15 | CPU Utilization: 0.555556 16 | I/O Utilization: 0.444444 17 | Throughput: 11.111111 processes per hundred cycles 18 | Average turnaround time: 9.000000 19 | Average waiting time: 0.000000 20 | -------------------------------------------------------------------------------- /output/sjf-output-1.txt: -------------------------------------------------------------------------------- 1 | The original input was: 1 (0 1 5 1) 2 | The (sorted) input is: 1 (0 1 5 1) 3 | 4 | The scheduling algorithm used was Shortest Job First 5 | 6 | Process 0: 7 | (A,B,C,M) = (0,1,5,1) 8 | Finishing time: 9 9 | Turnaround time: 9 10 | I/O time: 4 11 | Waiting time: 0 12 | 13 | Summary Data: 14 | Finishing time: 9 15 | CPU Utilization: 0.555556 16 | I/O Utilization: 0.444444 17 | Throughput: 11.111111 processes per hundred cycles 18 | Average turnaround time: 9.000000 19 | Average waiting time: 0.000000 20 | -------------------------------------------------------------------------------- /output/fcfs-output-1.txt: -------------------------------------------------------------------------------- 1 | The original input was: 1 (0 1 5 1) 2 | The (sorted) input is: 1 (0 1 5 1) 3 | 4 | The scheduling algorithm used was First Come First Served 5 | 6 | Process 0: 7 | (A,B,C,M) = (0,1,5,1) 8 | Finishing time: 9 9 | Turnaround time: 9 10 | I/O time: 4 11 | Waiting time: 0 12 | 13 | Summary Data: 14 | Finishing time: 9 15 | CPU Utilization: 0.555556 16 | I/O Utilization: 0.444444 17 | Throughput: 11.111111 processes per hundred cycles 18 | Average turnaround time: 9.000000 19 | Average waiting time: 0.000000 20 | -------------------------------------------------------------------------------- /output/hprn-output-1.txt: -------------------------------------------------------------------------------- 1 | The original input was: 1 (0 1 5 1) 2 | The (sorted) input is: 1 (0 1 5 1) 3 | 4 | The scheduling algorithm used was Highest Penalty Ratio Next 5 | 6 | Process 0: 7 | (A,B,C,M) = (0,1,5,1) 8 | Finishing time: 9 9 | Turnaround time: 9 10 | I/O time: 4 11 | Waiting time: 0 12 | 13 | Summary Data: 14 | Finishing time: 9 15 | CPU Utilization: 0.555556 16 | I/O Utilization: 0.444444 17 | Throughput: 11.111111 processes per hundred cycles 18 | Average turnaround time: 9.000000 19 | Average waiting time: 0.000000 20 | -------------------------------------------------------------------------------- /src/glb.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | # @File Name: glb.py 4 | # @Created: 2017-10-17 00:44:56 seo (simon.seo@nyu.edu) 5 | # @Updated: 2017-10-17 12:48:02 Simon Seo (simon.seo@nyu.edu) 6 | 7 | def init(): 8 | global v, sr, f, r, rf, tk, q 9 | v = False #option: verbose 10 | sr = False #option: show random number used 11 | f = '' #input file name 12 | rf = 'random-numbers.txt' #random number file name 13 | r = None #random number generator object 14 | tk = None #timekeeper object 15 | q = False #for round robin quantum: False or q -------------------------------------------------------------------------------- /output/rr-output-2.txt: -------------------------------------------------------------------------------- 1 | The original input was: 2 (0 1 5 1) (0 1 5 1) 2 | The (sorted) input is: 2 (0 1 5 1) (0 1 5 1) 3 | 4 | The scheduling algorithm used was Round Robbin 5 | 6 | Process 0: 7 | (A,B,C,M) = (0,1,5,1) 8 | Finishing time: 9 9 | Turnaround time: 9 10 | I/O time: 4 11 | Waiting time: 0 12 | 13 | Process 1: 14 | (A,B,C,M) = (0,1,5,1) 15 | Finishing time: 10 16 | Turnaround time: 10 17 | I/O time: 4 18 | Waiting time: 1 19 | 20 | Summary Data: 21 | Finishing time: 10 22 | CPU Utilization: 1.000000 23 | I/O Utilization: 0.800000 24 | Throughput: 20.000000 processes per hundred cycles 25 | Average turnaround time: 9.500000 26 | Average waiting time: 0.500000 27 | -------------------------------------------------------------------------------- /output/sjf-output-2.txt: -------------------------------------------------------------------------------- 1 | The original input was: 2 (0 1 5 1) (0 1 5 1) 2 | The (sorted) input is: 2 (0 1 5 1) (0 1 5 1) 3 | 4 | The scheduling algorithm used was Shortest Job First 5 | 6 | Process 0: 7 | (A,B,C,M) = (0,1,5,1) 8 | Finishing time: 9 9 | Turnaround time: 9 10 | I/O time: 4 11 | Waiting time: 0 12 | 13 | Process 1: 14 | (A,B,C,M) = (0,1,5,1) 15 | Finishing time: 10 16 | Turnaround time: 10 17 | I/O time: 4 18 | Waiting time: 1 19 | 20 | Summary Data: 21 | Finishing time: 10 22 | CPU Utilization: 1.000000 23 | I/O Utilization: 0.800000 24 | Throughput: 20.000000 processes per hundred cycles 25 | Average turnaround time: 9.500000 26 | Average waiting time: 0.500000 27 | -------------------------------------------------------------------------------- /output/fcfs-output-2.txt: -------------------------------------------------------------------------------- 1 | The original input was: 2 (0 1 5 1) (0 1 5 1) 2 | The (sorted) input is: 2 (0 1 5 1) (0 1 5 1) 3 | 4 | The scheduling algorithm used was First Come First Served 5 | 6 | Process 0: 7 | (A,B,C,M) = (0,1,5,1) 8 | Finishing time: 9 9 | Turnaround time: 9 10 | I/O time: 4 11 | Waiting time: 0 12 | 13 | Process 1: 14 | (A,B,C,M) = (0,1,5,1) 15 | Finishing time: 10 16 | Turnaround time: 10 17 | I/O time: 4 18 | Waiting time: 1 19 | 20 | Summary Data: 21 | Finishing time: 10 22 | CPU Utilization: 1.000000 23 | I/O Utilization: 0.800000 24 | Throughput: 20.000000 processes per hundred cycles 25 | Average turnaround time: 9.500000 26 | Average waiting time: 0.500000 27 | -------------------------------------------------------------------------------- /output/hprn-output-2.txt: -------------------------------------------------------------------------------- 1 | The original input was: 2 (0 1 5 1) (0 1 5 1) 2 | The (sorted) input is: 2 (0 1 5 1) (0 1 5 1) 3 | 4 | The scheduling algorithm used was Highest Penalty Ratio Next 5 | 6 | Process 0: 7 | (A,B,C,M) = (0,1,5,1) 8 | Finishing time: 9 9 | Turnaround time: 9 10 | I/O time: 4 11 | Waiting time: 0 12 | 13 | Process 1: 14 | (A,B,C,M) = (0,1,5,1) 15 | Finishing time: 10 16 | Turnaround time: 10 17 | I/O time: 4 18 | Waiting time: 1 19 | 20 | Summary Data: 21 | Finishing time: 10 22 | CPU Utilization: 1.000000 23 | I/O Utilization: 0.800000 24 | Throughput: 20.000000 processes per hundred cycles 25 | Average turnaround time: 9.500000 26 | Average waiting time: 0.500000 27 | -------------------------------------------------------------------------------- /output/rr-output-3.txt: -------------------------------------------------------------------------------- 1 | The original input was: 3 (0 1 5 1) (0 1 5 1) (3 1 5 1) 2 | The (sorted) input is: 3 (0 1 5 1) (0 1 5 1) (3 1 5 1) 3 | 4 | The scheduling algorithm used was Round Robbin 5 | 6 | Process 0: 7 | (A,B,C,M) = (0,1,5,1) 8 | Finishing time: 12 9 | Turnaround time: 12 10 | I/O time: 4 11 | Waiting time: 3 12 | 13 | Process 1: 14 | (A,B,C,M) = (0,1,5,1) 15 | Finishing time: 13 16 | Turnaround time: 13 17 | I/O time: 4 18 | Waiting time: 4 19 | 20 | Process 2: 21 | (A,B,C,M) = (3,1,5,1) 22 | Finishing time: 16 23 | Turnaround time: 13 24 | I/O time: 4 25 | Waiting time: 4 26 | 27 | Summary Data: 28 | Finishing time: 16 29 | CPU Utilization: 0.937500 30 | I/O Utilization: 0.750000 31 | Throughput: 18.750000 processes per hundred cycles 32 | Average turnaround time: 12.666667 33 | Average waiting time: 3.666667 34 | -------------------------------------------------------------------------------- /output/rr-output-6.txt: -------------------------------------------------------------------------------- 1 | The original input was: 3 (0 1 5 1) (0 1 5 1) (0 1 10 1) 2 | The (sorted) input is: 3 (0 1 5 1) (0 1 5 1) (0 1 10 1) 3 | 4 | The scheduling algorithm used was Round Robbin 5 | 6 | Process 0: 7 | (A,B,C,M) = (0,1,5,1) 8 | Finishing time: 13 9 | Turnaround time: 13 10 | I/O time: 4 11 | Waiting time: 4 12 | 13 | Process 1: 14 | (A,B,C,M) = (0,1,5,1) 15 | Finishing time: 14 16 | Turnaround time: 14 17 | I/O time: 4 18 | Waiting time: 5 19 | 20 | Process 2: 21 | (A,B,C,M) = (0,1,10,1) 22 | Finishing time: 25 23 | Turnaround time: 25 24 | I/O time: 9 25 | Waiting time: 6 26 | 27 | Summary Data: 28 | Finishing time: 25 29 | CPU Utilization: 0.800000 30 | I/O Utilization: 0.680000 31 | Throughput: 12.000000 processes per hundred cycles 32 | Average turnaround time: 17.333334 33 | Average waiting time: 5.000000 34 | -------------------------------------------------------------------------------- /output/sjf-output-3.txt: -------------------------------------------------------------------------------- 1 | The original input was: 3 (0 1 5 1) (0 1 5 1) (3 1 5 1) 2 | The (sorted) input is: 3 (0 1 5 1) (0 1 5 1) (3 1 5 1) 3 | 4 | The scheduling algorithm used was Shortest Job First 5 | 6 | Process 0: 7 | (A,B,C,M) = (0,1,5,1) 8 | Finishing time: 9 9 | Turnaround time: 9 10 | I/O time: 4 11 | Waiting time: 0 12 | 13 | Process 1: 14 | (A,B,C,M) = (0,1,5,1) 15 | Finishing time: 10 16 | Turnaround time: 10 17 | I/O time: 4 18 | Waiting time: 1 19 | 20 | Process 2: 21 | (A,B,C,M) = (3,1,5,1) 22 | Finishing time: 19 23 | Turnaround time: 16 24 | I/O time: 4 25 | Waiting time: 7 26 | 27 | Summary Data: 28 | Finishing time: 19 29 | CPU Utilization: 0.789474 30 | I/O Utilization: 0.631579 31 | Throughput: 15.789474 processes per hundred cycles 32 | Average turnaround time: 11.666667 33 | Average waiting time: 2.666667 34 | -------------------------------------------------------------------------------- /output/sjf-output-6.txt: -------------------------------------------------------------------------------- 1 | The original input was: 3 (0 1 5 1) (0 1 5 1) (0 1 10 1) 2 | The (sorted) input is: 3 (0 1 5 1) (0 1 5 1) (0 1 10 1) 3 | 4 | The scheduling algorithm used was Shortest Job First 5 | 6 | Process 0: 7 | (A,B,C,M) = (0,1,5,1) 8 | Finishing time: 9 9 | Turnaround time: 9 10 | I/O time: 4 11 | Waiting time: 0 12 | 13 | Process 1: 14 | (A,B,C,M) = (0,1,5,1) 15 | Finishing time: 10 16 | Turnaround time: 10 17 | I/O time: 4 18 | Waiting time: 1 19 | 20 | Process 2: 21 | (A,B,C,M) = (0,1,10,1) 22 | Finishing time: 29 23 | Turnaround time: 29 24 | I/O time: 9 25 | Waiting time: 10 26 | 27 | Summary Data: 28 | Finishing time: 29 29 | CPU Utilization: 0.689655 30 | I/O Utilization: 0.586207 31 | Throughput: 10.344828 processes per hundred cycles 32 | Average turnaround time: 16.000000 33 | Average waiting time: 3.666667 34 | -------------------------------------------------------------------------------- /output/fcfs-output-3.txt: -------------------------------------------------------------------------------- 1 | The original input was: 3 (0 1 5 1) (0 1 5 1) (3 1 5 1) 2 | The (sorted) input is: 3 (0 1 5 1) (0 1 5 1) (3 1 5 1) 3 | 4 | The scheduling algorithm used was First Come First Served 5 | 6 | Process 0: 7 | (A,B,C,M) = (0,1,5,1) 8 | Finishing time: 12 9 | Turnaround time: 12 10 | I/O time: 4 11 | Waiting time: 3 12 | 13 | Process 1: 14 | (A,B,C,M) = (0,1,5,1) 15 | Finishing time: 13 16 | Turnaround time: 13 17 | I/O time: 4 18 | Waiting time: 4 19 | 20 | Process 2: 21 | (A,B,C,M) = (3,1,5,1) 22 | Finishing time: 16 23 | Turnaround time: 13 24 | I/O time: 4 25 | Waiting time: 4 26 | 27 | Summary Data: 28 | Finishing time: 16 29 | CPU Utilization: 0.937500 30 | I/O Utilization: 0.750000 31 | Throughput: 18.750000 processes per hundred cycles 32 | Average turnaround time: 12.666667 33 | Average waiting time: 3.666667 34 | -------------------------------------------------------------------------------- /output/fcfs-output-6.txt: -------------------------------------------------------------------------------- 1 | The original input was: 3 (0 1 5 1) (0 1 5 1) (0 1 10 1) 2 | The (sorted) input is: 3 (0 1 5 1) (0 1 5 1) (0 1 10 1) 3 | 4 | The scheduling algorithm used was First Come First Served 5 | 6 | Process 0: 7 | (A,B,C,M) = (0,1,5,1) 8 | Finishing time: 13 9 | Turnaround time: 13 10 | I/O time: 4 11 | Waiting time: 4 12 | 13 | Process 1: 14 | (A,B,C,M) = (0,1,5,1) 15 | Finishing time: 14 16 | Turnaround time: 14 17 | I/O time: 4 18 | Waiting time: 5 19 | 20 | Process 2: 21 | (A,B,C,M) = (0,1,10,1) 22 | Finishing time: 25 23 | Turnaround time: 25 24 | I/O time: 9 25 | Waiting time: 6 26 | 27 | Summary Data: 28 | Finishing time: 25 29 | CPU Utilization: 0.800000 30 | I/O Utilization: 0.680000 31 | Throughput: 12.000000 processes per hundred cycles 32 | Average turnaround time: 17.333334 33 | Average waiting time: 5.000000 34 | -------------------------------------------------------------------------------- /output/hprn-output-3.txt: -------------------------------------------------------------------------------- 1 | The original input was: 3 (0 1 5 1) (0 1 5 1) (3 1 5 1) 2 | The (sorted) input is: 3 (0 1 5 1) (0 1 5 1) (3 1 5 1) 3 | 4 | The scheduling algorithm used was Highest Penalty Ratio Next 5 | 6 | Process 0: 7 | (A,B,C,M) = (0,1,5,1) 8 | Finishing time: 12 9 | Turnaround time: 12 10 | I/O time: 4 11 | Waiting time: 3 12 | 13 | Process 1: 14 | (A,B,C,M) = (0,1,5,1) 15 | Finishing time: 13 16 | Turnaround time: 13 17 | I/O time: 4 18 | Waiting time: 4 19 | 20 | Process 2: 21 | (A,B,C,M) = (3,1,5,1) 22 | Finishing time: 16 23 | Turnaround time: 13 24 | I/O time: 4 25 | Waiting time: 4 26 | 27 | Summary Data: 28 | Finishing time: 16 29 | CPU Utilization: 0.937500 30 | I/O Utilization: 0.750000 31 | Throughput: 18.750000 processes per hundred cycles 32 | Average turnaround time: 12.666667 33 | Average waiting time: 3.666667 34 | -------------------------------------------------------------------------------- /output/hprn-output-6.txt: -------------------------------------------------------------------------------- 1 | The original input was: 3 (0 1 5 1) (0 1 5 1) (0 1 10 1) 2 | The (sorted) input is: 3 (0 1 5 1) (0 1 5 1) (0 1 10 1) 3 | 4 | The scheduling algorithm used was Highest Penalty Ratio Next 5 | 6 | Process 0: 7 | (A,B,C,M) = (0,1,5,1) 8 | Finishing time: 13 9 | Turnaround time: 13 10 | I/O time: 4 11 | Waiting time: 4 12 | 13 | Process 1: 14 | (A,B,C,M) = (0,1,5,1) 15 | Finishing time: 14 16 | Turnaround time: 14 17 | I/O time: 4 18 | Waiting time: 5 19 | 20 | Process 2: 21 | (A,B,C,M) = (0,1,10,1) 22 | Finishing time: 25 23 | Turnaround time: 25 24 | I/O time: 9 25 | Waiting time: 6 26 | 27 | Summary Data: 28 | Finishing time: 25 29 | CPU Utilization: 0.800000 30 | I/O Utilization: 0.680000 31 | Throughput: 12.000000 processes per hundred cycles 32 | Average turnaround time: 17.333334 33 | Average waiting time: 5.000000 34 | -------------------------------------------------------------------------------- /output/rr-output-7.txt: -------------------------------------------------------------------------------- 1 | The original input was: 3 (0 1 20 1) (0 1 20 1) (10 1 10 1) 2 | The (sorted) input is: 3 (0 1 20 1) (0 1 20 1) (10 1 10 1) 3 | 4 | The scheduling algorithm used was Round Robbin 5 | 6 | Process 0: 7 | (A,B,C,M) = (0,1,20,1) 8 | Finishing time: 49 9 | Turnaround time: 49 10 | I/O time: 19 11 | Waiting time: 10 12 | 13 | Process 1: 14 | (A,B,C,M) = (0,1,20,1) 15 | Finishing time: 50 16 | Turnaround time: 50 17 | I/O time: 19 18 | Waiting time: 11 19 | 20 | Process 2: 21 | (A,B,C,M) = (10,1,10,1) 22 | Finishing time: 39 23 | Turnaround time: 29 24 | I/O time: 9 25 | Waiting time: 10 26 | 27 | Summary Data: 28 | Finishing time: 50 29 | CPU Utilization: 1.000000 30 | I/O Utilization: 0.940000 31 | Throughput: 6.000000 processes per hundred cycles 32 | Average turnaround time: 42.666668 33 | Average waiting time: 10.333333 34 | -------------------------------------------------------------------------------- /output/sjf-output-7.txt: -------------------------------------------------------------------------------- 1 | The original input was: 3 (0 1 20 1) (0 1 20 1) (10 1 10 1) 2 | The (sorted) input is: 3 (0 1 20 1) (0 1 20 1) (10 1 10 1) 3 | 4 | The scheduling algorithm used was Shortest Job First 5 | 6 | Process 0: 7 | (A,B,C,M) = (0,1,20,1) 8 | Finishing time: 40 9 | Turnaround time: 40 10 | I/O time: 19 11 | Waiting time: 1 12 | 13 | Process 1: 14 | (A,B,C,M) = (0,1,20,1) 15 | Finishing time: 59 16 | Turnaround time: 59 17 | I/O time: 19 18 | Waiting time: 20 19 | 20 | Process 2: 21 | (A,B,C,M) = (10,1,10,1) 22 | Finishing time: 29 23 | Turnaround time: 19 24 | I/O time: 9 25 | Waiting time: 0 26 | 27 | Summary Data: 28 | Finishing time: 59 29 | CPU Utilization: 0.847458 30 | I/O Utilization: 0.796610 31 | Throughput: 5.084746 processes per hundred cycles 32 | Average turnaround time: 39.333332 33 | Average waiting time: 7.000000 34 | -------------------------------------------------------------------------------- /output/rr-output-5.txt: -------------------------------------------------------------------------------- 1 | The original input was: 3 (1 5 30 2) (1 5 30 2) (0 5 30 2) 2 | The (sorted) input is: 3 (0 5 30 2) (1 5 30 2) (1 5 30 2) 3 | 4 | The scheduling algorithm used was Round Robbin 5 | 6 | Process 0: 7 | (A,B,C,M) = (0,5,30,2) 8 | Finishing time: 106 9 | Turnaround time: 106 10 | I/O time: 56 11 | Waiting time: 20 12 | 13 | Process 1: 14 | (A,B,C,M) = (1,5,30,2) 15 | Finishing time: 104 16 | Turnaround time: 103 17 | I/O time: 54 18 | Waiting time: 19 19 | 20 | Process 2: 21 | (A,B,C,M) = (1,5,30,2) 22 | Finishing time: 109 23 | Turnaround time: 108 24 | I/O time: 54 25 | Waiting time: 24 26 | 27 | Summary Data: 28 | Finishing time: 109 29 | CPU Utilization: 0.825688 30 | I/O Utilization: 0.825688 31 | Throughput: 2.752294 processes per hundred cycles 32 | Average turnaround time: 105.666664 33 | Average waiting time: 21.000000 34 | -------------------------------------------------------------------------------- /output/sjf-output-5.txt: -------------------------------------------------------------------------------- 1 | The original input was: 3 (1 5 30 2) (1 5 30 2) (0 5 30 2) 2 | The (sorted) input is: 3 (0 5 30 2) (1 5 30 2) (1 5 30 2) 3 | 4 | The scheduling algorithm used was Shortest Job First 5 | 6 | Process 0: 7 | (A,B,C,M) = (0,5,30,2) 8 | Finishing time: 90 9 | Turnaround time: 90 10 | I/O time: 54 11 | Waiting time: 6 12 | 13 | Process 1: 14 | (A,B,C,M) = (1,5,30,2) 15 | Finishing time: 100 16 | Turnaround time: 99 17 | I/O time: 52 18 | Waiting time: 17 19 | 20 | Process 2: 21 | (A,B,C,M) = (1,5,30,2) 22 | Finishing time: 111 23 | Turnaround time: 110 24 | I/O time: 56 25 | Waiting time: 24 26 | 27 | Summary Data: 28 | Finishing time: 111 29 | CPU Utilization: 0.810811 30 | I/O Utilization: 0.873874 31 | Throughput: 2.702703 processes per hundred cycles 32 | Average turnaround time: 99.666664 33 | Average waiting time: 15.666667 34 | -------------------------------------------------------------------------------- /output/fcfs-output-7.txt: -------------------------------------------------------------------------------- 1 | The original input was: 3 (0 1 20 1) (0 1 20 1) (10 1 10 1) 2 | The (sorted) input is: 3 (0 1 20 1) (0 1 20 1) (10 1 10 1) 3 | 4 | The scheduling algorithm used was First Come First Served 5 | 6 | Process 0: 7 | (A,B,C,M) = (0,1,20,1) 8 | Finishing time: 49 9 | Turnaround time: 49 10 | I/O time: 19 11 | Waiting time: 10 12 | 13 | Process 1: 14 | (A,B,C,M) = (0,1,20,1) 15 | Finishing time: 50 16 | Turnaround time: 50 17 | I/O time: 19 18 | Waiting time: 11 19 | 20 | Process 2: 21 | (A,B,C,M) = (10,1,10,1) 22 | Finishing time: 39 23 | Turnaround time: 29 24 | I/O time: 9 25 | Waiting time: 10 26 | 27 | Summary Data: 28 | Finishing time: 50 29 | CPU Utilization: 1.000000 30 | I/O Utilization: 0.940000 31 | Throughput: 6.000000 processes per hundred cycles 32 | Average turnaround time: 42.666668 33 | Average waiting time: 10.333333 34 | -------------------------------------------------------------------------------- /output/hprn-output-7.txt: -------------------------------------------------------------------------------- 1 | The original input was: 3 (0 1 20 1) (0 1 20 1) (10 1 10 1) 2 | The (sorted) input is: 3 (0 1 20 1) (0 1 20 1) (10 1 10 1) 3 | 4 | The scheduling algorithm used was Highest Penalty Ratio Next 5 | 6 | Process 0: 7 | (A,B,C,M) = (0,1,20,1) 8 | Finishing time: 49 9 | Turnaround time: 49 10 | I/O time: 19 11 | Waiting time: 10 12 | 13 | Process 1: 14 | (A,B,C,M) = (0,1,20,1) 15 | Finishing time: 50 16 | Turnaround time: 50 17 | I/O time: 19 18 | Waiting time: 11 19 | 20 | Process 2: 21 | (A,B,C,M) = (10,1,10,1) 22 | Finishing time: 36 23 | Turnaround time: 26 24 | I/O time: 9 25 | Waiting time: 7 26 | 27 | Summary Data: 28 | Finishing time: 50 29 | CPU Utilization: 1.000000 30 | I/O Utilization: 0.940000 31 | Throughput: 6.000000 processes per hundred cycles 32 | Average turnaround time: 41.666668 33 | Average waiting time: 9.333333 34 | -------------------------------------------------------------------------------- /output/fcfs-output-5.txt: -------------------------------------------------------------------------------- 1 | The original input was: 3 (1 5 30 2) (1 5 30 2) (0 5 30 2) 2 | The (sorted) input is: 3 (0 5 30 2) (1 5 30 2) (1 5 30 2) 3 | 4 | The scheduling algorithm used was First Come First Served 5 | 6 | Process 0: 7 | (A,B,C,M) = (0,5,30,2) 8 | Finishing time: 102 9 | Turnaround time: 102 10 | I/O time: 58 11 | Waiting time: 14 12 | 13 | Process 1: 14 | (A,B,C,M) = (1,5,30,2) 15 | Finishing time: 105 16 | Turnaround time: 104 17 | I/O time: 54 18 | Waiting time: 20 19 | 20 | Process 2: 21 | (A,B,C,M) = (1,5,30,2) 22 | Finishing time: 101 23 | Turnaround time: 100 24 | I/O time: 52 25 | Waiting time: 18 26 | 27 | Summary Data: 28 | Finishing time: 105 29 | CPU Utilization: 0.857143 30 | I/O Utilization: 0.876190 31 | Throughput: 2.857143 processes per hundred cycles 32 | Average turnaround time: 102.000000 33 | Average waiting time: 17.333334 34 | -------------------------------------------------------------------------------- /output/hprn-output-5.txt: -------------------------------------------------------------------------------- 1 | The original input was: 3 (1 5 30 2) (1 5 30 2) (0 5 30 2) 2 | The (sorted) input is: 3 (0 5 30 2) (1 5 30 2) (1 5 30 2) 3 | 4 | The scheduling algorithm used was Highest Penalty Ratio Next 5 | 6 | Process 0: 7 | (A,B,C,M) = (0,5,30,2) 8 | Finishing time: 103 9 | Turnaround time: 103 10 | I/O time: 56 11 | Waiting time: 17 12 | 13 | Process 1: 14 | (A,B,C,M) = (1,5,30,2) 15 | Finishing time: 101 16 | Turnaround time: 100 17 | I/O time: 52 18 | Waiting time: 18 19 | 20 | Process 2: 21 | (A,B,C,M) = (1,5,30,2) 22 | Finishing time: 105 23 | Turnaround time: 104 24 | I/O time: 56 25 | Waiting time: 18 26 | 27 | Summary Data: 28 | Finishing time: 105 29 | CPU Utilization: 0.857143 30 | I/O Utilization: 0.876190 31 | Throughput: 2.857143 processes per hundred cycles 32 | Average turnaround time: 102.333336 33 | Average waiting time: 17.666666 34 | -------------------------------------------------------------------------------- /output_verbose/rr-output-1-detailed.txt: -------------------------------------------------------------------------------- 1 | The original input was: 1 (0 1 5 1) 2 | The (sorted) input is: 1 (0 1 5 1) 3 | 4 | This detailed printout gives the state and remaining burst for each process 5 | 6 | Before cycle 0: unstarted 0. 7 | Before cycle 1: running 1. 8 | Before cycle 2: blocked 1. 9 | Before cycle 3: running 1. 10 | Before cycle 4: blocked 1. 11 | Before cycle 5: running 1. 12 | Before cycle 6: blocked 1. 13 | Before cycle 7: running 1. 14 | Before cycle 8: blocked 1. 15 | Before cycle 9: running 1. 16 | The scheduling algorithm used was Round Robbin 17 | 18 | Process 0: 19 | (A,B,C,M) = (0,1,5,1) 20 | Finishing time: 9 21 | Turnaround time: 9 22 | I/O time: 4 23 | Waiting time: 0 24 | 25 | Summary Data: 26 | Finishing time: 9 27 | CPU Utilization: 0.555556 28 | I/O Utilization: 0.444444 29 | Throughput: 11.111111 processes per hundred cycles 30 | Average turnaround time: 9.000000 31 | Average waiting time: 0.000000 32 | -------------------------------------------------------------------------------- /output_verbose/sjf-output-1-detailed.txt: -------------------------------------------------------------------------------- 1 | The original input was: 1 (0 1 5 1) 2 | The (sorted) input is: 1 (0 1 5 1) 3 | 4 | This detailed printout gives the state and remaining burst for each process 5 | 6 | Before cycle 0: unstarted 0. 7 | Before cycle 1: running 1. 8 | Before cycle 2: blocked 1. 9 | Before cycle 3: running 1. 10 | Before cycle 4: blocked 1. 11 | Before cycle 5: running 1. 12 | Before cycle 6: blocked 1. 13 | Before cycle 7: running 1. 14 | Before cycle 8: blocked 1. 15 | Before cycle 9: running 1. 16 | The scheduling algorithm used was Shortest Job First 17 | 18 | Process 0: 19 | (A,B,C,M) = (0,1,5,1) 20 | Finishing time: 9 21 | Turnaround time: 9 22 | I/O time: 4 23 | Waiting time: 0 24 | 25 | Summary Data: 26 | Finishing time: 9 27 | CPU Utilization: 0.555556 28 | I/O Utilization: 0.444444 29 | Throughput: 11.111111 processes per hundred cycles 30 | Average turnaround time: 9.000000 31 | Average waiting time: 0.000000 32 | -------------------------------------------------------------------------------- /output_verbose/fcfs-output-1-detailed.txt: -------------------------------------------------------------------------------- 1 | The original input was: 1 (0 1 5 1) 2 | The (sorted) input is: 1 (0 1 5 1) 3 | 4 | This detailed printout gives the state and remaining burst for each process 5 | 6 | Before cycle 0: unstarted 0. 7 | Before cycle 1: running 1. 8 | Before cycle 2: blocked 1. 9 | Before cycle 3: running 1. 10 | Before cycle 4: blocked 1. 11 | Before cycle 5: running 1. 12 | Before cycle 6: blocked 1. 13 | Before cycle 7: running 1. 14 | Before cycle 8: blocked 1. 15 | Before cycle 9: running 1. 16 | The scheduling algorithm used was First Come First Served 17 | 18 | Process 0: 19 | (A,B,C,M) = (0,1,5,1) 20 | Finishing time: 9 21 | Turnaround time: 9 22 | I/O time: 4 23 | Waiting time: 0 24 | 25 | Summary Data: 26 | Finishing time: 9 27 | CPU Utilization: 0.555556 28 | I/O Utilization: 0.444444 29 | Throughput: 11.111111 processes per hundred cycles 30 | Average turnaround time: 9.000000 31 | Average waiting time: 0.000000 32 | -------------------------------------------------------------------------------- /output_verbose/hprn-output-1-detailed.txt: -------------------------------------------------------------------------------- 1 | The original input was: 1 (0 1 5 1) 2 | The (sorted) input is: 1 (0 1 5 1) 3 | 4 | This detailed printout gives the state and remaining burst for each process 5 | 6 | Before cycle 0: unstarted 0. 7 | Before cycle 1: running 1. 8 | Before cycle 2: blocked 1. 9 | Before cycle 3: running 1. 10 | Before cycle 4: blocked 1. 11 | Before cycle 5: running 1. 12 | Before cycle 6: blocked 1. 13 | Before cycle 7: running 1. 14 | Before cycle 8: blocked 1. 15 | Before cycle 9: running 1. 16 | The scheduling algorithm used was Highest Penalty Ratio Next 17 | 18 | Process 0: 19 | (A,B,C,M) = (0,1,5,1) 20 | Finishing time: 9 21 | Turnaround time: 9 22 | I/O time: 4 23 | Waiting time: 0 24 | 25 | Summary Data: 26 | Finishing time: 9 27 | CPU Utilization: 0.555556 28 | I/O Utilization: 0.444444 29 | Throughput: 11.111111 processes per hundred cycles 30 | Average turnaround time: 9.000000 31 | Average waiting time: 0.000000 32 | -------------------------------------------------------------------------------- /output/rr-output-4.txt: -------------------------------------------------------------------------------- 1 | The original input was: 5 (0 3 200 3) (0 9 500 2) (0 20 500 1) (100 1 100 3) (100 100 500 1) 2 | The (sorted) input is: 5 (0 3 200 3) (0 9 500 2) (0 20 500 1) (100 1 100 3) (100 100 500 1) 3 | 4 | The scheduling algorithm used was Round Robbin 5 | 6 | Process 0: 7 | (A,B,C,M) = (0,3,200,3) 8 | Finishing time: 1193 9 | Turnaround time: 1193 10 | I/O time: 597 11 | Waiting time: 396 12 | 13 | Process 1: 14 | (A,B,C,M) = (0,9,500,2) 15 | Finishing time: 2115 16 | Turnaround time: 2115 17 | I/O time: 996 18 | Waiting time: 619 19 | 20 | Process 2: 21 | (A,B,C,M) = (0,20,500,1) 22 | Finishing time: 1725 23 | Turnaround time: 1725 24 | I/O time: 490 25 | Waiting time: 735 26 | 27 | Process 3: 28 | (A,B,C,M) = (100,1,100,3) 29 | Finishing time: 897 30 | Turnaround time: 797 31 | I/O time: 297 32 | Waiting time: 400 33 | 34 | Process 4: 35 | (A,B,C,M) = (100,100,500,1) 36 | Finishing time: 1824 37 | Turnaround time: 1724 38 | I/O time: 475 39 | Waiting time: 749 40 | 41 | Summary Data: 42 | Finishing time: 2115 43 | CPU Utilization: 0.851064 44 | I/O Utilization: 0.790071 45 | Throughput: 0.236407 processes per hundred cycles 46 | Average turnaround time: 1510.800049 47 | Average waiting time: 579.799988 48 | -------------------------------------------------------------------------------- /output/sjf-output-4.txt: -------------------------------------------------------------------------------- 1 | The original input was: 5 (0 3 200 3) (0 9 500 2) (0 20 500 1) (100 1 100 3) (100 100 500 1) 2 | The (sorted) input is: 5 (0 3 200 3) (0 9 500 2) (0 20 500 1) (100 1 100 3) (100 100 500 1) 3 | 4 | The scheduling algorithm used was Shortest Job First 5 | 6 | Process 0: 7 | (A,B,C,M) = (0,3,200,3) 8 | Finishing time: 1633 9 | Turnaround time: 1633 10 | I/O time: 597 11 | Waiting time: 836 12 | 13 | Process 1: 14 | (A,B,C,M) = (0,9,500,2) 15 | Finishing time: 2374 16 | Turnaround time: 2374 17 | I/O time: 996 18 | Waiting time: 878 19 | 20 | Process 2: 21 | (A,B,C,M) = (0,20,500,1) 22 | Finishing time: 1550 23 | Turnaround time: 1550 24 | I/O time: 491 25 | Waiting time: 559 26 | 27 | Process 3: 28 | (A,B,C,M) = (100,1,100,3) 29 | Finishing time: 1309 30 | Turnaround time: 1209 31 | I/O time: 297 32 | Waiting time: 812 33 | 34 | Process 4: 35 | (A,B,C,M) = (100,100,500,1) 36 | Finishing time: 1205 37 | Turnaround time: 1105 38 | I/O time: 476 39 | Waiting time: 129 40 | 41 | Summary Data: 42 | Finishing time: 2374 43 | CPU Utilization: 0.758214 44 | I/O Utilization: 0.703875 45 | Throughput: 0.210615 processes per hundred cycles 46 | Average turnaround time: 1574.199951 47 | Average waiting time: 642.799988 48 | -------------------------------------------------------------------------------- /output/fcfs-output-4.txt: -------------------------------------------------------------------------------- 1 | The original input was: 5 (0 3 200 3) (0 9 500 2) (0 20 500 1) (100 1 100 3) (100 100 500 1) 2 | The (sorted) input is: 5 (0 3 200 3) (0 9 500 2) (0 20 500 1) (100 1 100 3) (100 100 500 1) 3 | 4 | The scheduling algorithm used was First Come First Served 5 | 6 | Process 0: 7 | (A,B,C,M) = (0,3,200,3) 8 | Finishing time: 1806 9 | Turnaround time: 1806 10 | I/O time: 594 11 | Waiting time: 1012 12 | 13 | Process 1: 14 | (A,B,C,M) = (0,9,500,2) 15 | Finishing time: 2281 16 | Turnaround time: 2281 17 | I/O time: 994 18 | Waiting time: 787 19 | 20 | Process 2: 21 | (A,B,C,M) = (0,20,500,1) 22 | Finishing time: 1548 23 | Turnaround time: 1548 24 | I/O time: 487 25 | Waiting time: 561 26 | 27 | Process 3: 28 | (A,B,C,M) = (100,1,100,3) 29 | Finishing time: 1604 30 | Turnaround time: 1504 31 | I/O time: 297 32 | Waiting time: 1107 33 | 34 | Process 4: 35 | (A,B,C,M) = (100,100,500,1) 36 | Finishing time: 1113 37 | Turnaround time: 1013 38 | I/O time: 454 39 | Waiting time: 59 40 | 41 | Summary Data: 42 | Finishing time: 2281 43 | CPU Utilization: 0.789128 44 | I/O Utilization: 0.680403 45 | Throughput: 0.219202 processes per hundred cycles 46 | Average turnaround time: 1630.400024 47 | Average waiting time: 705.200012 48 | -------------------------------------------------------------------------------- /output/hprn-output-4.txt: -------------------------------------------------------------------------------- 1 | The original input was: 5 (0 3 200 3) (0 9 500 2) (0 20 500 1) (100 1 100 3) (100 100 500 1) 2 | The (sorted) input is: 5 (0 3 200 3) (0 9 500 2) (0 20 500 1) (100 1 100 3) (100 100 500 1) 3 | 4 | The scheduling algorithm used was Highest Penalty Ratio Next 5 | 6 | Process 0: 7 | (A,B,C,M) = (0,3,200,3) 8 | Finishing time: 1634 9 | Turnaround time: 1634 10 | I/O time: 597 11 | Waiting time: 837 12 | 13 | Process 1: 14 | (A,B,C,M) = (0,9,500,2) 15 | Finishing time: 2290 16 | Turnaround time: 2290 17 | I/O time: 994 18 | Waiting time: 796 19 | 20 | Process 2: 21 | (A,B,C,M) = (0,20,500,1) 22 | Finishing time: 1669 23 | Turnaround time: 1669 24 | I/O time: 492 25 | Waiting time: 677 26 | 27 | Process 3: 28 | (A,B,C,M) = (100,1,100,3) 29 | Finishing time: 1337 30 | Turnaround time: 1237 31 | I/O time: 297 32 | Waiting time: 840 33 | 34 | Process 4: 35 | (A,B,C,M) = (100,100,500,1) 36 | Finishing time: 1292 37 | Turnaround time: 1192 38 | I/O time: 492 39 | Waiting time: 200 40 | 41 | Summary Data: 42 | Finishing time: 2290 43 | CPU Utilization: 0.786026 44 | I/O Utilization: 0.686463 45 | Throughput: 0.218341 processes per hundred cycles 46 | Average turnaround time: 1604.400024 47 | Average waiting time: 670.000000 48 | -------------------------------------------------------------------------------- /src/scheduler.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | # @File Name: scheduler.py 4 | # @Created: 2017-10-13 18:57:02 seo (simon.seo@nyu.edu) 5 | # @Updated: 2017-10-19 17:21:52 Simon Seo (simon.seo@nyu.edu) 6 | import sys 7 | from copy import deepcopy as copy 8 | import glb 9 | from process import Process, ProcessTable 10 | from util import parseInput 11 | from algorithms import FCFS, RR, SJF, HPRN 12 | 13 | def main(): 14 | ps = ProcessTable() 15 | pspecs = parseInput(glb.f) 16 | for i in range(len(pspecs)): 17 | ps.append(Process(*pspecs[i], i)) 18 | print('The original input was: {} '.format(ps.__repr__())) 19 | ps.sortByArrival() 20 | print('The (sorted) input is: {} \n'.format(ps.__repr__())) 21 | 22 | if glb.v: 23 | print('This detailed printout gives the state and remaining burst for each process\n') 24 | 25 | FCFS().main(copy(ps)) 26 | RR().main(copy(ps), quantum=2) 27 | SJF().main(copy(ps)) 28 | HPRN().main(copy(ps)) 29 | 30 | 31 | if __name__ == '__main__': 32 | if len(sys.argv) == 1: 33 | sys.argv.append('--verbose') 34 | sys.argv.append('--show-random') 35 | sys.argv.append('input/input-1.txt') 36 | glb.init() 37 | glb.v = '--verbose' in sys.argv 38 | glb.sr = '--show-random' in sys.argv 39 | glb.f = sys.argv[-1] 40 | main() -------------------------------------------------------------------------------- /output_show-random/rr-output-1-show-random.txt: -------------------------------------------------------------------------------- 1 | The original input was: 1 (0 1 5 1) 2 | The (sorted) input is: 1 (0 1 5 1) 3 | 4 | This detailed printout gives the state and remaining burst for each process 5 | 6 | Before cycle 0: unstarted 0. 7 | Find burst when choosing ready process to run 1804289383 8 | Before cycle 1: running 1. 9 | Before cycle 2: blocked 1. 10 | Find burst when choosing ready process to run 846930886 11 | Before cycle 3: running 1. 12 | Before cycle 4: blocked 1. 13 | Find burst when choosing ready process to run 1681692777 14 | Before cycle 5: running 1. 15 | Before cycle 6: blocked 1. 16 | Find burst when choosing ready process to run 1714636915 17 | Before cycle 7: running 1. 18 | Before cycle 8: blocked 1. 19 | Find burst when choosing ready process to run 1957747793 20 | Before cycle 9: running 1. 21 | The scheduling algorithm used was Round Robbin 22 | 23 | Process 0: 24 | (A,B,C,M) = (0,1,5,1) 25 | Finishing time: 9 26 | Turnaround time: 9 27 | I/O time: 4 28 | Waiting time: 0 29 | 30 | Summary Data: 31 | Finishing time: 9 32 | CPU Utilization: 0.555556 33 | I/O Utilization: 0.444444 34 | Throughput: 11.111111 processes per hundred cycles 35 | Average turnaround time: 9.000000 36 | Average waiting time: 0.000000 37 | -------------------------------------------------------------------------------- /output_show-random/sjf-output-1-show-random.txt: -------------------------------------------------------------------------------- 1 | The original input was: 1 (0 1 5 1) 2 | The (sorted) input is: 1 (0 1 5 1) 3 | 4 | This detailed printout gives the state and remaining burst for each process 5 | 6 | Before cycle 0: unstarted 0. 7 | Find burst when choosing ready process to run 1804289383 8 | Before cycle 1: running 1. 9 | Before cycle 2: blocked 1. 10 | Find burst when choosing ready process to run 846930886 11 | Before cycle 3: running 1. 12 | Before cycle 4: blocked 1. 13 | Find burst when choosing ready process to run 1681692777 14 | Before cycle 5: running 1. 15 | Before cycle 6: blocked 1. 16 | Find burst when choosing ready process to run 1714636915 17 | Before cycle 7: running 1. 18 | Before cycle 8: blocked 1. 19 | Find burst when choosing ready process to run 1957747793 20 | Before cycle 9: running 1. 21 | The scheduling algorithm used was Shortest Job First 22 | 23 | Process 0: 24 | (A,B,C,M) = (0,1,5,1) 25 | Finishing time: 9 26 | Turnaround time: 9 27 | I/O time: 4 28 | Waiting time: 0 29 | 30 | Summary Data: 31 | Finishing time: 9 32 | CPU Utilization: 0.555556 33 | I/O Utilization: 0.444444 34 | Throughput: 11.111111 processes per hundred cycles 35 | Average turnaround time: 9.000000 36 | Average waiting time: 0.000000 37 | -------------------------------------------------------------------------------- /output_show-random/fcfs-output-1-show-random.txt: -------------------------------------------------------------------------------- 1 | The original input was: 1 (0 1 5 1) 2 | The (sorted) input is: 1 (0 1 5 1) 3 | 4 | This detailed printout gives the state and remaining burst for each process 5 | 6 | Before cycle 0: unstarted 0. 7 | Find burst when choosing ready process to run 1804289383 8 | Before cycle 1: running 1. 9 | Before cycle 2: blocked 1. 10 | Find burst when choosing ready process to run 846930886 11 | Before cycle 3: running 1. 12 | Before cycle 4: blocked 1. 13 | Find burst when choosing ready process to run 1681692777 14 | Before cycle 5: running 1. 15 | Before cycle 6: blocked 1. 16 | Find burst when choosing ready process to run 1714636915 17 | Before cycle 7: running 1. 18 | Before cycle 8: blocked 1. 19 | Find burst when choosing ready process to run 1957747793 20 | Before cycle 9: running 1. 21 | The scheduling algorithm used was First Come First Served 22 | 23 | Process 0: 24 | (A,B,C,M) = (0,1,5,1) 25 | Finishing time: 9 26 | Turnaround time: 9 27 | I/O time: 4 28 | Waiting time: 0 29 | 30 | Summary Data: 31 | Finishing time: 9 32 | CPU Utilization: 0.555556 33 | I/O Utilization: 0.444444 34 | Throughput: 11.111111 processes per hundred cycles 35 | Average turnaround time: 9.000000 36 | Average waiting time: 0.000000 37 | -------------------------------------------------------------------------------- /output_show-random/hprn-output-1-show-random.txt: -------------------------------------------------------------------------------- 1 | The original input was: 1 (0 1 5 1) 2 | The (sorted) input is: 1 (0 1 5 1) 3 | 4 | This detailed printout gives the state and remaining burst for each process 5 | 6 | Before cycle 0: unstarted 0. 7 | Find burst when choosing ready process to run 1804289383 8 | Before cycle 1: running 1. 9 | Before cycle 2: blocked 1. 10 | Find burst when choosing ready process to run 846930886 11 | Before cycle 3: running 1. 12 | Before cycle 4: blocked 1. 13 | Find burst when choosing ready process to run 1681692777 14 | Before cycle 5: running 1. 15 | Before cycle 6: blocked 1. 16 | Find burst when choosing ready process to run 1714636915 17 | Before cycle 7: running 1. 18 | Before cycle 8: blocked 1. 19 | Find burst when choosing ready process to run 1957747793 20 | Before cycle 9: running 1. 21 | The scheduling algorithm used was Highest Penalty Ratio Next 22 | 23 | Process 0: 24 | (A,B,C,M) = (0,1,5,1) 25 | Finishing time: 9 26 | Turnaround time: 9 27 | I/O time: 4 28 | Waiting time: 0 29 | 30 | Summary Data: 31 | Finishing time: 9 32 | CPU Utilization: 0.555556 33 | I/O Utilization: 0.444444 34 | Throughput: 11.111111 processes per hundred cycles 35 | Average turnaround time: 9.000000 36 | Average waiting time: 0.000000 37 | -------------------------------------------------------------------------------- /output_verbose/rr-output-2-detailed.txt: -------------------------------------------------------------------------------- 1 | The original input was: 2 (0 1 5 1) (0 1 5 1) 2 | The (sorted) input is: 2 (0 1 5 1) (0 1 5 1) 3 | 4 | This detailed printout gives the state and remaining burst for each process 5 | 6 | Before cycle 0: unstarted 0 unstarted 0. 7 | Before cycle 1: running 1 ready 0. 8 | Before cycle 2: blocked 1 running 1. 9 | Before cycle 3: running 1 blocked 1. 10 | Before cycle 4: blocked 1 running 1. 11 | Before cycle 5: running 1 blocked 1. 12 | Before cycle 6: blocked 1 running 1. 13 | Before cycle 7: running 1 blocked 1. 14 | Before cycle 8: blocked 1 running 1. 15 | Before cycle 9: running 1 blocked 1. 16 | Before cycle 10: terminated 0 running 1. 17 | The scheduling algorithm used was Round Robbin 18 | 19 | Process 0: 20 | (A,B,C,M) = (0,1,5,1) 21 | Finishing time: 9 22 | Turnaround time: 9 23 | I/O time: 4 24 | Waiting time: 0 25 | 26 | Process 1: 27 | (A,B,C,M) = (0,1,5,1) 28 | Finishing time: 10 29 | Turnaround time: 10 30 | I/O time: 4 31 | Waiting time: 1 32 | 33 | Summary Data: 34 | Finishing time: 10 35 | CPU Utilization: 1.000000 36 | I/O Utilization: 0.800000 37 | Throughput: 20.000000 processes per hundred cycles 38 | Average turnaround time: 9.500000 39 | Average waiting time: 0.500000 40 | -------------------------------------------------------------------------------- /output_verbose/sjf-output-2-detailed.txt: -------------------------------------------------------------------------------- 1 | The original input was: 2 (0 1 5 1) (0 1 5 1) 2 | The (sorted) input is: 2 (0 1 5 1) (0 1 5 1) 3 | 4 | This detailed printout gives the state and remaining burst for each process 5 | 6 | Before cycle 0: unstarted 0 unstarted 0. 7 | Before cycle 1: running 1 ready 0. 8 | Before cycle 2: blocked 1 running 1. 9 | Before cycle 3: running 1 blocked 1. 10 | Before cycle 4: blocked 1 running 1. 11 | Before cycle 5: running 1 blocked 1. 12 | Before cycle 6: blocked 1 running 1. 13 | Before cycle 7: running 1 blocked 1. 14 | Before cycle 8: blocked 1 running 1. 15 | Before cycle 9: running 1 blocked 1. 16 | Before cycle 10: terminated 0 running 1. 17 | The scheduling algorithm used was Shortest Job First 18 | 19 | Process 0: 20 | (A,B,C,M) = (0,1,5,1) 21 | Finishing time: 9 22 | Turnaround time: 9 23 | I/O time: 4 24 | Waiting time: 0 25 | 26 | Process 1: 27 | (A,B,C,M) = (0,1,5,1) 28 | Finishing time: 10 29 | Turnaround time: 10 30 | I/O time: 4 31 | Waiting time: 1 32 | 33 | Summary Data: 34 | Finishing time: 10 35 | CPU Utilization: 1.000000 36 | I/O Utilization: 0.800000 37 | Throughput: 20.000000 processes per hundred cycles 38 | Average turnaround time: 9.500000 39 | Average waiting time: 0.500000 40 | -------------------------------------------------------------------------------- /output_verbose/fcfs-output-2-detailed.txt: -------------------------------------------------------------------------------- 1 | The original input was: 2 (0 1 5 1) (0 1 5 1) 2 | The (sorted) input is: 2 (0 1 5 1) (0 1 5 1) 3 | 4 | This detailed printout gives the state and remaining burst for each process 5 | 6 | Before cycle 0: unstarted 0 unstarted 0. 7 | Before cycle 1: running 1 ready 0. 8 | Before cycle 2: blocked 1 running 1. 9 | Before cycle 3: running 1 blocked 1. 10 | Before cycle 4: blocked 1 running 1. 11 | Before cycle 5: running 1 blocked 1. 12 | Before cycle 6: blocked 1 running 1. 13 | Before cycle 7: running 1 blocked 1. 14 | Before cycle 8: blocked 1 running 1. 15 | Before cycle 9: running 1 blocked 1. 16 | Before cycle 10: terminated 0 running 1. 17 | The scheduling algorithm used was First Come First Served 18 | 19 | Process 0: 20 | (A,B,C,M) = (0,1,5,1) 21 | Finishing time: 9 22 | Turnaround time: 9 23 | I/O time: 4 24 | Waiting time: 0 25 | 26 | Process 1: 27 | (A,B,C,M) = (0,1,5,1) 28 | Finishing time: 10 29 | Turnaround time: 10 30 | I/O time: 4 31 | Waiting time: 1 32 | 33 | Summary Data: 34 | Finishing time: 10 35 | CPU Utilization: 1.000000 36 | I/O Utilization: 0.800000 37 | Throughput: 20.000000 processes per hundred cycles 38 | Average turnaround time: 9.500000 39 | Average waiting time: 0.500000 40 | -------------------------------------------------------------------------------- /output_verbose/hprn-output-2-detailed.txt: -------------------------------------------------------------------------------- 1 | The original input was: 2 (0 1 5 1) (0 1 5 1) 2 | The (sorted) input is: 2 (0 1 5 1) (0 1 5 1) 3 | 4 | This detailed printout gives the state and remaining burst for each process 5 | 6 | Before cycle 0: unstarted 0 unstarted 0. 7 | Before cycle 1: running 1 ready 0. 8 | Before cycle 2: blocked 1 running 1. 9 | Before cycle 3: running 1 blocked 1. 10 | Before cycle 4: blocked 1 running 1. 11 | Before cycle 5: running 1 blocked 1. 12 | Before cycle 6: blocked 1 running 1. 13 | Before cycle 7: running 1 blocked 1. 14 | Before cycle 8: blocked 1 running 1. 15 | Before cycle 9: running 1 blocked 1. 16 | Before cycle 10: terminated 0 running 1. 17 | The scheduling algorithm used was Highest Penalty Ratio Next 18 | 19 | Process 0: 20 | (A,B,C,M) = (0,1,5,1) 21 | Finishing time: 9 22 | Turnaround time: 9 23 | I/O time: 4 24 | Waiting time: 0 25 | 26 | Process 1: 27 | (A,B,C,M) = (0,1,5,1) 28 | Finishing time: 10 29 | Turnaround time: 10 30 | I/O time: 4 31 | Waiting time: 1 32 | 33 | Summary Data: 34 | Finishing time: 10 35 | CPU Utilization: 1.000000 36 | I/O Utilization: 0.800000 37 | Throughput: 20.000000 processes per hundred cycles 38 | Average turnaround time: 9.500000 39 | Average waiting time: 0.500000 40 | -------------------------------------------------------------------------------- /src/util.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | # @File Name: util.py 4 | # @Created: 2017-10-16 11:31:40 seo (simon.seo@nyu.edu) 5 | # @Updated: 2017-10-17 13:22:23 Simon Seo (simon.seo@nyu.edu) 6 | import glb 7 | import os 8 | 9 | class Timekeeper(): 10 | """Tracks time for all processes""" 11 | def __init__(self): 12 | self.now = 0 13 | def tick(self): 14 | self.now += 1 15 | def getNow(self): 16 | return self.now 17 | 18 | class Random(): 19 | """Random variable generator""" 20 | def __init__(self, filename): 21 | if not os.path.isfile(filename): 22 | raise Exception('The input file does not exist. The input filename should be the last argument.') 23 | self.file = open(filename,'r') 24 | def randInt(self): 25 | return int(self.file.readline().strip()) 26 | def randomOS(self, U): 27 | randInt = self.randInt() 28 | if glb.sr: 29 | print('Find burst when choosing ready process to run', randInt) 30 | return 1 + randInt % U 31 | 32 | def parseInput(filename): 33 | """returns list of process specs""" 34 | result = [] 35 | if not os.path.isfile(filename): 36 | raise Exception('The input file does not exist. The input filename should be the last argument.') 37 | with open(filename, 'r') as f: 38 | nums = [] 39 | for l in f: 40 | nums += [int(el) for el in l.strip().split() if el.isnumeric()] 41 | psl = nums.pop(0) #processes (list) length 42 | for i in range(psl): 43 | result.append(nums[4*i:4*i+4]) 44 | return result 45 | 46 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Scheduling Lab 2 | 3 | This is a lab exercise from NYU `CSIC-UA 202 Operating Systems` that emulates how different scheduling algorithms work in an OS. The algorithms implemented are: 4 | 5 | 1. FCFS (First Come First Serve) 6 | 2. RR (Round Robin) 7 | 3. SJF (Shortest Job First) 8 | 4. HPRN (Highest Penalty Ratio Next) 9 | 10 | ## Setup 11 | 12 | To run this program you need `python3`. It does not use external libraries. Download/clone this repository or cd into the repository. The sample inputs from Professor Gottlieb's website are already in the repository but if you wish you can download them with the following commandline in the repository directory. 13 | 14 | ```sh 15 | $ sh download.sh 16 | ``` 17 | 18 | Inside `glb.py` are the global variables used for this program. The only thing you might want to change is the location of the random number file. If you downloaded the files by using the `download.sh` file or by cloning the entire repo, the random number file should be in the root of the repository. 19 | 20 | ```py 21 | rf = 'random-numbers.txt' 22 | ``` 23 | 24 | # Run 25 | 26 | If you have the input files and the random number file, you can generally use this command to run the program: 27 | 28 | ```sh 29 | $ python3 scheduler.py 30 | ``` 31 | 32 | Additionally there are `--verbose` and `--show-random` options to show the state and burst of every process at each cycle and to show the random number selected, respectively. 33 | ```sh 34 | $ python3 scheduler.py --verbose 35 | $ python3 scheduler.py --show-random 36 | $ python3 scheduler.py --verbose --show-random 37 | ``` 38 | 39 | If the program is run without additional arguments it will automatically take `input/input-1.txt` as input with both `--verbose` and `--show-random` options. 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /download.sh: -------------------------------------------------------------------------------- 1 | mkdir input 2 | mkdir output 3 | mkdir detailed 4 | mkdir show-random 5 | 6 | curl "http://cs.nyu.edu/~gottlieb/courses/os202/labs/random-numbers" > random-numbers.txt 7 | 8 | cd input 9 | for i in {1..7} 10 | do 11 | curl "http://cs.nyu.edu/~gottlieb/courses/os202/labs/lab2/input-$i" > input-$i.txt 12 | done 13 | cd .. 14 | 15 | cd output 16 | for i in {1..7} 17 | do 18 | curl "http://cs.nyu.edu/~gottlieb/courses/os202/labs/lab2/fcfs-output-$i" > fcfs-output-$i.txt 19 | curl "http://cs.nyu.edu/~gottlieb/courses/os202/labs/lab2/rr-output-$i" > rr-output-$i.txt 20 | curl "http://cs.nyu.edu/~gottlieb/courses/os202/labs/lab2/sjf-output-$i" > sjf-output-$i.txt 21 | curl "http://cs.nyu.edu/~gottlieb/courses/os202/labs/lab2/hprn-output-$i" > hprn-output-$i.txt 22 | done 23 | cd .. 24 | 25 | 26 | cd detailed 27 | for i in {1..7} 28 | do 29 | curl "http://cs.nyu.edu/~gottlieb/courses/os202/labs/lab2/fcfs-output-$i-detailed" > fcfs-output-$i-detailed.txt 30 | curl "http://cs.nyu.edu/~gottlieb/courses/os202/labs/lab2/rr-output-$i-detailed" > rr-output-$i-detailed.txt 31 | curl "http://cs.nyu.edu/~gottlieb/courses/os202/labs/lab2/sjf-output-$i-detailed" > sjf-output-$i-detailed.txt 32 | curl "http://cs.nyu.edu/~gottlieb/courses/os202/labs/lab2/hprn-output-$i-detailed" > hprn-output-$i-detailed.txt 33 | done 34 | cd .. 35 | 36 | 37 | cd show-random 38 | for i in {1..7} 39 | do 40 | curl "http://cs.nyu.edu/~gottlieb/courses/os202/labs/lab2/fcfs-output-$i-show-random" > fcfs-output-$i-show-random.txt 41 | curl "http://cs.nyu.edu/~gottlieb/courses/os202/labs/lab2/rr-output-$i-show-random" > rr-output-$i-show-random.txt 42 | curl "http://cs.nyu.edu/~gottlieb/courses/os202/labs/lab2/sjf-output-$i-show-random" > sjf-output-$i-show-random.txt 43 | curl "http://cs.nyu.edu/~gottlieb/courses/os202/labs/lab2/hprn-output-$i-show-random" > hprn-output-$i-show-random.txt 44 | done 45 | cd .. 46 | -------------------------------------------------------------------------------- /output_show-random/rr-output-2-show-random.txt: -------------------------------------------------------------------------------- 1 | The original input was: 2 (0 1 5 1) (0 1 5 1) 2 | The (sorted) input is: 2 (0 1 5 1) (0 1 5 1) 3 | 4 | This detailed printout gives the state and remaining burst for each process 5 | 6 | Before cycle 0: unstarted 0 unstarted 0. 7 | Find burst when choosing ready process to run 1804289383 8 | Before cycle 1: running 1 ready 0. 9 | Find burst when choosing ready process to run 846930886 10 | Before cycle 2: blocked 1 running 1. 11 | Find burst when choosing ready process to run 1681692777 12 | Before cycle 3: running 1 blocked 1. 13 | Find burst when choosing ready process to run 1714636915 14 | Before cycle 4: blocked 1 running 1. 15 | Find burst when choosing ready process to run 1957747793 16 | Before cycle 5: running 1 blocked 1. 17 | Find burst when choosing ready process to run 424238335 18 | Before cycle 6: blocked 1 running 1. 19 | Find burst when choosing ready process to run 719885386 20 | Before cycle 7: running 1 blocked 1. 21 | Find burst when choosing ready process to run 1649760492 22 | Before cycle 8: blocked 1 running 1. 23 | Find burst when choosing ready process to run 596516649 24 | Before cycle 9: running 1 blocked 1. 25 | Find burst when choosing ready process to run 1189641421 26 | Before cycle 10: terminated 0 running 1. 27 | The scheduling algorithm used was Round Robbin 28 | 29 | Process 0: 30 | (A,B,C,M) = (0,1,5,1) 31 | Finishing time: 9 32 | Turnaround time: 9 33 | I/O time: 4 34 | Waiting time: 0 35 | 36 | Process 1: 37 | (A,B,C,M) = (0,1,5,1) 38 | Finishing time: 10 39 | Turnaround time: 10 40 | I/O time: 4 41 | Waiting time: 1 42 | 43 | Summary Data: 44 | Finishing time: 10 45 | CPU Utilization: 1.000000 46 | I/O Utilization: 0.800000 47 | Throughput: 20.000000 processes per hundred cycles 48 | Average turnaround time: 9.500000 49 | Average waiting time: 0.500000 50 | -------------------------------------------------------------------------------- /output_show-random/sjf-output-2-show-random.txt: -------------------------------------------------------------------------------- 1 | The original input was: 2 (0 1 5 1) (0 1 5 1) 2 | The (sorted) input is: 2 (0 1 5 1) (0 1 5 1) 3 | 4 | This detailed printout gives the state and remaining burst for each process 5 | 6 | Before cycle 0: unstarted 0 unstarted 0. 7 | Find burst when choosing ready process to run 1804289383 8 | Before cycle 1: running 1 ready 0. 9 | Find burst when choosing ready process to run 846930886 10 | Before cycle 2: blocked 1 running 1. 11 | Find burst when choosing ready process to run 1681692777 12 | Before cycle 3: running 1 blocked 1. 13 | Find burst when choosing ready process to run 1714636915 14 | Before cycle 4: blocked 1 running 1. 15 | Find burst when choosing ready process to run 1957747793 16 | Before cycle 5: running 1 blocked 1. 17 | Find burst when choosing ready process to run 424238335 18 | Before cycle 6: blocked 1 running 1. 19 | Find burst when choosing ready process to run 719885386 20 | Before cycle 7: running 1 blocked 1. 21 | Find burst when choosing ready process to run 1649760492 22 | Before cycle 8: blocked 1 running 1. 23 | Find burst when choosing ready process to run 596516649 24 | Before cycle 9: running 1 blocked 1. 25 | Find burst when choosing ready process to run 1189641421 26 | Before cycle 10: terminated 0 running 1. 27 | The scheduling algorithm used was Shortest Job First 28 | 29 | Process 0: 30 | (A,B,C,M) = (0,1,5,1) 31 | Finishing time: 9 32 | Turnaround time: 9 33 | I/O time: 4 34 | Waiting time: 0 35 | 36 | Process 1: 37 | (A,B,C,M) = (0,1,5,1) 38 | Finishing time: 10 39 | Turnaround time: 10 40 | I/O time: 4 41 | Waiting time: 1 42 | 43 | Summary Data: 44 | Finishing time: 10 45 | CPU Utilization: 1.000000 46 | I/O Utilization: 0.800000 47 | Throughput: 20.000000 processes per hundred cycles 48 | Average turnaround time: 9.500000 49 | Average waiting time: 0.500000 50 | -------------------------------------------------------------------------------- /output_show-random/fcfs-output-2-show-random.txt: -------------------------------------------------------------------------------- 1 | The original input was: 2 (0 1 5 1) (0 1 5 1) 2 | The (sorted) input is: 2 (0 1 5 1) (0 1 5 1) 3 | 4 | This detailed printout gives the state and remaining burst for each process 5 | 6 | Before cycle 0: unstarted 0 unstarted 0. 7 | Find burst when choosing ready process to run 1804289383 8 | Before cycle 1: running 1 ready 0. 9 | Find burst when choosing ready process to run 846930886 10 | Before cycle 2: blocked 1 running 1. 11 | Find burst when choosing ready process to run 1681692777 12 | Before cycle 3: running 1 blocked 1. 13 | Find burst when choosing ready process to run 1714636915 14 | Before cycle 4: blocked 1 running 1. 15 | Find burst when choosing ready process to run 1957747793 16 | Before cycle 5: running 1 blocked 1. 17 | Find burst when choosing ready process to run 424238335 18 | Before cycle 6: blocked 1 running 1. 19 | Find burst when choosing ready process to run 719885386 20 | Before cycle 7: running 1 blocked 1. 21 | Find burst when choosing ready process to run 1649760492 22 | Before cycle 8: blocked 1 running 1. 23 | Find burst when choosing ready process to run 596516649 24 | Before cycle 9: running 1 blocked 1. 25 | Find burst when choosing ready process to run 1189641421 26 | Before cycle 10: terminated 0 running 1. 27 | The scheduling algorithm used was First Come First Served 28 | 29 | Process 0: 30 | (A,B,C,M) = (0,1,5,1) 31 | Finishing time: 9 32 | Turnaround time: 9 33 | I/O time: 4 34 | Waiting time: 0 35 | 36 | Process 1: 37 | (A,B,C,M) = (0,1,5,1) 38 | Finishing time: 10 39 | Turnaround time: 10 40 | I/O time: 4 41 | Waiting time: 1 42 | 43 | Summary Data: 44 | Finishing time: 10 45 | CPU Utilization: 1.000000 46 | I/O Utilization: 0.800000 47 | Throughput: 20.000000 processes per hundred cycles 48 | Average turnaround time: 9.500000 49 | Average waiting time: 0.500000 50 | -------------------------------------------------------------------------------- /output_show-random/hprn-output-2-show-random.txt: -------------------------------------------------------------------------------- 1 | The original input was: 2 (0 1 5 1) (0 1 5 1) 2 | The (sorted) input is: 2 (0 1 5 1) (0 1 5 1) 3 | 4 | This detailed printout gives the state and remaining burst for each process 5 | 6 | Before cycle 0: unstarted 0 unstarted 0. 7 | Find burst when choosing ready process to run 1804289383 8 | Before cycle 1: running 1 ready 0. 9 | Find burst when choosing ready process to run 846930886 10 | Before cycle 2: blocked 1 running 1. 11 | Find burst when choosing ready process to run 1681692777 12 | Before cycle 3: running 1 blocked 1. 13 | Find burst when choosing ready process to run 1714636915 14 | Before cycle 4: blocked 1 running 1. 15 | Find burst when choosing ready process to run 1957747793 16 | Before cycle 5: running 1 blocked 1. 17 | Find burst when choosing ready process to run 424238335 18 | Before cycle 6: blocked 1 running 1. 19 | Find burst when choosing ready process to run 719885386 20 | Before cycle 7: running 1 blocked 1. 21 | Find burst when choosing ready process to run 1649760492 22 | Before cycle 8: blocked 1 running 1. 23 | Find burst when choosing ready process to run 596516649 24 | Before cycle 9: running 1 blocked 1. 25 | Find burst when choosing ready process to run 1189641421 26 | Before cycle 10: terminated 0 running 1. 27 | The scheduling algorithm used was Highest Penalty Ratio Next 28 | 29 | Process 0: 30 | (A,B,C,M) = (0,1,5,1) 31 | Finishing time: 9 32 | Turnaround time: 9 33 | I/O time: 4 34 | Waiting time: 0 35 | 36 | Process 1: 37 | (A,B,C,M) = (0,1,5,1) 38 | Finishing time: 10 39 | Turnaround time: 10 40 | I/O time: 4 41 | Waiting time: 1 42 | 43 | Summary Data: 44 | Finishing time: 10 45 | CPU Utilization: 1.000000 46 | I/O Utilization: 0.800000 47 | Throughput: 20.000000 processes per hundred cycles 48 | Average turnaround time: 9.500000 49 | Average waiting time: 0.500000 50 | -------------------------------------------------------------------------------- /output_verbose/rr-output-3-detailed.txt: -------------------------------------------------------------------------------- 1 | The original input was: 3 (0 1 5 1) (0 1 5 1) (3 1 5 1) 2 | The (sorted) input is: 3 (0 1 5 1) (0 1 5 1) (3 1 5 1) 3 | 4 | This detailed printout gives the state and remaining burst for each process 5 | 6 | Before cycle 0: unstarted 0 unstarted 0 unstarted 0. 7 | Before cycle 1: running 1 ready 0 unstarted 0. 8 | Before cycle 2: blocked 1 running 1 unstarted 0. 9 | Before cycle 3: running 1 blocked 1 unstarted 0. 10 | Before cycle 4: blocked 1 running 1 ready 0. 11 | Before cycle 5: ready 0 blocked 1 running 1. 12 | Before cycle 6: running 1 ready 0 blocked 1. 13 | Before cycle 7: blocked 1 running 1 ready 0. 14 | Before cycle 8: ready 0 blocked 1 running 1. 15 | Before cycle 9: running 1 ready 0 blocked 1. 16 | Before cycle 10: blocked 1 running 1 ready 0. 17 | Before cycle 11: ready 0 blocked 1 running 1. 18 | Before cycle 12: running 1 ready 0 blocked 1. 19 | Before cycle 13: terminated 0 running 1 ready 0. 20 | Before cycle 14: terminated 0 terminated 0 running 1. 21 | Before cycle 15: terminated 0 terminated 0 blocked 1. 22 | Before cycle 16: terminated 0 terminated 0 running 1. 23 | The scheduling algorithm used was Round Robbin 24 | 25 | Process 0: 26 | (A,B,C,M) = (0,1,5,1) 27 | Finishing time: 12 28 | Turnaround time: 12 29 | I/O time: 4 30 | Waiting time: 3 31 | 32 | Process 1: 33 | (A,B,C,M) = (0,1,5,1) 34 | Finishing time: 13 35 | Turnaround time: 13 36 | I/O time: 4 37 | Waiting time: 4 38 | 39 | Process 2: 40 | (A,B,C,M) = (3,1,5,1) 41 | Finishing time: 16 42 | Turnaround time: 13 43 | I/O time: 4 44 | Waiting time: 4 45 | 46 | Summary Data: 47 | Finishing time: 16 48 | CPU Utilization: 0.937500 49 | I/O Utilization: 0.750000 50 | Throughput: 18.750000 processes per hundred cycles 51 | Average turnaround time: 12.666667 52 | Average waiting time: 3.666667 53 | -------------------------------------------------------------------------------- /output_verbose/fcfs-output-3-detailed.txt: -------------------------------------------------------------------------------- 1 | The original input was: 3 (0 1 5 1) (0 1 5 1) (3 1 5 1) 2 | The (sorted) input is: 3 (0 1 5 1) (0 1 5 1) (3 1 5 1) 3 | 4 | This detailed printout gives the state and remaining burst for each process 5 | 6 | Before cycle 0: unstarted 0 unstarted 0 unstarted 0. 7 | Before cycle 1: running 1 ready 0 unstarted 0. 8 | Before cycle 2: blocked 1 running 1 unstarted 0. 9 | Before cycle 3: running 1 blocked 1 unstarted 0. 10 | Before cycle 4: blocked 1 running 1 ready 0. 11 | Before cycle 5: ready 0 blocked 1 running 1. 12 | Before cycle 6: running 1 ready 0 blocked 1. 13 | Before cycle 7: blocked 1 running 1 ready 0. 14 | Before cycle 8: ready 0 blocked 1 running 1. 15 | Before cycle 9: running 1 ready 0 blocked 1. 16 | Before cycle 10: blocked 1 running 1 ready 0. 17 | Before cycle 11: ready 0 blocked 1 running 1. 18 | Before cycle 12: running 1 ready 0 blocked 1. 19 | Before cycle 13: terminated 0 running 1 ready 0. 20 | Before cycle 14: terminated 0 terminated 0 running 1. 21 | Before cycle 15: terminated 0 terminated 0 blocked 1. 22 | Before cycle 16: terminated 0 terminated 0 running 1. 23 | The scheduling algorithm used was First Come First Served 24 | 25 | Process 0: 26 | (A,B,C,M) = (0,1,5,1) 27 | Finishing time: 12 28 | Turnaround time: 12 29 | I/O time: 4 30 | Waiting time: 3 31 | 32 | Process 1: 33 | (A,B,C,M) = (0,1,5,1) 34 | Finishing time: 13 35 | Turnaround time: 13 36 | I/O time: 4 37 | Waiting time: 4 38 | 39 | Process 2: 40 | (A,B,C,M) = (3,1,5,1) 41 | Finishing time: 16 42 | Turnaround time: 13 43 | I/O time: 4 44 | Waiting time: 4 45 | 46 | Summary Data: 47 | Finishing time: 16 48 | CPU Utilization: 0.937500 49 | I/O Utilization: 0.750000 50 | Throughput: 18.750000 processes per hundred cycles 51 | Average turnaround time: 12.666667 52 | Average waiting time: 3.666667 53 | -------------------------------------------------------------------------------- /output_verbose/hprn-output-3-detailed.txt: -------------------------------------------------------------------------------- 1 | The original input was: 3 (0 1 5 1) (0 1 5 1) (3 1 5 1) 2 | The (sorted) input is: 3 (0 1 5 1) (0 1 5 1) (3 1 5 1) 3 | 4 | This detailed printout gives the state and remaining burst for each process 5 | 6 | Before cycle 0: unstarted 0 unstarted 0 unstarted 0. 7 | Before cycle 1: running 1 ready 0 unstarted 0. 8 | Before cycle 2: blocked 1 running 1 unstarted 0. 9 | Before cycle 3: running 1 blocked 1 unstarted 0. 10 | Before cycle 4: blocked 1 running 1 ready 0. 11 | Before cycle 5: running 1 blocked 1 ready 0. 12 | Before cycle 6: blocked 1 running 1 ready 0. 13 | Before cycle 7: ready 0 blocked 1 running 1. 14 | Before cycle 8: running 1 ready 0 blocked 1. 15 | Before cycle 9: blocked 1 ready 0 running 1. 16 | Before cycle 10: ready 0 running 1 blocked 1. 17 | Before cycle 11: ready 0 blocked 1 running 1. 18 | Before cycle 12: running 1 ready 0 blocked 1. 19 | Before cycle 13: terminated 0 running 1 ready 0. 20 | Before cycle 14: terminated 0 terminated 0 running 1. 21 | Before cycle 15: terminated 0 terminated 0 blocked 1. 22 | Before cycle 16: terminated 0 terminated 0 running 1. 23 | The scheduling algorithm used was Highest Penalty Ratio Next 24 | 25 | Process 0: 26 | (A,B,C,M) = (0,1,5,1) 27 | Finishing time: 12 28 | Turnaround time: 12 29 | I/O time: 4 30 | Waiting time: 3 31 | 32 | Process 1: 33 | (A,B,C,M) = (0,1,5,1) 34 | Finishing time: 13 35 | Turnaround time: 13 36 | I/O time: 4 37 | Waiting time: 4 38 | 39 | Process 2: 40 | (A,B,C,M) = (3,1,5,1) 41 | Finishing time: 16 42 | Turnaround time: 13 43 | I/O time: 4 44 | Waiting time: 4 45 | 46 | Summary Data: 47 | Finishing time: 16 48 | CPU Utilization: 0.937500 49 | I/O Utilization: 0.750000 50 | Throughput: 18.750000 processes per hundred cycles 51 | Average turnaround time: 12.666667 52 | Average waiting time: 3.666667 53 | -------------------------------------------------------------------------------- /src/algorithms.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | # @File Name: algorithms.py 4 | # @Created: 2017-10-16 13:50:51 seo (simon.seo@nyu.edu) 5 | # @Updated: 2017-10-19 17:28:16 Simon Seo (simon.seo@nyu.edu) 6 | import sys 7 | import glb 8 | from util import Timekeeper, Random 9 | 10 | class SchedulingAlgorithm(): 11 | """superclass of all scheduling algorithms""" 12 | def __init__(self, algoName): 13 | self.tk = glb.tk = Timekeeper() # Reset time 14 | self.algoName = algoName 15 | glb.r = Random(glb.rf) # Reset Random numbers 16 | def main(self, ps, sortFunctionStr): 17 | while not ps.finished(): 18 | if glb.v: 19 | print('Before cycle{}: {}.'.format((' '*5+str(self.tk.getNow()))[-5:],ps)) 20 | ps.tickAll() # advance/deduct all time variables 21 | ps.updateStateAll() # update state accordingly 22 | if not len(ps.getByState('running')): # if there is no running process 23 | readyps = ps.getByState('ready').sortByInput().sortByArrival() 24 | readyps = getattr(readyps, sortFunctionStr)() # sort function will differ by algo 25 | if len(readyps) > 0: 26 | readyps.pop(0).run() 27 | self.tk.tick() # advance 1 cycle 28 | print('\nThe scheduling algorithm used was {}\n'.format(self.algoName)) 29 | ps.printSummaryAll() 30 | 31 | class FCFS(SchedulingAlgorithm): 32 | """First Come First Serve""" 33 | def __init__(self): 34 | super().__init__('First Come First Serve') 35 | def main(self, ps): 36 | super().main(ps, 'sortByReady') 37 | 38 | class RR(SchedulingAlgorithm): 39 | """Round Robin""" 40 | def __init__(self): 41 | super().__init__('Round Robin') 42 | def main(self, ps, quantum): 43 | glb.q = quantum 44 | super().main(ps, 'sortByReady') 45 | glb.q = False 46 | 47 | class SJF(SchedulingAlgorithm): 48 | """Shortest Job First: total time remaining (i.e., the 49 | input value C minus the number of cycles this process has run)""" 50 | def __init__(self): 51 | super().__init__('Shortest Job First') 52 | def main(self, ps): 53 | super().main(ps, 'sortByJob') 54 | 55 | class HPRN(SchedulingAlgorithm): 56 | """Highest Priority Ratio Next""" 57 | def __init__(self): 58 | super().__init__('Highest Priority Ratio Next') 59 | def main(self, ps): 60 | super().main(ps, 'sortByRatio') -------------------------------------------------------------------------------- /output_verbose/sjf-output-3-detailed.txt: -------------------------------------------------------------------------------- 1 | The original input was: 3 (0 1 5 1) (0 1 5 1) (3 1 5 1) 2 | The (sorted) input is: 3 (0 1 5 1) (0 1 5 1) (3 1 5 1) 3 | 4 | This detailed printout gives the state and remaining burst for each process 5 | 6 | Before cycle 0: unstarted 0 unstarted 0 unstarted 0. 7 | Before cycle 1: running 1 ready 0 unstarted 0. 8 | Before cycle 2: blocked 1 running 1 unstarted 0. 9 | Before cycle 3: running 1 blocked 1 unstarted 0. 10 | Before cycle 4: blocked 1 running 1 ready 0. 11 | Before cycle 5: running 1 blocked 1 ready 0. 12 | Before cycle 6: blocked 1 running 1 ready 0. 13 | Before cycle 7: running 1 blocked 1 ready 0. 14 | Before cycle 8: blocked 1 running 1 ready 0. 15 | Before cycle 9: running 1 blocked 1 ready 0. 16 | Before cycle 10: terminated 0 running 1 ready 0. 17 | Before cycle 11: terminated 0 terminated 0 running 1. 18 | Before cycle 12: terminated 0 terminated 0 blocked 1. 19 | Before cycle 13: terminated 0 terminated 0 running 1. 20 | Before cycle 14: terminated 0 terminated 0 blocked 1. 21 | Before cycle 15: terminated 0 terminated 0 running 1. 22 | Before cycle 16: terminated 0 terminated 0 blocked 1. 23 | Before cycle 17: terminated 0 terminated 0 running 1. 24 | Before cycle 18: terminated 0 terminated 0 blocked 1. 25 | Before cycle 19: terminated 0 terminated 0 running 1. 26 | The scheduling algorithm used was Shortest Job First 27 | 28 | Process 0: 29 | (A,B,C,M) = (0,1,5,1) 30 | Finishing time: 9 31 | Turnaround time: 9 32 | I/O time: 4 33 | Waiting time: 0 34 | 35 | Process 1: 36 | (A,B,C,M) = (0,1,5,1) 37 | Finishing time: 10 38 | Turnaround time: 10 39 | I/O time: 4 40 | Waiting time: 1 41 | 42 | Process 2: 43 | (A,B,C,M) = (3,1,5,1) 44 | Finishing time: 19 45 | Turnaround time: 16 46 | I/O time: 4 47 | Waiting time: 7 48 | 49 | Summary Data: 50 | Finishing time: 19 51 | CPU Utilization: 0.789474 52 | I/O Utilization: 0.631579 53 | Throughput: 15.789474 processes per hundred cycles 54 | Average turnaround time: 11.666667 55 | Average waiting time: 2.666667 56 | -------------------------------------------------------------------------------- /output_verbose/rr-output-6-detailed.txt: -------------------------------------------------------------------------------- 1 | The original input was: 3 (0 1 5 1) (0 1 5 1) (0 1 10 1) 2 | The (sorted) input is: 3 (0 1 5 1) (0 1 5 1) (0 1 10 1) 3 | 4 | This detailed printout gives the state and remaining burst for each process 5 | 6 | Before cycle 0: unstarted 0 unstarted 0 unstarted 0. 7 | Before cycle 1: running 1 ready 0 ready 0. 8 | Before cycle 2: blocked 1 running 1 ready 0. 9 | Before cycle 3: ready 0 blocked 1 running 1. 10 | Before cycle 4: running 1 ready 0 blocked 1. 11 | Before cycle 5: blocked 1 running 1 ready 0. 12 | Before cycle 6: ready 0 blocked 1 running 1. 13 | Before cycle 7: running 1 ready 0 blocked 1. 14 | Before cycle 8: blocked 1 running 1 ready 0. 15 | Before cycle 9: ready 0 blocked 1 running 1. 16 | Before cycle 10: running 1 ready 0 blocked 1. 17 | Before cycle 11: blocked 1 running 1 ready 0. 18 | Before cycle 12: ready 0 blocked 1 running 1. 19 | Before cycle 13: running 1 ready 0 blocked 1. 20 | Before cycle 14: terminated 0 running 1 ready 0. 21 | Before cycle 15: terminated 0 terminated 0 running 1. 22 | Before cycle 16: terminated 0 terminated 0 blocked 1. 23 | Before cycle 17: terminated 0 terminated 0 running 1. 24 | Before cycle 18: terminated 0 terminated 0 blocked 1. 25 | Before cycle 19: terminated 0 terminated 0 running 1. 26 | Before cycle 20: terminated 0 terminated 0 blocked 1. 27 | Before cycle 21: terminated 0 terminated 0 running 1. 28 | Before cycle 22: terminated 0 terminated 0 blocked 1. 29 | Before cycle 23: terminated 0 terminated 0 running 1. 30 | Before cycle 24: terminated 0 terminated 0 blocked 1. 31 | Before cycle 25: terminated 0 terminated 0 running 1. 32 | The scheduling algorithm used was Round Robbin 33 | 34 | Process 0: 35 | (A,B,C,M) = (0,1,5,1) 36 | Finishing time: 13 37 | Turnaround time: 13 38 | I/O time: 4 39 | Waiting time: 4 40 | 41 | Process 1: 42 | (A,B,C,M) = (0,1,5,1) 43 | Finishing time: 14 44 | Turnaround time: 14 45 | I/O time: 4 46 | Waiting time: 5 47 | 48 | Process 2: 49 | (A,B,C,M) = (0,1,10,1) 50 | Finishing time: 25 51 | Turnaround time: 25 52 | I/O time: 9 53 | Waiting time: 6 54 | 55 | Summary Data: 56 | Finishing time: 25 57 | CPU Utilization: 0.800000 58 | I/O Utilization: 0.680000 59 | Throughput: 12.000000 processes per hundred cycles 60 | Average turnaround time: 17.333334 61 | Average waiting time: 5.000000 62 | -------------------------------------------------------------------------------- /output_verbose/fcfs-output-6-detailed.txt: -------------------------------------------------------------------------------- 1 | The original input was: 3 (0 1 5 1) (0 1 5 1) (0 1 10 1) 2 | The (sorted) input is: 3 (0 1 5 1) (0 1 5 1) (0 1 10 1) 3 | 4 | This detailed printout gives the state and remaining burst for each process 5 | 6 | Before cycle 0: unstarted 0 unstarted 0 unstarted 0. 7 | Before cycle 1: running 1 ready 0 ready 0. 8 | Before cycle 2: blocked 1 running 1 ready 0. 9 | Before cycle 3: ready 0 blocked 1 running 1. 10 | Before cycle 4: running 1 ready 0 blocked 1. 11 | Before cycle 5: blocked 1 running 1 ready 0. 12 | Before cycle 6: ready 0 blocked 1 running 1. 13 | Before cycle 7: running 1 ready 0 blocked 1. 14 | Before cycle 8: blocked 1 running 1 ready 0. 15 | Before cycle 9: ready 0 blocked 1 running 1. 16 | Before cycle 10: running 1 ready 0 blocked 1. 17 | Before cycle 11: blocked 1 running 1 ready 0. 18 | Before cycle 12: ready 0 blocked 1 running 1. 19 | Before cycle 13: running 1 ready 0 blocked 1. 20 | Before cycle 14: terminated 0 running 1 ready 0. 21 | Before cycle 15: terminated 0 terminated 0 running 1. 22 | Before cycle 16: terminated 0 terminated 0 blocked 1. 23 | Before cycle 17: terminated 0 terminated 0 running 1. 24 | Before cycle 18: terminated 0 terminated 0 blocked 1. 25 | Before cycle 19: terminated 0 terminated 0 running 1. 26 | Before cycle 20: terminated 0 terminated 0 blocked 1. 27 | Before cycle 21: terminated 0 terminated 0 running 1. 28 | Before cycle 22: terminated 0 terminated 0 blocked 1. 29 | Before cycle 23: terminated 0 terminated 0 running 1. 30 | Before cycle 24: terminated 0 terminated 0 blocked 1. 31 | Before cycle 25: terminated 0 terminated 0 running 1. 32 | The scheduling algorithm used was First Come First Served 33 | 34 | Process 0: 35 | (A,B,C,M) = (0,1,5,1) 36 | Finishing time: 13 37 | Turnaround time: 13 38 | I/O time: 4 39 | Waiting time: 4 40 | 41 | Process 1: 42 | (A,B,C,M) = (0,1,5,1) 43 | Finishing time: 14 44 | Turnaround time: 14 45 | I/O time: 4 46 | Waiting time: 5 47 | 48 | Process 2: 49 | (A,B,C,M) = (0,1,10,1) 50 | Finishing time: 25 51 | Turnaround time: 25 52 | I/O time: 9 53 | Waiting time: 6 54 | 55 | Summary Data: 56 | Finishing time: 25 57 | CPU Utilization: 0.800000 58 | I/O Utilization: 0.680000 59 | Throughput: 12.000000 processes per hundred cycles 60 | Average turnaround time: 17.333334 61 | Average waiting time: 5.000000 62 | -------------------------------------------------------------------------------- /output_verbose/hprn-output-6-detailed.txt: -------------------------------------------------------------------------------- 1 | The original input was: 3 (0 1 5 1) (0 1 5 1) (0 1 10 1) 2 | The (sorted) input is: 3 (0 1 5 1) (0 1 5 1) (0 1 10 1) 3 | 4 | This detailed printout gives the state and remaining burst for each process 5 | 6 | Before cycle 0: unstarted 0 unstarted 0 unstarted 0. 7 | Before cycle 1: running 1 ready 0 ready 0. 8 | Before cycle 2: blocked 1 running 1 ready 0. 9 | Before cycle 3: running 1 blocked 1 ready 0. 10 | Before cycle 4: blocked 1 running 1 ready 0. 11 | Before cycle 5: ready 0 blocked 1 running 1. 12 | Before cycle 6: running 1 ready 0 blocked 1. 13 | Before cycle 7: blocked 1 ready 0 running 1. 14 | Before cycle 8: ready 0 running 1 blocked 1. 15 | Before cycle 9: ready 0 blocked 1 running 1. 16 | Before cycle 10: running 1 ready 0 blocked 1. 17 | Before cycle 11: blocked 1 running 1 ready 0. 18 | Before cycle 12: ready 0 blocked 1 running 1. 19 | Before cycle 13: running 1 ready 0 blocked 1. 20 | Before cycle 14: terminated 0 running 1 ready 0. 21 | Before cycle 15: terminated 0 terminated 0 running 1. 22 | Before cycle 16: terminated 0 terminated 0 blocked 1. 23 | Before cycle 17: terminated 0 terminated 0 running 1. 24 | Before cycle 18: terminated 0 terminated 0 blocked 1. 25 | Before cycle 19: terminated 0 terminated 0 running 1. 26 | Before cycle 20: terminated 0 terminated 0 blocked 1. 27 | Before cycle 21: terminated 0 terminated 0 running 1. 28 | Before cycle 22: terminated 0 terminated 0 blocked 1. 29 | Before cycle 23: terminated 0 terminated 0 running 1. 30 | Before cycle 24: terminated 0 terminated 0 blocked 1. 31 | Before cycle 25: terminated 0 terminated 0 running 1. 32 | The scheduling algorithm used was Highest Penalty Ratio Next 33 | 34 | Process 0: 35 | (A,B,C,M) = (0,1,5,1) 36 | Finishing time: 13 37 | Turnaround time: 13 38 | I/O time: 4 39 | Waiting time: 4 40 | 41 | Process 1: 42 | (A,B,C,M) = (0,1,5,1) 43 | Finishing time: 14 44 | Turnaround time: 14 45 | I/O time: 4 46 | Waiting time: 5 47 | 48 | Process 2: 49 | (A,B,C,M) = (0,1,10,1) 50 | Finishing time: 25 51 | Turnaround time: 25 52 | I/O time: 9 53 | Waiting time: 6 54 | 55 | Summary Data: 56 | Finishing time: 25 57 | CPU Utilization: 0.800000 58 | I/O Utilization: 0.680000 59 | Throughput: 12.000000 processes per hundred cycles 60 | Average turnaround time: 17.333334 61 | Average waiting time: 5.000000 62 | -------------------------------------------------------------------------------- /output_verbose/sjf-output-6-detailed.txt: -------------------------------------------------------------------------------- 1 | The original input was: 3 (0 1 5 1) (0 1 5 1) (0 1 10 1) 2 | The (sorted) input is: 3 (0 1 5 1) (0 1 5 1) (0 1 10 1) 3 | 4 | This detailed printout gives the state and remaining burst for each process 5 | 6 | Before cycle 0: unstarted 0 unstarted 0 unstarted 0. 7 | Before cycle 1: running 1 ready 0 ready 0. 8 | Before cycle 2: blocked 1 running 1 ready 0. 9 | Before cycle 3: running 1 blocked 1 ready 0. 10 | Before cycle 4: blocked 1 running 1 ready 0. 11 | Before cycle 5: running 1 blocked 1 ready 0. 12 | Before cycle 6: blocked 1 running 1 ready 0. 13 | Before cycle 7: running 1 blocked 1 ready 0. 14 | Before cycle 8: blocked 1 running 1 ready 0. 15 | Before cycle 9: running 1 blocked 1 ready 0. 16 | Before cycle 10: terminated 0 running 1 ready 0. 17 | Before cycle 11: terminated 0 terminated 0 running 1. 18 | Before cycle 12: terminated 0 terminated 0 blocked 1. 19 | Before cycle 13: terminated 0 terminated 0 running 1. 20 | Before cycle 14: terminated 0 terminated 0 blocked 1. 21 | Before cycle 15: terminated 0 terminated 0 running 1. 22 | Before cycle 16: terminated 0 terminated 0 blocked 1. 23 | Before cycle 17: terminated 0 terminated 0 running 1. 24 | Before cycle 18: terminated 0 terminated 0 blocked 1. 25 | Before cycle 19: terminated 0 terminated 0 running 1. 26 | Before cycle 20: terminated 0 terminated 0 blocked 1. 27 | Before cycle 21: terminated 0 terminated 0 running 1. 28 | Before cycle 22: terminated 0 terminated 0 blocked 1. 29 | Before cycle 23: terminated 0 terminated 0 running 1. 30 | Before cycle 24: terminated 0 terminated 0 blocked 1. 31 | Before cycle 25: terminated 0 terminated 0 running 1. 32 | Before cycle 26: terminated 0 terminated 0 blocked 1. 33 | Before cycle 27: terminated 0 terminated 0 running 1. 34 | Before cycle 28: terminated 0 terminated 0 blocked 1. 35 | Before cycle 29: terminated 0 terminated 0 running 1. 36 | The scheduling algorithm used was Shortest Job First 37 | 38 | Process 0: 39 | (A,B,C,M) = (0,1,5,1) 40 | Finishing time: 9 41 | Turnaround time: 9 42 | I/O time: 4 43 | Waiting time: 0 44 | 45 | Process 1: 46 | (A,B,C,M) = (0,1,5,1) 47 | Finishing time: 10 48 | Turnaround time: 10 49 | I/O time: 4 50 | Waiting time: 1 51 | 52 | Process 2: 53 | (A,B,C,M) = (0,1,10,1) 54 | Finishing time: 29 55 | Turnaround time: 29 56 | I/O time: 9 57 | Waiting time: 10 58 | 59 | Summary Data: 60 | Finishing time: 29 61 | CPU Utilization: 0.689655 62 | I/O Utilization: 0.586207 63 | Throughput: 10.344828 processes per hundred cycles 64 | Average turnaround time: 16.000000 65 | Average waiting time: 3.666667 66 | -------------------------------------------------------------------------------- /output_show-random/rr-output-3-show-random.txt: -------------------------------------------------------------------------------- 1 | The original input was: 3 (0 1 5 1) (0 1 5 1) (3 1 5 1) 2 | The (sorted) input is: 3 (0 1 5 1) (0 1 5 1) (3 1 5 1) 3 | 4 | This detailed printout gives the state and remaining burst for each process 5 | 6 | Before cycle 0: unstarted 0 unstarted 0 unstarted 0. 7 | Find burst when choosing ready process to run 1804289383 8 | Before cycle 1: running 1 ready 0 unstarted 0. 9 | Find burst when choosing ready process to run 846930886 10 | Before cycle 2: blocked 1 running 1 unstarted 0. 11 | Find burst when choosing ready process to run 1681692777 12 | Before cycle 3: running 1 blocked 1 unstarted 0. 13 | Find burst when choosing ready process to run 1714636915 14 | Before cycle 4: blocked 1 running 1 ready 0. 15 | Find burst when choosing ready process to run 1957747793 16 | Before cycle 5: ready 0 blocked 1 running 1. 17 | Find burst when choosing ready process to run 424238335 18 | Before cycle 6: running 1 ready 0 blocked 1. 19 | Find burst when choosing ready process to run 719885386 20 | Before cycle 7: blocked 1 running 1 ready 0. 21 | Find burst when choosing ready process to run 1649760492 22 | Before cycle 8: ready 0 blocked 1 running 1. 23 | Find burst when choosing ready process to run 596516649 24 | Before cycle 9: running 1 ready 0 blocked 1. 25 | Find burst when choosing ready process to run 1189641421 26 | Before cycle 10: blocked 1 running 1 ready 0. 27 | Find burst when choosing ready process to run 1025202362 28 | Before cycle 11: ready 0 blocked 1 running 1. 29 | Find burst when choosing ready process to run 1350490027 30 | Before cycle 12: running 1 ready 0 blocked 1. 31 | Find burst when choosing ready process to run 783368690 32 | Before cycle 13: terminated 0 running 1 ready 0. 33 | Find burst when choosing ready process to run 1102520059 34 | Before cycle 14: terminated 0 terminated 0 running 1. 35 | Before cycle 15: terminated 0 terminated 0 blocked 1. 36 | Find burst when choosing ready process to run 2044897763 37 | Before cycle 16: terminated 0 terminated 0 running 1. 38 | The scheduling algorithm used was Round Robbin 39 | 40 | Process 0: 41 | (A,B,C,M) = (0,1,5,1) 42 | Finishing time: 12 43 | Turnaround time: 12 44 | I/O time: 4 45 | Waiting time: 3 46 | 47 | Process 1: 48 | (A,B,C,M) = (0,1,5,1) 49 | Finishing time: 13 50 | Turnaround time: 13 51 | I/O time: 4 52 | Waiting time: 4 53 | 54 | Process 2: 55 | (A,B,C,M) = (3,1,5,1) 56 | Finishing time: 16 57 | Turnaround time: 13 58 | I/O time: 4 59 | Waiting time: 4 60 | 61 | Summary Data: 62 | Finishing time: 16 63 | CPU Utilization: 0.937500 64 | I/O Utilization: 0.750000 65 | Throughput: 18.750000 processes per hundred cycles 66 | Average turnaround time: 12.666667 67 | Average waiting time: 3.666667 68 | -------------------------------------------------------------------------------- /output_show-random/fcfs-output-3-show-random.txt: -------------------------------------------------------------------------------- 1 | The original input was: 3 (0 1 5 1) (0 1 5 1) (3 1 5 1) 2 | The (sorted) input is: 3 (0 1 5 1) (0 1 5 1) (3 1 5 1) 3 | 4 | This detailed printout gives the state and remaining burst for each process 5 | 6 | Before cycle 0: unstarted 0 unstarted 0 unstarted 0. 7 | Find burst when choosing ready process to run 1804289383 8 | Before cycle 1: running 1 ready 0 unstarted 0. 9 | Find burst when choosing ready process to run 846930886 10 | Before cycle 2: blocked 1 running 1 unstarted 0. 11 | Find burst when choosing ready process to run 1681692777 12 | Before cycle 3: running 1 blocked 1 unstarted 0. 13 | Find burst when choosing ready process to run 1714636915 14 | Before cycle 4: blocked 1 running 1 ready 0. 15 | Find burst when choosing ready process to run 1957747793 16 | Before cycle 5: ready 0 blocked 1 running 1. 17 | Find burst when choosing ready process to run 424238335 18 | Before cycle 6: running 1 ready 0 blocked 1. 19 | Find burst when choosing ready process to run 719885386 20 | Before cycle 7: blocked 1 running 1 ready 0. 21 | Find burst when choosing ready process to run 1649760492 22 | Before cycle 8: ready 0 blocked 1 running 1. 23 | Find burst when choosing ready process to run 596516649 24 | Before cycle 9: running 1 ready 0 blocked 1. 25 | Find burst when choosing ready process to run 1189641421 26 | Before cycle 10: blocked 1 running 1 ready 0. 27 | Find burst when choosing ready process to run 1025202362 28 | Before cycle 11: ready 0 blocked 1 running 1. 29 | Find burst when choosing ready process to run 1350490027 30 | Before cycle 12: running 1 ready 0 blocked 1. 31 | Find burst when choosing ready process to run 783368690 32 | Before cycle 13: terminated 0 running 1 ready 0. 33 | Find burst when choosing ready process to run 1102520059 34 | Before cycle 14: terminated 0 terminated 0 running 1. 35 | Before cycle 15: terminated 0 terminated 0 blocked 1. 36 | Find burst when choosing ready process to run 2044897763 37 | Before cycle 16: terminated 0 terminated 0 running 1. 38 | The scheduling algorithm used was First Come First Served 39 | 40 | Process 0: 41 | (A,B,C,M) = (0,1,5,1) 42 | Finishing time: 12 43 | Turnaround time: 12 44 | I/O time: 4 45 | Waiting time: 3 46 | 47 | Process 1: 48 | (A,B,C,M) = (0,1,5,1) 49 | Finishing time: 13 50 | Turnaround time: 13 51 | I/O time: 4 52 | Waiting time: 4 53 | 54 | Process 2: 55 | (A,B,C,M) = (3,1,5,1) 56 | Finishing time: 16 57 | Turnaround time: 13 58 | I/O time: 4 59 | Waiting time: 4 60 | 61 | Summary Data: 62 | Finishing time: 16 63 | CPU Utilization: 0.937500 64 | I/O Utilization: 0.750000 65 | Throughput: 18.750000 processes per hundred cycles 66 | Average turnaround time: 12.666667 67 | Average waiting time: 3.666667 68 | -------------------------------------------------------------------------------- /output_show-random/hprn-output-3-show-random.txt: -------------------------------------------------------------------------------- 1 | The original input was: 3 (0 1 5 1) (0 1 5 1) (3 1 5 1) 2 | The (sorted) input is: 3 (0 1 5 1) (0 1 5 1) (3 1 5 1) 3 | 4 | This detailed printout gives the state and remaining burst for each process 5 | 6 | Before cycle 0: unstarted 0 unstarted 0 unstarted 0. 7 | Find burst when choosing ready process to run 1804289383 8 | Before cycle 1: running 1 ready 0 unstarted 0. 9 | Find burst when choosing ready process to run 846930886 10 | Before cycle 2: blocked 1 running 1 unstarted 0. 11 | Find burst when choosing ready process to run 1681692777 12 | Before cycle 3: running 1 blocked 1 unstarted 0. 13 | Find burst when choosing ready process to run 1714636915 14 | Before cycle 4: blocked 1 running 1 ready 0. 15 | Find burst when choosing ready process to run 1957747793 16 | Before cycle 5: running 1 blocked 1 ready 0. 17 | Find burst when choosing ready process to run 424238335 18 | Before cycle 6: blocked 1 running 1 ready 0. 19 | Find burst when choosing ready process to run 719885386 20 | Before cycle 7: ready 0 blocked 1 running 1. 21 | Find burst when choosing ready process to run 1649760492 22 | Before cycle 8: running 1 ready 0 blocked 1. 23 | Find burst when choosing ready process to run 596516649 24 | Before cycle 9: blocked 1 ready 0 running 1. 25 | Find burst when choosing ready process to run 1189641421 26 | Before cycle 10: ready 0 running 1 blocked 1. 27 | Find burst when choosing ready process to run 1025202362 28 | Before cycle 11: ready 0 blocked 1 running 1. 29 | Find burst when choosing ready process to run 1350490027 30 | Before cycle 12: running 1 ready 0 blocked 1. 31 | Find burst when choosing ready process to run 783368690 32 | Before cycle 13: terminated 0 running 1 ready 0. 33 | Find burst when choosing ready process to run 1102520059 34 | Before cycle 14: terminated 0 terminated 0 running 1. 35 | Before cycle 15: terminated 0 terminated 0 blocked 1. 36 | Find burst when choosing ready process to run 2044897763 37 | Before cycle 16: terminated 0 terminated 0 running 1. 38 | The scheduling algorithm used was Highest Penalty Ratio Next 39 | 40 | Process 0: 41 | (A,B,C,M) = (0,1,5,1) 42 | Finishing time: 12 43 | Turnaround time: 12 44 | I/O time: 4 45 | Waiting time: 3 46 | 47 | Process 1: 48 | (A,B,C,M) = (0,1,5,1) 49 | Finishing time: 13 50 | Turnaround time: 13 51 | I/O time: 4 52 | Waiting time: 4 53 | 54 | Process 2: 55 | (A,B,C,M) = (3,1,5,1) 56 | Finishing time: 16 57 | Turnaround time: 13 58 | I/O time: 4 59 | Waiting time: 4 60 | 61 | Summary Data: 62 | Finishing time: 16 63 | CPU Utilization: 0.937500 64 | I/O Utilization: 0.750000 65 | Throughput: 18.750000 processes per hundred cycles 66 | Average turnaround time: 12.666667 67 | Average waiting time: 3.666667 68 | -------------------------------------------------------------------------------- /output_show-random/sjf-output-3-show-random.txt: -------------------------------------------------------------------------------- 1 | The original input was: 3 (0 1 5 1) (0 1 5 1) (3 1 5 1) 2 | The (sorted) input is: 3 (0 1 5 1) (0 1 5 1) (3 1 5 1) 3 | 4 | This detailed printout gives the state and remaining burst for each process 5 | 6 | Before cycle 0: unstarted 0 unstarted 0 unstarted 0. 7 | Find burst when choosing ready process to run 1804289383 8 | Before cycle 1: running 1 ready 0 unstarted 0. 9 | Find burst when choosing ready process to run 846930886 10 | Before cycle 2: blocked 1 running 1 unstarted 0. 11 | Find burst when choosing ready process to run 1681692777 12 | Before cycle 3: running 1 blocked 1 unstarted 0. 13 | Find burst when choosing ready process to run 1714636915 14 | Before cycle 4: blocked 1 running 1 ready 0. 15 | Find burst when choosing ready process to run 1957747793 16 | Before cycle 5: running 1 blocked 1 ready 0. 17 | Find burst when choosing ready process to run 424238335 18 | Before cycle 6: blocked 1 running 1 ready 0. 19 | Find burst when choosing ready process to run 719885386 20 | Before cycle 7: running 1 blocked 1 ready 0. 21 | Find burst when choosing ready process to run 1649760492 22 | Before cycle 8: blocked 1 running 1 ready 0. 23 | Find burst when choosing ready process to run 596516649 24 | Before cycle 9: running 1 blocked 1 ready 0. 25 | Find burst when choosing ready process to run 1189641421 26 | Before cycle 10: terminated 0 running 1 ready 0. 27 | Find burst when choosing ready process to run 1025202362 28 | Before cycle 11: terminated 0 terminated 0 running 1. 29 | Before cycle 12: terminated 0 terminated 0 blocked 1. 30 | Find burst when choosing ready process to run 1350490027 31 | Before cycle 13: terminated 0 terminated 0 running 1. 32 | Before cycle 14: terminated 0 terminated 0 blocked 1. 33 | Find burst when choosing ready process to run 783368690 34 | Before cycle 15: terminated 0 terminated 0 running 1. 35 | Before cycle 16: terminated 0 terminated 0 blocked 1. 36 | Find burst when choosing ready process to run 1102520059 37 | Before cycle 17: terminated 0 terminated 0 running 1. 38 | Before cycle 18: terminated 0 terminated 0 blocked 1. 39 | Find burst when choosing ready process to run 2044897763 40 | Before cycle 19: terminated 0 terminated 0 running 1. 41 | The scheduling algorithm used was Shortest Job First 42 | 43 | Process 0: 44 | (A,B,C,M) = (0,1,5,1) 45 | Finishing time: 9 46 | Turnaround time: 9 47 | I/O time: 4 48 | Waiting time: 0 49 | 50 | Process 1: 51 | (A,B,C,M) = (0,1,5,1) 52 | Finishing time: 10 53 | Turnaround time: 10 54 | I/O time: 4 55 | Waiting time: 1 56 | 57 | Process 2: 58 | (A,B,C,M) = (3,1,5,1) 59 | Finishing time: 19 60 | Turnaround time: 16 61 | I/O time: 4 62 | Waiting time: 7 63 | 64 | Summary Data: 65 | Finishing time: 19 66 | CPU Utilization: 0.789474 67 | I/O Utilization: 0.631579 68 | Throughput: 15.789474 processes per hundred cycles 69 | Average turnaround time: 11.666667 70 | Average waiting time: 2.666667 71 | -------------------------------------------------------------------------------- /output_show-random/rr-output-6-show-random.txt: -------------------------------------------------------------------------------- 1 | The original input was: 3 (0 1 5 1) (0 1 5 1) (0 1 10 1) 2 | The (sorted) input is: 3 (0 1 5 1) (0 1 5 1) (0 1 10 1) 3 | 4 | This detailed printout gives the state and remaining burst for each process 5 | 6 | Before cycle 0: unstarted 0 unstarted 0 unstarted 0. 7 | Find burst when choosing ready process to run 1804289383 8 | Before cycle 1: running 1 ready 0 ready 0. 9 | Find burst when choosing ready process to run 846930886 10 | Before cycle 2: blocked 1 running 1 ready 0. 11 | Find burst when choosing ready process to run 1681692777 12 | Before cycle 3: ready 0 blocked 1 running 1. 13 | Find burst when choosing ready process to run 1714636915 14 | Before cycle 4: running 1 ready 0 blocked 1. 15 | Find burst when choosing ready process to run 1957747793 16 | Before cycle 5: blocked 1 running 1 ready 0. 17 | Find burst when choosing ready process to run 424238335 18 | Before cycle 6: ready 0 blocked 1 running 1. 19 | Find burst when choosing ready process to run 719885386 20 | Before cycle 7: running 1 ready 0 blocked 1. 21 | Find burst when choosing ready process to run 1649760492 22 | Before cycle 8: blocked 1 running 1 ready 0. 23 | Find burst when choosing ready process to run 596516649 24 | Before cycle 9: ready 0 blocked 1 running 1. 25 | Find burst when choosing ready process to run 1189641421 26 | Before cycle 10: running 1 ready 0 blocked 1. 27 | Find burst when choosing ready process to run 1025202362 28 | Before cycle 11: blocked 1 running 1 ready 0. 29 | Find burst when choosing ready process to run 1350490027 30 | Before cycle 12: ready 0 blocked 1 running 1. 31 | Find burst when choosing ready process to run 783368690 32 | Before cycle 13: running 1 ready 0 blocked 1. 33 | Find burst when choosing ready process to run 1102520059 34 | Before cycle 14: terminated 0 running 1 ready 0. 35 | Find burst when choosing ready process to run 2044897763 36 | Before cycle 15: terminated 0 terminated 0 running 1. 37 | Before cycle 16: terminated 0 terminated 0 blocked 1. 38 | Find burst when choosing ready process to run 1967513926 39 | Before cycle 17: terminated 0 terminated 0 running 1. 40 | Before cycle 18: terminated 0 terminated 0 blocked 1. 41 | Find burst when choosing ready process to run 1365180540 42 | Before cycle 19: terminated 0 terminated 0 running 1. 43 | Before cycle 20: terminated 0 terminated 0 blocked 1. 44 | Find burst when choosing ready process to run 1540383426 45 | Before cycle 21: terminated 0 terminated 0 running 1. 46 | Before cycle 22: terminated 0 terminated 0 blocked 1. 47 | Find burst when choosing ready process to run 304089172 48 | Before cycle 23: terminated 0 terminated 0 running 1. 49 | Before cycle 24: terminated 0 terminated 0 blocked 1. 50 | Find burst when choosing ready process to run 1303455736 51 | Before cycle 25: terminated 0 terminated 0 running 1. 52 | The scheduling algorithm used was Round Robbin 53 | 54 | Process 0: 55 | (A,B,C,M) = (0,1,5,1) 56 | Finishing time: 13 57 | Turnaround time: 13 58 | I/O time: 4 59 | Waiting time: 4 60 | 61 | Process 1: 62 | (A,B,C,M) = (0,1,5,1) 63 | Finishing time: 14 64 | Turnaround time: 14 65 | I/O time: 4 66 | Waiting time: 5 67 | 68 | Process 2: 69 | (A,B,C,M) = (0,1,10,1) 70 | Finishing time: 25 71 | Turnaround time: 25 72 | I/O time: 9 73 | Waiting time: 6 74 | 75 | Summary Data: 76 | Finishing time: 25 77 | CPU Utilization: 0.800000 78 | I/O Utilization: 0.680000 79 | Throughput: 12.000000 processes per hundred cycles 80 | Average turnaround time: 17.333334 81 | Average waiting time: 5.000000 82 | -------------------------------------------------------------------------------- /output_show-random/fcfs-output-6-show-random.txt: -------------------------------------------------------------------------------- 1 | The original input was: 3 (0 1 5 1) (0 1 5 1) (0 1 10 1) 2 | The (sorted) input is: 3 (0 1 5 1) (0 1 5 1) (0 1 10 1) 3 | 4 | This detailed printout gives the state and remaining burst for each process 5 | 6 | Before cycle 0: unstarted 0 unstarted 0 unstarted 0. 7 | Find burst when choosing ready process to run 1804289383 8 | Before cycle 1: running 1 ready 0 ready 0. 9 | Find burst when choosing ready process to run 846930886 10 | Before cycle 2: blocked 1 running 1 ready 0. 11 | Find burst when choosing ready process to run 1681692777 12 | Before cycle 3: ready 0 blocked 1 running 1. 13 | Find burst when choosing ready process to run 1714636915 14 | Before cycle 4: running 1 ready 0 blocked 1. 15 | Find burst when choosing ready process to run 1957747793 16 | Before cycle 5: blocked 1 running 1 ready 0. 17 | Find burst when choosing ready process to run 424238335 18 | Before cycle 6: ready 0 blocked 1 running 1. 19 | Find burst when choosing ready process to run 719885386 20 | Before cycle 7: running 1 ready 0 blocked 1. 21 | Find burst when choosing ready process to run 1649760492 22 | Before cycle 8: blocked 1 running 1 ready 0. 23 | Find burst when choosing ready process to run 596516649 24 | Before cycle 9: ready 0 blocked 1 running 1. 25 | Find burst when choosing ready process to run 1189641421 26 | Before cycle 10: running 1 ready 0 blocked 1. 27 | Find burst when choosing ready process to run 1025202362 28 | Before cycle 11: blocked 1 running 1 ready 0. 29 | Find burst when choosing ready process to run 1350490027 30 | Before cycle 12: ready 0 blocked 1 running 1. 31 | Find burst when choosing ready process to run 783368690 32 | Before cycle 13: running 1 ready 0 blocked 1. 33 | Find burst when choosing ready process to run 1102520059 34 | Before cycle 14: terminated 0 running 1 ready 0. 35 | Find burst when choosing ready process to run 2044897763 36 | Before cycle 15: terminated 0 terminated 0 running 1. 37 | Before cycle 16: terminated 0 terminated 0 blocked 1. 38 | Find burst when choosing ready process to run 1967513926 39 | Before cycle 17: terminated 0 terminated 0 running 1. 40 | Before cycle 18: terminated 0 terminated 0 blocked 1. 41 | Find burst when choosing ready process to run 1365180540 42 | Before cycle 19: terminated 0 terminated 0 running 1. 43 | Before cycle 20: terminated 0 terminated 0 blocked 1. 44 | Find burst when choosing ready process to run 1540383426 45 | Before cycle 21: terminated 0 terminated 0 running 1. 46 | Before cycle 22: terminated 0 terminated 0 blocked 1. 47 | Find burst when choosing ready process to run 304089172 48 | Before cycle 23: terminated 0 terminated 0 running 1. 49 | Before cycle 24: terminated 0 terminated 0 blocked 1. 50 | Find burst when choosing ready process to run 1303455736 51 | Before cycle 25: terminated 0 terminated 0 running 1. 52 | The scheduling algorithm used was First Come First Served 53 | 54 | Process 0: 55 | (A,B,C,M) = (0,1,5,1) 56 | Finishing time: 13 57 | Turnaround time: 13 58 | I/O time: 4 59 | Waiting time: 4 60 | 61 | Process 1: 62 | (A,B,C,M) = (0,1,5,1) 63 | Finishing time: 14 64 | Turnaround time: 14 65 | I/O time: 4 66 | Waiting time: 5 67 | 68 | Process 2: 69 | (A,B,C,M) = (0,1,10,1) 70 | Finishing time: 25 71 | Turnaround time: 25 72 | I/O time: 9 73 | Waiting time: 6 74 | 75 | Summary Data: 76 | Finishing time: 25 77 | CPU Utilization: 0.800000 78 | I/O Utilization: 0.680000 79 | Throughput: 12.000000 processes per hundred cycles 80 | Average turnaround time: 17.333334 81 | Average waiting time: 5.000000 82 | -------------------------------------------------------------------------------- /output_show-random/hprn-output-6-show-random.txt: -------------------------------------------------------------------------------- 1 | The original input was: 3 (0 1 5 1) (0 1 5 1) (0 1 10 1) 2 | The (sorted) input is: 3 (0 1 5 1) (0 1 5 1) (0 1 10 1) 3 | 4 | This detailed printout gives the state and remaining burst for each process 5 | 6 | Before cycle 0: unstarted 0 unstarted 0 unstarted 0. 7 | Find burst when choosing ready process to run 1804289383 8 | Before cycle 1: running 1 ready 0 ready 0. 9 | Find burst when choosing ready process to run 846930886 10 | Before cycle 2: blocked 1 running 1 ready 0. 11 | Find burst when choosing ready process to run 1681692777 12 | Before cycle 3: running 1 blocked 1 ready 0. 13 | Find burst when choosing ready process to run 1714636915 14 | Before cycle 4: blocked 1 running 1 ready 0. 15 | Find burst when choosing ready process to run 1957747793 16 | Before cycle 5: ready 0 blocked 1 running 1. 17 | Find burst when choosing ready process to run 424238335 18 | Before cycle 6: running 1 ready 0 blocked 1. 19 | Find burst when choosing ready process to run 719885386 20 | Before cycle 7: blocked 1 ready 0 running 1. 21 | Find burst when choosing ready process to run 1649760492 22 | Before cycle 8: ready 0 running 1 blocked 1. 23 | Find burst when choosing ready process to run 596516649 24 | Before cycle 9: ready 0 blocked 1 running 1. 25 | Find burst when choosing ready process to run 1189641421 26 | Before cycle 10: running 1 ready 0 blocked 1. 27 | Find burst when choosing ready process to run 1025202362 28 | Before cycle 11: blocked 1 running 1 ready 0. 29 | Find burst when choosing ready process to run 1350490027 30 | Before cycle 12: ready 0 blocked 1 running 1. 31 | Find burst when choosing ready process to run 783368690 32 | Before cycle 13: running 1 ready 0 blocked 1. 33 | Find burst when choosing ready process to run 1102520059 34 | Before cycle 14: terminated 0 running 1 ready 0. 35 | Find burst when choosing ready process to run 2044897763 36 | Before cycle 15: terminated 0 terminated 0 running 1. 37 | Before cycle 16: terminated 0 terminated 0 blocked 1. 38 | Find burst when choosing ready process to run 1967513926 39 | Before cycle 17: terminated 0 terminated 0 running 1. 40 | Before cycle 18: terminated 0 terminated 0 blocked 1. 41 | Find burst when choosing ready process to run 1365180540 42 | Before cycle 19: terminated 0 terminated 0 running 1. 43 | Before cycle 20: terminated 0 terminated 0 blocked 1. 44 | Find burst when choosing ready process to run 1540383426 45 | Before cycle 21: terminated 0 terminated 0 running 1. 46 | Before cycle 22: terminated 0 terminated 0 blocked 1. 47 | Find burst when choosing ready process to run 304089172 48 | Before cycle 23: terminated 0 terminated 0 running 1. 49 | Before cycle 24: terminated 0 terminated 0 blocked 1. 50 | Find burst when choosing ready process to run 1303455736 51 | Before cycle 25: terminated 0 terminated 0 running 1. 52 | The scheduling algorithm used was Highest Penalty Ratio Next 53 | 54 | Process 0: 55 | (A,B,C,M) = (0,1,5,1) 56 | Finishing time: 13 57 | Turnaround time: 13 58 | I/O time: 4 59 | Waiting time: 4 60 | 61 | Process 1: 62 | (A,B,C,M) = (0,1,5,1) 63 | Finishing time: 14 64 | Turnaround time: 14 65 | I/O time: 4 66 | Waiting time: 5 67 | 68 | Process 2: 69 | (A,B,C,M) = (0,1,10,1) 70 | Finishing time: 25 71 | Turnaround time: 25 72 | I/O time: 9 73 | Waiting time: 6 74 | 75 | Summary Data: 76 | Finishing time: 25 77 | CPU Utilization: 0.800000 78 | I/O Utilization: 0.680000 79 | Throughput: 12.000000 processes per hundred cycles 80 | Average turnaround time: 17.333334 81 | Average waiting time: 5.000000 82 | -------------------------------------------------------------------------------- /output_show-random/sjf-output-6-show-random.txt: -------------------------------------------------------------------------------- 1 | The original input was: 3 (0 1 5 1) (0 1 5 1) (0 1 10 1) 2 | The (sorted) input is: 3 (0 1 5 1) (0 1 5 1) (0 1 10 1) 3 | 4 | This detailed printout gives the state and remaining burst for each process 5 | 6 | Before cycle 0: unstarted 0 unstarted 0 unstarted 0. 7 | Find burst when choosing ready process to run 1804289383 8 | Before cycle 1: running 1 ready 0 ready 0. 9 | Find burst when choosing ready process to run 846930886 10 | Before cycle 2: blocked 1 running 1 ready 0. 11 | Find burst when choosing ready process to run 1681692777 12 | Before cycle 3: running 1 blocked 1 ready 0. 13 | Find burst when choosing ready process to run 1714636915 14 | Before cycle 4: blocked 1 running 1 ready 0. 15 | Find burst when choosing ready process to run 1957747793 16 | Before cycle 5: running 1 blocked 1 ready 0. 17 | Find burst when choosing ready process to run 424238335 18 | Before cycle 6: blocked 1 running 1 ready 0. 19 | Find burst when choosing ready process to run 719885386 20 | Before cycle 7: running 1 blocked 1 ready 0. 21 | Find burst when choosing ready process to run 1649760492 22 | Before cycle 8: blocked 1 running 1 ready 0. 23 | Find burst when choosing ready process to run 596516649 24 | Before cycle 9: running 1 blocked 1 ready 0. 25 | Find burst when choosing ready process to run 1189641421 26 | Before cycle 10: terminated 0 running 1 ready 0. 27 | Find burst when choosing ready process to run 1025202362 28 | Before cycle 11: terminated 0 terminated 0 running 1. 29 | Before cycle 12: terminated 0 terminated 0 blocked 1. 30 | Find burst when choosing ready process to run 1350490027 31 | Before cycle 13: terminated 0 terminated 0 running 1. 32 | Before cycle 14: terminated 0 terminated 0 blocked 1. 33 | Find burst when choosing ready process to run 783368690 34 | Before cycle 15: terminated 0 terminated 0 running 1. 35 | Before cycle 16: terminated 0 terminated 0 blocked 1. 36 | Find burst when choosing ready process to run 1102520059 37 | Before cycle 17: terminated 0 terminated 0 running 1. 38 | Before cycle 18: terminated 0 terminated 0 blocked 1. 39 | Find burst when choosing ready process to run 2044897763 40 | Before cycle 19: terminated 0 terminated 0 running 1. 41 | Before cycle 20: terminated 0 terminated 0 blocked 1. 42 | Find burst when choosing ready process to run 1967513926 43 | Before cycle 21: terminated 0 terminated 0 running 1. 44 | Before cycle 22: terminated 0 terminated 0 blocked 1. 45 | Find burst when choosing ready process to run 1365180540 46 | Before cycle 23: terminated 0 terminated 0 running 1. 47 | Before cycle 24: terminated 0 terminated 0 blocked 1. 48 | Find burst when choosing ready process to run 1540383426 49 | Before cycle 25: terminated 0 terminated 0 running 1. 50 | Before cycle 26: terminated 0 terminated 0 blocked 1. 51 | Find burst when choosing ready process to run 304089172 52 | Before cycle 27: terminated 0 terminated 0 running 1. 53 | Before cycle 28: terminated 0 terminated 0 blocked 1. 54 | Find burst when choosing ready process to run 1303455736 55 | Before cycle 29: terminated 0 terminated 0 running 1. 56 | The scheduling algorithm used was Shortest Job First 57 | 58 | Process 0: 59 | (A,B,C,M) = (0,1,5,1) 60 | Finishing time: 9 61 | Turnaround time: 9 62 | I/O time: 4 63 | Waiting time: 0 64 | 65 | Process 1: 66 | (A,B,C,M) = (0,1,5,1) 67 | Finishing time: 10 68 | Turnaround time: 10 69 | I/O time: 4 70 | Waiting time: 1 71 | 72 | Process 2: 73 | (A,B,C,M) = (0,1,10,1) 74 | Finishing time: 29 75 | Turnaround time: 29 76 | I/O time: 9 77 | Waiting time: 10 78 | 79 | Summary Data: 80 | Finishing time: 29 81 | CPU Utilization: 0.689655 82 | I/O Utilization: 0.586207 83 | Throughput: 10.344828 processes per hundred cycles 84 | Average turnaround time: 16.000000 85 | Average waiting time: 3.666667 86 | -------------------------------------------------------------------------------- /output_verbose/rr-output-7-detailed.txt: -------------------------------------------------------------------------------- 1 | The original input was: 3 (0 1 20 1) (0 1 20 1) (10 1 10 1) 2 | The (sorted) input is: 3 (0 1 20 1) (0 1 20 1) (10 1 10 1) 3 | 4 | This detailed printout gives the state and remaining burst for each process 5 | 6 | Before cycle 0: unstarted 0 unstarted 0 unstarted 0. 7 | Before cycle 1: running 1 ready 0 unstarted 0. 8 | Before cycle 2: blocked 1 running 1 unstarted 0. 9 | Before cycle 3: running 1 blocked 1 unstarted 0. 10 | Before cycle 4: blocked 1 running 1 unstarted 0. 11 | Before cycle 5: running 1 blocked 1 unstarted 0. 12 | Before cycle 6: blocked 1 running 1 unstarted 0. 13 | Before cycle 7: running 1 blocked 1 unstarted 0. 14 | Before cycle 8: blocked 1 running 1 unstarted 0. 15 | Before cycle 9: running 1 blocked 1 unstarted 0. 16 | Before cycle 10: blocked 1 running 1 unstarted 0. 17 | Before cycle 11: running 1 blocked 1 ready 0. 18 | Before cycle 12: blocked 1 ready 0 running 1. 19 | Before cycle 13: ready 0 running 1 blocked 1. 20 | Before cycle 14: running 1 blocked 1 ready 0. 21 | Before cycle 15: blocked 1 ready 0 running 1. 22 | Before cycle 16: ready 0 running 1 blocked 1. 23 | Before cycle 17: running 1 blocked 1 ready 0. 24 | Before cycle 18: blocked 1 ready 0 running 1. 25 | Before cycle 19: ready 0 running 1 blocked 1. 26 | Before cycle 20: running 1 blocked 1 ready 0. 27 | Before cycle 21: blocked 1 ready 0 running 1. 28 | Before cycle 22: ready 0 running 1 blocked 1. 29 | Before cycle 23: running 1 blocked 1 ready 0. 30 | Before cycle 24: blocked 1 ready 0 running 1. 31 | Before cycle 25: ready 0 running 1 blocked 1. 32 | Before cycle 26: running 1 blocked 1 ready 0. 33 | Before cycle 27: blocked 1 ready 0 running 1. 34 | Before cycle 28: ready 0 running 1 blocked 1. 35 | Before cycle 29: running 1 blocked 1 ready 0. 36 | Before cycle 30: blocked 1 ready 0 running 1. 37 | Before cycle 31: ready 0 running 1 blocked 1. 38 | Before cycle 32: running 1 blocked 1 ready 0. 39 | Before cycle 33: blocked 1 ready 0 running 1. 40 | Before cycle 34: ready 0 running 1 blocked 1. 41 | Before cycle 35: running 1 blocked 1 ready 0. 42 | Before cycle 36: blocked 1 ready 0 running 1. 43 | Before cycle 37: ready 0 running 1 blocked 1. 44 | Before cycle 38: running 1 blocked 1 ready 0. 45 | Before cycle 39: blocked 1 ready 0 running 1. 46 | Before cycle 40: ready 0 running 1 terminated 0. 47 | Before cycle 41: running 1 blocked 1 terminated 0. 48 | Before cycle 42: blocked 1 running 1 terminated 0. 49 | Before cycle 43: running 1 blocked 1 terminated 0. 50 | Before cycle 44: blocked 1 running 1 terminated 0. 51 | Before cycle 45: running 1 blocked 1 terminated 0. 52 | Before cycle 46: blocked 1 running 1 terminated 0. 53 | Before cycle 47: running 1 blocked 1 terminated 0. 54 | Before cycle 48: blocked 1 running 1 terminated 0. 55 | Before cycle 49: running 1 blocked 1 terminated 0. 56 | Before cycle 50: terminated 0 running 1 terminated 0. 57 | The scheduling algorithm used was Round Robbin 58 | 59 | Process 0: 60 | (A,B,C,M) = (0,1,20,1) 61 | Finishing time: 49 62 | Turnaround time: 49 63 | I/O time: 19 64 | Waiting time: 10 65 | 66 | Process 1: 67 | (A,B,C,M) = (0,1,20,1) 68 | Finishing time: 50 69 | Turnaround time: 50 70 | I/O time: 19 71 | Waiting time: 11 72 | 73 | Process 2: 74 | (A,B,C,M) = (10,1,10,1) 75 | Finishing time: 39 76 | Turnaround time: 29 77 | I/O time: 9 78 | Waiting time: 10 79 | 80 | Summary Data: 81 | Finishing time: 50 82 | CPU Utilization: 1.000000 83 | I/O Utilization: 0.940000 84 | Throughput: 6.000000 processes per hundred cycles 85 | Average turnaround time: 42.666668 86 | Average waiting time: 10.333333 87 | -------------------------------------------------------------------------------- /output_verbose/fcfs-output-7-detailed.txt: -------------------------------------------------------------------------------- 1 | The original input was: 3 (0 1 20 1) (0 1 20 1) (10 1 10 1) 2 | The (sorted) input is: 3 (0 1 20 1) (0 1 20 1) (10 1 10 1) 3 | 4 | This detailed printout gives the state and remaining burst for each process 5 | 6 | Before cycle 0: unstarted 0 unstarted 0 unstarted 0. 7 | Before cycle 1: running 1 ready 0 unstarted 0. 8 | Before cycle 2: blocked 1 running 1 unstarted 0. 9 | Before cycle 3: running 1 blocked 1 unstarted 0. 10 | Before cycle 4: blocked 1 running 1 unstarted 0. 11 | Before cycle 5: running 1 blocked 1 unstarted 0. 12 | Before cycle 6: blocked 1 running 1 unstarted 0. 13 | Before cycle 7: running 1 blocked 1 unstarted 0. 14 | Before cycle 8: blocked 1 running 1 unstarted 0. 15 | Before cycle 9: running 1 blocked 1 unstarted 0. 16 | Before cycle 10: blocked 1 running 1 unstarted 0. 17 | Before cycle 11: running 1 blocked 1 ready 0. 18 | Before cycle 12: blocked 1 ready 0 running 1. 19 | Before cycle 13: ready 0 running 1 blocked 1. 20 | Before cycle 14: running 1 blocked 1 ready 0. 21 | Before cycle 15: blocked 1 ready 0 running 1. 22 | Before cycle 16: ready 0 running 1 blocked 1. 23 | Before cycle 17: running 1 blocked 1 ready 0. 24 | Before cycle 18: blocked 1 ready 0 running 1. 25 | Before cycle 19: ready 0 running 1 blocked 1. 26 | Before cycle 20: running 1 blocked 1 ready 0. 27 | Before cycle 21: blocked 1 ready 0 running 1. 28 | Before cycle 22: ready 0 running 1 blocked 1. 29 | Before cycle 23: running 1 blocked 1 ready 0. 30 | Before cycle 24: blocked 1 ready 0 running 1. 31 | Before cycle 25: ready 0 running 1 blocked 1. 32 | Before cycle 26: running 1 blocked 1 ready 0. 33 | Before cycle 27: blocked 1 ready 0 running 1. 34 | Before cycle 28: ready 0 running 1 blocked 1. 35 | Before cycle 29: running 1 blocked 1 ready 0. 36 | Before cycle 30: blocked 1 ready 0 running 1. 37 | Before cycle 31: ready 0 running 1 blocked 1. 38 | Before cycle 32: running 1 blocked 1 ready 0. 39 | Before cycle 33: blocked 1 ready 0 running 1. 40 | Before cycle 34: ready 0 running 1 blocked 1. 41 | Before cycle 35: running 1 blocked 1 ready 0. 42 | Before cycle 36: blocked 1 ready 0 running 1. 43 | Before cycle 37: ready 0 running 1 blocked 1. 44 | Before cycle 38: running 1 blocked 1 ready 0. 45 | Before cycle 39: blocked 1 ready 0 running 1. 46 | Before cycle 40: ready 0 running 1 terminated 0. 47 | Before cycle 41: running 1 blocked 1 terminated 0. 48 | Before cycle 42: blocked 1 running 1 terminated 0. 49 | Before cycle 43: running 1 blocked 1 terminated 0. 50 | Before cycle 44: blocked 1 running 1 terminated 0. 51 | Before cycle 45: running 1 blocked 1 terminated 0. 52 | Before cycle 46: blocked 1 running 1 terminated 0. 53 | Before cycle 47: running 1 blocked 1 terminated 0. 54 | Before cycle 48: blocked 1 running 1 terminated 0. 55 | Before cycle 49: running 1 blocked 1 terminated 0. 56 | Before cycle 50: terminated 0 running 1 terminated 0. 57 | The scheduling algorithm used was First Come First Served 58 | 59 | Process 0: 60 | (A,B,C,M) = (0,1,20,1) 61 | Finishing time: 49 62 | Turnaround time: 49 63 | I/O time: 19 64 | Waiting time: 10 65 | 66 | Process 1: 67 | (A,B,C,M) = (0,1,20,1) 68 | Finishing time: 50 69 | Turnaround time: 50 70 | I/O time: 19 71 | Waiting time: 11 72 | 73 | Process 2: 74 | (A,B,C,M) = (10,1,10,1) 75 | Finishing time: 39 76 | Turnaround time: 29 77 | I/O time: 9 78 | Waiting time: 10 79 | 80 | Summary Data: 81 | Finishing time: 50 82 | CPU Utilization: 1.000000 83 | I/O Utilization: 0.940000 84 | Throughput: 6.000000 processes per hundred cycles 85 | Average turnaround time: 42.666668 86 | Average waiting time: 10.333333 87 | -------------------------------------------------------------------------------- /output_verbose/hprn-output-7-detailed.txt: -------------------------------------------------------------------------------- 1 | The original input was: 3 (0 1 20 1) (0 1 20 1) (10 1 10 1) 2 | The (sorted) input is: 3 (0 1 20 1) (0 1 20 1) (10 1 10 1) 3 | 4 | This detailed printout gives the state and remaining burst for each process 5 | 6 | Before cycle 0: unstarted 0 unstarted 0 unstarted 0. 7 | Before cycle 1: running 1 ready 0 unstarted 0. 8 | Before cycle 2: blocked 1 running 1 unstarted 0. 9 | Before cycle 3: running 1 blocked 1 unstarted 0. 10 | Before cycle 4: blocked 1 running 1 unstarted 0. 11 | Before cycle 5: running 1 blocked 1 unstarted 0. 12 | Before cycle 6: blocked 1 running 1 unstarted 0. 13 | Before cycle 7: running 1 blocked 1 unstarted 0. 14 | Before cycle 8: blocked 1 running 1 unstarted 0. 15 | Before cycle 9: running 1 blocked 1 unstarted 0. 16 | Before cycle 10: blocked 1 running 1 unstarted 0. 17 | Before cycle 11: running 1 blocked 1 ready 0. 18 | Before cycle 12: blocked 1 running 1 ready 0. 19 | Before cycle 13: running 1 blocked 1 ready 0. 20 | Before cycle 14: blocked 1 ready 0 running 1. 21 | Before cycle 15: ready 0 running 1 blocked 1. 22 | Before cycle 16: ready 0 blocked 1 running 1. 23 | Before cycle 17: running 1 ready 0 blocked 1. 24 | Before cycle 18: blocked 1 ready 0 running 1. 25 | Before cycle 19: ready 0 running 1 blocked 1. 26 | Before cycle 20: ready 0 blocked 1 running 1. 27 | Before cycle 21: running 1 ready 0 blocked 1. 28 | Before cycle 22: blocked 1 ready 0 running 1. 29 | Before cycle 23: ready 0 running 1 blocked 1. 30 | Before cycle 24: ready 0 blocked 1 running 1. 31 | Before cycle 25: running 1 ready 0 blocked 1. 32 | Before cycle 26: blocked 1 running 1 ready 0. 33 | Before cycle 27: ready 0 blocked 1 running 1. 34 | Before cycle 28: running 1 ready 0 blocked 1. 35 | Before cycle 29: blocked 1 running 1 ready 0. 36 | Before cycle 30: ready 0 blocked 1 running 1. 37 | Before cycle 31: running 1 ready 0 blocked 1. 38 | Before cycle 32: blocked 1 running 1 ready 0. 39 | Before cycle 33: ready 0 blocked 1 running 1. 40 | Before cycle 34: running 1 ready 0 blocked 1. 41 | Before cycle 35: blocked 1 running 1 ready 0. 42 | Before cycle 36: ready 0 blocked 1 running 1. 43 | Before cycle 37: running 1 ready 0 terminated 0. 44 | Before cycle 38: blocked 1 running 1 terminated 0. 45 | Before cycle 39: running 1 blocked 1 terminated 0. 46 | Before cycle 40: blocked 1 running 1 terminated 0. 47 | Before cycle 41: running 1 blocked 1 terminated 0. 48 | Before cycle 42: blocked 1 running 1 terminated 0. 49 | Before cycle 43: running 1 blocked 1 terminated 0. 50 | Before cycle 44: blocked 1 running 1 terminated 0. 51 | Before cycle 45: running 1 blocked 1 terminated 0. 52 | Before cycle 46: blocked 1 running 1 terminated 0. 53 | Before cycle 47: running 1 blocked 1 terminated 0. 54 | Before cycle 48: blocked 1 running 1 terminated 0. 55 | Before cycle 49: running 1 blocked 1 terminated 0. 56 | Before cycle 50: terminated 0 running 1 terminated 0. 57 | The scheduling algorithm used was Highest Penalty Ratio Next 58 | 59 | Process 0: 60 | (A,B,C,M) = (0,1,20,1) 61 | Finishing time: 49 62 | Turnaround time: 49 63 | I/O time: 19 64 | Waiting time: 10 65 | 66 | Process 1: 67 | (A,B,C,M) = (0,1,20,1) 68 | Finishing time: 50 69 | Turnaround time: 50 70 | I/O time: 19 71 | Waiting time: 11 72 | 73 | Process 2: 74 | (A,B,C,M) = (10,1,10,1) 75 | Finishing time: 36 76 | Turnaround time: 26 77 | I/O time: 9 78 | Waiting time: 7 79 | 80 | Summary Data: 81 | Finishing time: 50 82 | CPU Utilization: 1.000000 83 | I/O Utilization: 0.940000 84 | Throughput: 6.000000 processes per hundred cycles 85 | Average turnaround time: 41.666668 86 | Average waiting time: 9.333333 87 | -------------------------------------------------------------------------------- /output_verbose/sjf-output-7-detailed.txt: -------------------------------------------------------------------------------- 1 | The original input was: 3 (0 1 20 1) (0 1 20 1) (10 1 10 1) 2 | The (sorted) input is: 3 (0 1 20 1) (0 1 20 1) (10 1 10 1) 3 | 4 | This detailed printout gives the state and remaining burst for each process 5 | 6 | Before cycle 0: unstarted 0 unstarted 0 unstarted 0. 7 | Before cycle 1: running 1 ready 0 unstarted 0. 8 | Before cycle 2: blocked 1 running 1 unstarted 0. 9 | Before cycle 3: running 1 blocked 1 unstarted 0. 10 | Before cycle 4: blocked 1 running 1 unstarted 0. 11 | Before cycle 5: running 1 blocked 1 unstarted 0. 12 | Before cycle 6: blocked 1 running 1 unstarted 0. 13 | Before cycle 7: running 1 blocked 1 unstarted 0. 14 | Before cycle 8: blocked 1 running 1 unstarted 0. 15 | Before cycle 9: running 1 blocked 1 unstarted 0. 16 | Before cycle 10: blocked 1 running 1 unstarted 0. 17 | Before cycle 11: ready 0 blocked 1 running 1. 18 | Before cycle 12: running 1 ready 0 blocked 1. 19 | Before cycle 13: blocked 1 ready 0 running 1. 20 | Before cycle 14: running 1 ready 0 blocked 1. 21 | Before cycle 15: blocked 1 ready 0 running 1. 22 | Before cycle 16: running 1 ready 0 blocked 1. 23 | Before cycle 17: blocked 1 ready 0 running 1. 24 | Before cycle 18: running 1 ready 0 blocked 1. 25 | Before cycle 19: blocked 1 ready 0 running 1. 26 | Before cycle 20: running 1 ready 0 blocked 1. 27 | Before cycle 21: blocked 1 ready 0 running 1. 28 | Before cycle 22: running 1 ready 0 blocked 1. 29 | Before cycle 23: blocked 1 ready 0 running 1. 30 | Before cycle 24: running 1 ready 0 blocked 1. 31 | Before cycle 25: blocked 1 ready 0 running 1. 32 | Before cycle 26: running 1 ready 0 blocked 1. 33 | Before cycle 27: blocked 1 ready 0 running 1. 34 | Before cycle 28: running 1 ready 0 blocked 1. 35 | Before cycle 29: blocked 1 ready 0 running 1. 36 | Before cycle 30: running 1 ready 0 terminated 0. 37 | Before cycle 31: blocked 1 running 1 terminated 0. 38 | Before cycle 32: running 1 blocked 1 terminated 0. 39 | Before cycle 33: blocked 1 running 1 terminated 0. 40 | Before cycle 34: running 1 blocked 1 terminated 0. 41 | Before cycle 35: blocked 1 running 1 terminated 0. 42 | Before cycle 36: running 1 blocked 1 terminated 0. 43 | Before cycle 37: blocked 1 running 1 terminated 0. 44 | Before cycle 38: running 1 blocked 1 terminated 0. 45 | Before cycle 39: blocked 1 running 1 terminated 0. 46 | Before cycle 40: running 1 blocked 1 terminated 0. 47 | Before cycle 41: terminated 0 running 1 terminated 0. 48 | Before cycle 42: terminated 0 blocked 1 terminated 0. 49 | Before cycle 43: terminated 0 running 1 terminated 0. 50 | Before cycle 44: terminated 0 blocked 1 terminated 0. 51 | Before cycle 45: terminated 0 running 1 terminated 0. 52 | Before cycle 46: terminated 0 blocked 1 terminated 0. 53 | Before cycle 47: terminated 0 running 1 terminated 0. 54 | Before cycle 48: terminated 0 blocked 1 terminated 0. 55 | Before cycle 49: terminated 0 running 1 terminated 0. 56 | Before cycle 50: terminated 0 blocked 1 terminated 0. 57 | Before cycle 51: terminated 0 running 1 terminated 0. 58 | Before cycle 52: terminated 0 blocked 1 terminated 0. 59 | Before cycle 53: terminated 0 running 1 terminated 0. 60 | Before cycle 54: terminated 0 blocked 1 terminated 0. 61 | Before cycle 55: terminated 0 running 1 terminated 0. 62 | Before cycle 56: terminated 0 blocked 1 terminated 0. 63 | Before cycle 57: terminated 0 running 1 terminated 0. 64 | Before cycle 58: terminated 0 blocked 1 terminated 0. 65 | Before cycle 59: terminated 0 running 1 terminated 0. 66 | The scheduling algorithm used was Shortest Job First 67 | 68 | Process 0: 69 | (A,B,C,M) = (0,1,20,1) 70 | Finishing time: 40 71 | Turnaround time: 40 72 | I/O time: 19 73 | Waiting time: 1 74 | 75 | Process 1: 76 | (A,B,C,M) = (0,1,20,1) 77 | Finishing time: 59 78 | Turnaround time: 59 79 | I/O time: 19 80 | Waiting time: 20 81 | 82 | Process 2: 83 | (A,B,C,M) = (10,1,10,1) 84 | Finishing time: 29 85 | Turnaround time: 19 86 | I/O time: 9 87 | Waiting time: 0 88 | 89 | Summary Data: 90 | Finishing time: 59 91 | CPU Utilization: 0.847458 92 | I/O Utilization: 0.796610 93 | Throughput: 5.084746 processes per hundred cycles 94 | Average turnaround time: 39.333332 95 | Average waiting time: 7.000000 96 | -------------------------------------------------------------------------------- /src/process.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | # @File Name: process.py 4 | # @Created: 2017-10-16 11:31:12 seo (simon.seo@nyu.edu) 5 | # @Updated: 2017-10-19 15:51:19 Simon Seo (simon.seo@nyu.edu) 6 | import glb 7 | 8 | class Process(): 9 | """Class that simulates a process""" 10 | def __init__(self, A, B, C, M, i): 11 | self.A = A #Arrival Time 12 | self.B = B #CPU-burst time (block after) 13 | self.C = C #total CPU time needed 14 | self.M = M #ioburst = multiplier * cpuburst (block for) 15 | self.i = i #order in list (id) 16 | 17 | self.state = 'unstarted' #unstarted, ready, running, blocked, terminated 18 | self.burst = 0 #time left for any state 19 | self.prevBurst = 0 #length of previous burst (used for calculating ioburst) 20 | self.remC = C #CPU time remaining 21 | self.countDown = glb.q #quantum left for RR 22 | self.timeEnteredReady = None #to find the earliest one 23 | 24 | self.finishTime = None #time when process finishes 25 | self.turnaroundTime = 0 #finishing time - A 26 | self.ioTime = 0 #count time in blocked state 27 | self.waitingTime = 0 #count time in ready state 28 | self.runningTime = 0 #count time in running state 29 | 30 | def __lt__(self, p): 31 | '''priority: arrival time, input order''' 32 | return (self.A < p.A) if (self.A != p.A) else (self.i < p.i) 33 | 34 | def __repr__(self): 35 | return "({} {} {} {})".format(self.A, self.B, self.C, self.M) 36 | 37 | def __str__(self): 38 | stateStr = (' '*10 + self.state)[-10:] 39 | burstStr = (' '*3 + str(self.burst if not glb.q else self.countDown))[-3:] 40 | return stateStr + burstStr 41 | 42 | def printSummary(self): 43 | print(''' (A,B,C,M) = ({},{},{},{})\n\tFinishing time: {}\n\tTurnaround time: {}\n\tI/O time: {}\n\tWaiting time: {}\n''' \ 44 | .format(self.A, self.B, self.C, self.M, 45 | self.finishTime, self.turnaroundTime, 46 | self.ioTime, self.waitingTime) 47 | ) 48 | 49 | def tick(self): 50 | '''recalculate time variables''' 51 | state = self.state 52 | if state not in ['unstarted', 'terminated']: 53 | self.turnaroundTime += 1 54 | if state == 'running': 55 | self.burst -= 1 if self.burst > 0 else 0 56 | self.remC -= 1 57 | self.countDown -= 1 if glb.q > 0 else 0 58 | self.runningTime += 1 59 | elif state == 'ready': 60 | self.waitingTime += 1 61 | elif state == 'blocked': 62 | self.burst -= 1 if self.burst > 0 else 0 63 | self.ioTime += 1 64 | return 65 | 66 | def updateState(self): 67 | '''update state based on new time calculations''' 68 | now = glb.tk.getNow() 69 | if self.state == 'running': 70 | if self.remC == 0: 71 | self.state = 'terminated' 72 | self.finishTime = now 73 | elif self.burst == 0: 74 | self.block() 75 | elif self.countDown == 0: 76 | self.preempt() 77 | elif self.state == 'unstarted': 78 | if now == self.A: 79 | self.unblock() 80 | elif self.state == 'blocked': 81 | if self.burst == 0: 82 | self.unblock() 83 | elif self.state == 'ready': 84 | # ready processes are handled by the scheduler algorithm 85 | pass 86 | elif self.state == 'terminated': 87 | # terminated processes are left alone 88 | pass 89 | 90 | return self.state 91 | 92 | def ratio(self): 93 | T = self.turnaroundTime 94 | t = max(1, self.runningTime) 95 | return T/t 96 | 97 | def setRandomBurst(self): 98 | self.prevBurst = glb.r.randomOS(self.B) 99 | self.burst = self.prevBurst 100 | return 101 | 102 | def setIOBurst(self): 103 | self.burst = self.M * self.prevBurst #Assumes that prevBurst was CPUBurst 104 | return 105 | 106 | def run(self): 107 | self.state = 'running' 108 | if glb.q: 109 | self.countDown = glb.q 110 | if self.burst == 0: 111 | self.setRandomBurst() 112 | 113 | def block(self): 114 | self.state = 'blocked' 115 | self.setIOBurst() 116 | 117 | def _ready(self): 118 | self.state = 'ready' 119 | self.timeEnteredReady = glb.tk.getNow() 120 | 121 | def unblock(self): 122 | return self._ready() 123 | 124 | def preempt(self): 125 | return self._ready() 126 | 127 | class ProcessTable(list): 128 | """docstring for ProcessTable""" 129 | def __init__(self): 130 | super(ProcessTable, self).__init__() 131 | self.finishTime = 0 132 | self.IOutil = 0 133 | 134 | def __str__(self): 135 | # unstarted 0 unstarted 0 136 | result = '' 137 | for el in self: 138 | result += ' {}'.format(el) 139 | return result 140 | 141 | def __repr__(self): 142 | # 2 (0 1 5 1) (0 1 5 1) 143 | result = str(len(self)) 144 | for el in self: 145 | result += ' {}'.format(el.__repr__()) 146 | return result 147 | 148 | def sortByArrival(self): 149 | self.sort(key=lambda p: p.A) 150 | return self 151 | 152 | def sortByInput(self): 153 | self.sort(key=lambda p: p.i) 154 | return self 155 | 156 | def sortByReady(self): 157 | self.sort(key=lambda p: p.timeEnteredReady) 158 | return self 159 | 160 | def sortByRatio(self): 161 | self.sort(key=lambda p: -p.ratio()) 162 | return self 163 | 164 | def sortByJob(self): 165 | self.sort(key=lambda p:p.C - p.runningTime) 166 | return self 167 | 168 | def finished(self): 169 | for p in self: 170 | if p.state != 'terminated': 171 | return False 172 | self.finishTime = glb.tk.getNow() - 1 173 | return True 174 | 175 | def getAll(self, f): 176 | result = ProcessTable() 177 | for p in self: 178 | if f(p): 179 | result.append(p) 180 | return result 181 | 182 | def getByState(self, state): 183 | return self.getAll(lambda p: p.state == state) 184 | 185 | def tickAll(self): 186 | if len(self.getAll(lambda p: p.state == 'blocked')) > 0: 187 | self.IOutil += 1 188 | for p in self: 189 | p.tick() 190 | 191 | def updateStateAll(self): 192 | for p in self: 193 | p.updateState() 194 | 195 | def printSummaryAll(self): 196 | self.sortByArrival() 197 | psl = len(self) 198 | finishTime = self.finishTime 199 | CPUutil = sum(list([p.runningTime for p in self])) / finishTime 200 | IOutil = self.IOutil / finishTime 201 | Throughput = 100*psl/finishTime 202 | avgTurnaround = sum(list([p.turnaroundTime for p in self])) / psl 203 | avgWaiting = sum(list([p.waitingTime for p in self])) / psl 204 | for i, p in enumerate(self): 205 | print('Process {}:'.format(i)) 206 | p.printSummary() 207 | print('''Summary Data: 208 | Finishing time: {} 209 | CPU Utilization: {:.6f} 210 | I/O Utilization: {:.6f} 211 | Throughput: {:.6f} processes per hundred cycles 212 | Average turnaround time: {:.6f} 213 | Average waiting time: {:.6f}\n''' \ 214 | .format(finishTime, CPUutil, IOutil, Throughput, avgTurnaround, avgWaiting)) 215 | 216 | 217 | -------------------------------------------------------------------------------- /output_show-random/rr-output-7-show-random.txt: -------------------------------------------------------------------------------- 1 | The original input was: 3 (0 1 20 1) (0 1 20 1) (10 1 10 1) 2 | The (sorted) input is: 3 (0 1 20 1) (0 1 20 1) (10 1 10 1) 3 | 4 | This detailed printout gives the state and remaining burst for each process 5 | 6 | Before cycle 0: unstarted 0 unstarted 0 unstarted 0. 7 | Find burst when choosing ready process to run 1804289383 8 | Before cycle 1: running 1 ready 0 unstarted 0. 9 | Find burst when choosing ready process to run 846930886 10 | Before cycle 2: blocked 1 running 1 unstarted 0. 11 | Find burst when choosing ready process to run 1681692777 12 | Before cycle 3: running 1 blocked 1 unstarted 0. 13 | Find burst when choosing ready process to run 1714636915 14 | Before cycle 4: blocked 1 running 1 unstarted 0. 15 | Find burst when choosing ready process to run 1957747793 16 | Before cycle 5: running 1 blocked 1 unstarted 0. 17 | Find burst when choosing ready process to run 424238335 18 | Before cycle 6: blocked 1 running 1 unstarted 0. 19 | Find burst when choosing ready process to run 719885386 20 | Before cycle 7: running 1 blocked 1 unstarted 0. 21 | Find burst when choosing ready process to run 1649760492 22 | Before cycle 8: blocked 1 running 1 unstarted 0. 23 | Find burst when choosing ready process to run 596516649 24 | Before cycle 9: running 1 blocked 1 unstarted 0. 25 | Find burst when choosing ready process to run 1189641421 26 | Before cycle 10: blocked 1 running 1 unstarted 0. 27 | Find burst when choosing ready process to run 1025202362 28 | Before cycle 11: running 1 blocked 1 ready 0. 29 | Find burst when choosing ready process to run 1350490027 30 | Before cycle 12: blocked 1 ready 0 running 1. 31 | Find burst when choosing ready process to run 783368690 32 | Before cycle 13: ready 0 running 1 blocked 1. 33 | Find burst when choosing ready process to run 1102520059 34 | Before cycle 14: running 1 blocked 1 ready 0. 35 | Find burst when choosing ready process to run 2044897763 36 | Before cycle 15: blocked 1 ready 0 running 1. 37 | Find burst when choosing ready process to run 1967513926 38 | Before cycle 16: ready 0 running 1 blocked 1. 39 | Find burst when choosing ready process to run 1365180540 40 | Before cycle 17: running 1 blocked 1 ready 0. 41 | Find burst when choosing ready process to run 1540383426 42 | Before cycle 18: blocked 1 ready 0 running 1. 43 | Find burst when choosing ready process to run 304089172 44 | Before cycle 19: ready 0 running 1 blocked 1. 45 | Find burst when choosing ready process to run 1303455736 46 | Before cycle 20: running 1 blocked 1 ready 0. 47 | Find burst when choosing ready process to run 35005211 48 | Before cycle 21: blocked 1 ready 0 running 1. 49 | Find burst when choosing ready process to run 521595368 50 | Before cycle 22: ready 0 running 1 blocked 1. 51 | Find burst when choosing ready process to run 294702567 52 | Before cycle 23: running 1 blocked 1 ready 0. 53 | Find burst when choosing ready process to run 1726956429 54 | Before cycle 24: blocked 1 ready 0 running 1. 55 | Find burst when choosing ready process to run 336465782 56 | Before cycle 25: ready 0 running 1 blocked 1. 57 | Find burst when choosing ready process to run 861021530 58 | Before cycle 26: running 1 blocked 1 ready 0. 59 | Find burst when choosing ready process to run 278722862 60 | Before cycle 27: blocked 1 ready 0 running 1. 61 | Find burst when choosing ready process to run 233665123 62 | Before cycle 28: ready 0 running 1 blocked 1. 63 | Find burst when choosing ready process to run 2145174067 64 | Before cycle 29: running 1 blocked 1 ready 0. 65 | Find burst when choosing ready process to run 468703135 66 | Before cycle 30: blocked 1 ready 0 running 1. 67 | Find burst when choosing ready process to run 1101513929 68 | Before cycle 31: ready 0 running 1 blocked 1. 69 | Find burst when choosing ready process to run 1801979802 70 | Before cycle 32: running 1 blocked 1 ready 0. 71 | Find burst when choosing ready process to run 1315634022 72 | Before cycle 33: blocked 1 ready 0 running 1. 73 | Find burst when choosing ready process to run 635723058 74 | Before cycle 34: ready 0 running 1 blocked 1. 75 | Find burst when choosing ready process to run 1369133069 76 | Before cycle 35: running 1 blocked 1 ready 0. 77 | Find burst when choosing ready process to run 1125898167 78 | Before cycle 36: blocked 1 ready 0 running 1. 79 | Find burst when choosing ready process to run 1059961393 80 | Before cycle 37: ready 0 running 1 blocked 1. 81 | Find burst when choosing ready process to run 2089018456 82 | Before cycle 38: running 1 blocked 1 ready 0. 83 | Find burst when choosing ready process to run 628175011 84 | Before cycle 39: blocked 1 ready 0 running 1. 85 | Find burst when choosing ready process to run 1656478042 86 | Before cycle 40: ready 0 running 1 terminated 0. 87 | Find burst when choosing ready process to run 1131176229 88 | Before cycle 41: running 1 blocked 1 terminated 0. 89 | Find burst when choosing ready process to run 1653377373 90 | Before cycle 42: blocked 1 running 1 terminated 0. 91 | Find burst when choosing ready process to run 859484421 92 | Before cycle 43: running 1 blocked 1 terminated 0. 93 | Find burst when choosing ready process to run 1914544919 94 | Before cycle 44: blocked 1 running 1 terminated 0. 95 | Find burst when choosing ready process to run 608413784 96 | Before cycle 45: running 1 blocked 1 terminated 0. 97 | Find burst when choosing ready process to run 756898537 98 | Before cycle 46: blocked 1 running 1 terminated 0. 99 | Find burst when choosing ready process to run 1734575198 100 | Before cycle 47: running 1 blocked 1 terminated 0. 101 | Find burst when choosing ready process to run 1973594324 102 | Before cycle 48: blocked 1 running 1 terminated 0. 103 | Find burst when choosing ready process to run 149798315 104 | Before cycle 49: running 1 blocked 1 terminated 0. 105 | Find burst when choosing ready process to run 2038664370 106 | Before cycle 50: terminated 0 running 1 terminated 0. 107 | The scheduling algorithm used was Round Robbin 108 | 109 | Process 0: 110 | (A,B,C,M) = (0,1,20,1) 111 | Finishing time: 49 112 | Turnaround time: 49 113 | I/O time: 19 114 | Waiting time: 10 115 | 116 | Process 1: 117 | (A,B,C,M) = (0,1,20,1) 118 | Finishing time: 50 119 | Turnaround time: 50 120 | I/O time: 19 121 | Waiting time: 11 122 | 123 | Process 2: 124 | (A,B,C,M) = (10,1,10,1) 125 | Finishing time: 39 126 | Turnaround time: 29 127 | I/O time: 9 128 | Waiting time: 10 129 | 130 | Summary Data: 131 | Finishing time: 50 132 | CPU Utilization: 1.000000 133 | I/O Utilization: 0.940000 134 | Throughput: 6.000000 processes per hundred cycles 135 | Average turnaround time: 42.666668 136 | Average waiting time: 10.333333 137 | -------------------------------------------------------------------------------- /output_show-random/fcfs-output-7-show-random.txt: -------------------------------------------------------------------------------- 1 | The original input was: 3 (0 1 20 1) (0 1 20 1) (10 1 10 1) 2 | The (sorted) input is: 3 (0 1 20 1) (0 1 20 1) (10 1 10 1) 3 | 4 | This detailed printout gives the state and remaining burst for each process 5 | 6 | Before cycle 0: unstarted 0 unstarted 0 unstarted 0. 7 | Find burst when choosing ready process to run 1804289383 8 | Before cycle 1: running 1 ready 0 unstarted 0. 9 | Find burst when choosing ready process to run 846930886 10 | Before cycle 2: blocked 1 running 1 unstarted 0. 11 | Find burst when choosing ready process to run 1681692777 12 | Before cycle 3: running 1 blocked 1 unstarted 0. 13 | Find burst when choosing ready process to run 1714636915 14 | Before cycle 4: blocked 1 running 1 unstarted 0. 15 | Find burst when choosing ready process to run 1957747793 16 | Before cycle 5: running 1 blocked 1 unstarted 0. 17 | Find burst when choosing ready process to run 424238335 18 | Before cycle 6: blocked 1 running 1 unstarted 0. 19 | Find burst when choosing ready process to run 719885386 20 | Before cycle 7: running 1 blocked 1 unstarted 0. 21 | Find burst when choosing ready process to run 1649760492 22 | Before cycle 8: blocked 1 running 1 unstarted 0. 23 | Find burst when choosing ready process to run 596516649 24 | Before cycle 9: running 1 blocked 1 unstarted 0. 25 | Find burst when choosing ready process to run 1189641421 26 | Before cycle 10: blocked 1 running 1 unstarted 0. 27 | Find burst when choosing ready process to run 1025202362 28 | Before cycle 11: running 1 blocked 1 ready 0. 29 | Find burst when choosing ready process to run 1350490027 30 | Before cycle 12: blocked 1 ready 0 running 1. 31 | Find burst when choosing ready process to run 783368690 32 | Before cycle 13: ready 0 running 1 blocked 1. 33 | Find burst when choosing ready process to run 1102520059 34 | Before cycle 14: running 1 blocked 1 ready 0. 35 | Find burst when choosing ready process to run 2044897763 36 | Before cycle 15: blocked 1 ready 0 running 1. 37 | Find burst when choosing ready process to run 1967513926 38 | Before cycle 16: ready 0 running 1 blocked 1. 39 | Find burst when choosing ready process to run 1365180540 40 | Before cycle 17: running 1 blocked 1 ready 0. 41 | Find burst when choosing ready process to run 1540383426 42 | Before cycle 18: blocked 1 ready 0 running 1. 43 | Find burst when choosing ready process to run 304089172 44 | Before cycle 19: ready 0 running 1 blocked 1. 45 | Find burst when choosing ready process to run 1303455736 46 | Before cycle 20: running 1 blocked 1 ready 0. 47 | Find burst when choosing ready process to run 35005211 48 | Before cycle 21: blocked 1 ready 0 running 1. 49 | Find burst when choosing ready process to run 521595368 50 | Before cycle 22: ready 0 running 1 blocked 1. 51 | Find burst when choosing ready process to run 294702567 52 | Before cycle 23: running 1 blocked 1 ready 0. 53 | Find burst when choosing ready process to run 1726956429 54 | Before cycle 24: blocked 1 ready 0 running 1. 55 | Find burst when choosing ready process to run 336465782 56 | Before cycle 25: ready 0 running 1 blocked 1. 57 | Find burst when choosing ready process to run 861021530 58 | Before cycle 26: running 1 blocked 1 ready 0. 59 | Find burst when choosing ready process to run 278722862 60 | Before cycle 27: blocked 1 ready 0 running 1. 61 | Find burst when choosing ready process to run 233665123 62 | Before cycle 28: ready 0 running 1 blocked 1. 63 | Find burst when choosing ready process to run 2145174067 64 | Before cycle 29: running 1 blocked 1 ready 0. 65 | Find burst when choosing ready process to run 468703135 66 | Before cycle 30: blocked 1 ready 0 running 1. 67 | Find burst when choosing ready process to run 1101513929 68 | Before cycle 31: ready 0 running 1 blocked 1. 69 | Find burst when choosing ready process to run 1801979802 70 | Before cycle 32: running 1 blocked 1 ready 0. 71 | Find burst when choosing ready process to run 1315634022 72 | Before cycle 33: blocked 1 ready 0 running 1. 73 | Find burst when choosing ready process to run 635723058 74 | Before cycle 34: ready 0 running 1 blocked 1. 75 | Find burst when choosing ready process to run 1369133069 76 | Before cycle 35: running 1 blocked 1 ready 0. 77 | Find burst when choosing ready process to run 1125898167 78 | Before cycle 36: blocked 1 ready 0 running 1. 79 | Find burst when choosing ready process to run 1059961393 80 | Before cycle 37: ready 0 running 1 blocked 1. 81 | Find burst when choosing ready process to run 2089018456 82 | Before cycle 38: running 1 blocked 1 ready 0. 83 | Find burst when choosing ready process to run 628175011 84 | Before cycle 39: blocked 1 ready 0 running 1. 85 | Find burst when choosing ready process to run 1656478042 86 | Before cycle 40: ready 0 running 1 terminated 0. 87 | Find burst when choosing ready process to run 1131176229 88 | Before cycle 41: running 1 blocked 1 terminated 0. 89 | Find burst when choosing ready process to run 1653377373 90 | Before cycle 42: blocked 1 running 1 terminated 0. 91 | Find burst when choosing ready process to run 859484421 92 | Before cycle 43: running 1 blocked 1 terminated 0. 93 | Find burst when choosing ready process to run 1914544919 94 | Before cycle 44: blocked 1 running 1 terminated 0. 95 | Find burst when choosing ready process to run 608413784 96 | Before cycle 45: running 1 blocked 1 terminated 0. 97 | Find burst when choosing ready process to run 756898537 98 | Before cycle 46: blocked 1 running 1 terminated 0. 99 | Find burst when choosing ready process to run 1734575198 100 | Before cycle 47: running 1 blocked 1 terminated 0. 101 | Find burst when choosing ready process to run 1973594324 102 | Before cycle 48: blocked 1 running 1 terminated 0. 103 | Find burst when choosing ready process to run 149798315 104 | Before cycle 49: running 1 blocked 1 terminated 0. 105 | Find burst when choosing ready process to run 2038664370 106 | Before cycle 50: terminated 0 running 1 terminated 0. 107 | The scheduling algorithm used was First Come First Served 108 | 109 | Process 0: 110 | (A,B,C,M) = (0,1,20,1) 111 | Finishing time: 49 112 | Turnaround time: 49 113 | I/O time: 19 114 | Waiting time: 10 115 | 116 | Process 1: 117 | (A,B,C,M) = (0,1,20,1) 118 | Finishing time: 50 119 | Turnaround time: 50 120 | I/O time: 19 121 | Waiting time: 11 122 | 123 | Process 2: 124 | (A,B,C,M) = (10,1,10,1) 125 | Finishing time: 39 126 | Turnaround time: 29 127 | I/O time: 9 128 | Waiting time: 10 129 | 130 | Summary Data: 131 | Finishing time: 50 132 | CPU Utilization: 1.000000 133 | I/O Utilization: 0.940000 134 | Throughput: 6.000000 processes per hundred cycles 135 | Average turnaround time: 42.666668 136 | Average waiting time: 10.333333 137 | -------------------------------------------------------------------------------- /output_show-random/hprn-output-7-show-random.txt: -------------------------------------------------------------------------------- 1 | The original input was: 3 (0 1 20 1) (0 1 20 1) (10 1 10 1) 2 | The (sorted) input is: 3 (0 1 20 1) (0 1 20 1) (10 1 10 1) 3 | 4 | This detailed printout gives the state and remaining burst for each process 5 | 6 | Before cycle 0: unstarted 0 unstarted 0 unstarted 0. 7 | Find burst when choosing ready process to run 1804289383 8 | Before cycle 1: running 1 ready 0 unstarted 0. 9 | Find burst when choosing ready process to run 846930886 10 | Before cycle 2: blocked 1 running 1 unstarted 0. 11 | Find burst when choosing ready process to run 1681692777 12 | Before cycle 3: running 1 blocked 1 unstarted 0. 13 | Find burst when choosing ready process to run 1714636915 14 | Before cycle 4: blocked 1 running 1 unstarted 0. 15 | Find burst when choosing ready process to run 1957747793 16 | Before cycle 5: running 1 blocked 1 unstarted 0. 17 | Find burst when choosing ready process to run 424238335 18 | Before cycle 6: blocked 1 running 1 unstarted 0. 19 | Find burst when choosing ready process to run 719885386 20 | Before cycle 7: running 1 blocked 1 unstarted 0. 21 | Find burst when choosing ready process to run 1649760492 22 | Before cycle 8: blocked 1 running 1 unstarted 0. 23 | Find burst when choosing ready process to run 596516649 24 | Before cycle 9: running 1 blocked 1 unstarted 0. 25 | Find burst when choosing ready process to run 1189641421 26 | Before cycle 10: blocked 1 running 1 unstarted 0. 27 | Find burst when choosing ready process to run 1025202362 28 | Before cycle 11: running 1 blocked 1 ready 0. 29 | Find burst when choosing ready process to run 1350490027 30 | Before cycle 12: blocked 1 running 1 ready 0. 31 | Find burst when choosing ready process to run 783368690 32 | Before cycle 13: running 1 blocked 1 ready 0. 33 | Find burst when choosing ready process to run 1102520059 34 | Before cycle 14: blocked 1 ready 0 running 1. 35 | Find burst when choosing ready process to run 2044897763 36 | Before cycle 15: ready 0 running 1 blocked 1. 37 | Find burst when choosing ready process to run 1967513926 38 | Before cycle 16: ready 0 blocked 1 running 1. 39 | Find burst when choosing ready process to run 1365180540 40 | Before cycle 17: running 1 ready 0 blocked 1. 41 | Find burst when choosing ready process to run 1540383426 42 | Before cycle 18: blocked 1 ready 0 running 1. 43 | Find burst when choosing ready process to run 304089172 44 | Before cycle 19: ready 0 running 1 blocked 1. 45 | Find burst when choosing ready process to run 1303455736 46 | Before cycle 20: ready 0 blocked 1 running 1. 47 | Find burst when choosing ready process to run 35005211 48 | Before cycle 21: running 1 ready 0 blocked 1. 49 | Find burst when choosing ready process to run 521595368 50 | Before cycle 22: blocked 1 ready 0 running 1. 51 | Find burst when choosing ready process to run 294702567 52 | Before cycle 23: ready 0 running 1 blocked 1. 53 | Find burst when choosing ready process to run 1726956429 54 | Before cycle 24: ready 0 blocked 1 running 1. 55 | Find burst when choosing ready process to run 336465782 56 | Before cycle 25: running 1 ready 0 blocked 1. 57 | Find burst when choosing ready process to run 861021530 58 | Before cycle 26: blocked 1 running 1 ready 0. 59 | Find burst when choosing ready process to run 278722862 60 | Before cycle 27: ready 0 blocked 1 running 1. 61 | Find burst when choosing ready process to run 233665123 62 | Before cycle 28: running 1 ready 0 blocked 1. 63 | Find burst when choosing ready process to run 2145174067 64 | Before cycle 29: blocked 1 running 1 ready 0. 65 | Find burst when choosing ready process to run 468703135 66 | Before cycle 30: ready 0 blocked 1 running 1. 67 | Find burst when choosing ready process to run 1101513929 68 | Before cycle 31: running 1 ready 0 blocked 1. 69 | Find burst when choosing ready process to run 1801979802 70 | Before cycle 32: blocked 1 running 1 ready 0. 71 | Find burst when choosing ready process to run 1315634022 72 | Before cycle 33: ready 0 blocked 1 running 1. 73 | Find burst when choosing ready process to run 635723058 74 | Before cycle 34: running 1 ready 0 blocked 1. 75 | Find burst when choosing ready process to run 1369133069 76 | Before cycle 35: blocked 1 running 1 ready 0. 77 | Find burst when choosing ready process to run 1125898167 78 | Before cycle 36: ready 0 blocked 1 running 1. 79 | Find burst when choosing ready process to run 1059961393 80 | Before cycle 37: running 1 ready 0 terminated 0. 81 | Find burst when choosing ready process to run 2089018456 82 | Before cycle 38: blocked 1 running 1 terminated 0. 83 | Find burst when choosing ready process to run 628175011 84 | Before cycle 39: running 1 blocked 1 terminated 0. 85 | Find burst when choosing ready process to run 1656478042 86 | Before cycle 40: blocked 1 running 1 terminated 0. 87 | Find burst when choosing ready process to run 1131176229 88 | Before cycle 41: running 1 blocked 1 terminated 0. 89 | Find burst when choosing ready process to run 1653377373 90 | Before cycle 42: blocked 1 running 1 terminated 0. 91 | Find burst when choosing ready process to run 859484421 92 | Before cycle 43: running 1 blocked 1 terminated 0. 93 | Find burst when choosing ready process to run 1914544919 94 | Before cycle 44: blocked 1 running 1 terminated 0. 95 | Find burst when choosing ready process to run 608413784 96 | Before cycle 45: running 1 blocked 1 terminated 0. 97 | Find burst when choosing ready process to run 756898537 98 | Before cycle 46: blocked 1 running 1 terminated 0. 99 | Find burst when choosing ready process to run 1734575198 100 | Before cycle 47: running 1 blocked 1 terminated 0. 101 | Find burst when choosing ready process to run 1973594324 102 | Before cycle 48: blocked 1 running 1 terminated 0. 103 | Find burst when choosing ready process to run 149798315 104 | Before cycle 49: running 1 blocked 1 terminated 0. 105 | Find burst when choosing ready process to run 2038664370 106 | Before cycle 50: terminated 0 running 1 terminated 0. 107 | The scheduling algorithm used was Highest Penalty Ratio Next 108 | 109 | Process 0: 110 | (A,B,C,M) = (0,1,20,1) 111 | Finishing time: 49 112 | Turnaround time: 49 113 | I/O time: 19 114 | Waiting time: 10 115 | 116 | Process 1: 117 | (A,B,C,M) = (0,1,20,1) 118 | Finishing time: 50 119 | Turnaround time: 50 120 | I/O time: 19 121 | Waiting time: 11 122 | 123 | Process 2: 124 | (A,B,C,M) = (10,1,10,1) 125 | Finishing time: 36 126 | Turnaround time: 26 127 | I/O time: 9 128 | Waiting time: 7 129 | 130 | Summary Data: 131 | Finishing time: 50 132 | CPU Utilization: 1.000000 133 | I/O Utilization: 0.940000 134 | Throughput: 6.000000 processes per hundred cycles 135 | Average turnaround time: 41.666668 136 | Average waiting time: 9.333333 137 | -------------------------------------------------------------------------------- /output_show-random/sjf-output-7-show-random.txt: -------------------------------------------------------------------------------- 1 | The original input was: 3 (0 1 20 1) (0 1 20 1) (10 1 10 1) 2 | The (sorted) input is: 3 (0 1 20 1) (0 1 20 1) (10 1 10 1) 3 | 4 | This detailed printout gives the state and remaining burst for each process 5 | 6 | Before cycle 0: unstarted 0 unstarted 0 unstarted 0. 7 | Find burst when choosing ready process to run 1804289383 8 | Before cycle 1: running 1 ready 0 unstarted 0. 9 | Find burst when choosing ready process to run 846930886 10 | Before cycle 2: blocked 1 running 1 unstarted 0. 11 | Find burst when choosing ready process to run 1681692777 12 | Before cycle 3: running 1 blocked 1 unstarted 0. 13 | Find burst when choosing ready process to run 1714636915 14 | Before cycle 4: blocked 1 running 1 unstarted 0. 15 | Find burst when choosing ready process to run 1957747793 16 | Before cycle 5: running 1 blocked 1 unstarted 0. 17 | Find burst when choosing ready process to run 424238335 18 | Before cycle 6: blocked 1 running 1 unstarted 0. 19 | Find burst when choosing ready process to run 719885386 20 | Before cycle 7: running 1 blocked 1 unstarted 0. 21 | Find burst when choosing ready process to run 1649760492 22 | Before cycle 8: blocked 1 running 1 unstarted 0. 23 | Find burst when choosing ready process to run 596516649 24 | Before cycle 9: running 1 blocked 1 unstarted 0. 25 | Find burst when choosing ready process to run 1189641421 26 | Before cycle 10: blocked 1 running 1 unstarted 0. 27 | Find burst when choosing ready process to run 1025202362 28 | Before cycle 11: ready 0 blocked 1 running 1. 29 | Find burst when choosing ready process to run 1350490027 30 | Before cycle 12: running 1 ready 0 blocked 1. 31 | Find burst when choosing ready process to run 783368690 32 | Before cycle 13: blocked 1 ready 0 running 1. 33 | Find burst when choosing ready process to run 1102520059 34 | Before cycle 14: running 1 ready 0 blocked 1. 35 | Find burst when choosing ready process to run 2044897763 36 | Before cycle 15: blocked 1 ready 0 running 1. 37 | Find burst when choosing ready process to run 1967513926 38 | Before cycle 16: running 1 ready 0 blocked 1. 39 | Find burst when choosing ready process to run 1365180540 40 | Before cycle 17: blocked 1 ready 0 running 1. 41 | Find burst when choosing ready process to run 1540383426 42 | Before cycle 18: running 1 ready 0 blocked 1. 43 | Find burst when choosing ready process to run 304089172 44 | Before cycle 19: blocked 1 ready 0 running 1. 45 | Find burst when choosing ready process to run 1303455736 46 | Before cycle 20: running 1 ready 0 blocked 1. 47 | Find burst when choosing ready process to run 35005211 48 | Before cycle 21: blocked 1 ready 0 running 1. 49 | Find burst when choosing ready process to run 521595368 50 | Before cycle 22: running 1 ready 0 blocked 1. 51 | Find burst when choosing ready process to run 294702567 52 | Before cycle 23: blocked 1 ready 0 running 1. 53 | Find burst when choosing ready process to run 1726956429 54 | Before cycle 24: running 1 ready 0 blocked 1. 55 | Find burst when choosing ready process to run 336465782 56 | Before cycle 25: blocked 1 ready 0 running 1. 57 | Find burst when choosing ready process to run 861021530 58 | Before cycle 26: running 1 ready 0 blocked 1. 59 | Find burst when choosing ready process to run 278722862 60 | Before cycle 27: blocked 1 ready 0 running 1. 61 | Find burst when choosing ready process to run 233665123 62 | Before cycle 28: running 1 ready 0 blocked 1. 63 | Find burst when choosing ready process to run 2145174067 64 | Before cycle 29: blocked 1 ready 0 running 1. 65 | Find burst when choosing ready process to run 468703135 66 | Before cycle 30: running 1 ready 0 terminated 0. 67 | Find burst when choosing ready process to run 1101513929 68 | Before cycle 31: blocked 1 running 1 terminated 0. 69 | Find burst when choosing ready process to run 1801979802 70 | Before cycle 32: running 1 blocked 1 terminated 0. 71 | Find burst when choosing ready process to run 1315634022 72 | Before cycle 33: blocked 1 running 1 terminated 0. 73 | Find burst when choosing ready process to run 635723058 74 | Before cycle 34: running 1 blocked 1 terminated 0. 75 | Find burst when choosing ready process to run 1369133069 76 | Before cycle 35: blocked 1 running 1 terminated 0. 77 | Find burst when choosing ready process to run 1125898167 78 | Before cycle 36: running 1 blocked 1 terminated 0. 79 | Find burst when choosing ready process to run 1059961393 80 | Before cycle 37: blocked 1 running 1 terminated 0. 81 | Find burst when choosing ready process to run 2089018456 82 | Before cycle 38: running 1 blocked 1 terminated 0. 83 | Find burst when choosing ready process to run 628175011 84 | Before cycle 39: blocked 1 running 1 terminated 0. 85 | Find burst when choosing ready process to run 1656478042 86 | Before cycle 40: running 1 blocked 1 terminated 0. 87 | Find burst when choosing ready process to run 1131176229 88 | Before cycle 41: terminated 0 running 1 terminated 0. 89 | Before cycle 42: terminated 0 blocked 1 terminated 0. 90 | Find burst when choosing ready process to run 1653377373 91 | Before cycle 43: terminated 0 running 1 terminated 0. 92 | Before cycle 44: terminated 0 blocked 1 terminated 0. 93 | Find burst when choosing ready process to run 859484421 94 | Before cycle 45: terminated 0 running 1 terminated 0. 95 | Before cycle 46: terminated 0 blocked 1 terminated 0. 96 | Find burst when choosing ready process to run 1914544919 97 | Before cycle 47: terminated 0 running 1 terminated 0. 98 | Before cycle 48: terminated 0 blocked 1 terminated 0. 99 | Find burst when choosing ready process to run 608413784 100 | Before cycle 49: terminated 0 running 1 terminated 0. 101 | Before cycle 50: terminated 0 blocked 1 terminated 0. 102 | Find burst when choosing ready process to run 756898537 103 | Before cycle 51: terminated 0 running 1 terminated 0. 104 | Before cycle 52: terminated 0 blocked 1 terminated 0. 105 | Find burst when choosing ready process to run 1734575198 106 | Before cycle 53: terminated 0 running 1 terminated 0. 107 | Before cycle 54: terminated 0 blocked 1 terminated 0. 108 | Find burst when choosing ready process to run 1973594324 109 | Before cycle 55: terminated 0 running 1 terminated 0. 110 | Before cycle 56: terminated 0 blocked 1 terminated 0. 111 | Find burst when choosing ready process to run 149798315 112 | Before cycle 57: terminated 0 running 1 terminated 0. 113 | Before cycle 58: terminated 0 blocked 1 terminated 0. 114 | Find burst when choosing ready process to run 2038664370 115 | Before cycle 59: terminated 0 running 1 terminated 0. 116 | The scheduling algorithm used was Shortest Job First 117 | 118 | Process 0: 119 | (A,B,C,M) = (0,1,20,1) 120 | Finishing time: 40 121 | Turnaround time: 40 122 | I/O time: 19 123 | Waiting time: 1 124 | 125 | Process 1: 126 | (A,B,C,M) = (0,1,20,1) 127 | Finishing time: 59 128 | Turnaround time: 59 129 | I/O time: 19 130 | Waiting time: 20 131 | 132 | Process 2: 133 | (A,B,C,M) = (10,1,10,1) 134 | Finishing time: 29 135 | Turnaround time: 19 136 | I/O time: 9 137 | Waiting time: 0 138 | 139 | Summary Data: 140 | Finishing time: 59 141 | CPU Utilization: 0.847458 142 | I/O Utilization: 0.796610 143 | Throughput: 5.084746 processes per hundred cycles 144 | Average turnaround time: 39.333332 145 | Average waiting time: 7.000000 146 | -------------------------------------------------------------------------------- /output_verbose/fcfs-output-5-detailed.txt: -------------------------------------------------------------------------------- 1 | The original input was: 3 (1 5 30 2) (1 5 30 2) (0 5 30 2) 2 | The (sorted) input is: 3 (0 5 30 2) (1 5 30 2) (1 5 30 2) 3 | 4 | This detailed printout gives the state and remaining burst for each process 5 | 6 | Before cycle 0: unstarted 0 unstarted 0 unstarted 0. 7 | Before cycle 1: running 4 unstarted 0 unstarted 0. 8 | Before cycle 2: running 3 ready 0 ready 0. 9 | Before cycle 3: running 2 ready 0 ready 0. 10 | Before cycle 4: running 1 ready 0 ready 0. 11 | Before cycle 5: blocked 8 running 2 ready 0. 12 | Before cycle 6: blocked 7 running 1 ready 0. 13 | Before cycle 7: blocked 6 blocked 4 running 3. 14 | Before cycle 8: blocked 5 blocked 3 running 2. 15 | Before cycle 9: blocked 4 blocked 2 running 1. 16 | Before cycle 10: blocked 3 blocked 1 blocked 6. 17 | Before cycle 11: blocked 2 running 1 blocked 5. 18 | Before cycle 12: blocked 1 blocked 2 blocked 4. 19 | Before cycle 13: running 4 blocked 1 blocked 3. 20 | Before cycle 14: running 3 ready 0 blocked 2. 21 | Before cycle 15: running 2 ready 0 blocked 1. 22 | Before cycle 16: running 1 ready 0 ready 0. 23 | Before cycle 17: blocked 8 running 1 ready 0. 24 | Before cycle 18: blocked 7 blocked 2 running 2. 25 | Before cycle 19: blocked 6 blocked 1 running 1. 26 | Before cycle 20: blocked 5 running 3 blocked 4. 27 | Before cycle 21: blocked 4 running 2 blocked 3. 28 | Before cycle 22: blocked 3 running 1 blocked 2. 29 | Before cycle 23: blocked 2 blocked 6 blocked 1. 30 | Before cycle 24: blocked 1 blocked 5 running 5. 31 | Before cycle 25: ready 0 blocked 4 running 4. 32 | Before cycle 26: ready 0 blocked 3 running 3. 33 | Before cycle 27: ready 0 blocked 2 running 2. 34 | Before cycle 28: ready 0 blocked 1 running 1. 35 | Before cycle 29: running 2 ready 0 blocked 10. 36 | Before cycle 30: running 1 ready 0 blocked 9. 37 | Before cycle 31: blocked 4 running 3 blocked 8. 38 | Before cycle 32: blocked 3 running 2 blocked 7. 39 | Before cycle 33: blocked 2 running 1 blocked 6. 40 | Before cycle 34: blocked 1 blocked 6 blocked 5. 41 | Before cycle 35: running 3 blocked 5 blocked 4. 42 | Before cycle 36: running 2 blocked 4 blocked 3. 43 | Before cycle 37: running 1 blocked 3 blocked 2. 44 | Before cycle 38: blocked 6 blocked 2 blocked 1. 45 | Before cycle 39: blocked 5 blocked 1 running 1. 46 | Before cycle 40: blocked 4 running 5 blocked 2. 47 | Before cycle 41: blocked 3 running 4 blocked 1. 48 | Before cycle 42: blocked 2 running 3 ready 0. 49 | Before cycle 43: blocked 1 running 2 ready 0. 50 | Before cycle 44: ready 0 running 1 ready 0. 51 | Before cycle 45: ready 0 blocked 10 running 4. 52 | Before cycle 46: ready 0 blocked 9 running 3. 53 | Before cycle 47: ready 0 blocked 8 running 2. 54 | Before cycle 48: ready 0 blocked 7 running 1. 55 | Before cycle 49: running 2 blocked 6 blocked 8. 56 | Before cycle 50: running 1 blocked 5 blocked 7. 57 | Before cycle 51: blocked 4 blocked 4 blocked 6. 58 | Before cycle 52: blocked 3 blocked 3 blocked 5. 59 | Before cycle 53: blocked 2 blocked 2 blocked 4. 60 | Before cycle 54: blocked 1 blocked 1 blocked 3. 61 | Before cycle 55: running 1 ready 0 blocked 2. 62 | Before cycle 56: blocked 2 running 2 blocked 1. 63 | Before cycle 57: blocked 1 running 1 ready 0. 64 | Before cycle 58: ready 0 blocked 4 running 3. 65 | Before cycle 59: ready 0 blocked 3 running 2. 66 | Before cycle 60: ready 0 blocked 2 running 1. 67 | Before cycle 61: running 2 blocked 1 blocked 6. 68 | Before cycle 62: running 1 ready 0 blocked 5. 69 | Before cycle 63: blocked 4 running 2 blocked 4. 70 | Before cycle 64: blocked 3 running 1 blocked 3. 71 | Before cycle 65: blocked 2 blocked 4 blocked 2. 72 | Before cycle 66: blocked 1 blocked 3 blocked 1. 73 | Before cycle 67: running 4 blocked 2 ready 0. 74 | Before cycle 68: running 3 blocked 1 ready 0. 75 | Before cycle 69: running 2 ready 0 ready 0. 76 | Before cycle 70: running 1 ready 0 ready 0. 77 | Before cycle 71: blocked 8 ready 0 running 3. 78 | Before cycle 72: blocked 7 ready 0 running 2. 79 | Before cycle 73: blocked 6 ready 0 running 1. 80 | Before cycle 74: blocked 5 running 5 blocked 6. 81 | Before cycle 75: blocked 4 running 4 blocked 5. 82 | Before cycle 76: blocked 3 running 3 blocked 4. 83 | Before cycle 77: blocked 2 running 2 blocked 3. 84 | Before cycle 78: blocked 1 running 1 blocked 2. 85 | Before cycle 79: running 3 blocked 10 blocked 1. 86 | Before cycle 80: running 2 blocked 9 ready 0. 87 | Before cycle 81: running 1 blocked 8 ready 0. 88 | Before cycle 82: blocked 6 blocked 7 running 1. 89 | Before cycle 83: blocked 5 blocked 6 blocked 2. 90 | Before cycle 84: blocked 4 blocked 5 blocked 1. 91 | Before cycle 85: blocked 3 blocked 4 running 3. 92 | Before cycle 86: blocked 2 blocked 3 running 2. 93 | Before cycle 87: blocked 1 blocked 2 running 1. 94 | Before cycle 88: running 4 blocked 1 blocked 6. 95 | Before cycle 89: running 3 ready 0 blocked 5. 96 | Before cycle 90: running 2 ready 0 blocked 4. 97 | Before cycle 91: running 1 ready 0 blocked 3. 98 | Before cycle 92: blocked 8 running 3 blocked 2. 99 | Before cycle 93: blocked 7 running 2 blocked 1. 100 | Before cycle 94: blocked 6 running 1 ready 0. 101 | Before cycle 95: blocked 5 blocked 6 running 1. 102 | Before cycle 96: blocked 4 blocked 5 blocked 2. 103 | Before cycle 97: blocked 3 blocked 4 blocked 1. 104 | Before cycle 98: blocked 2 blocked 3 running 5. 105 | Before cycle 99: blocked 1 blocked 2 running 4. 106 | Before cycle 100: ready 0 blocked 1 running 3. 107 | Before cycle 101: ready 0 ready 0 running 2. 108 | Before cycle 102: running 3 ready 0 terminated 0. 109 | Before cycle 103: terminated 0 running 3 terminated 0. 110 | Before cycle 104: terminated 0 running 2 terminated 0. 111 | Before cycle 105: terminated 0 running 1 terminated 0. 112 | The scheduling algorithm used was First Come First Served 113 | 114 | Process 0: 115 | (A,B,C,M) = (0,5,30,2) 116 | Finishing time: 102 117 | Turnaround time: 102 118 | I/O time: 58 119 | Waiting time: 14 120 | 121 | Process 1: 122 | (A,B,C,M) = (1,5,30,2) 123 | Finishing time: 105 124 | Turnaround time: 104 125 | I/O time: 54 126 | Waiting time: 20 127 | 128 | Process 2: 129 | (A,B,C,M) = (1,5,30,2) 130 | Finishing time: 101 131 | Turnaround time: 100 132 | I/O time: 52 133 | Waiting time: 18 134 | 135 | Summary Data: 136 | Finishing time: 105 137 | CPU Utilization: 0.857143 138 | I/O Utilization: 0.876190 139 | Throughput: 2.857143 processes per hundred cycles 140 | Average turnaround time: 102.000000 141 | Average waiting time: 17.333334 142 | -------------------------------------------------------------------------------- /output_verbose/hprn-output-5-detailed.txt: -------------------------------------------------------------------------------- 1 | The original input was: 3 (1 5 30 2) (1 5 30 2) (0 5 30 2) 2 | The (sorted) input is: 3 (0 5 30 2) (1 5 30 2) (1 5 30 2) 3 | 4 | This detailed printout gives the state and remaining burst for each process 5 | 6 | Before cycle 0: unstarted 0 unstarted 0 unstarted 0. 7 | Before cycle 1: running 4 unstarted 0 unstarted 0. 8 | Before cycle 2: running 3 ready 0 ready 0. 9 | Before cycle 3: running 2 ready 0 ready 0. 10 | Before cycle 4: running 1 ready 0 ready 0. 11 | Before cycle 5: blocked 8 running 2 ready 0. 12 | Before cycle 6: blocked 7 running 1 ready 0. 13 | Before cycle 7: blocked 6 blocked 4 running 3. 14 | Before cycle 8: blocked 5 blocked 3 running 2. 15 | Before cycle 9: blocked 4 blocked 2 running 1. 16 | Before cycle 10: blocked 3 blocked 1 blocked 6. 17 | Before cycle 11: blocked 2 running 1 blocked 5. 18 | Before cycle 12: blocked 1 blocked 2 blocked 4. 19 | Before cycle 13: running 4 blocked 1 blocked 3. 20 | Before cycle 14: running 3 ready 0 blocked 2. 21 | Before cycle 15: running 2 ready 0 blocked 1. 22 | Before cycle 16: running 1 ready 0 ready 0. 23 | Before cycle 17: blocked 8 running 1 ready 0. 24 | Before cycle 18: blocked 7 blocked 2 running 2. 25 | Before cycle 19: blocked 6 blocked 1 running 1. 26 | Before cycle 20: blocked 5 running 3 blocked 4. 27 | Before cycle 21: blocked 4 running 2 blocked 3. 28 | Before cycle 22: blocked 3 running 1 blocked 2. 29 | Before cycle 23: blocked 2 blocked 6 blocked 1. 30 | Before cycle 24: blocked 1 blocked 5 running 5. 31 | Before cycle 25: ready 0 blocked 4 running 4. 32 | Before cycle 26: ready 0 blocked 3 running 3. 33 | Before cycle 27: ready 0 blocked 2 running 2. 34 | Before cycle 28: ready 0 blocked 1 running 1. 35 | Before cycle 29: ready 0 running 2 blocked 10. 36 | Before cycle 30: ready 0 running 1 blocked 9. 37 | Before cycle 31: running 3 blocked 4 blocked 8. 38 | Before cycle 32: running 2 blocked 3 blocked 7. 39 | Before cycle 33: running 1 blocked 2 blocked 6. 40 | Before cycle 34: blocked 6 blocked 1 blocked 5. 41 | Before cycle 35: blocked 5 running 3 blocked 4. 42 | Before cycle 36: blocked 4 running 2 blocked 3. 43 | Before cycle 37: blocked 3 running 1 blocked 2. 44 | Before cycle 38: blocked 2 blocked 6 blocked 1. 45 | Before cycle 39: blocked 1 blocked 5 running 1. 46 | Before cycle 40: running 5 blocked 4 blocked 2. 47 | Before cycle 41: running 4 blocked 3 blocked 1. 48 | Before cycle 42: running 3 blocked 2 ready 0. 49 | Before cycle 43: running 2 blocked 1 ready 0. 50 | Before cycle 44: running 1 ready 0 ready 0. 51 | Before cycle 45: blocked 10 ready 0 running 4. 52 | Before cycle 46: blocked 9 ready 0 running 3. 53 | Before cycle 47: blocked 8 ready 0 running 2. 54 | Before cycle 48: blocked 7 ready 0 running 1. 55 | Before cycle 49: blocked 6 running 2 blocked 8. 56 | Before cycle 50: blocked 5 running 1 blocked 7. 57 | Before cycle 51: blocked 4 blocked 4 blocked 6. 58 | Before cycle 52: blocked 3 blocked 3 blocked 5. 59 | Before cycle 53: blocked 2 blocked 2 blocked 4. 60 | Before cycle 54: blocked 1 blocked 1 blocked 3. 61 | Before cycle 55: ready 0 running 1 blocked 2. 62 | Before cycle 56: running 2 blocked 2 blocked 1. 63 | Before cycle 57: running 1 blocked 1 ready 0. 64 | Before cycle 58: blocked 4 running 3 ready 0. 65 | Before cycle 59: blocked 3 running 2 ready 0. 66 | Before cycle 60: blocked 2 running 1 ready 0. 67 | Before cycle 61: blocked 1 blocked 6 running 2. 68 | Before cycle 62: ready 0 blocked 5 running 1. 69 | Before cycle 63: running 2 blocked 4 blocked 4. 70 | Before cycle 64: running 1 blocked 3 blocked 3. 71 | Before cycle 65: blocked 4 blocked 2 blocked 2. 72 | Before cycle 66: blocked 3 blocked 1 blocked 1. 73 | Before cycle 67: blocked 2 ready 0 running 4. 74 | Before cycle 68: blocked 1 ready 0 running 3. 75 | Before cycle 69: ready 0 ready 0 running 2. 76 | Before cycle 70: ready 0 ready 0 running 1. 77 | Before cycle 71: ready 0 running 3 blocked 8. 78 | Before cycle 72: ready 0 running 2 blocked 7. 79 | Before cycle 73: ready 0 running 1 blocked 6. 80 | Before cycle 74: running 5 blocked 6 blocked 5. 81 | Before cycle 75: running 4 blocked 5 blocked 4. 82 | Before cycle 76: running 3 blocked 4 blocked 3. 83 | Before cycle 77: running 2 blocked 3 blocked 2. 84 | Before cycle 78: running 1 blocked 2 blocked 1. 85 | Before cycle 79: blocked 10 blocked 1 running 3. 86 | Before cycle 80: blocked 9 ready 0 running 2. 87 | Before cycle 81: blocked 8 ready 0 running 1. 88 | Before cycle 82: blocked 7 running 1 blocked 6. 89 | Before cycle 83: blocked 6 blocked 2 blocked 5. 90 | Before cycle 84: blocked 5 blocked 1 blocked 4. 91 | Before cycle 85: blocked 4 running 3 blocked 3. 92 | Before cycle 86: blocked 3 running 2 blocked 2. 93 | Before cycle 87: blocked 2 running 1 blocked 1. 94 | Before cycle 88: blocked 1 blocked 6 running 4. 95 | Before cycle 89: ready 0 blocked 5 running 3. 96 | Before cycle 90: ready 0 blocked 4 running 2. 97 | Before cycle 91: ready 0 blocked 3 running 1. 98 | Before cycle 92: running 3 blocked 2 blocked 8. 99 | Before cycle 93: running 2 blocked 1 blocked 7. 100 | Before cycle 94: running 1 ready 0 blocked 6. 101 | Before cycle 95: blocked 6 running 1 blocked 5. 102 | Before cycle 96: blocked 5 blocked 2 blocked 4. 103 | Before cycle 97: blocked 4 blocked 1 blocked 3. 104 | Before cycle 98: blocked 3 running 5 blocked 2. 105 | Before cycle 99: blocked 2 running 4 blocked 1. 106 | Before cycle 100: blocked 1 running 3 ready 0. 107 | Before cycle 101: ready 0 running 2 ready 0. 108 | Before cycle 102: running 3 terminated 0 ready 0. 109 | Before cycle 103: running 2 terminated 0 ready 0. 110 | Before cycle 104: terminated 0 terminated 0 running 3. 111 | Before cycle 105: terminated 0 terminated 0 running 2. 112 | The scheduling algorithm used was Highest Penalty Ratio Next 113 | 114 | Process 0: 115 | (A,B,C,M) = (0,5,30,2) 116 | Finishing time: 103 117 | Turnaround time: 103 118 | I/O time: 56 119 | Waiting time: 17 120 | 121 | Process 1: 122 | (A,B,C,M) = (1,5,30,2) 123 | Finishing time: 101 124 | Turnaround time: 100 125 | I/O time: 52 126 | Waiting time: 18 127 | 128 | Process 2: 129 | (A,B,C,M) = (1,5,30,2) 130 | Finishing time: 105 131 | Turnaround time: 104 132 | I/O time: 56 133 | Waiting time: 18 134 | 135 | Summary Data: 136 | Finishing time: 105 137 | CPU Utilization: 0.857143 138 | I/O Utilization: 0.876190 139 | Throughput: 2.857143 processes per hundred cycles 140 | Average turnaround time: 102.333336 141 | Average waiting time: 17.666666 142 | -------------------------------------------------------------------------------- /output_verbose/rr-output-5-detailed.txt: -------------------------------------------------------------------------------- 1 | The original input was: 3 (1 5 30 2) (1 5 30 2) (0 5 30 2) 2 | The (sorted) input is: 3 (0 5 30 2) (1 5 30 2) (1 5 30 2) 3 | 4 | This detailed printout gives the state and remaining burst for each process 5 | 6 | Before cycle 0: unstarted 0 unstarted 0 unstarted 0. 7 | Before cycle 1: running 2 unstarted 0 unstarted 0. 8 | Before cycle 2: running 1 ready 0 ready 0. 9 | Before cycle 3: ready 0 running 2 ready 0. 10 | Before cycle 4: ready 0 running 1 ready 0. 11 | Before cycle 5: ready 0 blocked 4 running 2. 12 | Before cycle 6: ready 0 blocked 3 running 1. 13 | Before cycle 7: running 2 blocked 2 ready 0. 14 | Before cycle 8: running 1 blocked 1 ready 0. 15 | Before cycle 9: blocked 8 ready 0 running 1. 16 | Before cycle 10: blocked 7 running 1 blocked 6. 17 | Before cycle 11: blocked 6 blocked 2 blocked 5. 18 | Before cycle 12: blocked 5 blocked 1 blocked 4. 19 | Before cycle 13: blocked 4 running 2 blocked 3. 20 | Before cycle 14: blocked 3 running 1 blocked 2. 21 | Before cycle 15: blocked 2 running 2 blocked 1. 22 | Before cycle 16: blocked 1 running 1 ready 0. 23 | Before cycle 17: ready 0 blocked 8 running 1. 24 | Before cycle 18: running 2 blocked 7 blocked 2. 25 | Before cycle 19: running 1 blocked 6 blocked 1. 26 | Before cycle 20: blocked 4 blocked 5 running 2. 27 | Before cycle 21: blocked 3 blocked 4 running 1. 28 | Before cycle 22: blocked 2 blocked 3 running 1. 29 | Before cycle 23: blocked 1 blocked 2 blocked 6. 30 | Before cycle 24: running 2 blocked 1 blocked 5. 31 | Before cycle 25: running 1 ready 0 blocked 4. 32 | Before cycle 26: ready 0 running 2 blocked 3. 33 | Before cycle 27: ready 0 running 1 blocked 2. 34 | Before cycle 28: running 2 blocked 4 blocked 1. 35 | Before cycle 29: running 1 blocked 3 ready 0. 36 | Before cycle 30: ready 0 blocked 2 running 2. 37 | Before cycle 31: ready 0 blocked 1 running 1. 38 | Before cycle 32: running 1 ready 0 ready 0. 39 | Before cycle 33: blocked 10 running 2 ready 0. 40 | Before cycle 34: blocked 9 running 1 ready 0. 41 | Before cycle 35: blocked 8 ready 0 running 1. 42 | Before cycle 36: blocked 7 running 1 blocked 6. 43 | Before cycle 37: blocked 6 blocked 6 blocked 5. 44 | Before cycle 38: blocked 5 blocked 5 blocked 4. 45 | Before cycle 39: blocked 4 blocked 4 blocked 3. 46 | Before cycle 40: blocked 3 blocked 3 blocked 2. 47 | Before cycle 41: blocked 2 blocked 2 blocked 1. 48 | Before cycle 42: blocked 1 blocked 1 running 1. 49 | Before cycle 43: running 2 ready 0 blocked 2. 50 | Before cycle 44: running 1 ready 0 blocked 1. 51 | Before cycle 45: ready 0 running 2 ready 0. 52 | Before cycle 46: ready 0 running 1 ready 0. 53 | Before cycle 47: running 2 ready 0 ready 0. 54 | Before cycle 48: running 1 ready 0 ready 0. 55 | Before cycle 49: ready 0 ready 0 running 2. 56 | Before cycle 50: ready 0 ready 0 running 1. 57 | Before cycle 51: ready 0 running 2 blocked 4. 58 | Before cycle 52: ready 0 running 1 blocked 3. 59 | Before cycle 53: running 1 blocked 8 blocked 2. 60 | Before cycle 54: blocked 10 blocked 7 blocked 1. 61 | Before cycle 55: blocked 9 blocked 6 running 1. 62 | Before cycle 56: blocked 8 blocked 5 blocked 2. 63 | Before cycle 57: blocked 7 blocked 4 blocked 1. 64 | Before cycle 58: blocked 6 blocked 3 running 2. 65 | Before cycle 59: blocked 5 blocked 2 running 1. 66 | Before cycle 60: blocked 4 blocked 1 blocked 4. 67 | Before cycle 61: blocked 3 running 2 blocked 3. 68 | Before cycle 62: blocked 2 running 1 blocked 2. 69 | Before cycle 63: blocked 1 running 1 blocked 1. 70 | Before cycle 64: running 2 blocked 6 ready 0. 71 | Before cycle 65: running 1 blocked 5 ready 0. 72 | Before cycle 66: blocked 4 blocked 4 running 2. 73 | Before cycle 67: blocked 3 blocked 3 running 1. 74 | Before cycle 68: blocked 2 blocked 2 blocked 4. 75 | Before cycle 69: blocked 1 blocked 1 blocked 3. 76 | Before cycle 70: running 2 ready 0 blocked 2. 77 | Before cycle 71: running 1 ready 0 blocked 1. 78 | Before cycle 72: ready 0 running 2 ready 0. 79 | Before cycle 73: ready 0 running 1 ready 0. 80 | Before cycle 74: running 2 ready 0 ready 0. 81 | Before cycle 75: running 1 ready 0 ready 0. 82 | Before cycle 76: blocked 8 ready 0 running 2. 83 | Before cycle 77: blocked 7 ready 0 running 1. 84 | Before cycle 78: blocked 6 running 1 ready 0. 85 | Before cycle 79: blocked 5 blocked 6 running 2. 86 | Before cycle 80: blocked 4 blocked 5 running 1. 87 | Before cycle 81: blocked 3 blocked 4 running 1. 88 | Before cycle 82: blocked 2 blocked 3 blocked 10. 89 | Before cycle 83: blocked 1 blocked 2 blocked 9. 90 | Before cycle 84: running 2 blocked 1 blocked 8. 91 | Before cycle 85: running 1 ready 0 blocked 7. 92 | Before cycle 86: ready 0 running 1 blocked 6. 93 | Before cycle 87: running 1 blocked 2 blocked 5. 94 | Before cycle 88: blocked 6 blocked 1 blocked 4. 95 | Before cycle 89: blocked 5 running 2 blocked 3. 96 | Before cycle 90: blocked 4 running 1 blocked 2. 97 | Before cycle 91: blocked 3 running 1 blocked 1. 98 | Before cycle 92: blocked 2 blocked 6 running 2. 99 | Before cycle 93: blocked 1 blocked 5 running 1. 100 | Before cycle 94: running 2 blocked 4 ready 0. 101 | Before cycle 95: running 1 blocked 3 ready 0. 102 | Before cycle 96: ready 0 blocked 2 running 2. 103 | Before cycle 97: ready 0 blocked 1 running 1. 104 | Before cycle 98: running 1 ready 0 blocked 8. 105 | Before cycle 99: blocked 6 running 1 blocked 7. 106 | Before cycle 100: blocked 5 blocked 2 blocked 6. 107 | Before cycle 101: blocked 4 blocked 1 blocked 5. 108 | Before cycle 102: blocked 3 running 2 blocked 4. 109 | Before cycle 103: blocked 2 running 1 blocked 3. 110 | Before cycle 104: blocked 1 running 2 blocked 2. 111 | Before cycle 105: running 2 terminated 0 blocked 1. 112 | Before cycle 106: running 1 terminated 0 ready 0. 113 | Before cycle 107: terminated 0 terminated 0 running 2. 114 | Before cycle 108: terminated 0 terminated 0 running 1. 115 | Before cycle 109: terminated 0 terminated 0 running 1. 116 | The scheduling algorithm used was Round Robbin 117 | 118 | Process 0: 119 | (A,B,C,M) = (0,5,30,2) 120 | Finishing time: 106 121 | Turnaround time: 106 122 | I/O time: 56 123 | Waiting time: 20 124 | 125 | Process 1: 126 | (A,B,C,M) = (1,5,30,2) 127 | Finishing time: 104 128 | Turnaround time: 103 129 | I/O time: 54 130 | Waiting time: 19 131 | 132 | Process 2: 133 | (A,B,C,M) = (1,5,30,2) 134 | Finishing time: 109 135 | Turnaround time: 108 136 | I/O time: 54 137 | Waiting time: 24 138 | 139 | Summary Data: 140 | Finishing time: 109 141 | CPU Utilization: 0.825688 142 | I/O Utilization: 0.825688 143 | Throughput: 2.752294 processes per hundred cycles 144 | Average turnaround time: 105.666664 145 | Average waiting time: 21.000000 146 | -------------------------------------------------------------------------------- /output_verbose/sjf-output-5-detailed.txt: -------------------------------------------------------------------------------- 1 | The original input was: 3 (1 5 30 2) (1 5 30 2) (0 5 30 2) 2 | The (sorted) input is: 3 (0 5 30 2) (1 5 30 2) (1 5 30 2) 3 | 4 | This detailed printout gives the state and remaining burst for each process 5 | 6 | Before cycle 0: unstarted 0 unstarted 0 unstarted 0. 7 | Before cycle 1: running 4 unstarted 0 unstarted 0. 8 | Before cycle 2: running 3 ready 0 ready 0. 9 | Before cycle 3: running 2 ready 0 ready 0. 10 | Before cycle 4: running 1 ready 0 ready 0. 11 | Before cycle 5: blocked 8 running 2 ready 0. 12 | Before cycle 6: blocked 7 running 1 ready 0. 13 | Before cycle 7: blocked 6 blocked 4 running 3. 14 | Before cycle 8: blocked 5 blocked 3 running 2. 15 | Before cycle 9: blocked 4 blocked 2 running 1. 16 | Before cycle 10: blocked 3 blocked 1 blocked 6. 17 | Before cycle 11: blocked 2 running 1 blocked 5. 18 | Before cycle 12: blocked 1 blocked 2 blocked 4. 19 | Before cycle 13: running 4 blocked 1 blocked 3. 20 | Before cycle 14: running 3 ready 0 blocked 2. 21 | Before cycle 15: running 2 ready 0 blocked 1. 22 | Before cycle 16: running 1 ready 0 ready 0. 23 | Before cycle 17: blocked 8 running 1 ready 0. 24 | Before cycle 18: blocked 7 blocked 2 running 2. 25 | Before cycle 19: blocked 6 blocked 1 running 1. 26 | Before cycle 20: blocked 5 running 3 blocked 4. 27 | Before cycle 21: blocked 4 running 2 blocked 3. 28 | Before cycle 22: blocked 3 running 1 blocked 2. 29 | Before cycle 23: blocked 2 blocked 6 blocked 1. 30 | Before cycle 24: blocked 1 blocked 5 running 5. 31 | Before cycle 25: ready 0 blocked 4 running 4. 32 | Before cycle 26: ready 0 blocked 3 running 3. 33 | Before cycle 27: ready 0 blocked 2 running 2. 34 | Before cycle 28: ready 0 blocked 1 running 1. 35 | Before cycle 29: running 2 ready 0 blocked 10. 36 | Before cycle 30: running 1 ready 0 blocked 9. 37 | Before cycle 31: blocked 4 running 3 blocked 8. 38 | Before cycle 32: blocked 3 running 2 blocked 7. 39 | Before cycle 33: blocked 2 running 1 blocked 6. 40 | Before cycle 34: blocked 1 blocked 6 blocked 5. 41 | Before cycle 35: running 3 blocked 5 blocked 4. 42 | Before cycle 36: running 2 blocked 4 blocked 3. 43 | Before cycle 37: running 1 blocked 3 blocked 2. 44 | Before cycle 38: blocked 6 blocked 2 blocked 1. 45 | Before cycle 39: blocked 5 blocked 1 running 1. 46 | Before cycle 40: blocked 4 running 5 blocked 2. 47 | Before cycle 41: blocked 3 running 4 blocked 1. 48 | Before cycle 42: blocked 2 running 3 ready 0. 49 | Before cycle 43: blocked 1 running 2 ready 0. 50 | Before cycle 44: ready 0 running 1 ready 0. 51 | Before cycle 45: running 4 blocked 10 ready 0. 52 | Before cycle 46: running 3 blocked 9 ready 0. 53 | Before cycle 47: running 2 blocked 8 ready 0. 54 | Before cycle 48: running 1 blocked 7 ready 0. 55 | Before cycle 49: blocked 8 blocked 6 running 2. 56 | Before cycle 50: blocked 7 blocked 5 running 1. 57 | Before cycle 51: blocked 6 blocked 4 blocked 4. 58 | Before cycle 52: blocked 5 blocked 3 blocked 3. 59 | Before cycle 53: blocked 4 blocked 2 blocked 2. 60 | Before cycle 54: blocked 3 blocked 1 blocked 1. 61 | Before cycle 55: blocked 2 running 1 ready 0. 62 | Before cycle 56: blocked 1 blocked 2 running 2. 63 | Before cycle 57: ready 0 blocked 1 running 1. 64 | Before cycle 58: running 3 ready 0 blocked 4. 65 | Before cycle 59: running 2 ready 0 blocked 3. 66 | Before cycle 60: running 1 ready 0 blocked 2. 67 | Before cycle 61: blocked 6 running 2 blocked 1. 68 | Before cycle 62: blocked 5 running 1 ready 0. 69 | Before cycle 63: blocked 4 blocked 4 running 2. 70 | Before cycle 64: blocked 3 blocked 3 running 1. 71 | Before cycle 65: blocked 2 blocked 2 blocked 4. 72 | Before cycle 66: blocked 1 blocked 1 blocked 3. 73 | Before cycle 67: running 4 ready 0 blocked 2. 74 | Before cycle 68: running 3 ready 0 blocked 1. 75 | Before cycle 69: running 2 ready 0 ready 0. 76 | Before cycle 70: running 1 ready 0 ready 0. 77 | Before cycle 71: blocked 8 running 3 ready 0. 78 | Before cycle 72: blocked 7 running 2 ready 0. 79 | Before cycle 73: blocked 6 running 1 ready 0. 80 | Before cycle 74: blocked 5 blocked 6 running 5. 81 | Before cycle 75: blocked 4 blocked 5 running 4. 82 | Before cycle 76: blocked 3 blocked 4 running 3. 83 | Before cycle 77: blocked 2 blocked 3 running 2. 84 | Before cycle 78: blocked 1 blocked 2 running 1. 85 | Before cycle 79: running 3 blocked 1 blocked 10. 86 | Before cycle 80: running 2 ready 0 blocked 9. 87 | Before cycle 81: running 1 ready 0 blocked 8. 88 | Before cycle 82: blocked 6 running 1 blocked 7. 89 | Before cycle 83: blocked 5 blocked 2 blocked 6. 90 | Before cycle 84: blocked 4 blocked 1 blocked 5. 91 | Before cycle 85: blocked 3 running 3 blocked 4. 92 | Before cycle 86: blocked 2 running 2 blocked 3. 93 | Before cycle 87: blocked 1 running 1 blocked 2. 94 | Before cycle 88: running 4 blocked 6 blocked 1. 95 | Before cycle 89: running 3 blocked 5 ready 0. 96 | Before cycle 90: running 2 blocked 4 ready 0. 97 | Before cycle 91: terminated 0 blocked 3 running 3. 98 | Before cycle 92: terminated 0 blocked 2 running 2. 99 | Before cycle 93: terminated 0 blocked 1 running 1. 100 | Before cycle 94: terminated 0 running 1 blocked 6. 101 | Before cycle 95: terminated 0 blocked 2 blocked 5. 102 | Before cycle 96: terminated 0 blocked 1 blocked 4. 103 | Before cycle 97: terminated 0 running 5 blocked 3. 104 | Before cycle 98: terminated 0 running 4 blocked 2. 105 | Before cycle 99: terminated 0 running 3 blocked 1. 106 | Before cycle 100: terminated 0 running 2 ready 0. 107 | Before cycle 101: terminated 0 terminated 0 running 3. 108 | Before cycle 102: terminated 0 terminated 0 running 2. 109 | Before cycle 103: terminated 0 terminated 0 running 1. 110 | Before cycle 104: terminated 0 terminated 0 blocked 6. 111 | Before cycle 105: terminated 0 terminated 0 blocked 5. 112 | Before cycle 106: terminated 0 terminated 0 blocked 4. 113 | Before cycle 107: terminated 0 terminated 0 blocked 3. 114 | Before cycle 108: terminated 0 terminated 0 blocked 2. 115 | Before cycle 109: terminated 0 terminated 0 blocked 1. 116 | Before cycle 110: terminated 0 terminated 0 running 3. 117 | Before cycle 111: terminated 0 terminated 0 running 2. 118 | The scheduling algorithm used was Shortest Job First 119 | 120 | Process 0: 121 | (A,B,C,M) = (0,5,30,2) 122 | Finishing time: 90 123 | Turnaround time: 90 124 | I/O time: 54 125 | Waiting time: 6 126 | 127 | Process 1: 128 | (A,B,C,M) = (1,5,30,2) 129 | Finishing time: 100 130 | Turnaround time: 99 131 | I/O time: 52 132 | Waiting time: 17 133 | 134 | Process 2: 135 | (A,B,C,M) = (1,5,30,2) 136 | Finishing time: 111 137 | Turnaround time: 110 138 | I/O time: 56 139 | Waiting time: 24 140 | 141 | Summary Data: 142 | Finishing time: 111 143 | CPU Utilization: 0.810811 144 | I/O Utilization: 0.873874 145 | Throughput: 2.702703 processes per hundred cycles 146 | Average turnaround time: 99.666664 147 | Average waiting time: 15.666667 148 | -------------------------------------------------------------------------------- /output_show-random/fcfs-output-5-show-random.txt: -------------------------------------------------------------------------------- 1 | The original input was: 3 (1 5 30 2) (1 5 30 2) (0 5 30 2) 2 | The (sorted) input is: 3 (0 5 30 2) (1 5 30 2) (1 5 30 2) 3 | 4 | This detailed printout gives the state and remaining burst for each process 5 | 6 | Before cycle 0: unstarted 0 unstarted 0 unstarted 0. 7 | Find burst when choosing ready process to run 1804289383 8 | Before cycle 1: running 4 unstarted 0 unstarted 0. 9 | Before cycle 2: running 3 ready 0 ready 0. 10 | Before cycle 3: running 2 ready 0 ready 0. 11 | Before cycle 4: running 1 ready 0 ready 0. 12 | Find burst when choosing ready process to run 846930886 13 | Before cycle 5: blocked 8 running 2 ready 0. 14 | Before cycle 6: blocked 7 running 1 ready 0. 15 | Find burst when choosing ready process to run 1681692777 16 | Before cycle 7: blocked 6 blocked 4 running 3. 17 | Before cycle 8: blocked 5 blocked 3 running 2. 18 | Before cycle 9: blocked 4 blocked 2 running 1. 19 | Before cycle 10: blocked 3 blocked 1 blocked 6. 20 | Find burst when choosing ready process to run 1714636915 21 | Before cycle 11: blocked 2 running 1 blocked 5. 22 | Before cycle 12: blocked 1 blocked 2 blocked 4. 23 | Find burst when choosing ready process to run 1957747793 24 | Before cycle 13: running 4 blocked 1 blocked 3. 25 | Before cycle 14: running 3 ready 0 blocked 2. 26 | Before cycle 15: running 2 ready 0 blocked 1. 27 | Before cycle 16: running 1 ready 0 ready 0. 28 | Find burst when choosing ready process to run 424238335 29 | Before cycle 17: blocked 8 running 1 ready 0. 30 | Find burst when choosing ready process to run 719885386 31 | Before cycle 18: blocked 7 blocked 2 running 2. 32 | Before cycle 19: blocked 6 blocked 1 running 1. 33 | Find burst when choosing ready process to run 1649760492 34 | Before cycle 20: blocked 5 running 3 blocked 4. 35 | Before cycle 21: blocked 4 running 2 blocked 3. 36 | Before cycle 22: blocked 3 running 1 blocked 2. 37 | Before cycle 23: blocked 2 blocked 6 blocked 1. 38 | Find burst when choosing ready process to run 596516649 39 | Before cycle 24: blocked 1 blocked 5 running 5. 40 | Before cycle 25: ready 0 blocked 4 running 4. 41 | Before cycle 26: ready 0 blocked 3 running 3. 42 | Before cycle 27: ready 0 blocked 2 running 2. 43 | Before cycle 28: ready 0 blocked 1 running 1. 44 | Find burst when choosing ready process to run 1189641421 45 | Before cycle 29: running 2 ready 0 blocked 10. 46 | Before cycle 30: running 1 ready 0 blocked 9. 47 | Find burst when choosing ready process to run 1025202362 48 | Before cycle 31: blocked 4 running 3 blocked 8. 49 | Before cycle 32: blocked 3 running 2 blocked 7. 50 | Before cycle 33: blocked 2 running 1 blocked 6. 51 | Before cycle 34: blocked 1 blocked 6 blocked 5. 52 | Find burst when choosing ready process to run 1350490027 53 | Before cycle 35: running 3 blocked 5 blocked 4. 54 | Before cycle 36: running 2 blocked 4 blocked 3. 55 | Before cycle 37: running 1 blocked 3 blocked 2. 56 | Before cycle 38: blocked 6 blocked 2 blocked 1. 57 | Find burst when choosing ready process to run 783368690 58 | Before cycle 39: blocked 5 blocked 1 running 1. 59 | Find burst when choosing ready process to run 1102520059 60 | Before cycle 40: blocked 4 running 5 blocked 2. 61 | Before cycle 41: blocked 3 running 4 blocked 1. 62 | Before cycle 42: blocked 2 running 3 ready 0. 63 | Before cycle 43: blocked 1 running 2 ready 0. 64 | Before cycle 44: ready 0 running 1 ready 0. 65 | Find burst when choosing ready process to run 2044897763 66 | Before cycle 45: ready 0 blocked 10 running 4. 67 | Before cycle 46: ready 0 blocked 9 running 3. 68 | Before cycle 47: ready 0 blocked 8 running 2. 69 | Before cycle 48: ready 0 blocked 7 running 1. 70 | Find burst when choosing ready process to run 1967513926 71 | Before cycle 49: running 2 blocked 6 blocked 8. 72 | Before cycle 50: running 1 blocked 5 blocked 7. 73 | Before cycle 51: blocked 4 blocked 4 blocked 6. 74 | Before cycle 52: blocked 3 blocked 3 blocked 5. 75 | Before cycle 53: blocked 2 blocked 2 blocked 4. 76 | Before cycle 54: blocked 1 blocked 1 blocked 3. 77 | Find burst when choosing ready process to run 1365180540 78 | Before cycle 55: running 1 ready 0 blocked 2. 79 | Find burst when choosing ready process to run 1540383426 80 | Before cycle 56: blocked 2 running 2 blocked 1. 81 | Before cycle 57: blocked 1 running 1 ready 0. 82 | Find burst when choosing ready process to run 304089172 83 | Before cycle 58: ready 0 blocked 4 running 3. 84 | Before cycle 59: ready 0 blocked 3 running 2. 85 | Before cycle 60: ready 0 blocked 2 running 1. 86 | Find burst when choosing ready process to run 1303455736 87 | Before cycle 61: running 2 blocked 1 blocked 6. 88 | Before cycle 62: running 1 ready 0 blocked 5. 89 | Find burst when choosing ready process to run 35005211 90 | Before cycle 63: blocked 4 running 2 blocked 4. 91 | Before cycle 64: blocked 3 running 1 blocked 3. 92 | Before cycle 65: blocked 2 blocked 4 blocked 2. 93 | Before cycle 66: blocked 1 blocked 3 blocked 1. 94 | Find burst when choosing ready process to run 521595368 95 | Before cycle 67: running 4 blocked 2 ready 0. 96 | Before cycle 68: running 3 blocked 1 ready 0. 97 | Before cycle 69: running 2 ready 0 ready 0. 98 | Before cycle 70: running 1 ready 0 ready 0. 99 | Find burst when choosing ready process to run 294702567 100 | Before cycle 71: blocked 8 ready 0 running 3. 101 | Before cycle 72: blocked 7 ready 0 running 2. 102 | Before cycle 73: blocked 6 ready 0 running 1. 103 | Find burst when choosing ready process to run 1726956429 104 | Before cycle 74: blocked 5 running 5 blocked 6. 105 | Before cycle 75: blocked 4 running 4 blocked 5. 106 | Before cycle 76: blocked 3 running 3 blocked 4. 107 | Before cycle 77: blocked 2 running 2 blocked 3. 108 | Before cycle 78: blocked 1 running 1 blocked 2. 109 | Find burst when choosing ready process to run 336465782 110 | Before cycle 79: running 3 blocked 10 blocked 1. 111 | Before cycle 80: running 2 blocked 9 ready 0. 112 | Before cycle 81: running 1 blocked 8 ready 0. 113 | Find burst when choosing ready process to run 861021530 114 | Before cycle 82: blocked 6 blocked 7 running 1. 115 | Before cycle 83: blocked 5 blocked 6 blocked 2. 116 | Before cycle 84: blocked 4 blocked 5 blocked 1. 117 | Find burst when choosing ready process to run 278722862 118 | Before cycle 85: blocked 3 blocked 4 running 3. 119 | Before cycle 86: blocked 2 blocked 3 running 2. 120 | Before cycle 87: blocked 1 blocked 2 running 1. 121 | Find burst when choosing ready process to run 233665123 122 | Before cycle 88: running 4 blocked 1 blocked 6. 123 | Before cycle 89: running 3 ready 0 blocked 5. 124 | Before cycle 90: running 2 ready 0 blocked 4. 125 | Before cycle 91: running 1 ready 0 blocked 3. 126 | Find burst when choosing ready process to run 2145174067 127 | Before cycle 92: blocked 8 running 3 blocked 2. 128 | Before cycle 93: blocked 7 running 2 blocked 1. 129 | Before cycle 94: blocked 6 running 1 ready 0. 130 | Find burst when choosing ready process to run 468703135 131 | Before cycle 95: blocked 5 blocked 6 running 1. 132 | Before cycle 96: blocked 4 blocked 5 blocked 2. 133 | Before cycle 97: blocked 3 blocked 4 blocked 1. 134 | Find burst when choosing ready process to run 1101513929 135 | Before cycle 98: blocked 2 blocked 3 running 5. 136 | Before cycle 99: blocked 1 blocked 2 running 4. 137 | Before cycle 100: ready 0 blocked 1 running 3. 138 | Before cycle 101: ready 0 ready 0 running 2. 139 | Find burst when choosing ready process to run 1801979802 140 | Before cycle 102: running 3 ready 0 terminated 0. 141 | Find burst when choosing ready process to run 1315634022 142 | Before cycle 103: terminated 0 running 3 terminated 0. 143 | Before cycle 104: terminated 0 running 2 terminated 0. 144 | Before cycle 105: terminated 0 running 1 terminated 0. 145 | The scheduling algorithm used was First Come First Served 146 | 147 | Process 0: 148 | (A,B,C,M) = (0,5,30,2) 149 | Finishing time: 102 150 | Turnaround time: 102 151 | I/O time: 58 152 | Waiting time: 14 153 | 154 | Process 1: 155 | (A,B,C,M) = (1,5,30,2) 156 | Finishing time: 105 157 | Turnaround time: 104 158 | I/O time: 54 159 | Waiting time: 20 160 | 161 | Process 2: 162 | (A,B,C,M) = (1,5,30,2) 163 | Finishing time: 101 164 | Turnaround time: 100 165 | I/O time: 52 166 | Waiting time: 18 167 | 168 | Summary Data: 169 | Finishing time: 105 170 | CPU Utilization: 0.857143 171 | I/O Utilization: 0.876190 172 | Throughput: 2.857143 processes per hundred cycles 173 | Average turnaround time: 102.000000 174 | Average waiting time: 17.333334 175 | -------------------------------------------------------------------------------- /output_show-random/hprn-output-5-show-random.txt: -------------------------------------------------------------------------------- 1 | The original input was: 3 (1 5 30 2) (1 5 30 2) (0 5 30 2) 2 | The (sorted) input is: 3 (0 5 30 2) (1 5 30 2) (1 5 30 2) 3 | 4 | This detailed printout gives the state and remaining burst for each process 5 | 6 | Before cycle 0: unstarted 0 unstarted 0 unstarted 0. 7 | Find burst when choosing ready process to run 1804289383 8 | Before cycle 1: running 4 unstarted 0 unstarted 0. 9 | Before cycle 2: running 3 ready 0 ready 0. 10 | Before cycle 3: running 2 ready 0 ready 0. 11 | Before cycle 4: running 1 ready 0 ready 0. 12 | Find burst when choosing ready process to run 846930886 13 | Before cycle 5: blocked 8 running 2 ready 0. 14 | Before cycle 6: blocked 7 running 1 ready 0. 15 | Find burst when choosing ready process to run 1681692777 16 | Before cycle 7: blocked 6 blocked 4 running 3. 17 | Before cycle 8: blocked 5 blocked 3 running 2. 18 | Before cycle 9: blocked 4 blocked 2 running 1. 19 | Before cycle 10: blocked 3 blocked 1 blocked 6. 20 | Find burst when choosing ready process to run 1714636915 21 | Before cycle 11: blocked 2 running 1 blocked 5. 22 | Before cycle 12: blocked 1 blocked 2 blocked 4. 23 | Find burst when choosing ready process to run 1957747793 24 | Before cycle 13: running 4 blocked 1 blocked 3. 25 | Before cycle 14: running 3 ready 0 blocked 2. 26 | Before cycle 15: running 2 ready 0 blocked 1. 27 | Before cycle 16: running 1 ready 0 ready 0. 28 | Find burst when choosing ready process to run 424238335 29 | Before cycle 17: blocked 8 running 1 ready 0. 30 | Find burst when choosing ready process to run 719885386 31 | Before cycle 18: blocked 7 blocked 2 running 2. 32 | Before cycle 19: blocked 6 blocked 1 running 1. 33 | Find burst when choosing ready process to run 1649760492 34 | Before cycle 20: blocked 5 running 3 blocked 4. 35 | Before cycle 21: blocked 4 running 2 blocked 3. 36 | Before cycle 22: blocked 3 running 1 blocked 2. 37 | Before cycle 23: blocked 2 blocked 6 blocked 1. 38 | Find burst when choosing ready process to run 596516649 39 | Before cycle 24: blocked 1 blocked 5 running 5. 40 | Before cycle 25: ready 0 blocked 4 running 4. 41 | Before cycle 26: ready 0 blocked 3 running 3. 42 | Before cycle 27: ready 0 blocked 2 running 2. 43 | Before cycle 28: ready 0 blocked 1 running 1. 44 | Find burst when choosing ready process to run 1189641421 45 | Before cycle 29: ready 0 running 2 blocked 10. 46 | Before cycle 30: ready 0 running 1 blocked 9. 47 | Find burst when choosing ready process to run 1025202362 48 | Before cycle 31: running 3 blocked 4 blocked 8. 49 | Before cycle 32: running 2 blocked 3 blocked 7. 50 | Before cycle 33: running 1 blocked 2 blocked 6. 51 | Before cycle 34: blocked 6 blocked 1 blocked 5. 52 | Find burst when choosing ready process to run 1350490027 53 | Before cycle 35: blocked 5 running 3 blocked 4. 54 | Before cycle 36: blocked 4 running 2 blocked 3. 55 | Before cycle 37: blocked 3 running 1 blocked 2. 56 | Before cycle 38: blocked 2 blocked 6 blocked 1. 57 | Find burst when choosing ready process to run 783368690 58 | Before cycle 39: blocked 1 blocked 5 running 1. 59 | Find burst when choosing ready process to run 1102520059 60 | Before cycle 40: running 5 blocked 4 blocked 2. 61 | Before cycle 41: running 4 blocked 3 blocked 1. 62 | Before cycle 42: running 3 blocked 2 ready 0. 63 | Before cycle 43: running 2 blocked 1 ready 0. 64 | Before cycle 44: running 1 ready 0 ready 0. 65 | Find burst when choosing ready process to run 2044897763 66 | Before cycle 45: blocked 10 ready 0 running 4. 67 | Before cycle 46: blocked 9 ready 0 running 3. 68 | Before cycle 47: blocked 8 ready 0 running 2. 69 | Before cycle 48: blocked 7 ready 0 running 1. 70 | Find burst when choosing ready process to run 1967513926 71 | Before cycle 49: blocked 6 running 2 blocked 8. 72 | Before cycle 50: blocked 5 running 1 blocked 7. 73 | Before cycle 51: blocked 4 blocked 4 blocked 6. 74 | Before cycle 52: blocked 3 blocked 3 blocked 5. 75 | Before cycle 53: blocked 2 blocked 2 blocked 4. 76 | Before cycle 54: blocked 1 blocked 1 blocked 3. 77 | Find burst when choosing ready process to run 1365180540 78 | Before cycle 55: ready 0 running 1 blocked 2. 79 | Find burst when choosing ready process to run 1540383426 80 | Before cycle 56: running 2 blocked 2 blocked 1. 81 | Before cycle 57: running 1 blocked 1 ready 0. 82 | Find burst when choosing ready process to run 304089172 83 | Before cycle 58: blocked 4 running 3 ready 0. 84 | Before cycle 59: blocked 3 running 2 ready 0. 85 | Before cycle 60: blocked 2 running 1 ready 0. 86 | Find burst when choosing ready process to run 1303455736 87 | Before cycle 61: blocked 1 blocked 6 running 2. 88 | Before cycle 62: ready 0 blocked 5 running 1. 89 | Find burst when choosing ready process to run 35005211 90 | Before cycle 63: running 2 blocked 4 blocked 4. 91 | Before cycle 64: running 1 blocked 3 blocked 3. 92 | Before cycle 65: blocked 4 blocked 2 blocked 2. 93 | Before cycle 66: blocked 3 blocked 1 blocked 1. 94 | Find burst when choosing ready process to run 521595368 95 | Before cycle 67: blocked 2 ready 0 running 4. 96 | Before cycle 68: blocked 1 ready 0 running 3. 97 | Before cycle 69: ready 0 ready 0 running 2. 98 | Before cycle 70: ready 0 ready 0 running 1. 99 | Find burst when choosing ready process to run 294702567 100 | Before cycle 71: ready 0 running 3 blocked 8. 101 | Before cycle 72: ready 0 running 2 blocked 7. 102 | Before cycle 73: ready 0 running 1 blocked 6. 103 | Find burst when choosing ready process to run 1726956429 104 | Before cycle 74: running 5 blocked 6 blocked 5. 105 | Before cycle 75: running 4 blocked 5 blocked 4. 106 | Before cycle 76: running 3 blocked 4 blocked 3. 107 | Before cycle 77: running 2 blocked 3 blocked 2. 108 | Before cycle 78: running 1 blocked 2 blocked 1. 109 | Find burst when choosing ready process to run 336465782 110 | Before cycle 79: blocked 10 blocked 1 running 3. 111 | Before cycle 80: blocked 9 ready 0 running 2. 112 | Before cycle 81: blocked 8 ready 0 running 1. 113 | Find burst when choosing ready process to run 861021530 114 | Before cycle 82: blocked 7 running 1 blocked 6. 115 | Before cycle 83: blocked 6 blocked 2 blocked 5. 116 | Before cycle 84: blocked 5 blocked 1 blocked 4. 117 | Find burst when choosing ready process to run 278722862 118 | Before cycle 85: blocked 4 running 3 blocked 3. 119 | Before cycle 86: blocked 3 running 2 blocked 2. 120 | Before cycle 87: blocked 2 running 1 blocked 1. 121 | Find burst when choosing ready process to run 233665123 122 | Before cycle 88: blocked 1 blocked 6 running 4. 123 | Before cycle 89: ready 0 blocked 5 running 3. 124 | Before cycle 90: ready 0 blocked 4 running 2. 125 | Before cycle 91: ready 0 blocked 3 running 1. 126 | Find burst when choosing ready process to run 2145174067 127 | Before cycle 92: running 3 blocked 2 blocked 8. 128 | Before cycle 93: running 2 blocked 1 blocked 7. 129 | Before cycle 94: running 1 ready 0 blocked 6. 130 | Find burst when choosing ready process to run 468703135 131 | Before cycle 95: blocked 6 running 1 blocked 5. 132 | Before cycle 96: blocked 5 blocked 2 blocked 4. 133 | Before cycle 97: blocked 4 blocked 1 blocked 3. 134 | Find burst when choosing ready process to run 1101513929 135 | Before cycle 98: blocked 3 running 5 blocked 2. 136 | Before cycle 99: blocked 2 running 4 blocked 1. 137 | Before cycle 100: blocked 1 running 3 ready 0. 138 | Before cycle 101: ready 0 running 2 ready 0. 139 | Find burst when choosing ready process to run 1801979802 140 | Before cycle 102: running 3 terminated 0 ready 0. 141 | Before cycle 103: running 2 terminated 0 ready 0. 142 | Find burst when choosing ready process to run 1315634022 143 | Before cycle 104: terminated 0 terminated 0 running 3. 144 | Before cycle 105: terminated 0 terminated 0 running 2. 145 | The scheduling algorithm used was Highest Penalty Ratio Next 146 | 147 | Process 0: 148 | (A,B,C,M) = (0,5,30,2) 149 | Finishing time: 103 150 | Turnaround time: 103 151 | I/O time: 56 152 | Waiting time: 17 153 | 154 | Process 1: 155 | (A,B,C,M) = (1,5,30,2) 156 | Finishing time: 101 157 | Turnaround time: 100 158 | I/O time: 52 159 | Waiting time: 18 160 | 161 | Process 2: 162 | (A,B,C,M) = (1,5,30,2) 163 | Finishing time: 105 164 | Turnaround time: 104 165 | I/O time: 56 166 | Waiting time: 18 167 | 168 | Summary Data: 169 | Finishing time: 105 170 | CPU Utilization: 0.857143 171 | I/O Utilization: 0.876190 172 | Throughput: 2.857143 processes per hundred cycles 173 | Average turnaround time: 102.333336 174 | Average waiting time: 17.666666 175 | -------------------------------------------------------------------------------- /output_show-random/rr-output-5-show-random.txt: -------------------------------------------------------------------------------- 1 | The original input was: 3 (1 5 30 2) (1 5 30 2) (0 5 30 2) 2 | The (sorted) input is: 3 (0 5 30 2) (1 5 30 2) (1 5 30 2) 3 | 4 | This detailed printout gives the state and remaining burst for each process 5 | 6 | Before cycle 0: unstarted 0 unstarted 0 unstarted 0. 7 | Find burst when choosing ready process to run 1804289383 8 | Before cycle 1: running 2 unstarted 0 unstarted 0. 9 | Before cycle 2: running 1 ready 0 ready 0. 10 | Find burst when choosing ready process to run 846930886 11 | Before cycle 3: ready 0 running 2 ready 0. 12 | Before cycle 4: ready 0 running 1 ready 0. 13 | Find burst when choosing ready process to run 1681692777 14 | Before cycle 5: ready 0 blocked 4 running 2. 15 | Before cycle 6: ready 0 blocked 3 running 1. 16 | Before cycle 7: running 2 blocked 2 ready 0. 17 | Before cycle 8: running 1 blocked 1 ready 0. 18 | Before cycle 9: blocked 8 ready 0 running 1. 19 | Find burst when choosing ready process to run 1714636915 20 | Before cycle 10: blocked 7 running 1 blocked 6. 21 | Before cycle 11: blocked 6 blocked 2 blocked 5. 22 | Before cycle 12: blocked 5 blocked 1 blocked 4. 23 | Find burst when choosing ready process to run 1957747793 24 | Before cycle 13: blocked 4 running 2 blocked 3. 25 | Before cycle 14: blocked 3 running 1 blocked 2. 26 | Before cycle 15: blocked 2 running 2 blocked 1. 27 | Before cycle 16: blocked 1 running 1 ready 0. 28 | Find burst when choosing ready process to run 424238335 29 | Before cycle 17: ready 0 blocked 8 running 1. 30 | Find burst when choosing ready process to run 719885386 31 | Before cycle 18: running 2 blocked 7 blocked 2. 32 | Before cycle 19: running 1 blocked 6 blocked 1. 33 | Find burst when choosing ready process to run 1649760492 34 | Before cycle 20: blocked 4 blocked 5 running 2. 35 | Before cycle 21: blocked 3 blocked 4 running 1. 36 | Before cycle 22: blocked 2 blocked 3 running 1. 37 | Before cycle 23: blocked 1 blocked 2 blocked 6. 38 | Find burst when choosing ready process to run 596516649 39 | Before cycle 24: running 2 blocked 1 blocked 5. 40 | Before cycle 25: running 1 ready 0 blocked 4. 41 | Find burst when choosing ready process to run 1189641421 42 | Before cycle 26: ready 0 running 2 blocked 3. 43 | Before cycle 27: ready 0 running 1 blocked 2. 44 | Before cycle 28: running 2 blocked 4 blocked 1. 45 | Before cycle 29: running 1 blocked 3 ready 0. 46 | Find burst when choosing ready process to run 1025202362 47 | Before cycle 30: ready 0 blocked 2 running 2. 48 | Before cycle 31: ready 0 blocked 1 running 1. 49 | Before cycle 32: running 1 ready 0 ready 0. 50 | Find burst when choosing ready process to run 1350490027 51 | Before cycle 33: blocked 10 running 2 ready 0. 52 | Before cycle 34: blocked 9 running 1 ready 0. 53 | Before cycle 35: blocked 8 ready 0 running 1. 54 | Before cycle 36: blocked 7 running 1 blocked 6. 55 | Before cycle 37: blocked 6 blocked 6 blocked 5. 56 | Before cycle 38: blocked 5 blocked 5 blocked 4. 57 | Before cycle 39: blocked 4 blocked 4 blocked 3. 58 | Before cycle 40: blocked 3 blocked 3 blocked 2. 59 | Before cycle 41: blocked 2 blocked 2 blocked 1. 60 | Find burst when choosing ready process to run 783368690 61 | Before cycle 42: blocked 1 blocked 1 running 1. 62 | Find burst when choosing ready process to run 1102520059 63 | Before cycle 43: running 2 ready 0 blocked 2. 64 | Before cycle 44: running 1 ready 0 blocked 1. 65 | Find burst when choosing ready process to run 2044897763 66 | Before cycle 45: ready 0 running 2 ready 0. 67 | Before cycle 46: ready 0 running 1 ready 0. 68 | Before cycle 47: running 2 ready 0 ready 0. 69 | Before cycle 48: running 1 ready 0 ready 0. 70 | Find burst when choosing ready process to run 1967513926 71 | Before cycle 49: ready 0 ready 0 running 2. 72 | Before cycle 50: ready 0 ready 0 running 1. 73 | Before cycle 51: ready 0 running 2 blocked 4. 74 | Before cycle 52: ready 0 running 1 blocked 3. 75 | Before cycle 53: running 1 blocked 8 blocked 2. 76 | Before cycle 54: blocked 10 blocked 7 blocked 1. 77 | Find burst when choosing ready process to run 1365180540 78 | Before cycle 55: blocked 9 blocked 6 running 1. 79 | Before cycle 56: blocked 8 blocked 5 blocked 2. 80 | Before cycle 57: blocked 7 blocked 4 blocked 1. 81 | Find burst when choosing ready process to run 1540383426 82 | Before cycle 58: blocked 6 blocked 3 running 2. 83 | Before cycle 59: blocked 5 blocked 2 running 1. 84 | Before cycle 60: blocked 4 blocked 1 blocked 4. 85 | Find burst when choosing ready process to run 304089172 86 | Before cycle 61: blocked 3 running 2 blocked 3. 87 | Before cycle 62: blocked 2 running 1 blocked 2. 88 | Before cycle 63: blocked 1 running 1 blocked 1. 89 | Find burst when choosing ready process to run 1303455736 90 | Before cycle 64: running 2 blocked 6 ready 0. 91 | Before cycle 65: running 1 blocked 5 ready 0. 92 | Find burst when choosing ready process to run 35005211 93 | Before cycle 66: blocked 4 blocked 4 running 2. 94 | Before cycle 67: blocked 3 blocked 3 running 1. 95 | Before cycle 68: blocked 2 blocked 2 blocked 4. 96 | Before cycle 69: blocked 1 blocked 1 blocked 3. 97 | Find burst when choosing ready process to run 521595368 98 | Before cycle 70: running 2 ready 0 blocked 2. 99 | Before cycle 71: running 1 ready 0 blocked 1. 100 | Find burst when choosing ready process to run 294702567 101 | Before cycle 72: ready 0 running 2 ready 0. 102 | Before cycle 73: ready 0 running 1 ready 0. 103 | Before cycle 74: running 2 ready 0 ready 0. 104 | Before cycle 75: running 1 ready 0 ready 0. 105 | Find burst when choosing ready process to run 1726956429 106 | Before cycle 76: blocked 8 ready 0 running 2. 107 | Before cycle 77: blocked 7 ready 0 running 1. 108 | Before cycle 78: blocked 6 running 1 ready 0. 109 | Before cycle 79: blocked 5 blocked 6 running 2. 110 | Before cycle 80: blocked 4 blocked 5 running 1. 111 | Before cycle 81: blocked 3 blocked 4 running 1. 112 | Before cycle 82: blocked 2 blocked 3 blocked 10. 113 | Before cycle 83: blocked 1 blocked 2 blocked 9. 114 | Find burst when choosing ready process to run 336465782 115 | Before cycle 84: running 2 blocked 1 blocked 8. 116 | Before cycle 85: running 1 ready 0 blocked 7. 117 | Find burst when choosing ready process to run 861021530 118 | Before cycle 86: ready 0 running 1 blocked 6. 119 | Before cycle 87: running 1 blocked 2 blocked 5. 120 | Before cycle 88: blocked 6 blocked 1 blocked 4. 121 | Find burst when choosing ready process to run 278722862 122 | Before cycle 89: blocked 5 running 2 blocked 3. 123 | Before cycle 90: blocked 4 running 1 blocked 2. 124 | Before cycle 91: blocked 3 running 1 blocked 1. 125 | Find burst when choosing ready process to run 233665123 126 | Before cycle 92: blocked 2 blocked 6 running 2. 127 | Before cycle 93: blocked 1 blocked 5 running 1. 128 | Find burst when choosing ready process to run 2145174067 129 | Before cycle 94: running 2 blocked 4 ready 0. 130 | Before cycle 95: running 1 blocked 3 ready 0. 131 | Before cycle 96: ready 0 blocked 2 running 2. 132 | Before cycle 97: ready 0 blocked 1 running 1. 133 | Before cycle 98: running 1 ready 0 blocked 8. 134 | Find burst when choosing ready process to run 468703135 135 | Before cycle 99: blocked 6 running 1 blocked 7. 136 | Before cycle 100: blocked 5 blocked 2 blocked 6. 137 | Before cycle 101: blocked 4 blocked 1 blocked 5. 138 | Find burst when choosing ready process to run 1101513929 139 | Before cycle 102: blocked 3 running 2 blocked 4. 140 | Before cycle 103: blocked 2 running 1 blocked 3. 141 | Before cycle 104: blocked 1 running 2 blocked 2. 142 | Find burst when choosing ready process to run 1801979802 143 | Before cycle 105: running 2 terminated 0 blocked 1. 144 | Before cycle 106: running 1 terminated 0 ready 0. 145 | Find burst when choosing ready process to run 1315634022 146 | Before cycle 107: terminated 0 terminated 0 running 2. 147 | Before cycle 108: terminated 0 terminated 0 running 1. 148 | Before cycle 109: terminated 0 terminated 0 running 1. 149 | The scheduling algorithm used was Round Robbin 150 | 151 | Process 0: 152 | (A,B,C,M) = (0,5,30,2) 153 | Finishing time: 106 154 | Turnaround time: 106 155 | I/O time: 56 156 | Waiting time: 20 157 | 158 | Process 1: 159 | (A,B,C,M) = (1,5,30,2) 160 | Finishing time: 104 161 | Turnaround time: 103 162 | I/O time: 54 163 | Waiting time: 19 164 | 165 | Process 2: 166 | (A,B,C,M) = (1,5,30,2) 167 | Finishing time: 109 168 | Turnaround time: 108 169 | I/O time: 54 170 | Waiting time: 24 171 | 172 | Summary Data: 173 | Finishing time: 109 174 | CPU Utilization: 0.825688 175 | I/O Utilization: 0.825688 176 | Throughput: 2.752294 processes per hundred cycles 177 | Average turnaround time: 105.666664 178 | Average waiting time: 21.000000 179 | --------------------------------------------------------------------------------