Main Page   Class Hierarchy   Alphabetical List   Compound List   Compound Members  

HAPI::DiscreteChanceNode Class Reference

Inheritance diagram for HAPI::DiscreteChanceNode:

HAPI::Node HAPI::BooleanDCNode HAPI::IntervalDCNode HAPI::LabelledDCNode HAPI::NumberedDCNode List of all members.

Detailed Description

This class is the ancestor of all discrete chance nodes.


Public Member Functions

void addParent (DiscreteChanceNode *parent)
 Add parent as a new parent of this node.

void removeParent (DiscreteChanceNode *parent)
 Remove the directed link between parent and this node.

void switchParent (DiscreteChanceNode *oldParent, DiscreteChanceNode *newParent)
 Substitute a new parent for an old parent.

void addParent (DiscreteDecisionNode *parent)
 Add parent as a new parent of this node.

void removeParent (DiscreteDecisionNode *parent)
 Remove the directed link between parent and this node.

void switchParent (DiscreteDecisionNode *oldParent, DiscreteDecisionNode *newParent)
 Substitute a new parent for an old parent.

NodeList getParents () const
 Return a NodeList with references to the parents of this node.

NodeList getChildren () const
 Return a NodeList containing pointers to the children of this node.

void reverseEdge (DiscreteChanceNode *neighbor)
 Reverse the edge between this node and the specified neighbor.

bool caseIsSet (size_t index) const
 Test whether the value of this node in case index currently is set.

void enterFinding (size_t state, Number value)
 This method specifies a finding value for the specified state and all other states are not effected.

Number getBelief (size_t state) const
 The belief for the specified state in this node is returned.

size_t getCaseState (size_t index) const
 Retrieve the state value of this node associated with the case index.

Category getCategory () const
 Return the node category.

Kind getKind () const
 Return the node kind.

Number getEnteredFinding (size_t state) const
 Retrieve the finding currently registrered at this node for state.

TablegetExperienceTable ()
 Return the experience table.

TablegetFadingTable ()
 Return the fading table.

size_t getNumberOfStates () const
 Return the number of states in this node.

Number getPropagatedFinding (size_t state) const
 Retrieve the propagated finding.

size_t getSelection () const
 Return the state index generated by the most recent call to Domain::simulate ().

std::string getStateLabel (size_t state) const
 Return the label of state.

virtual TablegetTable ()
 Return the table associated with this node.

bool hasExperienceTable () const
 Check whether node has experience table.

bool hasFadingTable () const
 Check whether node has fading table.

bool isEvidenceEntered () const
 Return whether or not evidence is entered into this node.

bool isEvidencePropagated () const
 Return whether or not evidence has been propagated from this node.

void retractFindings ()
 Retract all findings for this node.

void selectState (size_t state)
 Select the specified state of this node.

void setCaseState (size_t index, size_t state)
 Specify the case state of this node associated with case index to be state.

void setStateLabel (size_t state, const char *statelabel)
 Set the state label of the node.

void setStateLabel (size_t state, const std::string &statelabel)
 Set the state label of the node.

void touchTable ()
 Touch the table of this node.

void unsetCase (size_t index)
 Specify that the value of this node for case index is unknown.

size_t getSampledState () const
 Returns the state sampled for this.


Member Function Documentation

void HAPI::DiscreteChanceNode::addParent DiscreteDecisionNode parent  ) 
 

Add parent as a new parent of this node.

That is, add a directed link from parent to this node.

Parameters:
parent DiscreteDecisionNode*

void HAPI::DiscreteChanceNode::addParent DiscreteChanceNode *  parent  ) 
 

Add parent as a new parent of this node.

That is, add a directed link from parent to this node.

Parameters:
parent DiscreteChanceNode*

bool HAPI::DiscreteChanceNode::caseIsSet size_t  index  )  const
 

Test whether the value of this node in case index currently is set.

Parameters:
index Case index.
Returns:
boolean.

void HAPI::DiscreteChanceNode::enterFinding size_t  state,
Number  value
 

This method specifies a finding value for the specified state and all other states are not effected.

Parameters:
state An integer designating which state to be selected. States are numbered consecutively from 0 and upwards.
value A non-negative real number as the finding value.

Number HAPI::DiscreteChanceNode::getBelief size_t  state  )  const
 

The belief for the specified state in this node is returned.

Note that if findings have been entered since the most recent propagation, the beliefs returned may not be up-to-date.

Parameters:
state An interger value designating which state to examine.

Category HAPI::DiscreteChanceNode::getCategory  )  const [inline, virtual]
 

Return the node category.

Returns:
Category

Implements HAPI::Node.

NodeList HAPI::DiscreteChanceNode::getChildren  )  const
 

Return a NodeList containing pointers to the children of this node.

If no children exist, an empty NodeList is returned.

Returns:
NodeList

