Trait genevo::genetic::Fitness
[−]
[src]
pub trait Fitness: Eq + Ord + Clone + Debug + Sized { fn zero() -> Self; fn abs_diff(&self, other: &Self) -> Self; }
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::GeneticOperator
s
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
fn zero() -> Self
Returns the zero value of this Fitness
value.
The internal value should be 0.
fn abs_diff(&self, other: &Self) -> Self
Returns the absolute difference between this Fitness
value and the
other one, i.e. result = |self| - |other|