Skip to content

wsparcie/os_algorithms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CPU & Page Algorithms

Python Matplotlib Pandas Pandas Status

 ___ ___ _ _ _ ___ ___ _ _ _ _ | _>| . \| | | < > | . \ ___ ___ ___ | . || | ___ ___ _ _ <_> _| |_ | |_ ._ _ _ ___ | <__| _/| ' | /.\/ | _/<_> |/ . |/ ._> | || |/ . |/ . \| '_>| | | | | . || ' ' |<_-< `___/|_| `___' \_/\ |_| <___|\_. |\___. |_|_||_|\_. |\___/|_| |_| |_| |_|_||_|_|_|/__/ <___' <___' 

A simple program for analyzing and visualizing CPU scheduling and page replacement algorithms, with automated data generation and reporting.

Features

  • CPU Scheduling Algorithms:

    • SJF (Shortest Job First, preemptive & non-preemptive)
    • Round Robin (configurable quantum)
    • Priority-based scheduling
    • Automated workload generation
  • Page Replacement Algorithms (configurable frames):

    • LRU (Least Recently Used)
    • LFU (Least Frequently Used)
    • Automated sequence generation
  • Data Generation:

    • Custom distributions for processes and page references
    • CSV and JSON export for input datasets
    • Batch generation for multiple test sets
  • Performance Analysis:

    • Average turnaround, waiting, completion and response times
    • Page hit/miss rates and execution time
    • Comparative analysis across algorithms and datasets
  • Visualization:

    • Gantt charts for CPU scheduling
    • Performance graphs and histograms
    • Automated report and chart export (PNG, CSV, TXT)

Prerequisites

  • Python 3.13
  • Required packages:
    matplotlib>=3.9.2 pandas>=2.2.2 numpy>=1.26.4

Usage

  1. Install dependencies:

    pip install -r requirements.txt
  2. Run simulations:

    • CPU Scheduling:
      python cpu_scheduling/cpu_RUN.py
    • Page Replacement:
      python page_replacement/page_RUN.py

Project Structure

README.md cpu_scheduling/ cpu_generate.py cpu_RUN.py cpu_simulate.py SJF.py SRTF.py RR.py input_data/ output_data/ page_replacement/ page_generate.py page_RUN.py page_simulate.py LRU.py LFU.py input_data/ output_data/ 

License

This project is released under the MIT License.

About

A simple program for analyzing and visualizing CPU scheduling and page replacement algorithms

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages