[−][src]Struct radiate::engine::niche::Niche
A species is meant to keep track of fitness scores of each of it's members, and a mascot. The mascot is the representation of the species by a Type member in the population. It also holds the number of age it's been alive
Fields
mascot: Member<T>
members: Vec<NicheMember<T>>
age: i32
total_adjusted_fitness: Option<f32>
niche_id: Uuid
Implementations
impl<T, E> Niche<T, E> where
T: Genome<T, E> + Send + Sync + Clone,
E: Send + Sync,
[src]
T: Genome<T, E> + Send + Sync + Clone,
E: Send + Sync,
Implement the species
pub fn new(mascot: &Member<T>, mascot_fitness: f32) -> Self
[src]
pub fn fittest(&self) -> (f32, Member<T>)
[src]
Get the top performing member from the species by their associated fitness score. If None is returned meaning there is no members in the species, panic!
pub fn reset(&mut self)
[src]
Reset the species by getting a new random mascot and incrementing the age by one, then setting the total adjusted species back to None, and clearing the members vec. Basically starting from scratch again but need to increment a few small things to keep track of the species
pub fn calculate_total_adjusted_fitness(&mut self)
[src]
pub fn get_total_adjusted_fitness(&self) -> f32
[src]
Get the total adjusted fitness score of the species by summing up all the fitness scores of each member
pub fn display_info(&self)
[src]
Trait Implementations
impl<T: Clone, E: Clone> Clone for Niche<T, E>
[src]
impl<T: Debug, E: Debug> Debug for Niche<T, E>
[src]
Auto Trait Implementations
impl<T, E> RefUnwindSafe for Niche<T, E> where
E: RefUnwindSafe,
E: RefUnwindSafe,
impl<T, E> Send for Niche<T, E> where
E: Send,
T: Send + Sync,
E: Send,
T: Send + Sync,
impl<T, E> Sync for Niche<T, E> where
E: Sync,
T: Send + Sync,
E: Sync,
T: Send + Sync,
impl<T, E> Unpin for Niche<T, E> where
E: Unpin,
E: Unpin,
impl<T, E> UnwindSafe for Niche<T, E> where
E: UnwindSafe,
E: UnwindSafe,
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> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
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>,