com.cra.bnet.engine
Class AddNode

java.lang.Object
  |
  +--com.cra.bnet.engine.AbstractNode
        |
        +--com.cra.bnet.engine.AbstractQueueNode
              |
              +--com.cra.bnet.engine.AddNode
All Implemented Interfaces:
AmgNode, QueueNode

public final class AddNode
extends AbstractQueueNode

Represents an addition node in the AMG.


Field Summary
 
Fields inherited from class com.cra.bnet.engine.AbstractNode
derivativeName, name, valueName
 
Constructor Summary
AddNode(Set[] separator, int separatorIndex, int instantiationIndex)
          Creates a new AddNode using the specified separator index and instantiation index.
 
Method Summary
 boolean addChild(MultiplyNode node)
          Adds the specified multiply node to this node's child list.
 boolean addParent(MultiplyNode node)
          Adds the specified multiply node to this nodes parent list.
protected  double computeDerivative()
          Computes the derivative for this node.
protected  double computeValue()
          Computes the value for this node.
protected  String createName()
           
 String getDerivativeName()
          Returns this node's derivative name.
 int getInstantiationIndex()
          Returns this node's instantiation index.
 Set[] getSeparator()
          Returns this node's separator.
 int getSeparatorIndex()
          Returns this node's separator index.
 String getValueName()
          Returns this node's value name.
 String toString()
          Returns a string representation of this node.
 
Methods inherited from class com.cra.bnet.engine.AbstractQueueNode
isOnQueue, setOnQueue
 
Methods inherited from class com.cra.bnet.engine.AbstractNode
addChild, addParent, getChildren, getDerivative, getName, getParents, getValue, reset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.cra.bnet.engine.AmgNode
getChildren, getDerivative, getName, getParents, getValue, reset
 

Constructor Detail

AddNode

public AddNode(Set[] separator,
               int separatorIndex,
               int instantiationIndex)
Creates a new AddNode using the specified separator index and instantiation index.

Parameters:
separatorIndex - separator index.
instantiationIndex - instantiation index.
Method Detail

addChild

public boolean addChild(MultiplyNode node)
Adds the specified multiply node to this node's child list.

Parameters:
node - child node.
Returns:
true if the child was added and false if it was not.

addParent

public boolean addParent(MultiplyNode node)
Adds the specified multiply node to this nodes parent list.

Parameters:
node - parent node.
Returns:
true if the parent was added and false if it was not.

getInstantiationIndex

public int getInstantiationIndex()
Returns this node's instantiation index.

Returns:
this node's intantiation index.

getSeparator

public Set[] getSeparator()
Returns this node's separator.

Returns:
this node's separator.

getSeparatorIndex

public int getSeparatorIndex()
Returns this node's separator index.

Returns:
this node's separator index.

createName

protected String createName()
Specified by:
createName in class AbstractNode

getDerivativeName

public String getDerivativeName()
Description copied from interface: AmgNode
Returns this node's derivative name.

Specified by:
getDerivativeName in interface AmgNode
Overrides:
getDerivativeName in class AbstractNode
Returns:
this node's derivative name.

getValueName

public String getValueName()
Description copied from interface: AmgNode
Returns this node's value name.

Specified by:
getValueName in interface AmgNode
Overrides:
getValueName in class AbstractNode
Returns:
this node's value name.

computeValue

protected double computeValue()
Description copied from class: AbstractNode
Computes the value for this node.

Specified by:
computeValue in class AbstractNode
Returns:
the value for this node.

computeDerivative

protected double computeDerivative()
Description copied from class: AbstractNode
Computes the derivative for this node.

Overrides:
computeDerivative in class AbstractNode
Returns:
the derivative for this node.

toString

public String toString()
Returns a string representation of this node.

Overrides:
toString in class Object
Returns:
a string representation of this node.