JoelViney / Elevator

An implementation of the elevator algorithm

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Elevator

The elevator algorithm, a simple but elegant algorithm by which a single elevator can decide where to stop, is summarised as follows:

  • As long as there’s someone inside or ahead of the elevator who wants to go in the current direction, keep heading in that direction.
  • Once the elevator has exhausted the requests in its current direction, switch directions if there’s a request in the other direction. Otherwise, stop and wait for a call.

The implementation used TDD. It was written for fun on a Friday afternoon with a beer in hand.

About

An implementation of the elevator algorithm

License:MIT License


Languages

Language:C# 100.0%