pub trait Fitness: Eq + Ord + Clone + Debug + Sized {
    fn zero() -> Self;
fn abs_diff(&self, other: &Self) -> Self; }
Expand description

A Fitness value is used to determine the quality of a Genotype. Fitness values should have an ordering, also called ranking.

Make sure the following statement holds: A Genotype with a Fitness value of f1 performs better than another Genotype with a Fitness value of f2 if f1 > f2.

For multi-objective Fitness values either operator::GeneticOperators suitable for multi-objective optimization are used or the implementation of the multi-objective Fitness value additionally implements the AsScalar trait. Using single-objective optimization for multi-objective problems has some drawbacks though.

Required methods

Returns the zero value of this Fitness value. The internal value should be 0.

Returns the absolute difference between this Fitness value and the other one, i.e. result = |self| - |other|

Implementations on Foreign Types

Implementors