[][src]Enum radiate::engine::survival::ParentalCriteria

pub enum ParentalCriteria {

Implement a way to pick parents of children, in other words how is the rest of the population generation after those who don't survice die out.

BiasedRandom - the default option, statistically pick more fit parents however allow for less fit parents to be picked as well. This is kinda like putting the members in a species on a curve and randomly picking from that distribution OnlySurvivers - those who survive are only allowed to reproduce BestInEachSpecies - only the best in each species are allowed to reproduce MostDifferent - Pick one parent, then find the parent most different from it (structurally) and use that as the other parent. Note this could lead to large expansion in population




impl ParentalCriteria[src]

implement the pick parents

pub fn pick_parents<T, E>(
    inbreed_rate: f32,
    families: &Vec<Family<T, E>>
) -> Option<((f32, Member<T>), (f32, Member<T>))> where
    T: Genome<T, E> + Send + Sync + Clone,
    E: Send + Sync

Find two parents to crossover and produce a child

pub fn get_biased_random_member<T, E>(
    r: &mut ThreadRng,
    family: &Family<T, E>
) -> (f32, Member<T>) where
    T: Genome<T, E> + Send + Sync + Clone,
    E: Send + Sync

Get a biased random member from the species. By summing the fitness scores of the members, members with larger fitness scorese are statistically more likely to be picked

Trait Implementations

impl Clone for ParentalCriteria[src]

impl Debug for ParentalCriteria[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> BorrowMut<T> for T where
    T: ?Sized

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Type for T[src]

type Meta = Concrete

Type of metadata for type.

impl<T> Type for T where
    T: ?Sized

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,