COM.hugin.HAPI
Class NumberedDFNode

java.lang.Object
  extended by COM.hugin.HAPI.Node
      extended by COM.hugin.HAPI.DiscreteNode
          extended by COM.hugin.HAPI.DiscreteFunctionNode
              extended by COM.hugin.HAPI.NumberedDFNode
All Implemented Interfaces:
NumericDiscreteNode, java.lang.Cloneable

public class NumberedDFNode
extends DiscreteFunctionNode
implements NumericDiscreteNode

Numbered discrete function node. Each state of an NumberedDFNode represents a number.


Constructor Summary
NumberedDFNode(DiscreteFunctionNode node)
          Constructs a new NumberedDFNode object corresponding to the given DiscreteFunctionNode object node.
NumberedDFNode(NetworkModel belongsTo)
          Constructs a new NumberedDFNode.
 
Method Summary
 double getQuantile(double probability)
          Returns the quantile corresponding to the specified probability argument of the inverse cumulative distribution function.
 int getStateIndex(double value)
          Returns the index of the state matching the specified value.
 double getStateValue(int s)
          Returns the value associated with a particular state of this NumberedDFNode.
 void setStateValue(int s, double v)
          Sets the value associated with a particular state of this NumberedDFNode.
 
Methods inherited from class COM.hugin.HAPI.DiscreteFunctionNode
getCategory
 
Methods inherited from class COM.hugin.HAPI.DiscreteNode
caseIsSet, computeExplanationData, computeExplanationData, enterFinding, generateTable, getBelief, getCaseState, getEnteredFinding, getEntropy, getExpectedUtility, getKind, getMutualInformation, getNumberOfStates, getPredictedBelief, getPropagatedFinding, getSampledState, getSensitivityConstants, getSensitivityConstants, getStateIndex, getStateLabel, retractFindings, selectState, setCaseState, setNumberOfStates, setStateLabel, unsetCase
 
Methods inherited from class COM.hugin.HAPI.Node
addParent, addToInputs, addToOutputs, clone, createTemporalClone, delete, evidenceIsEntered, evidenceIsPropagated, evidenceToPropagate, getAttribute, getAttributes, getChildren, getEdgeConstraint, getHome, getHomeClass, getHomeDomain, getInstance, getJunctionTree, getLabel, getMaster, getModel, getName, getParents, getPosition, getSource, getTable, getTemporalClone, getTemporalMaster, getUserData, isAlive, likelihoodIsEntered, likelihoodIsPropagated, removeFromInputs, removeFromOutputs, removeParent, reverseEdge, setAttribute, setAttributes, setEdgeConstraint, setLabel, setName, setPosition, setUserData, switchParent
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NumberedDFNode

public NumberedDFNode(NetworkModel belongsTo)
               throws ExceptionHugin
Constructs a new NumberedDFNode.

Throws:
ExceptionHugin

NumberedDFNode

public NumberedDFNode(DiscreteFunctionNode node)
               throws ExceptionHugin
Constructs a new NumberedDFNode object corresponding to the given DiscreteFunctionNode object node. The new object will be identical to node (that is, same parents, same table, etc.) except for its type.

As a side-effect, the object node dies (that is, becomes "not-alive"). Moreover, all (output and temporal) clones associated with node also die.

Throws:
ExceptionHugin
Method Detail

getStateValue

public double getStateValue(int s)
                     throws ExceptionHugin
Returns the value associated with a particular state of this NumberedDFNode.

Specified by:
getStateValue in interface NumericDiscreteNode
Parameters:
s - the index of the state in question.
Throws:
ExceptionHugin

getStateIndex

public int getStateIndex(double value)
                  throws ExceptionHugin
Returns the index of the state matching the specified value. If there is no (unique) state with the specified state value, -1 is returned.

Specified by:
getStateIndex in interface NumericDiscreteNode
Parameters:
value - the state value of the state to be searched for
Returns:
the index of the state with the specified state value.
Throws:
ExceptionHugin

setStateValue

public void setStateValue(int s,
                          double v)
                   throws ExceptionHugin
Sets the value associated with a particular state of this NumberedDFNode.

Specified by:
setStateValue in interface NumericDiscreteNode
Parameters:
s - the index of the state in question.
v - the new value for state s.
Throws:
ExceptionHugin

getQuantile

public double getQuantile(double probability)
                   throws ExceptionHugin
Returns the quantile corresponding to the specified probability argument of the inverse cumulative distribution function.

Specified by:
getQuantile in interface NumericDiscreteNode
Throws:
ExceptionHugin