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 TypeMethodDescriptionvoidexecute(InferenceEngine engine) Executes the action associated with this rule.getName()returns the name of the rule.intGets the priority of the rule.booleanEvaluates the condition of the rule against a given object (fact).
-
Method Details
-
getName
String getName()returns the name of the rule. -
matches
Evaluates the condition of the rule against a given object (fact).- Parameters:
object- the fact to evaluate.- Returns:
- true if the condition matches.
-
execute
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.
-