class DiscreteChanceNode : public Node

This class is the ancestor for all discrete nodes.

Inheritance:


Public Methods

void addParent(DiscreteChanceNode *parent) throw( HAPI::ExceptionHugin )
Add parent as a new parent of this node
void addParent(DiscreteDecisionNode *parent) throw( HAPI::ExceptionHugin )
Add parent as a new parent of this node
bool caseIsSet(long index) throw(HAPI::ExceptionHugin)
Test whether the value of this node in case index currently is set
void enterFinding(int state, double value) throw( ExceptionHugin )
This method specifies a finding value for the specified state and all other states are not effected
double getBelief(int state) throw( ExceptionHugin )
The belief for the specified state in this node is returned
int getCaseState(long index) throw(HAPI::ExceptionHugin)
Retrieve the state value of this node associated with the case index
virtual Category getCategory() throw()
Return the node category
NodeList getChildren() const throw( HAPI::ExceptionHugin )
Return a NodeList containing pointers to the children of this node
double getEnteredFinding(int state) const throw( ExceptionHugin )
Retrieve the finding currently registrered at this node for state
Table* getExperienceTable() throw(HAPI::ExceptionHugin)
Return the experience table
Table* getFadingTable() throw(HAPI::ExceptionHugin)
Return the fading table
virtual Kind getKind() throw(HAPI::ExceptionHugin)
Return the node kind
int getNumberOfStates() const throw(ExceptionHugin)
Return the number of states in this node
double getPropagatedFinding(int state) const throw( ExceptionHugin )
Retrieve the propagated finding
int getSelection() const throw(ExceptionHugin)
Return the state index generated by the latest call to Domain::simulate()
std::string getStateLabel(int state) const throw(HAPI::ExceptionHugin)
Return the label of state
virtual Table* getTable() throw(HAPI::ExceptionHugin)
Return the table associated with this node
bool hasExperienceTable() throw(HAPI::ExceptionHugin)
Check whether node has experience table
bool hasFadingTable() throw(HAPI::ExceptionHugin)
Check whether node has fading table
bool isEvidenceEntered()
Return whether or not evidence is entered into this node
bool isEvidencePropagated()
Return whether or not evidence has been propagated from this node
void removeParent(DiscreteChanceNode *parent) throw( HAPI::ExceptionHugin )
Remove the directed link between parent and this node
void removeParent(DiscreteDecisionNode *parent) throw( HAPI::ExceptionHugin )
Remove the directed link between parent and this node
void retractFindings() throw( ExceptionHugin )
Retract all findings for this node
void reverseEdge(DiscreteChanceNode *neighbor) throw(ExceptionHugin)
Reverse the edge between this node and the specified neighbor
void selectState(int state) throw( ExceptionHugin )
Select the specified state of this node
void setCaseState(long index, int state) throw(HAPI::ExceptionHugin)
Specify the case state of this node associated with case index to be state
void setStateLabel(int state, char *statelabel) throw(HAPI::ExceptionHugin)
Set the state label of the node
void setStateLabel(int state, std::string& statelabel) throw(HAPI::ExceptionHugin)
Set the state label of the node
void unsetCase(long index)
Specify that the value of this node for case index is unknown
int getSampledState( ) throw(HAPI::ExceptionHugin)
Returns the state sampled for this

Inherited from Node:

Public Methods

std::string getAttribute(std::string& key) const throw(HAPI::ExceptionHugin)
Domain* getDomain() const throw(HAPI::ExceptionHugin)
JunctionTree* getJunctionTree() const throw(HAPI::ExceptionHugin)
std::string getLabel() const throw(HAPI::ExceptionHugin)
Model* getModel() throw(HAPI::ExceptionHugin)
std::string getName() const throw(HAPI::ExceptionHugin)
NodeList getParents() const throw(HAPI::ExceptionHugin)
std::pair <long, long> getPosition() const throw(HAPI::ExceptionHugin)
void* getUserData() throw(HAPI::ExceptionHugin)
Constraint getEdgeConstraint( Node *bNode )
void setEdgeConstraint( Node *bNode, Constraint C )
void generateTable() throw(HAPI::ExceptionHugin )
std::vector <Attribute*> Node::getAttributes() throw(HAPI::ExceptionHugin )
void setAttribute(std::string& key, std::string& value) throw(HAPI::ExceptionHugin)
void setLabel(char* label) throw(HAPI::ExceptionHugin)
void setLabel(std::string& label) throw(HAPI::ExceptionHugin)
void setName(char *name) throw(HAPI::ExceptionHugin)
void setName(std::string& name) throw(HAPI::ExceptionHugin)
void setPosition(long x, long y) throw(HAPI::ExceptionHugin)
void setPosition(std::pair<long, long> pos) throw(HAPI::ExceptionHugin)
void setUserData(void *) throw(HAPI::ExceptionHugin)
Domain* getHomeDomain() const throw(ExceptionHugin)
Class* getHomeClass() const throw(ExceptionHugin)
void addToInputs() throw(ExceptionHugin)
void addToOutputs() throw(ExceptionHugin)
void removeFromInputs() throw(ExceptionHugin)
void removeFromOutputs() throw(ExceptionHugin)
Node* getInstance() throw(ExceptionHugin)
Node* getMaster() throw(ExceptionHugin)
NodeList getSource() throw(ExceptionHugin)

