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

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

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

Required methods

pub fn age_threshold(&self) -> u64[src]

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

pub fn age_unfitness(&self, age_generations: u64, fitness: f64) -> f64[src]

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

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

Implementors

impl Age for AgeFunctions[src]

Loading content...