pub struct MultiContinuousGenotype {
    pub allele_ranges: Vec<Range<ContinuousAllele>>,
    pub allele_neighbour_ranges: Option<Vec<Range<ContinuousAllele>>>,
    pub seed_genes: Option<Vec<ContinuousAllele>>,
    /* private fields */
}Expand description
Genes are a list of f32, each individually taken from its own allele_range. The genes_size is derived to be the allele_ranges length. On random initialization, each gene gets a value from its own allele_range with a uniform probability. Each gene has a weighted probability of mutating, depending on its allele_range size. If a gene mutates, a new values is taken from its own allele_range with a uniform probability. Duplicate allele values are allowed. Defaults to usize as item.
Optionally an allele_neighbour_ranges can be provided. When this is done the mutation is restricted to modify the existing value by a difference taken from allele_neighbour_range with a uniform probability.
Example:
use genetic_algorithm::genotype::{Genotype, MultiContinuousGenotype};
let genotype = MultiContinuousGenotype::builder()
    .with_allele_ranges(vec![
       (0.0..10.0),
       (5.0..20.0),
       (0.0..5.0),
       (10.0..30.0),
    ])
    .with_allele_neighbour_ranges(vec![
       (-1.0..1.0),
       (-2.0..2.0),
       (-0.5..0.5),
       (-3.0..3.0),
    ]) // optional
    .build()
    .unwrap();Fields
allele_ranges: Vec<Range<ContinuousAllele>>allele_neighbour_ranges: Option<Vec<Range<ContinuousAllele>>>seed_genes: Option<Vec<ContinuousAllele>>Trait Implementations
sourceimpl Clone for MultiContinuous
 
impl Clone for MultiContinuous
sourcefn clone(&self) -> MultiContinuous
 
fn clone(&self) -> MultiContinuous
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 MultiContinuous
 
impl Debug for MultiContinuous
sourceimpl Display for MultiContinuous
 
impl Display for MultiContinuous
sourceimpl Genotype for MultiContinuous
 
impl Genotype for MultiContinuous
type Allele = f32
fn genes_size(&self) -> usize
sourcefn chromosome_factory<R: Rng>(&self, rng: &mut R) -> Chromosome<Self>
 
fn chromosome_factory<R: Rng>(&self, rng: &mut R) -> Chromosome<Self>
a random chromosome factory to seed the initial population for Evolve
sourcefn mutate_chromosome_random<R: Rng>(
    &self,
    chromosome: &mut Chromosome<Self>,
    rng: &mut R
)
 
fn mutate_chromosome_random<R: Rng>(
    &self,
    chromosome: &mut Chromosome<Self>,
    rng: &mut R
)
a random mutation of the chromosome
sourcefn crossover_points(&self) -> Vec<usize>
 
fn crossover_points(&self) -> Vec<usize>
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 crossover_indexes(&self) -> Vec<usize>
 
fn crossover_indexes(&self) -> Vec<usize>
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
fn builder() -> GenotypeBuilder<Self>
sourceimpl IncrementalGenotype for MultiContinuous
 
impl IncrementalGenotype for MultiContinuous
sourcefn mutate_chromosome_neighbour<R: Rng>(
    &self,
    chromosome: &mut Chromosome<Self>,
    scale: Option<f32>,
    rng: &mut R
)
 
fn mutate_chromosome_neighbour<R: Rng>(
    &self,
    chromosome: &mut Chromosome<Self>,
    scale: Option<f32>,
    rng: &mut R
)
a neighbouring mutation of the chromosome
sourcefn neighbouring_population(
    &self,
    chromosome: &Chromosome<Self>,
    scale: Option<f32>
) -> Population<Self>
 
fn neighbouring_population(
    &self,
    chromosome: &Chromosome<Self>,
    scale: Option<f32>
) -> Population<Self>
all neighbouring mutations of the chromosome
sourcefn neighbouring_population_size(&self) -> BigUint
 
fn neighbouring_population_size(&self) -> BigUint
chromosome neighbours size for the all possible neighbouring mutation combinations
sourceimpl TryFrom<Builder<MultiContinuous>> for MultiContinuous
 
impl TryFrom<Builder<MultiContinuous>> for MultiContinuous
Auto Trait Implementations
impl RefUnwindSafe for MultiContinuous
impl Send for MultiContinuous
impl Sync for MultiContinuous
impl Unpin for MultiContinuous
impl UnwindSafe for MultiContinuous
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