Skip to main content

Select

Trait Select 

Source
pub trait Select:
    Clone
    + Debug
    + Send
    + Sync {
    // Required method
    fn select<G: Genome>(
        &self,
        population: &Population<G>,
        objective: Objective,
        count: usize,
        rng: &mut StreamRng,
    ) -> Vec<usize>;
}
Expand description

Selects parents from an evaluated population.

Required Methods§

Source

fn select<G: Genome>( &self, population: &Population<G>, objective: Objective, count: usize, rng: &mut StreamRng, ) -> Vec<usize>

Selects count parents, with replacement: the positions of the selected individuals.

Every individual is expected to be evaluated, unevaluated individuals are treated as invalid. Returns no parents for an empty population.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§