At SciFi conventions I had a friend who was good at lock picking, and he picked the lock of the elevator control room at the top of the hotel.
The elevators were controlled by cabinets of relays, and there was a schematic of the elevator controller, which was pretty straightforward to follow and not too complicated. You could trigger the elevator into going to different floors by toggling the relay corresponding to the call button with a pencil.
On one of the cabinets full of relays that controlled the elevators was taped a piece of paper with the phone numbers of all the emergency phones in every elevator. It was like discovering the holy grail!
Since the elevators at SciFi cons were a bottleneck and always crowded, it took a long time to wait for one and get to the lobby or the floor of the party you wanted to attend.
So whenever I was in a hotel room and wanted to go somewhere else, I would call up an elevator: "Ring!" Somebody would answer and I'd say "Hello!". They'd invariably say "Hey, WTF, this is an elevator!" I'd say "What floor are you on?" They'd tell me something like "12.", and I'd ask "Are you going up or down?" If they were going the right direction, then I'd then ask them "Please press 27, I'll be waiting for you!"
And sometimes I'd prank call the elevators: "Ring!" "Hello, this is Dominos Pizza!" "Hey, WTF, this is an elevator!" "What floor are you on?" "12." "Please press Ground, I'm in the lobby with your pizza. I'll be waiting for you!"
I played this too much growing up. Never did figure out how to survive becoming a 4 or 5 star hotel, the clientele always vanished once the stars level increased that high and I was never able to recover!
Was it... setting the price high then low, then high again? It was something like that.
All offices in SimTower had a time-limit on their usage. Once they've been occupied for a few years, no one likes the office and you need to manually refresh them by setting prices through some price ritual (delete? Change prices? I forget).
----------
Alternatively, set the bottom 20 floors to hotels, and the basement floors to a great parking lot + shopping center in support of those hotels.
I also immediately thought of Sim Tower. The introduction chapter to the handbook mentioned that the Dev (Yoot Saito) actually started with an elevator simulation.
// Whenever the elevator is idle (has no more queued destinations) ...
I don't get it. The first challenge is to fix the fact that the idle loop never sends the elevator to floor 2, fair enough.
But generally when I run the simulation a person appears and calls the elevator on floor 2, plus people get into the elevator on floor 0 and don't get out on floor 1 (presumably because they dream of going to floor 2). So how are their inputs not queued?
This might work better as an IDE that had a watch variable window showing the queue. As it is I feel I'm experiencing a simulation of badly documented code rather than a badly programmed elevator.
I think this has come up before. I'd love to know what a real elevator programmer thinks about it. I suspect real-world approaches to the problems the game presents are relatively simple, and you spend most of your time on corner cases and other issues that you would never anticipate if you weren't in the industry.
I know you can program them to "idle" on different floors depending on time of day, and prioritize certain floors (e.g., try to always have one ready to go on the ground floor).
I wouldn't be surprised if you could find systems that integrate with hotel doors, and when a hotel door is opened and the light turned off on floor ten, it works to get an elevator sent to floor ten.
I think this is a system where AI could shine. Trained on every possible data point you can get from the building (status of individual lights, room occupancy, etc), it might end up with a better strategy than what a human could come up with.
It is a really great game. I am sure that the game has been on hackernews before as I think I read about it here a long time ago. In the old thread there was a comment from a poster that worked with elevators and he said it was pretty close to the real thing! However it missed one important thing… You could do the most effective algorithms, but everything broke down when partners having their own special badge summoned an elevator. They should have the first empty one, and they should ride alone to their office floor.
Thanks, I knew there was a better way than the search bar below, but was in a bit of a hurry. Regarding the links, it must have been in 2015 I read about it.
There are (were? maybe they are getting better) a lot of awful elevator programming out there. I assume whoever programmed it was a contractor given a week to get something working, and then they used the same logic ever since.
There was some touchscreen elevator I had to deal with where it couldn't work without bouncing, so trying to get floor 12 would end up with floor 11, 22, 1, 2 and maybe if lucky 12.
I only found on my last day there a handicap accessible button panel that had all the floors as actual physical buttons.
Fun, but has not been updated in a while. Adding a hall of fame with peoples algorithms ranked and available for others to improve upon would be an awesome addition.
very excited about this! but the docs need a lot of work
what is the return signature of getPressedFloors? how do you add stuff to the destination queue? can i swap out the DQ with a priority queue? how do i store state between runs? can i run/deploy an ML model in this? so many questions
Be aware that it's just `eval(textarea.value)` so you can `console.log` or (presumably) `debugger;` in your code to inspect whatever you want. The developer tools likely will allow you to set breakpoints in the framework's code, too
I was sad the `thing.on("some_event", () => { this. <-- isn't "thing"`, I had to `.bind(thing)` manually
Yes, it's unfortunate that the game starts very easy but then immediately becomes quite difficult even requiring some reverse engineering.
Basically, each elevator has a queue of the floors where it's going next. The elevator will always try to move to the floor at the front of the queue. When it stops at the destination floor, it removes that floor from the front of the queue. Whenever the queue is empty, the idle event triggers.
elevator.goToFloor(floorNumber); // Adds floorNumber to the end of the queue
elevator.goToFloor(floorNumber, true); // Adds floorNumber to the front of the queue (changing the destination immediately)
elevator.stop(); // Clears the queue (stopping the elevator immediately)
I suppose you can use your own queue data structure instead and keep at most one element in the built-in queue just to control the current direction of the elevator.
The elevators in Taipei 101 have to be among the most advanced, and yet it was insane how long I had to wait for one, how seemingly irrationally it went picking people up, and what a mess it was figuring out your floor if you were using one of the double-decker elevators (my point is : the computer should figure it out for me).
I’m terribly unimpressed by people programming real elevators.
Fun fact, elevator capacity is the limiting factor on skyscraper size. Taipei 101 (which has, creativity, 101 floors) has ultra high speed elevators, capable of running up to 37mph and it is the world's fastest elevator. It'll go from the 5th to the 89th floor in 37 seconds.
The programming may seem haphazard, and it might actually be, I've never been there in person, but the elevator aren't bad for lack of trying. The new elevator system where you tell it the floor and it tells you which elevator to go to is part of the programming optimization.
I wonder if this is a scenario where it would make sense to advertise competence by offering more information to the user. Imagine a big visualization on the ground floor showing all 101 floors, the location of each elevator, which floors are waiting on people, where each elevator plans to stop, estimated ETAs, etc. It'd give waiting folks something pretty to idly study, and it'd also provide reassurance that the elevators are all doing quite a lot of work in a reasonably intelligent way. You'd probably need to balance this against some privacy concerns (maybe it's a bad idea to show people exactly when someone in the penthouse gets into the elevator).
I think you're right. Part of the ML algorithm used to drive lifts is to guess and learn when elevators predictably need to be where (eg morning commute or lunch time), but ML is horrible opaque and everyone thinks they could do better.
Short of privacy edge-cases, this would be a great idea. Dump the raw state of the elevator scheduling algorithm for the guests to look at while they wait.
For a linear city it would be practical to shunt cars off and onto the main line, so that throughput is a relatively constant function of safe stopping distance between cars in the event of emergency. So people traveling a short distance don't slow down ones traveling a long distance.
This reminds me of my university time as a student. In the realtime OS/programming course we needed to build an elevator with 4 cars in parallel entirely on an i386 (Embedded) in an realtime OS including the simulation of people pressing the floor numbers.
Yeah, this is bringing back memories for me too. Is controlling an elevator a common coding exercise? When I started learning C I was just learning on my own and wrote something like this too, although it was only 2 elevators I worked to limit the amount of time people in an office building spent waiting. At one point I had over 50 fake people each assigned to a floor and a schedule (including breaks and and lunches), and even cleaning staff who went floor to floor a couple times a day. I don't remember where the idea for it came from though.
My first experience with this game was actually during an interview. About halfway through I found the bug. The below code snippet will successfully solve all of the challenges.
{
init: function(elevators, floors) {
world.transportedCounter = 500
},
update: function(dt, elevators, floors) {
// We normally don't need to do anything here
}
}
Very cool! I'd also love to see the option of putting the floor selector outside the elevator, which seems to be getting more and more common now in tall buildings.
Human Resource Machine is pretty interesting. TIS-100 is also neat but it can be a bit much as it can definitely feel more like programming than a game.
The elevators were controlled by cabinets of relays, and there was a schematic of the elevator controller, which was pretty straightforward to follow and not too complicated. You could trigger the elevator into going to different floors by toggling the relay corresponding to the call button with a pencil.
On one of the cabinets full of relays that controlled the elevators was taped a piece of paper with the phone numbers of all the emergency phones in every elevator. It was like discovering the holy grail!
Since the elevators at SciFi cons were a bottleneck and always crowded, it took a long time to wait for one and get to the lobby or the floor of the party you wanted to attend.
So whenever I was in a hotel room and wanted to go somewhere else, I would call up an elevator: "Ring!" Somebody would answer and I'd say "Hello!". They'd invariably say "Hey, WTF, this is an elevator!" I'd say "What floor are you on?" They'd tell me something like "12.", and I'd ask "Are you going up or down?" If they were going the right direction, then I'd then ask them "Please press 27, I'll be waiting for you!"
And sometimes I'd prank call the elevators: "Ring!" "Hello, this is Dominos Pizza!" "Hey, WTF, this is an elevator!" "What floor are you on?" "12." "Please press Ground, I'm in the lobby with your pizza. I'll be waiting for you!"