Archive for October, 2006

flocking autonomous agents

A while ago I completed my Mathematics BSc from Bangor University. Its a course they’ve stopped doing now, but at the time, it was a most excellent thing. For those that are interested I did my final year dissertation on Flocking Autonomous Agents. That is, the order that appears when groups of supposedly simple agents congregate.

Its the sort of thing that you see in the wild with swallows flying about. Theres no master plan of where they’re going, nor any central command to the system. So how do these simple creatures manage to form cohesive flocks that can travel, with what seems, singular purpose?

It was just this question I proposed to answer in my dissertation (and I thought I did that rather well) as well as explaining the deceptively complex maths behind it.

Long story short. The system works like this:

  1. The individual agents are only aware of whats going on in an area directly around them (their vision range).
  2. The individual agents will try to adjust their direction to that of their neighbors.
  3. They won’t always do this right.
  4. There is 4th rule.

It seems almost counter-intuitive that the fact that a agent makes mistakes in their headings would actually help the flock as a whole but, after some rather intense mathematics, you can prove that, up to a point, it helps the system.

The crux of the matter is this – If there is group of agents flying together in sync and none of them ever makes a mistake as to their heading or position, their relative positions will conceivably never change.

If however they do make mistakes something wonderful happens.

Mistakes that have a negative impact on the flock as a whole get naturally canceled out while mistakes that bring the flock together are reinforced. Over time a very tight, cohesive, resilient flock is formed.

I even wrote a lovely java applet for it and ill post it up here when i figure out how to embed it properly. Ill even give you the source code, cos I’m nice like that.

hello the internets!

Hmm. I’m looking for some code. I could use Krugle but that would mean navigating away from this page and thats a real hassle. If only i could use the firefox search bar to search Krugle for me. Oh well. It doesn’t look like thats possible. Theres no extensions to do that.

But wait.

Fret no more. Phil Roche, programmer extrodinare, Irish guy, and proud owner of a very heavy duty laptop stand (and co-worker) has written a plugin for firefox. That busy little man. He even got a post on the Krugle blog for his troubles. (And rather suspiciously also just completed and external audit for them and got a $50 amazon voucher – bribing maybe?)

So if you want to read his original post, you can get it here. But don’t let him bask in it too much. Hes enjoying the extra traffic a little too much as it is.

1072