Trait SelectorIndividualTrait

Source
pub trait SelectorIndividualTrait<const R: usize>: EachCrateIndividual {
    type Err: Debug;

    // Required method
    fn selected_ids<'a, G>(
        group: G,
        fitnesses: HashMap<usize, usize>,
    ) -> Result<HashSet<usize>, Self::Err>
       where G: IntoIterator<Item = &'a Self>,
             Self: 'a;
}
Expand description

A trait for individual defined by selector crate.

  • T - A type of value.
  • R - The number of individuals after individuals are reduced by selector.

Required Associated Types§

Source

type Err: Debug

An error of selector. This is occurred when bad scores are given to this.

Required Methods§

Source

fn selected_ids<'a, G>( group: G, fitnesses: HashMap<usize, usize>, ) -> Result<HashSet<usize>, Self::Err>
where G: IntoIterator<Item = &'a Self>, Self: 'a,

Select individuals.

  • 'a - A lifetime of group.
  • G - A type of group.
  • group - A value which you are able to get Self from.
  • fitnesses - Scores of fitness crate.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§