Documentation

This class is the ancestor for all discrete nodes.
void addParent(DiscreteChanceNode *parent) throw( HAPI::ExceptionHugin )
Add parent as a new parent of this node. That is, add a directed link from parent to this node.

Parameters:
parent - DiscreteChanceNode*

void addParent(DiscreteDecisionNode *parent) throw( HAPI::ExceptionHugin )
Add parent as a new parent of this node. That is, add a directed link from parent to this node.

Parameters:
parent - DiscreteDecisionNode*

bool caseIsSet(long index) throw(HAPI::ExceptionHugin)
Test whether the value of this node in case index currently is set.

Returns:
boolean.
Parameters:
index - Case index.

void enterFinding(int state, double value) throw( ExceptionHugin )
This method specifies a finding value for the specified state and all other states are not effected. <P>

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

double getBelief(int state) throw( ExceptionHugin )
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.

int getCaseState(long index) throw(HAPI::ExceptionHugin)
Retrieve the state value of this node associated with the case index

virtual Category getCategory() throw()
Return the node category
Returns:
Category

NodeList getChildren() const throw( HAPI::ExceptionHugin )
Return a NodeList containing pointers to the children of this node. If no children exist, an empty NodeList is returned.

Returns:
NodeList

double getEnteredFinding(int state) const throw( ExceptionHugin )
Retrieve the finding currently registrered at this node for state.

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

Table* getExperienceTable() throw(HAPI::ExceptionHugin)
Return the experience table

Table* getFadingTable() throw(HAPI::ExceptionHugin)
Return the fading table

virtual Kind getKind() throw(HAPI::ExceptionHugin)
Return the node kind
Returns:
Kind

int getNumberOfStates() const throw(ExceptionHugin)
Return the number of states in this node. The states are numbered from 0 to N-1.

Returns:
int

double getPropagatedFinding(int state) const throw( ExceptionHugin )
Retrieve the propagated finding. That is, retrieve the finding value incorporated within the current junction tree potentials for the specified state of this node.

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

int getSelection() const throw(ExceptionHugin)
Return the state index generated by the latest call to Domain::simulate()
Returns:
int

std::string getStateLabel(int state) const throw(HAPI::ExceptionHugin)
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* getTable() throw(HAPI::ExceptionHugin)
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 hasExperienceTable() throw(HAPI::ExceptionHugin)
Check whether node has experience table

bool hasFadingTable() throw(HAPI::ExceptionHugin)
Check whether node has fading table

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

Returns:
Boolean.

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

Returns:
Boolean.

void removeParent(DiscreteChanceNode *parent) throw( HAPI::ExceptionHugin )
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 removeParent(DiscreteDecisionNode *parent) throw( HAPI::ExceptionHugin )
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 retractFindings() throw( ExceptionHugin )
Retract all findings for this node. This is equivalent to setting the finding value to 1 for all states of this node.

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

Parameters:
neighbor - DiscreteChanceNode*

void selectState(int state) throw( ExceptionHugin )
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 setCaseState(long index, int state) throw(HAPI::ExceptionHugin)
Specify the case state of this node associated with case index to be state.

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

void setStateLabel(int state, char *statelabel) throw(HAPI::ExceptionHugin)
Set the state label of the node.

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

void setStateLabel(int state, std::string& statelabel) throw(HAPI::ExceptionHugin)
Set the state label of the node.

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

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

Parameters:
index - long.

int getSampledState( ) throw(HAPI::ExceptionHugin)
Returns the state sampled for this


Direct child classes:
NumberedDCNode
LabelledDCNode
IntervalDCNode
BooleanDCNode

alphabetic index hierarchy of classes


this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de