package
Version:
v0.0.0-...-153afd2
Opens a new window with list of versions in this module.
Published: May 2, 2019
License: Unlicense
Opens a new window with license information.
Imports: 17
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
Module: Scheduler
- The scheduler module schedules new orders to the cheapest elevator
- Orders are assigned by the elevator that received the order
- Orders are assigned a deadline, and if it is expired, the order is reassigned a new elevator. This also applies to "offline" elevators
- Worst case normal execution time
- Can function in single elevator mode. Should then finish all orders it has been assigned in addition to own cab calls
External packages
Package Name |
Description |
Reason |
context |
Goroutine context management (included in standard library from Golang 1.7) |
To stop the goroutine if the context is no longer valid |
driver-go |
Handout from TTK4145 |
To control the hardware of the elevator |
go-spew |
Pretty printer for complex data structures |
To dump order list to console |
xid |
Generates globally unique IDs |
Used to assign unique order ids |
Documentation
¶
Run is the startingpoint for the scheduler module
The ctx context is used to stop the gorotine if the context expires.
Config contains scheduler configuration variables
type SchedulableOrder struct {
common.Order `json:"order"`
Worker int `json:"assignee"`
Timestamp time.Time `json:"timestamp"`
OrderID string `json:"order_id"`
}
SchedulableOrder is an order with a priority and cost
Source Files
¶
Click to show internal directories.
Click to hide internal directories.