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:

  • ElevatorOperator for running the elevator finite state machine.
  • Network for establishing and maintaining connection to the node cluster.
  • Orders for keeping track of all orders in the cluster.
  • OrderAssigner for deciding which elevator is best fit to handle an incoming order.
  • OrderDistributor for distributing new assignments and comleted handling of orders to the rest of the cluster.
  • Watchdog for reinjecting orders if they are not handled within a set amount of time.
  • Driver for communicating with the elevator hardware.
  • InputPoller for polling the various hardware sensors.

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.