[][src]Struct optlib::genetic::creation::vec_float::RandomCreator

pub struct RandomCreator<G: Clone + NumCast + PartialOrd> { /* fields omitted */ }

Creator to initialize population by individuals with random genes in the preset intervals. G - type of genes. Chromosome is vector of the genes.

Methods

impl<G: Clone + NumCast + PartialOrd> RandomCreator<G>[src]

pub fn new(population_size: usize, intervals: Vec<(G, G)>) -> Self[src]

Constructor.

G - type of genes. Chromosome is vector of the genes.

Parameters

  • population_size - individuals count in the first generation.
  • intervals - vector of the tuples (minval, maxval). Length of the intervals must equal genes count in the chromosome. The values of minval and maxval will be included in random interval.

Trait Implementations

impl<G: Clone + NumCast + PartialOrd> Creator<Vec<G>> for RandomCreator<G>[src]

Auto Trait Implementations

impl<G> !Send for RandomCreator<G>

impl<G> !Sync for RandomCreator<G>

Blanket Implementations

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.