Evolife

Jean-Louis Dessalles


  1. Overall description
  2. How to execute Evolife (+ download)
  3. Evolife source files
  4. Evolife classes
  5. Evolife functions
  6. How Evolife works
  7. Create your own Evolife scenario
  8. Use Evolife’s components separately (graphics, ecology, genetic algorithm)




7. Create you own Evolife scenario


Evolife allows you to study an evolving population, either to implement a genetic algorithm or to perform some ecological study. If you do not need all of this, consider section 8 about using only some of Evolife’s components.

Evolife scenarios vary:

  1. by parameters and values defined in the configuration file (xxx.evo) that you load with starter.
  2. by different default functions implemented in Default_Scenario.py (in Scenarii) that you can redefine.

There are several possibilities to create your own scenario by rewriting functions from Default_Scenario.py:

You may look in Scenarii for the scenario that is closest to what you wish to do. Let’s mention:

You may cut-and-paste and rewrite all functions inherited from Default_Scenario (defined in Default_Scenario.py). These include:

Functions marked with ‘–’ are called from within the scenario.
Functions marked with ‘+’ are called from Group.py.
Functions marked with ‘*’ are called from Observer.py.

You may then run the scenario by choosing MyScenario.evo from the Configuration Editor.

To create a scenario from scratch

  1. Suppose you want to run a simulation of beehive. Create a new file, e.g. S_Beehive.py (or any appropriate name starting with S_) in the directory Scenarii by copying an existing scenario (pick the one that seems to resemble your own project most closely, e.g. S_SexRatio.py).
  2. Customize S_Beehive.py by rewriting any functions inherited from Default_Scenario (some have been listed in the preceding section).
  3. Create a Beehive.evo configuration file at an appropriate location (typically in the Expe directory). This file should include many of the parameter-value pairs that Evolife is looking for, such as PopulationSize or MutationRate.
  4. You can edit the new parameter-value pairs you introduced in the .evo configuration file using the confituration editor (starter). Your parameters will be merely added at the bottom after you have loaded Beehive.evo. If you want a cleaner aspect, you should edit the appropriate .xml file loaded by starter. Then restart the Configuration Editor by executing ./starter. After setting all relevant parameters to the desired values, you can run Evolife with your scenario by clicking on [Run].