public class TargetFitness extends Object implements TerminationCondition
| Constructor and Description |
|---|
TargetFitness(double targetFitness,
boolean natural) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
shouldTerminate(PopulationData<?> populationData)
The condition is queried via this method to determine whether or not evolution
should finish at the current point.
|
public TargetFitness(double targetFitness,
boolean natural)
targetFitness - The fitness score that must be achieved by at least
one individual in the population in order for this condition to be satisfied.natural - Whether fitness scores are natural or non-natural. If fitness
is natural, the condition will be satisfied if any individual has a fitness
that is greater than or equal to the target fitness. If fitness is non-natural,
the condition will be satisified in any individual has a fitness that is less
than or equal to the target fitness.FitnessEvaluatorpublic boolean shouldTerminate(PopulationData<?> populationData)
shouldTerminate in interface TerminationConditionpopulationData - Information about the current state of evolution. This may
be used to determine whether evolution should continue or not.