[][src]Trait genevo::algorithm::Algorithm

pub trait Algorithm {
    type Output: Clone + Debug + PartialEq;
    type Error: Error + Clone + Debug + PartialEq;
    fn next(
        &mut self,
        iteration: u64,
        rng: &mut Prng
    ) -> Result<Self::Output, Self::Error>;
fn reset(&mut self) -> Result<bool, Self::Error>; }

An Algorithm defines the steps to be processed in a simulation::Simulation. The Simulation uses an implementation of an Algorithm to perform one iteration of the evaluation stage.

Associated Types

Loading content...

Required methods

fn next(
    &mut self,
    iteration: u64,
    rng: &mut Prng
) -> Result<Self::Output, Self::Error>

fn reset(&mut self) -> Result<bool, Self::Error>

Loading content...

Implementors

impl<G, F, E, S, C, M, R> Algorithm for GeneticAlgorithm<G, F, E, S, C, M, R> where
    G: Genotype,
    F: Fitness + Send + Sync,
    E: FitnessFunction<G, F> + Sync,
    S: SelectionOp<G, F>,
    C: CrossoverOp<G> + Sync,
    M: MutationOp<G> + Sync,
    R: ReinsertionOp<G, F>, 
[src]

type Output = State<G, F>

type Error = GeneticAlgorithmError

Loading content...