Module logicng

Class TimeoutMaxSATHandler

    • Method Detail

      • started

        public void started()
        Description copied from interface: Handler
        This method is called when the computation starts.
        Specified by:
        started in interface Handler
        Overrides:
        started in class TimeoutHandler
      • aborted

        public boolean aborted()
        Description copied from interface: Handler
        Returns whether the computation was aborted by the handler.
        Specified by:
        aborted in interface Handler
        Specified by:
        aborted in interface MaxSATHandler
        Overrides:
        aborted in class ComputationHandler
        Returns:
        true if the computation was aborted by the handler, otherwise false
      • satHandler

        public SATHandler satHandler()
        Returns a SAT handler which can be used to cancel internal SAT calls of the model enumeration process. Note that this handler will only be available after the first call to started().
        Specified by:
        satHandler in interface MaxSATHandler
        Returns:
        the SAT handler
      • foundLowerBound

        public boolean foundLowerBound​(int lowerBound,
                                       Assignment model)
        Description copied from interface: MaxSATHandler
        This method is called when the MaxSAT solver found a new lower bound for a solution.
        Specified by:
        foundLowerBound in interface MaxSATHandler
        Parameters:
        lowerBound - the cost of the lower bound
        model - the model of the lower bound, may be null if not applicable
        Returns:
        true if the solving process should be continued, otherwise false
      • foundUpperBound

        public boolean foundUpperBound​(int upperBound,
                                       Assignment model)
        Description copied from interface: MaxSATHandler
        This method is called when the MaxSAT solver found a new upper bound for a solution.
        Specified by:
        foundUpperBound in interface MaxSATHandler
        Parameters:
        upperBound - the cost of the upper bound
        model - the model of the upper bound, may be null if not applicable
        Returns:
        true if the solving process should be continued, otherwise false
      • finishedSolving

        public void finishedSolving()
        Description copied from interface: MaxSATHandler
        This method is called when the MaxSAT solver finished solving.
        Specified by:
        finishedSolving in interface MaxSATHandler
      • lowerBoundApproximation

        public int lowerBoundApproximation()
        Description copied from interface: MaxSATHandler
        Returns the last approximation of the result or -1 if there is no approximation for the lower bound. If the handler does not cancel the solving process, it is not guaranteed that this method will return the optimal result. Use the respective method of the MaxSAT solver instead.
        Specified by:
        lowerBoundApproximation in interface MaxSATHandler
        Returns:
        the last approximation of the result or -1 if no approximation is known
      • upperBoundApproximation

        public int upperBoundApproximation()
        Description copied from interface: MaxSATHandler
        Returns the last approximation of the result or -1 if there is no approximation for the lower bound. If the handler does not cancel the solving process, it is not guaranteed that this method will return the optimal result. Use the respective method of the MaxSAT solver instead.
        Specified by:
        upperBoundApproximation in interface MaxSATHandler
        Returns:
        the last approximation of the result or -1 if no approximation is known