Design Elevator System

Difficulty: MEDIUMCategory: HLDFrequency: 1Asked On 2022-08-16

Problem Statement

Designing an Elevator Control System for a building with multiple floors and elevators. The system should efficiently handle requests from passengers, optimize elevator movement, and minimize wait and travel time while ensuring safety and reliability.


Functional Requirements (FR)


Passenger Requests

•Passengers can call elevators from any floor (up/down buttons).
•Inside the elevator, passengers can select destination floors.
•Support multiple passengers making concurrent requests.


Elevator Operations

•Elevators move up and down between floors.
•Stop at requested floors in efficient order.
•Handle emergency situations (door obstruction, overload).
•Indicate current floor, direction, and status to passengers.


Scheduling & Dispatch

•Assign elevators to requests optimally to minimize wait time.
•Support different scheduling algorithms (e.g., FCFS, nearest elevator, SCAN).
•Handle idle elevators efficiently.


Safety & Alerts

•Prevent elevator from moving with doors open or overload.
•Support emergency stop and alarm features.


Maintenance & Monitoring

•Track elevator usage and faults.
•Allow manual override for maintenance or emergencies.


Non-Functional Requirements (NFR)


•Scalability: Support multiple elevators and floors efficiently.
•Reliability: Ensure elevators operate safely at all times.
•Responsiveness: Minimize wait and travel time for passengers.
•Extensibility: Easy to add more elevators or floors.


Core Components / Modules


Elevator

•Attributes: elevatorId, currentFloor, targetFloors[], direction, status (idle/moving/maintenance), capacity
•Methods: move(), stop(), openDoor(), closeDoor(), updateStatus()

ElevatorController

•Receives requests from passengers.
•Decides which elevator should handle which request.
•Implements scheduling algorithms (e.g., nearest elevator, SCAN).

Floor

•Attributes: floorNumber, upButtonPressed, downButtonPressed

Request

•Attributes: requestId, sourceFloor, destinationFloor, timestamp, direction

Display / Panel

•Shows current elevator status, direction, and floor to passengers.

Monitoring & Maintenance System

•Tracks elevator health, fault detection, and maintenance logs.

High-Level Data Flow

1.Passenger presses call button → Floor sends request → ElevatorController assigns nearest elevator.
2.Assigned Elevator moves → Stops at requested floor → Doors open → Passenger enters and selects destination floor.
3.ElevatorController updates elevator target floors and optimizes next stops.
4.Real-time updates shown on elevator panel and floor displays.


Advanced Features (Optional / Bonus)


•Destination dispatch system: Passengers input destination floor on the lobby screen to optimize grouping.
•Energy-efficient scheduling: Minimize total energy usage by optimizing elevator movement.
•AI-based predictive scheduling: Predict traffic patterns (peak hours) to pre-position elevators.
•Emergency mode: Automatically return elevators to nearest floor during fire or power failure.
•Accessibility features: Voice announcements and priority access for disabled passengers.


Solution

Comments