Skip to main content

Selection

Trait Selection 

Source
pub trait Selection {
    // Required method
    fn select<R: Rng + ?Sized>(
        &mut self,
        costs: &[f64],
        count: usize,
        rng: &mut R,
        out: &mut Vec<usize>,
    );
}
Expand description

Picks parent indices from a population, given the population’s costs.

Required Methods§

Source

fn select<R: Rng + ?Sized>( &mut self, costs: &[f64], count: usize, rng: &mut R, out: &mut Vec<usize>, )

Appends count indices into costs to out. Indices may repeat.

costs is never empty when the algorithms call this.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<S: Selection + ?Sized> Selection for &mut S

Source§

fn select<R: Rng + ?Sized>( &mut self, costs: &[f64], count: usize, rng: &mut R, out: &mut Vec<usize>, )

Implementors§