Cost: NA
About These Ratings
Difficulty: Danger 0: (NA) Utility: This column is of historical interest only.

------------------------

Artificial Life: Boids of a Feather Flock Together

---------------------

by Shawn Carlson
Nov,2000

---------------------

Scientists sometimes struggle to understand why certain animals act as they do, especially social animals. A school of fish or a flock of birds, for example, behaves in many ways like a single creature. Yet exactly how the individuals organize themselves into a "superorganism" is still very much a mystery.


Figure 1: CYBERBIRDS, dubbed Òboids,Ó can be created on a computer) using software developed by Craig Reynolds.

But believe it or not, these days insights into such self-organizing communities seem to come more often from computer hackers than from field biologists. Many programmers are creating on their desktops virtual environments populated with simulated animals. The nature of these artificial life-forms (or "a-life," for short) usually hinges on a special data string, which is analogous to the DNA blueprint of a living organism. This digital code defines how an a-organism interacts with its cybersurroundings and determines the likelihood that the simulated creature will reproduce.


Although each virtual creature follows only a few simple rules, when a group of them encounters an obstacle (left), the individuals split up (center) and later rejoin (right), mimicking a flock of real birds.

To mimic real DNA, the cybercode is programmed to experience random mutations, which can alter the fitness of the artificial animal. So by tracking many generations of these byte-size beasties, you can in several minutes watch their digital DNA evolve in ways that might take nature millions of years to accomplish with a real genetic code. With much of this software available online (consult the premier a-life Web site, www.alife.org, or see www. aridolan.com/ad/adb/adib.html for an index of sites where you can download Java scripts), any interested amateur can now plumb the depths of evolution, at least in these virtual worlds.

If you take up this challenge, you'll be joining the ranks of people such as Craig Reynolds, now with Sony Computer Entertainment, who in 1986 developed an impressive model of flocking birds. Reynolds speculated that each bird in a flock acts on a simple set of directives. So he programmed his a-life creations, which he whimsically dubbed "boids," to follow just three rules. first, don't get too close to anything, including other boids. Second, try to match your velocity to that of the other boids around you. And third, always move toward the center of the pack of nearby boids.

The results of his simulation are remarkable. (Check out www.red3d.com/ cwr/boids/ for an eye-popping animation.) No matter how the boids are initially scattered, they quickly form a flock. When the group encounters an obstacle in cyberspace, it splits into two groups and reassembles on the far side.

Reynolds's boids seem to support the fascinating theory of emergent behavior, which describes how complex social interactions can arise when individuals obey a few rudimentary but very special rules. Reynolds's code contains no reference to flocking, much less any instructions for how a flock should navigate obstacles. And whereas most programs can't deal with situations that the programmer does not anticipate, in this simulation the boids execute a surprising array of sensible responses to unforeseen challenges. Reynolds remains a leading pioneer on the virtual frontier: his applications of computer animation to motion pictures won him an Academy Award in 1998.

JAVA APPLET allows interested Web surfers to simulate carnivorous boids, called ÒfloysÓ.

 

Ariel Dolan, a computer programmer in Ramat-Gan, Israel, has added a delightful twist to Reynolds's creation by developing carnivorous boids, dubbed "floys" (pronounced "flow-eez"). Your gateway to Dolan's a-life aviary is at www. aridolan.com/efloys.html, where you will find Java scripts that produce simulations that are truly a treat to watch.

Dolan's floys follow just two rules: stick close to your fellows but not too close, and when you spot an intruder, move toward it and attack. These instructions also generate a flock. But the assembly benefits individuals in an unexpected way. Avoiding too much togetherness causes the floys to move in an ensemble that spreads out over a substantial region. They thus patrol airspace that extends far beyond the sensory range of any one floy. Whenever an outsider approaches, the nearest floy moves toward it. And because its compatriots are all programmed to remain together, the nearest neighbors follow along, as do their wing men, and so on.

A sequence of snapshots (top to bottom, right) shows what happens when a band of floys (green) detects a lone intruder (red) and hunts it down as the besieged interloper tries to flee.

