com.cra.bnet.engine
Class EvidenceNode

java.lang.Object
  |
  +--com.cra.bnet.engine.AbstractNode
        |
        +--com.cra.bnet.engine.EvidenceNode
All Implemented Interfaces:
AmgNode

public final class EvidenceNode
extends AbstractNode

Represents an evidence node in the AMG.


Field Summary
 
Fields inherited from class com.cra.bnet.engine.AbstractNode
derivativeName, name, valueName
 
Constructor Summary
EvidenceNode(DiscreteNode node, int variableIndex, int instantiationIndex)
          Creates a new EvidenceNode using the specified variable index and instantiation index.
 
Method Summary
 boolean addParent(MultiplyNode node)
          Adds the specified multiply node to this node's parent list.
 double computeValue()
          Computes the value for this node.
protected  String createName()
           
 String getDerivativeName()
          Returns this node's derivative name.
 double getEvidence()
          Returns this node's evidence.
 int getInstantiationIndex()
          Returns this node's instantiation index.
 DiscreteNode getNode()
           
 int getVariableIndex()
          Returns this node's variable index.
 void setEvidence(double evidence)
          Sets this node's evidence to the specified value.
 String toString()
          Returns a string representation of this node.
 
Methods inherited from class com.cra.bnet.engine.AbstractNode
addChild, addParent, computeDerivative, getChildren, getDerivative, getName, getParents, getValue, getValueName, reset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EvidenceNode

public EvidenceNode(DiscreteNode node,
                    int variableIndex,
                    int instantiationIndex)
Creates a new EvidenceNode using the specified variable index and instantiation index.

Parameters:
variableIndex - variable index.
instantiationIndex - instantiation index.
Method Detail

addParent

public boolean addParent(MultiplyNode node)
Adds the specified multiply node to this node's 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 instantiation index.

getNode

public DiscreteNode getNode()

getVariableIndex

public int getVariableIndex()
Returns this node's variable index.

Returns:
this node's variable 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.

getEvidence

public double getEvidence()
Returns this node's evidence.

Returns:
this node's evidence.

setEvidence

public void setEvidence(double evidence)
Sets this node's evidence to the specified value.

Parameters:
evidence - evidence value.

computeValue

public 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.

toString

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

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