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§
Sourcefn initialize<F>(&mut self, n: usize, init_fn: F)where
F: Fn() -> G,
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
Sourcefn population(&self) -> Vec<G>
fn population(&self) -> Vec<G>
Current generation
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.