|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectCOM.hugin.HAPI.Node
COM.hugin.HAPI.DiscreteNode
The DiscreteNode class. Base class for all discrete nodes.
Method Summary | |
boolean |
caseIsSet(int c)
Returns true if a value has been set for this
DiscreteNode in case c ; otherwise, returns
false . |
void |
enterFinding(int state,
double finding)
Specifies a finding value for a given state with all other states unaffected. |
void |
generateTable()
Generates the table of this DiscreteNode from its model (a missing model will trigger an ExceptionUsage). |
double |
getBelief(int state)
Returns the belief for the specified state of this DiscreteNode. |
int |
getCaseState(int c)
Returns the state of this DiscreteNode for case c . |
double |
getEnteredFinding(int state)
Returns the entered finding for the specified state of this node. |
double |
getEntropy()
Computes the entropy of this node. |
double |
getExpectedUtility(int state)
Returns the expected utility associated with the specified action (state). |
NetworkModel.Kind |
getKind()
Returns the Kind of this DiscreteNode. |
double |
getMutualInformation(DiscreteNode node)
Computes the mutual information between this node and the specified node. |
int |
getNumberOfStates()
Returns the number of states of this node. |
double |
getPropagatedFinding(int state)
Returns the propagated finding. |
int |
getSampledState()
Returns the state index of this DiscreteNode for the configuration generated by the most recent call to Domain.simulate() . |
double[] |
getSensitivityConstants(int input)
Returns the four constants of the specified sensitivity function. |
double[] |
getSensitivityConstants(int input,
int output)
Returns the four constants of the specified sensitivity function. |
int |
getStateIndex(java.lang.String label)
Returns the index of the state matching the specified label. |
java.lang.String |
getStateLabel(int state)
Returns the label of the specified state. |
void |
retractFindings()
Retracts all findings for this node. |
void |
selectState(int state)
Selects the specified state of this node. |
void |
setCaseState(int c,
int state)
Sets the state of this DiscreteNode to state in
case c . |
void |
setNumberOfStates(int stateCount)
Sets the number of states of this node. |
void |
setStateLabel(int state,
java.lang.String newLabel)
Sets the label of the specified state. |
void |
unsetCase(int c)
Specifies that the state of this DiscreteNode is "unknown" for case c . |
Methods inherited from class COM.hugin.HAPI.Node |
addParent, addToInputs, addToOutputs, clone, delete, evidenceIsEntered, evidenceIsPropagated, evidenceToPropagate, getAttribute, getAttributes, getCategory, getChildren, getDomain, getEdgeConstraint, getHome, getHomeClass, getHomeDomain, getInstance, getJunctionTree, getLabel, getMaster, getModel, getName, getParents, getPosition, getSource, getTable, 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 |
Method Detail |
public double getBelief(int state) throws ExceptionHugin
state
- an integer value representing which state to examine.
ExceptionHugin
public double getExpectedUtility(int state) throws ExceptionHugin
state
- An integer value designating which state to
examine.
ExceptionHugin
public double getEnteredFinding(int state) throws ExceptionHugin
state
- an integer value representing which state to examine.
ExceptionHugin
public double getPropagatedFinding(int state) throws ExceptionHugin
state
- an integer representing the state to be examined.
ExceptionHugin
public void retractFindings() throws ExceptionHugin
ExceptionHugin
public int getNumberOfStates() throws ExceptionHugin
ExceptionHugin
public void setNumberOfStates(int stateCount) throws ExceptionHugin
ExceptionHugin
public java.lang.String getStateLabel(int state) throws ExceptionHugin
state
- the index (a nonnegative integer) of the state;
must be less than the number of states of the node
ExceptionHugin
public int getStateIndex(java.lang.String label) throws ExceptionHugin
label
- the state label to search for
ExceptionHugin
public void setStateLabel(int state, java.lang.String newLabel) throws ExceptionHugin
state
- the index (a nonnegative integer) of the state;
must be less than the number of states of the node.newLabel
- the desired state label (a String).
ExceptionHugin
public void selectState(int state) throws ExceptionHugin
ExceptionHugin
public void enterFinding(int state, double finding) throws ExceptionHugin
state
- an integer representing the state to be
selected. States are numbered consecutively from 0 and upwards.finding
- A nonnegative real number as the finding value.
ExceptionHugin
public NetworkModel.Kind getKind()
getKind
in class Node
public void setCaseState(int c, int state) throws ExceptionHugin
state
in
case c
.
c
- the case index represented as an integer.state
- the state represented as an integer.
ExceptionHugin
public void unsetCase(int c) throws ExceptionHugin
c
.
c
- the case index (an integer in the range 0, ..., number
of cases)
ExceptionHugin
public boolean caseIsSet(int c) throws ExceptionHugin
true
if a value has been set for this
DiscreteNode in case c
; otherwise, returns
false
.
c
- the case index (an integer in the range 0, ..., number
of cases)
ExceptionHugin
public int getCaseState(int c) throws ExceptionHugin
c
.
c
- the case index (an integer in the range 0, ..., number
of cases)
ExceptionHugin
public int getSampledState() throws ExceptionHugin
Domain.simulate()
.
ExceptionHugin
public void generateTable() throws ExceptionHugin
ExceptionHugin
public double getEntropy() throws ExceptionHugin
ExceptionHugin
public double getMutualInformation(DiscreteNode node) throws ExceptionHugin
node
- the other node
ExceptionHugin
public double[] getSensitivityConstants(int input) throws ExceptionHugin
computeSensitivityData
. If the results produced by that call
have been invalidated, a usage exception is thrown.
input
- specifies a conditional probability (or policy)
parameter of this node (i.e., input
is the index
of an entry in the CPT/policy of this node).
ExceptionHugin
public double[] getSensitivityConstants(int input, int output) throws ExceptionHugin
computeSensitivityData
.
If the results produced by that call have been invalidated, a
usage exception is thrown.
input
- specifies a conditional probability (or policy)
parameter of this node (i.e., input
is the index
of an entry in the CPT/policy of this node).output
- identifies one of the output probabilities
specified in the call to computeSensitivityData
.
ExceptionHugin
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |