Reproduction

The process of replication dominates the dynamics of the system. Here, we present an overview of the method by which programs reproduce, and we then discuss the exact implementation.

Self-Replication and Offspring

Reproduction in avida is typically carried out in four distinct processes:

  1. Allocation of new memory.
  2. Copying of the parent program into the new memory, instruction by instruction.
  3. Division of the program into parent and child programs.
  4. Placement of the child program into the lattice.

The first three processes are implemented in the instruction set (and are thus the responsibility of the individual program), while the fourth process is automatically handled by the environment when a successful division takes place.

In a correctly self-replicating program (see the example program in the Virtual CPU section), the size of the allocated memory is typically exactly the program's size (doubling the total memory from its original size), with division occurring at its midpoint after the copying process is finished. In principle, there is no reason that a program could not use a different method (such as tripling its size, and making two copies of itself, or creating a self-extracting smaller program); however, the instruction set (and the handwritten ancestor) are biased towards the first method.

The reproduction system is separated into two conceptual parts: first, the generation of offspring, which is handled by individual cells; and second, the placement of offspring, which is handled by the interaction lattice or the world structure.

Placement of the offspring is done in a localized manner; the offspring of a program can only be placed within the immediate neighborhood of that program's location (the near eight grid positions on a 2-D lattice). First, an empty location is sought; if no free location exists, the oldest cell (in the default scheme) is chosen and replaced with the offspring. The search for the oldest cell includes the parent program; thus, a creature can actually cause itself to be killed by the placement of its child.

The process of placement is entirely a function of the environment; as soon as a successful division occurs, the new program is automatically placed. It is intrinsically part of the ``physics'' of the system, while the replication process itself (the allocation, copying, and division) is part of the instruction set.

Choosing a Placement Method

In order to choose a method of placing a daughter cell, edit the ``Reproduction'' section of the genesis file (see the Configuration section). The BIRTH_METHOD variable determines how new offspring are placed, and this can have a large effect on the soup. If there are any empty cells available, they will always have top priority as possible locations. If none of the eight immediate cells connected to the mother are vacant, one of the surrounding creatures (or the mother herself) must be removed to make room for this new child. The options are:

  • Choose Randomly: a creature is chosen at random from the mother and its eight neighbors. This method is poor for evolution because approximately half of the creatures will be replaced before they have had any chance to have offspring, and hence will never have a chance to prove themselves.
  • Choose Eldest: this is the default method in avida. The creatures in the neighborhood around the mother (including the mother itself) will be evaluated, and the oldest of them will be removed. In the case of a tie, the cell to be removed for the new creature will be chosen randomly from the eldest ones.
  • Choose max Age/Merit (highest [age divided by merit]): this placement method favors creatures with a higher merit, and is an additional way to encourage creatures to learn specific tasks. With this birth method combined with the constant time-slicing scheme, the creatures will be given CPU time equivalent to other (time-slicing based) learning schemes. The difference here is that rather than having faster CPUs, the creatures will simply live for a longer period of time. See the Time Slicing section for more information on this.
  • Choose Empty: this is a very limited birth method which currently is useful only when death is turned on (see below). In this mode cells are prevented from killing each other, and only new born creatures are allowed to move into empty cells.
  • Choosing a DEATH_METHOD for the soup is somewhat less complicated. In this version of avida, there are three methods available. The first is to simply turn death off such that creatures can only die from being replaced by a newborn, and not through old age. The second way is to fix the maximum number of instructions that any creature can execute, effectively giving them a finite lifetime akin to decay. Creatures that hit this age limit are replaced by empty space. This age limit is specified by the AGE_LIMIT variable. Finally, the last method is to have the maximum number of instructions a creature can execute be a multiple of that creature's length. If you select this method, the maximum number of instructions that a creature can live is its length multiplied by AGE_LIMIT.


    NEXT: The Virtual CPU
    PREV: Time Slicing and the Fitness Landscape

    INDEX


    Page maintained by Charles Ofria
    Send all comments to charles@krl.caltech.edu