Module crossover

Source
Expand description

The crossover phase where every two parent chromosomes create two children chromosomes. The selection phase determines the order and the amount of the parent pairing (overall with fitter first).

If the selection dropped some chromosomes due to the selection_rate, the crossover will restore the population towards the target_population_size by keeping the best parents alive. Excess parents are dropped.

Structs§

CrossoverClone
Children are clones of the parents. The population is restored towards the target_population_size by keeping the best parents alive. Excess parents are dropped.
CrossoverMultiGene
Crossover multiple genes between the parents. The gene positions are chosen with uniform probability. Choose between allowing duplicate crossovers of the same gene or not (~2x slower). The population is restored towards the target_population_size by keeping the best parents alive. Excess parents are dropped.
CrossoverMultiPoint
Crossover multiple gene positions from which on the rest of the genes are taken from the other parent. This goes back and forth. The gene positions are chosen with uniform probability. Choose between allowing duplicate crossovers on the same point or not (not much slower, as crossover itself is relatively expensive). The population is restored towards the target_population_size by keeping the best parents alive. Excess parents are dropped.
CrossoverSingleGene
Crossover a single gene between the parents. The gene position is chosen with uniform probability. The population is restored towards the target_population_size by keeping the best parents alive. Excess parents are dropped.
CrossoverSinglePoint
Crossover a single gene position from which on the rest of the genes are taken from the other parent. The gene position is chosen with uniform probability. The population is restored towards the target_population_size by keeping the best parents alive. Excess parents are dropped.
CrossoverUniform
Crossover with 50% probability for each gene to come from one of the two parents. Actually implemented as CrossoverMultiGene::new(<genes_size> / 2, allow_duplicates=true)

Enums§

CrossoverWrapper

Traits§

Crossover