HAPI::InstanceNode Class Reference

InstanceNodes are the key building block of object-oriented Bayesian networks and LIMIDs. More...

Inheritance diagram for HAPI::InstanceNode:
HAPI::Node

List of all members.

Public Member Functions

InstanceNodeclone () const
 Clone this InstanceNode object.
Category getCategory () const
 Return the node category.
ClassgetClass () const
 Get the class from which this instance was created.
NodegetInput (Node *input) const
 Returns the node, which is bound to the given input.
Kind getKind () const
 Return the node kind.
NodegetOutput (Node *output) const
 Returns the output clone from the instance for the given output node in the class.
 InstanceNode (Class *master, Class *insertIn)
 Create a new InstanceNode (representing an instance of master) in the given Class (insertIn).
void setInput (Node *input, Node *node)
 Bind an existing node to an input node in an instance.
void substituteClass (Class *newClass)
 Change this node to be an instance of newClass.
void unsetInput (Node *input)
 Removes a binding to the input node given.

Detailed Description

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

An InstanceNode represents an instance of a Class (i.e., a Bayesian network or a LIMID). 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".


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

InstanceNode* HAPI::InstanceNode::clone (  )  const [virtual]

Clone this InstanceNode object.

Implements HAPI::Node.

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

Return the node category.

Returns:
H_CATEGORY_INSTANCE

Implements HAPI::Node.

Class* HAPI::InstanceNode::getClass (  )  const

Get the class from which this instance was created.

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.
Kind HAPI::InstanceNode::getKind (  )  const [inline, virtual]

Return the node kind.

Returns:
H_KIND_OTHER

Implements HAPI::Node.

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-2010