Struct genetic_algorithm::chromosome::Chromosome
source · [−]pub struct Chromosome<T: Genotype> {
pub genes: Vec<T::Allele>,
pub fitness_score: Option<FitnessValue>,
}Expand description
The Chromosome is used as an individual in the Population. It holds the genes and knows how to sort between itself with regard to it’s fitness score. Chromosomes crossover, mutate and compete with each other in the Evolve strategy
Fields
genes: Vec<T::Allele>fitness_score: Option<FitnessValue>Implementations
sourceimpl<T: Genotype> Chromosome<T>
impl<T: Genotype> Chromosome<T>
Trait Implementations
sourceimpl<T: Clone + Genotype> Clone for Chromosome<T> where
T::Allele: Clone,
impl<T: Clone + Genotype> Clone for Chromosome<T> where
T::Allele: Clone,
sourcefn clone(&self) -> Chromosome<T>
fn clone(&self) -> Chromosome<T>
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<T: Genotype> Display for Chromosome<T>
impl<T: Genotype> Display for Chromosome<T>
sourceimpl<T: Genotype> Ord for Chromosome<T>
impl<T: Genotype> Ord for Chromosome<T>
sourceimpl<T: Genotype> PartialEq<Chromosome<T>> for Chromosome<T>
impl<T: Genotype> PartialEq<Chromosome<T>> for Chromosome<T>
sourceimpl<T: Genotype> PartialOrd<Chromosome<T>> for Chromosome<T>
impl<T: Genotype> PartialOrd<Chromosome<T>> for Chromosome<T>
sourcefn partial_cmp(&self, other: &Self) -> Option<Ordering>
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
impl<T: Genotype> Eq for Chromosome<T>
Auto Trait Implementations
impl<T> RefUnwindSafe for Chromosome<T> where
<T as Genotype>::Allele: RefUnwindSafe,
impl<T> Send for Chromosome<T> where
<T as Genotype>::Allele: Send,
impl<T> Sync for Chromosome<T> where
<T as Genotype>::Allele: Sync,
impl<T> Unpin for Chromosome<T> where
<T as Genotype>::Allele: Unpin,
impl<T> UnwindSafe for Chromosome<T> where
<T as Genotype>::Allele: UnwindSafe,
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