Interface Rule


public interface Rule
Represents a logic rule in an expert system.

A rule consists of a condition (Left-Hand Side) and an action (Right-Hand Side).

Since:
2.0
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Executes the action associated with this rule.
    returns the name of the rule.
    int
    Gets the priority of the rule.
    boolean
    matches(Object object)
    Evaluates the condition of the rule against a given object (fact).
  • Method Details

    • getName

      String getName()
      returns the name of the rule.
    • matches

      boolean matches(Object object)
      Evaluates the condition of the rule against a given object (fact).
      Parameters:
      object - the fact to evaluate.
      Returns:
      true if the condition matches.
    • execute

      void execute(InferenceEngine engine)
      Executes the action associated with this rule.
      Parameters:
      engine - the inference engine context.
    • getPriority

      int getPriority()
      Gets the priority of the rule. Higher priority rules fire first.
      Returns:
      priority value.