|
||||||||
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
public abstract class DiscreteNode
The DiscreteNode class. Base class for all discrete nodes.
Method Summary | |
---|---|
boolean |
caseIsSet(long c)
Returns true if a state has been set for this
DiscreteNode in case c ; otherwise, returns
false . |
void |
computeExplanationData(int x,
DiscreteNode Y,
int y,
long maxSubsetSize)
Computes Bayes factor data for all (nonempty) subsets of evidence nodes up to the specified maximum size. |
void |
computeExplanationData(int state,
long maxSubsetSize)
Computes "normalized likelihoods" for the specified hypothesis and all (nonempty) subsets of evidence nodes up to the specified maximum size. |
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(long 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 |
getPredictedBelief(int state,
long time)
Returns the predicted belief for the specified state of this DiscreteNode at the specified time point. |
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(long input)
Returns the four constants of the specified sensitivity function. |
double[] |
getSensitivityConstants(long 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(long 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(long c)
Specifies that the state of this DiscreteNode is "unknown" for case c . |
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 getPredictedBelief(int state, long time) throws ExceptionHugin
computeDBNPredictions
.
state
- an integer value representing which state to examine.time
- time slice index (a nonnegative integer less than the
number of predicted time slices)
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 computeExplanationData(int x, DiscreteNode Y, int y, long maxSubsetSize) throws ExceptionHugin
getExplanation
and getExplanationScore
.
x
- state of the primary hypothesis node (this node)Y
- the alternative hypothesis nodey
- state of the alternative hypothesis nodemaxSubsetSize
- data for all subsets of evidence nodes up
to this size are computed
ExceptionHugin
public void computeExplanationData(int state, long maxSubsetSize) throws ExceptionHugin
getExplanation
and getExplanationScore
.
state
- state of the hypothesis node (this node)maxSubsetSize
- data for all subsets of evidence nodes up
to this size are computed
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(long c, int state) throws ExceptionHugin
state
in
case c
.
c
- the index of the case (an integer in the range 0, ...,
number of cases - 1)state
- the state of the specified case for this Node
ExceptionHugin
public void unsetCase(long c) throws ExceptionHugin
c
.
c
- the index of the case (an integer in the range 0, ..., number
of cases - 1)
ExceptionHugin
public boolean caseIsSet(long c) throws ExceptionHugin
true
if a state has been set for this
DiscreteNode in case c
; otherwise, returns
false
.
c
- the index of the case (an integer in the range 0, ..., number
of cases - 1)
ExceptionHugin
public int getCaseState(long c) throws ExceptionHugin
c
.
c
- the index of the case (an integer in the range 0, ..., number
of cases - 1)
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(long 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(long 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 |