Interface InferenceEngine

All Known Implementing Classes:
ReteEngine

public interface InferenceEngine
The inference engine is responsible for matching rules against facts (objects) and executing them.
Since:
2.0
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Adds a fact (data object) to the working memory.
    void
    addRule(Rule rule)
    Adds a rule to the knowledge base.
    void
    clears the working memory.
    void
    Triggers the inference cycle.
    Retrieves all facts currently in the working memory.
    void
    Removes a fact from the working memory.
  • Method Details

    • addRule

      void addRule(Rule rule)
      Adds a rule to the knowledge base.
      Parameters:
      rule - the rule to be added.
    • addFact

      void addFact(Object fact)
      Adds a fact (data object) to the working memory.
      Parameters:
      fact - the object to be reasoned about.
    • removeFact

      void removeFact(Object fact)
      Removes a fact from the working memory.
      Parameters:
      fact - the object to remove.
    • fireRules

      void fireRules()
      Triggers the inference cycle. Automatically matches rules against facts and executes them.
    • getFacts

      Collection<Object> getFacts()
      Retrieves all facts currently in the working memory.
      Returns:
      a collection of facts.
    • clearFacts

      void clearFacts()
      clears the working memory.