[−][src]Struct radiate::engine::niche::Niche
A species is meant to keep track of fitness scores of eachof 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>
Methods
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 incrememnting 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 incremement 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,
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> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
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.
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>,