[HN Gopher] Elevator Saga - An elevator programming game
       ___________________________________________________________________
        
       Elevator Saga - An elevator programming game
        
       Author : warpech
       Score  : 265 points
       Date   : 2021-06-12 20:08 UTC (1 days ago)
        
 (HTM) web link (play.elevatorsaga.com)
 (TXT) w3m dump (play.elevatorsaga.com)
        
       | jmchuster wrote:
       | If you like these programming games, localmotion has one where
       | you schedule taxis to pick up passengers between buildings.
       | 
       | https://www.getlocalmotion.com/code-challenge
        
       | petee wrote:
       | An advanced level of this game should have you implement your
       | logic with mechanical relays. Those relay banks are always
       | fascinating
        
       | spicybright wrote:
       | Are real elevators ever coded with logic like mentioned in this
       | thread? Or do they just keep it a simple as possible?
        
         | kens wrote:
         | 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?
        
         | bombcar wrote:
         | 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.
        
           | BuildTheRobots wrote:
           | >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 ;)
        
             | bombcar wrote:
             | Hopefully you don't have to spend the time again - but if
             | you do it's very easy to buy the fireman's key on eBay. You
             | didn't hear that here.
        
               | wolrah wrote:
               | Relevant video discussing fire keys and other common
               | keys: https://www.youtube.com/watch?v=a9b9IYqsb_U
               | 
               | And since this thread is about elevators, I have to also
               | mention another video of theirs:
               | https://www.youtube.com/watch?v=ZUvGfuLlZus
        
             | em-bee wrote:
             | our elevator allows undoing pressed buttons. if no buttons
             | are pressed, then the elevator will stop. now you could
             | play a game where you try to get the elevator to stop at a
             | particular floor without pressing that floors button. the
             | only downside is that our elevator does not open the doors
             | if no button is pressed, so any off-limit floors would
             | remain inaccessible
        
             | lucb1e wrote:
             | That's amazing. I'll be trying that trick next time I have
             | some time to kill in a building!
             | 
             | 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...
        
               | spicybright wrote:
               | I'm sure for surgery rooms (at least), needing someone to
               | rush in to help and having them fumble with ID cards
               | outweighs a bad party trying to, I guess, muck up a
               | surgery or something.
        
               | templeos3 wrote:
               | Very rarely do you have people rushing in to surgery
               | rooms. Despite TV dramas, most surgeries are not high
               | risk, most surgical patients are not critically ill, and
               | those that are tend to be pre-staffed for the risk. OR
               | rooms are not usually locked but the surgical suite sure
               | is. The bigger issue with the surgical suite is proper
               | attire. ICUs are a different matter (where coincidentally
               | I happen to be tonight). Generally all the staff you need
               | is already on the locked side of the unit.
        
               | bombcar wrote:
               | "Men are better than gates" - Gandalf - the real security
               | on the surgery rooms are those in them.
        
               | em-bee wrote:
               | in the hospitals that i have been for visits usually the
               | whole intensive care area and other sensitive areas were
               | access controlled. so while the door to the actual
               | surgery room might have been open, you are often not even
               | allowed anywhere near.
        
               | [deleted]
        
       | juloo wrote:
       | It's annoying that it doesn't highlight syntax errors. It's even
       | worse than that because it's intercepting the syntax error for
       | logging purpose and loses any informations. You get unrelated
       | errors in the app's code.
        
       | asiachick wrote:
       | 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.
        
         | SaberTail wrote:
         | 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...
        
         | aidenn0 wrote:
         | Maybe Sim Tower? The game was pretty boring, but building and
         | managing elevators to keep people happy was a fun challenge.
        
           | noduerme wrote:
           | 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...
        
       | sleepy_keita wrote:
       | I've always been fascinated with elevator algorithms. This is
       | awesome!
        
       | gnramires wrote:
       | 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's fun to consider a minimal energy solution (it takes a very
       | long time to get anywhere ;) ).
        
         | gnramires wrote:
         | 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.
        
       | muddywater wrote:
       | We're building an API to monitor elevators and stuff inside
       | buildings. There are smart and dumb elevators. In any case, no
       | one is actively using the data yet to improve our experiences
       | like mentioned on this thread...sometimes we just wish we knew
       | when to take the stairs.
       | 
       | 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.
        
         | petee wrote:
         | Most hotels I've stayed at seem to be significantly limited on
         | speed; anything <=5 floors is almost always faster to just head
         | for the stairs and not even bother waiting. After a week, it's
         | 6 floors.
        
       | adenozine wrote:
       | I used to interview programmers with an elevator programming
       | problem. Neat to see it expanded so excellently and cleanly in
       | this piece. Well done!
        
         | grensley wrote:
         | I really like just asking "how do elevators work"?
         | 
         | 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.
        
         | alasdair_ wrote:
         | 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.
        
           | adenozine wrote:
           | 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?
        
             | em-bee wrote:
             | the problem is having particular expectations at the
             | outcome, which is wrong. even after hiring, if i have a
             | particular expectation how problems are to be solved, then
             | that will lead to disappointment, micromanagement and
             | disempowerment of my developers. i did use elevatorsaga in
             | interviews with good results. having someone making such an
             | unusual suggestion in an interview would be a plus for me.
             | this person is thinking out of the box. and it would lead
             | to a discussion of the difference of optimizing solutions
             | for overall performance vs user expectations.
        
             | alasdair_ wrote:
             | I didn't. I tried again later in my career but ended up
             | taking up Facebook's offer before the final Google round.
        
           | bombcar wrote:
           | That's an example of a thing that may work well but would
           | piss users off - it apparently reversing would annoy.
        
             | Thorrez wrote:
             | Not just annoy. Some users might think they accidentally
             | got on the wrong elevator ("oops, I got on a down elevator
             | instead of an up elevator") and leave the elevator at the
             | next floor to ask for a new elevator.
        
           | [deleted]
        
       | curmudgeon22 wrote:
       | 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.
        
         | asdfasgasdgasdg wrote:
         | Elevator could also make a decent guess at fullness just by
         | recording the discrete changes in weight. It wouldn't be
         | perfect but again it would probably be better than allowing
         | user input.
        
           | em-bee wrote:
           | i believe all elevators at least have a failsafe to refuse to
           | run if they are overloaded. going from there to tracking and
           | using the actual weight for its programming is not a big step
        
             | kqr wrote:
             | Oh, elevators know to some accuracy how many people-mass
             | things are in it. It just rarely has reason to use that
             | information.
        
         | joshka wrote:
         | Would a first order approximation of "full" be "has two
         | destinations"
        
           | nextlevelwizard wrote:
           | You could but if passengers knew that it would result into
           | single passengers pressing two car calls so they could get
           | private elevator ride. Rather you would just use the normal
           | passenger counting system i.e. correlating weight scale with
           | photocell cuts.
        
         | nextlevelwizard wrote:
         | I mean you aren't wrong, but also this is all logic tha has
         | existed in elevators for decades, but if your building owner
         | just slaps a piece of paper artificially creating a limit the
         | elevator system won't be aware of it. On other hand they could
         | have made an configuration order and paid to change the
         | behavior of the elevator, to reduce its capacity. Then it
         | wouldn't make extra stops since it would know that it is at max
         | capacity.
        
         | webmaven wrote:
         | _> Ability to set elevator as  "full". Even if abused by a
         | single person, still better than multiple wasted stops._
         | 
         | 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.
        
         | mortehu wrote:
         | Another failure: when there's a line, and you already know
         | you'll need multiple cars, the elevator button will still only
         | allow you to call one car at a time. Even if several cars are
         | already on your level with the doors closed.
        
         | geofft wrote:
         | During COVID I think it's totally reasonable for any person to
         | be able to set the elevator as "full" - if you're returning
         | from travel and quarantining, immunocompromised, etc. you might
         | not want to travel with anyone.
         | 
         | Also,
         | 
         | * Elevator door closes when it's not in use - may as well stay
         | open, get some ventilation, and use slightly less energy!
        
           | canada_dry wrote:
           | > any person to be able to set the elevator as "full"
           | 
           | 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.
        
       | Daneel_ wrote:
       | 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.
        
         | 7373737373 wrote:
         | Also, to understand the asynchronous nature of Javascript, have
         | a look at this excellent presentation and website:
         | 
         | http://latentflip.com/loupe/
        
         | petee wrote:
         | https://www.codecademy.com
         | 
         | I didn't finish, but I recall enjoying their intro to JS, and
         | managed to write a few working things hah
        
         | GreenWatermelon wrote:
         | If you know your way around any programming language, then hop
         | on (https://learnxinyminutes.com) to quickly get the hang of
         | any other language.
        
       | Aeolun wrote:
       | Oh, this reminds me of the elevator banks in my office. I'm sure
       | there's something going on there. It can let me know which of 8
       | elevators is coming to pick me up as soon as I press the button.
        
       | dang wrote:
       | 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)
        
         | larschdk wrote:
         | 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.
        
       | ziptron wrote:
       | 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.
        
         | larschdk wrote:
         | 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.
        
         | em-bee wrote:
         | our elevator does that, and i noticed it is quite common in
         | chinese elevators. i can undo all destinations which makes the
         | elevator just stop.
         | 
         | 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
        
           | [deleted]
        
         | mcrae wrote:
         | It works this way often in (north-east) Asia. Double-tap a
         | selected floor and it unselects. Brilliant.
        
           | thesnide wrote:
           | Yep. My office one does that. I first it was a joke, but it
           | actually is indeed a brilliant scheme to avoid misclicks.
           | 
           | And as you seldom unselect, it's Huffman coding for the win
           | ;-)
        
         | nextlevelwizard wrote:
         | the thing is that elevators are these days way more complex
         | than anybody would even imagine, but the thing also is that
         | there are no tutorials given to people who use them. Also extra
         | features cost extra money and building owners usually just want
         | the very basic stuff for residentals.
        
         | joshribakoff wrote:
         | Many modern ones in high rise buildings require you to scan a
         | key fob and/or enter the desired floor number, then it tells
         | you which elevator to go wait at. The ones with the key fob
         | often replace your previous selection automatically.
         | 
         | There are not buttons in this style of elevator other than door
         | open door close and call for help.
        
           | tshaddox wrote:
           | In an office building near me, the security person at
           | reception enters a destination floor and tells you which
           | elevator to step into. There are no controls outside or in
           | the elevator (other than emergency stuff).
        
         | rovek wrote:
         | I always try this if I accidentally press a button, or enter an
         | empty lift with a few buttons pressed. One glorious day in a
         | hotel in Penang, I double-pressed a button and my dreams came
         | true, lights out. That one experience will be enough to keep my
         | dreams alive for decades to come
        
         | vishnugupta wrote:
         | 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!
        
       | voldemort1968 wrote:
       | I was thinking of creating this very thing on several occasions
       | being in an elevator. The logic of elevators is very intriguing
       | and more complicated than people realize.
        
         | 7373737373 wrote:
         | I'm not sure if this is true. I think all elevators I've
         | encountered followed the elevator/SCAN algorithm:
         | 
         | > 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
         | 
         | https://en.wikipedia.org/wiki/Elevator_algorithm
        
           | dialogbox wrote:
           | That is true only for the single elevator system. If there
           | are multiple elevators, the system could be extremely
           | complicated.
        
           | falldmg wrote:
           | Have you ever seen elevators where you select a floor from
           | the outside and it gets assigned to one of multiple
           | elevators? Those seem like they might be doing something more
           | sophisticated.
        
             | disposedtrolley wrote:
             | 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
             | 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.
             | 
             | https://en.wikipedia.org/wiki/Destination_dispatch
        
               | bombcar wrote:
               | 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.
        
               | jchw wrote:
               | 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.
        
               | bombcar wrote:
               | Continued small motion in a long single queue feels
               | "fairer" than multiple queues - and may actually be.
               | 
               | 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.
        
           | nextlevelwizard wrote:
           | This works if you have only a single elevator, but if you
           | have a group of elevators that work together and serve same
           | set of floors you can start optimizing the trips for example
           | journey time vs wait time.
        
       | SMAAART wrote:
       | elevator.goToFloor(1); elevator.goToFloor(2);
       | elevator.goToFloor(0);
        
         | Jtsummers wrote:
         | That (or a slight variation) works for the first couple of
         | levels. Then it gets harder.
        
           | SamBam wrote:
           | I was happy that my solution for level 4 was also accepted
           | for level 5 and 6. Only a small tweak was needed for level 7,
           | as now moves were counted instead of time.
           | 
           | 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.
        
       | SMAAART wrote:
       | elevator.goToFloor(0);                 elevator.goToFloor(1);
       | elevator.goToFloor(2);                 elevator.goToFloor(3);
       | elevator.goToFloor(4);
        
       | TheRealNGenius wrote:
       | Ah disk scheduling algorithms :)
       | https://en.wikipedia.org/wiki/Elevator_algorithm
        
       | lloydatkinson wrote:
       | 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?
        
         | umvi wrote:
         | Should be `for (let elevator of elevators)`
        
           | lloydatkinson wrote:
           | 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!
        
         | emiphil wrote:
         | for (elevator ... Like that is making a new global variable
         | called elevator which is getting overwritten on the next loop.
         | You need to for(const elevator... (or let).
         | 
         | The other thread is the same answer but for a slightly
         | different case
        
         | mercora wrote:
         | i likely ran into the same or a related issue. i dont know much
         | about javascript though.                       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 ...
        
           | garaetjjte wrote:
           | I think this was discussed there:
           | https://news.ycombinator.com/item?id=8933979
        
             | mercora wrote:
             | this did indeed help understanding and fixing the issue.
        
               | davnicwil wrote:
               | Just in case this is interesting, a potentially more
               | elegant way to solve this with modern JS is to use
               | 'for(let i' instead of 'for(var i'.
               | 
               | 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!
        
         | pazqo wrote:
         | You should be able to accomplish the same with
         | elevators.forEach((elevator) => {})
        
       | Jun8 wrote:
       | 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 it would be trivial :-) After telling us
       | that all his approaches failed miserably, he had one of his
       | impish laughs and told us that he never worked on that problem
       | again. Miss that guy. Get a copy of his book
       | (https://books.google.com/books/about/Introduction_to_Statist...)
       | if you can, it's written in the "old style" but very informative.
       | 
       | Interesting fact: Gen Fukunaga
       | (https://en.m.wikipedia.org/wiki/Gen_Fukunaga), founder of anime
       | company Funimation, is his son.
        
         | clarkmoody wrote:
         | I pounded my head on this problem in a multi-agent system
         | course in graduate school. Needless to say, I could not
         | outperform a simple naive algorithm however hard I tried.
        
         | labster wrote:
         | 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.
        
           | lloydatkinson wrote:
           | 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.
        
         | abhgh wrote:
         | 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
         | watching themselves and others while waiting.
        
           | jyriand wrote:
           | Reminds me a parable from Are your lights on by Gerald
           | Weinberg.
        
           | b0afc375b5 wrote:
           | I first heard of this from Dr. Russell Ackoff's Systems
           | Thinking Speech. I had a mini mind blown moment.
        
         | changoplatanero wrote:
         | In my ML class some students did a project on using
         | reinforcement learning to optimize elevators. They told me that
         | after 100 years of operation the algorithm would have enough
         | data to start working really well.
        
         | MobileVet wrote:
         | Boiler Up!
         | 
         | I had Prof Fukunaga for EE301 I think (Might have been EE202).
         | I was too young and dumb to recognize his brilliance.
        
           | aidenn0 wrote:
           | I started in physics before switching to CS. I'm glad the ECE
           | department is good, because the CS department was terrible.
        
           | Jun8 wrote:
           | Awesome, it's a small world. I was his teaching assistant
           | during the times he taught EE301 (Signals & Systems) so
           | chances are I've corrected your exams!
        
       ___________________________________________________________________
       (page generated 2021-06-13 23:02 UTC)