Elevator Saga: An elevator programming game (2015)
play.elevatorsaga.com
play.elevatorsaga.com
Interesting fact: Gen Fukunaga (https://en.m.wikipedia.org/wiki/Gen_Fukunaga), founder of anime company Funimation, is his son.
I had Prof Fukunaga for EE301 I think (Might have been EE202). I was too young and dumb to recognize his brilliance.
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.
Also,
* Elevator door closes when it's not in use - may as well stay open, get some ventilation, and use slightly less energy!
Sadly, in an apartment building there are several people who are selfish. These types would use the feature to monopolize the elevator for moving.
> door closes - stay open?
Prob to reduce the time to travel to a floor. If the doors were open it would add another 15secs in addition to the travel time to reach the called floor.
I'd add a couple of sensors (one for volume and one for weight) to let the elevator itself determine how full it is and act accordingly.
I would also still have a "full" button for people to press, but not have the button actually do anything, except maybe light up.
And as you seldom unselect, it's Huffman coding for the win ;-)
living on the top floor of a highrise, i was occasionally able to use that when i realized that i forgot something at home (although most times it takes me longer to realize that than the elevator needs to make it all the way down)
it is also very useful when the kids are naughty and press all the buttons for fun
There are not buttons in this style of elevator other than door open door close and call for help.
Used correctly, it can massively improve the elevator usage experience. Used incorrectly, it ends up being worse than a "indicate travel direction" system.
Having used it in 3 (I think) buildings with this system, it was definitely used correctly in one, definitely NOT used correctly in another and in the third, I was mostly present sufficiently outside normal working hours that I cannot with certainty state how it was used.
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)
https://github.com/magwo/elevatorsaga
along with some pull requests which might fix those problems.
On the repo it says:
"For developers/contributors: This project is not actively maintained. The repo is used to serve github pages so I would like to keep it as is. Feel free to fork and host your own versions of Elevator Saga! But I would like to keep the domain name with the original version of the game."
I am sure someone on here has the chops to set up a clone of it.
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.
I didn't finish, but I recall enjoying their intro to JS, and managed to write a few working things hah
It looks like this highlights the "fun for the programmer" part.
https://www.gamesradar.com/simrefinery-the-lost-oil-plant-ga...
[1] https://archive.org/details/SimTower_-_Manual_-_PC/page/n7/m...
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's fun to consider a minimal energy solution (it takes a very long time to get anywhere ;) ).
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.
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 ;)
We also play the game sometimes of getting places we're not supposed to (as consultants). Walk around like you're from IT and are supposed to be there (technically both true), perhaps with a laptop under your arm, nobody will care what you do to any of the computers there. In schools and hospitals, and probably other places, try (variants of) the city you're in as password, perhaps combined with the postal code, and you usually get access to everything because of course the staff needs to actually help you. The username is pre-filled, don't worry about that (most of the time that's the field with more entropy).
It's honestly terrifying and short of locking rooms (because some of the personnel needs fast access to computers, preferably faster than plugging in and out smartcards all day long) there just isn't really a solution. I'm pretty sure we could have walked into a surgery room, we steered clear of any place that looked like it might head us into places with patients under actual operation. Why those aren't locked I don't know, probably there is a good reason so probably they can't change that...
And since this thread is about elevators, I have to also mention another video of theirs: https://www.youtube.com/watch?v=ZUvGfuLlZus
> 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
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.
Same thing happens with traffic lights.
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.
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? for(var i = 0; i < elevators.length; i++) {
elevators[i].on("idle", function() {
for(var j = 0; j < floors.length; j++) {
elevators[i].goToFloor(j);
}
})
}
it only works for "i < 1" and then only the second elevator moves... its kinda sad as i immediately enjoyed playing ...The reason is that 'let' gives 'i' 'block scope', meaning that each iteration of the loop block gets its own scope so that 'i' isn't overwritten each time, and each function you declare captures the value of 'i' at the time it was declared.
In other words - the way you originally expected 'var' to behave is how 'let' behaves!
The other thread is the same answer but for a slightly different case
If you're curious to view the kind of data streaming from a building or basic elevator, see here: (https://onboarddata.io/), python SDK is on Github (https://github.com/onboard-data/client-py). Every building is different. Some elevators have data on flooding, weight, inspection, electricity usage, while others do not.
elevator.goToFloor(0);
elevator.goToFloor(1);
elevator.goToFloor(2);
elevator.goToFloor(3);
elevator.goToFloor(4);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.
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?
It's so open ended and they can talk about anything from the algorithm, to the mechanical design of elevators, to the UI, to a high-level discussion of all the different components.
Really lets you know quickly which parts of systems candidates are interested in.
The next level required no passenger to wait longer that a certain amount of time, and I would have had to trash half my program, so I quit for now.