|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--jeops.engine.RuleBase
Class that models the heart of the inference engine. It will decide when the rules are fired, filling their symbolic tables with the objects needed for the decision making.
Rule
Constructor Summary | |
RuleBase(ObjectBase base)
Creates a new rule base, given its object base. |
|
RuleBase(ObjectBase base,
RuleSorter ruleSorter)
Creates a new rule base, given its object base and a rule sorter to define the conflict resolution policy. |
Method Summary | |
void |
addRule(Rule r)
Adds a new rule to this rule base. |
void |
assertObject(java.lang.Object obj)
Tells this base that a new object was inserted into its object base, so that the rules can be checked against this object. |
void |
dump()
Prints a tree representation of this base. |
void |
dump(int spaces)
Prints a tree representation of this base. |
boolean |
fireSingleRule(KnowledgeBase knowledgeBase)
Fires a single rule in the rule base, if there is such one in the conflict set. |
void |
modifyObject(java.lang.Object obj)
Tells this base that an object was modified in its object base, so that the rules with instantiations for that object are retested, and new cases can be added to the conflict set. |
void |
reset()
Removes all rules from this rule base. |
void |
retractObject(java.lang.Object obj)
Tells this base that an object was removed from its object base, so that the rules with instantiations for that object are removed from the object base |
void |
setRuleSorter(RuleSorter ruleSorter)
Defines a conflict set policy for this rule base. |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public RuleBase(ObjectBase base)
base
- the object base over which it will work.public RuleBase(ObjectBase base, RuleSorter ruleSorter)
base
- the object base.ruleSorter
- the sorter that will define this base's conflict
resolution policy.Method Detail |
public void addRule(Rule r)
r
- the rule being added to this base.public void assertObject(java.lang.Object obj)
obj
- the object that was inserted.public void dump()
public void dump(int spaces)
spaces
- the identation of the information to be printed.public boolean fireSingleRule(KnowledgeBase knowledgeBase) throws RuleNotFiredException
knowledgeBase
- the knowledge base that owns this rule base.true
if a rule has been fired;
false
otherwise.public void modifyObject(java.lang.Object obj)
obj
- the object that was modified in this base.public void reset()
public void retractObject(java.lang.Object obj)
obj
- the object that was removed from this base.public void setRuleSorter(RuleSorter ruleSorter)
ruleSorter
- the sorter that implements the needed policy.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |