Elevator System Low Level Design

Problem definition

You are tasked with designing an elevator system for an office building.

Questions for the interviewer

  1. How many elevators can be in the building? How many of elevator cars will work concurrently?
  2. How many buildings do we serve?
  3. What functions should each elevator car panel support (e.g., open doors, close doors, turn on ventilation, emergency call)?
  4. What is the capacity of each elevator car (number of persons and maximum allowed weight)?
  5. Should the elevator have information panels inside the elevator car and on each floor? What information should be displayed on these panels?
  6. What optimization techniques should we apply for the elevator system? Should we prioritize optimizing idle time, waiting time or energy consumption?

Requirements

R1. The elevator system consists of 1 elevator per building with 3 concurrently working elevator cars.

R2. We serve an ensemble of 5 buildings. The elevator system is the same in each building.

R3. Each elevator car should support the following functions: select a floor, open doors, close doors, emergency call, and turn on ventilation.

R4. There should be a button panel on each floor with “Up” and “Down” buttons.

R5. The maximum allowed capacity of each elevator car is 6 persons or 600 kg.

R6. Each elevator car should have an information panel that shows the current floor number.

R7. Each floor should have hall information panels that indicate the direction of user requests if an elevator car has been requested.

R8. The elevator system should support 3 optimization strategies: minimize idle time, minimize waiting time, and minimize emery consumption.

Use case diagram

First of all, let’s define actors and possible use cases.

Primary actors: passenger

Secondary actors: service employee

System: elevator system

PassengerService employeeSystem
Press button at the hall panelPress button at the hall panelMove the elevator car
Press button at the elevator car panelPress button at the elevator car panelProcess the elevator car request
Change the optimization strategyProcess the hall request
Open/close door
Show information on the hall panel
Show information on the elevator car panel
Possible use cases

Relationships:

Generalization:

  1. Press an elevator button, such as “Open door”, “Close door”, “Emergency call” or “Floor number”, can be inherited from the “Press an elevator button” use case.
  2. Press a hall button, such as “Up”, “Down”, can be inherited from the “Press a hall button” use case.
  3. “Show information on the hall panel” and “Show information on the elevator car panel” could be inherited from the common use case “Show information on the panel”.
  4. “Process the elevator car request” and “Process the hall request” can be children of the common “Process request” use case.

Include:

  1. “Press button at the hall panel” use case includes “Process the hall request”.
  2. “Press button at the elevator car panel” use case includes “Process the elevator car request”.

Extend:

“Process the elevator car request” and “Process the hall request” can be extended by “Move the elevator car” if there are available elevator cars.

Diagram:

Sequence diagram

Let’s create a sequence diagram for the “Elevator call” interaction. To do this, we should first compose a list of actions included in the interaction:

  1. Passenger: presses a hall button.
  2. Hall button: creates a hall request.
  3. System: evaluates the desired direction for the hall panel.
  4. Hall panel: displays the desired direction.
  5. System: finds an appropriate elevator car.
  6. System: starts moving an idle car or continues moving the existing car.
  7. System: stops the car.
  8. System: opens the doors.

Activity diagram

Activity diagrams serve to represent a process as a transition between initial, intermediate, and final statuses.

Let’s compose an activity diagram for the action “Elevator car ride”.

Class diagram

Used design patterns:

  • Observer – Observable pattern (to update date on the information panels).
  • Command pattern (to execute the service command).

The codebase is published on GitHub.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top