Trait oxigen::population_refitness::PopulationRefitness[][src]

pub trait PopulationRefitness<T: PartialEq + Send + Sync, G: Genotype<T>>: Send + Sync {
    fn population_refitness(
        &self,
        individual_index: usize,
        population: &[IndWithFitness<T, G>],
        generation: u64,
        progress: f64,
        n_solutions: usize
    ) -> f64; }

This trait defines the population_refitness function that permits to modify the individuals fitness comparing them to the others individuals in the population. This function is called when all individuals fitness have been computed and just before the survival pressure kill.

The refitness is done over the original fitness with age effects, but without taking into account refitnesses of previous generations.

Required methods

fn population_refitness(
    &self,
    individual_index: usize,
    population: &[IndWithFitness<T, G>],
    generation: u64,
    progress: f64,
    n_solutions: usize
) -> f64
[src]

Modify the individual fitness comparing it with the other individuals in the population. Called just before age unfitness and survival pressure kill.

Parameters:

  • individual_index: The individual index inside the population.
  • population: The full population. It includes the individual that is being evaluated (individual_index) that is probably wanted to be excluded of the comparison with population individuals. The Option<Fitness> is always Some(Fitness) when this function is called.
  • generation: The current generation.
  • progress: The progress in the last iterations.
  • n_solutions: The number of found solutions in the last generation.

Returns

The new fitness of the individual.

Loading content...

Implementors

impl<T: PartialEq + Send + Sync, G: Genotype<T>> PopulationRefitness<T, G> for PopulationRefitnessFunctions[src]

Loading content...