elevator module#
- class elevator.Elevator(min_floor, max_floor, policy, capacity)#
Bases:
object
Represents an elevator
- Parameters:
min_floor (int) – The minimum floor of the elevator
max_floor (int) – The maximum floor of the elevator
policy (Policy) – The policy of the elevator
capacity (int) – The capacity of the elevator
- get_current_floor()#
Get the current floor of the elevator
- Returns:
The current floor
- Return type:
int
- get_elevator_index()#
Get the index of the elevator in the building
- Returns:
The index of the elevator
- Return type:
int
- set_elevator_index(index)#
Set the index of the elevator in the building
- Parameters:
index (int) – The index of the elevator