[][src]Trait genevo::genetic::FitnessFunction

pub trait FitnessFunction<G, F>: Clone where
    G: Genotype,
    F: Fitness
{ fn fitness_of(&self, a: &G) -> F;
fn average(&self, a: &[F]) -> F;
fn highest_possible_fitness(&self) -> F;
fn lowest_possible_fitness(&self) -> F; }

Defines the evaluation function to calculate the Fitness value of a Genotype based on its properties.

Required methods

fn fitness_of(&self, a: &G) -> F

Calculates the Fitness value of the given Genotype.

fn average(&self, a: &[F]) -> F

Calculates the average Fitness value of the given Fitness values.

fn highest_possible_fitness(&self) -> F

Returns the very best of all theoretically possible Fitness values.

fn lowest_possible_fitness(&self) -> F

Returns the worst of all theoretically possible Fitness values. This is usually a value equivalent to zero.

Loading content...

Implementors

Loading content...