[][src]Trait oxigen::survival_pressure::SurvivalPressure

pub trait SurvivalPressure<T: PartialEq + Send + Sync, G: Genotype<T>>: Send + Sync {
    fn kill(
        &self,
        population_size: usize,
        population: &mut Vec<IndWithFitness<T, G>>,
        parents_children: &[Reproduction]
    ); }

This trait defines the kill function used to remove individuals at the end of a generation.

Required methods

fn kill(
    &self,
    population_size: usize,
    population: &mut Vec<IndWithFitness<T, G>>,
    parents_children: &[Reproduction]
)

Removes individuals according to the population size; the population and the fitness of the population; and the parents and children relationships. Population is not sorted in any particular order, but children are after population_size. Note that in oxigen 1.x versions this function returned the indexes to be deleted without modifying the population, not it directly removes the individuals.

Loading content...

Implementors

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

Loading content...