This project implements a dynamic elevator scheduling algorithm in Java, simulating the path and logic of an elevator based on incoming requests and direction.
- Handles dynamic floor requests during the elevator journey.
- Moves only to requested floors, avoiding unnecessary stops.
- Supports direction-based scheduling (up or down) similar to SCAN algorithm.
- Automatically reverses direction when no further requests exist in the current direction.
- Uses ArrayList for efficient request management and sorting.
-
Requests are added dynamically via the
requestFloor()
method. -
The elevator maintains:
currentFloor
– its current position.direction
– current direction ("up" or "down").requests
– list of pending floor requests.
-
Processes requests in the current direction:
- Ascending order when going up.
- Descending order when going down.
-
If no requests remain in the current direction, it reverses direction.
-
Upon reaching a requested floor, it removes it from the queue.
javac ElevatorSystem.java
java ElevatorSystem
ElevatorSystem elevator = new ElevatorSystem();
elevator.requestFloor(5);
elevator.requestFloor(3);
elevator.requestFloor(8);
elevator.processRequests();
ElevatorSystem.java
: Contains the elevator algorithm implementation.README.md
: Project documentation.
- ArrayList for dynamic data storage.
- Sorting algorithms for direction-based traversal.
- While loops and conditionals for continuous processing.
- Object-Oriented Programming (OOP) to encapsulate elevator logic within a class.
- Multi-elevator system with optimal car assignment.
- Real-time simulation with threading.
- GUI integration using JavaFX or Swing for visualization.
- REST API backend for smart building elevator control systems.
This project is for educational and demonstration purposes under Data Structures, Algorithms, and Java OOP learning.
Vansh Pandey BTech CSE | AI-ML | Space & Research Enthusiast
“Elevators teach us – when requests align with direction, journeys become efficient.”