Class CompoundTerminationCondition
java.lang.Object
org.moeaframework.core.termination.CompoundTerminationCondition
- All Implemented Interfaces:
Iterable<TerminationCondition>
,Named
,TerminationCondition
public class CompoundTerminationCondition
extends Object
implements TerminationCondition, Iterable<TerminationCondition>
Terminates a run when one or more termination conditions are satisfied.
-
Constructor Summary
ConstructorDescriptionCompoundTerminationCondition
(TerminationCondition... conditions) Constructs a new termination condition based on at least one individual termination condition being satisfied. -
Method Summary
Modifier and TypeMethodDescriptiondouble
getPercentComplete
(Algorithm algorithm) Returns the percentage that this condition is complete, as a value between0.0
and100.0
.void
initialize
(Algorithm algorithm) Invoked when the algorithm is created to collect any initial conditions.iterator()
boolean
shouldTerminate
(Algorithm algorithm) Invoked after every step to check if the algorithm should terminate.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
Methods inherited from interface org.moeaframework.core.termination.TerminationCondition
getName
-
Constructor Details
-
CompoundTerminationCondition
Constructs a new termination condition based on at least one individual termination condition being satisfied.- Parameters:
conditions
- the termination conditions
-
-
Method Details
-
initialize
Description copied from interface:TerminationCondition
Invoked when the algorithm is created to collect any initial conditions. Note that the algorithm may not have been initialized at this point.- Specified by:
initialize
in interfaceTerminationCondition
- Parameters:
algorithm
- the algorithm
-
shouldTerminate
Description copied from interface:TerminationCondition
Invoked after every step to check if the algorithm should terminate.- Specified by:
shouldTerminate
in interfaceTerminationCondition
- Parameters:
algorithm
- the algorithm- Returns:
true
if the algorithm should terminate;false
otherwise
-
getPercentComplete
Description copied from interface:TerminationCondition
Returns the percentage that this condition is complete, as a value between0.0
and100.0
. If the percentage can not be determined, returns 0d/0d.- Specified by:
getPercentComplete
in interfaceTerminationCondition
- Parameters:
algorithm
- the algorithm- Returns:
- the percentage completion
-
iterator
- Specified by:
iterator
in interfaceIterable<TerminationCondition>
-