EMERGENT BEHAVIOR
Two applet demonstrations of emergent behavior are provided below. The first is the classical
(?) ants simulation and the second is a variant thereof which I designed.
A Win32 (PC) application, "Anagram", that involves agents and flocking behavior in a multi-agent
system is available for download here.
Ant Simulation
The ant simulation is based upon the concept of having multiple entities
that behave to a common set of rules, i.e., each ant's behavior is driven
by the environment and the rules common to all ants. These rules, which
approximate real ants and are programmed in this example, are:
-
Ants wander randomly in search of food or the scent left by another ant.
In the simulation, the wandering has a diagonal bias.
-
If an ant stumbles upon some food, it picks up a piece and carries it to
the ant hole (in the center of the display).
-
As an ant carries food to the ant hole, it leaves a scent along its trail.
-
Upon reaching the ant hole the ant leaves the food and follows the trail
it left back to the food.
-
An ant that stumbles across a scent follows the scent from the newest to
the oldest adjacent scent.
-
If an ant is following a scent and gets to the end of the scent trail and
doesn't find food adjacent thereto, it wanders around in a circle for a
while. If it still doesn't find food, it ignores the scents for a while
as it returns to random searching.
These behavioral rules produce the ant-trail like behavior we have all
seen.
When running the example, after the screen appears, click anywhere to
drop the "FOOD". Then press the "Start" button and watch the show.
Ant
Demonstration.
Letter Movers
The letter movers simulation is a variation on the ant simulation. In this
simulation an ant field is shown with the letters A, B and C on it. The
user moves the letters around on the screen then starts the simulation.
The ants will move the latters back to their original locations.
The letter mover ants have a behavior similar to the conventional ants
except that instead of taking the letters to the ant hole, they move their
pieces a fixed x,y distance needed to return the letters to their origins.
When running this example, after the screen appears follow the instructions
there upon. Letter Mover Demonstration.