|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--jeops.engine.KnowledgeBase
The main class of JEOPS. This class models the knowledge the agent has about the world. In it are stored the facts (objects) and (production) rules that act on the first.
Constructor Summary | |
KnowledgeBase(java.lang.String ruleFile)
Creates a new knowledge base, given the name of the file containing the rules. |
|
KnowledgeBase(java.lang.String ruleFile,
RuleSorter ruleSorter)
Creates a new knowledge base, given the name of the file containing the rules. |
Method Summary | |
void |
assert(java.lang.Object obj)
Inserts a new object in this knowledge base. |
void |
flush()
Remove all facts (objects) of the object base. |
ObjectBase |
getObjectBase()
Returns the object base over which this knowledge base works. |
RuleBase |
getRuleBase()
Returns the rule base that controls this knowledge base. |
java.util.Vector |
objects(java.lang.String className)
Returns the objects of a given class. |
void |
retract(java.lang.Object obj)
Removes a given object of this knowledge base. |
void |
run()
Fires the rules in the rule base with the objects present in the object base, until no rule is fireable anymore. |
void |
setRuleSorter(RuleSorter ruleSorter)
Defines a conflict set policy for this knowledge base. |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public KnowledgeBase(java.lang.String ruleFile)
ruleFile
- the name of the file containing the rules.public KnowledgeBase(java.lang.String ruleFile, RuleSorter ruleSorter)
ruleFile
- the name of the file containing the rules.ruleSorter
- a rule sorter that will define the policy
for the rule firing.Method Detail |
public void assert(java.lang.Object obj)
obj
- the object being inserted.public void flush()
public ObjectBase getObjectBase()
public RuleBase getRuleBase()
public java.util.Vector objects(java.lang.String className)
className
- the name of the class.public void retract(java.lang.Object obj)
obj
- the object being removed.public void run()
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 |