<?xml version="1.0"?>
<rss version="2.0">
   <channel>
      <title>Boids algorithm :  A modelisation of murmuration by Yohan Lanier</title>
      <link>https://padlet.com/yohanlanier/murmuration_modelisation</link>
      <description>How well can we model a natural phenomenom using a simple algorithm ? An implementation of the Craig Reynold&#39;s algorithm</description>
      <language>en-us</language>
      <pubDate>2021-02-14 16:28:46 UTC</pubDate>
      <lastBuildDate>2025-12-21 18:08:54 UTC</lastBuildDate>
      <webMaster>hello@padlet.com</webMaster>
      <image>
         <url>https://padlet.net/icons/png/1f54a.png</url>
      </image>
      <item>
         <title>What is a murmuration ? </title>
         <author>yohanlanier</author>
         <link>https://padlet.com/yohanlanier/murmuration_modelisation/wish/1332532038</link>
         <description><![CDATA[<p>When birds, especially starlings, flock together, we call that phenomenom<strong> murmuration</strong>. When it occures,<strong> thousands of birds fly together</strong>, forming various random patterns. It is pretty impressive. During their flight, <strong>birds seem connected with each others</strong>. You can find out more by watching this pretty cool video by <strong><em>Smarter Every Day :&nbsp;</em></strong></p>]]></description>
         <enclosure url="https://www.youtube.com/watch?v=4LWmRuB-uNU" />
         <pubDate>2021-03-20 14:14:39 UTC</pubDate>
         <guid>https://padlet.com/yohanlanier/murmuration_modelisation/wish/1332532038</guid>
      </item>
      <item>
         <title>How do birds behave together ? </title>
         <author>yohanlanier</author>
         <link>https://padlet.com/yohanlanier/murmuration_modelisation/wish/1332542486</link>
         <description><![CDATA[<div>Actually, scientists found out that starling flocks have<strong> more in common with physics than with biology ! </strong>At least you can easily model a murmuration using physical principles. <br><br>Let's take an example with only two starlings :&nbsp; it's easy to understand that assuming they are going to the same place, <strong>when one turns the other knows when to turn</strong> since they can see each other. They will <strong>adjust their speed</strong> to stay together. If they are to close, they will move away a little bit etc... You can think of it as two particles attracted to each others but which can't get to close. <br><br>The magic of murmuration<strong> is that it doesn't occure with two or ten birds but with thousands of them</strong>.&nbsp;<br><br></div>]]></description>
         <enclosure url="" />
         <pubDate>2021-03-20 14:22:03 UTC</pubDate>
         <guid>https://padlet.com/yohanlanier/murmuration_modelisation/wish/1332542486</guid>
      </item>
      <item>
         <title>Craig Reynold&#39;s algorithm </title>
         <author>yohanlanier</author>
         <link>https://padlet.com/yohanlanier/murmuration_modelisation/wish/1332556145</link>
         <description><![CDATA[<div>So how can we model thousands of starlings each connected with the others ? Well <strong>Craig Reynold</strong> found a way to do it. Here I will describe the most simple way to do it and present a mere implementation of this algorithm using <em>python</em>. Then I will present you various way to improve the algorithm. <br><br>First things first, you have to know that the following principles can be apply to birds or fishes or insects or other living creatures, that's why we will refere to them as <strong>boids</strong>.<br><br>I will use the link down below to explain the algorithm. It the original website Craig Reynold used to present his work.</div>]]></description>
         <enclosure url="https://www.red3d.com/cwr/boids/" />
         <pubDate>2021-03-20 14:31:50 UTC</pubDate>
         <guid>https://padlet.com/yohanlanier/murmuration_modelisation/wish/1332556145</guid>
      </item>
      <item>
         <title>Introduction of the algorithm</title>
         <author>yohanlanier</author>
         <link>https://padlet.com/yohanlanier/murmuration_modelisation/wish/1332565587</link>
         <description><![CDATA[<div>You can think of each boid as a particle which has&nbsp; :</div><ul><li>a position</li><li>a velocity (you can think of it as a vector which means the boid has a direction and a "speed" at which he travels)</li><li>an acceleration which is how its velocity varies in time</li><li>a mass (here we will assume all the boids have the exact same weight = 1 kg because it symplifies a lot the implementation)</li></ul><div>And the more important things : <br>Each boid has a <strong>range </strong>in which he sees other boids :<strong> </strong>we can call that range the<strong> perception range. </strong>If some are to far from him it won't interact with them.<strong> So each boid will only interact with its nearest neighbours.</strong> In a first approach, we'll consider that each boid can see at 360° around him.&nbsp;<br><br>So what we want to do in this algorithm is to control the velocity of the boids (hence their position) so that we can move them forming murmuration.&nbsp;<br><br>I'll also consider we are in a 2D world in order to simplify drawings an explanations.</div>]]></description>
         <enclosure url="" />
         <pubDate>2021-03-20 14:38:17 UTC</pubDate>
         <guid>https://padlet.com/yohanlanier/murmuration_modelisation/wish/1332565587</guid>
      </item>
      <item>
         <title>1st principle : Alignment</title>
         <author>yohanlanier</author>
         <link>https://padlet.com/yohanlanier/murmuration_modelisation/wish/1332583511</link>
         <description><![CDATA[<div>The original description of this principle is : <em>"steer towards the average heading of local flockmates"</em>. <br><br>So lets focus on one boid and see how he interacts with others in this principle. Basically what it says is that at every time, the boid "finds" what's the <strong>average direction of his neighbours</strong> (meaning the boids which are in his perception range) and he <strong>aligns its direction with it</strong>. Physically it means the boid will align his velociy (which is his direction) with the average velocity of his neighbours.&nbsp; <br><br>And this makes a lot of sens if you think to the starlings flocks : locally, all the birds are going in the same direction. <br><br>In the end, you can think of that as a "<strong>steering alignment force</strong>". And as Newton has inveted a really handly law in physics, this force is related to the acceleration of our boid. And in a discrete world, if we chose to have a time step equal to 1 sec, <strong>this force is directly related to the velocity of the boid !</strong> So there we have made our first step to model murmuration !</div>]]></description>
         <enclosure url="https://www.red3d.com/cwr/boids/images/alignment.gif" />
         <pubDate>2021-03-20 14:50:39 UTC</pubDate>
         <guid>https://padlet.com/yohanlanier/murmuration_modelisation/wish/1332583511</guid>
      </item>
      <item>
         <title>2nd principle : cohesion </title>
         <author>yohanlanier</author>
         <link>https://padlet.com/yohanlanier/murmuration_modelisation/wish/1332607125</link>
         <description><![CDATA[<div>"<em>steer to move toward the average position of local flockmates"<br><br></em>So if we continue to focus on one boid,<em> </em>what this principle says is that, at every time, our boid has to move so that it's next position steers toward the average position of the boids which are in his perception range.&nbsp; <em>&nbsp;<br><br></em>Once again, this makes sens, each starling wants to stay with the flock so he tends to move toward the average position of its neighbours. In that way he never goes to far from the others. <br><br>And again you can think of it as an <strong>"attractive steering cohesion force"</strong>. And as we said before, this force is related to the velocity of the boid. And as physics is wonderfull, the sum of the force apply to the boid equals its acceleration (because its mass is 1kg). This means the "attractive steering cohesion force" adds up with the "steering alignment force<strong>". This is really convenient for the implementation.&nbsp;</strong></div>]]></description>
         <enclosure url="https://www.red3d.com/cwr/boids/images/cohesion.gif" />
         <pubDate>2021-03-20 15:06:51 UTC</pubDate>
         <guid>https://padlet.com/yohanlanier/murmuration_modelisation/wish/1332607125</guid>
      </item>
      <item>
         <title>3rd principle :  seperation</title>
         <author>yohanlanier</author>
         <link>https://padlet.com/yohanlanier/murmuration_modelisation/wish/1334596361</link>
         <description><![CDATA[<div><em>"steer to avoid crowding local flockmates"<br><br></em>Last but not least, we don't want our boid to collapse with his nieghbours. One way to do that is to consider that our boid will steer away from its neighbours in such a way that the steering force is inversly proportional to the distance between them. <br><br>If you think about it that makes sens : if a flockmate is far the starling won't really have to avoid him but if it is close enough, it will pay attention to avoid it.<br><br>Once again you can think of that as a <strong>"repulsive steering seperation force"</strong> which will merely add up with the two previous forces we wrote !<br><br>So there we are ! All we have to do now is to apply this principles to all the boids at the same time which is pretty easy to do in any programming language !&nbsp;</div>]]></description>
         <enclosure url="https://www.red3d.com/cwr/boids/images/separation.gif" />
         <pubDate>2021-03-21 14:56:04 UTC</pubDate>
         <guid>https://padlet.com/yohanlanier/murmuration_modelisation/wish/1334596361</guid>
      </item>
      <item>
         <title>For all the equation lovers here ! </title>
         <author>yohanlanier</author>
         <link>https://padlet.com/yohanlanier/murmuration_modelisation/wish/1334641461</link>
         <description><![CDATA[<div>Newton's law : </div><var>m \times a = F_{alignment} + F_{cohesion} + F_{seperation}</var><div>But we consider we live in a world where the mass of everything is 1kg so : </div><var>m=1kg </var><div>Then we will discretize time and get the velocity (considering a time step equal to 1 sec) : </div><var>\frac{v_i - v_{i-1}}{\Delta t} = a_i =  F_{alignment} + F_{cohesion} + F_{seperation} \Rightarrow v_i = v_{i-1} + F_{alignment} + F_{cohesion} + F_{seperation}</var><div>And identically we can have the position of our boids : </div><var>\frac{p_i - p_{i-1}}{\Delta t} = v_i \Rightarrow p_i = p_{i-1} + v_i</var><div>One will see that this physics equations are pretty easy to write in any programming language.  All we have to do is to write these equations for each boid. The real difficulty is to write the expressions of the forces. </div>]]></description>
         <enclosure url="" />
         <pubDate>2021-03-21 15:17:36 UTC</pubDate>
         <guid>https://padlet.com/yohanlanier/murmuration_modelisation/wish/1334641461</guid>
      </item>
      <item>
         <title>References : </title>
         <author>yohanlanier</author>
         <link>https://padlet.com/yohanlanier/murmuration_modelisation/wish/1334675929</link>
         <description><![CDATA[<div>I put here all the links I've read to write this padlet AND code the simulation you can see on the videos : </div><ul><li>https://imagecomputing.net/damien.rohmer/publications/2002_2006_student_work/2004_boids/rapport/boids_3eti_rohmer.pdf </li><li>https://www.youtube.com/watch?v=mhjuuHl6qHM </li><li>https://www.red3d.com/cwr/boids/ </li><li>https://www.youtube.com/watch?v=4LWmRuB-uNU </li><li>https://eater.net/boids  </li><li>https://medium.com/better-programming/boids-simulating-birds-flock-behavior-in-python-9fff99375118 </li></ul>]]></description>
         <enclosure url="" />
         <pubDate>2021-03-21 15:33:41 UTC</pubDate>
         <guid>https://padlet.com/yohanlanier/murmuration_modelisation/wish/1334675929</guid>
      </item>
      <item>
         <title>Adding some features </title>
         <author>yohanlanier</author>
         <link>https://padlet.com/yohanlanier/murmuration_modelisation/wish/1334685577</link>
         <description><![CDATA[<div>I wanted to add some features to the algortihm I wrote so by surfing on the internet, I found many things I could add to my simulation. I choosed 2 things :<br><br></div><ul><li>I added obstacles that the boids would have to avoid</li><li>I added the possibility to have a "leader boid" which would be followed by all the other boids&nbsp;</li></ul><div><br>You could add many other things such as the fact that birds don't see at 360° around them so you might want to implement that etc... or you could argue that birds have different masses than 1kg and implement that and see the effects etc..&nbsp;</div>]]></description>
         <enclosure url="" />
         <pubDate>2021-03-21 15:38:17 UTC</pubDate>
         <guid>https://padlet.com/yohanlanier/murmuration_modelisation/wish/1334685577</guid>
      </item>
      <item>
         <title>Playing with the parameters + warnings </title>
         <author>yohanlanier</author>
         <link>https://padlet.com/yohanlanier/murmuration_modelisation/wish/1334699254</link>
         <description><![CDATA[<div>There are so many things you can play with to give various comportements to your flock ! <br><br>For instance :</div><ul><li>maximum cohesion force</li><li>maximum speration force</li><li>maximum alignment force</li><li>maximum speed</li></ul><div><br>**Warnings**<br>One would say that python isn't the most convenient language to do such animations because it is pretty slow and "live animations" are not smooth. He would be right. Even if the code could be improve using numba or by refactoring it (Some may have noticed that we don't have to check all the boids of the block for each boid, which is pretty long to do, but we can limit ourselve to check only the neighbours of each boid... I didn't do that here) python isn't the ideal language.  But matplotlib was fine to edit the animations and I had it installed on my laptop so I used it + I wanted to practice python.  </div>]]></description>
         <enclosure url="" />
         <pubDate>2021-03-21 15:44:30 UTC</pubDate>
         <guid>https://padlet.com/yohanlanier/murmuration_modelisation/wish/1334699254</guid>
      </item>
      <item>
         <title>A simulation I made with the explained principles </title>
         <author>yohanlanier</author>
         <link>https://padlet.com/yohanlanier/murmuration_modelisation/wish/1334715887</link>
         <description><![CDATA[]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/1017671402/a49b2cd5425e9220a4b3bbf644af69f9/anim1.mp4" />
         <pubDate>2021-03-21 15:52:18 UTC</pubDate>
         <guid>https://padlet.com/yohanlanier/murmuration_modelisation/wish/1334715887</guid>
      </item>
      <item>
         <title>Adding a leader boid with a random trajectory (the blue dot)</title>
         <author>yohanlanier</author>
         <link>https://padlet.com/yohanlanier/murmuration_modelisation/wish/1334720965</link>
         <description><![CDATA[]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/1017671402/04e812b2cdcd75c4f0d07815b028f74f/anim2.mp4" />
         <pubDate>2021-03-21 15:54:49 UTC</pubDate>
         <guid>https://padlet.com/yohanlanier/murmuration_modelisation/wish/1334720965</guid>
      </item>
      <item>
         <title>Github repo for the code</title>
         <author>yohanlanier</author>
         <link>https://padlet.com/yohanlanier/murmuration_modelisation/wish/1334724161</link>
         <description><![CDATA[<div>Yet to come</div>]]></description>
         <enclosure url="" />
         <pubDate>2021-03-21 15:56:23 UTC</pubDate>
         <guid>https://padlet.com/yohanlanier/murmuration_modelisation/wish/1334724161</guid>
      </item>
      <item>
         <title>An illustration of the seperation principle</title>
         <author>yohanlanier</author>
         <link>https://padlet.com/yohanlanier/murmuration_modelisation/wish/1334760061</link>
         <description><![CDATA[<div>All the boids stay seperated from each others</div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/1017671402/fec4dbd48d35db39e2fdd441b66295a4/gif1.gif" />
         <pubDate>2021-03-21 16:14:05 UTC</pubDate>
         <guid>https://padlet.com/yohanlanier/murmuration_modelisation/wish/1334760061</guid>
      </item>
      <item>
         <title>An illustration of the cohesion principle</title>
         <author>yohanlanier</author>
         <link>https://padlet.com/yohanlanier/murmuration_modelisation/wish/1334770284</link>
         <description><![CDATA[<div>Eventually if we wait long enough, all the boids would form one group and would stop moving</div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/1017671402/a793b34f2da60b4cbb301c3452c2c2da/gif1.gif" />
         <pubDate>2021-03-21 16:19:33 UTC</pubDate>
         <guid>https://padlet.com/yohanlanier/murmuration_modelisation/wish/1334770284</guid>
      </item>
      <item>
         <title>An illustration of the alignment principle</title>
         <author>yohanlanier</author>
         <link>https://padlet.com/yohanlanier/murmuration_modelisation/wish/1334780335</link>
         <description><![CDATA[<div>Eventually if we wait long enough, all the boids will have the same velocity (meaning direction and speed)</div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/1017671402/22cb0f56df7447196c17b3d9013f5b12/gif1.gif" />
         <pubDate>2021-03-21 16:24:43 UTC</pubDate>
         <guid>https://padlet.com/yohanlanier/murmuration_modelisation/wish/1334780335</guid>
      </item>
   </channel>
</rss>
