Interface IReasonerInstance

  • All Known Implementing Classes:
    DelegatingReasonerInstance, Reasoner.ReasonerInstance

    public interface IReasonerInstance
    A reuseable reasoner instance. Project, configuration and reasoner configuration are fixed for this instance. The reasoner may operate sequentially or in parallel. A specific reasoner must not offer/create reasoner instances. The underlying model is assumed to have no structural changes between two subsequent reasonings.
    Author:
    Holger Eichelberger
    • Method Detail

      • getDescriptor

        ReasonerDescriptor getDescriptor()
        Returns a descriptor stating common information about this reasoner.
        Returns:
        the descriptor
      • isConsistent

        ReasoningResult isConsistent​(ProgressObserver observer)
        Checks whether a given variability model (project) is satisfiable.
        Parameters:
        observer - an optional progress observer, shall be ProgressObserver.NO_OBSERVER if unused
        Returns:
        The result of this reasoning step. Can have the status Status.UNSUPPORTED if the concrete reasoner does not support this operation.
      • check

        ReasoningResult check​(ProgressObserver observer)
        Checks the configuration according to the given project structure and does not affect the configuration.
        Parameters:
        observer - an optional progress observer, shall be ProgressObserver.NO_OBSERVER if unused
        Returns:
        The result of this reasoning step. Can have the status Status.UNSUPPORTED if the concrete reasoner does not support this operation.
      • propagate

        ReasoningResult propagate​(ProgressObserver observer)
        Checks the configuration according to the given model and propagates values, if possible.
        Parameters:
        observer - an optional progress observer, shall be ProgressObserver.NO_OBSERVER if unused
        Returns:
        The result of this reasoning step. Can have the status Status.UNSUPPORTED if the concrete reasoner does not support this operation.
      • evaluate

        EvaluationResult evaluate​(java.util.List<Constraint> constraints,
                                  ProgressObserver observer)
        Evaluates a given list of constraints (in the sense of boolean conditions) which are related to and valid in the context of the given project and configuration.
        Parameters:
        constraints - the constraints (expressions which evaluate to a boolean value)
        observer - an optional progress observer, shall be ProgressObserver.NO_OBSERVER if unused
        Returns:
        The result of this reasoning step. Can have the status Status.UNSUPPORTED if the concrete reasoner does not support this operation.
      • createValue

        ValueCreationResult createValue​(AbstractVariable var,
                                        IDatatype type,
                                        ProgressObserver observer)
        Creates the value for a certain IVML type/variable.
        Parameters:
        var - the variable to create the value for (may be null if type is given, may imply additional constraints)
        type - the type to create the value for (may be null if var is given)
        observer - an optional progress observer, shall be ProgressObserver.NO_OBSERVER if unused
        Returns:
        the value creation result
      • notify

        void notify​(IReasonerMessage message)
        Is called when a reasoner message is issued.
        Parameters:
        message - the message sent
      • isRunning

        boolean isRunning()
        Returns whether the reasoner is (still) operating.
        Returns:
        true for operating, false else
      • stop

        boolean stop()
        Stops/terminates reasoning. If possible, a reasoner shall stop the reasoning operations as quick as possible. A reasoner must not implement this operation.
        Returns:
        true if the reasoner tries to stop, false else (operation not implemented)
        See Also:
        ReasoningResult.setStopped(boolean)
      • getProject

        Project getProject()
        Returns the project this instance is attached to.
        Returns:
        the project
      • getReasonerConfiguration

        ReasonerConfiguration getReasonerConfiguration()
        Returns the reasoner configuration this project is running with.
        Returns:
        the reasoner configuration