Struct vrp_core::solver::population::Elitism [−][src]
pub struct Elitism { /* fields omitted */ }Expand description
A simple evolution aware implementation of Population trait with the the following
characteristics:
- sorting of individuals in population according their objective fitness using
NSGA-IIalgorithm - maintaining diversity of population based on their crowding distance
Implementations
impl Elitism[src]
impl Elitism[src]pub fn new(
problem: Arc<Problem>,
random: Arc<dyn Random + Send + Sync>,
max_population_size: usize,
selection_size: usize
) -> Self[src]
pub fn new(
problem: Arc<Problem>,
random: Arc<dyn Random + Send + Sync>,
max_population_size: usize,
selection_size: usize
) -> Self[src]Creates a new instance of Elitism.
problem- a Vehicle Routing Problem definition.max_population_size- a max size of population size.
pub fn drain<R>(&mut self, range: R) -> Vec<Individual> where
R: RangeBounds<usize>, [src]
pub fn drain<R>(&mut self, range: R) -> Vec<Individual> where
R: RangeBounds<usize>, [src]Extracts all individuals from population.
Trait Implementations
impl Population for Elitism[src]
impl Population for Elitism[src]fn add_all(&mut self, individuals: Vec<Individual>) -> bool[src]
fn add_all(&mut self, individuals: Vec<Individual>) -> bool[src]Adds all individuals into the population, then sorts and shrinks population if necessary. Returns true if any of newly added individuals is considered as best known. Read more
fn add(&mut self, individual: Individual) -> bool[src]
fn add(&mut self, individual: Individual) -> bool[src]Adds an individual into the population. Returns true if newly added individual is considered as best known. Read more
fn on_generation(&mut self, _: &Statistics)[src]
fn on_generation(&mut self, _: &Statistics)[src]Informs population about new generation event. This is time for the population to decide whether selection phase has to be changed. Read more
fn cmp(&self, a: &Individual, b: &Individual) -> Ordering[src]
fn cmp(&self, a: &Individual, b: &Individual) -> Ordering[src]Compares two solutions the same way as population does.
fn select<'a>(&'a self) -> Box<dyn Iterator<Item = &Individual> + 'a>[src]
fn select<'a>(&'a self) -> Box<dyn Iterator<Item = &Individual> + 'a>[src]Selects parents from the population based on current selection phase.
fn ranked<'a>(&'a self) -> Box<dyn Iterator<Item = (&Individual, usize)> + 'a>[src]
fn ranked<'a>(&'a self) -> Box<dyn Iterator<Item = (&Individual, usize)> + 'a>[src]Returns subset of individuals within their rank sorted according their quality.
fn selection_phase(&self) -> SelectionPhase[src]
fn selection_phase(&self) -> SelectionPhase[src]Returns a current selection phase.
Auto Trait Implementations
impl !RefUnwindSafe for Elitism
impl Send for Elitism
impl Sync for Elitism
impl Unpin for Elitism
impl !UnwindSafe for Elitism
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]pub fn borrow_mut(&mut self) -> &mut T[src]
pub fn borrow_mut(&mut self) -> &mut T[src]Mutably borrows from an owned value. Read more
impl<T> Pointable for T
impl<T> Pointable for Timpl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,