Top
Best
New

Posted by Jrh0203 9 hours ago

Elevators(john.fun)
786 points | 204 commentspage 5
danso 4 hours ago|
Oh wow, this is perfect reading for me. One of my first college career fair questions was "Tell me how you would program an elevator". Forgot what sad attempt at an answer I gave, but I pretty much thought about that algorithm every time I've ever waited for the elevator. Which was pretty much daily when living in NY.
efavdb 7 hours ago||
I recently wrote an article about this problem, and detail one reasonable algo for minimizing wait time. (Doesn’t consider concept of cars being full though, interesting addition)

https://jslandy.com/elevators/

reader9274 7 hours ago||
I feel like most cases of wait times are due to elevators "waiting" empty in the wrong floor. They either all wait in the bottom floor, or all wait where they were last left at. Would be better if their waiting floors were distributed throughout the floors so that first response is fast.
Sohcahtoa82 7 hours ago||
In the middle or end of the day, yes. In the morning, waiting on the bottom floor is the best.

Unless you're a hotel. Then the timing is flipped: Wait in a distributed manner in the morning/mid-day, gather on the floor in the evening.

cruffle_duffle 7 hours ago||
The problem is that in the morning the “last stop” for the elevator might be the lobby not a mid floor. And so it would have to move itself back up without any passengers or calls to upper floors. Basically “optimistically” moving itself back up. And I wonder if some (most?) control systems don’t do that because of… well I dunno. Lots of elevators have pretty old or basic control systems in them. Maybe predate caring about energy and many also probably aren’t strictly smart enough to be concerned about wear factors and stuff.

It could also be that you and I simply aren’t privy to what is actually happening “the instant” you are waiting for the elevator.

…which makes me wonder how often the firmware in these get updated. Assuming it’s not just a pile of ancient relays and stuff. And if, when they do get updated, the algorithms get improved. Or if the algorithm is something that gets sold to the building and “upgrading” is an actual purchase.

Anyway, I could get a little LLM buddy to look it all up but where is the fun in that?

dbcurtis 7 hours ago|||
Most systems to that. Empty-cab strategy is a programming option in the controller. If all cabs are idle (very rare) they are typically spread out.
rubslopes 7 hours ago||
Yes! I always thought that, when unused, elevators should distribute themselves along the floors, weighted by the floors that use them the most.
clarkmoody 8 hours ago||
One of the most frustrating assignments[1] (2011) in my computer science education was trying to build a better mousetrap for elevator control.

[1]: https://clarkmoody.com/Moody_AgentBasedElevatorControl.pdf

SoftTalker 7 hours ago|
Disk drive read/write algorithms have a lot in common with elevator algorithms. At least they did in the days of physical heads moving across a platter.
m463 3 hours ago||
I'd like to see skyscraper elevators simulated, not just a few floors.

They have to be built a certain way, and need super fancy dispatch algorithms.

JoshTriplett 6 hours ago||
> This counterintuitive result is all thanks to the rebalancing step where every 5 seconds, the system re-optimizes each elevator's path. The kiosk enforces rigidity, you must get in the assigned elevator.

Sounds like destination dispatch would work better if it didn't tell you which elevator to get into until the elevator arrived.

EDIT: already being discussed in the thread at https://news.ycombinator.com/item?id=49125423

pwython 6 hours ago||
I was on a Royal Caribbean ship a couple weeks ago (Utopia, 18 decks, 5,668 passengers). It has 24 main elevators split between front and back, left and right. So a bank of 6 in front of you each time you needed a lift. You press your floor on a touchpad and it assigns you an elevator A through F.

I swear no matter if it was busy or not, it seemed like everyone was assigned to the same one or two elevators. The wait was always so long too, I used the stairs most of the time if just going <6 flights.

Someone besides RCCL needs to study that algorithm.

skullone 6 hours ago||
Possibly to balance the hours on elevator banks. Common in buildings to leave some out of the cycle, since elevator maintenance can be a year out to schedule. Probably much worse out at sea
sp0rk 6 hours ago||
This type of system is mentioned in the article under the "Destination Dispatch" section.
sambaumann 8 hours ago||
This reminds me of elevator saga (https://play.elevatorsaga.com/) - little programming game where you have to program elevator schedules.
efields 5 hours ago||
This is like the how it’s made of a website. I could read and click through an endless amount of these kinds of explainers.
ryukoposting 7 hours ago|
My friend lives in a building with one of those super old elevators with the manual double doors and no queuing. It's the sort of elevator that someone probably got paid to operate once upon a time.

Using such a primitive elevator gave me a newfound appreciation for the complexity of modern designs. The queueing algorithms are subtle but clever, and the difference in efficiency is instantly obvious once you've dealt with the alternative.

More comments...