public class FixedGenerationCount extends java.lang.Object implements StoppingCondition
isSatisfied(Population) is invoked, a generation counter is
incremented. Once the counter reaches the configured
maxGenerations value, isSatisfied(Population) returns
true.| Modifier and Type | Field and Description |
|---|---|
private int |
maxGenerations
Maximum number of generations (stopping criteria)
|
private int |
numGenerations
Number of generations that have passed
|
| Constructor and Description |
|---|
FixedGenerationCount(int maxGenerations)
Create a new FixedGenerationCount instance.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getNumGenerations() |
boolean |
isSatisfied(Population population)
Determine whether or not the given number of generations have passed.
|
private int numGenerations
private final int maxGenerations
public FixedGenerationCount(int maxGenerations)
maxGenerations - number of generations to evolvepublic boolean isSatisfied(Population population)
isSatisfied in interface StoppingConditionpopulation - ignored (no impact on result)true IFF the maximum number of generations has been exceededpublic int getNumGenerations()
Copyright (c) 2003-2013 Apache Software Foundation