Skip to main content

Selection

Trait Selection 

Source
pub trait Selection<G>: Default {
    // Required method
    fn select<'pop, R>(
        &self,
        population: &'pop [Chromosome<G>],
        count: usize,
        rng: &mut R,
    ) -> Vec<&'pop Chromosome<G>>
       where R: Rng + ?Sized;
}
Expand description

Trait for selecting a subset of the population

Required Methods§

Source

fn select<'pop, R>( &self, population: &'pop [Chromosome<G>], count: usize, rng: &mut R, ) -> Vec<&'pop Chromosome<G>>
where R: Rng + ?Sized,

Selects a subset of the population

§Arguments
  • population - The population to select from
  • count - The number of individuals to select
  • rng - The random number generator
§Returns

A vector of selected individuals

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§