Configuring Avida Runs

Avida runs can be setup in detail through the use of several different files; a genesis file, a file defining the instruction set, one listing the events to occur during the run, a creature file (which is used to initialize the soup), and finally a file which indicates bonus levels for tasks. By default, these files are (respectively):

  • genesis
  • inst_set.24.base
  • event_list
  • genebank/creature.base
  • task_set
  • A description of each of them follows.

    The Genesis File

    The genesis file initializes many variables within an avida run. The basic format for the file is:

    This file is split up in a number of sections, each of which contain a selection of variables (described briefly within the actual file). Here we attempt to fully detail the use of each variable.

    The first section in the genesis file, ``Architecture Variables,'' determines the overall structure of the run. These settings are:

  • MODE: This variable sets the geometry of the soup. Only two options are available in version 1.0 of avida: mode 1 (a tierra emulator), and mode 2 (the default avida).
  • MAX_UPDATES: Determines the number of updates the run should last. For a baseline, the default setup (50000 updates with a 60×60 world and an average time slice of 30) will take about 5 hours on an unloaded 200MHz Pentium Pro. A value of 0 for this variable will prevent the run from ever terminating by itself.
  • WORLD_SIZE: This is used only in tierra mode. It will determine the maximum number of creatures which should be in the population. By default, this is set to 3600.
  • WORLD-X and WORLD-Y: These determine the dimensions of the lattice in avida mode. By default, these are both 60, hence the population has 3600 creatures in it. The minimum for each of these (due to some algorithms used to speed up portions of avida) is 3.
  • RANDOM_SEED: This is a number off of which all of the randomness in avida is based. If the seed is altered from one run to the next, the runs will progress in different manners. On the other hand, a single run can be repeated exactly by keeping the seed the same. For a seed based on the current time, use 0 here.
  • The ``Configuration Files'' section of the genesis file determines which other files should be used to configure the avida run. Note that to change the genesis file used, use the command line option: -g <genesis_filename>

  • DEFAULT_DIR: This is the directory where avida will look for the remaining configuration files. By default, ../work/ will be used (thus any directory on the same level as work will find the configuration files.) This should be changed to an absolute path, so that the configurations can be found if you run avida from anywhere else on your system. Note that the genesis file must be in the same directory as avida unless the -g option is used to specify its location on startup.
  • INST_SET: The instruction set file to be used for this run. This file configures the assembly language used by the virtual CPUs. The default is inst_set.24.base. See later in this section for more details on how the files are set up and which ones are available with the avida distribution.
  • TASK_SET: The task set file to be used. This file configures the rewards given to CPUs for performing specific tasks. The default is ``task_set.'' See later in this section for more details on modifying this file.
  • EVENT_FILE: The event file contains a list of specific actions which should occur during the run. The default file used is called ``event_list.'' See later in this section for more details.
  • START_CREATURE: This option designates the file of the ancestor program which should be used to seed the soup. The default ancestor is located in genebank/creature.base. See later in this section for information on how creatures are stored in files.
  • The ``Viewer'' section has only a single variable; VIEW_MODE. This determines the screen which the user interface initializes to when an avida run is started. By default, it is blank to maximize the speed of the run, but the options are 0=BLANK, 1=MAP, 2=STATS, 3=HIST, 4=OPTIONS, and 5=ZOOM, each of which directly correspond to a view in avida.

    The next three sections in the genesis file (``Reproduction,'' ``Mutations,'' and ``Time Slicing'') are all quite important, as the variables there can have a very large effect on runs, and as such each are described in more detail in their own manual sections (Reproduction, Mutations, and Time Slicing and the Fitness Landscape respectively).

    The ``Genotype Info'' section controls what information we record about genotypes and species. The variables are:

  • THRESHOLD: This value determines the number of creatures which must be present in a genotype in order for it to be statistically interesting. Typically this is set to 3; if a genotype does not have at least 3 members it probably cannot reproduce itself, and a non-replicating genotype will be unlikely to have a full 3 members just by chance.
  • GENOTYPE_PRINT: This is a 0/1 on/off switch. When it is turned on, all genotypes that become threshold will automatically be extracted to the genebank directory. Each of these files will be small, but if a run continues for a long time there can literally be millions of them, so be careful!
  • SPECIES_PRINT: This works similar to the previous variable, but only prints out the representative genotype every time a new species is created. The files names are in the format: spec-number.
  • GENOTYPE_PRINT_DOM: Again, this works similar to the previous two variables, but it causes only the genotype which is currently dominating the population to be extracted into the genebank directory. Additionally, if a value larger than one is placed here, the genotype would have to be dominant for at least that many consecutive updates before it is printed. Hence a 10 would only have a genotype printed after it was the most abundant in the soup for a full ten updates.
  • SPECIES_RECORDING: This setting determines if we should keep species information during a run. Setting this variable to 0 turns this feature off; switching to 1 keeps full information (i.e., every time a new threshold genotype is created, it is checked against all current species to see into which, if any, it best fits). Finally, setting this switch to 2 keeps limited information; it only compares the new threshold to the species of its parent genotype. In practice, settings 1 and 2 produce similar results as it is rare for multiple genotypes to evolve into the same species independently. As setting 2 is significantly faster, it is the default.
  • SPECIES_THRESHOLD: When comparing two different genotypes to determine if they are the same species, we cross them over at all possible points and then count the number of times the hybrid creature fails to reproduce. The value of SPECIES_THRESHOLD determines the maximum number of failures allowed for them to still be considered the same species.
  • Finally, the ``Data and Log Files'' section determines if and how often information should be added to various output files. For all files, a 0 next to the appropriate variable indicates that the file should not be printed at all. For the data and status files, a positive number indicates that the files should have information added to them this set interval of updates. Most of the data files have a default value of ten, and hence are updated every tenth update. For log files, a tag other than 0 implies that this file should be produced. See the Guide to Output Files for more information on exactly what is recorded in each of these files.

    The Instruction Set File

    The instruction set file is one of the simplest to modify. It consists of a list of possible commands for the virtual assembly language, each with a 1 or 0 next to them determining if they should be included. Any instruction not listed here will automatically be assumed to have a 0 next to it (so, theoretically only the included instructions need to be in the list.)

    Avida comes with a selection of default instruction set files that are each for a specific purpose. Those files are:

  • inst_set.24.base : This is the default instruction set, as described in the Virtual CPU section.
  • inst_set.24.const : The const instruction set prevents creatures from changing their size. Instead of the allocate and divide instructions from the default set, they use c_alloc and c_divide which prevent any size changes in the creatures.
  • inst_set.25.error_check : The error-checking instruction set adds the single instruction if-n-cpy to those available in the default set. Higher mutation rates will actually cause creatures to learn to double check all of their copies, and re-do those which have failed.
  • inst_set.27.parasite : The parasite instruction set adds the commands jump-p, rotate-r, and rotate-l to the default one. This allows creatures to select an adjacent creature as host (using the rotate instructions) and jump into its memory to execute its code. Do not use the Death function (DEATH_METHOD other than 0) with this instruction set.
  • For more information on how each instruction actually works, see the Virtual CPU section.

    The Event File

    This file configures the events to occur during an avida run, by listing the update it should happen at, the name of the event, and any relevant arguments for it. The format is:

      <update> <event-name> [<args>...]
    

    As an example, if a creature named creature.happy is to be injected at update number 42 into CPU 100, the following line should be added to the file:

      42 inject creature.happy 100  
    

    Only four types of events are enabled in avida Version 1.0. Those are:

  • cycle <cycle_length> <event>: Execute the <event> listed every <cycle_length> updates.
  • inject <filename> <cpu_num>: Put the creature located in <filename> into CPU number <cpu_num>.
  • pause: Freeze the avida run in the viewer. This will not work with viewers that do not have the ability to pause.
  • set_copy_mut <new_mut_rate>: Reset the copy mutation rates in all the CPUs to <new_mut_rate>.
  • The Genebank Files

    Avida comes with a selection of possible ancestor creatures to initialize (or inject into) runs, located in the directory genebank. These files include the code of the creatures, and are often commented. Comments all start with a # symbol; it and all of the text following are ignored when the creatures are loaded into avida (as are blank lines). The creature files which are included in avida are:

  • creature.base : The default creature used in avida; 31 lines long.
  • creature.error_check : This creature uses the error checking instruction set to decrease its effective copy mutation rate.
  • creature.host and creature.parasite : These creatures are a pair such that the host is capable of self replication on its own while the parasite only calculates its own size and then jumps into the host to finish the remainder of its replication.
  • creature.small : This is a small creature capable of self-replication as described in the Virtual CPU section
  • The Task File

    The task_set file lists all of the possible bonuses that avida creatures can receive, and the relative level (on an exponential scale) of that bonus. To be exact, a bonus b multiplies a creature's merit by 1 + 2b-3. Thus a bonus of 3 would double the merit, and 4 would multiply it by 3.

    The file is set up so that each task in avida is listed, followed by the bonus it should trigger for this run. After this (as comments), the meaning of this task is given, as well as the minimum number of nands a program would need to use to be able to complete the operation. The task_set file is located by default in the work directory.

    Command Line Options

    There are five command line options implemented in Version 1.0 of avida. They are:

  • -g[enesis] <filename>: This option allows the use of a genesis file other than the default genesis.
  • -h[elp]: This option simply lists all of the command line options available in avida.
  • -s[eed] <value>: Set random seed to the value given.
  • -v[ersion]: This will give the version number for this avida. This manual is written for avida Version 1.0.0. The version ID is broken up such that the first number is only changed if there is a major structural revision, the second number is changed for all significant changes to code, and the final number is changed every time there are bug fixes implemented (thus, this manual should be good for all avida versions 1.0.x)

  • NEXT: A Guide to Output Files
    PREV: The Text Interface

    INDEX


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