This repository provides a simulator for different CPU scheduling algorithms written in Go, as well as a Jupyter Notebook used to generate graphs for visualizations, and analysis.
- Supports multiple CPU scheduling algorithms:
- First-Come, First-Serve (FCFS)
- Preemptive and Non-Preemptive versions
- Shortest Job First (SJF)
- Preemptive and Non-Preemptive versions
- First-Come, First-Serve (FCFS)
- Supports multiple page replacement algorithms:
- First-In, First-Out (FIFO)
- Least Frequently Used (LFU)
- Persistent and Non-Persistent versions
- Visualizations using Jupyter Notebooks.
- sim.py python script to run simulations in a batch
- pre built executable for x86_64 Linux at src/src and Windows at src/src.exe
Make sure you have the following installed on your machine:
- python
- Poetry
- go
-
Clone the repository:
git clone https://github.com/kaykoe/cpu-scheduling-sim.git cd cpu-scheduling-sim -
Install dependencies:
poetry install
-
Install the Go dependencies, and build the Go executable (optional, pre-built executables are provided):
cd src go build
-
Run the simulator:
- see command line args to run the executable directly (use the src.exe file on Windows):
cd src ./src --help - or batch generate data with python script:
poetry run python sim.py
- see command line args to run the executable directly (use the src.exe file on Windows):
- Input and output data files are located in the in/ and out/ directories, respectively. Output is generated in both .csv files for data processing, as well as human-readable .txt files for easy viewing.
- View the documentation
- The out directory also contains the plots generated with plot.ipynb.
This project is licensed under the MIT License.

