Code Monkey home page Code Monkey logo

schedsim's Introduction

Scheduling Algorithms Visualization

This Python script provides a real-time visualization of different scheduling algorithms using the curses library. It's designed to help understand how various scheduling algorithms (Rate Monotonic Scheduling, Deadline Monotonic Scheduling, Earliest Deadline First, and Least Laxity First) operate under different task configurations. This script was developed for the Operating Systems 1 course that I regularly teach at Hof University of Applied Sciences.

demo

Features

  • Real-time visualization of scheduling algorithms
  • Support for Rate Monotonic Scheduling (RMS)
  • Support for Deadline Monotonic Scheduling (DMS)
  • Support for Earliest Deadline First (EDF)
  • Support for Least Laxity First (LLF)
  • Customizable task configurations
  • Adjustable runtime and execution sleep time via command-line arguments

Prerequisites

  • Python 3.x
  • A terminal emulator that supports curses (Linux and macOS terminals should work out of the box. Windows users might need to use WSL or Cygwin)

Installation

  1. Clone the repository or download the source code:

    git clone https://your-repository-url.git
    cd scheduling-algorithms-visualization
  2. (Optional) Create and activate a virtual environment:

    python -m venv venv
    source venv/bin/activate  # On Windows use `venv\Scripts\activate`

Note: This script has no external dependencies apart from standard Python libraries.

Usage

To run the script with default settings (25 units of time, 1-second sleep, using RMS algorithm):

./sched-sim.py

To customize the runtime, sleep time, and algorithm:

./sched-sim.py -r 50 -s 0.5 -a edf

Options:

  • -r or --runtime: Defines the simulation's duration in time units (default: 25).
  • -s or --sleep: Sets the delay between each unit of time to slow down the visualization (default: 1 second).
  • -a or --algorithm: Chooses the scheduling algorithm (rms for Rate Monotonic Scheduling, dms for Deadline Monotonic Scheduling, edf for Earliest Deadline First, llf for Least Laxity First).

Contributing

Contributions are welcome! Please feel free to submit a pull request or open an issue for any bugs, feature requests, or improvements.

License

MIT License - See the LICENSE file in the repository for more details.

schedsim's People

Contributors

cit avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.