Class ElapsedTime
- java.lang.Object
-
- org.uncommons.watchmaker.framework.termination.ElapsedTime
-
- All Implemented Interfaces:
TerminationCondition
public class ElapsedTime extends Object implements TerminationCondition
Terminates evolution after a pre-determined period of time has elapsed.
-
-
Constructor Summary
Constructors Constructor Description ElapsedTime(long maxDuration)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
shouldTerminate(PopulationData<?> populationData)
The condition is queried via this method to determine whether or not evolution should finish at the current point.
-
-
-
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. This implementation terminates evolution if the pre-configured maximum permitted time has elapsed.- Specified by:
shouldTerminate
in interfaceTerminationCondition
- 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.
-
-