Design an Elevator System (Multi-Elevator)
Requirements: Design and code an elevator control system for a single elevator, then extend it to handle multiple elevators servicing the same building.
Design considerations: Elevator states (idle, moving up, moving down, doors open), request queue handling (internal floor requests vs external up/down hall calls), and a scheduling algorithm (e.g., SCAN/LOOK) to minimize wait time and direction changes.
For the multi-elevator extension: a dispatcher component that assigns incoming hall calls to the "best" elevator (e.g., nearest elevator already moving in the requested direction, or least-loaded idle elevator), plus per-elevator queues that operate independently.
Approach: Model Elevator and ElevatorController/Dispatcher classes; each Elevator maintains its current floor, direction, and a sorted set of pending stops; the Dispatcher scores each elevator for a new request and assigns it to the lowest-cost elevator.