pub struct Individual {
pub parameters: Vec<ParameterValue>,
pub fitness: Option<f64>,
pub multi_fitness: Option<Vec<f64>>,
pub age: usize,
pub rank: Option<usize>,
pub crowding_distance: Option<f64>,
}Expand description
Individual in the genetic algorithm population
Fields§
§parameters: Vec<ParameterValue>Parameter values (chromosome)
fitness: Option<f64>Fitness score (higher is better)
multi_fitness: Option<Vec<f64>>Multi-objective fitness scores
age: usizeAge of the individual (generations since creation)
rank: Option<usize>Domination rank (for multi-objective optimization)
crowding_distance: Option<f64>Crowding distance (for multi-objective optimization)
Implementations§
Source§impl Individual
impl Individual
Sourcepub fn new(parameters: Vec<ParameterValue>) -> Self
pub fn new(parameters: Vec<ParameterValue>) -> Self
Create a new individual with given parameters
Sourcepub fn age_increment(&mut self)
pub fn age_increment(&mut self)
Increment the age of the individual
Trait Implementations§
Source§impl Clone for Individual
impl Clone for Individual
Source§fn clone(&self) -> Individual
fn clone(&self) -> Individual
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 moreAuto Trait Implementations§
impl Freeze for Individual
impl RefUnwindSafe for Individual
impl Send for Individual
impl Sync for Individual
impl Unpin for Individual
impl UnsafeUnpin for Individual
impl UnwindSafe for Individual
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more