https://github.com/Chau-Nguyen-Developer/cpu-scheduling-simulator
This program stimulates the following CPU scheduling algorirthms:
- First Come First Serve (FCFS) (done)
- Shortest Job First (SJF) (under construction)
- Preemptive Priority Scheduling (under construction)
- Round Robin (RR) (under construction)
The task information will be read from an input file witht the following format
Pid Arrival_Time Burst_Time Priority
All fields are integer type.
Unit for time: milliseconds
Pid is a unique numberic process ID
Arrival_Time is the time when the task arrives
Burst_Time is the CPU time requested by a task
Priority is the priority associated with each task. Low numbers = High priority.
Note: For RR algorithm, user can modify their chosen Time-Quantum number.
Example
A simple user interface (a prompt in command line) will pop up to ask you for your input (.txt) file, your chosen CPU Scheduling Algorithm, and Time Quantum (if Round Robin is chosen.)
Print progress of task every unit time (millisecond). Once all tasks are completed, the program should compute and print:
- Average waiting time
- Average response time
- Average turn-around time
- CPU Utilization Rate
FCFS Algorithm is ready to be used. The rest are under construction. Please stay tuned.
You can either fork or clone this GitHub repo (instruction), or simply download the JAR file and run it to use the program.
This is the command to run .jar file at your command line after you download it:
java -jar CPU_Simulator.jar
[✔] Read from file
[✔] Populate info to each process instances
[✔]Sort pocesses based on their arrive time.
[✔]Create the scheme who go first and who go next
[✔]Wait time of a process = its start time - its arrival time
[✔]Response time = wait time
[✔]Process time = Burst time
[✔]Prompt
