Live data from Hacker News

Elevator Saga: An elevator programming game (2015)

play.elevatorsaga.com

81–90 of 103 posts

Re: Elevator Saga: An elevator programming game (2015)

#81
post #29

I always wished elevator buttons could toggle. If you accidentally press the wrong floor, just press it again to cancel. This may not work in all situations, but in some situations, it could be a time saver.

I think the reason for this could be to prevent you cancelling other people's destinations. I can only imagine the public freakout that could unfold, even if it was accidental.

Re: Elevator Saga: An elevator programming game (2015)

#82
post #5

One past discussion, plus a one-commenter: Elevator Saga: The Elevator Programming Game - https://news.ycombinator.com/item?id=21425054 - Nov 2019 (1 comment) Elevator Saga – An elevator programming game - https://news.ycombinator.com/item?id=8929314 - Jan 2015 (104 comments)

And sadly it still has some unfixed bugs since 2015 where people don't consider the up/down indicators correctly, and will not enter the elevator even though the lights are on in the direction they want to go.

Re: Elevator Saga: An elevator programming game (2015)

#83
post #56
post #15

Made me remember an interesting anecdote: During my PhD at Purdue I had the good luck to take the Pattern Recognition (nowadays would be called ML) course from Prof. Fukunaga, one of the pioneers in the field ( https://en.m.wikipedia.org/wiki/Keinosuke_Fukunaga ). In one of his classes he mentioned that years ago a company came to him, requesting his expertise in optimizing movement of a bank of elevators. He thought…

There is this anecdote in the text "Operations Research, An Introduction." by Hamdy Taha, which I consider to be a very good example of picking the right tools for the job. An OR group was hired to fix elevator wait times in an office building. After studying the problem they installed full-length mirrors at the entrance to the elevators. Complaints around elevator service disappeared as people were now engaged in wa…

Reminds me a parable from Are your lights on by Gerald Weinberg.

Re: Elevator Saga: An elevator programming game (2015)

#84

An interesting improvement over naive operation I thought long ago: idle elevators should go to 1/2 maximum floor! You easily cut average wait times in 1/2! Problem is, it's also energy inefficient. If you get a passenger at floor 1 or 0, you've wasted a lot of movement. On-demand movement wastes minimally. So I've learned of a tradeoff between energy and waiting time -- not just elevator speed, but in algorithms. It…

I've also learned it's a classic under-specified problem. To solve it completely you need, for example:

1) distribution of arrival times and destinations of passengers;

(For example, if late evening people usually go up, it's best to idle on ground floor)

2) a "satisfaction function", giving a measure of performance of your system:

You can get low average waiting times and diverging maximum wait time for a busy elevator, simply trade time from a single passenger for others (by e.g. never going to a floor). As long as utilization is significant at all times, this phenomenon exists.

Clearly it's not only average we care about, but also maximum and minima of transit times.

---

It's a very illuminating modelling exercise.

Re: Elevator Saga: An elevator programming game (2015)

#85
post #51

What am I doing wrong? for(elevator of elevators) { elevator.on('idle', () => { //do some logic with elevator }) } It only seems to run for the second elevator rather than both of them?

Should be `for (let elevator of elevators)`

Oh my god you’re right, oops. I wouldn’t normally make that mistake but no IDE and coding at night apparently isn’t a good mix!

Re: Elevator Saga: An elevator programming game (2015)

#86
post #30
post #15

Made me remember an interesting anecdote: During my PhD at Purdue I had the good luck to take the Pattern Recognition (nowadays would be called ML) course from Prof. Fukunaga, one of the pioneers in the field ( https://en.m.wikipedia.org/wiki/Keinosuke_Fukunaga ). In one of his classes he mentioned that years ago a company came to him, requesting his expertise in optimizing movement of a bank of elevators. He thought…

I’ve always wondered if the main computer in Star Trek has to be so big just to manage the turbolifts. Three dimensional elevators with multiple exits per level, probably prioritizing routes dynamically based on the passengers and the military alert level. Imagine the algorithms.

I think it would fundamentally be a constraint based programming problem, eg the sudoku solvers, travelling salesman implementations, software that tells eg Amazon warehouses which parcels go in the van first based on both size and the route it’s planned so that the driver never had to dig all the parcels out to get the buried ones.

Re: Elevator Saga: An elevator programming game (2015)

#87
post #29

I always wished elevator buttons could toggle. If you accidentally press the wrong floor, just press it again to cancel. This may not work in all situations, but in some situations, it could be a time saver.

This is my top of the wish list feature as well! Then my 9yo son told me the feature exists, just double tap/press the desired floor button. I thought he was joking, but no! It works!! How he discovered it I will never know!

Re: Elevator Saga: An elevator programming game (2015)

#88
post #18

Earlier quoted context omitted.

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 gro…

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.

Re: Elevator Saga: An elevator programming game (2015)

#89
post #4

I don't remember the article but I remember reading about a building management game where the reviewer believed the entire game was based around the elevator management code and that writing that code was fun for the programmer but the game itself was not fun for the player. It looks like this highlights the "fun for the programmer" part.

Maybe Sim Tower? The game was pretty boring, but building and managing elevators to keep people happy was a fun challenge.

Sim Tower and Sim Ant were both great network-building games. They seemed boring until you really delved into the details. Maxis was really genius up until EA bought them. Here's a pretty cool project they did that never came to light...

https://www.gamesradar.com/simrefinery-the-lost-oil-plant-ga...

Re: Elevator Saga: An elevator programming game (2015)

#90
post #60

Call me weird, but I’ve been fascinated by elevator logic since I was a child. I had a math curiosities book that dedicated a chapter to it and after reading that I was hooked on knowing more. I wish my knowledge of JavaScript was more than “programming language that’s not Java” so I could actually play this. Could anyone recommend an online introduction to JS so I can attempt to play this? I’m more of a bash guy.

Also, to understand the asynchronous nature of Javascript, have a look at this excellent presentation and website:

http://latentflip.com/loupe/

Post reply on HN