org.jscience.computing.ai.expertsystem.rete
Class FinalReteNode

java.lang.Object
  extended by org.jscience.computing.ai.expertsystem.rete.ReteNode
      extended by org.jscience.computing.ai.expertsystem.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.


Constructor Summary
FinalReteNode(int numberInputs, AbstractKnowledgeBase knowledgeBase, int ruleIndex)
          Creates a new discriminant rete 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 org.jscience.computing.ai.expertsystem.rete.ReteNode
addSuccessor, addSuccessor, addSuccessor, getNumberInputs, getNumberOutputs, getSuccessors, propagate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

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.
Method Detail

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.

Specified by:
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.

Parameters:
obj - DOCUMENT ME!

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.