Skip to content

A project to simulate various CPU scheduling and page replacement algorithms, done as a project for an Operating Systems course at Wroclaw University of Science and Technology.

License

Notifications You must be signed in to change notification settings

kaykoe/cpu-scheduling-sim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CPU Scheduling Simulator

License

Table of Contents


Introduction

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.

Features

  • Supports multiple CPU scheduling algorithms:
    • First-Come, First-Serve (FCFS)
      • Preemptive and Non-Preemptive versions
    • Shortest Job First (SJF)
      • Preemptive and Non-Preemptive versions
  • 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

Example Plots

plot plot

Installation

Prerequisites

Make sure you have the following installed on your machine:

  1. Clone the repository:

    git clone https://github.com/kaykoe/cpu-scheduling-sim.git
    cd cpu-scheduling-sim
  2. Install dependencies:

    poetry install
  3. Install the Go dependencies, and build the Go executable (optional, pre-built executables are provided):

    cd src
    go build

Usage

  1. 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

View the results:

  • 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.

License

This project is licensed under the MIT License.

About

A project to simulate various CPU scheduling and page replacement algorithms, done as a project for an Operating Systems course at Wroclaw University of Science and Technology.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published