public class FixedGenerationCount extends Object implements StoppingCondition
isSatisfied(Population)
is invoked, a generation
counter is incremented. Once the counter reaches the configured maxGenerations
value,
isSatisfied(Population)
returns true.Constructor and Description |
---|
FixedGenerationCount(int maxGenerationsIn)
Create a new FixedGenerationCount instance.
|
Modifier and Type | Method and Description |
---|---|
int |
getNumGenerations()
Returns the number of generations that have already passed.
|
boolean |
isSatisfied(Population population)
Determine whether or not the given number of generations have passed.
|
public FixedGenerationCount(int maxGenerationsIn)
maxGenerationsIn
- number of generations to evolveNumberIsTooSmallException
- if the number of generations is < 1public boolean isSatisfied(Population population)
isSatisfied
in interface StoppingCondition
population
- ignored (no impact on result)true
IFF the maximum number of generations has been exceededpublic int getNumGenerations()
Copyright © 2019 CNES. All rights reserved.