This code implements the Shortest Job First (SJF) scheduling algorithm for a set of processes. The user has the option to either provide their own set of processes or generate a random set of processes.
The code calculates various metrics such as waiting time, turnaround time, CPU utilization, throughput, and average response time. The results are printed to the console at the end of the program.
To use the code, the user can run the program and choose between generating a random set of processes or providing their own set. If the user chooses to generate a random set, they will need to enter the number of processes they want to generate. If the user chooses to provide their own set, they will need to enter the arrival time and burst time for each process.
The results of the program are printed to the console, including the table of processes with their respective metrics, as well as the CPU utilization, throughput, and average response time.
Dependencies:
- random
- Python 3.x
To run the program, simply execute the code in a Python environment.