[][src]Trait genevo::genetic::Fitness

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::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

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|

Loading content...

Implementations on Foreign Types

impl Fitness for i8[src]

impl Fitness for i16[src]

impl Fitness for i32[src]

impl Fitness for i64[src]

impl Fitness for isize[src]

impl Fitness for u8[src]

impl Fitness for u16[src]

impl Fitness for u32[src]

impl Fitness for u64[src]

impl Fitness for usize[src]

Loading content...

Implementors

Loading content...