A sequence of snapshots (top to bottom, right) shows what happens when a band of floys (green) detects a lone intruder (red) and hunts it down as the besieged interloper tries to flee.

The result is quite striking. Challenged by an enemy, the entire flock turns quickly and pursues the intruder, including those floys that were initially too far away to sense the presence of the interloper. The swarm soon engulfs the invader, which ends up fighting for its a-life. This scene is not unlike what would happen to a hapless water buffalo that wandered into a lake infested with piranha.

Like feasting piranha, each floy is rewarded for every successful "bite" that it takes. In Dolan's boid-eat-boid world, each morsel delivers one unit of energy from prey to predator. Fast floys have more opportunity to gorge, but they burn up energy rapidly while flying. Slow floys use less energy, but they tend to reach intruders last, and so they collect less sustenance.

Dolan's code generates mutations in the instructions for speed and energy consumption and in other parameters as well, including how closely individuals approach one another, how fast they accelerate and even the probability that they will disobey the rules. Dolan's program also ensures that the floys with the most energy are the most likely to reproduce and pass on their traits. So as the cybergenerations pass, the population becomes ever better adapted to live within its virtual realm.

Armed with Dolan's code and a little imagination, anyone with modest programming skills can perform all kinds of original investigations. I am now trying to understand why high levels of aggression survive in a population when this tendency so often seems self-destructive. My new version sets two bands of floys against each other. A floy still loses energy when it gets bitten by one from the enemy camp. But because warriors don't gain strength when they strike a foe, successful floy fighters in my simulation don't gain energy when they bite an opponent. The result is a melee in which the winner is determined entirely by numbers, energy reserves and the rules of probability.

I plan to modify the code to allow for floys with three distinct levels of inborn hostility. When a floy receives one cybergene for aggression from each parent, it will be especially combative and will fight to the death with all foreigners. A floy that inherits only one gene for aggression will battle until its energy reserves get low and then retreat. And a floy with no genes for aggression will withdraw from all fights.

Here's what I think might happen. When the population encounters an enemy group of overwhelming strength, only some of the band will do battle, while the aggressionless individuals will retreat. When energy reserves eventually run low, the modestly aggressive floys will join their nonaggressive comrades. But the highly aggressive floys will continue to engage the enemy, thereby protecting the retreating floys from attack. Although these steadfast warriors will ultimately be destroyed, most of the original population will survive--not bad, considering that a uniformly aggressive population would be killed off completely. And because more hyperaggressive individuals will appear in the next generation when the surviving floys with single genes for aggression mate, this strategy may be continued indefinitely. So some individuals in a warring population might always have destructively aggressive tendencies--not for their own protection but to ensure the survival of their pacifist brethren. Dolan's floys allow me to explore this notion.

Artificial life-forms can also be used to examine problems that have nothing to do with biology. For example, some investigators have used computer simulations of this kind to probe the mysteries of traffic flow (see, for instance, www.theo2. physik.uni-stuttgart.de/treiber/Micro Applet/). My good friend Greg Schmidt believes that Dolan's floys may, in fact, need little modification to model the way people drive on California highways. As with my version, the actions of each floy could be determined in part by an aggression parameter, which would make some floys more likely to speed, swerve in front of others or drive on the shoulder during traffic snarls. Such a model, borrowed from a simulation of birds, could offer important insights into traffic management. At the very least, it might one day explain why drivers prone to rush-hour road rage always seem as common as crows.

The Society for Amateur Scientists (SAS) is a nonprofit research and educational organization dedicated to helping people enrich their lives by following their passion to take part in scientific adventures of all kinds.

The Society for Amateur Scientists
5600 Post Road, #114-341
East Greenwich, RI 02818
Phone: 1-401-823-7800

Internet: http://www.sas.org/

 

American Science & Surplus offers a unique mix of industrial, military and educational items, with an emphasis on science and education. We supply a wide range of unusual and hard to find items (some say bizarre stuff) to the hobbyist, tinkerer, artist, experimenter, home educator, do-it-yourselfer, and bargain hunter.

American Science & Surplus
P.O. Box 1030
Skokie, IL 60076
847-982-0870 Voice
800-934-0722 Fax

info@sciplus.com

http://www.sciplus.com