This Streamlit app visualizes various CPU scheduling algorithms including FCFS, SJF, SRTF, Priority (Non-preemptive), Priority (Preemptive), and Round Robin. The app allows users to input process details, select a scheduling algorithm, and view the results in a Gantt chart and table format.
- Add Processes: Input process details such as PID, Arrival Time, Burst Time, and Priority (if applicable).
- Select Scheduling Algorithm: Choose from FCFS, SJF, SRTF, Priority (Non-preemptive), Priority (Preemptive), or Round Robin.
- Run the Algorithm: Execute the selected scheduling algorithm and visualize the results.
- View Results: Display the processes, Gantt chart, and results table showing Waiting Time and Turnaround Time for each process.
-
Clone the repository:
git clone https://github.com/jalpatel11/CPU-Scheduling-Algorithms.git cd CPU-Scheduling-Algorithms
-
Create a virtual environment:
python -m venv myenv source myenv/bin/activate # On Windows use `myenv\Scripts\activate`
-
Install the required packages:
pip install -r requirements.txt
-
Run the Streamlit app:
streamlit run app.py
-
Open your web browser and go to
http://localhost:8501
. -
Use the sidebar to add processes and select a scheduling algorithm.
-
Click the "Run" button to execute the algorithm and view the results.
app.py
: Main application file for the Streamlit app.Scheduling.py
: Contains the implementation of the scheduling algorithms.requirements.txt
: List of required Python packages.README.md
: This file.
- FCFS (First-Come, First-Served): Processes are executed in the order they arrive.
- SJF (Shortest Job First): Processes with the shortest burst time are executed first.
- SRTF (Shortest Remaining Time First): Preemptive version of SJF where the process with the shortest remaining burst time is executed next.
- Priority (Non-preemptive): Processes are executed based on priority, without preemption.
- Priority (Preemptive): Processes are executed based on priority, with preemption.
- Round Robin: Processes are executed in a cyclic order with a fixed time quantum.
Jal Patel
GitHub: jalpatel11
This project is licensed under the MIT License.