Skip to content

tausif112/LOOK-Disk-Scheduling-Simulator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

7 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ’ฝ LOOK Disk Scheduling Simulator

LOOK Disk Scheduling Algorithm Implementation in Python

Python License Google Colab


A Python implementation of the LOOK Disk Scheduling Algorithm with seek path generation and total cylinder movement calculation.


๐Ÿ“Œ Overview

This project demonstrates the implementation of the LOOK (Look Ahead) Disk Scheduling Algorithm, a commonly used disk scheduling technique in Operating Systems.

Unlike the SCAN algorithm, LOOK does not move the disk head all the way to the disk boundary. Instead, it moves only as far as the last pending request in the current direction before reversing.

In this implementation, the disk head moves right first, services all requests on the right side, then reverses direction and services the remaining requests on the left side.

The simulator calculates:

  • Disk head movement path
  • Seek sequence
  • Total cylinder movement
  • Final servicing order

The project was developed and tested using Google Colaboratory (Google Colab).


โœจ Features

  • LOOK Disk Scheduling Simulation
  • Right-First Head Movement Strategy
  • Seek Path Generation
  • Total Cylinder Movement Calculation
  • Efficient Disk Head Traversal
  • Google Colab Notebook Included
  • Python Source Code Included

๐Ÿง  About LOOK Disk Scheduling

LOOK is an improved version of the SCAN Disk Scheduling Algorithm.

Instead of moving the disk head to the extreme end of the disk, LOOK only travels up to the last request in the current direction and then reverses.

Advantages

  • Less head movement than SCAN
  • Improved seek performance
  • Reduced unnecessary traversal
  • Efficient request servicing

Limitations

  • Requires sorting of requests
  • Performance depends on request distribution
  • Requests in the opposite direction may experience longer waits

โš™๏ธ Algorithm

  1. Start from the current disk head position.
  2. Divide requests into:
    • Right-side requests
    • Left-side requests
  3. Sort right-side requests in ascending order.
  4. Sort left-side requests in descending order.
  5. Service all right-side requests first.
  6. Reverse direction.
  7. Service all left-side requests.
  8. Calculate total cylinder movement.
  9. Return the final seek path.

๐Ÿงฎ Input Example

queue = [98, 183, 37, 122, 14, 124, 65, 67]
start = 53

๐Ÿ“Š Output Example

Path: [53, 65, 67, 98, 122, 124, 183, 37, 14]

Total cylinder movement: 299

๐Ÿ“ˆ Seek Path Representation

53 โ†’ 65 โ†’ 67 โ†’ 98 โ†’ 122 โ†’ 124 โ†’ 183 โ†’ 37 โ†’ 14

๐Ÿ“‹ Movement Analysis

From To Distance
53 65 12
65 67 2
67 98 31
98 122 24
122 124 2
124 183 59
183 37 146
37 14 23

Total Cylinder Movement

12 + 2 + 31 + 24 + 2 + 59 + 146 + 23

= 299

๐Ÿ“ธ Google Colab Development Environment

The project was implemented and tested using Google Colaboratory.

Google Colab Workspace

Colab Workspace


๐Ÿ“ธ Program Output

Output


๐Ÿ“‚ Project Structure

LOOK-Disk-Scheduling-Simulator/
โ”‚
โ”œโ”€โ”€ LOOK_Disk_Scheduling.ipynb
โ”œโ”€โ”€ look.py
โ”œโ”€โ”€ README.md
โ”œโ”€โ”€ LICENSE
โ”œโ”€โ”€ .gitignore
โ”‚
โ””โ”€โ”€ screenshots/
    โ”œโ”€โ”€ colab-workspace.png
    โ””โ”€โ”€ output.png

๐Ÿš€ How to Run

Clone the Repository

git clone https://github.com/tausif112/LOOK-Disk-Scheduling-Simulator.git

Navigate to the Project Directory

cd LOOK-Disk-Scheduling-Simulator

Run the Program

python look.py

๐Ÿ›  Technologies Used

Technology Purpose
Python Core Implementation
Google Colab Development Environment
GitHub Version Control
Operating Systems Disk Scheduling Concepts

๐Ÿ”ฎ Future Improvements

  • C-LOOK Disk Scheduling
  • SCAN Disk Scheduling Comparison
  • C-SCAN Disk Scheduling Comparison
  • SSTF Disk Scheduling Comparison
  • Graphical Seek Path Visualization
  • Interactive User Input
  • Dynamic Disk Request Input
  • Comparison Between Disk Scheduling Algorithms

๐Ÿ‘จโ€๐Ÿ’ป Author

Md Tausif Uddin

Department of Computer Science & Engineering (CSE)
University of Asia Pacific (UAP)

GitHub: https://github.com/tausif112


โญ If you found this project useful, consider giving it a star!

About

Python implementation of the LOOK Disk Scheduling Algorithm with seek path generation and total cylinder movement calculation.

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Contributors