Watchmaker Framework for Evolutionary Computation API
(Version 0.7.1)

org.uncommons.watchmaker.framework.termination
Class Stagnation

java.lang.Object
  extended by org.uncommons.watchmaker.framework.termination.Stagnation
All Implemented Interfaces:
TerminationCondition

public class Stagnation
extends Object
implements TerminationCondition

A TerminationCondition that halts evolution if no improvement in fitness is observed within a specified number of generations.

Author:
Daniel Dyer

Constructor Summary
Stagnation(int generationLimit, boolean naturalFitness)
          Creates a TerminationCondition that will halt evolution after the specified number of generations passes without any improvement in the population's fittest individual.
Stagnation(int generationLimit, boolean naturalFitness, boolean usePopulationAverage)
          Creates a TerminationCondition that will halt evolution after the specified number of generations passes without any improvement in the population's fitness (either the fittest individual or the mean fitness of the entire population, depending on the final parameter).
 
Method Summary
 boolean shouldTerminate(PopulationData<?> populationData)
          The condition is queried via this method to determine whether or not evolution should finish at the current point.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Stagnation

public Stagnation(int generationLimit,
                  boolean naturalFitness)
Creates a TerminationCondition that will halt evolution after the specified number of generations passes without any improvement in the population's fittest individual.

Parameters:
generationLimit - The number of generations without improvement that will lead to termination.
naturalFitness - True if higher fitness scores are better, false otherwise.

Stagnation

public Stagnation(int generationLimit,
                  boolean naturalFitness,
                  boolean usePopulationAverage)
Creates a TerminationCondition that will halt evolution after the specified number of generations passes without any improvement in the population's fitness (either the fittest individual or the mean fitness of the entire population, depending on the final parameter).

Parameters:
generationLimit - The number of generations without improvement that will lead to termination.
naturalFitness - True if higher fitness scores are better, false otherwise.
usePopulationAverage - If true uses the mean fitness of the population as the criteria, otherwise uses the fittest individual.
Method Detail

shouldTerminate

public boolean shouldTerminate(PopulationData<?> populationData)
The condition is queried via this method to determine whether or not evolution should finish at the current point.

Specified by:
shouldTerminate in interface TerminationCondition
Parameters:
populationData - Information about the current state of evolution. This may be used to determine whether evolution should continue or not.
Returns:
true if evolution should be terminated, false otherwise.

Watchmaker Framework for Evolutionary Computation API
(Version 0.7.1)