Skip to content
/ sanntid Public

Elevator Project for TTK4145 Real-time Programming

License

Notifications You must be signed in to change notification settings

sigtot/sanntid

Repository files navigation

Multi-elevator network project

Go Report Card GoDoc

Elevator Project for TTK4145 Real-time Programming

This repo contains implementation of a system for connecting n elevators and n elevator panels installed on n computers over a network connection in such a way that orders are distributed evenly and efficiently to the elevators. A large effort has been put into fault tolerance due to the requirement that no order is lost after it has been accepted. This requirement applies even in the case of network failure, power outages, program crashes or situations with severe packet loss.

simulator

Design

The design for this system is based on the common publish/subscribe pattern which is heavily used distributed systems. In hte figure below, the modules of the system are shown, with dashed, labeled arrows correspond to a module being either a subscriber or a publisher to a certain topic.

Solid arrows however, signify more direct forms of communication between modules (channels, function calls, etc.).

module_overview

Imported packages

elevio package

The elevator driver used in the project was provided by the course instructors. As we were not pleased with some of the implementation done in the driver, the repository was forked, and made some changes to. The original elevator driver can be found here.

bbolt

Bolt is the database used by the order watchers to store not yet delivered calls. The package used in this project is the bbolt package by etcd, which can be found here

logrus

Logging events in the system is done with the logrus package. The package can be found here

Go standard library

A fair few of the packages from the Go standard library are used in this project. For specific packages see the imports in the files. These packages are used for a lot of different tasks, from io and os related, to encoding and compressing. For the network related parts of the project the net package and net/http package are used.