No, especially not in practice. I would never proclaim to have such a belief unless it was my job to do so. Even then, I wouldn't be convinced I was doing a good job of it. The amount of unforeseen complexity in most systems is no joke.
So You Think You Can Program an Elevator
91–100 of 118 posts
Re: So You Think You Can Program an Elevator
#92This is both cool and disappointing. I'm sure this is more challenging than it looks, and it's cool to see emergent complexity from a (seemingly) simply set of conditions to satisfy. However, the reason I think about elevator programming isn't to make an elevator behave the way they do today. It's to make an elevator behave better than they do today. For example: * I don't want an elevator to close and reopen its doo…
So yes I think I could program an elevator. And yes I think I could do it better than the shit it currently is.
Grumble grumble
Re: So You Think You Can Program an Elevator
#93Earlier quoted context omitted.
Don't go for a FSM. GKRuleSystem[0] to the rescue! Or any other Fuzzy Logic(?) framework. Or maybe a behaviour tree, which is how I would have (tried) to design it with. I hope I get something like this on an interview, instead of "reverse binary tree" like questions. This actually seems like a fun problem to solve. Knowing my defect brain, it would put a lot of effort into this because it's kinda fun. Also because I…
Not sure why I am being downvoted here. A FSM would make things very hard to read compared to a BT. The fact that you would have to use a stack to pop events shows that it might not be the best suited use.
In any case, a well designed FSM would get you a long way. Since the input (pressed buttons) is finite, you can cover every single case and weight according to importance of floor and wait time.
Re: So You Think You Can Program an Elevator
#94Re: So You Think You Can Program an Elevator
#95Re: So You Think You Can Program an Elevator
#96Earlier quoted context omitted.
Elevators enable skyscrapers. As you build taller skyscrapers, more and more of the floor space is given over to elevators. There must be a huge incentive to improve elevator routing. I'd love to peek behind that curtain.
I think they use machine learning now.
> This is because they operate on the curious principle of “defocused temporal perception.” In other words they have the capacity to see dimly into the immediate future, which enables the elevator to be on the right floor to pick you up even before you knew you wanted it, thus eliminating all the tedious chatting, relaxing and making friends that people were previously forced to do while waiting for elevators.
> Not unnaturally, many elevators imbued with intelligence and precognition became terribly frustrated with the mindless business of going up and down, up and down, experimented briefly with the notion of going sideways, as a sort of existential protest, demanded participation in the decision-making process and finally took to squatting in basements sulking.
> An impoverished hitchhiker visiting any planets in the Sirius star system these days can pick up easy money working as a counselor for neurotic elevators.
The Hitchhiker's Guide to the Galaxy by Douglas Adams
Re: So You Think You Can Program an Elevator
#97They've removed the elevator buttons inside the carriage at my work; now one can only select a single floor from outside the elevator.
Re: So You Think You Can Program an Elevator
#98Re: So You Think You Can Program an Elevator
#99Very similar immediately playable JavaScript version. http://play.elevatorsaga.com/ Which I'm now closing as I lost too much time to this the first time I saw it.
This is fantastic. Are there other good programming challenge / games like this? I'd love to see a collection of other similar games.
It's the best one for doing challenges that use actual test cases. This challenge could easily be ported to that site (and I think there already are a few elevator ones)
Re: So You Think You Can Program an Elevator
#100Very similar immediately playable JavaScript version. http://play.elevatorsaga.com/ Which I'm now closing as I lost too much time to this the first time I saw it.
Somehow I find this API counter-intuitive and painful to use. - Why currentFloor() is a function not a property? - Why both goingUpIndicator() and goingDownIndicator() instead of .direction property? - Why name destinationDirection() instead of currentDirection? - Why only floor_button_pressed but no in-door button press event? I gave up.
Hilariously i missed the apply button on the first try, and wondered why it was still only moving between 0 and 1 after adding a few lines.
The site design could do with a tuneup as well. The actual page seems to only fit on widescreen, while the docs page becomes painful to read on same.