Lesson 3 - Lesson 5 - Main page - Algorithm-Based - Component-Based - Hints - EO documentation

Tutorial Lesson 4: fully operational EA

In this lesson, you will still use the same Evolutionary Algorithm. But this time you will have full control of all components from the command-line or a parameter file. You can even use the algorithm decribed here without any other knowledge of EO, just by writing your fitness function as a plain C++ function. This is why this lesson starts with a user's guide, most of it being representation-independent, with some parts that are specific of respectively the binary and the real algorithms.
However, the ultimate purpose of this tutorial is to be able to do your own experiments - and these these will likely fall outside the scope of these two programs. This is why you should also read the programmer's guides, as the structure and memory managements are here radically different that in the 3 previous lessons - though relying of course on the same objects.
 



User's guide

As already said, the behavior of the algorithms will be exactly the same as the previous one as far as optimization is concerned. Only now you will be able to tune every component of the algorithms (except the type of genotype) using run-time parameters.
Also, as in previous lessons, most of the code is representation-independent, i.e. is the same for both the binary genotypes and the real-valued genotypes. This small user's guide reflects that, but you can go directly to the binary or the real parts if you wish.

Warning: this is a user guide, not a programming guide. In particular, the keywords of the parameters are not the names of the underlying classes (though they should be similar in most cases).

User's guide: Parameter input The way to input parameters has already be described in Lesson 3. To get a list of parameters, type the command with option --help (or -h): with both testBit and testReal this will result in

User's guide:The status file
This file will always contain the list of the parameters that have been actually used by the last run of the program, however thay have been entered (try testBit -G1 and take a look a the status file). The parameters that are commented out (a # character comments out the rest of the line) in the file are those that were not specified by the user.

User's guide:Representation-independent parameters
The parameters are organized in sections. In what follows, the fixed font colored text is directly taken from the status file and is commented between the lines.



Section ###### General ######
# --help=0 # -h : Prints this message
Boolean parameter of absolutely no interest: tells whether or not help was requested.

# --seed=988700289 # -S : Random number seed
Unsigned long parameter: the seed for the Random Number Generator If the parameter is absent, then time(0) is used, which indicates the number of seconds since Jan. 1 1980, is used ... and stored in the status file, of course, so you can repeat the same run by simply assigning that value again. There is no default value ("true" random seed).



Section ###### Output ######
This section contains parameters related to output (to screen, to files, graphical, ...).

# --useEval=1 # Use nb of eval. as counter (vs nb of gen.)
Boolean parameter: whether or not you want the nb of evluations to be displayed and used as counter in statistics outputs and plots. Default is true.

# --printBestStat=1 # Print Best/avg/stdev every gen.
Boolean parameter: toggles screen output of indicated statistics. Default is true.

# --plotBestStat=0 # Plot Best/avg Stat
Boolean parameter: toggles gnuplot output of best and average plots (Linux only at the moment). Default is false.

# --BestFileName=best.xg # Name of file for Best/avg/stdev
String parameter: if present, the statistics are stored in that file (no default)

# --printPop=0 # Print sorted pop. every gen.
Boolean parameter: adds a dump of the whole population to the screen every generation. Is likely to generate huge output! Default is false.

# --printFDC=1 # Print FDC coeff. every gen.
Boolean parameter: adds Fitness Distance Correlation to output every generation. Default is false.

# --plotFDCStat=0 # Plot FDC scatter plot
Boolean parameter: toggles the Fitness Distance Correlation plot (Fitness vs distance to best). Default is false.

# --plotHisto=0 # Plot histogram of fitnesses
Boolean parameter: if on, gnuplot is used to plot the sorted population (fitness vs rank). Gives a graphical idea of the diversity. Default is false.



Section ###### Persistence ######
This section contains parameters handling job dump and restart mechanism

# --Load= # -L : A save file to restart from
String parameter: if present, the initial population (and the RNG) is read from indicated file. That file must come from a previous save (or must be in same format!), i.e. must contain a popualtion, the RNG and all parameters. If no other parameter is modified, using a previously saved population and RNG will give exactly the same results than having run that previous run longer. And a way to be sure to re-use the same parameters is to ... use that very save file as parameter file, as it contains all actual parameters in the right format.
Note that if not enough individuals are read, the remaining are randomly initialized. No default value.

# --recomputeFitness=0 # -r : Recompute the fitness after re-loading the pop.?
Boolean parameter: in case some individuals are read from a file, their fitness is read too. If this one is true, it is nevertheless recomputed. Default is false i.e. use fitnes that's in the file.

# --saveFrequency=0 # Save every F generation (0 = only final state, absent = never)
Integer parameter: interval between two dump to disk of the whole population (+RNG + parameters) to disk, in a file named genNN.sav, where NN is the generation number. If this prameter is present (even with 0 or negative value), the final population will always be saved, whatever the reason for stopping. Hence the only way to avoid all saves is to omit the parameter (there is no default value).

# --saveTimeInterval=0 # Save every T seconds (0 or absent = never)
Integer parameter: time interval between two population (+RNG + parameters) dumps to disks. Files are names timeNN.sav. See pervious parameter description for ore details. No default value.

# --status=t-eoGA.status # Status file
String parameter: name of the status file (that contains all parameters in the input format). There is no way to avoid creating that file except recompiling ... or giving the name /dev/null (Unix). Default value is ProgramName.status



Section ###### Stopping criterion ######
This section allows to decide when the algorithm will stop.

# --maxGen=100 # -G : Maximum number of generations (0 = none)
Integer parameter: maximum number of generations. A value of 0 disables that stopping criterion. Default is 100.

# --steadyGen=100 # -s : Number of generations with no improvement
Integer parameter: stops whenever that number of generations is passed without any improvement of the best fitness in the population, provided the following minimum number of generations has been done. No default value.

# --minGen=0 # -g : Minimum number of generations
Integer parameter: the above steadyGen parameter starts its job only after that minimum nuber of generations is passed. No default value.

# --maxEval=0 # -E : Maximum number of evaluations (0 = none)
Integer parameter: maximum number of generations. No default value.

# --targetFitness=0 # -T : Stop when fitness reaches
Real-valued parameter: the algorithm stops whenever the best fitness reaches that target. No default value.

# --CtrlC=0 # -C : Terminate current generation upon Ctrl C
Boolean parameter: if true, Ctrl C only stops after the current generation as completed (eventually dumping population to a file if some saver is active). THis very useful feature is only available in Unix at the moment. Default is false.



Section ###### engine ######
In this section, one chooses all components of the Evolution Engine (selection, replacemenet and the like).

# --selection=DetTour(2) # -S : Selection: Roulette, DetTour(T), StochTour(t) or Sequential(ordered/unordered)
String parameter: Name of selection procedure. Availabable are the roulette wheel (name Roulette, fitness scaling coming soon); deterministic tournament (name DetTour with size - integer > 2 - in parentheses right after the name, use double quotes on the command line);  stochastic tournament (name StochTour with probability - float in [0.5, 1] - in parentheses); sequential (name Sequential, all individuals in turn), either from best to worst (option ordered in parentheses), or in random ordered (option unordered); and finally repeated independent uniform choices  (name Random). Default is DetTour(2).

# --nbOffspring=100% # -O : Nb of offspring (percentage or absolute)
Integer or real-valued parameter: this parameter indicates the amount of offspring that will be generated from the genitors every generation. However, this amount can be specified either relative to the population size, and it should then end with percent character (%), or as an absolute integer number (without the percent char).
Indeed, you can either want, say 7 times more offspring than parents (a rather common situation in Evolution Strategies), in which case you give value 700% to nbOffspring parameter; or you might want a single offspring whatever the population size, like in Steady-State evolution engines, in which case you simply enter value 1. Default is 100%.

# --replacement=Comma # -R : Replacement: Comma, Plus, EPTour(T), SSGAWorst, SSGADet(T), SSGAStoch(t)
String parameter: Name of replacement procedure. Availabable are the ES plus and comma deterministic replacement strategies (named respectively Plus and  Comma); EP stochastic tournament (name EPTour with tournament size in parentheses); and the steady-state replacement procedures, at the moment only based on fitnesses, replacement being either deterministic (new born replace worst parent, name SSGAWorst),  or based on a tournament  (name SSGADet for deterministic tournament, size in parentheses, and SSGAStoch  for stochastic tournament, probability in parentheses). Default is Comma (which btw is also SGA generational replacement whenever there are as many offspring as parents).

# --weakElitism=0 # -w : Old best parent replaces new worst offspring *if necessary*
Boolean parameter: if true, weak elitism is added to the replacement procedure (i.e. if the best fitness among the offspring is less than the best fitness, the best parent replaces the worst offspring). Default is false.

User's guide: Bistring specific parameters
 



Programmer's guide
Lesson 3 - Lesson 5 - Main page - Algorithm-Based - Component-Based - Hints - EO documentation

Marc Schoenauer

Last modified: None of your business!