[][src]Trait rust_ga::Genome

pub trait Genome {
    fn new() -> Self;
fn fitness(&self) -> f64;
fn cross(&self, other: &Self) -> Self;
fn mutate(self) -> Self;
fn display(&self); }

Trait required for a DNA to ge added to Population

Required methods

fn new() -> Self

Creates a new Genome

fn fitness(&self) -> f64

Computes the fitness of the Genome

fn cross(&self, other: &Self) -> Self

Creates a new Genome by crossing over 2 Genomes

fn mutate(self) -> Self

Mutates a Genome

fn display(&self)

Displays the Genome

Loading content...

Implementors

Loading content...