Main Page   Class Hierarchy   Alphabetical List   Compound List   Compound Members  

HAPI::InstanceNode Class Reference

Inheritance diagram for HAPI::InstanceNode:

HAPI::Node List of all members.

Detailed Description

InstanceNodes are the key building block of object-oriented Bayesian networks and influence diagrams.

An InstanceNode represents an instance of a Class (i.e., a Bayesian network or an influence diagram). In other words, an instance node represents a subnetwork. The Class of which InstanceNodes exist in other Classes can itself contain InstanceNodes, whereby an object-oriented network can be viewed as a hierarchical description of a problem domain. Describing a network in a hierarchical fashion often makes the network much less cluttered, and thus provides a much better means of communicating ideas among knowledge engineers and users.

As systems often are composed of collections of identical or similar components, models of systems often contain repetitive patterns. The notion of InstanceNodes makes it very easy to construct multiple identical instances of a network fragment.

An InstanceNode is connected to other nodes via its interface nodes, which are the input Nodes and the output Nodes of the Class of which the InstanceNode is an instance. Chance nodes and decision nodes of the encapsulating Class (i.e., network) as well as output nodes of InstanceNodes of the encapsulating Class can be bound to input nodes of an InstanceNode.

As the output nodes of an InstanceNode can be parents of non-InstanceNodes, these output nodes are represented in the "home Class" of the InstanceNode as clones of the output nodes of the "instance Class" of the InstanceNode. Therefore, the output nodes of InstanceNodes are sometimes referred to as "output clones".


Public Member Functions

 InstanceNode (Class *master, Class *insertIn)
 Create a new InstanceNode (representing an instance of master) in the given Class (insertIn).

ClassgetClass () const
 Get the class, from which this instance was derived.

void substituteClass (Class *newClass)
 Change this node to be an instance of newClass.

Category getCategory () const
 Return the node category.

Kind getKind () const
 Return the node kind.

void setInput (Node *input, Node *node)
 Bind an existing node to an input node in an instance.

void unsetInput (Node *input)
 Removes a binding to the input node given.

NodegetInput (Node *input) const
 Returns the node, which is bound to the given input.

NodegetOutput (Node *output) const
 Returns the output clone from the instance for the given output node in the class.


Constructor & Destructor Documentation

HAPI::InstanceNode::InstanceNode Class master,
Class insertIn
 

Create a new InstanceNode (representing an instance of master) in the given Class (insertIn).

Parameters:
master The class which the InstanceNode is an instance of
insertIn The class in which the InstanceNode is inserted
Returns:
the new InstanceNode


Member Function Documentation

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

Return the node category.

Returns:
Category

Implements HAPI::Node.

Node* HAPI::InstanceNode::getInput Node input  )  const
 

Returns the node, which is bound to the given input.

Parameters:
input The input node in the instance, whose bound node is returned.

Node* HAPI::InstanceNode::getOutput Node output  )  const
 

Returns the output clone from the instance for the given output node in the class.

Parameters:
output An output node from a class, whose output clone, from an instance, is returned.

void HAPI::InstanceNode::setInput Node input,
Node node
 

Bind an existing node to an input node in an instance.

Parameters:
input The input node in the instance which is to be bound.
node The node which is bound to the input node.

void HAPI::InstanceNode::substituteClass Class newClass  ) 
 

Change this node to be an instance of newClass.

newClass must be compatible with the original class (i.e., must have the same interface).

void HAPI::InstanceNode::unsetInput Node input  ) 
 

Removes a binding to the input node given.

Parameters:
input The input node in the instance, which must be unbound


Copyright Hugin Expert A/S 1993-2004