class Node

Nodes are one of the fundamental objects used in the construction of Bayesian belief networks and influence diagrams

Inheritance:


Public Methods

virtual ~Node()
Delete Node
void addParent(DiscreteChanceNode *parent) throw(HAPI::ExceptionHugin)
Add the DiscreteChanceNode parent as a new parent of this node
std::string getAttribute(std::string& key) const throw(HAPI::ExceptionHugin)
Return the value associated with key in the attribute list for this node
virtual Category getCategory() throw()
Return the node category
Domain* getDomain() const throw(HAPI::ExceptionHugin)
Return the Domain this Node belongs to
JunctionTree* getJunctionTree() const throw(HAPI::ExceptionHugin)
Return the JunctionTree to which this node belongs
virtual Kind getKind() throw(ExceptionHugin)
Return the node kind
std::string getLabel() const throw(HAPI::ExceptionHugin)
Get the label of this node
Model* getModel() throw(HAPI::ExceptionHugin)
Return the Model of this Node
std::string getName() const throw(HAPI::ExceptionHugin)
Retrieve the name of this Node
NodeList getParents() const throw(HAPI::ExceptionHugin)
Return a NodeList with references to the parents of this node
std::pair <long, long> getPosition() const throw(HAPI::ExceptionHugin)
Return the position of the node
void* getUserData() throw(HAPI::ExceptionHugin)
Return the value stored within the user data slot of this node
Constraint getEdgeConstraint( Node *bNode )
Retrieve the learning constraint specifyed for the edge
void setEdgeConstraint( Node *bNode, Constraint C )
Specify constraint for the edge
void generateTable() throw(HAPI::ExceptionHugin )
Generate the conditional probability table for this node, as it is specified by the model (i
std::vector <Attribute*> Node::getAttributes() throw(HAPI::ExceptionHugin )
Returns a vector of attributes associated with this Node
void removeParent(DiscreteChanceNode *parent) throw(HAPI::ExceptionHugin)
Remove the directed link between parent and this node
void setAttribute(std::string& key, std::string& value) throw(HAPI::ExceptionHugin)
Insert the key/value pair in the attribute list for this node
void setLabel(char* label) throw(HAPI::ExceptionHugin)
Set the node label
void setLabel(std::string& label) throw(HAPI::ExceptionHugin)
Set the node label
void setName(char *name) throw(HAPI::ExceptionHugin)
Create a copy of name and assign it to this node
void setName(std::string& name) throw(HAPI::ExceptionHugin)
Create a copy of name and assign it to this node
void setPosition(long x, long y) throw(HAPI::ExceptionHugin)
Set the position of the node
void setPosition(std::pair<long, long> pos) throw(HAPI::ExceptionHugin)
Set the position of the node
void setUserData(void *) throw(HAPI::ExceptionHugin)
The Hugin API provides a data slot within each Node object
Domain* getHomeDomain() const throw(ExceptionHugin)
Get the Domain in which this node is placed
Class* getHomeClass() const throw(ExceptionHugin)
Get the class in which this node is placed
void addToInputs() throw(ExceptionHugin)
Add this Node to the list of input nodes in this Class
void addToOutputs() throw(ExceptionHugin)
Add this Node to the list of output nodes in this Class
void removeFromInputs() throw(ExceptionHugin)
Remove this Node from the list of input nodes in the Class
void removeFromOutputs() throw(ExceptionHugin)
Remove this Node from the list of output nodes in the Class
Node* getInstance() throw(ExceptionHugin)
Returns the InstanceNode containing this (cloned) output node
Node* getMaster() throw(ExceptionHugin)
Returns the "master" of this (cloned) output Node of an InstanceNode (i
NodeList getSource() throw(ExceptionHugin)
Returns a NodeList of Class nodes that identifies this Domain node

Documentation

Nodes are one of the fundamental objects used in the construction of Bayesian belief networks and influence diagrams. All nodes need a Domain* as argument, that is, the domain must exist before nodes can be created into it.
virtual ~Node()
Delete Node. The node is deleted from its domain. If the domain was compiled, the corresponding compiled structure is deleted. All references and pointers to the node become invalid.

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

Parameters:
parent - DiscreteChanceNode*

std::string getAttribute(std::string& key) const throw(HAPI::ExceptionHugin)
Return the value associated with key in the attribute list for this node.

Returns:
Standard C++ Library string containing the attribure value.

virtual Category getCategory() throw()
Return the node category.

Returns:
Category

Domain* getDomain() const throw(HAPI::ExceptionHugin)
Return the Domain this Node belongs to. This Node must reside in an existing Hugin domain.

Returns:
Domain* - A reference to the Domain where this Node resides.

JunctionTree* getJunctionTree() const throw(HAPI::ExceptionHugin)
Return the JunctionTree to which this node belongs.

Returns:
Reference to JunctionTree object.

virtual Kind getKind() throw(ExceptionHugin)
Return the node kind.

Returns:
Kind

std::string getLabel() const throw(HAPI::ExceptionHugin)
Get the label of this node.

Returns:
Standard C++ Library string.

Model* getModel() throw(HAPI::ExceptionHugin)
Return the Model of this Node.

Returns:
Model

std::string getName() const throw(HAPI::ExceptionHugin)
Retrieve the name of this Node. If this node has not previously been assigned a name, a valid name will automatically be assigned.

Returns:
A Standard C++ Library string containing the name of this node.

NodeList getParents() const throw(HAPI::ExceptionHugin)
Return a NodeList with references to the parents of this node. If no parents exist, an empty NodeList is returned.

Returns:
NodeList

std::pair <long, long> getPosition() const throw(HAPI::ExceptionHugin)
Return the position of the node.

Returns:
Standard C++ Library pair<long,long>

void* getUserData() throw(HAPI::ExceptionHugin)
Return the value stored within the user data slot of this node. If the stored value is NULL, or if no value has been stored, NULL is returned. It is the responsibility of the application programmer to ensure that the data is valid, that pointers are accessed correctly, etc. Also note that when you delete a node, Hugin does not attempt to delete the data pointed to by the user data slot. It is the responsibility of the user.

Returns:
void* Pointer stored within the Node object as a reference to user data associated with this node.

Constraint getEdgeConstraint( Node *bNode )
Retrieve the learning constraint specifyed for the edge

void setEdgeConstraint( Node *bNode, Constraint C )
Specify constraint for the edge

void generateTable() throw(HAPI::ExceptionHugin )
Generate the conditional probability table for this node, as it is specified by the model (i.e., the expressions). If one or more expressions are illegal in one way or the other, an expression is thrown.

std::vector <Attribute*> Node::getAttributes() throw(HAPI::ExceptionHugin )
Returns a vector of attributes associated with this Node

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 - Reference to the parent node that will be removed.

void setAttribute(std::string& key, std::string& value) throw(HAPI::ExceptionHugin)
Insert the key/value pair in the attribute list for this node. If key is already defined, the value is updated. If no value is provided, the attribute is removed.

Parameters:
key - A Standard C++ Library string.
value - A Standard C++ Library string.

void setLabel(char* label) throw(HAPI::ExceptionHugin)
Set the node label.

Parameters:
label - char*

void setLabel(std::string& label) throw(HAPI::ExceptionHugin)
Set the node label.

Parameters:
label - std::string

void setName(char *name) throw(HAPI::ExceptionHugin)
Create a copy of name and assign it to this node. name must be a valid name, i.e., it must follow the rules that govern the validity of C identifiers, and no other node in the domain to which <tt>*this</tt> node belongs can have the same name.

Parameters:
name - A pointer to a zero-terminated string containing the desired name of the node.

void setName(std::string& name) throw(HAPI::ExceptionHugin)
Create a copy of name and assign it to this node. name must be a valid name, i.e., it must follow the rules that govern the validity of C identifiers, and no other node in the domain to which <tt>*this</tt> node belongs can have the same name.

Parameters:
name - Standard C++ Library string containing the desired name of the node.

void setPosition(long x, long y) throw(HAPI::ExceptionHugin)
Set the position of the node.

Parameters:
x - The desired x coordinate of the node.
y - The desired y coordinate of the node.

void setPosition(std::pair<long, long> pos) throw(HAPI::ExceptionHugin)
Set the position of the node.

Parameters:
pos - Standard C++ Library pair of longs.

void setUserData(void *) throw(HAPI::ExceptionHugin)
The Hugin API provides a data slot within each Node object. This data slot is for use exclusively by the user/application. This slot can hold a pointer to arbitrary data, such as a file, a display window, an input buffer from hardware sensors, etc. Please note that Hugin does not do anything to the user data. Data is not even copied. Only the pointer to the data is stored.

Parameters:
void - * Pointer to user-defined data associated with this node.

Domain* getHomeDomain() const throw(ExceptionHugin)
Get the Domain in which this node is placed. This function is equivalent to getDomain, and is only here for consistency with getHomeClass.

Class* getHomeClass() const throw(ExceptionHugin)
Get the class in which this node is placed

void addToInputs() throw(ExceptionHugin)
Add this Node to the list of input nodes in this Class. I.e., make this Node an input node.

void addToOutputs() throw(ExceptionHugin)
Add this Node to the list of output nodes in this Class. I.e., make this Node an output node.

void removeFromInputs() throw(ExceptionHugin)
Remove this Node from the list of input nodes in the Class. I.e., make this Node an ordinary node again.

void removeFromOutputs() throw(ExceptionHugin)
Remove this Node from the list of output nodes in the Class. I.e., make this Node an ordinary node again.

Node* getInstance() throw(ExceptionHugin)
Returns the InstanceNode containing this (cloned) output node. Note that we clone all output nodes when we create an InstanceNode. This is done in order to make it possible to specify conditional probability tables involving output nodes from InstanceNode's.
Returns:
The InstanceNode containing this output clone.
See Also:
InstanceNode

Node* getMaster() throw(ExceptionHugin)
Returns the "master" of this (cloned) output Node of an InstanceNode (i.e., the Node cloned to get this output Node). Note that "master" belongs to another Class object. Note also that we clone all output nodes when we create an InstanceNode. This is done in order to make it possible to specify conditional probability tables involving output nodes from InstanceNode's.

Returns:
The "master" of this output clone.

NodeList getSource() throw(ExceptionHugin)
Returns a NodeList of Class nodes that identifies this Domain node.<p>

The createDomain method of the Class class unfolds an object-oriented (nested) specification of a Bayesian network or an influence diagram into a regular Domain object.<p>

Nodes in this Domain which originates from nodes residing in nested sub-networks (via InstanceNodes) can be uniquely related to a sequence of InstanceNodes and an ordinary Node of the object-oriented network.<p>

Returns:
An ordered NodeList with the InstanceNodes and the ordinary Node identifying the source of this Node that must belong to a Domain.


Direct child classes:
UtilityNode
InstanceNode
DiscreteDecisionNode
DiscreteChanceNode
ContinuousChanceNode

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