Class MaximumFitnessEvaluationsTerminator<T>

java.lang.Object
org.cicirello.search.evo.MaximumFitnessEvaluationsTerminator<T>
Type Parameters:
T - The type of object under optimization.
All Implemented Interfaces:
TerminationStrategy<T>

public final class MaximumFitnessEvaluationsTerminator<T> extends Object implements TerminationStrategy<T>
TerminationStrategy that terminates an evolutionary algorithm once the total number of fitness evaluations exceeds a threshold. Note that the TerminationStrategy is evaluated once per generation, so this MaximumFitnessEvaluationsTerminator may result in more fitness evaluations than the target threshold (e.g., it won't cause termination in the middle of a generation, such as while evaluating the children that result from crossing or mutating parents).
  • Constructor Details

    • MaximumFitnessEvaluationsTerminator

      public MaximumFitnessEvaluationsTerminator(long maximumNumberOfFitnessEvaluations)
      Initializes the TerminationStrategy
      Parameters:
      maximumNumberOfFitnessEvaluations - the target maximum number of fitness evaluations. The evolutionary algorithm will terminate once this maximum is reached and detected at the start of a generation
  • Method Details

    • terminate

      public boolean terminate(TerminationStrategy.ExecutionState<T> state)
      Description copied from interface: TerminationStrategy
      Predicate method to determine whether or not to terminate the current run of the evolutionary algorithm.
      Specified by:
      terminate in interface TerminationStrategy<T>
      Parameters:
      state - the state of the evolutionary algorithm prior to the start of a generation
      Returns:
      true if and only if the evolutionary algorithm should terminate