https://github.com/mohamedyounis10/cpu-scheduling-algorithms-app
A Python app using CustomTkinter to visualize CPU scheduling algorithms like FCFS, SJF, SRTF, Priority, and Round Robin with Gantt chart representations.
https://github.com/mohamedyounis10/cpu-scheduling-algorithms-app
cpu-scheduling cpu-scheduling-algorithms operating-systems ui
Last synced: 3 months ago
JSON representation
A Python app using CustomTkinter to visualize CPU scheduling algorithms like FCFS, SJF, SRTF, Priority, and Round Robin with Gantt chart representations.
- Host: GitHub
- URL: https://github.com/mohamedyounis10/cpu-scheduling-algorithms-app
- Owner: mohamedyounis10
- Created: 2024-12-24T18:46:40.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-12-24T18:58:17.000Z (6 months ago)
- Last Synced: 2025-02-12T02:13:27.354Z (5 months ago)
- Topics: cpu-scheduling, cpu-scheduling-algorithms, operating-systems, ui
- Language: Python
- Homepage:
- Size: 69.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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:
```bash
git clone https://github.com/mohamedyounis10/cpu-scheduling-app.git
cd cpu-scheduling-app
```
2. Install dependencies:
```bash
pip install customtkinter matplotlib pillow
```
3. Run the GUI application:
```bash
python cpu_scheduling_app.py
```---
## Screenshots
### Welcome Screen

### Main Application Interface

---
## Usage
### **Core Algorithm Usage**
You can use the core algorithms independently by importing them from the `cpu_scheduling_algorithms.py` file. Example:
```python
from cpu_scheduling_algorithms import FCFS, ProcessAttributesprocesses = [
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](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](https://github.com/mohamedyounis10).