The genetic algorithm object determines which individuals
should survive, which should reproduce, and which
should die. It also records statistics and decides how long
the evolution should continue. Typically a genetic
algorithm has no obvious stopping criterion. You must tell
the algorithm when to stop. Often the number-of-
generations is used as a stopping measure, but you can
use goodness-of-best-solution, convergence-of-population,
or any problem-specific criterion if you prefer.
The library contains four flavors of genetic algorithms. The
first is the standard 'simple genetic algorithm' described
by Goldberg in his book. This algorithm uses non-
overlapping populations and optional elitism. Each
generation the algorithm creates an entirely new
population of individuals. The second is a 'steady-state
genetic algorithm' that uses overlapping populations. In
this variation, you can specify how much of the population
should be replaced in each generation. The third variation
is the 'incremental genetic algorithm', in which each
generation consists of only one or two children. The
incremental genetic algorithms allow custom replacement
methods to define how the new generation should be
integrated into the population. So, for example, a newly generated child could replace its parent,
replace a random individual in the population, or replace an individual that is most like it. The fourth
type is the 'deme' genetic algorithm. This algorithm evolves multiple populations in parallel using a
steady-state algorithm. Each generation the algorithm migrates some of the individuals from each
population to one of the other populations.
In addition to the basic built-in types, GAlib defines the components you'll need to derive your own
genetic algorithm classes. The examples include a few of these derivations including (1) a genetic
algorithm that uses multiple populations and 'migration' between populations on multiple CPUs, and
(2) a genetic algorithm that does 'deterministic crowding' to maintain different species of individuals
during the evolution.
The base genetic algorithm class contains operators and data common to most flavors of genetic
algorithms. When you derive your own genetic algorithm you can use these member data and
functions to keep track of statistics and monitor performance.
The genetic algorithm contains the statistics, replacement strategy, and parameters for running the
algorithm. the population object, a container for genomes, also contains some statistics as well as
selection and scaling operators. A typical genetic algorithm will run forever. The library has built in
functions for specifying when the algorithm should terminate. These include terminate-upon-
generation, in which you specify a certain number of generations for which the algorithm should run,
and terminate-upon-convergence, in which you specify a value to which the best-of-generation score
should converge. You can customize the termination function to use your own stopping criterion.
The number of function evaluations is a good way to compare different genetic algorithms with various
other search methods. The GAlib genetic algorithms keep track of both the number of genome
evaluations and population evaluations.
initialize
population
select individuals
for mating
mate individuals
to produce offspring
are stopping
criteria satisfied?
finish
insert offspring
into population
mutate offspring