4 ms·
Very interesting. A friend and I were interested in elevator algorithms last year, and ended up writing an elevator "simulator" in Java. I'll post the code some
by peter_l_downs 15y ago
Very interesting. A friend and I were interested in elevator algorithms last year, and ended up writing an elevator "simulator" in Java. I'll post the code somewhere if anyone's interested, but like chrislomax and TheCapn say is correct: depending on the time of day, the optimal algorithm changes.
The interesting thing about "elevator" algorithms is that they're really very similar to the algorithms used to schedule reads and writes on a hard drive. Reading in some data is similar to picking up a person, and writing data can be thought of as dropping the person off somewhere. Regular (i.e., not solid state) hard drives have large cylinders of addresses. This is sort of like a rolled up building.
I don't have the output in front of me, but I think that both LOOK [1] and SCAN [2] algorithms performed very well. It's cool to note that the SCAN algorithm is referred to as the "Elevator algorithm" by Wikipedia. Clearly we're not the first to go down this rabbit hole.
[1] http://en.wikipedia.org/wiki/LOOK_algorithm http://en.wikipedia.org/wiki/LOOK_algorithm
[2] http://en.wikipedia.org/wiki/Elevator_algorithm http://en.wikipedia.org/wiki/Elevator_algorithm
- karambahh 15y agoI'm definitely interested in playing with your simulator!