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)
FixedElapsedTime
instance.maxTime
- maximum number of seconds generations are allowed to evolveNumberIsTooSmallException
- if the provided time is < 0public FixedElapsedTime(long maxTime, TimeUnit unit)
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 StoppingCondition
population
- ignored (no impact on result)true
IFF the maximum allowed time period has elapsedCopyright © 2019 CNES. All rights reserved.