Struct rsgenetic::sim::select::StochasticSelector [] [src]

pub struct StochasticSelector {
    // some fields omitted
}

Selects phenotypes at random, starting from a random index and taking equidistant jumps.

Commonly known as Stochastic Universal Sampling.

Methods

impl StochasticSelector
[src]

fn new(count: usize) -> StochasticSelector

Create and return a stochastic selector.

Such a selector selects elements using stochastic universal sampling, yielding parents with low, medium and high fitness values. In total, count parents are selected.

  • count: must be larger than zero, a multiple of 2 and less than the population size.

Trait Implementations

impl<T: Phenotype> Selector<T> for StochasticSelector
[src]

fn select(&self, population: &Vec<T>, _: FitnessType) -> Result<Parents<T>, String>

Select elements from a population, either maximizing or minimizing the fitness (fitness_type). Read more