Skip to main content

GeneticOperator

Trait GeneticOperator 

Source
pub trait GeneticOperator {
    // Required methods
    fn crossover(&self, parent_a: &Genome, parent_b: &Genome) -> Genome;
    fn mutate(&self, genome: &mut Genome, mutation_rate: f64);
}
Expand description

Trait for genetic operators

Required Methods§

Source

fn crossover(&self, parent_a: &Genome, parent_b: &Genome) -> Genome

Perform crossover between two parent genomes

Source

fn mutate(&self, genome: &mut Genome, mutation_rate: f64)

Mutate a genome with given mutation rate

Implementors§