Elevator Project - TTK4145: Real time programming
General description
This project is an implementation of an elevator system running n elevators across m floors, using Elixir. The implementation uses message passing, through use of the following OTP behaviours and modules:
Modules
The system is divided into the following modules:
ElevatorOperatorfor running the elevator finite state machine.ElevatorOperator.DoorTimerfor timing closing of the elevator door.
Networkfor establishing and maintaining connection to the node cluster.Network.Listenfor receiving broadcasts with names of other nodes.Network.Broadcastfor broadcasting own node name.Network.ConnectionCheckfor checking if the node is connected to the cluster, and requesting backup whenever it becomes connected.
Ordersfor keeping track of all orders in the cluster.OrderAssignerfor deciding which elevator is best fit to handle an incoming order.OrderDistributorfor distributing new assignments and comleted handling of orders to the rest of the cluster.Watchdogfor reinjecting orders if they are not handled within a set amount of time.Driverfor communicating with the elevator hardware.InputPollerfor polling the various hardware sensors.ObstructionPollerfor polling the obstruction switch sensor.FloorPollerfor polling the floor sensor.OrderButtonPollerfor polling an order button.
Additionally, different modules are supervised by different Supervisors. These Supervisors are responsible for restarting modules if the terminate due to some error. The modules are documented at https://hexdocs.pm/elevator_project/0.1.0.
Running the system
The system can be ran through the command mix run --no-halt. The application requires the installation of the delivered ElevatorServer.