Struct ai::chromosome::Chromosome
[−]
[src]
pub struct Chromosome { /* fields omitted */ }
A chromosome struct to be used to generate binary genes.
Methods
impl Chromosome
[src]
fn new() -> Chromosome
new() instantiates a new Chromosome. It has 44 genes (0 or 1) in a vector
fn fitness(&self) -> f32
fitness is the adaptability of the respective chromosome. Fitness should be between 0 and 1, where 1 is best.
fn mutate(&mut self)
During the evolution process a chromosome should mutate. Chromosomes should be able to mutate during the eveolution process