Interface TerminationCondition

All Known Implementing Classes:
CompoundTerminationCondition, MaxElapsedTime, MaxFunctionEvaluations, TargetObjectiveTermination, TemperatureBasedTerminationCondition

public interface TerminationCondition
Interface used to implement conditions for when an algorithm should terminate. The initialize method is invoked when the algorithm is first created to collect any initial conditions, such as the starting time, and shouldTerminate is invoked every step to check if the algorithm should terminate.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    initialize(Algorithm algorithm)
    Invoked when the algorithm is created to collect any initial conditions.
    boolean
    Invoked after every step to check if the algorithm should terminate.
  • Method Details

    • initialize

      void initialize(Algorithm algorithm)
      Invoked when the algorithm is created to collect any initial conditions. Note that the algorithm may not have been initialized at this point.
      Parameters:
      algorithm - the algorithm
    • shouldTerminate

      boolean shouldTerminate(Algorithm algorithm)
      Invoked after every step to check if the algorithm should terminate.
      Parameters:
      algorithm - the algorithm
      Returns:
      true if the algorithm should terminate; false otherwise