Struct genetic_algorithm::crossover::CrossoverSingleGene
source · [−]pub struct CrossoverSingleGene(pub KeepParent);
Expand description
Crossover starting with clones of the parents, with a single gene taken from the other parent. The single gene is chosen with uniform probability. Optionally keep parents around to compete with children later on.
Not allowed for unique genotypes as it would not preserve the gene uniqueness in the children.
Tuple Fields
0: KeepParent
Trait Implementations
sourceimpl Clone for SingleGene
impl Clone for SingleGene
sourcefn clone(&self) -> SingleGene
fn clone(&self) -> SingleGene
Returns a copy of the value. Read more
1.0.0 · sourceconst fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Crossover for SingleGene
impl Crossover for SingleGene
fn call<T: Genotype, R: Rng>(
&self,
genotype: &T,
population: &mut Population<T>,
rng: &mut R
)
sourcefn require_crossover_indexes(&self) -> bool
fn require_crossover_indexes(&self) -> bool
to guard against invalid Crossover strategies which break the internal consistency
of the genes, unique genotypes can’t simply exchange genes without gene duplication issues Read more
sourcefn require_crossover_points(&self) -> bool
fn require_crossover_points(&self) -> bool
to guard against invalid Crossover strategies which break the internal consistency
of the genes, unique genotypes can’t simply exchange genes without gene duplication issues Read more
Auto Trait Implementations
impl RefUnwindSafe for SingleGene
impl Send for SingleGene
impl Sync for SingleGene
impl Unpin for SingleGene
impl UnwindSafe for SingleGene
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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