I wanted to know how (real) elevators work. But, so far, I could not find much material about the algorithms they use, nor software (if any) for simulation. Could anybody give me references for that?
-
Fundamentally, it's a problem described by queueing theory.– Rein HenrichsJul 27, 2011 at 7:58
-
If you like some specific deep knowledge, watch this: youtube.com/watch?v=1Uh_N1O3E4E– Toon KrijtheFeb 26, 2020 at 12:44
-
And it has a sister question on SO: stackoverflow.com/questions/493276/…– Toon KrijtheFeb 26, 2020 at 12:46
-
I took a stab at it some years ago, including some of the mentioned optimizations: github.com/samsonradu/elevator/blob/gh-pages/js/src/stores/… DEMO: samsonradu.github.io/elevator– SamsonJan 10, 2021 at 22:43
3 Answers
Interesting question. Makes me want to do some research on this as well.
Wiki has a reference to a book Barney, G. (2003, January). Elevator Traffic Handbook: Theory and Practice. ISBN 9780415274760.
Here's a snippet from Wiki (you might have seen it already):
The elevator algorithm has found an application in computer operating systems as an algorithm for scheduling hard disk requests. Modern elevators use more complex heuristic algorithms to decide which request to service next. An introduction to these algorithms can be found in the "Elevator traffic handbook: theory and practice" given in the references below.
There are different implementations of course, but the most prevalent is this one:
https://en.wikipedia.org/wiki/Elevator#Elevator_algorithm
Since in actual buildings the ground floor is usually used more frequently than others, there are also a fair amount of implementations which let the elevator return to the ground floor after a certain time of inactivity.
(On a side note, there is a telling that Donald Knuth once spent a day in an elevator just to be absolutely sure that he would describe the elevator algorithm correctly, but I can't find a reference for that.)
-
4RE: Your side note: I just saw it referenced in this paper (pg. 165): ocw.mit.edu/courses/electrical-engineering-and-computer-science/… It cites The Art of Computer Programming, Donald E., Knuth, Vol 1. page 295. On the elevator system in the Mathematics Building at Cal Tech. First published in 1968– jduhlsMar 5, 2018 at 14:57
Elevator algorithm is best described using Knuth's Elevator algorithm.
But in the simple steps, the algorithm can be stated as:
- Travel in the single direction until the last request in that direction.
- If there is no request, stop and proceed towards other direction, if there is any request from other direction.