Project Overview

This distributed elevator control system is designed for efficient management of n elevators across m floors. The system is modular, and consists of:

  • elevator: Handout code which manages logic for operations, event handling, and task allocation.

  • network: Facilitates robust communication across the distributed system.

  • elevio: Provides an interface to the physical elevator hardware.

  • hall_request_assigner: Handout code which based on the current states, assigns the optimal hall orders.

Central to the system’s design is the use of UDP and a peer-to-peer communication architecture for robustness against network issues.

Prequisites

  • Go: (1.21 or newer) installed

  • Operating System: Linux. The system and its components have been designed and tested for compatibility with Linux environments, specifically Ubuntu 22.04.

  • Elevator Hardware Access: Direct access or an emulation setup is required for the elevio package to interact with the elevator hardware.

Execution Instructions

To launch an elevator instance, use the following command, substituting ID_NUMBER and PORT_NUMBER:

 
go run main.go --id=ID_NUMBER --port=PORT_NUMBER
 
  • ID_NUMBER: Assigns a unique identifier to the elevator instance. This must be an integer.

  • PORT_NUMBER: Specifies the network port for this elevator’s communication. This must be an int, and should not be a reserved port.


Example usage is

 
go run main.go --id=1 --port=12345
 

Given that the elevator also runs on port 12345.

Run with systemctl

To make sure that the elevator will always run in case of a crash, you can use the systemctl service file:

 
mkdir -p bin
 
cd bin && go build .. && cd ..
 
./install-service.bash --id 1 --port 20000
 
./start.bash --id 1
 

This will start a single elevator as a service.

To stop the service:

 
./stop.bash --id 1