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§
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, )
sourcefn require_crossover_indexes(&self) -> bool
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
sourcefn require_crossover_points(&self) -> bool
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.