InstanceNodes are the key building block of object-oriented Bayesian networks and LIMIDs. More...
Public Member Functions | |
InstanceNode * | clone () const |
Clone this InstanceNode object. | |
Category | getCategory () const |
Return the node category. | |
Class * | getClass () const |
Get the class from which this instance was created. | |
Node * | getInput (Node *input) const |
Returns the node, which is bound to the given input. | |
Kind | getKind () const |
Return the node kind. | |
Node * | getOutput (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. |
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".
Create a new InstanceNode (representing an instance of master) in the given Class (insertIn).
master | The class which the InstanceNode is an instance of | |
insertIn | The class in which the InstanceNode is inserted |
InstanceNode* HAPI::InstanceNode::clone | ( | ) | const [virtual] |
Clone this InstanceNode object.
Implements HAPI::Node.
Category HAPI::InstanceNode::getCategory | ( | ) | const [inline, virtual] |
Class* HAPI::InstanceNode::getClass | ( | ) | const |
Get the class from which this instance was created.
Returns the node, which is bound to the given input.
input | The input node in the instance, whose bound node is returned. |
Kind HAPI::InstanceNode::getKind | ( | ) | const [inline, virtual] |
Returns the output clone from the instance for the given output node in the class.
output | An output node from a class, whose output clone, from an instance, is returned. |
Bind an existing node to an input node in an instance.
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.
input | The input node in the instance, which must be unbound |