Live data from Hacker News

Elevator Saga: An elevator programming game (2015)

play.elevatorsaga.com

21–30 of 103 posts

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

#21
post #17

Earlier quoted context omitted.

i likely ran into the same or a related issue. i dont know much about javascript though. for(var i = 0; i it only works for "i < 1" and then only the second elevator moves... its kinda sad as i immediately enjoyed playing ...

I think this was discussed there: https://news.ycombinator.com/item?id=8933979

this did indeed help understanding and fixing the issue.

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

#22

Are real elevators ever coded with logic like mentioned in this thread? Or do they just keep it a simple as possible?

The logic to pick up passengers is the easy part of a real elevator. Some harder problems: a) Physics. How to drive the motors to move smoothly and efficiently to the desired floor and stop level with the landing. b) Safety and regulatory. There are lots of safety features that need to be implemented, e.g. control by fire fighters. c) Customization. There are lots of special cases, either for customer desires or laws in different states. d) Networking. How do you get the signals from the hall call buttons to the controller and from the controller to the hall lanterns? Tons of wires or a protocol? e) Diagnostics and failure handling. What do you do if something goes wrong? What do you log for maintenance?

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

#23

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.

As aidenn0 said, this sounds like SimTower and its sequel Yoot Tower. There's a section of the manual[1] called "A Message From Yoot Saito, Creator of Sim Tower" that describes how he started creating it because he was curious about elevator programming.

[1] https://archive.org/details/SimTower_-_Manual_-_PC/page/n7/m...

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

#24

I used to interview programmers with an elevator programming problem. Neat to see it expanded so excellently and cleanly in this piece. Well done!

I had this question during a Google interview. The interviewer became annoyed when I suggested that an elevator that sometimes went backwards to pick ip someone on a just-missed floor could at least be interesting, if not perfectly efficient. They had a preconceived idea that they wanted a stateless system and didn’t like my stateful approach, even if it was potentially better for end users.

Yeah, that's one reason I stopped doing like code-this-thing style of interviews. There's no point in contriving problems for someone, we could both be working on something useful. I think for me at least, the main attribute I look for in a candidate for a developer role is the ability-to-avoid-shitty-solutions-ness of someone. If they steer themselves from bad ideas well, the rest can be taught by presentation and practice with the rest of the team.

I've had a similar idea around measuring how many riders make calls over say the past 100 rides, and then trying to calculate how efficient it might be to deviate a few floors either direction to grab someone close-by. It's an interesting hole to climb into.

Did you get the gig at google?

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

#26
post #13

Are real elevators ever coded with logic like mentioned in this thread? Or do they just keep it a simple as possible?

They can be. Express elevators and such. But mainly the programs are limited to what floor the elevators idle at because more complicated programs even if more efficient overall often piss people off.

>which floors the elevators idle at...

I recently spent 4 months in hospital which left me with an amount of time to kill in an attempt to stay sane. One of the games was trying to get places I was technically allowed but really shouldn't have been ("sod your 'no public access' signs, in not public, I'm an inpatient!"). Being confined to a wheelchair made the game a bit more difficult. One day one of the ward staff mentioned that the building used to have a 4th floor which got mothballed years ago. None of the elevators had a button for it and trying to get up a flight of stairs wasn't an option. After puzzling for a while, I finally realised that one of the elevators was still set to idle on the 4th floor. Get in the elevator, don't press any buttons, read a book for 10 minutes and bam - elevator returns itself to the 4th floor, opens the doors and goes ping. I wheel myself out to find I'm not just on the 4th floor, but also behind (on the inside of) the locked doors at the top of the stairs, which I counted as a double win ;)

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

#27
During Covid, I've often wished I could reprogram the elevator of the apartment building I live in. The current rule is only 2 people can be in the elevator at a time.

Problems that arise:

* Elevator stopping frequently, but already at capacity, slowing down overall performance

* Elevator always goes to bottom (or top) first to pick up passengers going up (or down). This means if your waiting on the ground floor and it's a busy time, folks at the parking levels will repeatedly get picked up before you.

Possible solutions:

* First come, first served (need to remember order of what floor pushed button when)

* Ability to set elevator as "full". Even if abused by a single person, still better than multiple wasted stops.

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

#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.
Post reply on HN