Thursday, September 16, 2004

Introduction

Have you ever wondered how you could animate armies of thousands of soldiers ? flocks of hunderds of fish ? etc... Well, you use what they call Autonomous Agents: agents that have a local behavior that creates interresting global behaviors. The first example of autonomous agents was brought in 1984 by Craig Reynolds which developped a small application to simulation flocks: the boids application was born.

Since then, Reynolds has published an excellent paper in 99 on the subject: Steering behavior for Autonomous Characteres. If you never had a look at this, check out his web site and look at the java demo, it is just splendid!

Previous try

During my Phd, I monitored the course of C/C++ for third year Engineer students. The autonomous agents theme was very appealing and students got very involved into that project. (If you are looking for something fun for teaching software engineering, this theme is great!). At that time, they received a mini drawing library that could render agents in real time in OpenGL and Glut. If you want to give it a try, you can download it from www.dotnetwiki.org (look for Autonomous.binaries.zip in the download section) Of course, I tested the project on myself and built an application that looked as follows:

 

On the picture, you can see 151 agent (green dots) that are moving toward the little black dot. They are avoiding themselves, avoiding obstacles (big gray circle). The little lines between agents show that there is a "flocking" interaction,i.e. they are avoiding themselves.

During that project, we could see a lot of interresting properties of such flocks. For example, the system has a self-organization property. If you let the simulation go long enough, agents will organize themselves in a perfect triangular tiling as show below:

We could also see waves where the agents stopped going in reverse direction from the direction of the flock (In PDE theory, those are called shocks). In fact, it is the same phenomenon that occurs in traffic jam when a wave a "zero" velocity is travelling along the highway. When you stand back in your car, just look at the way you will start run a few hundred meters and the stop, and again and again. This behavior is predicted by the hyperbolic PDE theory :) In the figure below, the agents are moving left toward the little black dot. You can visualize the waves going right. The gray lines denote flock which means that agents are stopping in order to avoid each other.

NSteer

The code C++ was written using Tempate Meta Programming. In NSteer, I'll try to build gradually a framework for C#

posted on Thursday, September 16, 2004 11:16:00 PM UTC  #    Comments [8]
Tracked by:
"black dating latin" (online) [Trackback]
"hypnotized teen" (online) [Trackback]
Monday, June 06, 2005 5:35:15 PM UTC
Ever since reading IBM's Autonomouse computing manifesto I've beed dying to get more into Autonomous computing. I've only had time to read one book on it before real world demands took precedence. So I look forward to seeing you develop this project with Relish.
haacked@yahoo.com (Haacked)
Monday, June 06, 2005 5:35:15 PM UTC
Right, NSteer is an empty solution on my desktop. The rest is in my brains... If people are interrested, I'll surely &quot;host&quot; it in the <a title="MbUnit, Generating Unit Testing and Model Based Testing Framework for .NET Framework" href="http://mbunit.tigris.org" target="_blank">MbUnit</a> CVS
Jonathan de Halleux
Monday, June 06, 2005 5:35:16 PM UTC
Yes, yes, we are interested.
AI2004
Monday, June 06, 2005 5:35:16 PM UTC
Any news?
maiorfi@gmail.com
Monday, June 06, 2005 5:35:16 PM UTC
It works... but I need to find some time to publish this...
Jonathan de Halleux
Monday, June 06, 2005 5:35:17 PM UTC
If you need some help...just ask.
maiorfi@gmail.com
Monday, June 06, 2005 5:35:17 PM UTC
Peli's Blog
Monday, June 06, 2005 5:35:17 PM UTC
Peli's Blog
Comments are closed.