Module logicng

Interface OptimizationHandler

  • All Superinterfaces:
    Handler
    All Known Implementing Classes:
    TimeoutOptimizationHandler

    public interface OptimizationHandler
    extends Handler
    Interface for an optimization handler.
    Since:
    2.1.0
    Version:
    2.1.0
    • Method Detail

      • satHandler

        SATHandler satHandler()
        Returns a SAT handler which can be used to cancel internal SAT calls of the optimization function.
        Returns:
        a SAT handler
      • aborted

        default boolean aborted()
        Description copied from interface: Handler
        Returns whether the computation was aborted by the handler.
        Specified by:
        aborted in interface Handler
        Returns:
        true if the computation was aborted by the handler, otherwise false
      • foundBetterBound

        default boolean foundBetterBound​(Supplier<Assignment> currentResultProvider)
        This method is called when the solver found a better bound for the optimization.
        Parameters:
        currentResultProvider - a provider for the current result, can be used to examine the current result or to use this result if the optimization should be aborted
        Returns:
        true if the optimization process should be continued, otherwise false
      • satHandler

        static SATHandler satHandler​(OptimizationHandler handler)
        Returns a SAT handler if the optimization handler is not null.
        Parameters:
        handler - the optimization handler
        Returns:
        The SAT handler if the optimization handler is not null, otherwise null