[][src]Struct radiate::engine::generation::Generation

pub struct Generation<T, E> where
    T: Genome<T, E> + Send + Sync,
    E: Send + Sync
{ pub members: Vec<Container<T, E>>, pub species: Vec<Family<T, E>>, pub survival_criteria: SurvivalCriteria, pub parental_criteria: ParentalCriteria, }

A generation is meant to facilitate the speciation, crossover, and reproduction of spececies and their types over the course of a single genertion


members: Vec<Container<T, E>>species: Vec<Family<T, E>>survival_criteria: SurvivalCriteriaparental_criteria: ParentalCriteria


impl<T, E> Generation<T, E> where
    T: Genome<T, E> + Send + Sync + Clone,
    E: Envionment + Sized + Send + Sync

implement the generation

pub fn new() -> Self[src]

Create a new generation

This creates a base default generation type with no members and no species. It is bland.

pub fn pass_down(&self, new_members: Vec<Member<T>>) -> Option<Self>[src]

passdown the previous generation's members and species to a new generation

pub fn optimize<P>(&mut self, prob: Arc<RwLock<P>>) -> Option<(f32, Arc<T>)> where
    P: Problem<T> + Send + Sync

The optimization function

pub fn speciate(&mut self, distance: f32, settings: &Arc<RwLock<E>>)[src]

Speciation is the process of going through the members in the generation and assigning them species in which they belong to determined by a specific distance between the member and the species mascot.

pub fn create_next_generation(
    &mut self,
    pop_size: i32,
    config: Config,
    env: &Arc<RwLock<E>>
) -> Option<Self>

Create the next generation and return a new generation struct with new members, and reset species. This is how the generation moves from one to the next. This function also is the one which runs the crossover fn from the genome trait, the more effecent that function is, the faster this function will be.

pub fn best_member(&self) -> Option<(f32, Arc<T>)>[src]

get the top member of the generations

Trait Implementations

impl<T: Debug, E: Debug> Debug for Generation<T, E> where
    T: Genome<T, E> + Send + Sync,
    E: Send + Sync

Auto Trait Implementations

impl<T, E> RefUnwindSafe for Generation<T, E>

impl<T, E> Send for Generation<T, E>

impl<T, E> Sync for Generation<T, E>

impl<T, E> Unpin for Generation<T, E>

impl<T, E> UnwindSafe for Generation<T, E>

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, 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>,