pub struct IndividualWrapper<T: Individual> {
pub individual: T,
pub fitness: f64,
pub num_of_mutations: u32,
pub id: u32,
}Expand description
A wrapper helper struct for the individuals. It does the book keeping of the fitness and the number of mutations this individual has to run in one iteration.
Fields§
§individual: TThe actual individual, user defined struct.
fitness: f64The current calculated fitness for this individual.
num_of_mutations: u32The number of mutation this individual is doing in one iteration.
id: u32The id of the population that this individual belongs to. Just for statistics.
Trait Implementations§
Source§impl<T: Clone + Individual> Clone for IndividualWrapper<T>
impl<T: Clone + Individual> Clone for IndividualWrapper<T>
Source§fn clone(&self) -> IndividualWrapper<T>
fn clone(&self) -> IndividualWrapper<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T: Debug + Individual> Debug for IndividualWrapper<T>
impl<T: Debug + Individual> Debug for IndividualWrapper<T>
Source§impl<T: Individual> Ord for IndividualWrapper<T>
Implement this for sorting
impl<T: Individual> Ord for IndividualWrapper<T>
Implement this for sorting
Source§fn cmp(&self, other: &IndividualWrapper<T>) -> Ordering
fn cmp(&self, other: &IndividualWrapper<T>) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<T: Individual> PartialEq for IndividualWrapper<T>
Implement this for sorting
impl<T: Individual> PartialEq for IndividualWrapper<T>
Implement this for sorting
Source§impl<T: Individual> PartialOrd for IndividualWrapper<T>
Implement this for sorting
impl<T: Individual> PartialOrd for IndividualWrapper<T>
Implement this for sorting
impl<T: Individual> Eq for IndividualWrapper<T>
Implement this for sorting
Auto Trait Implementations§
impl<T> Freeze for IndividualWrapper<T>where
T: Freeze,
impl<T> RefUnwindSafe for IndividualWrapper<T>where
T: RefUnwindSafe,
impl<T> Send for IndividualWrapper<T>where
T: Send,
impl<T> Sync for IndividualWrapper<T>where
T: Sync,
impl<T> Unpin for IndividualWrapper<T>where
T: Unpin,
impl<T> UnwindSafe for IndividualWrapper<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more