Evolution

In this lecture we introduce birth and death into our artificial societies. In these models an agent typically has an age attribute that is incremented each time the model is updated. When the agent reaches its last birthday—controlled by a life expectancy variable-- it dies.

Agents are also equipped with a fitness attribute. Interactions with the environment and other agents (which may be regarded as competitions or collaborations) cause the fitness of an agent to increase or decrease.

Just before a reasonably fit agent dies, it is given a chance to reproduce. Reproduction can be sexual or asexual. If an agent reproduces sexually, it selects a reasonably fit mate. The attributes of the offspring are random combinations of the attributes of the parent or parents.

Evolution as a Search Algorithm

While the fitness of an individual agent fluctuates from battle to battle, the mean fitness of the society as a whole increases from generation to generation. (This is another example of emergent behavior.)

Let's define agent space as the set of all possible combinations of agent attributes. We can think of the altitude of a point P in agent space as the fitness of the agent that possesses the particular combination of attributes described by P. Thus agent space can be a complex landscape of hills and valleys. We call this the fitness landscape. (The idea that a well defined fitness function exists seems problematic. The fitness of an agent depends on its competitors and chance.)

Evolution can be understood as an algorithm that searches for peaks in fitness landscapes. Starting with a collection of agents standing on random points in some fitness landscape, the evolution algorithm iteratively makes copies of the agents standing at higher points and deletes agents standing at lower points. The copies are imperfect, however. Therefore some of the new agents will be standing on slightly different points than their parents stood. While these newly occupied points might be close to home, they can have radically different altitudes—higher or lower. This is because most fitness landscapes are very craggy. For example, one tiny alteration in a gene sequence might cause a child to be born with a defective heart or a genius IQ. However, over time it will appear to us that the agents in our society are gradually marching up hills in the fitness landscape. (Of course they won't be the same agents; rather they will be successive generations of agents.)

In the version of the evolution algorithm discovered by Darwin, agents are organisms and fitness is the ability to survive in nature. There are many other versions of the algorithm, however. Agents can be products and fitness popularity. Agents can be ideas and fitness can be usefulness. Agents can be businesses and fitness can be profitability. Agents can be jokes and fitness can be funniness. Agents can be words and fitness can be expressiveness.

Genetic Algorithms

Suppose we encode the attributes of an agent into a single string. We can think of this string as a compact description of the agent. Imagine also that a parser or decoder exists that constructs agents from their descriptions.

For example, if agents are products, their descriptions can be viewed as design specifications. If agents are businesses, their descriptions can be viewed as business plans. If agents are organisms, their descriptions can be viewed as their genetic codes.

In this case we can think of the points in agent space as descriptions. Let's call this design space. The evolutionary algorithm that searches design space must first construct agents from their descriptions, then evaluate the fitness of the agent. During mating, the designs of the parents are combined by crossover and mutation to create the designs of their offspring.

This version of the evolutionary algorithm is called a genetic algorithm.

Models

Evo

These concepts are formalized in evo.nlogo.

Here's the update procedure:

to update-turtle
   if fitness <= 0 [die stop]
   ifelse age < life-expectancy
   [
      set age age + 1
      move
      update-fitness
   ]
   [
      if threshold <= fitness [reproduce]
      die
   ]
end

Here's a typical way fitness is updated:

to update-fitness
   let competitor one-of other turtles
      with [distance myself < proximity]
   if competitor != nobody [
      let my-score random fitness
      let competitor-score random ([fitness] of competitor)
      let reward 1
      ifelse my-score < competitor-score
      [
         set fitness max (list 0 (fitness - reward))
         ask competitor [set fitness fitness + reward]
      ]
      [
         set fitness fitness + reward
         ask competitor [set fitness max (list 0 (fitness - reward))]
      ]
   ]
end

Notice that the more fit turtle has a better chance of winning the competition.

 

Echo

Echo (sample models/Biology) is a model about the evolution of fitness, adapted from John Holland's book "Hidden Order" (1995).