pub struct Population { /* private fields */ }
Expand description
Population management utilities
Implementations§
Source§impl Population
impl Population
Sourcepub fn with_capacity(
population_size: usize,
_n_objectives: usize,
_n_variables: usize,
) -> Self
pub fn with_capacity( population_size: usize, _n_objectives: usize, _n_variables: usize, ) -> Self
Create a new population with specified capacity
Sourcepub fn from_solutions(solutions: Vec<MultiObjectiveSolution>) -> Self
pub fn from_solutions(solutions: Vec<MultiObjectiveSolution>) -> Self
Create population from solutions
Sourcepub fn add(&mut self, solution: MultiObjectiveSolution)
pub fn add(&mut self, solution: MultiObjectiveSolution)
Add a solution to the population
Sourcepub fn solutions(&self) -> &[MultiObjectiveSolution]
pub fn solutions(&self) -> &[MultiObjectiveSolution]
Get all solutions
Sourcepub fn solutions_mut(&mut self) -> &mut Vec<MultiObjectiveSolution>
pub fn solutions_mut(&mut self) -> &mut Vec<MultiObjectiveSolution>
Get mutable reference to solutions
Sourcepub fn extract_pareto_front(&self) -> Vec<MultiObjectiveSolution>
pub fn extract_pareto_front(&self) -> Vec<MultiObjectiveSolution>
Extract Pareto front from population
Sourcepub fn non_dominated_sort(&mut self) -> Vec<Vec<usize>>
pub fn non_dominated_sort(&mut self) -> Vec<Vec<usize>>
Perform non-dominated sorting (for NSGA-II)
Sourcepub fn calculate_crowding_distances(&mut self, front_indices: &[usize])
pub fn calculate_crowding_distances(&mut self, front_indices: &[usize])
Calculate crowding distances for solutions in the same front
Sourcepub fn select_best(&mut self, target_size: usize) -> Vec<MultiObjectiveSolution>
pub fn select_best(&mut self, target_size: usize) -> Vec<MultiObjectiveSolution>
Select best solutions using NSGA-II crowded comparison
Sourcepub fn calculate_statistics(&self) -> PopulationStatistics
pub fn calculate_statistics(&self) -> PopulationStatistics
Calculate population statistics
Trait Implementations§
Source§impl Clone for Population
impl Clone for Population
Source§fn clone(&self) -> Population
fn clone(&self) -> Population
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 Population
impl Debug for Population
Auto Trait Implementations§
impl Freeze for Population
impl RefUnwindSafe for Population
impl Send for Population
impl Sync for Population
impl Unpin for Population
impl UnwindSafe for Population
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.