[−][src]Module genevo::ga
This module provides an algorithm::Algorithm
which implements the genetic
algorithm (GA).
The stages of the basic genetic algorithm are:
- Initialize: Generate random population of n genotypes (or chromosomes)
- Fitness: Evaluate the fitness of each genotype in the population
- New Population: Create a new population by repeating following steps
until the new population is complete:
3.1. Selection: Select a tuple of parent genotypes from a population
according to their fitness and the selection strategy of the
configured
operator::SelectionOp
3.2. Crossover: With a crossover probability cross over the parents to form a new offspring (child) by means of the configuredoperator::CrossoverOp
. 3.3. Mutation: With a mutation probability mutate new offspring at each locus (position in genotype) by means of the configuredoperator::MutationOp
. 3.4. Accepting: Place new offspring in the new population. - Replace: Use new generated population for a further run of the algorithm.
- Termination: If the end condition is satisfied, stop, and return the best solution in current population.
- Loop: Go to step 2
Modules
builder |
Structs
GeneticAlgorithm | A |
State | The |
Enums
GeneticAlgorithmError | An error that can occur during execution of a |
Functions
genetic_algorithm |