public class FixedElapsedTime extends Object implements StoppingCondition
The first time isSatisfied(Population) is invoked, the end time of the evolution is determined based on the
provided maxTime value. Once the elapsed time reaches the configured maxTime value,
isSatisfied(Population) returns true.
| Constructor and Description |
|---|
FixedElapsedTime(long maxTime)
Create a new
FixedElapsedTime instance. |
FixedElapsedTime(long maxTime,
TimeUnit unit)
Create a new
FixedElapsedTime instance. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
isSatisfied(Population population)
Determine whether or not the maximum allowed time has passed.
|
public FixedElapsedTime(long maxTime) throws NumberIsTooSmallException
FixedElapsedTime instance.maxTime - maximum number of seconds generations are allowed to evolveNumberIsTooSmallException - if the provided time is < 0public FixedElapsedTime(long maxTime, TimeUnit unit) throws NumberIsTooSmallException
FixedElapsedTime instance.maxTime - maximum time generations are allowed to evolveunit - TimeUnit of the maxTime argumentNumberIsTooSmallException - if the provided time is < 0public boolean isSatisfied(Population population)
isSatisfied in interface StoppingConditionpopulation - ignored (no impact on result)true IFF the maximum allowed time period has elapsedCopyright © 2003–2016 The Apache Software Foundation. All rights reserved.