pub struct GeneticPopulation {
pub profiles: Vec<GeneticProfile>,
}Expand description
A collection of GeneticProfile instances representing a population.
Fields§
§profiles: Vec<GeneticProfile>Implementations§
Source§impl GeneticPopulation
impl GeneticPopulation
Sourcepub fn add(&mut self, profile: GeneticProfile)
pub fn add(&mut self, profile: GeneticProfile)
Add a profile to the population.
Sourcepub fn blend_all(&self) -> Vec<GeneticParams>
pub fn blend_all(&self) -> Vec<GeneticParams>
Compute the dominant blend for every profile and return the results.
Sourcepub fn diversity_score(&self) -> f32
pub fn diversity_score(&self) -> f32
Mean pairwise L2 distance of all blended results.
Returns 0.0 if the population has fewer than two members.
Trait Implementations§
Source§impl Clone for GeneticPopulation
impl Clone for GeneticPopulation
Source§fn clone(&self) -> GeneticPopulation
fn clone(&self) -> GeneticPopulation
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 Debug for GeneticPopulation
impl Debug for GeneticPopulation
Source§impl Default for GeneticPopulation
impl Default for GeneticPopulation
Source§fn default() -> GeneticPopulation
fn default() -> GeneticPopulation
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for GeneticPopulation
impl RefUnwindSafe for GeneticPopulation
impl Send for GeneticPopulation
impl Sync for GeneticPopulation
impl Unpin for GeneticPopulation
impl UnsafeUnpin for GeneticPopulation
impl UnwindSafe for GeneticPopulation
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