COM.hugin.HAPI
Class DiscreteDecisionNode

java.lang.Object
  |
  +--COM.hugin.HAPI.Node
        |
        +--COM.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.
 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, setEdgeConstraint, setLabel, setName, setPosition, setUserData
 
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 ExceptionObjectNotAlive,
                                 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.


getEnteredFinding

public double getEnteredFinding(int state)
                         throws ExceptionObjectNotAlive,
                                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.


getPropagatedFinding

public double getPropagatedFinding(int state)
                            throws ExceptionObjectNotAlive,
                                   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.


retractFindings

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

getNumberOfStates

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

Returns:
int

setNumberOfStates

public void setNumberOfStates(int newNumber)
                       throws ExceptionObjectNotAlive,
                              ExceptionHugin

getStateLabel

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

setStateLabel

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

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

selectState

public void selectState(int state)
                 throws ExceptionObjectNotAlive,
                        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.

enterFinding

public void enterFinding(int state,
                         double finding)
                  throws ExceptionObjectNotAlive,
                         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.
value - a non-negative real number as the finding value.

getCategory

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

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

getKind

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

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