Menu

Main Settings

Giovanni Squillero

Main Settings

The file ugp3.settings.xml is µGP's main configuration file. Inside the file, you will find several separate scopes ("contexts") that enclose groups of related options.

Evolution Context

This context includes parameters tied to the evolution.

populations: is a list of the populations that will be managed by ugp3 during the next run of the program. Each population is described by a name (that will be visualized in µGP logs) and a value, which is the reference to a population file. In the same evolution you might have populations with different characteristic (e.g. size, stop conditions, genetics operators applied to individuals, etc.)

randomSeed: is an optional parameter, that fixes the number the internal random number generator of µGP is seeded with. It can help to replicate an experiment, which is a precious feature for stochastic algorithms. If randomSeed is not present or 0, the seed is automatically set to the number of seconds since January, 1st 1970 (a.k.a., The Epoch). This option is only useful if the toolkit is starting from scratch. Otherwise, the status of the pseudo-random number generator will be restored.

statisticsPathName: is the path name for the statistic file, which stores some numbers describing the evolution. A new statistics file (with a different name) will be created if the file already exists. See format of evolution statistics.

migration: is an optional parameter, that is actually used when more then one population is specified. Following the island paradigm (see Islands and migration for more details), some individuals can be copied from one population to the others, after a specified number of generations. At the moment, only the classical migration option is implemented: its syntax is <option name="migration" value="classical; <number of individuals>; <interval>"/>, so every <interval> generations, the best <number of individuals> individuals from a population will be copied to the others.

Below, an example of an evolution context that has two populations (named pop1 and pop2), a fixed random seed and saves the statistics into file statistics/statistics.csv. Due to the specified migration option, the best individual of each population will be copied into the other, every 20 generations.

 <context name="evolution">     
     <option name="randomSeed" value="42" />     
     <option name ="populations">     
         <population name="pop1" value="population.settings.xml" />     
         <population name="pop2" value="population.settings.xml" />     
     </option>     
     <option name="statisticsPathName" value="statistics.csv" />
     <option name="migration" value="classical; 1; 20"/>
 </context>

Recovery Context

This context describes details related to the recovery of an interrupted
evolution.

recoveryOutput: is used to specify the name of the status XML file where the information about the population(s) will be stored. This file is used to save the state of the evolution at each generation. If an evolution is interrupted, it is possible to resume it by typing ugp3 --recoveryInput status_file The default name for the status file is status.xml.

recoveryOverwriteOutput: is a flag, which can assume value false or true: if it is set to true, the original status XML file the evolution is resumed from will be overwritten after the first generation of the new run; otherwise, the state of the evolution will be saved on a new file.

recoveryDiscardFitness: is a flag, which can assume value false or true: if it is set to true, the fitness of each individual in the recovered population will be recomputed when the evolution is resumed; otherwise, the individuals will have the fitness already stored in the status file.

Below, an example of a recovery context that saves the output in a file called status.xml, is set to overwrite the file in case of a resume, and will not re-compute the fitness of the individuals.

 <context name="recovery">
     <option name="recoveryOutput" value="status.xml" />
     <option name="recoveryOverwriteOutput" value="true" />
     <option name="recoveryDiscardFitness" value="false" />
 </context>

Logging Context

This context describes options related to the logging of µGP activities. Is it possible to have different logs, at different levels of detail, from an overview on the progress of the evolution to a debug log for developers.

Each option is defined by the name of the file the output will be directed to (std::cout for an output to screen), and a value that defines verbosity and formatting.

There are six options for verbosity, from the most verbose to the least:

  • debug all possible information
  • verbose: a lot of information
  • info: standard information
  • warning: only warnings and errors
  • error: only errors

Each option includes the output of all the previous ones.

The default option for output to screen is info.

For the formatting field there will be several options in the future: right now, the only one completely working are:

  • brief: a compact, human-readable tag is associated with each log line
  • extended: complete information with each log line. This includes: date and time; exact source line generating the message; type of message.

Below, an example of a logging context with two outputs, one essential to screen, one at the debug level to a file named logs/debug.log.

 <context name="logging">
     <option name="std::cout" value="info; brief" />
     <option name="logs/debug.log" value="debug; brief" />
 </context>

Related

Wiki: Home