Function genomic::reproduce

source ·
pub fn reproduce<G: Genome + Clone>(
    parent_left: &G,
    parent_right: &G,
    crossover_method: CrossoverMethod,
    mutation_rate: f64,
    rng: &mut impl Rng
) -> (G, G)
Expand description

Reproduces two parent individuals, creating two children with a crossover of the parent’s chromosomes and some mutation.

The two parent should have the same amount of chromosomes (as defined by [Chromosome::size_hint]). If not, then the crossover operation may yield undesired results.

Each child is mutated with its own StdRng, meaning that dropping one of the children should fully optimize out its mutation (assuming this function call gets inlined).