COM.hugin.HAPI
Class DiscreteDecisionNode

java.lang.Object
  extended byCOM.hugin.HAPI.Node
      extended byCOM.hugin.HAPI.DiscreteDecisionNode
Direct Known Subclasses:
BooleanDDNode, IntervalDDNode, LabelledDDNode, NumberedDDNode

public class DiscreteDecisionNode
extends Node

The discrete decision node. Base class for all decision nodes.


Method Summary
 void enterFinding(int state, double finding)
          Selects a state of this DiscreteDecisionNode.
 NetworkModel.Category getCategory()
          Returns the Category of this DiscreteDecisionNode.
 double getEnteredFinding(int state)
          Retrieve the finding currently registrered at this node for the specified state.
 double getExpectedUtility(int state)
          Returns the expected utility associated with the specified action (state).
 NetworkModel.Kind getKind()
          Returns the Kind for this DiscreteDecisionNode.
 int getNumberOfStates()
          Returns the number of states in this node.
 double getPropagatedFinding(int state)
          Retrieve the finding value incorporated.
 int getSampledState()
          Returns the state index of this DiscreteDecisionNode for the configuration generated by the most recent call to simulate().
 java.lang.String getStateLabel(int state)
          Returns the label of state.
 void retractFindings()
          Retract all findings for this node.
 void selectState(int state)
          Select the specified state of this node.
 void setNumberOfStates(int newNumber)
           
 void setStateLabel(int state, java.lang.String newLabel)
          Sets the state label of the node.
 
Methods inherited from class COM.hugin.HAPI.Node
addParent, addToInputs, addToOutputs, delete, evidenceIsEntered, evidenceIsPropagated, evidenceToPropagate, getAttribute, getAttributes, getChildren, getDomain, getEdgeConstraint, getHome, getHomeClass, getHomeDomain, getInstance, getJunctionTree, getLabel, getMaster, getModel, getName, getParents, getPosition, getSource, getUserData, 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
 

Method Detail

getExpectedUtility

public double getExpectedUtility(int state)
                          throws ExceptionHugin
Returns the expected utility associated with the specified action (state).

Parameters:
state - An interger value designating which state to examine.
Returns:
A double-precision floating-point value expressing the expected utility associated with state.

Throws:
ExceptionHugin

getEnteredFinding

public double getEnteredFinding(int state)
                         throws ExceptionHugin
Retrieve the finding currently registrered at this node for the specified state.

Parameters:
state - An integer designating the state to be examined.
Returns:
A double-precision real number expressing the entered finding.

Throws:
ExceptionHugin

getPropagatedFinding

public double getPropagatedFinding(int state)
                            throws ExceptionHugin
Retrieve the finding value incorporated. This value is incorporated within the current JunctionTree potentials for state of this node.

Parameters:
state - An integer designating the state to be examined.
Returns:
A double-precision real number expressing the propagated finding.

Throws:
ExceptionHugin

retractFindings

public void retractFindings()
                     throws ExceptionHugin
Retract all findings for this node. This is equivalent to setting the finding value to 1 for all states of this node.

Throws:
ExceptionHugin

getNumberOfStates

public int getNumberOfStates()
                      throws ExceptionHugin
Returns the number of states in this node. The states are numbered from 0 to N-1.

Returns:
int
Throws:
ExceptionHugin

setNumberOfStates

public void setNumberOfStates(int newNumber)
                       throws ExceptionHugin
Throws:
ExceptionHugin

getStateLabel

public java.lang.String getStateLabel(int state)
                               throws ExceptionHugin
Returns the label of state. 0 < state < N, where N is the number of states in the node.

Returns:
A standard string.
Throws:
ExceptionHugin

setStateLabel

public void setStateLabel(int state,
                          java.lang.String newLabel)
                   throws ExceptionHugin
Sets the state label of the node.

Parameters:
state - the state number (int).
newLabel - the desired state label (String).
Throws:
ExceptionHugin

selectState

public void selectState(int state)
                 throws ExceptionHugin
Select the specified state of this node. This is equivalent to specifying the finding value 1 for state and 0 for all other states.

Throws:
ExceptionHugin

enterFinding

public void enterFinding(int state,
                         double finding)
                  throws ExceptionHugin
Selects a state of this DiscreteDecisionNode. This is equivalent to specifying the finding value 1 for the state and 0 for all other states.

Parameters:
state - an integer representing the state to be selected. States are numbered consecutively from 0 and upwards.
finding - a non-negative real number as the finding value.
Throws:
ExceptionHugin

getCategory

public NetworkModel.Category getCategory()
                                  throws ExceptionObjectNotAlive
Returns the Category of this DiscreteDecisionNode.

Overrides:
getCategory in class Node
Returns:
NetworkModel.H_CATEGORY_DECISION.
Throws:
ExceptionObjectNotAlive

getKind

public NetworkModel.Kind getKind()
                          throws ExceptionObjectNotAlive
Returns the Kind for this DiscreteDecisionNode.

Overrides:
getKind in class Node
Returns:
NetworkModel.H_KIND_DISCRETE.
Throws:
ExceptionObjectNotAlive

getSampledState

public int getSampledState()
                    throws ExceptionHugin
Returns the state index of this DiscreteDecisionNode for the configuration generated by the most recent call to simulate().

Returns:
An int - the state index sampled for this DiscreteDecisionNode in the last invocation of simulate() on the Domain of the node.
Throws:
ExceptionHugin