sanntid

command module
v0.0.0-...-f7a92a3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 9, 2020 License: MIT Imports: 18 Imported by: 0

README

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.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package buttons contains logic for listening to new calls, translating them and sending them to a seller.
Package buttons contains logic for listening to new calls, translating them and sending them to a seller.
Package buyer contains the logic for bidding on and buying calls.
Package buyer contains the logic for bidding on and buying calls.
Package elev implements a simple elevator controller that directs the elevator to a goal floor and handles arrival at goal floor.
Package elev implements a simple elevator controller that directs the elevator to a goal floor and handles arrival at goal floor.
Package hotchan defines a channel with automatically expiring items.
Package hotchan defines a channel with automatically expiring items.
Package indicators contains procedures for listening for events on the network and passively updating the order indicators accordingly.
Package indicators contains procedures for listening for events on the network and passively updating the order indicators accordingly.
Package mac contains the functionality for finding the eno1, eth1 or eth0 mac-addresses on linux-ubuntu machines.
Package mac contains the functionality for finding the eno1, eth1 or eth0 mac-addresses on linux-ubuntu machines.
Package orders contains functions for sorting lists of orders, calculating prices of new orders and procedures for keeping track of the order queue and handling goal floor arrivals and new orders.
Package orders contains functions for sorting lists of orders, calculating prices of new orders and procedures for keeping track of the order queue and handling goal floor arrivals and new orders.
Package orderwatcher contains the watchdog and state distribution system, and thus handles most of the fault tolerance in the elevator system.
Package orderwatcher contains the watchdog and state distribution system, and thus handles most of the fault tolerance in the elevator system.
Package pubsub implements the common publish/subscribe pattern.
Package pubsub implements the common publish/subscribe pattern.
Package seller contains logic for announcing sale propositions, running bidding rounds and selling to the lowest bidder.
Package seller contains logic for announcing sale propositions, running bidding rounds and selling to the lowest bidder.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL