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. Parameters 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 were not specified by the user.

User's guide: Representation-independent parameters
The parameters are organized in sections.
The first section only contains the random seed.

###### General ######
# --help=0 # -h : Prints this message
Whether or not help was requested is handled through a boolean parameter
# --seed=988700289 # -S : Random number seed
The seed for the Random Number Generator

###### 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 plots
# --printBestStat=1 # Print Best/avg/stdev every gen.
Boolean parameter, toggles screen output of indicated statistics
# --plotBestStat=0 # Plot Best/avg Stat
Boolean parameter, toggles gnuplot output of best and average plots (Linux only at the moment)
# --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
# --printFDC=1 # Print FDC coeff. every gen.
Boolean parameter, adds Fitness Distance Correlation to output every generation
# --plotFDCStat=0 # Plot FDC scatter plot
Boolean parameter, toggles the Fitness Distance Correlation plot (Fitness vs distance to best)
# --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.

###### Persistence ######
This section contains parameters handling job restart
# --Load= # -L : A save file to restart from
String parameter: if present, the initial population (and the RNG status) 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.
# --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).

###### 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. Default is 0 which is equivalent to infinity.
# --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).

###### 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) or finally repeated independent uniform choices  (name Random).
# --offspringRate=100% # -O : Nb of offspring (percentage or absolute)

# --replacement=Comma # -R : Replacement: Comma, Plus or EPTour(T)
String parameter: Name of replacement procedure. Availabable are
# --weakElitism=0 # -w : Old best parent replaces new worst offspring *if necessary*
 



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

Marc Schoenauer

Last modified: None of your business!