[−][src]Struct radiate::engine::generation::Generation
A generation is meant to facilitate the speciation, crossover, and reproduction of species and their types over the course of a single generation
Fields
members: Vec<Container<T, E>>
species: Vec<Family<T, E>>
survival_criteria: SurvivalCriteria
parental_criteria: ParentalCriteria
Implementations
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]
pass down the previous generation's members and species to a new generation
pub fn members_mut(&mut self) -> &mut [Container<T, E>]
[src]
Get mutable slice of current generation members.
pub fn member_mut(&mut self, idx: usize) -> Option<&mut Container<T, E>>
[src]
Get mutable member.
pub fn member(&self, idx: usize) -> Option<&Container<T, E>>
[src]
Get immutable member.
pub fn optimize<P>(&mut self, prob: Arc<RwLock<P>>) 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 efficient 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,
pub 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> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
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.
pub 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.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,