Skip to content

An elevator system using Akka actors to receive PickUps and DropOff messages asynchronously.

Notifications You must be signed in to change notification settings

felipegutierrez/elevator-system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

60 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status Coverage Status CodeFactor Codacy Badge Codacy Badge Lines of code

An elevator system using Akka actors

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.

Basic commands:

  • Compiling: sbt compile.
  • Compiling & Running: sbt run.
  • Unit tests: sbt test.
  • Generate documentation: sbt doc, then open the target/scala-2.12/api/index.html file.

About

An elevator system using Akka actors to receive PickUps and DropOff messages asynchronously.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages