Contents
Introduction
The term evolution engine denotes the different parts that simulate
the Darwinism in Evolutionary Algorithms.
The fittest individuals are more likely to reproduce and survive.
Darwinism takes place in two different phases of an EA, though in many popular variants, only one phase is activated.
Selection is the Darwinistic choice of parents
that will be allowed to reproduce.
Replacement takes place after reproduction,
and is the Darwinistic choice of those individuals that will survive,
i.e. become the parents of the next generation.
Replacement
The replacement phase takes place after the birth
of all offspring through variation operators. The idea is to close
the generation loop, i.e. to end up with a population of individuals that
will be the initial population of next generation. That population will
be built upon the old parents and the new-born offspring.
In all algorithms that come up with EO, the population
size is supposed to be constant from
one generation to the next one - though nothing stops you from writing
an algorithm with varying population size.
Replacement: The
interface
The abstract class for replacement procedures is the functor class
eoReplacement,
and the interface for its operator()
is
void operator()(const eoPop<EOT>& _parents, eoPop<EOT>& _offspring)
which you could have guessed from the inheritance tree for class eoReplacement.,
as you see there that eoReplacement derives
from class eoBF<const eoPop<EOT>&,
eoPop<EOT>&, void>.
This means that it takes 2 populations
(called, for obvious anthropomorphic reasons, _parents and _offspring :-)
and puts the result into population offspring (as _parents is passed as
constant
population).
Note: After the replacement step, all algorithms swap the parents and offspring populations - this is why the result of the replacement is put into the _offspring population -- the _parents being there untouched until the very last moment.
Replacement: Instances
Available instances of eoMerge objects
are eoPlus, that simply adds
the parents to the offspring, or eoElitism,
that adds only some of the (best) parents to the offspring. A special case
of eoElistism is eoNoElitism,
an eoMerge that does nothing.
Available instances of eoReduce are eoTruncate, that deterministically keeps only the required number of individuals, taking the best ones, and eoEPReduce that usees the EP stocahstic tournamenent to reduce the population.
Available instances of eoMergeReduce replacement procedures are built on the above, and include
Replacement: Adding
(weak) elitism
You can add what is called weak elitism
to any replacement by encapsulating it into an eoWeakElitismReplacement
object. Weak elitism ensures that the overall best
fitness in the population will never decrease:
if the best fitness in the new population is less than the best fitness
of the parent population, then the best parent is added back to the new
population, replacing the worse.
Within EO, this is very easy to add:
First, declare your replacement functor (here, generational, but it
can be any replacement object):
eoNoReplacement<Indi> genReplace;
Then wrap the weak elitism around it:
eoWeakElitismReplacement<Indi> replace(genReplace);
and use now replace as your replacement procedure within your algorithm.
Note: of course, adding weak elitism to an elitist replacement makes no sense - but will not harm either :-)
Popular
evolution engines
The most popular evolution engines are listed below, together with
the way to use them in EO. If you don't find your particuler algorithm,
please send it to us, and we might include it here!