The system is composed of three actors named Panel, BuildingCoordinator, and Elevators. The BuildingCoordinator is the dispatcher that coordinates how the elevators move on the building. To accomplish this task uses one ElevatorControlSystem which can be a controller that implements the FCFS algorithm at ElevatorControlSystemFCFS or a controller that implements the SCAN algorithm at ElevatorControlSystemScan. The communication among the actors are done using messages on the ElevatorPanelProtocol, the BuildingCoordinatorProtocol, and the ElevatorProtocol.
The Panel is responsible to send commands (PickUp(floor, direction)) to the BuildingCoordinator that receives it as PickUpRequest. It changes its state that is composed by two maps of pickups and stops, then selects one of its Elevators to move. The BuildingCoordinator sends a MoveElevator message which makes the specific Elevator to move. Elevators have only two states. They can be stopped or moving. If one Elevator receives messages to move when it is already moving, the message is stashed and will be processed once the elevator stops. It is the BuildingCoordinator that decides which order of movements it will send to the Elevators. This is dictated by the FCFS or the SCAN controller.
- Compiling:
sbt compile
. - Compiling & Running:
sbt run
. - Unit tests:
sbt test
. - Generate documentation:
sbt doc
, then open thetarget/scala-2.12/api/index.html
file.