940 lines
65 KiB
HTML
940 lines
65 KiB
HTML
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
|
<meta name="GENERATOR" content="Mozilla/4.78 [en] (X11; U; Linux 2.4.7-10 i686) [Netscape]">
|
|
<title>Tutorial: Lesson 4</title>
|
|
</head>
|
|
<body text="#000000" link="#0000EE" vlink="#551A8B" alink="#FF0000" background="beige009.jpg">
|
|
<a href="eoLesson3.html">Lesson 3</a> -
|
|
<a href="eoLesson5.html">Lesson
|
|
5</a> -
|
|
<a href="eoTutorial.html">Main page</a> -
|
|
<a href="eoTopDown.html">Algorithm-Based</a>
|
|
- <a href="eoBottomUp.html">Component-Based</a> - <a href="eoProgramming.html">Hints</a>
|
|
- <b><font face="Arial,Helvetica"><font size=+1><a href="../../doc/html/index.html">EO
|
|
documentation</a></font></font></b>
|
|
<br>
|
|
<hr WIDTH="100%">
|
|
<br><b><font color="#FF0000">User's guide:</font></b> <a href="#userguide">General</a>
|
|
- <a href="#binary">Bitstring</a> - <a href="#real">Real</a> - <a href="#ES">ES</a>
|
|
- <b><font color="#FF0000">Programmer's guide:</font></b> <a href="#programmerguide">General</a>
|
|
- <a href="#memory">Memory management </a>- <a href="#parameter">Parameters</a>
|
|
<br>
|
|
<hr WIDTH="100%"><!-- -------------- End of header ------------------ --><!-- ----------------------------------------------- -->
|
|
<center>
|
|
<h1>
|
|
<font color="#FF0000">Tutorial Lesson 4: ready-to-use fully operational EA</font></h1></center>
|
|
In this lesson, you will still use the same Evolutionary Algorithm. But
|
|
this time you will have <b><font color="#FF6600">full control of all components</font></b>
|
|
from the <b><font color="#FF6600">command-line or a parameter file</font></b>.<br>
|
|
You can even use the algorithm decribed here <b><font color="#FF6600">without any other knowledge
|
|
of EO</font></b>, just by writing your fitness function as a plain C++ function. <br><br>
|
|
|
|
<b><font color="#000099"><font size=+2>Contents</font></font></b><br>
|
|
<ul>
|
|
<li><b><font color="#FF0000">User's guide</font></b>
|
|
<ul>
|
|
<li> <a href="#userguide">Representation independent</a>,
|
|
useful for <b><font color="#FF6600">all</font></b> applications</li>
|
|
<li> <a href="#binary">BitEA, the binary version</a>, similar
|
|
to previous lessons</li>
|
|
<li> <a href="#real">RealEA, the basic real-valued version</a>,
|
|
not efficient - see by yourself!</li>
|
|
<li> <a href="#ES">RealEA, the self-adaptive Evolution Strategy</a>, best choice for continuous optimization in EO today (December 2004)</li>
|
|
</ul>
|
|
</li>
|
|
<li><b><font color="#FF0000">Programmer's guide</font></b>:
|
|
the ultimate purpose of this tutorial is to make you able to do
|
|
your own experiments - and these these will likely fall outside the scope
|
|
of the two ready-to-use programs above. You wil hence need to learn more about
|
|
<ul>
|
|
<li> <a href="#programmerguide">Building libraries</a> (in spite of the
|
|
<a href="eoProgramming.html#templates">template problem</a>)</li>
|
|
<li> <a href="#memory">Memory management</a>: it is radically
|
|
different that in the 3 previous lessons - though relying
|
|
of course on the same objects. Note that eoPersistent objects and eoParam
|
|
objects are handled by different mechanisms.
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
|
|
<p>
|
|
<hr WIDTH="100%">
|
|
<br><a NAME="userguide"></a><b><font color="#000099"><font size=+2>User's
|
|
guide</font></font></b>
|
|
<p><font color="#000000">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.</font>
|
|
<br><font color="#000000">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 <a href="#binary">binary</a> or the <a href="#real">real</a>
|
|
parts if you wish.</font>
|
|
<p><b><font color="#FF0000">Warning</font></b><font color="#000000">: this
|
|
is a user guide, not a programming guide. In particular, the </font><font color="#FF6600">keywords</font><font color="#000000">
|
|
of the parameters are </font><b><font color="#FF6600">not</font></b><font color="#000000">
|
|
the </font><font color="#FF6600">names</font><font color="#000000"> of
|
|
the underlying classes (though they should be similar in most cases).</font>
|
|
<p><b><font size=+1><font color="#000099">User's guide:</font><font color="#FF0000">Parameter
|
|
input</font></font></b><font color="#000000"> The way to input parameters
|
|
has already be described in <a href="eoLesson3.html#paraminput">Lesson
|
|
3</a>. To get a list of parameters, type the command with option --help
|
|
(or -h): with both testBit and testReal this will result in</font>
|
|
<ul>
|
|
<li>
|
|
<font color="#000000">Printing the list of keywords on the standard output</font></li>
|
|
|
|
<li>
|
|
<font color="#000000">Creating (or overwriting) a file name testBit.status
|
|
or testReal.status that contains the list of all recognized parameters
|
|
and has the format of an input parameter file.</font></li>
|
|
</ul>
|
|
<b><font size=+1><font color="#000099">User's guide:</font><font color="#FF0000">The
|
|
status file</font></font></b>
|
|
<br><font color="#000000">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 </font><b><tt><font color="#FF6666"><font size=+1>testBit
|
|
-G1</font></font></tt></b><font color="#000000"> 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.</font>
|
|
<br><font color="#000000">On the status file, the parameters are organized
|
|
in sections. Note, however, that this format is not mandatory in the param
|
|
file, as </font><font color="#FF6600">only the keywords</font><font color="#000000">
|
|
are processed.</font>
|
|
<p><b><font size=+1><font color="#000099">User's guide:</font><font color="#FF0000">Representation-independent
|
|
parameters</font></font></b>
|
|
<br><font color="#000000">In what follows, the fixed font colored text
|
|
is directly taken from the status file and is commented between the lines.
|
|
The presentation follows the status file format - only two sections are
|
|
representation-dependent (see the corresponding <a href="#binary">binary</a>
|
|
or <a href="#real">real</a> sections). All other sections are presented
|
|
now:</font>
|
|
<p>
|
|
<hr SIZE=5 WIDTH="30%">
|
|
<br><b><font size=+1><font color="#FF0000">Section </font><tt><font color="#993300">######
|
|
General ######</font></tt></font></b>
|
|
<br><b><tt><font color="#993300"><font size=+1># --help=0 # -h : Prints
|
|
this message</font></font></tt></b>
|
|
<br><font color="#FF0000">Boolean parameter </font><font color="#000000">of
|
|
absolutely no interest: tells whether or not help was requested.</font>
|
|
<p><b><tt><font color="#993300"><font size=+1># --seed=988700289 # -S :
|
|
Random number seed</font></font></tt></b>
|
|
<br><font color="#FF0000">Unsigned long parameter:</font><font color="#000000">
|
|
the seed for the <a href="eoProgramming.html#random">Random Number Generator</a>
|
|
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 </font><font color="#FF0000">no default value ("true" random
|
|
seed)</font><font color="#000000">.</font>
|
|
<p>
|
|
<hr SIZE=5 WIDTH="30%">
|
|
<p><b><font size=+1><font color="#FF0000">Section </font><tt><font color="#009900">######
|
|
engine ######</font></tt></font></b>
|
|
<br><font color="#000000">In this section, one chooses all components of
|
|
the <a href="eoEngine.html">Evolution Engine</a> (selection, replacemenet
|
|
and the like).</font>
|
|
<p><b><tt><font color="#009900"><font size=+1># --popSize=20 # -P : Population
|
|
Size</font></font></tt></b>
|
|
<br><font color="#FF0000">Integer parameter:</font><font color="#000000">
|
|
the size of the population (constant along evolution). And yes, this is
|
|
a representation independent parameter, as the population is created either
|
|
from a file or using an eoInit object - and only that object is representation-dependent.</font>
|
|
<br><b><tt><font color="#009900"><font size=+1># --selection=DetTour(2)
|
|
# -S : Selection: Roulette, DetTour(T), StochTour(t) or Sequential(ordered/unordered)</font></font></tt></b>
|
|
<br><font color="#FF0000">String parameter:</font><font color="#000000">
|
|
Name of <a href="eoEngine.html#selection">selection procedure.</a> Availabable
|
|
are the </font><b><font color="#FF6600">roulette wheel</font></b><font color="#000000">
|
|
(name </font><b><tt><font color="#009900"><font size=+1>Roulette</font></font></tt></b><font color="#000000">,
|
|
fitness scaling coming soon); </font><b><font color="#FF6600">deterministic
|
|
tournament</font></b><font color="#000000"> (name </font><b><tt><font color="#009900"><font size=+1>DetTour</font></font></tt></b><font color="#000000">
|
|
with size - integer > 2 - in parentheses right after the name, use double
|
|
quotes on the command line); </font><b><font color="#FF6600">stochastic
|
|
tournament</font></b><font color="#000000"> (name </font><b><tt><font color="#009900"><font size=+1>StochTour</font></font></tt></b><font color="#000000">
|
|
with probability - float in [0.5, 1] - in parentheses); </font><b><font color="#FF6600">sequential</font></b><font color="#000000">
|
|
(name
|
|
</font><b><tt><font color="#009900"><font size=+1>Sequential</font></font></tt></b><font color="#000000">,
|
|
all individuals in turn), either from best to worst (option </font><b><tt><font color="#009900"><font size=+1>ordered</font></font></tt></b><font color="#000000">
|
|
in parentheses), or in random ordered (option </font><b><tt><font color="#009900"><font size=+1>unordered</font></font></tt></b><font color="#000000">);
|
|
and finally repeated </font><b><font color="#FF6600">independent uniform
|
|
choices</font></b><font color="#000000"> (name </font><b><tt><font color="#009900"><font size=+1>Random</font></font></tt></b><font color="#000000">).
|
|
Default is </font><font color="#FF0000">DetTour(2)</font><font color="#000000">.</font>
|
|
<p><b><tt><font color="#009900"><font size=+1># --nbOffspring=100% # -O
|
|
: Nb of offspring (percentage or absolute)</font></font></tt></b>
|
|
<br><font color="#FF0000">Integer or real-valued parameter:</font><font color="#000000">
|
|
this parameter indicates the </font><b><font color="#FF6600">amount of
|
|
offspring</font></b><font color="#000000"> that will be generated from
|
|
the genitors every generation. However, this amount can be specified either
|
|
</font><font color="#FF6600">relative</font><font color="#000000">
|
|
to the population size, and it should then end with percent character (%),
|
|
or as an </font><font color="#FF6600">absolute</font><font color="#000000">
|
|
integer number (without the percent char).</font>
|
|
<br><font color="#000000">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 </font><b><tt><font color="#009900"><font size=+1>nbOffspring</font></font></tt></b><font color="#000000">
|
|
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. </font><font color="#FF0000">Default is 100%</font><font color="#000000">.</font>
|
|
<p><b><tt><font color="#009900"><font size=+1># --replacement=Comma # -R
|
|
: Replacement: Comma, Plus, EPTour(T), SSGAWorst, SSGADet(T), SSGAStoch(t)</font></font></tt></b>
|
|
<br><font color="#FF0000">String parameter:</font><font color="#000000">
|
|
Name of replacement procedure. Availabable are the </font><b><font color="#FF6600">ES
|
|
plus and comma</font></b><font color="#000000"> deterministic replacement
|
|
strategies (named respectively </font><b><tt><font color="#009900"><font size=+1>Plus</font></font></tt></b><font color="#000000">
|
|
and </font><b><tt><font color="#009900"><font size=+1>Comma</font></font></tt></b><font color="#000000">);
|
|
</font><b><font color="#FF6600">EP
|
|
stochastic tournament</font></b><font color="#000000"> (name </font><b><tt><font color="#009900"><font size=+1>EPTour</font></font></tt></b><font color="#000000">
|
|
with tournament size in parentheses); and the </font><b><font color="#FF6600">steady-state
|
|
</font></b><font color="#000000">replacement
|
|
procedures, at the moment only based on fitnesses, replacement being either
|
|
</font><font color="#FF6600">deterministic</font><font color="#000000">
|
|
(new born replace worst parent, name </font><b><tt><font color="#009900"><font size=+1>SSGAWorst</font></font></tt></b><font color="#000000">),
|
|
or based on a tournament (name </font><b><tt><font color="#009900"><font size=+1>SSGADet</font></font></tt></b><font color="#000000">
|
|
for deterministic tournament, size in parentheses, and </font><b><tt><font color="#009900"><font size=+1>SSGAStoch</font></font></tt></b><font color="#000000">
|
|
for stochastic tournament, probability in parentheses). </font><font color="#FF0000">Default
|
|
is Comma</font><font color="#000000"> (which btw is also SGA </font><font color="#FF0000">generational
|
|
replacement</font><font color="#000000"> whenever there are as many offspring
|
|
as parents).</font>
|
|
<p><b><tt><font color="#009900"><font size=+1># --weakElitism=0 # -w :
|
|
Old best parent replaces new worst offspring *if necessary*</font></font></tt></b>
|
|
<br><font color="#FF0000">Boolean parameter:</font><font color="#000000">
|
|
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). </font><font color="#FF0000">Default
|
|
is false.</font>
|
|
<p>
|
|
<hr SIZE=5 WIDTH="30%">
|
|
<p><b><font size=+1><font color="#FF0000">Section </font><tt><font color="#3333FF">######
|
|
Output ######</font></tt></font></b>
|
|
<br><font color="#000000">This first section on Output contains parameters
|
|
related to screen text output.</font>
|
|
<p><b><tt><font color="#3333FF"><font size=+1># --useEval=1 # Use nb of
|
|
eval. as counter (vs nb of gen.)</font></font></tt></b>
|
|
<br><font color="#FF0000">Boolean parameter:</font><font color="#000000">
|
|
whether or not you want the nb of evluations to be displayed and used as
|
|
counter in statistics outputs and plots. </font><font color="#FF0000">Default
|
|
is true</font><font color="#000000">.</font>
|
|
<p><b><tt><font color="#3333FF"><font size=+1># --printBestStat=1 # Print
|
|
Best/avg/stdev every gen.</font></font></tt></b>
|
|
<br><font color="#FF0000">Boolean parameter:</font><font color="#000000">
|
|
toggles screen output of indicated statistics. </font><font color="#FF0000">Default
|
|
is true</font><font color="#000000">.</font>
|
|
<p><b><tt><font color="#3333FF"><font size=+1># --printPop=0 # Print sorted
|
|
pop. every gen.</font></font></tt></b>
|
|
<br><font color="#FF0000">Boolean parameter:</font><font color="#000000">
|
|
adds a dump of the whole population to the screen every generation. Is
|
|
likely to generate </font><b><font color="#FF6600">huge</font></b><font color="#000000">
|
|
output! </font><font color="#FF0000">Default is false.</font>
|
|
<p><b><tt><font color="#3333FF"><font size=+1># --printFDC=1 # Print FDC
|
|
coeff. every gen.</font></font></tt></b>
|
|
<br><font color="#FF0000">Boolean parameter:</font><font color="#000000">
|
|
adds Fitness Distance Correlation to output every generation. </font><font color="#FF0000">Default
|
|
is false.</font>
|
|
<p>
|
|
<hr SIZE=5 WIDTH="30%">
|
|
<p><b><font size=+1><font color="#FF0000">Section </font><tt><font color="#3333FF">######
|
|
Output - Disk ######</font></tt></font></b>
|
|
<br><font color="#000000">This second section on Output contains parameters
|
|
related to DISK output.</font>
|
|
<p><b><tt><font color="#3333FF"><font size=+1># --resDir=Res # Directory
|
|
to store DISK outputs</font></font></tt></b>
|
|
<br><font color="#FF0000">String parameter: </font><font color="#000000">All
|
|
</font><font color="#FF6600">DISK
|
|
output</font><font color="#000000"> will be stored in a separate directory
|
|
-this is its name. If the directory does not exist, it is created. Note
|
|
that </font><font color="#FF6600">all graphical displays</font><font color="#000000">
|
|
will use that directory for their temporary files. Also </font><font color="#FF6600">all
|
|
job dump</font><font color="#000000"> (see section </font><b><font color="#3333FF">Persistence</font></b><font color="#000000">
|
|
below) store their files there too.</font>
|
|
<p><b><tt><font color="#3333FF"><font size=+1># --eraseDir=0 # erase files
|
|
in dirName if any</font></font></tt></b>
|
|
<br><font color="#FF0000">Boolean parameter:</font><font color="#000000">
|
|
in order not to mix up files from different runs, it is mandatory to ensure
|
|
that the directory where all files will be stored is empty. However, if
|
|
this parameter is not set and the directory already exists, an exception
|
|
is thrown and the program stops. It it is set, </font><b><font color="#FF6600">all
|
|
files in the result directory are erased</font></b><font color="#000000">.</font>
|
|
<p><b><tt><font color="#3333FF"><font size=+1># --fileBestStat=0 # Output
|
|
Best/avg/stdev to a file</font></font></tt></b>
|
|
<br><font color="#FF0000">Boolean parameter:</font><font color="#000000">
|
|
if present, the best, average and standard deviation statistics are stored
|
|
in file </font><b><tt><font color="#993300"><font size=+1>resDir/best.xg</font></font></tt></b><font color="#000000">.
|
|
Each line contains the generation number, eventualy the evaluation count
|
|
(depending on parameter </font><b><tt><font color="#3333FF"><font size=+1>useEval</font></font></tt></b><font color="#000000">
|
|
then the statistics. </font><font color="#FF0000">Default is false.</font>
|
|
<br>
|
|
<p>
|
|
<hr SIZE=5 WIDTH="30%">
|
|
<p><b><font size=+1><font color="#FF0000">Section </font><tt><font color="#3333FF">######
|
|
Output - Graphical ######</font></tt></font></b>
|
|
<br><font color="#000000">This last section on Output contains parameters
|
|
related to graphical output (only available in Unix through gnuplot at
|
|
the moment).</font>
|
|
<p><b><tt><font color="#3333FF"><font size=+1># --plotBestStat=0 # Plot
|
|
Best/avg Stat</font></font></tt></b>
|
|
<br><font color="#FF0000">Boolean parameter:</font><font color="#000000">
|
|
toggles gnuplot output of best and average plots (Linux only at the moment).
|
|
</font><font color="#FF0000">Default
|
|
is false.</font>
|
|
<p><b><tt><font color="#3333FF"><font size=+1># --plotFDCStat=0 # Plot
|
|
FDC scatter plot</font></font></tt></b>
|
|
<br><font color="#FF0000">Boolean parameter:</font><font color="#000000">
|
|
toggles the Fitness Distance Correlation plot (Fitness vs distance to best).
|
|
</font><font color="#FF0000">Default
|
|
is false.</font>
|
|
<p><b><tt><font color="#3333FF"><font size=+1># --plotHisto=0 # Plot histogram
|
|
of fitnesses</font></font></tt></b>
|
|
<br><font color="#FF0000">Boolean parameter:</font><font color="#000000">
|
|
if on, gnuplot is used to plot the sorted population (fitness vs rank).
|
|
Gives a graphical idea of the diversity. </font><font color="#FF0000">Default
|
|
is false.</font>
|
|
<p>
|
|
<hr SIZE=5 WIDTH="30%">
|
|
<p><b><font size=+1><font color="#FF0000">Section </font><tt><font color="#3333FF">######
|
|
Persistence ######</font></tt></font></b>
|
|
<br><font color="#000000">This section contains parameters handling job
|
|
dump and restart mechanism.</font>
|
|
<p><b><tt><font color="#3333FF"><font size=+1># --Load= # -L : A save file
|
|
to restart from</font></font></tt></b>
|
|
<br><font color="#FF0000">String parameter:</font><font color="#000000">
|
|
if present, the initial population (and the RNG) is read from indicated
|
|
file. That file </font><b><font color="#FF0000">must</font></b><font color="#000000">
|
|
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.</font>
|
|
<br><font color="#000000">Note that if not enough individuals are read,
|
|
the remaining are randomly initialized. </font><font color="#FF0000">No
|
|
default value</font><font color="#000000">.</font>
|
|
<p><b><tt><font color="#3333FF"><font size=+1># --recomputeFitness=0 #
|
|
-r : Recompute the fitness after re-loading the pop.?</font></font></tt></b>
|
|
<br><font color="#FF0000">Boolean parameter:</font><font color="#000000">
|
|
in case some individuals are read from a file, their fitness is read too.
|
|
If this one is true, it is nevertheless recomputed. </font><font color="#FF0000">Default
|
|
is false</font><font color="#000000"> i.e. use fitnes that's in the file.</font>
|
|
<p><b><tt><font color="#3333FF"><font size=+1># --saveFrequency=0 # Save
|
|
every F generation (0 = only final state, absent = never)</font></font></tt></b>
|
|
<br><font color="#FF0000">Integer parameter:</font><font color="#000000">
|
|
interval between two dump to disk of the whole population (+RNG + parameters),
|
|
in a file named genNN.sav in the </font><b><tt><font color="#993300"><font size=+1>dirRes</font></font></tt></b><font color="#000000">
|
|
directory, 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 </font><font color="#FF0000">no default
|
|
value</font><font color="#000000">).</font>
|
|
<p><b><tt><font color="#3333FF"><font size=+1># --saveTimeInterval=0 #
|
|
Save every T seconds (0 or absent = never)</font></font></tt></b>
|
|
<br><font color="#FF0000">Integer parameter:</font><font color="#000000">
|
|
time interval between two population (+RNG + parameters) dumps to disks.
|
|
Files are names timeNN.sav. See pervious parameter description for ore
|
|
details. </font><font color="#FF0000">No default value.</font>
|
|
<p><b><tt><font color="#3333FF"><font size=+1># --status=t-eoGA.status
|
|
# Status file</font></font></tt></b>
|
|
<br><font color="#FF0000">String parameter:</font><font color="#000000">
|
|
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 </font><font color="#FF0000">ProgramName.status</font>
|
|
<p>
|
|
<hr SIZE=5 WIDTH="30%">
|
|
<p><b><font size=+1><font color="#FF0000">Section </font><tt><font color="#3333FF">######
|
|
Stopping criterion ######</font></tt></font></b>
|
|
<br><font color="#000000">This section allows to decide when the algorithm
|
|
will stop.</font>
|
|
<p><b><tt><font color="#3333FF"><font size=+1># --maxGen=100 # -G : Maximum
|
|
number of generations (0 = none)</font></font></tt></b>
|
|
<br><font color="#000000">Integer parameter: maximum number of generations.
|
|
A value of 0 disables that stopping criterion. </font><font color="#FF0000">Default
|
|
is 100.</font>
|
|
<p><b><tt><font color="#3333FF"><font size=+1># --steadyGen=100 # -s :
|
|
Number of generations with no improvement</font></font></tt></b>
|
|
<br><font color="#FF0000">Integer parameter:</font><font color="#000000">
|
|
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. </font><font color="#FF0000">No default value.</font>
|
|
<p><b><tt><font color="#3333FF"><font size=+1># --minGen=0 # -g : Minimum
|
|
number of generations</font></font></tt></b>
|
|
<br><font color="#000000">Integer parameter: the above steadyGen parameter
|
|
starts its job only after that minimum nuber of generations is passed.
|
|
</font><font color="#FF0000">No
|
|
default value.</font>
|
|
<p><b><tt><font color="#3333FF"><font size=+1># --maxEval=0 # -E : Maximum
|
|
number of evaluations (0 = none)</font></font></tt></b>
|
|
<br><font color="#FF0000">Integer parameter:</font><font color="#000000">
|
|
maximum number of generations.
|
|
</font><font color="#FF0000">No default
|
|
value.</font>
|
|
<p><b><tt><font color="#3333FF"><font size=+1># --targetFitness=0 # -T
|
|
: Stop when fitness reaches</font></font></tt></b>
|
|
<br><font color="#FF0000">Real-valued parameter:</font><font color="#000000">
|
|
the algorithm stops whenever the best fitness reaches that target. </font><font color="#FF0000">No
|
|
default value.</font>
|
|
<p><b><tt><font color="#3333FF"><font size=+1># --CtrlC=0 # -C : Terminate
|
|
current generation upon Ctrl C</font></font></tt></b>
|
|
<br><font color="#FF0000">Boolean parameter:</font><font color="#000000">
|
|
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. </font><font color="#FF0000">Default
|
|
is false.</font>
|
|
<br>
|
|
<hr ALIGN=LEFT SIZE=5 WIDTH="100%">
|
|
<p><a NAME="binary"></a><b><font size=+1><font color="#000099">User's guide:</font><font color="#FF0000">Bistring
|
|
specific parameters</font></font></b>
|
|
<br>The following describes the specific parameters that are available
|
|
in program BitEA to evolve genotypes that are <b><font color="#FF6600">bitstrings</font></b>.
|
|
<br>The two representation-dependent sections are concerned repectively
|
|
with genotype initilization and variation operators.
|
|
<p>
|
|
<hr SIZE=5 WIDTH="30%">
|
|
<p><b><font size=+1><font color="#FF0000">Section </font><tt><font color="#CC33CC">######
|
|
Genotype Initialization ######</font></tt></font></b>
|
|
<br><font color="#000000">This section should allow input if all necessary
|
|
parameters for genitype initialization</font>
|
|
<p><b><tt><font color="#CC33CC"><font size=+1># --ChromSize=10 # -n : The
|
|
length of the bitstrings</font></font></tt></b>
|
|
<br><font color="#FF0000">Integer parameter:</font><font color="#000000">
|
|
The bitstring initilization only requires the length of the chromosome.</font>
|
|
<p>
|
|
<hr SIZE=5 WIDTH="30%">
|
|
<p><b><font size=+1><font color="#FF0000">Section </font><tt><font color="#CC33CC">######
|
|
Variation Operators ######</font></tt></font></b>
|
|
<br><font color="#000000">This section allows to tune the way the variation
|
|
operators will be applied to the individuals (in the strict limit of SGA
|
|
model at the moment, see below).</font>
|
|
<p><b><tt><font color="#CC33CC"><font size=+1># --operator=SGA # -o : Description
|
|
of the operator (SGA only now)</font></font></tt></b>
|
|
<br><font color="#FF0000">String parameter:</font><font color="#000000">
|
|
Describes the way the operators are applied. At the moment, </font><b><font color="#FF6600">only
|
|
SGA</font></b><font color="#000000"> is available. SGA </font><b><font color="#FF6600">sequentially</font></b><font color="#000000">
|
|
applies a (quadratic) crossover operator with probability </font><b><tt><font color="#CC33CC"><font size=+1>pCross</font></font></tt></b><font color="#000000">
|
|
and a mutation operator with probability </font><b><tt><font color="#CC33CC"><font size=+1>pMut</font></font></tt></b><font color="#000000">.
|
|
Both these operators can in turn be </font><b><font color="#FF6600">proportional
|
|
combinations</font></b><font color="#000000"> of simple operators of the
|
|
same arity.</font>
|
|
<p><b><tt><font color="#CC33CC"><font size=+1># --pCross=0.6 # -C : Probability
|
|
of Crossover</font></font></tt></b>
|
|
<br><font color="#FF0000">Floating-point parameter:</font><font color="#000000">
|
|
The probability that a given couple of selected genitors is applied the
|
|
crossover operator. In SGA operator model, each couple of selected genitors
|
|
is applied the crossover operator with that probability (and remains unchanged
|
|
with probability </font><b><tt><font color="#CC33CC"><font size=+1>1-pCross</font></font></tt></b><font color="#000000">.
|
|
Whenever a couple undergoes crossover, a choice is made upon available
|
|
crossover operators </font><b><font color="#FF6600">proportionaly to their
|
|
relative rates</font></b><font color="#000000"> (see below). </font><font color="#FF0000">Default
|
|
is 0.6</font><font color="#000000">.</font>
|
|
<p><b><tt><font color="#CC33CC"><font size=+1># --pMut=0.1 # -M : Probability
|
|
of Mutation</font></font></tt></b>
|
|
<br><font color="#FF0000">Floating-point parameter:</font><font color="#000000">
|
|
The probability that a given individual (resulting from a crossover or
|
|
a non-crossover operation, see above) is applied the mutation operator.
|
|
Whenever an individual undergoes mutation, a choice is made upon available
|
|
mutation operators </font><b><font color="#FF6600">proportionaly to their
|
|
relative rates</font></b><font color="#000000"> (see below). </font><font color="#FF0000">Default
|
|
is 0.1</font><font color="#000000">.</font>
|
|
<p><b><tt><font color="#CC33CC"><font size=+1># --onePointRate=1 # -1 :
|
|
Relative rate for one point crossover</font></font></tt></b>
|
|
<br><font color="#FF0000">Floating-point parameter:</font><font color="#000000">
|
|
Rate of aplication of the 1-point crossover </font><b><font color="#FF6600">relatively</font></b><font color="#000000">
|
|
to 2-point and uniform below (see </font><b><tt><font color="#CC33CC"><font size=+1>pCross</font></font></tt></b><font color="#000000">
|
|
parameter). </font><font color="#FF0000">Default is 1</font><font color="#000000">.</font>
|
|
<p><b><tt><font color="#CC33CC"><font size=+1># --twoPointRate=1 # -2 :
|
|
Relative rate for two point crossover</font></font></tt></b>
|
|
<br><font color="#FF0000">Floating-point parameter:</font><font color="#000000">
|
|
Rate of aplication of the 2-point crossover </font><b><font color="#FF6600">relatively</font></b><font color="#000000">
|
|
to 1-point above and uniform below (see </font><b><tt><font color="#CC33CC"><font size=+1>pCross</font></font></tt></b><font color="#000000">
|
|
parameter). </font><font color="#FF0000">Default is 1</font><font color="#000000">.</font>
|
|
<p><b><tt><font color="#CC33CC"><font size=+1># --uRate=2 # -U : Relative
|
|
rate for uniform crossover</font></font></tt></b>
|
|
<br><font color="#FF0000">Floating-point parameter:</font><font color="#000000">
|
|
Rate of aplication of the 1-point crossover </font><b><font color="#FF6600">relatively</font></b><font color="#000000">
|
|
to 1- and 2-point above (see </font><b><tt><font color="#CC33CC"><font size=+1>pCross</font></font></tt></b><font color="#000000">
|
|
parameter). </font><font color="#FF0000">Default is 2</font><font color="#000000">.</font>
|
|
<p><b><tt><font color="#CC33CC"><font size=+1># --pMutPerBit=0.01 # -b
|
|
: Probability of flipping 1 bit in bit-flip mutation</font></font></tt></b>
|
|
<br><font color="#FF0000">Floating-point parameter:</font><font color="#000000">
|
|
When </font><b><tt><font color="#CC33CC"><font size=+1>bit-flip mutation</font></font></tt></b><font color="#000000">
|
|
is applied, each bit is flipped independently with probability </font><b><tt><font color="#CC33CC"><font size=+1>pMutPerBit</font></font></tt></b><font color="#000000">.</font>
|
|
<p><b><tt><font color="#CC33CC"><font size=+1># --bitFlipRate=0.01 # -s
|
|
: Relative rate for bit-flip mutation</font></font></tt></b>
|
|
<br><font color="#FF0000">Floating-point parameter:</font><font color="#000000">
|
|
Rate of aplication of the bit-flip mutation </font><b><font color="#FF6600">relatively</font></b><font color="#000000">
|
|
to one-Bit mutation below (see </font><b><tt><font color="#CC33CC"><font size=+1>pMut</font></font></tt></b><font color="#000000">
|
|
above). </font><font color="#FF0000">Default is 0.01</font><font color="#000000">
|
|
(if all relative rates are equal, the choice is uniform among available
|
|
operators).</font>
|
|
<p><b><tt><font color="#CC33CC"><font size=+1># --oneBitRate=0.01 # -d
|
|
: Relative rate for deterministic bit-flip mutation</font></font></tt></b>
|
|
<br><font color="#FF0000">Floating-point parameter:</font><font color="#000000">
|
|
Rate of aplication of the one-bit mutation </font><b><font color="#FF6600">relatively</font></b><font color="#000000">
|
|
to bit-flip mutation below (see </font><b><tt><font color="#CC33CC"><font size=+1>pMut</font></font></tt></b><font color="#000000">
|
|
above). One-bit mutation flips one and only one bit, uniformly chosen in
|
|
the individual. </font><font color="#FF0000">Default is 0.01</font><font color="#000000">
|
|
(if all relative rates are equal, the choice is uniform among available
|
|
operators).</font>
|
|
<br>
|
|
<p>
|
|
<hr ALIGN=LEFT SIZE=5 WIDTH="100%">
|
|
<p><a NAME="real"></a><b><font size=+1><font color="#000099">User's guide:</font><font color="#FF0000">Real-valued
|
|
specific parameters</font></font></b>
|
|
<br>
|
|
To run your own real-valued application, write your fitness function
|
|
(see <b><tt><font color="#993300" size=+1>real_value.h</font></font></tt></b>),
|
|
recompile, and run from the command line <br>
|
|
<center><b><tt><font color="#993300" size=+1>RealEA @RealEA.param</font></tt></b></center><br>
|
|
in order to use sensible parameters! (see <a href="eoLesson3.html#paraminput">Lesson 3</a>
|
|
for details on the parameter file).
|
|
But remember that <a href="#ES">Self-adaptive ES</a> will work much better!
|
|
<br><br>
|
|
The following describes the specific parameters that are available
|
|
in programs <b><tt><font color="#993300"><font size=+1>RealEA</font></font></tt></b>
|
|
and <b><tt><font color="#993300"><font size=+1>ESEA</font></font></tt></b>
|
|
to evolve genotypes that are <b><font color="#FF6600">vector<double></font></b>.
|
|
<br><b><tt><font color="#993300"><font size=+1>RealEA</font></font></tt></b>
|
|
implements what can be called a "real-coded GA", where everything is identical
|
|
to the bitstring case above (except initialization and operators that are
|
|
specific to vector<double> of course) and <b><tt><font color="#993300"><font size=+1>ESEA</font></font></tt></b>
|
|
implements the full Evolution-Strategy self-adaptive mutation mechanism
|
|
- together with specific ES crossover operators. The initialization section
|
|
for both programs are identical, but the operator sections are totally
|
|
different. See <a href="#ES">next paragraph</a> for a description of ES
|
|
specific parameters.
|
|
<p>
|
|
<hr SIZE=5 WIDTH="30%">
|
|
<p><b><font size=+1><font color="#FF0000">Section </font><tt><font color="#CC33CC">######
|
|
Genotype Initialization ######</font></tt></font></b>
|
|
<br><font color="#000000">This section should allow input if all necessary
|
|
parameters for genitype initialization</font>
|
|
<p><b><tt><font color="#CC33CC"><font size=+1># --vecSize=10 # -n : The
|
|
number of variables</font></font></tt></b>
|
|
<br><font color="#FF0000">Integer parameter:</font><font color="#000000">
|
|
The initilization requires the length of the vector<double>.</font>
|
|
<p><b><tt><font color="#CC33CC"><font size=+1># --initBounds=10[-1,1] #
|
|
-B : Bounds for uniform initialization</font></font></tt></b>
|
|
<br><font color="#FF0000">Bounds parameter:</font><font color="#000000">
|
|
Bounds for uniform initialization of the real variables. The syntax for
|
|
this parameter given in the </font><b><tt><font color="#CC33CC"><font size=+1>objectBounds</font></font></tt></b><font color="#000000">
|
|
parameter description below. This argument is mandatory, furthermore the
|
|
given bounds </font><b><font color="#FF6600">must be bounded</font></b><font color="#000000">.
|
|
</font><font color="#FF0000">The
|
|
default is [-1,1]</font><font color="#000000"> for all variables.</font>
|
|
<br>Note that this parameter is independent of the <b><tt><font color="#CC33CC"><font size=+1>objectBounds</font></font></tt></b>
|
|
parameter below.
|
|
<p><b><tt><font color="#CC33CC"><font size=+1># --sigmaInit=0.3 # -s :
|
|
Initial value for Sigma(s)</font></font></tt></b>
|
|
<br><font color="#FF0000">Floating-point parameter:</font><font color="#000000">
|
|
The initial value for all standard-deviation mutation strategy parameters.
|
|
Useless when no self-adaptive mutation mechanism is used.</font>
|
|
<p>
|
|
<hr SIZE=5 WIDTH="30%">
|
|
<p><b><font size=+1><font color="#FF0000">Section </font><tt><font color="#CC33CC">######
|
|
Variation Operators ######</font></tt></font></b>
|
|
<br><font color="#000000">This section allows to tune the way the variation
|
|
operators will be applied to the individuals (in the strict limit of SGA
|
|
model at the moment, see below).</font>
|
|
<p><b><tt><font color="#CC33CC"><font size=+1># --objectBounds=10[-inf,+inf]
|
|
# -B : Bounds for variables</font></font></tt></b>
|
|
<br><font color="#FF0000">Bounds parameter:</font><font color="#000000">
|
|
Bounds for object variables. The syntax for this parameter is a succession
|
|
of (optionally semi-colon separated) items of the form </font><b><tt><font color="#993300"><font size=+1>N[min,Max]</font></font></tt></b><font color="#000000">where
|
|
the optional integer </font><b><tt><font color="#993300"><font size=+1>N</font></font></tt></b><font color="#000000">
|
|
indicates how many variables have the given bounds. </font><b><tt><font color="#993300"><font size=+1>min</font></font></tt></b><font color="#000000">
|
|
and </font><b><tt><font color="#993300"><font size=+1>Max</font></font></tt></b><font color="#000000">
|
|
are either floating point numbers, or </font><b><tt><font color="#993300"><font size=+1>-inf</font></font></tt></b><font color="#000000">
|
|
(resp. </font><b><tt><font color="#993300"><font size=+1>+inf</font></font></tt></b><font color="#000000">)
|
|
to indicate unbounded direction. If not enough bounds are provided, the
|
|
remaining variables will have the same bounds as the last bounds given.</font>
|
|
<br><font color="#000000">This argument is mandatory, and
|
|
</font><font color="#FF0000">default
|
|
is [-inf,+inf]</font><font color="#000000">, i.e. unbounded variables.</font>
|
|
<p><b><font color="#FF0000">Examples</font></b><font color="#000000">:
|
|
</font><b><tt><font color="#CC33CC"><font size=+1>10[-1,1]</font></font></tt></b><font color="#000000">is
|
|
equivalent to simply </font><b><tt><font color="#CC33CC"><font size=+1>[-1,1]</font></font></tt></b><font color="#000000">
|
|
or to the extended </font><b><tt><font color="#CC33CC"><font size=+1>[-1,1][-1,1][-1,1][-1,1][-1,1][-1,1][-1,1][-1,1][-1,1][-1,1]</font></font></tt></b><font color="#000000">.</font>
|
|
<br><font color="#000000">And </font><b><tt><font color="#CC33CC"><font size=+1>[-1,1];2[0,1];[-inf,10]</font></font></tt></b>results
|
|
in the first variable staying in [-1,1], the second and the third in [0,1]
|
|
and all remaining variables below 10.
|
|
<p><b><tt><font color="#CC33CC"><font size=+1># --operator=SGA # -o : Description
|
|
of the operator (SGA only now)</font></font></tt></b>
|
|
<br><font color="#FF0000">String parameter:</font><font color="#000000">
|
|
Describes the way the operators are applied. At the moment, </font><b><font color="#FF6600">only
|
|
SGA</font></b><font color="#000000"> is available. SGA </font><b><font color="#FF6600">sequentially</font></b><font color="#000000">
|
|
applies a (quadratic) crossover operator with probability </font><b><tt><font color="#CC33CC"><font size=+1>pCross</font></font></tt></b><font color="#000000">
|
|
and a mutation operator with probability </font><b><tt><font color="#CC33CC"><font size=+1>pMut</font></font></tt></b><font color="#000000">.
|
|
Both these operators can in turn be </font><b><font color="#FF6600">proportional
|
|
combinations</font></b><font color="#000000"> of simple operators of the
|
|
same arity.</font>
|
|
<p><b><tt><font color="#CC33CC"><font size=+1># --pCross=0.6 # -C : Probability
|
|
of Crossover</font></font></tt></b>
|
|
<br><font color="#FF0000">Floating-point parameter:</font><font color="#000000">
|
|
The probability that a given couple of selected genitors is applied the
|
|
crossover operator. In SGA operator model, each couple of selected genitors
|
|
is applied the crossover operator with that probability (and remains unchanged
|
|
with probability </font><b><tt><font color="#CC33CC"><font size=+1>1-pCross</font></font></tt></b><font color="#000000">.
|
|
Whenever a couple undergoes crossover, a choice is made upon available
|
|
crossover operators </font><b><font color="#FF6600">proportionaly to their
|
|
relative rates</font></b><font color="#000000"> (see below). </font><font color="#FF0000">Default
|
|
is 0.6</font><font color="#000000">.</font>
|
|
<p><b><tt><font color="#CC33CC"><font size=+1># --pMut=0.1 # -M : Probability
|
|
of Mutation</font></font></tt></b>
|
|
<br><font color="#FF0000">Floating-point parameter:</font><font color="#000000">
|
|
The probability that a given individual (resulting from a crossover or
|
|
a non-crossover operation, see above) is applied the mutation operator.
|
|
Whenever an individual undergoes mutation, a choice is made upon available
|
|
mutation operators </font><b><font color="#FF6600">proportionaly to their
|
|
relative rates</font></b><font color="#000000"> (see below). </font><font color="#FF0000">Default
|
|
is 0.1</font><font color="#000000">.</font>
|
|
<p><b><tt><font color="#CC33CC"><font size=+1># --alpha=0 # -a : bound
|
|
for combination factor in real crossover</font></font></tt></b>
|
|
<br><font color="#FF0000">Floating-point parameter:</font><font color="#000000">
|
|
Bound for the choices of linear combination factors in both crossover belows
|
|
(similar to BLX-alpha notation). </font><font color="#FF0000">Default is
|
|
0</font><font color="#000000"> (i.e. combination factor are chosen in [0,1]).</font>
|
|
<p><b><tt><font color="#CC33CC"><font size=+1># --segmentRate=1 # -s :
|
|
Relative rate for segment crossover</font></font></tt></b>
|
|
<br><font color="#FF0000">Floating-point parameter:</font><font color="#000000">
|
|
Rate of application of the segment crossover </font><b><font color="#FF6600">relatively</font></b><font color="#000000">
|
|
to hypercube and uniform crossovers (see </font><b><tt><font color="#CC33CC"><font size=+1>pCross</font></font></tt></b><font color="#000000">
|
|
parameter). Segment crossover generates offspring uniformly on the segment
|
|
joining both parents, i.e. constructs two linear combinations of the parents
|
|
with a random number uniformly drawn in [</font><b><tt><font color="#CC33CC"><font size=+1>alpha</font></font></tt></b><font color="#000000">,1+</font><b><tt><font color="#CC33CC"><font size=+1>alpha</font></font></tt></b><font color="#000000">].
|
|
</font><font color="#FF0000">Default
|
|
is 1</font><font color="#000000">.</font>
|
|
<p><b><tt><font color="#CC33CC"><font size=+1># --hypercubeRate=1 # -A
|
|
: Relative rate for hypercube crossover</font></font></tt></b>
|
|
<br><font color="#FF0000">Floating-point parameter:</font><font color="#000000">
|
|
Rate of application of the hypercube crossover </font><b><font color="#FF6600">relatively</font></b><font color="#000000">
|
|
to segment and uniform crossovers (see </font><b><tt><font color="#CC33CC"><font size=+1>pCross</font></font></tt></b><font color="#000000">
|
|
parameter). Hypercube crossover generates offspring uniformly on the hypercube
|
|
whose diagonal is the segment joining both parents, i.e. by doing linear
|
|
combinations of each variable independently (a random number in [</font><b><tt><font color="#CC33CC"><font size=+1>alpha</font></font></tt></b><font color="#000000">,1+</font><b><tt><font color="#CC33CC"><font size=+1>alpha</font></font></tt></b><font color="#000000">]
|
|
is drawn anew for each variable). </font><font color="#FF0000">Default
|
|
is 1</font><font color="#000000">.</font>
|
|
<p><b><tt><font color="#CC33CC"><font size=+1># --uxoverRate=1 # -A : Relative
|
|
rate for uniform crossover</font></font></tt></b>
|
|
<br><font color="#FF0000">Floating-point parameter:</font><font color="#000000">
|
|
Rate of application of the segment crossover </font><b><font color="#FF6600">relatively</font></b><font color="#000000">
|
|
to hypercube and segment crossovers (see </font><b><tt><font color="#CC33CC"><font size=+1>pCross</font></font></tt></b><font color="#000000">
|
|
parameter). Uniform crossover simply exchanges values of variables, i.e.
|
|
uniformly picks up two other summits of the hypercube defined by the parents.
|
|
</font><font color="#FF0000">Default
|
|
is 1</font><font color="#000000">.</font>
|
|
<p><b><tt><font color="#CC33CC"><font size=+1># --epsilon=0.01 # -e : Half-size
|
|
of interval for Uniform Mutation</font></font></tt></b>
|
|
<br><font color="#FF0000">Floating-point parameter:</font><font color="#000000">
|
|
The uniform and deterministic-uniform mutations will choose values of variable
|
|
X uniformly in </font><b><tt><font size=+1><font color="#993300">[X-</font><font color="#CC33CC">epsilon</font><font color="#993300">,
|
|
X+</font><font color="#CC33CC">epsilon</font><font color="#993300">]</font></font></tt></b><font color="#000000">.
|
|
</font><font color="#FF0000">Default
|
|
is 0.01</font><font color="#000000">.</font>
|
|
<p><b><tt><font color="#CC33CC"><font size=+1># --uniformMutRate=1 # -u
|
|
: Relative rate for uniform mutation</font></font></tt></b>
|
|
<br><font color="#FF0000">Floating-point parameter:</font><font color="#000000">
|
|
Rate of aplication of the uniform mutation </font><b><font color="#FF6600">relatively</font></b><font color="#000000">
|
|
to determinitic uniform and the normal mutations (see </font><b><tt><font color="#CC33CC"><font size=+1>pMut</font></font></tt></b><font color="#000000">
|
|
above). Uniform mutation modifies all variables by choosing new values
|
|
uniformly on an interval centered on the old value of width </font><b><tt><font size=+1><font color="#993300">2*</font><font color="#CC33CC">epsilon</font></font></tt></b><font color="#000000">
|
|
(see above). </font><font color="#FF0000">Default is1</font><font color="#000000">.</font>
|
|
<p><b><tt><font color="#CC33CC"><font size=+1># --detMutRate=1 # -d : Relative
|
|
rate for deterministic uniform mutation</font></font></tt></b>
|
|
<br><font color="#FF0000">Floating-point parameter:</font><font color="#000000">
|
|
Rate of aplication of the determinisitc-uniform mutation </font><b><font color="#FF6600">relatively</font></b><font color="#000000">
|
|
to uniform and normal mutations (see </font><b><tt><font color="#CC33CC"><font size=+1>pMut</font></font></tt></b><font color="#000000">
|
|
above). Deterministic-uniform mutation modifies one single variable uniformly
|
|
based on epsilon </font><b><tt><font color="#CC33CC"><font size=+1>epsilon</font></font></tt></b><font color="#000000">.
|
|
</font><font color="#FF0000">Default
|
|
is1</font><font color="#000000">.</font>
|
|
<p><b><tt><font color="#CC33CC"><font size=+1># --normalMutRate=1 # -d
|
|
: Relative rate for Gaussian mutation</font></font></tt></b>
|
|
<br><font color="#FF0000">Floating-point parameter:</font><font color="#000000">
|
|
Rate of aplication of the normal mutation </font><b><font color="#FF6600">relatively</font></b><font color="#000000">
|
|
to two uniform mutations above (see </font><b><tt><font color="#CC33CC"><font size=+1>pMut</font></font></tt></b><font color="#000000">
|
|
above). </font><font color="#FF0000">Default is1</font><font color="#000000">.</font>
|
|
<p><b><tt><font color="#CC33CC"><font size=+1># --sigma=0.3 # -s : Sigma
|
|
(fixed) for Gaussian mutation</font></font></tt></b>
|
|
<br><font color="#FF0000">Floating-point parameter:</font><font color="#000000">
|
|
The value of standard deviation for Gaussian mutation - fixed along evolution
|
|
(see the Evolution Strategy program below for self-adaptive mutations).</font>
|
|
<p>
|
|
<hr ALIGN=LEFT SIZE=5 WIDTH="100%">
|
|
<p><a NAME="ES"></a><b><font size=+1><font color="#000099">User's guide:</font><font color="#FF0000">ES
|
|
with self-adative mutation parameters</font></font></b>
|
|
<br>
|
|
To run your own SA-ES application, write your fitness function
|
|
(see <b><tt><font color="#993300" size=+1>real_value.h</font></font></tt></b>),
|
|
recompile, and run from the command line <br>
|
|
<center><b><tt><font color="#993300" size=+1>ESEA @ESEA.param</font></tt></b></center><br>
|
|
in order to use sensible parameters! (see <a href="eoLesson3.html#paraminput">Lesson 3</a>
|
|
for details on the parameter file).
|
|
<br><br>
|
|
The following describes the specific parameters for program <b><tt><font color="#993300"><font size=+1>ESEA</font></font></tt></b>,
|
|
that implements the full Evolution-Strategy self-adaptive mutation mechanism
|
|
- together with specific ES crossover operators. The initialization section
|
|
is the same as the one for plain vector<double> above, so only the opeartor
|
|
sections will be described here. A new section is now concerned with deciding
|
|
what kind of self-adaptive mutation strategy will be applied - it has been
|
|
separated from the other variation operators because it has consequences
|
|
on the choice of the genotype.
|
|
<br><b><font color="#FF6600">Warning</font></b>: if you choose not to use
|
|
any self-adaptive mechanism (i.e. setting all parameters of this section
|
|
to false) you end up with ... an algorithm that is identical to <b><tt><font color="#993300"><font size=+1>RealEA</font></font></tt></b>
|
|
above (try it and take alook at the status file).
|
|
<p>
|
|
<hr SIZE=5 WIDTH="30%">
|
|
<p><b><font size=+1><font color="#FF0000">Section </font><tt><font color="#CC33CC">######
|
|
ES mutation ######</font></tt></font></b>
|
|
<br><font color="#000000">This section allows to decide which type of self-adaptive
|
|
mutation will be used. There are three available types: isotropic mutation,
|
|
using one standard deviation for each individual, that will be applied
|
|
to all variables; anisotropic mutation, where each individual carries as
|
|
many standard deviations as it has variables; and correlated mutation where
|
|
each individuals has its own full correlation matrix.</font>
|
|
<p><b><tt><font color="#CC33CC"><font size=+1># --Isotropic=1 # -i : Isotropic
|
|
self-adaptive mutation</font></font></tt></b>
|
|
<br><font color="#FF0000">Boolean parameter:</font><font color="#000000">
|
|
If true, at least one self-adaptive parameter will be used for each individual.
|
|
</font><font color="#FF0000">Default
|
|
is true</font><font color="#000000">.</font>
|
|
<p><b><tt><font color="#CC33CC"><font size=+1># --Stdev=0 # -s : One self-adaptive
|
|
stDev per variable</font></font></tt></b>
|
|
<br><font color="#FF0000">Boolean parameter:</font><font color="#000000">
|
|
If true, at least one self-adaptive parameter per variable will be used
|
|
for each individual. </font><font color="#FF0000">Default is false</font><font color="#000000">.</font>
|
|
<p><b><tt><font color="#CC33CC"><font size=+1># --Correl=0 # -c : Use correlated
|
|
mutations</font></font></tt></b>
|
|
<br><font color="#FF0000">Boolean parameter:</font><font color="#000000">
|
|
If true, full correalted self-adaptive mutation will be used for each individual.
|
|
</font><font color="#FF0000">Default
|
|
is false</font><font color="#000000">.</font>
|
|
<p><b><font color="#FF6600">Note</font></b><font color="#000000">: The
|
|
default values result in an isotropic self-adaptive mutation to be chosen.</font>
|
|
<p>
|
|
<hr SIZE=5 WIDTH="30%">
|
|
<p><b><font size=+1><font color="#FF0000">Section </font><tt><font color="#CC33CC">######
|
|
Variation Operators ######</font></tt></font></b>
|
|
<br><font color="#000000">Only the parameters that are specific to ESEA
|
|
are presented here - the </font><b><tt><font color="#CC33CC"><font size=+1>objectBounds,operator,pCross</font></font></tt></b><font color="#000000">
|
|
and </font><b><tt><font color="#CC33CC"><font size=+1>pMut</font></font></tt></b><font color="#000000">
|
|
are exactly the same as for </font><b><tt><font color="#993300"><font size=+1>RealEA</font></font></tt></b><font color="#000000">
|
|
above.</font>
|
|
<p><b><tt><font color="#CC33CC"><font size=+1># --crossType=global # -C
|
|
: Type of ES recombination (global or standard)</font></font></tt></b>
|
|
<br><font color="#FF0000">String parameter:</font><font color="#000000">
|
|
Es crossover can involve only two parents - and it is then identical to
|
|
the </font><b><tt><font color="#CC33CC"><font size=+1>standard</font></font></tt></b><font color="#000000">
|
|
hypercube crossover describe for the </font><b><tt><font color="#993300"><font size=+1>RealEA</font></font></tt></b><font color="#000000">
|
|
parameters above. But new parents can also be chosen anew for each variable
|
|
before doing the crossover for that variable - and this is called </font><b><tt><font color="#CC33CC"><font size=+1>global</font></font></tt></b><font color="#000000">
|
|
recombination.</font>
|
|
<p><b><tt><font color="#CC33CC"><font size=+1># --crossObj=discrete # -O
|
|
: Recombination of object variables (discrete or intermediate)</font></font></tt></b>
|
|
<br><font color="#FF0000">String parameter:</font><font color="#000000">
|
|
There are two possible crossovers in plain ES. The </font><b><tt><font color="#CC33CC"><font size=+1>discrete</font></font></tt></b><font color="#000000">
|
|
crossover simpy exchanges variables among the parents. It is similar to
|
|
the plain uniform crossover for real variables. The crossover performs
|
|
a linear combination of parents;variables - it si similar to the hypercube
|
|
crossover described for with alpah parameter set to 0. This parameter
|
|
allso to choose the type of crossover that will be applied to the </font><b><font color="#FF6600">object
|
|
variables</font></b><font color="#000000"> (i.e. the origianl variables
|
|
of the problem). </font><font color="#FF0000">Default is discrete.</font>
|
|
<p><b><tt><font color="#CC33CC"><font size=+1># --crossStdev=intermediate
|
|
# -S : Recombination of mutation strategy parameters (intermediate or discrete)</font></font></tt></b>
|
|
<br><font color="#FF0000">String parameter:</font><font color="#000000">
|
|
This parameter allows to choose the type of crossover (see above) that
|
|
will be applied to the </font><b><font color="#FF6600">mutation strategy
|
|
parameters</font></b><font color="#000000"> that are part of the genotype.
|
|
</font><font color="#FF0000">Default
|
|
is intermediate.</font>
|
|
<p><b><tt><font color="#CC33CC"><font size=+1># --TauLoc=1 # -l : Local
|
|
Tau (before normalization)</font></font></tt></b>
|
|
<br><font color="#FF0000">Floating-point parameter:</font><font color="#000000">
|
|
The local factor for the mutation of the mutation strategy parameters (the
|
|
only one used when a single standard deviation is used). </font><font color="#FF0000">Default
|
|
is 1</font><font color="#000000">.</font>
|
|
<p><b><tt><font color="#CC33CC"><font size=+1># --TauGlob=1 # -g : Global
|
|
Tau (before normalization)</font></font></tt></b>
|
|
<br><font color="#FF0000">Floating-point parameter:</font><font color="#000000">
|
|
The global factor for the mutation of the mutation strategy parameters
|
|
(only useful when more than one standard deviation are used). </font><font color="#FF0000">Default
|
|
is 1</font><font color="#000000">.</font>
|
|
<p><b><tt><font color="#CC33CC"><font size=+1># --Beta=0.0873 # -b : Beta</font></font></tt></b>
|
|
<br><font color="#FF0000">Floating-point parameter:</font><font color="#000000">
|
|
The factor for the mutation of the rotation angles in the case of the full
|
|
correlated mutation. </font><font color="#FF0000">Default is 0.0873</font><font color="#000000">
|
|
(following Schwefel).</font>
|
|
<p>
|
|
<hr SIZE=5 WIDTH="100%">
|
|
<br><a NAME="programmerguide"></a><b><font color="#000099"><font size=+2>Programmer's
|
|
guide</font></font></b>
|
|
<p>At the moment, you will have to browse in the source (colored!) code
|
|
(<a href="BitEA.html">Bit</a> - Real) almost by yourself, sorry.
|
|
<p>Note that the main file is now very slim, as it only contains calls
|
|
to some <b><tt><font color="#993300"><font size=+1>make_xxx</font></font></tt></b>
|
|
functions - these functions contain the actual code, very similar to the
|
|
code of Lesson3, except for the memory management, performed through an
|
|
<b><tt><font color="#993300"><font size=+1><a href="../../doc/html/classeo_state.html">eoState</a></font></font></tt></b>
|
|
object (notice that all <b><tt><font color="#993300"><font size=+1>make_xxx</font></font></tt></b>
|
|
calls have an eoState as second parameter).
|
|
<p><b><font color="#000099"><font size=+2>Programmer's guide: </font></font><font color="#FF0000"><font size=+1>The
|
|
make_xxx files</font></font></b>
|
|
<p><b><font color="#FF0000">Interface</font></b>: all <b><tt><font color="#993300"><font size=+1>make_xxx</font></font></tt></b>
|
|
files have as first two parameters an <b><tt><font color="#993300"><font size=+1><a href="../../doc/html/classeo_parser.html">eoParser</a></font></font></tt></b>
|
|
and an <b><tt><font color="#993300"><font size=+1><a href="../../doc/html/classeo_state.html">eoState</a></font></font></tt></b>.
|
|
The <b><tt><font color="#3366FF"><font size=+1>eoParser</font></font></tt></b>
|
|
is be used within all functions to parse the command-line and/or a parameter
|
|
file in order to read any relevant user-parameter, while the <b><tt><font color="#3366FF"><font size=+1>eoState</font></font></tt></b>
|
|
is used here to store all pointers to be allocated inside the function
|
|
(see <a href="eoProgramming.html#memory">Programming hints</a> for more
|
|
detailed explanations).
|
|
<p>There are 2 types of <b><tt><font color="#993300"><font size=+1>make_xxx</font></font></tt></b>
|
|
files: the ones that do depend on representation, defining the <b><font color="#FF9900">genotype
|
|
</font></b>and
|
|
<b><font color="#CC33CC">initialization</font></b>
|
|
(<b><tt><font color="#CC33CC"><font size=+1>make_genotype_xxx</font></font></tt></b>,
|
|
with xxx being the type of genotype) and variation operators (<b><tt><font color="#CC33CC"><font size=+1>make_op_xxx</font></font></tt></b>),
|
|
and the one that are truly representation-independent (<b><tt><font color="#993300"><font size=+1>make_pop,
|
|
make_continue, make _checkpoint, make_algo </font></font></tt></b><font color="#000000">and</font><b><tt><font color="#993300"><font size=+1>
|
|
make_run</font></font></tt></b>).
|
|
<br>The former are located in the directory corresponding to the actual
|
|
genotype (<b><tt><font color="#FF9900"><font size=+1>src/ga</font></font></tt></b>
|
|
for eoBit, <b><tt><font color="#FF9900"><font size=+1>src/es</font></font></tt></b>
|
|
for eoReal and all eoESxxx genotypes). The latter are in the directory
|
|
<b><tt><font color="#993300"><font size=+1>src/do.</font></font></tt></b>
|
|
<p>If you take a close look at the code of <b><tt><font color="#993300"><font size=+1><a href="../../src/do/make_continue.h">make_continue</a></font></font></tt></b>
|
|
for instance, you will first notice that ... the function declared there
|
|
is called <b><tt><font color="#993300"><font size=+1>do_make_continue</font></font></tt></b>
|
|
and is not <a href="BitEA.html#continue">the one you are calling</a> in
|
|
the main file, though it has the same parameters as arguments.
|
|
<br>The explanation lies within the file <b><tt><font color="#FF9900"><font size=+1>make_continue_xxx.cpp</font></font></tt></b>
|
|
(with xxx = ga or real/es)which, as its color (and name) should have
|
|
told you about, are representation-dependent: in fact the <b><tt><font color="#FF9900"><font size=+1>make_continue_xxx.cpp</font></font></tt></b>
|
|
files only instanciates the general <EOT> template into one of the possible
|
|
template for eoBit or eoReal/eoES - and this trick allows to <b><font color="#FF6600">compile
|
|
them separately</font></b>!
|
|
<p>The other thing that you should notice is that the code there is very
|
|
similar to the code that was in Lesson 3, regarding parameter reading
|
|
and type of object that are allocated - except for memory management. This
|
|
goes for all <b><tt><font color="#993300"><font size=+1>make_xxx</font></font></tt></b>
|
|
files - so the only thing you need to understand how it goes is to look
|
|
at the <a href="#memory">memory management section</a>.
|
|
<p><b><font color="#FF0000">Pros</font></b>: you don't have to handle a
|
|
huge main function - and many of the make_xxx files can be directly used
|
|
in different applications (this is called <b><font color="#FF6600">modularity</font></b>
|
|
:-)))
|
|
<br>More interesting, you can even <b><font color="#FF6600">compile</font></b>
|
|
the <b><tt><font color="#993300"><font size=+1>make_xxx</font></font></tt></b>
|
|
files <b><font color="#FF6600">separately</font></b> for a given target
|
|
template, and link them e.g. with your fitness function when it is ready
|
|
(remember that up to now you needed to compile everything altogether by
|
|
including the code into your mail fine). Indeed, if you do a global make,
|
|
you will notice that there are additional libraries compiled in <b><tt><font color="#FF9900"><font size=+1>src/ga</font></font></tt></b>
|
|
and <b><tt><font color="#FF9900"><font size=+1>src/es</font></font></tt></b>
|
|
...
|
|
<p><b><font color="#FF0000">Cons</font></b>: It makes the code a little
|
|
more complex to understand, first because of the indirection needed for
|
|
pre-compilation with a given template, and second because of the memory
|
|
management that this imposes.
|
|
<br>
|
|
<br>
|
|
<p><a NAME="memory"></a><b><font color="#000099"><font size=+2>Programmer's
|
|
guide: </font></font><font color="#FF0000"><font size=+1>Memory management</font></font></b>
|
|
<br>As already said, all functions have an <b><tt><font color="#3366FF"><font size=+1>eoState</font></font></tt></b>
|
|
as second argument - and that object is used to store the functor objects
|
|
that were simply declared as variables of the main function up to now :
|
|
see <a href="eoProgramming.html#memory">Programming hints</a> for more
|
|
detailed explanations and take a look at the code of <b><tt><font color="#993300"><font size=+1><a href="../../src/do/make_continue.h">make_continue</a></font></font></tt></b>
|
|
for instance, you will see the implementation of the memory management
|
|
in action.
|
|
<p><a NAME="parameter"></a><b><font color="#000099"><font size=+2>Programmer's
|
|
guide: </font></font><font color="#FF0000"><font size=+1>Memory management
|
|
of eoParam objects</font></font></b>
|
|
<p>It has been seen in Lesson 3 that parameters could be read from command-line
|
|
and/or a parameter file using an <b><tt><font color="#3366FF"><font size=+1>eoParser</font></font></tt></b>
|
|
object. However, the memory mangement problem also concerns EO parameter
|
|
objects (<b><tt><font color="#3366FF"><font size=+1>eoParam</font></font></tt></b>):
|
|
the way there are read in <a href="eoLesson3.html#parameters">Lesson3</a>
|
|
makes them local variables of the function they are defined in.
|
|
<br>It is however possible to ask the <b><tt><font color="#3366FF"><font size=+1>eoParser</font></font></tt></b>
|
|
to hold them, as done for instance in eoContinue for the maximum number
|
|
of generations. Local declaration would amount to something like :
|
|
<p><b><tt><font color="#3366FF"><font size=+1>eoValueParam<unsigned
|
|
int>& maxGenParam(100, "maxGen", "Maximum number of generations ()
|
|
= none)",'G');</font></font></tt></b>
|
|
<br><b><tt><font color="#3366FF"><font size=+1> parser.processParam(
|
|
maxGenParam, "Stopping criterion" );</font></font></tt></b>
|
|
<br><b><tt><font color="#3366FF"><font size=+1> unsigned maxGen =
|
|
maxGenParam.value();</font></font></tt></b>
|
|
<p>while if you want the parser to hold those eoParam objects, you will
|
|
write something like
|
|
<p><b><tt><font color="#3366FF"><font size=+1>eoValueParam<unsigned>&
|
|
maxGenParam = _parser.createParam(unsigned(100), "maxGen", "Maximum number
|
|
of generations () = none)",'G',"Stopping criterion");</font></font></tt></b>
|
|
<p>and then use <b><tt><font color="#3366FF"><font size=+1>maxGenParam.value()</font></font></tt></b>
|
|
to get the value enterred by the user. In that case, you get a <b><font color="#FF6600">reference</font></b>
|
|
to an eoParam object that is hold by the eoParser - and deleted whith it.
|
|
<br>Note that there are <b><font color="#FF6600">two important differences</font></b>
|
|
between the arguments of the constructor of an eoParam object and the method
|
|
createParam of an eoParser object: first, you need to provide the additional
|
|
section parameter (used only when outputting the eoParser); second you
|
|
<b><font color="#FF6600">must</font></b>
|
|
make sure that the first argument is of the correct type otherwise the
|
|
compiler will complain.
|
|
<p>Note that if you don't later need the eoParam, but simply its value,
|
|
you can even diretly write
|
|
<p><b><tt><font color="#3366FF"><font size=+1>unsigned maxGen = _parser.createParam(unsigned(100),
|
|
"maxGen", "Maximum number of generations () = none)",'G',"Stopping criterion").value();</font></font></tt></b>
|
|
<p><b><font color="#FF0000"><font size=+1>Getting parameter values in different
|
|
functions:</font></font></b>
|
|
<p>It is often useful (though probably <b><font color="#FF6600">very bad
|
|
programming style </font></b>:-))) to be able to get the value of a user-defined
|
|
parameter in two different places of the code without passing it around
|
|
through many levels of call. You can then use the alternate function <b><tt><font color="#3366FF"><font size=+1>getORcreateParam</font></font></tt></b>
|
|
with exactly the same syntax than <b><tt><font color="#3366FF"><font size=+1>createParam</font></font></tt></b>.
|
|
<br>Be careful that the link between both parameters is made through their
|
|
longmanes (second argument), and that you must so <b><font color="#FF6600">hard-code</font></b>
|
|
that name in two different places with of course exactly the same spelling!!!
|
|
<br><b><font color="#FF6600">Examples</font></b> can be found for instance
|
|
in the make_genotype_xxx files, for the sizes of the genotypes: it is often
|
|
the case that the definition of the optimization problem requires (or computes)
|
|
such size. The idea is then that you either read or compute that size,
|
|
then create a (dummy) parameter with the name that is used later in the
|
|
make_genotype file. For instance, for bitstrings, the make_genotype_ga.h
|
|
contains the following line defining the size of the bitstring
|
|
<p><b><tt><font color="#3366FF"><font size=+1> unsigned theSize =
|
|
_parser.getORcreateParam(unsigned(10), "chromSize", "The length of the
|
|
bitstrings", 'n',"Problem").value();</font></font></tt></b>
|
|
<p>If you want to define that size earlier, you should write somewhere
|
|
before
|
|
<br>
|
|
<p><b><tt><font color="#3366FF"><font size=+1> unsigned requiredSize
|
|
= ... ;</font></font></tt></b>
|
|
<br><b><tt><font color="#3366FF"><font size=+1> _parser.createParam(requiredSize,
|
|
"chromSize", "The length of the bitstrings", 'n',"Problem");</font></font></tt></b>
|
|
<p>Of course, if that size is mandatory, you should NOT modify it at run-time
|
|
by entering anther value !
|
|
<p>
|
|
<hr WIDTH="100%"><b><font color="#FF0000">User's guide:</font></b> <a href="#userguide">General</a>
|
|
- <a href="#binary">Bitstring</a> - <a href="#real">Real</a> - <a href="#ES">ES</a>
|
|
- <b><font color="#FF0000">Programmer's guide:</font></b> <a href="#programmerguide">General</a>
|
|
- <a href="#memory">Memory management </a>- <a href="#parameter">Parameters</a>
|
|
<br>
|
|
<hr WIDTH="100%"><font color="#000000"><a href="eoLesson3.html">Lesson
|
|
3</a> -
|
|
<a href="eoLesson5.html">Lesson 5</a> -
|
|
<a href="eoTutorial.html">Main
|
|
page</a> -
|
|
<a href="eoTopDown.html">Algorithm-Based</a> - <a href="eoBottomUp.html">Component-Based</a>
|
|
- <a href="eoProgramming.html">Hints</a> -<b> <font face="Arial,Helvetica"><font size=+1><a href="../../doc/html/index.html">EO
|
|
documentation</a></font></font></b></font>
|
|
<br>
|
|
<hr>
|
|
<address>
|
|
<font color="#000000"><a href="mailto:Marc.Schoenauer@inria.fr">Marc Schoenauer</a></font></address>
|
|
|
|
<br><!-- Created: Tue May 1 14:49:12 CET 2001 --><!-- hhmts start --><font color="#000000">Last
|
|
modified: None of your business!</font><!-- hhmts end -->
|
|
</body>
|
|
</html>
|