Class TargetFitnessTerminator<T>
java.lang.Object
org.cicirello.search.evo.TargetFitnessTerminator<T>
- Type Parameters:
T- The type of object under optimization.
- All Implemented Interfaces:
TerminationStrategy<T>
TerminationStrategy that terminates an evolutionary algorithm if a solution with a target fitness
value (or better) is found.
-
Nested Class Summary
Nested classes/interfaces inherited from interface TerminationStrategy
TerminationStrategy.ExecutionState<T> -
Constructor Summary
ConstructorsConstructorDescriptionTargetFitnessTerminator(double targetFitness) Initializes the TerminationStrategy -
Method Summary
Modifier and TypeMethodDescriptionbooleanPredicate method to determine whether or not to terminate the current run of the evolutionary algorithm.
-
Constructor Details
-
TargetFitnessTerminator
public TargetFitnessTerminator(double targetFitness) Initializes the TerminationStrategy- Parameters:
targetFitness- the target fitness. Note that this is the target fitness value and not a target for the objective function you are optimizing, which may or may not be the same thing depending upon how you have configured the evolutionary algorithm
-
-
Method Details
-
terminate
Description copied from interface:TerminationStrategyPredicate method to determine whether or not to terminate the current run of the evolutionary algorithm.- Specified by:
terminatein interfaceTerminationStrategy<T>- Parameters:
state- the state of the evolutionary algorithm prior to the start of a generation- Returns:
- true if and only if the evolutionary algorithm should terminate
-