<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>gmilburn.ca &#187; boid</title>
	<atom:link href="http://www.gmilburn.ca/tag/boid/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.gmilburn.ca</link>
	<description>Essays, Projects, and Distractions of Geoff Milburn</description>
	<lastBuildDate>Fri, 27 Aug 2010 01:42:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Monday Miscellany</title>
		<link>http://www.gmilburn.ca/2010/03/29/monday-miscellany/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=monday-miscellany</link>
		<comments>http://www.gmilburn.ca/2010/03/29/monday-miscellany/#comments</comments>
		<pubDate>Mon, 29 Mar 2010 20:05:31 +0000</pubDate>
		<dc:creator>Geoff</dc:creator>
				<category><![CDATA[Interesting]]></category>
		<category><![CDATA[boid]]></category>
		<category><![CDATA[flock]]></category>
		<category><![CDATA[mit]]></category>
		<category><![CDATA[university]]></category>

		<guid isPermaLink="false">http://www.gmilburn.ca/?p=2320</guid>
		<description><![CDATA[A few little things for Monday - 5000 fish and recommended reading from MIT.]]></description>
			<content:encoded><![CDATA[<p>A few little things for Monday. I made a new video using the same engine as the <a href="http://www.gmilburn.ca/boids/hd/">fish school simulation</a> described in the post <a href="http://www.gmilburn.ca/2010/03/23/in-this-virtual-fish-tank-you-make-the-rules/">In This Virtual Fish Tank, You Make the Rules</a>.</p>
<p><object width="571" height="321"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=10526127&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=10526127&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="571" height="321"></embed></object></p>
<p>This video shows 5000 fish swimming while the weightings of the three behavioural rules vary using sinusoidal functions. I love the &#8220;borders&#8221; created as large fish schools collide, and fish attempt to escape along the plane of intersection.</p>
<p><a href="http://www.gmilburn.ca/2010/02/24/triumph-of-the-golden-rule/">Triumph of the Golden Rule</a> was also <a href="http://web.mit.edu/6.033/www/papers/indirect-bittyrant.shtml">linked to as recommended reading</a> for MIT course 6.033 Computer Systems Engineering &#8211; one of the best compliments I&#8217;ve received. Thanks Evan!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gmilburn.ca/2010/03/29/monday-miscellany/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>In This Virtual Fish Tank, You Make the Rules</title>
		<link>http://www.gmilburn.ca/2010/03/23/in-this-virtual-fish-tank-you-make-the-rules/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=in-this-virtual-fish-tank-you-make-the-rules</link>
		<comments>http://www.gmilburn.ca/2010/03/23/in-this-virtual-fish-tank-you-make-the-rules/#comments</comments>
		<pubDate>Tue, 23 Mar 2010 17:12:27 +0000</pubDate>
		<dc:creator>Geoff</dc:creator>
				<category><![CDATA[Numbers & Nature]]></category>
		<category><![CDATA[boid]]></category>
		<category><![CDATA[cooperation]]></category>
		<category><![CDATA[emergence]]></category>
		<category><![CDATA[flock]]></category>
		<category><![CDATA[mathematics]]></category>

		<guid isPermaLink="false">http://www.gmilburn.ca/?p=2283</guid>
		<description><![CDATA[This simulation of a school of fish allows you to play with the weightings of three rules that cause coordinated group behavior.]]></description>
			<content:encoded><![CDATA[<p>In my last post, I discussed how <a href="http://www.gmilburn.ca/2010/03/18/herds-of-android-birds-mimic-ad-hoc-flocks/">individuals following simple rules cause cause coordinated group behavior to arise</a>. The boid model created by Craig Reynolds used three rules &#8211; alignment, separation, and coherence. But how much attention does each individual pay to each rule? In situations like migration, alignment might be the most important rule. If you&#8217;re being attacked by predators, sticking together and paying attention to the coherence rule might keep you from being eaten.</p>
<p>Clearly different situations might have different approaches. I was very interested in how different weightings of these rules might behave, so I decided to create a program that would allow you to change the relative importance of each rule at will. You can see a video of it in action below (the three sliders on the bottom left control the influence of the various rules).</p>
<p><object width="571" height="321"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=10383384&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=10383384&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="571" height="321"></embed></object></p>
<table>
<tr bgcolor="#e9e8e3">
<td align="center" width="50%">Smaller screen, older computer, or just want something more simple? <br /><big><a href="http://www.gmilburn.ca/boids/sd/" target="_blank">Load the standard definition fish school simulation.</a></big></td>
<td align="center" width="50%">Big screen, fast computer, and want to give the fish some more room to swim? <br /><big><a href="http://www.gmilburn.ca/boids/hd/" target="_blank">Load the high definition fish school simulation.</a></big></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>
<table>
<tr>
<td align="center"><img src="http://www.gmilburn.ca/wp-content/uploads/2010/03/alignment.jpg" alt="" title="alignment" width="48" height="51" class="alignnone size-full wp-image-2296" /></td>
<td><strong>Alignment:</strong> This slider adjusts how much each fish wants to head in the same direction as other fish around it.</td>
</tr>
<tr>
<td align="center"><img src="http://www.gmilburn.ca/wp-content/uploads/2010/03/cohesion.jpg" alt="" title="cohesion" width="47" height="51" class="alignnone size-full wp-image-2297" /></td>
<td><strong>Cohesion: </strong>This slider adjusts how close each fish wants to be to its neighbors.</td>
</tr>
<tr>
<td align="center"><img src="http://www.gmilburn.ca/wp-content/uploads/2010/03/separation.jpg" alt="" title="separation" width="47" height="51" class="alignnone size-full wp-image-2299" /></td>
<td><strong>Separation:</strong> This slider adjust how much each fish wants to space itself out from the others.</td>
</tr>
<tr>
<td align="center"><img src="http://www.gmilburn.ca/wp-content/uploads/2010/03/fish1.jpg" alt="" title="fish" width="50" height="50" class="alignnone size-full wp-image-2304" /></td>
<td>Click anywhere in the water to add a new fish.</td>
</tr>
<tr>
<td align="center"><img src="http://www.gmilburn.ca/wp-content/uploads/2010/03/reset.jpg" alt="" title="reset" width="45" height="45" class="alignnone size-full wp-image-2298" /></td>
<td>Press this button to reset the simulation.</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>
<p>I hope you enjoy it &#8211; please leave me a comment if you have any questions, comments, or find any bugs.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gmilburn.ca/2010/03/23/in-this-virtual-fish-tank-you-make-the-rules/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Herds of Android Birds Mimic Ad Hoc Flocks</title>
		<link>http://www.gmilburn.ca/2010/03/18/herds-of-android-birds-mimic-ad-hoc-flocks/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=herds-of-android-birds-mimic-ad-hoc-flocks</link>
		<comments>http://www.gmilburn.ca/2010/03/18/herds-of-android-birds-mimic-ad-hoc-flocks/#comments</comments>
		<pubDate>Thu, 18 Mar 2010 09:00:33 +0000</pubDate>
		<dc:creator>Geoff</dc:creator>
				<category><![CDATA[Numbers & Nature]]></category>
		<category><![CDATA[boid]]></category>
		<category><![CDATA[cooperation]]></category>
		<category><![CDATA[emergence]]></category>
		<category><![CDATA[flock]]></category>

		<guid isPermaLink="false">http://www.gmilburn.ca/?p=2184</guid>
		<description><![CDATA[In winter during the late afternoon before settling down to roost, flocks of thousands of starlings will twist and turn, turning the sky black with strange curves that seem to move with a mind of their own. The flocks of up to a million strong form for warmth, for security, and for social contact. ]]></description>
			<content:encoded><![CDATA[<p>In winter during the late afternoon before settling down to roost, flocks of thousands of <a href="http://en.wikipedia.org/wiki/Starling">starlings</a> will twist and turn, turning the sky black with strange curves that seem to move with a mind of their own. The flocks of up to a million strong form for warmth, for security, and for social contact. The video below shows a small group of 80,000 starlings. If you&#8217;re the impatient type, skip ahead to 1:15 to see some of the most impressive forms and transitions.</p>
<p><object width="571" height="321"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=9193713&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=9193713&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="571" height="321"></embed></object></p>
<p>These seething clouds of birds have no leader, no planning, and yet produce a dance that seems choreographed in its precision and beauty. So how do they do it? Some strange ability given to them, a unique skill among the animal kingdom? Well, perhaps not quite. Consider that humans seem to be able to move in crowds with the same ease, although some might say with a bit less beauty.</p>
<p><object width="571" height="321"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=1626058&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=1626058&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="571" height="321"></embed></object></p>
<p>People seem to move in clumps, in the same direction, and manage to not trample each other or collide. There seem to be parallels in crowds of organisms, that this order emerges consistently and that somehow each animal &#8220;knows&#8221; what to do on a small scale, resulting in cohesive and sensible group movement. The question then becomes &#8211; what exactly are we doing unconsciously to organize like this?</p>
<h2>The Boid Model</h2>
<p>In 1986 <a href="http://www.red3d.com/cwr/boids/">Craig Reynolds produced a computer model</a> describing how large groups of animals such as schools, herds, and flocks could be able to move in unison with no central coordination. He called his creations &#8220;boids&#8221;, and imagined that each would follow some simple, sensible rules to navigate around. He also knew a single animal would never be able to keep track of every other animal in the group, and assumed that they would only pay attention to their immediate neighbors in the flock. </p>
<p>So if you were a boid, what rules would you follow?</p>
<table>
<tr>
<td><big><strong>Alignment:</strong></big> Look around you. Where is everyone else going? Probably a good idea to go there too. Alignment is a rule that finds the average direction your neighbours are going, and tells you to go there too.</td>
<td><img src="http://www.gmilburn.ca/wp-content/uploads/2010/03/alignment.gif" alt="" title="alignment" width="217" height="145" class="alignright size-full wp-image-2189" /></td>
</tr>
<tr>
<td><big><strong>Cohesion:</strong></big>Predators look to pick off stragglers on the edge of the pack. Cohesion is a rule that finds the average position of your neighbors and tells you to go there, pulling you into the relative safety of the center of the pack.</td>
<td><img src="http://www.gmilburn.ca/wp-content/uploads/2010/03/cohesion.gif" alt="" title="cohesion" width="217" height="145" class="alignright size-full wp-image-2190" /></td>
</tr>
<tr>
<td><big><strong>Separation:</strong></big> When crowds get big, they can get dangerous. Animals can trample each other, and birds can collide. Separation is a rule that tells you to make sure to give your neighbors some space.</td>
<td><img src="http://www.gmilburn.ca/wp-content/uploads/2010/03/separation.gif" alt="" title="separation" width="217" height="145" class="alignright size-full wp-image-2191" /></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>
<p>How do we know how to do this? Well, the tautological answer is that it simply works. The beauty of these rules is that each of them is amazingly simple, and seem to make sense to us on an intuitive level. We tend to go with the crowd, stick together, and still try to give everyone a bit of personal space. But are these rules enough to produce the complex dance of the starlings, or are we missing some detail?</p>
<h2>A Boid Dance</h2>
<p>It turns out these simple rules produce patterns of movement that are anything but.</p>
<p><object width="571" height="321"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=2481794&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=2481794&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="571" height="321"></embed></object></p>
<p>We can see that it looks flowing and wonderfully organic &#8211; but it&#8217;s not quite the same as the starling flocks. We can play with the boid model, tuning its various parameters to see how the resulting crowds might react. </p>
<table>
<tr>
<td>A school of fish trying to avoid predators might be modeled best by weighting the cohesiveness rule very heavily, attempting to keep together at all costs while not worrying too much about personal space or where precisely they&#8217;re heading as long as it&#8217;s away from what&#8217;s trying to eat you.</td>
<td><img src="http://www.gmilburn.ca/wp-content/uploads/2010/03/school-of-fish-300x199.jpg" alt="" title="school-of-fish" width="300" height="199" class="alignright size-medium wp-image-2269" /></td>
</tr>
<tr>
<td> A flock of geese flying south for the winter will focus on heading in a certain direction (alignment), then space themselves out to ensure they can see in front of themselves (seperation) while staying close enough and on the same plane to experience the aerodynamic benefits of flying in a group (cohesion) producing the &#8220;flying V&#8221; we see so often in fall.</td>
<td><img src="http://www.gmilburn.ca/wp-content/uploads/2010/03/geese-v-300x200.jpg" alt="" title="geese-v" width="300" height="200" class="alignright size-medium wp-image-2270" /></td>
</tr>
<tr>
<td>Migrating animals are primarily concerned with making sure they&#8217;re going in the same direction as everyone else (alignment) while ensuring that no one is trampled (seperation) and that young and weak animals are protected in the center of the herd (cohesion). For instance, the wildebeest stampede that killed Simba&#8217;s father in the Lion King was <a href="http://www.lionking.org/text/FilmNotes.html">generated using the same theory as the boid model</a>.</td>
<td><img src="http://www.gmilburn.ca/wp-content/uploads/2010/03/wildebeest-300x192.jpg" alt="" title="wildebeest" width="300" height="192" class="alignright size-medium wp-image-2271" /></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>
<p>This simple model has a wide range of possible applications, and a huge amount of flexibility allowing it to produce a wide range of behavioural simulations. This gorgeous installation of light graffiti uses the rules we&#8217;ve just discussed to create hypnotizing patterns of artificial creatures.</p>
<p><object width="571" height="321"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=455512&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=ff0179&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=455512&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=ff0179&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="571" height="321"></embed></object></p>
<p>The boid model has been used to animate realistic looking behavior over a huge range of media. If you&#8217;ve seen a computer generated crowd moving in a vaguely sensible manner anywhere, it likely uses the same basic theory. The power of the model comes from its construction, assuming simple behaviors competing for influence that result in a complex outcome not unlike our own consciousness or political systems. Not too shabby for a research project from over 20 years ago.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gmilburn.ca/2010/03/18/herds-of-android-birds-mimic-ad-hoc-flocks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
