Next: Function Definition
Up: The Language
Previous: Population Definition
The genetic algorithm is top-most entity in any Genetic Algorithm
implementation. There can be only one genetic algorithm construct in
any DARWIN program and this construct should contain at least one
population as a member. It is responsible for
creating its population and evolving it until a termination condition is
reached. The genetic algorithm also specifies the replacement strategy.
The genetic algorithm has terminator, replacement, evolver,
initializer and printer as its moderators.
The syntax of the genetic algorithm is as follows :
alg_typedef |
::= |
"algorithm" id |
|
|
"{" memb_decls "}" |
|
|
alg_moderators ";" |
alg_moderator |
::= |
initializer ":" prototype |
|
|
printer ":" prototype |
|
|
evolver ":" prototype |
|
|
terminator ":" prototype |
|
|
replacement ":" prototype |
For example, an algorithm implementing Simple GA can be
declared by just specifying a population :
algorithm GA
{
Pop population;
};
- The genetic algorithm initializer
- is responsible for initializing its
population and parameters. The default is to call the population initializer
to initializer its population.
- The genetic algorithm terminator
- is a boolean function deciding when a
termination condition is reached. The default stops if number of generations
is 100.
- The genetic algorithm replacement
- moderator is used to decide if
which of the chromosomes in the parent and offspring populations should
survive. The generated replacement moderator is dummy, so the offspring
replaces its parent population.
- The genetic algorithm evolver moderator
- is the hart of any DARWIN program.
This moderator is responsible for first creating and then evolving a
population until the termination moderator decides stopping this process.
The generated genetic algorithm evolver implements Simple GA.
- The genetic algorithm printer
- provides formatted output of the
genetic algorithm construct. By default, all the algorithm members, including
the population, are printed. This moderator is called when the termination
condition of the genetic algorithm is reached.
Next: Function Definition
Up: The Language
Previous: Population Definition
Gokturk Ucoluk
2003-09-15