pub trait Genotype: Clone + Send + Debug + Display + TryFrom<GenotypeBuilder<Self>> {
    type Allele: Clone + Send + Debug;

    fn genes_size(&self) -> usize;
    fn chromosome_factory<R: Rng>(&self, rng: &mut R) -> Chromosome<Self>;
    fn mutate_chromosome_random<R: Rng>(
        &self,
        chromosome: &mut Chromosome<Self>,
        rng: &mut R
    ); fn crossover_points(&self) -> Vec<usize> { ... } fn crossover_indexes(&self) -> Vec<usize> { ... } fn builder() -> GenotypeBuilder<Self> { ... } }
Expand description

Standard genotype, suitable for Evolve. Each implemented genotype handles its own random genes initialization and mutation.

Required Associated Types

Required Methods

a random chromosome factory to seed the initial population for Evolve

a random mutation of the chromosome

Provided Methods

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

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

Implementors