Trait rsgenetic::pheno::Phenotype [] [src]

pub trait Phenotype<F>: Clone where
    F: Fitness
{ fn fitness(&self) -> F;
fn crossover(&self, _: &Self) -> Self;
fn mutate(&self) -> Self; }

Defines what a Phenotype is. A Phenotype can breed with other Phenotypes, resulting in a single child. A Phenotype can also be mutated. Finally, a Phenotype has a certain fitness value associated with it.

If reasonable, it is recommended to have your implementation derive Copy.

Required Methods

Calculate the fitness of this Phenotype.

Perform crossover on this Phenotype, returning a new Phenotype.

Perform mutation on this Phenotype, returning a new Phenotype.

Implementors