Design the control software for a building with several elevators. People press a button on a floor to call a lift, then press a floor number inside it. The system decides which lift goes where and moves them one floor at a time.
It must
- Several elevators serve floors 0 to N.
- A hall call (up or down button on a floor) is given to exactly one elevator.
- A passenger inside presses a destination floor.
- A lift keeps going in its direction, stopping at requested floors on the way (the SCAN idea), then reverses.
- At any moment each lift is idle, moving up or moving down, and the system can say which.
Keep in mind
- No request may wait forever (no starvation).
- The rule that picks a lift must be replaceable (nearest, least busy, zoned).
- Doors, weight limits and emergency stop are follow-ups, not part of the first design.