Emergent Behavior

Sometimes a population of agents can exhibit complex behavioral patterns even though the behavior pattern of individual agents is simple.

Models/Biology/Fireflies (Spontaneous Synchronization)

Spontaneous synchronization is a more mysterious form of emergent behavior in which the cyclical behavior of a system's components or agents tend to align with each other. Check out this video: metronomes . Here's a cool TED talk by mathematician Steven Strogatz. After you're done watching this, take a look at the video of the Tacoma Bridge collapsing.

Certain types of fireflies will synchronize their flashing. In this simulation each firefly (turtle) has a cyclical clock. During a certain period the firefly flashes yellow, otherwise it turns dull gray. Initially, the clocks aren't synchronized, so neither is the flashing.

During a brief period in the dark part of the clock's cycle, the firefly counts the number of flashing neighbors. If it is above some threshold, the firefly will reset its clock to some fixed point in the cycle.

Here's another interesting link:

http://home.clara.net/heureka/books/synchronicity.htm

 

Models/Biology/Ants

Ants aren't very smart, yet a colony of ants will exploit food sources in order of their distance from the colony. In other words, we could use a colony of ants to sort a list of numbers.

In the Ants model ants (turtles) wander around randomly. If one finds a piece of food, he brings it back to the ant hill, leaving a chemical trail as he goes. The chemical has a diffusion rate (the width of the trail) and evaporation rate (how long the trail lasts). Both of these can be controlled by the user.

If a wandering ant comes across a chemical trail, he follows it to its source. If he finds food, he brings it back to the ant hill and reinforces the chemical trail.

Models/Biology/Termites

Termites provide us with an excellent example of emergent behavior: stacking woodchips. How do they do it? Actually, it's pretty simple. Each termite roams around randomly until it finds a woodchip. It picks up the chip and resumes random roaming until it finds another woodchip. It then drops the woodchip it is carrying and goes off to look for another woodchip. Pretty soon, we have piles:

Models/Biology/Flocking (Boids)

Flocking birds, schooling fish, swarming bees, and conforming humans aren't necessarily following a leader. In this simulation boids (virtual birds) follow three simple rules:

Alignment: Turn as your nearest neighbors turns.

Cohesion: Turn to get closer to your nearest neighbor.

Separation: Turn away if too close.

Actually, there's a fourth rule: when a predator comes, scatter.

Here's the procedure:

to flock
   find-flockmates
   if any? flockmates
   [ find-nearest-neighbor
      ifelse distance nearest-neighbor < minimum-separation
      [ separate ]
      [ align cohere ]
   ]
end

And a screen shot:

Models/Sociology/Voting

Our political opinions are carefully reasoned, right? Then why are there red states and blue states? The truth is, our political opinions are heavily influenced by the opinions of our neighbors.

In this model patches represent voters. There are two parties: the green party and the blue. During each cycle a voter observes how his eight neighbors vote (remember, turtles live in a donut-shaped pond, so there are no edges). If a clear majority votes blue or green, then the patch changes his vote to blue or green, respectively. Switches allow the user to specify how ties or close calls should be handled.

If both switches are off, the voters quickly Balkanize into blue and green voting blocks:

Turning one of the switches on also leads to voting blocks, but with lots of waffling at the borders. With both switches on voting blocks don't seem to develop.

Models/Sociology/Segregation

The whole idea of using computer simulations to look for patterns in societies got started with Thomas Schelling's Tipping Model. Sociologists were baffled by Boston's segregated neighborhoods. When interviewed, the inhabitants of these neighborhoods said they would feel comfortable some having racially or ethnically different people living in the neighborhood.

In this simulation patches represent neighborhoods. There are two turtle "races" red and green. A turtle is happy if the number of similar neighbors exceeds some minimum percentage. Unhappy turtles jump from patch to patch until they find an unoccupied patch.

Notice that even when a turtle only needs 30% of his neighbors to be of the same race, we still see segregated neighborhoods.