jeops.rete
Class FinalReteNode
java.lang.Object
|
+--jeops.rete.ReteNode
|
+--jeops.rete.FinalReteNode
- public class FinalReteNode
- extends ReteNode
A final node in the Rete network. There will be one final node for
each rule in the rule base; when objects arrive at a final node,
they are stored in a conflict set element and inserted into the
conflict set of the knowledge base.
- Version:
- 1.0 14 Jul 2000
- Author:
- Carlos Figueira Filho (csff@cin.ufpe.br)
Field Summary |
private java.lang.Object[] |
ARRAY
Object array, defined as an attribute for efficiency purposes
only. |
private AbstractKnowledgeBase |
knowledgeBase
The knowledge base that will receive the elements to pass them
to the conflict set. |
private int |
ruleIndex
The index of the rule correspondent to this node. |
Method Summary |
void |
flush()
Remove all objects that may be stored in this node. |
void |
newObject(java.lang.Object obj,
int input)
Informs this node that an object has arrived. |
void |
remove(java.lang.Object obj)
Remove the following objects that may be stored in this node. |
java.lang.String |
toString()
Returns a string representation of this object. |
Methods inherited from class java.lang.Object |
,
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
registerNatives,
wait,
wait,
wait |
knowledgeBase
private AbstractKnowledgeBase knowledgeBase
- The knowledge base that will receive the elements to pass them
to the conflict set. As the conflict set can be changed when
the program is being executed, it is easier to concentrate the
insertion of elements in the conflict set at one single point
(the knowledge base), and have all final nodes to refer that
point.
ruleIndex
private int ruleIndex
- The index of the rule correspondent to this node.
ARRAY
private final java.lang.Object[] ARRAY
- Object array, defined as an attribute for efficiency purposes
only.
FinalReteNode
public FinalReteNode(int numberInputs,
AbstractKnowledgeBase knowledgeBase,
int ruleIndex)
- Creates a new discriminant rete node.
- Parameters:
numberInputs
- the number of inputs of this node.knowledgeBase
- the knowledge base to where the elements
will be sent.ruleIndex
- the index of the rule that will be stored in
the conflict set by the propagation of objects
arriving at this final node.
flush
public void flush()
- Remove all objects that may be stored in this node. As no
information is stored in this node, and it has no successors,
this method has been overriden for performance reasons.
newObject
public void newObject(java.lang.Object obj,
int input)
- Informs this node that an object has arrived.
- Overrides:
- newObject in class ReteNode
- Parameters:
obj
- the object that arrived at this node.input
- the input number of this node that is to receive
the object. This node has only one input, so this
parameter is not considered in objects of this class.
remove
public void remove(java.lang.Object obj)
- Remove the following objects that may be stored in this node.
As no information is stored in this node, and it has no
successors, this method has been overriden for performance
reasons.
toString
public java.lang.String toString()
- Returns a string representation of this object. Useful for
debugging.
- Overrides:
- toString in class java.lang.Object
- Returns:
- a string representation of this object.