This project is a Disk Scheduling Algorithms Simulator implemented in Python.
It demonstrates and compares different disk scheduling algorithms used in operating systems to optimize disk head movement and reduce seek time.
The simulator calculates the service order of disk requests, computes the total seek distance, and visualizes the head movement using graphs.
This project is intended for educational purposes, particularly for Operating Systems courses.
Implementation/ │ ├── algorithms/ │ ├── fcfs.py │ ├── sstf.py │ ├── scan.py │ ├── cscan.py │ ├── look.py │ └── clook.py │ ├── utils/ │ ├── graph.py │ ├── plot.py │ └── seek_distance.py │ ├── main.py └── README.md
- Services requests in arrival order.
- Simple and fair.
- Can result in high total seek time.
- Selects the request closest to the current head position.
- Reduces total seek time.
- May cause starvation.
- Moves in one direction servicing requests.
- Reverses direction at the end of the disk.
- Moves in one direction only.
- Jumps back to the beginning after reaching the end.
- Similar to SCAN.
- Travels only as far as the last request instead of the disk boundary.
- Circular version of LOOK.
- Jumps from the last request directly to the first request.
Total seek distance is calculated using:
| current_position - next_position |
The total seek time is the sum of all individual head movements.
Implemented in: utils/seek_distance.py
The simulator provides graphical visualization of disk head movement:
- X-axis: Order of execution
- Y-axis: Track positions
- Displays total head movement visually
Visualization modules:
utils/graph.py
utils/plot.py
- Clone the repository:
git clone
cd Implementation
- Install required dependencies:
pip install matplotlib
- Run the program:
python main.py
- Python 3.x
- matplotlib
Initial Head Position: 50
Disk Size: 200
Request Queue: 95, 180, 34, 119, 11, 123, 62, 64
The program will output:
- Service order
- Total seek distance
- Graphical visualization
This project helps in understanding:
- Disk scheduling techniques
- Seek time optimization
- Algorithm efficiency comparison
- Trade-offs between fairness and performance
- Graphical User Interface (GUI)
- Real-time animation
- Algorithm comparison table
- Export results to CSV
- Performance benchmarking
Developed for Operating Systems coursework.
This project is intended for educational purposes only.