Class MaxFunctionEvaluations
java.lang.Object
org.moeaframework.core.termination.MaxFunctionEvaluations
- All Implemented Interfaces:
TerminationCondition
Terminates a run when the maximum number of function evaluations is exceeded.
-
Constructor Summary
ConstructorDescriptionMaxFunctionEvaluations
(int maxEvaluations) Constructs a new termination condition based on the maximum number of function evaluations. -
Method Summary
Modifier and TypeMethodDescriptionvoid
initialize
(Algorithm algorithm) Invoked when the algorithm is created to collect any initial conditions.boolean
shouldTerminate
(Algorithm algorithm) Invoked after every step to check if the algorithm should terminate.
-
Constructor Details
-
MaxFunctionEvaluations
public MaxFunctionEvaluations(int maxEvaluations) Constructs a new termination condition based on the maximum number of function evaluations.- Parameters:
maxEvaluations
- the maximum number of function evaluations
-
-
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
-