com.cra.bnet.engine
Class CptEntryNode

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

public final class CptEntryNode
extends AbstractNode

Represents a cpt entry node in the AMG.


Field Summary
 
Fields inherited from class com.cra.bnet.engine.AbstractNode
derivativeName, name, valueName
 
Constructor Summary
CptEntryNode(DiscreteNode node, int variableIndex, int instantiationIndex, double probability)
          Creates a new CptEntryNode using the specified variable index, instantiation index, and probability.
 
Method Summary
 boolean addParent(MultiplyNode node)
          Adds the specified multiply node to this node's parent list.
protected  double computeValue()
          Computes the value for this node.
protected  String createName()
           
 int getInstantiationIndex()
          Returns this node's instantiation index.
 DiscreteNode getNode()
           
 double getProbability()
          Returns this node's probability.
 int getVariableIndex()
          Returns this node's variable index.
 void setProbability(double probability)
          Sets this node's probability 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, getDerivativeName, getName, getParents, getValue, getValueName, reset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CptEntryNode

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

Parameters:
variableIndex - variable index.
instantiationIndex - instantiation index.
probability - probability value.
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

getProbability

public double getProbability()
Returns this node's probability.

Returns:
this node's probability.

setProbability

public void setProbability(double probability)
Sets this node's probability to the specified value.

Parameters:
probability - probability value.

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.

toString

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

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