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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Neat Algorithms - Flocking

220 点作者 mattkirman大约 14 年前

17 条评论

RiderOfGiraffes大约 14 年前
Also submitted four days ago:<p><a href="http://news.ycombinator.com/item?id=2246089" rel="nofollow">http://news.ycombinator.com/item?id=2246089</a><p>although it gains very few upvotes, and no comments. More evidence that getting noticed is largely chance, or gaming.
评论 #2263901 未加载
评论 #2264566 未加载
评论 #2264029 未加载
评论 #2264093 未加载
swannodette大约 14 年前
And here's a parallel version written in Clojure that scales across your cores, <a href="https://github.com/swannodette/flocking/blob/master/src/flocking/flocking3.clj" rel="nofollow">https://github.com/swannodette/flocking/blob/master/src/floc...</a>
评论 #2263666 未加载
Breefield大约 14 年前
If you haven't seen the boids pseudocode page by Conrad Parker it's definitely worth checking out: <a href="http://www.vergenet.net/~conrad/boids/pseudocode.html" rel="nofollow">http://www.vergenet.net/~conrad/boids/pseudocode.html</a><p>Here's an implementation I wrote last month for fun: <a href="http://breefield.com/lab/flock" rel="nofollow">http://breefield.com/lab/flock</a>. It doesn't have much bias in terms of direction (there's no wind, or patterns to follow), so there's generally one large swarm. Click-drag to create repellers, boids follow mouse. The white center of each boid shrinks at it's velocity increases, and the inverse happens to it's red direction line. Purple specks indicate perceived center of nearby flock. The rest is just aesthetic.<p>It's always super interesting to see other implementations in action, so please share more in your comments, if you have them. I'd certainly love to see them.
评论 #2264382 未加载
nihilocrat大约 14 年前
I used flocking in a game project in college (getting ad-hoc starship fleets to get into ad-hoc formations) with another condition: When the basic requirements are met, each ship should also try to align with a master "fleet admiral" ship, and the group of boids under consideration was limited to only ships specifically defined as part of the fleet.<p>It kind of worked, there were issues with stragglers and making it look organic that I couldn't fix in time. If ships got too far outside the formation sometimes they would only try aligning with the leader instead of catching up first. Also, when they did get in formation, they were eerily good at matching the leader's alignment: all ships would turn in unison and kind of ruin the organic feel of the pure flocking algorithm.
评论 #2264877 未加载
krisneuharth大约 14 年前
See also: <a href="http://en.wikipedia.org/wiki/Swarm_behaviour" rel="nofollow">http://en.wikipedia.org/wiki/Swarm_behaviour</a><p>At a research company I worked at we used swarming concepts for controlling swarms of sensors, robots, and UAVs. We also used ant colony optimization techniques mixed with genetic algorithms to do predictive intelligence. Really powerful stuff.
mccutchen大约 14 年前
Here's an implementation I wrote some years ago that includes obstacle avoidance. Clicking adds obstacles, spacebar adds boids, reloading gets new colors. This ended up looking somewhat like sperm avoiding eggs...<p><a href="http://humortree.org/projects/flock03/" rel="nofollow">http://humortree.org/projects/flock03/</a><p>(Java applet warning!)<p>The source code is here:<p><a href="https://github.com/mccutchen/humortree.org/tree/master/projects/flock03" rel="nofollow">https://github.com/mccutchen/humortree.org/tree/master/proje...</a>
mgunes大约 14 年前
Very well explained. There needs to be more of this (algorithms and applied math explained in a manner somewhat accessible and nourishing to non-mathematicians through code and visualization) on the web, and I'd love to be pointed to similar resources.
joshes大约 14 年前
Turning on the legend and the magnification of an individual boid (by clicking "Decorate") is very helpful. When you mouse over the magnified boid, you see the vectors immediately adjust, providing a very handy visual description of what is happening in real time.
评论 #2263477 未加载
kamens大约 14 年前
I used to use boids as an interview question for candidates who whizzed through my first few code challenges -- was interesting to discuss various collision detection options with an eye on performance.<p>Such a simple algorithm w/ such a cool result.
corysama大约 14 年前
You may also like <a href="http://www.red3d.com/cwr/steer/" rel="nofollow">http://www.red3d.com/cwr/steer/</a>
hebejebelus大约 14 年前
This is fantastic! Not just the algorithm, but the explanation, the fact that there's source code readily available, and the canvas demo. Please, do more!
tjarratt大约 14 年前
I've wanted to write some exploratory algorithms for flocking for a long time now. This is just the motivation I need to start working on a silly side project.<p>Thank you, everyone in the comments who submitted source code or demos. You never know when something you upload will really brighten someone's day (even if it's written in java).
mirkules大约 14 年前
Cool. There's also a book called "Swarm Intelligence" by Kennedy/Eberhart that describes swarm behaviors very well (my favorite book).<p>For anyone interested, here is the Craig Reynolds page that describes the flocking behavior <a href="http://www.red3d.com/cwr/boids/" rel="nofollow">http://www.red3d.com/cwr/boids/</a>
pjvandehaar大约 14 年前
It'd be great if someone added "[processor-heavy]" on to the title of posts like this.
thefox大约 14 年前
I could watch this for hours.
meatsock大约 14 年前
glad to see you've herd of this, and are flocking to it. if you're not too flighty it's worth a peep, but you may have to duck some bugs in the code. furthermore i think flocking should be part of everyone's schooling, and there's nothing fishy about that.
VladRussian大约 14 年前
discrete navier stokes?
评论 #2263903 未加载