Hacker News new | ask | show | jobs
by voldemort1968 1828 days ago
I was thinking of creating this very thing on several occasions being in an elevator. The logic of elevators is very intriguing and more complicated than people realize.
1 comments

I'm not sure if this is true. I think all elevators I've encountered followed the elevator/SCAN algorithm:

> the elevator continues to travel in its current direction (up or down) until empty, stopping only to let individuals off or to pick up new individuals heading in the same direction.

with the elevator staying on its last location if there are no new requests and there being no buffering time after a request, first come first served

https://en.wikipedia.org/wiki/Elevator_algorithm

Have you ever seen elevators where you select a floor from the outside and it gets assigned to one of multiple elevators? Those seem like they might be doing something more sophisticated.
I used to have those elevators where I worked and everybody hated them. I think the algorithm was tuned for efficiency, so you’d be waiting for an elevator for minutes as it tries to batch everyone up, while a dozen other elevators sit idle.

This was made worse through the need to specify the number of people who are travelling to a specific floor so the algorithm can allocate enough space in each elevator. Large groups often ignored this so you’d often find that an elevator you’ve waited minutes for is full, and start the dance all over again.

https://en.wikipedia.org/wiki/Destination_dispatch

This is the problem - if the system goes beyond “what floor should I idle at” and “do I idle door open” people get mad at it because of apparent unfairness and inefficiency even if it is actually more efficient overall.

Same thing happens with traffic lights.

This got downvoted, but I’m pretty sure it is objectively correct. I feel like the same sentiment occurs with one queue vs multiple queues.
Continued small motion in a long single queue feels “fairer” than multiple queues - and may actually be.

But I also know most people prefer a driving trip where they’re continually moving rather than one where they’re basically stopped - even if the second is shorter in time.

“Apparent fairness” is an important design criteria for dealing with the public. Even if the system is actually incredibly unfair.

That is true only for the single elevator system. If there are multiple elevators, the system could be extremely complicated.
This works if you have only a single elevator, but if you have a group of elevators that work together and serve same set of floors you can start optimizing the trips for example journey time vs wait time.