Module logicng

Class TimeoutModelEnumerationHandler

    • Constructor Detail

      • TimeoutModelEnumerationHandler

        public TimeoutModelEnumerationHandler​(long timeout,
                                              TimeoutHandler.TimerType type)
        Constructs a new timeout handler with a given timeout and a timeout type. The interpretation of the timeout depends on the timeout type: Note that it might take a few milliseconds more until the computation is actually canceled, since the handler depends on the next found model.
        Parameters:
        timeout - the timeout in milliseconds, its meaning is defined by the timeout type
        type - the type of the timer, must not be null
      • TimeoutModelEnumerationHandler

        public TimeoutModelEnumerationHandler​(long timeout)
        Constructs a new timeout handler with a given timeout and uses the timeout type TimeoutHandler.TimerType.SINGLE_TIMEOUT. Thus, the timeout is started when Handler.started() is called and further calls to Handler.started() have no effect on the timeout.
        Parameters:
        timeout - the timeout in milliseconds
    • Method Detail

      • 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 ModelEnumerationHandler
        Returns:
        the SAT handler
      • 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
      • foundModel

        public boolean foundModel​(Assignment assignment)
        Description copied from interface: ModelEnumerationHandler
        This method is called every time a model is found.
        Specified by:
        foundModel in interface ModelEnumerationHandler
        Parameters:
        assignment - the respective model
        Returns:
        true if more models should be searched, otherwise false