[−][src]Struct radiate::engine::generation::Generation
A generation is meant to facilitate the speciation, crossover, and reproduction of spececies and their types over the course of a single genertion
Fields
members: Vec<Container<T, E>>
species: Vec<Family<T, E>>
survival_criteria: SurvivalCriteria
parental_criteria: ParentalCriteria
Methods
impl<T, E> Generation<T, E> where
T: Genome<T, E> + Send + Sync + Clone,
E: Envionment + Sized + Send + Sync,
[src]
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,
[src]
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>
[src]
&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,
[src]
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,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
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>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Type for T
[src]
const METATYPE: MetaType
[src]
type Meta = Concrete
Type of metadata for type.
fn meta(self: *const T) -> <T as Type>::Meta
[src]
fn data(self: *const T) -> *const ()
[src]
fn data_mut(self: *mut T) -> *mut ()
[src]
fn dangling(_t: <T as Type>::Meta) -> NonNull<T>
[src]
fn fatten(thin: *mut (), _t: <T as Type>::Meta) -> *mut T
[src]
fn meta_type(self: *const Self) -> MetaType
[src]
impl<T> Type for T where
T: ?Sized,
[src]
T: ?Sized,
default fn meta(self: *const T) -> <T as Type>::Meta
[src]
default fn data(self: *const T) -> *const ()
[src]
default fn data_mut(self: *mut T) -> *mut ()
[src]
default fn dangling(t: <T as Type>::Meta) -> NonNull<T>
[src]
default fn fatten(thin: *mut (), t: <T as Type>::Meta) -> *mut T
[src]
const METATYPE: MetaType
[src]
type Meta: 'static
fn meta_type(self: *const Self) -> MetaType
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,