Trait EvolutionaryAlgorithm

Source
pub trait EvolutionaryAlgorithm<G, S, C, M, E, R, O>
where G: Sequence, S: SelectOperator<G, O>, C: CrossoverOperator<G>, M: MutateOperator<G>, E: Fn(&G) -> O, R: Rng, O: Ord + Clone,
{ // Required methods fn initialize<F>(&mut self, n: usize, init_fn: F) where F: Fn() -> G; fn next(&mut self) -> Vec<G>; fn population(&self) -> Vec<G>; fn is_done(&self) -> bool; }
Expand description

An evolutationary algorithm

Required Methods§

Source

fn initialize<F>(&mut self, n: usize, init_fn: F)
where F: Fn() -> G,

Initialize the algorithm by generating a population using a generator fn

Source

fn next(&mut self) -> Vec<G>

Advance to next generation

Source

fn population(&self) -> Vec<G>

Current generation

Source

fn is_done(&self) -> bool

Is the evolutationary algorithm done?

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§

Source§

impl<G, S, C, M, E, R, O> EvolutionaryAlgorithm<G, S, C, M, E, R, O> for Simple<G, S, C, M, E, R, O>
where G: Sequence, S: SelectOperator<G, O>, C: CrossoverOperator<G>, M: MutateOperator<G>, E: Fn(&G) -> O, R: Rng, O: Ord + Clone,