Heatbugs
 

Heatbugs

Heatbugs is one of our canonical Swarm demonstrations, an example of how simple agents acting only on local information can produce complex global behaviour. It's simply a toy, but a nice demonstration of the concepts Swarm is about.

Figure 1. The Heatbug world

The Heatbug world

Each agent in this model is a heatbug. The world has a spatial property, heat, which diffuses and evaporates over time. In this picture, green dots represent heatbugs, brighter red represents warmer spots of the world.

Each heatbug puts out a small amount of heat, and also has a certain ideal temperature it wants to be. The system itself is a simple time stepped model: each time step, the heatbug looks moves to a nearby spot that will make it happier and then puts out a bit of heat. One heatbug by itself can't be warm enough, so over time they tend to cluster together for warmth.

Figure 2. Data from the system

Data from the system

You can think of the heatbugs system as an optimization problem: each heatbug is trying to minimize its unhappiness. The graph above demonstrates how well, over time, the average unhappiness of all bugs is being optimized. In this system, even though each bug is acting purely selfishly the average unhappiness over time is improving.

This graph represents only one small part of Swarm data collection, a simple (hardcoded) time-series graph. The Swarm system supports a variety of generic methods for tapping data from components of the system, combining those data through statistical filters, and displaying then with generic visualization objects or saving them to files. Much of this support is still under development, and so is not shown here.

Figure 3. Controlling the system

Controlling the system

Part of the reason we build simulations is we can go in, tweak a few parameters, and see how the change affects things. The two windows shown above are a snapshot of some of the control features of Swarm: a form for user input of parameters, and a control panel to start and stop the simulation. Swarm models can also be configured and driven via the Lisp scripting language.