[−][src]Trait genevo::termination::Termination
A Termination
defines a condition when the Simulation
shall stop.
One implementation of the trait Termination
should only handle one
single termination condition. In the simulation multiple termination
conditions can be combined through combinator
s.
Required methods
fn evaluate(&mut self, state: &State<A>) -> StopFlag
Evaluates the termination condition and returns a StopFlag
depending
on the result. The StopFlag
indicates whether the simulation shall
stop or continue.
In case the simulation shall be stopped, i.e. a StopFlag::StopNow
is
returned also a the reason why the simulation shall be stopped is
returned. This reason should explain to the user of the simulation,
why the simulation has been stopped.
Provided methods
fn reset(&mut self)
Resets the state of this Termination
condition. This function is
called on each Termination
instance when the simulation is reset.
This function only needs to be implemented by an implementation of
Termination
if it has its own state, e.g. for counting or tracking
of progress.
The default implementation does nothing.
Implementors
impl<A> Termination<A> for GenerationLimit where
A: Algorithm,
[src]
A: Algorithm,
impl<A> Termination<A> for TimeLimit where
A: Algorithm,
[src]
A: Algorithm,
impl<G, F, E, S, C, M, R> Termination<GeneticAlgorithm<G, F, E, S, C, M, R>> for FitnessLimit<G, F> where
G: Genotype,
F: Fitness + Send + Sync,
E: FitnessFunction<G, F>,
E: FitnessFunction<G, F> + Sync,
S: SelectionOp<G, F>,
C: CrossoverOp<G> + Sync,
M: MutationOp<G> + Sync,
R: ReinsertionOp<G, F>,
[src]
G: Genotype,
F: Fitness + Send + Sync,
E: FitnessFunction<G, F>,
E: FitnessFunction<G, F> + Sync,
S: SelectionOp<G, F>,
C: CrossoverOp<G> + Sync,
M: MutationOp<G> + Sync,
R: ReinsertionOp<G, F>,
fn evaluate(
&mut self,
state: &State<GeneticAlgorithm<G, F, E, S, C, M, R>>
) -> StopFlag
[src]
&mut self,
state: &State<GeneticAlgorithm<G, F, E, S, C, M, R>>
) -> StopFlag
fn reset(&mut self)
[src]
impl<T1, T2, A> Termination<A> for And<T1, T2, A> where
T1: Termination<A>,
T2: Termination<A>,
A: Algorithm,
[src]
T1: Termination<A>,
T2: Termination<A>,
A: Algorithm,
impl<T1, T2, A> Termination<A> for Or<T1, T2, A> where
T1: Termination<A>,
T2: Termination<A>,
A: Algorithm,
[src]
T1: Termination<A>,
T2: Termination<A>,
A: Algorithm,