Class TargetObjectiveTermination
java.lang.Object
org.moeaframework.core.termination.TargetObjectiveTermination
- All Implemented Interfaces:
TerminationCondition
Terminates a run when at least one solution in the result is equal to or within some allowed difference (epsilon)
from a target solution.
-
Constructor Summary
ConstructorDescriptionTargetObjectiveTermination
(double[] target) Constructs a new termination condition using distance to target objective values.TargetObjectiveTermination
(double[] target, double epsilon) Constructs a new termination condition using distance to target objective values.TargetObjectiveTermination
(Solution target) Constructs a new termination condition using distance to a target solution.TargetObjectiveTermination
(Solution target, double epsilon) Constructs a new termination condition using distance to a target solution. -
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
-
TargetObjectiveTermination
public TargetObjectiveTermination(double[] target) Constructs a new termination condition using distance to target objective values.- Parameters:
target
- the target objective values
-
TargetObjectiveTermination
public TargetObjectiveTermination(double[] target, double epsilon) Constructs a new termination condition using distance to target objective values.- Parameters:
target
- the target objective valuesepsilon
- the allowed error
-
TargetObjectiveTermination
Constructs a new termination condition using distance to a target solution.- Parameters:
target
- the target solution
-
TargetObjectiveTermination
Constructs a new termination condition using distance to a target solution.- Parameters:
target
- the target solutionepsilon
- the allowed error
-
-
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
-