Struct genevo::selection::truncation::MaximizeSelector
source · [−]pub struct MaximizeSelector { /* private fields */ }
Expand description
The MaximizeSelector
selects the best performing genetic::Genotype
s
from the population.
This MaximizeSelector
can be used for single-objective fitness values
as well as multi-objective fitness values.
Implementations
sourceimpl MaximizeSelector
impl MaximizeSelector
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 the MaximizeSelector
.
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 selection
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 selection
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 MaximizeSelector
impl Clone for MaximizeSelector
sourcefn clone(&self) -> MaximizeSelector
fn clone(&self) -> MaximizeSelector
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 MaximizeSelector
impl Debug for MaximizeSelector
sourceimpl GeneticOperator for MaximizeSelector
impl GeneticOperator for MaximizeSelector
sourceimpl PartialEq<MaximizeSelector> for MaximizeSelector
impl PartialEq<MaximizeSelector> for MaximizeSelector
sourcefn eq(&self, other: &MaximizeSelector) -> bool
fn eq(&self, other: &MaximizeSelector) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &MaximizeSelector) -> bool
fn ne(&self, other: &MaximizeSelector) -> bool
This method tests for !=
.
sourceimpl<G, F> SelectionOp<G, F> for MaximizeSelector where
G: Genotype,
F: Fitness,
impl<G, F> SelectionOp<G, F> for MaximizeSelector where
G: Genotype,
F: Fitness,
sourcefn select_from<R>(
&self,
evaluated: &EvaluatedPopulation<G, F>,
_: &mut R
) -> Vec<Parents<G>> where
R: Rng + Sized,
fn select_from<R>(
&self,
evaluated: &EvaluatedPopulation<G, F>,
_: &mut R
) -> Vec<Parents<G>> where
R: Rng + Sized,
Selects individuals from the given population according to the implemented selection strategy. Read more
impl MultiObjective for MaximizeSelector
Can be used for multi-objective optimization
impl SingleObjective for MaximizeSelector
Can be used for single-objective optimization
impl StructuralPartialEq for MaximizeSelector
Auto Trait Implementations
impl RefUnwindSafe for MaximizeSelector
impl Send for MaximizeSelector
impl Sync for MaximizeSelector
impl Unpin for MaximizeSelector
impl UnwindSafe for MaximizeSelector
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