Skip to content

A Python app using CustomTkinter to visualize CPU scheduling algorithms like FCFS, SJF, SRTF, Priority, and Round Robin with Gantt chart representations.

Notifications You must be signed in to change notification settings

mohamedyounis10/CPU-Scheduling-Algorithms-App

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

CPU Scheduling Algorithms

This repository contains two main components:

  1. CPU Scheduling Algorithms: Core implementations of CPU scheduling algorithms (without UI).
  2. CPU Scheduling App with UI: An interactive application for visualizing and running CPU scheduling algorithms, combining both the algorithms and a graphical user interface (GUI).

Features

  • Supported Algorithms:
    • First-Come First-Served (FCFS)
    • Shortest Job First (SJF)
    • Shortest Remaining Time First (SRTF)
    • Priority Scheduling
    • Round Robin (RR)
  • Interactive UI:
    • Add processes dynamically.
    • Visualize the Gantt Chart for each scheduling algorithm.
    • Error handling for invalid inputs.
  • Standalone Core Algorithms:
    • The cpu_scheduling_algorithms.py file contains the core implementations of scheduling algorithms, independent of the GUI.
  • Integrated Application:
    • The cpu_scheduling_app.py file combines the algorithms and an interactive UI in a single application.

Installation

  1. Clone the repository:
    git clone https://github.com/mohamedyounis10/cpu-scheduling-app.git
    cd cpu-scheduling-app
  2. Install dependencies:
    pip install customtkinter matplotlib pillow
  3. Run the GUI application:
    python cpu_scheduling_app.py

Screenshots

Welcome Screen

Screenshot 2024-12-24 205248

Main Application Interface

image


Usage

Core Algorithm Usage

You can use the core algorithms independently by importing them from the cpu_scheduling_algorithms.py file. Example:

from cpu_scheduling_algorithms import FCFS, ProcessAttributes

processes = [
    ProcessAttributes(pid="P1", BurstTime=5, ArrivalTime=0),
    ProcessAttributes(pid="P2", BurstTime=3, ArrivalTime=2),
    ProcessAttributes(pid="P3", BurstTime=8, ArrivalTime=4),
]

result = FCFS(processes)
print(result)  # Output: [("P1", 0, 5), ("P2", 5, 8), ("P3", 8, 16)]

GUI Usage

  1. Launch the application and add processes by filling out the fields for Process ID, Burst Time, Arrival Time, and optionally Priority/Time Quantum.
  2. Select a scheduling algorithm.
  3. Click "Run Algorithm" to visualize the Gantt Chart.

Files

  • cpu_scheduling_app.py: The main file for the GUI application that combines the scheduling algorithms and an interactive UI.
  • cpu_scheduling_algorithms.py: Contains core implementations of scheduling algorithms, designed to be used independently of any GUI.
  • images/: Directory for screenshots and other assets.

License

This project is licensed under the MIT License. See the LICENSE file for details.


Contributing

Contributions are welcome! Feel free to submit a pull request or open an issue to suggest improvements or report bugs.


Author

Created by Mohamed Younis.

About

A Python app using CustomTkinter to visualize CPU scheduling algorithms like FCFS, SJF, SRTF, Priority, and Round Robin with Gantt chart representations.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages