Genome

Trait Genome 

Source
pub trait Genome:
    Clone
    + Send
    + Sync
    + Sized {
    // Required methods
    fn random(rng: &mut dyn RngCore) -> Self;
    fn mutate(&mut self, rng: &mut dyn RngCore);
    fn crossover(&self, other: &Self, rng: &mut dyn RngCore) -> Self;
}
Expand description

Defines how candidate parameters behave within the genetic algorithm.

Required Methods§

Source

fn random(rng: &mut dyn RngCore) -> Self

Generate a random candidate.

Source

fn mutate(&mut self, rng: &mut dyn RngCore)

Produce a mutated version of this candidate.

Source

fn crossover(&self, other: &Self, rng: &mut dyn RngCore) -> Self

Combine the candidate with another one to create an offspring.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§