Struct genevo::selection::proportionate::UniversalSamplingSelector
source · [−]pub struct UniversalSamplingSelector { /* private fields */ }
Expand description
The UniversalSamplingSelector
implements stochastic fitness proportionate
selection. The first candidate is picked randomly. All other candidates are
picked by equidistant jumps.
Characteristics: no bias, minimal spread.
Implementations
sourceimpl UniversalSamplingSelector
impl UniversalSamplingSelector
sourcepub fn new(selection_ratio: f64, num_individuals_per_parents: usize) -> Self
pub fn new(selection_ratio: f64, num_individuals_per_parents: usize) -> Self
Constructs a new instance of UniversalSamplingSelector
.
sourcepub fn selection_ratio(&self) -> f64
pub fn selection_ratio(&self) -> f64
Returns the selection ratio.
The selection ratio is the fraction of number of parents that are
selected on every call of the select_from
function and the number
of individuals in the population.
sourcepub fn set_selection_ratio(&mut self, value: f64)
pub fn set_selection_ratio(&mut self, value: f64)
Sets the selection ratio to a new value.
The selection ratio is the fraction of number of parents that are
selected on every call of the select_from
function and the number
of individuals in the population.
sourcepub fn num_individuals_per_parents(&self) -> usize
pub fn num_individuals_per_parents(&self) -> usize
Returns the number of individuals per parents use by this selector.
sourcepub fn set_num_individuals_per_parents(&mut self, value: usize)
pub fn set_num_individuals_per_parents(&mut self, value: usize)
Sets the number of individuals per parents to the given value.
Trait Implementations
sourceimpl Clone for UniversalSamplingSelector
impl Clone for UniversalSamplingSelector
sourcefn clone(&self) -> UniversalSamplingSelector
fn clone(&self) -> UniversalSamplingSelector
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for UniversalSamplingSelector
impl Debug for UniversalSamplingSelector
sourceimpl PartialEq<UniversalSamplingSelector> for UniversalSamplingSelector
impl PartialEq<UniversalSamplingSelector> for UniversalSamplingSelector
sourcefn eq(&self, other: &UniversalSamplingSelector) -> bool
fn eq(&self, other: &UniversalSamplingSelector) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &UniversalSamplingSelector) -> bool
fn ne(&self, other: &UniversalSamplingSelector) -> bool
This method tests for !=
.
sourceimpl<G, F> SelectionOp<G, F> for UniversalSamplingSelector where
G: Genotype,
F: Fitness + AsScalar,
impl<G, F> SelectionOp<G, F> for UniversalSamplingSelector where
G: Genotype,
F: Fitness + AsScalar,
sourcefn select_from<R>(
&self,
evaluated: &EvaluatedPopulation<G, F>,
rng: &mut R
) -> Vec<Parents<G>> where
R: Rng + Sized,
fn select_from<R>(
&self,
evaluated: &EvaluatedPopulation<G, F>,
rng: &mut R
) -> Vec<Parents<G>> where
R: Rng + Sized,
Selects individuals from the given population according to the implemented selection strategy. Read more
impl SingleObjective for UniversalSamplingSelector
impl StructuralPartialEq for UniversalSamplingSelector
Auto Trait Implementations
impl RefUnwindSafe for UniversalSamplingSelector
impl Send for UniversalSamplingSelector
impl Sync for UniversalSamplingSelector
impl Unpin for UniversalSamplingSelector
impl UnwindSafe for UniversalSamplingSelector
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more