https://github.com/jaceklaskowski/elevator-control-system
Elevator Control System
https://github.com/jaceklaskowski/elevator-control-system
Last synced: 4 months ago
JSON representation
Elevator Control System
- Host: GitHub
- URL: https://github.com/jaceklaskowski/elevator-control-system
- Owner: jaceklaskowski
- License: apache-2.0
- Created: 2017-03-02T14:24:08.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-04-02T20:26:40.000Z (about 8 years ago)
- Last Synced: 2025-01-01T02:43:44.393Z (6 months ago)
- Language: Scala
- Size: 8.79 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Elevator Control System (ECS)
## Design
**Thought**: ECS is like a cluster manager with elevators as agents.
Elevator Control System (ECS) controls elevators that can stand still (and hence no people inside) or go up or down.
There can be one or many people going in different directions (up and down).
Choosing what elevator to take on `UP` or `DOWN` requests is a function of cost that an elevator computes on demand when such a request is received.
## How to run (aka Build Instructions)
Install [sbt](http://www.scala-sbt.org/) and execute `sbt test` command. Expect `[success]` at the end.```bash
$ sbt test
...
[info] MovingCostSpec:
[info] Elevator
[info] - should calculate its moving cost
[info] ElevatorControlSystemSpec:
[info] A ElevatorControlSystem
[info] - should handle up to 16 elevators
[info] - should query the state of the elevators (what floor are they on and where they are going)
[info] - should receive a pickup request
[info] Run completed in 308 milliseconds.
[info] Total number of tests run: 4
[info] Suites: completed 2, aborted 0
[info] Tests: succeeded 4, failed 0, canceled 0, ignored 0, pending 0
[info] All tests passed.
[success] Total time: 8 s, completed Mar 2, 2017 3:21:39 PM
```