项目作者: gsharma

项目描述 :
Elevator scheduling system
高级语言: Java
项目地址: git://github.com/gsharma/elevators.git
创建时间: 2019-08-21T19:19:25Z
项目社区:https://github.com/gsharma/elevators

开源协议:Apache License 2.0

下载


Elevator Scheduler

Goals

  1. For users: minimize the transit time (wait time outside + wait time inside) while using the elevator.
  2. For operators: minimize operational energy expenditure, allow for easy maintenance, allow configurability.

Motivation

On a recent trip to Hawaii while staying in a large high-rise building with a bank of 5 elevators, I closely observed the building’s elevator scheduler in action and decided to simulate one myself.

System Requirements

Note: list needs to be segregated by user vs operator requirements::

  1. Capacity is enforced as an upper bound on the aggregate weight of users riding an elevator.
  2. Direction of elevator motion does not change until current destination.
  3. Service speed of a group of elevators managed by a scheduler is identical.
  4. Service capacity of a group of elevators managed by a scheduler may not be uniform.
  5. Service speed and capacity are always known to the elevator scheduler.
  6. Elevator-internal and elevator-external requests need to be separately identified.
  7. Resting point of elevators should be one of the floors with highest external request count.
  8. Elevator-internal requests should not ignored and are serviced by the local elevator.
  9. Elevator-internal requests can be toggled between selected/de-selected states.
  10. Duplicate requests for the same floor are ignored.
  11. Elevator-external requests are scheduled by the elevator scheduler.
  12. Elevator has 3 operational modes - normal, emergency, stopped.
  13. Emergency operational mode disables all external scheduling.
  14. Operators may choose to disable scheduling for certain floors (e.g. floor 13).

System Invariants

Implementation Notes

  1. What amounts to a sub-optimal decision?

Any “change of mind” decision elongates service time for already-made promises. Consider in-flight passengers as promises, elevator scheduler should maintain the direction of travel. It is okay to accept more internal and external requests along the direction of travel assuming they are all scheduled before reversing direction of travel.