pub enum AgeFunctions {
None,
Linear(AgeThreshold, AgeSlope),
Quadratic(AgeThreshold, AgeSlope),
}Expand description
Provided age functions.
Variants§
None
No age unfitness.
Linear(AgeThreshold, AgeSlope)
Linear function of iterations.
Quadratic(AgeThreshold, AgeSlope)
Quadratic function of iterations.
Trait Implementations§
Source§impl Age for AgeFunctions
impl Age for AgeFunctions
Source§fn age_threshold(&self) -> u64
fn age_threshold(&self) -> u64
Returns the minimum number of generations required to start the age unfitness.
Source§fn age_unfitness(&self, age_generations: u64, fitness: f64) -> f64
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.: Read moreAuto Trait Implementations§
impl Freeze for AgeFunctions
impl RefUnwindSafe for AgeFunctions
impl Send for AgeFunctions
impl Sync for AgeFunctions
impl Unpin for AgeFunctions
impl UnwindSafe for AgeFunctions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more