Class FixedElapsedTime

  • All Implemented Interfaces:
    StoppingCondition

    public class FixedElapsedTime
    extends java.lang.Object
    implements StoppingCondition
    Stops after a fixed amount of time has elapsed.

    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.

    Since:
    3.1
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private long endTime
      The predetermined termination time (stopping condition).
      private long maxTimePeriod
      Maximum allowed time period (in nanoseconds).
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean isSatisfied​(Population population)
      Determine whether or not the maximum allowed time has passed.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • maxTimePeriod

        private final long maxTimePeriod
        Maximum allowed time period (in nanoseconds).
      • endTime

        private long endTime
        The predetermined termination time (stopping condition).
    • Method Detail

      • isSatisfied

        public boolean isSatisfied​(Population population)
        Determine whether or not the maximum allowed time has passed. The termination time is determined after the first generation.
        Specified by:
        isSatisfied in interface StoppingCondition
        Parameters:
        population - ignored (no impact on result)
        Returns:
        true IFF the maximum allowed time period has elapsed