Number HAPI::DiscreteChanceNode::getEnteredFinding size_t  state  )  const
 

Retrieve the finding currently registrered at this node for state.

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

Kind HAPI::DiscreteChanceNode::getKind  )  const [inline, virtual]
 

Return the node kind.

Returns:
Kind

Implements HAPI::Node.

size_t HAPI::DiscreteChanceNode::getNumberOfStates  )  const
 

Return the number of states in this node.

The states are numbered from 0 to N-1.

Returns:
size_t

NodeList HAPI::DiscreteChanceNode::getParents  )  const
 

Return a NodeList with references to the parents of this node.

If no parents exist, an empty NodeList is returned.

Returns:
NodeList

Number HAPI::DiscreteChanceNode::getPropagatedFinding size_t  state  )  const
 

Retrieve the propagated finding.

That is, retrieve the finding value incorporated within the current junction tree potentials for the specified state of this node.

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

size_t HAPI::DiscreteChanceNode::getSelection  )  const
 

Return the state index generated by the most recent call to Domain::simulate ().

This function is obsolete. Use getSampledState instead.

Returns:
size_t

std::string HAPI::DiscreteChanceNode::getStateLabel size_t  state  )  const
 

Return the label of state.

0 < state < N, where N is the number of states in the node.

Returns:
Standard C++ Library string.

virtual Table* HAPI::DiscreteChanceNode::getTable  )  [virtual]
 

Return the table associated with this node.

The table is the conditional probability table for this node given its parents. The set of nodes associated with the table will be the (discrete) parents of this in unspecified order followed by this node.

Returns:
Table*

bool HAPI::DiscreteChanceNode::isEvidenceEntered  )  const
 

Return whether or not evidence is entered into this node.

Returns:
Boolean.

bool HAPI::DiscreteChanceNode::isEvidencePropagated  )  const
 

Return whether or not evidence has been propagated from this node.

Returns:
Boolean.

void HAPI::DiscreteChanceNode::removeParent DiscreteDecisionNode parent  ) 
 

Remove the directed link between parent and this node.

The table (if any) will be updated such that the updated table will be the portion of the old table that corresponds to parent being in its first state.

Parameters:
parent Pointer to the parent DiscreteDecisionNode that will be removed.

void HAPI::DiscreteChanceNode::removeParent DiscreteChanceNode *  parent  ) 
 

Remove the directed link between parent and this node.

The table (if any) will be updated such that the updated table will be the portion of the old table that corresponds to parent being in its first state.

Parameters:
parent Pointer to the parent DiscreteChanceNode that will be removed.

void HAPI::DiscreteChanceNode::retractFindings  ) 
 

Retract all findings for this node.

This is equivalent to setting the finding value to 1 for all states of this node.

void HAPI::DiscreteChanceNode::reverseEdge DiscreteChanceNode *  neighbor  ) 
 

Reverse the edge between this node and the specified neighbor.

Parameters:
neighbor DiscreteChanceNode*

void HAPI::DiscreteChanceNode::selectState size_t  state  ) 
 

Select the specified state of this node.

This is equivalent to specifying the finding value 1 for the specified state and 0 for all other states.

Parameters:
state An integer designating which state to be selected. States are numbered consecutively from 0 and upwards.

void HAPI::DiscreteChanceNode::setCaseState size_t  index,
size_t  state
 

Specify the case state of this node associated with case index to be state.

Parameters:
index The case index.
state The node state.

void HAPI::DiscreteChanceNode::setStateLabel size_t  state,
const std::string &  statelabel
 

Set the state label of the node.

Parameters:
state size_t - The state number.
statelabel - The desired state label.

void HAPI::DiscreteChanceNode::setStateLabel size_t  state,
const char *  statelabel
 

Set the state label of the node.

Parameters:
state size_t - The state number.
statelabel - The desired state label.

void HAPI::DiscreteChanceNode::switchParent DiscreteDecisionNode oldParent,
DiscreteDecisionNode newParent
 

Substitute a new parent for an old parent.

The new parent must be compatible with the old parent: This implies that it must be of the same class, have the same number of states, etc.

void HAPI::DiscreteChanceNode::switchParent DiscreteChanceNode *  oldParent,
DiscreteChanceNode *  newParent
 

Substitute a new parent for an old parent.

The new parent must be compatible with the old parent: This implies that it must be of the same class, have the same number of states, etc.

void HAPI::DiscreteChanceNode::touchTable  ) 
 

Touch the table of this node.

This should be done to notify the inference engine whenever changes made to the Table should be used in subsequent inference. Changes made by the Hugin API will automatically provide this notification.

void HAPI::DiscreteChanceNode::unsetCase size_t  index  ) 
 

Specify that the value of this node for case index is unknown.

Parameters:
index long.


Copyright Hugin Expert A/S 1993-2004