Class TerminationCriteriaManager

  • All Implemented Interfaces:
    IRequestManualTerminationListener, ITerminationCriteriaManager, org.opt4j.core.optimizer.OptimizerIterationListener

    public class TerminationCriteriaManager
    extends Object
    implements ITerminationCriteriaManager
    The main goal of the Termination Criteria Manager is to create termination criteria, call them so that they can evaluate the current optimization state and then evaluate their decisions, on which it must base its own decision whether to stop the optimization or not.
    • Constructor Detail

      • TerminationCriteriaManager

        @Inject
        public TerminationCriteriaManager​(org.opt4j.core.optimizer.Control control,
                                          org.opt4j.core.optimizer.Population population,
                                          org.opt4j.core.optimizer.Archive archive)
    • Method Detail

      • activateTCComparisionMode

        public void activateTCComparisionMode()
        Activates Termination Criteria Comparison Mode in which termination criteria decisions do not influence the optimization but are shown on the output.
        Specified by:
        activateTCComparisionMode in interface ITerminationCriteriaManager
      • deactivateTCComparisionMode

        public void deactivateTCComparisionMode()
        Deactivates Termination Criteria Comparison Mode in which termination criteria decisions are do not influence the optimization but are shown on the output.
        Specified by:
        deactivateTCComparisionMode in interface ITerminationCriteriaManager
      • activateComposedCriterion

        public void activateComposedCriterion()
        Activates Composed Criterion Mode in which multiple termination criteria can be stringed together to form a more powerful termination criterion
        Specified by:
        activateComposedCriterion in interface ITerminationCriteriaManager
      • deactivateComposedCriterion

        public void deactivateComposedCriterion()
        If Composed Criterion is deactivated then a simple || condition is used to evaluate results from the different criteria.
        Specified by:
        deactivateComposedCriterion in interface ITerminationCriteriaManager
      • setComposedCriterionExpression

        public void setComposedCriterionExpression​(String composedCriterionExpression)
        Sets the expression used to define the relationship between the termination criterion. If not set a standard Expression is used (Crit1 || Crit2 || Crit3 || Crit4 || ...)
        Specified by:
        setComposedCriterionExpression in interface ITerminationCriteriaManager
      • addOutputChangedListener

        public void addOutputChangedListener​(IOutputChangedListener listener)
        Adds a new listener for the OutputChanged event. If the listener is also a IRequestManualTerminationProvider. the TCM will add itself as a listener to that event.
        Specified by:
        addOutputChangedListener in interface ITerminationCriteriaManager
        Parameters:
        listener - IOutputChangedListener listener
      • removeOutputChangedListener

        public void removeOutputChangedListener​(IOutputChangedListener listener)
        Removes a new listener for the OutputChanged event. If the listener is also a IRequestManualTerminationProvider. the TCM will remove itself as a listener from that event.
        Specified by:
        removeOutputChangedListener in interface ITerminationCriteriaManager
        Parameters:
        listener - IOutputChangedListener listener
      • addTerminationCriteriaManagerInitializedListener

        public static void addTerminationCriteriaManagerInitializedListener​(ITerminationCriteriaManagerInitializedListener listener)
        Adds a new listener for the static TerminationCriteriaManagerInitialized event.
        Parameters:
        listener - ITerminationCriteriaManagerInitializedListener listener
      • removeTerminationCriteriaManagerInitializedListener

        public static void removeTerminationCriteriaManagerInitializedListener​(ITerminationCriteriaManagerInitializedListener listener)
        Removes a listener from the static TerminationCriteriaManagerInitialized event.
        Parameters:
        listener - ITerminationCriteriaManagerInitializedListener listener
      • iterationComplete

        public void iterationComplete​(org.opt4j.core.optimizer.Optimizer optimizer,
                                      int iteration)
        Specified by:
        iterationComplete in interface org.opt4j.core.optimizer.OptimizerIterationListener