Interface TerminationCondition
- All Superinterfaces:
Named
- All Known Implementing Classes:
CancellationSignal,CompoundTerminationCondition,MaxElapsedTime,MaxFunctionEvaluations,TargetObjectiveTermination,TemperatureBasedTerminationCondition
Interface used to implement conditions for when an algorithm should terminate. The
initialize method is
invoked when the algorithm is first created to collect any initial conditions, such as the starting time,
and shouldTerminate is invoked every step to check if the algorithm should terminate.-
Method Summary
Modifier and TypeMethodDescriptiondefault StringgetName()Returns the name of this object.doublegetPercentComplete(Algorithm algorithm) Returns the percentage that this condition is complete, as a value between0.0and100.0.voidinitialize(Algorithm algorithm) Invoked when the algorithm is created to collect any initial conditions.booleanshouldTerminate(Algorithm algorithm) Invoked after every step to check if the algorithm should terminate.
-
Method Details
-
initialize
Invoked when the algorithm is created to collect any initial conditions. Note that the algorithm may not have been initialized at this point.- Parameters:
algorithm- the algorithm
-
shouldTerminate
Invoked after every step to check if the algorithm should terminate.- Parameters:
algorithm- the algorithm- Returns:
trueif the algorithm should terminate;falseotherwise
-
getPercentComplete
Returns the percentage that this condition is complete, as a value between0.0and100.0. If the percentage can not be determined, returns 0d/0d.- Parameters:
algorithm- the algorithm- Returns:
- the percentage completion
-
getName
Description copied from interface:NamedReturns the name of this object. The format for the name depends on the specific implementation, but in general we recommend:- Prefer using alphanumeric characters including
'_'and'-'. - Avoid whitespace and other control characters.
nullcan be returned, if allowed by the implementation, to indicate the object is anonymous or has no assigned name.
- Prefer using alphanumeric characters including
-