Class ReasonerConfiguration


  • public class ReasonerConfiguration
    extends java.lang.Object
    Describes the configuration to be passed via the ReasonerFrontend to the individual reasoners. Data in this class may be defined e.g. via the UI or from a configuration file. Setters are realized in builder style so that they can be chained easily after instance creation.
    Author:
    Holger Eichelberger
    • Constructor Detail

      • ReasonerConfiguration

        public ReasonerConfiguration()
        Creates a new instance and initializes it with default values, i.e. the global timeout from ReasonerFrontend.getTimeout(), an unspecified attributes values set (null) and an unspecified default reasoner (null).
      • ReasonerConfiguration

        public ReasonerConfiguration​(boolean defParamValue)
        Creates a new instance and initializes it with default values, i.e. the global timeout from ReasonerFrontend.getTimeout(), an unspecified attributes values set (null), custom messaging and an unspecified default reasoner (null).
        Parameters:
        defParamValue - Enables custom messages (comments instead of constraints).
    • Method Detail

      • setTimeout

        public ReasonerConfiguration setTimeout​(int timeout)
        Changes the timeout for reasoning.
        Parameters:
        timeout - the timeout in ms, shall be ignored if less negative or null
        Returns:
        this
      • getTimeout

        public int getTimeout()
        Returns the timeout for reasoning.
        Returns:
        the timeout in ms, shall be ignored if not positive
      • getTimeout

        public int getTimeout​(ReasonerConfiguration configuration)
        Returns the specific timeout for reasoning. This method uses ReasonerFrontend.getTimeout() as fallback. Reasoners shall call this method rather than getTimeout().
        Parameters:
        configuration - the configuration the timeout shall be returned for (may be null)
        Returns:
        the timeout in ms, shall be ignored if less negative or null
      • setAttributeValues

        public ReasonerConfiguration setAttributeValues​(AttributeValues attributeValues)
        Changes attribute values for reasoning.
        Parameters:
        attributeValues - the values instance (may ba null)
        Returns:
        this
      • getAttributeValues

        public static AttributeValues getAttributeValues​(ReasonerConfiguration config)
        Null-safe access to the attribute values.
        Parameters:
        config - the configuration instance holding the attribute values.
        Returns:
        the values or null
      • setDefaultReasoner

        public ReasonerConfiguration setDefaultReasoner​(ReasonerDescriptor defaultReasoner)
        Changes the default reasoner.
        Parameters:
        defaultReasoner - the default reasoner or null if there is none configured
        Returns:
        this
      • getDefaultResoner

        public ReasonerDescriptor getDefaultResoner()
        Returns the default reasoner.
        Returns:
        the default reasoner or null if there is none configured
      • enableCustomMessages

        public ReasonerConfiguration enableCustomMessages()
        Enables custom messages.
        Returns:
        this
      • disableCustomMessages

        public ReasonerConfiguration disableCustomMessages()
        Disable custom messages.
        Returns:
        this
      • getCustomMessages

        public boolean getCustomMessages()
        Returns if custom messages are enabled.
        Returns:
        Returns true if custom messages are enabled.
      • setRuntimeMode

        public ReasonerConfiguration setRuntimeMode​(boolean runtime)
        Defines whether runtime reasoning reasoning shall be activated. Currently, runtime reasoning assumes that all required defaults and assignments have already been processed. In particular, the caller is responsible for passing a "clean" configuration to the reasoner that leads to the expected results. Same as setIncrementalMode(boolean).
        Parameters:
        runtime - if reasoning shall happen for runtime
        Returns:
        this
      • setIncrementalMode

        public ReasonerConfiguration setIncrementalMode​(boolean incremental)
        Defines whether runtime incremental reasoning shall be performend. Currently, runtime reasoning assumes that all required defaults and assignments have already been processed. In particular, the caller is responsible for passing a "clean" configuration to the reasoner that leads to the expected results.
        Parameters:
        incremental - if incremental reasoning shall happen
        Returns:
        this
      • isRuntimeMode

        public boolean isRuntimeMode()
        Returns whether runtime reasoning shall be done (see setRuntimeMode(boolean).
        Returns:
        true if reasoning shall happen for runtime, false else (same as isIncrementalMode())
      • isIncrementalMode

        public boolean isIncrementalMode()
        Returns whether incremental reasoning shall be done (see setIncrementalMode(boolean).
        Returns:
        true if reasoning shall happen for runtime, false else