TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Elevator Saga: An elevator programming game (2015)

278 点作者 warpech将近 4 年前

21 条评论

Jun8将近 4 年前
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 (<a href="https:&#x2F;&#x2F;en.m.wikipedia.org&#x2F;wiki&#x2F;Keinosuke_Fukunaga" rel="nofollow">https:&#x2F;&#x2F;en.m.wikipedia.org&#x2F;wiki&#x2F;Keinosuke_Fukunaga</a>). 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 (<a href="https:&#x2F;&#x2F;books.google.com&#x2F;books&#x2F;about&#x2F;Introduction_to_Statistical_Pattern_Reco.html?id=BIJZTGjTxBgC&amp;printsec=frontcover&amp;source=kp_read_button&amp;newbks=1&amp;newbks_redir=0&amp;gboemv=1" rel="nofollow">https:&#x2F;&#x2F;books.google.com&#x2F;books&#x2F;about&#x2F;Introduction_to_Statist...</a>) if you can, it’s written in the “old style” but very informative.<p>Interesting fact: Gen Fukunaga (<a href="https:&#x2F;&#x2F;en.m.wikipedia.org&#x2F;wiki&#x2F;Gen_Fukunaga" rel="nofollow">https:&#x2F;&#x2F;en.m.wikipedia.org&#x2F;wiki&#x2F;Gen_Fukunaga</a>), founder of anime company Funimation, is his son.
评论 #27489234 未加载
评论 #27488447 未加载
评论 #27488980 未加载
评论 #27488756 未加载
评论 #27489966 未加载
curmudgeon22将近 4 年前
During Covid, I&#x27;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.<p>Problems that arise:<p>* Elevator stopping frequently, but already at capacity, slowing down overall performance<p>* 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&#x27;s a busy time, folks at the parking levels will repeatedly get picked up before you.<p>Possible solutions:<p>* First come, first served (need to remember order of what floor pushed button when)<p>* Ability to set elevator as &quot;full&quot;. Even if abused by a single person, still better than multiple wasted stops.
评论 #27489885 未加载
评论 #27488558 未加载
评论 #27489225 未加载
评论 #27489465 未加载
评论 #27488760 未加载
评论 #27513032 未加载
评论 #27489880 未加载
ziptron将近 4 年前
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.
评论 #27490951 未加载
评论 #27489122 未加载
评论 #27488581 未加载
评论 #27488808 未加载
评论 #27490747 未加载
评论 #27490560 未加载
评论 #27489873 未加载
dang将近 4 年前
One past discussion, plus a one-commenter:<p><i>Elevator Saga: The Elevator Programming Game</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=21425054" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=21425054</a> - Nov 2019 (1 comment)<p><i>Elevator Saga – An elevator programming game</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=8929314" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=8929314</a> - Jan 2015 (104 comments)
评论 #27490591 未加载
TheRealNGenius将近 4 年前
Ah disk scheduling algorithms :) <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Elevator_algorithm" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Elevator_algorithm</a>
Daneel_将近 4 年前
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.<p>I wish my knowledge of JavaScript was more than “programming language that’s not Java” so I could actually play this.<p>Could anyone recommend an online introduction to JS so I can attempt to play this?<p>I’m more of a bash guy.
评论 #27489515 未加载
评论 #27490891 未加载
评论 #27495656 未加载
asiachick将近 4 年前
I don&#x27;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.<p>It looks like this highlights the &quot;fun for the programmer&quot; part.
评论 #27488340 未加载
评论 #27487625 未加载
gnramires将近 4 年前
An interesting improvement over naive operation I thought long ago: idle elevators should go to 1&#x2F;2 maximum floor! You easily cut average wait times in 1&#x2F;2!<p>Problem is, it&#x27;s also energy inefficient. If you get a passenger at floor 1 or 0, you&#x27;ve wasted a lot of movement. On-demand movement wastes minimally.<p>So I&#x27;ve learned of a tradeoff between energy and waiting time -- not just elevator speed, but in algorithms.<p>It&#x27;s fun to consider a minimal energy solution (it takes a very long time to get anywhere ;) ).
评论 #27490621 未加载
spicybright将近 4 年前
Are real elevators ever coded with logic like mentioned in this thread? Or do they just keep it a simple as possible?
评论 #27487935 未加载
评论 #27488296 未加载
voldemort1968将近 4 年前
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.
评论 #27487736 未加载
lloydatkinson将近 4 年前
What am I doing wrong?<p><pre><code> for(elevator of elevators) { elevator.on(&#x27;idle&#x27;, () =&gt; { &#x2F;&#x2F;do some logic with elevator }) } </code></pre> It only seems to run for the second elevator rather than both of them?
评论 #27488110 未加载
评论 #27492344 未加载
评论 #27489077 未加载
评论 #27489061 未加载
jmchuster将近 4 年前
If you like these programming games, localmotion has one where you schedule taxis to pick up passengers between buildings.<p><a href="https:&#x2F;&#x2F;www.getlocalmotion.com&#x2F;code-challenge" rel="nofollow">https:&#x2F;&#x2F;www.getlocalmotion.com&#x2F;code-challenge</a>
muddywater将近 4 年前
We&#x27;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.<p>If you&#x27;re curious to view the kind of data streaming from a building or basic elevator, see here: (<a href="https:&#x2F;&#x2F;onboarddata.io&#x2F;" rel="nofollow">https:&#x2F;&#x2F;onboarddata.io&#x2F;</a>), python SDK is on Github (<a href="https:&#x2F;&#x2F;github.com&#x2F;onboard-data&#x2F;client-py" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;onboard-data&#x2F;client-py</a>). Every building is different. Some elevators have data on flooding, weight, inspection, electricity usage, while others do not.
评论 #27495724 未加载
Aeolun将近 4 年前
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.
SMAAART将近 4 年前
<p><pre><code> elevator.goToFloor(0); elevator.goToFloor(1); elevator.goToFloor(2); elevator.goToFloor(3); elevator.goToFloor(4);</code></pre>
adenozine将近 4 年前
I used to interview programmers with an elevator programming problem. Neat to see it expanded so excellently and cleanly in this piece. Well done!
评论 #27487890 未加载
评论 #27489659 未加载
juloo将近 4 年前
It&#x27;s annoying that it doesn&#x27;t highlight syntax errors. It&#x27;s even worse than that because it&#x27;s intercepting the syntax error for logging purpose and loses any informations. You get unrelated errors in the app&#x27;s code.
sleepy_keita将近 4 年前
I&#x27;ve always been fascinated with elevator algorithms. This is awesome!
petee将近 4 年前
An advanced level of this game should have you implement your logic with mechanical relays. Those relay banks are always fascinating
CyanDeparture将近 4 年前
There should be a checkbox here to add a mirror to the ground floor waiting area. If memory serves me correctly, this significantly reduces the amount people complain about waiting because they will look at themselves and it won&#x27;t feel as long.
SMAAART将近 4 年前
elevator.goToFloor(1); elevator.goToFloor(2); elevator.goToFloor(0);
评论 #27488997 未加载