[][src]Trait oxigen::age::Age

pub trait Age: Send + Sync {
    fn age_threshold(&self) -> u64;
fn age_unfitness(&self, age_generations: u64, fitness: f64) -> f64; }

This trait defines the manner in which old individuals are fitness decreased.

Required methods

fn age_threshold(&self) -> u64

Returns the minimum number of generations required to start the age unfitness.

fn age_unfitness(&self, age_generations: u64, fitness: f64) -> f64

Returns the fitness after decrease it by age using the number of age_generations that exceeds the age threshold. The generation when the individual is created is the age 0. This function is called when age_generations is bigger or equal than 0. E.g.:

This example is not tested
individual.age=2, age_threshold=2 -> age_generations=0
This example is not tested
individual.age=1, age_threshold=2 -> age_generations=-1 (not called)
This example is not tested
individual.age=4, age_threshold=2 -> age_generations=2
Loading content...

Implementors

impl Age for AgeFunctions[src]

Loading content...