Class RuleSystem


  • public class RuleSystem
    extends java.lang.Object
    Rule system is a container for state, rule base, and pattern matcher with agenda.
    • Field Detail

      • state

        protected IOAVState state
        The working memory containing all facts.
      • rulebase

        protected IRulebase rulebase
        The rule base containing all the rules.
      • inited

        protected boolean inited
        Flag to check if the rule system was already initialized.
    • Method Detail

      • init

        public void init()
        Initialize the rule system. The rule system needs to be initialized once, before rules can be fired. When trying to initialize the rule system twice, an exception is thrown. Exceptions are also thrown, when trying to fire rules of a not yet initialized rule system
      • isInited

        public boolean isInited()
        Get the inited.
        Returns:
        the inited.
      • getState

        public IOAVState getState()
        Get the memory.
        Returns:
        The memory.
      • getRulebase

        public IRulebase getRulebase()
        Get the rulebase.
        Returns:
        The rulebase.
      • getAgenda

        public IAgenda getAgenda()
        Get the agenda. The agenda can only be accessed, after the rule system has been initialized with init().
        Returns:
        The agenda.
      • fireAllRules

        public void fireAllRules()
        Fire all rules until quiescence.
      • getMatcherFunctionality

        public IPatternMatcherFunctionality getMatcherFunctionality()
        Get the matcher functionality.
        Returns:
        The matcher functionality.
      • getMatcherState

        public IPatternMatcherState getMatcherState()
        Get the matcher state.
        Returns:
        The matcher state.