Trait genetic_algorithm::crossover::Crossover

source ·
pub trait Crossover: Clone + Debug {
    // Required methods
    fn call<G: Genotype, R: Rng, SR: EvolveReporter<Genotype = G>>(
        &mut self,
        genotype: &G,
        state: &mut EvolveState<G>,
        config: &EvolveConfig,
        reporter: &mut SR,
        rng: &mut R,
    );
    fn require_crossover_indexes(&self) -> bool;
    fn require_crossover_points(&self) -> bool;
}

Required Methods§

source

fn call<G: Genotype, R: Rng, SR: EvolveReporter<Genotype = G>>( &mut self, genotype: &G, state: &mut EvolveState<G>, config: &EvolveConfig, reporter: &mut SR, rng: &mut R, )

source

fn require_crossover_indexes(&self) -> bool

to guard against invalid Crossover strategies which break the internal consistency of the genes, unique genotypes can’t simply exchange genes without gene duplication issues

source

fn require_crossover_points(&self) -> bool

to guard against invalid Crossover strategies which break the internal consistency of the genes, unique genotypes can’t simply exchange genes without gene duplication issues

Object Safety§

This trait is not object safe.

Implementors§