Trait Codex

Source
pub trait Codex<G, A, T>
where G: Gene<G, A>,
{ // Required methods fn encode(&self) -> Genotype<G, A>; fn decode(&self, genotype: &Genotype<G, A>) -> T; // Provided methods fn spawn(&self, num: i32) -> Vec<T> { ... } fn spawn_genotypes(&self, num: i32) -> Vec<Genotype<G, A>> { ... } fn spawn_population(&self, num: i32) -> Population<G, A> { ... } }

Required Methods§

Source

fn encode(&self) -> Genotype<G, A>

Source

fn decode(&self, genotype: &Genotype<G, A>) -> T

Provided Methods§

Source

fn spawn(&self, num: i32) -> Vec<T>

Source

fn spawn_genotypes(&self, num: i32) -> Vec<Genotype<G, A>>

Source

fn spawn_population(&self, num: i32) -> Population<G, A>

Implementors§