Skip to content

Parameters

Clifford Bohm edited this page Aug 28, 2017 · 5 revisions

Parameters provide a method for users to define how MABE will operate. Parameters control things like how long MABE will run, how large a population will be, what kinds of genomes and brains will be used along with literally hundreds of other options. The simplest way to change a parameter, is to just change the parameter in a settings file.

Creating Settings Files

If you run MABE with the '-s' command line option, MABE will generate settings files.

./MABE -s

If any files settings are being loaded (see -f option below), or if any parameters are defined on the command line, then the new settings files will incorporate values from the loaded files and command line.

Using Settings Files

The "-f" option tells MABE to load settings files.

./MABE -f settings.cfg settings_organism.cfg settings_world.cfg

If you looks at the contents of a settings file (settings.cfg for example) you will see something like this:

% GLOBAL:
  mode = run                          # (string) mode to run MABE in [run,test]
  outputDirectory = ./                # (string) where files will be written
  popSize = 250                       # (int) number of genomes in the population
etc...

Each line contains either a "%" followed by category name or the name of a parameter. Everything after a "#" is a comment. Generally, comments will contain the type of the parameter and a short description of what the parameter does. Comments are ignored by MABE.

a little more on "%"... a "%" in a config file sets a cateroy name. Until the next "%" and parameters read from the file will have the category name and a "-" prepended. This means that popSize in code above is really GLOBAL-popSize.

If you just wanted to set some parameters, you could create a settings file like this:

%
GLOBAL-mode = run
GLOBAL-outputDirectory = ./
GLOBAL-popSize = 1000
ARCHIVIST-outputMethod = default
ARCHIVIST_DEFAULT-realtimeFilesInterval = 25
BRAIN-brainType = Wire
BRAIN_WIRE-decayDuration = 3

We find some users do not like working with MABE created config files because they tend to include a lot of parameters that they are not interested in. One option is to change the relevant parameters defaults in code and recompile. While this will technically work, you run into two problems: You need to remember to reimplement these alterations if you receive updated code, and another user could use your code but not realize that you had changed the defaults. A better solution is to leave everything default and create a config file with only the parameters you are interested in changed.

Command line parameters

Any Parameter in a .cfg file can also be set on the command line by using the -p option followed by the parameter name and value. The parameter popSize appears like this in settings.cfg:

% GLOBAL
popSize = 250

If you wanted to set popSize on the command line you would run:

./MABE -p GLOBAL-popSize 500

After -p, you can list any number of parameters in any order.

./MABE -p GLOBAL-popSize 500 GLOBAL-randomSeed 102 GLOBAL-updates 5000 BRAIN-brainType Markov

Command line vs. settings.cfg vs. default settings

Parameters set on the command line override parameters set in .cfg files... which override default settings (values that MABE defines in the code).

Parameters Tables

ParametersTable is a data structure with is used to store and manage parameters. Parameters links are used to interface with ParametersTables.
Click here for more on using ParametersLinks in code
Click here for a detailed description of ParametersTables

Clone this wiki locally