|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--jeops.AbstractKnowledgeBase
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. This class must be subclassed by a concrete knowledge base so that it is provided with the object and rule base needed for work.
Constructor Summary | |
AbstractKnowledgeBase(ConflictSet conflictSet)
Creates a new knowledge base. |
Method Summary | |
void |
addConflictSetListener(RuleFireListener l)
Adds the specified conflict set listener to receive events from this knowledge base. |
void |
addRuleFireListener(RuleFireListener l)
Adds the specified rule fire listener to receive events from this knowledge base. |
void |
assert(java.lang.Object obj)
Inserts a new object in this knowledge base. |
void |
flush()
Remove all facts (objects) of the object base. |
AbstractRuleBase |
getRuleBase()
Returns the (production) rule base of this knowledge base. |
void |
internalElementAdded(InternalConflictSetEvent e)
Invoked when an element is added to the conflict set. |
void |
internalElementRemoved(InternalConflictSetEvent e)
Invoked when an element is removed from the conflict set. |
java.util.Vector |
objects(java.lang.String className)
Returns the objects of a given class. |
void |
removeConflictSetListener(RuleFireListener l)
Removes the specified conflict set listener so that it no longer receives conflict set events from this knowledge base. |
void |
removeRuleFireListener(RuleFireListener l)
Removes the specified rule fire listener so that it no longer receives rule fire events from this knowledge base. |
boolean |
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 |
setConflictSet(ConflictSet conflictSet)
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 AbstractKnowledgeBase(ConflictSet conflictSet)
conflictSet
- the conflict set associated with this knowledge base.Method Detail |
public AbstractRuleBase getRuleBase()
public void addRuleFireListener(RuleFireListener l)
l
- the rule base listenerpublic void removeRuleFireListener(RuleFireListener l)
l
- the rule fire listenerpublic void addConflictSetListener(RuleFireListener l)
l
- the conflict set listenerpublic void removeConflictSetListener(RuleFireListener l)
l
- the conflict set listenerpublic void internalElementAdded(InternalConflictSetEvent e)
e
- the conflict set event.public void internalElementRemoved(InternalConflictSetEvent e)
e
- the conflict set event.public void assert(java.lang.Object obj)
obj
- the object being inserted.public void flush()
public java.util.Vector objects(java.lang.String className)
className
- the name of the class.public boolean retract(java.lang.Object obj)
obj
- the object being removed.true
if the given object belonged to this base;
false
otherwise.public void run()
public void setConflictSet(ConflictSet conflictSet)
conflictSet
- the new conflict set that implements its
associated conflict resolution policy.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |