public class TargetFitness extends java.lang.Object implements TerminationCondition
Modifier and Type | Field and Description |
---|---|
protected double |
targetFitness |
Constructor and Description |
---|
TargetFitness(double targetFitness,
boolean natural) |
Modifier and Type | Method and Description |
---|---|
double |
getTargetFitness() |
boolean |
shouldTerminate(PopulationData<?> populationData)
The condition is queried via this method to determine whether or not
evolution should finish at the current point.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
toString
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.FitnessEvaluator
public boolean shouldTerminate(PopulationData<?> populationData)
shouldTerminate
in interface TerminationCondition
populationData
- Information about the current state of evolution. This may be
used to determine whether evolution should continue or not.public double getTargetFitness()