Inheritance diagram for HAPI::InstanceNode:
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). | |
Class * | getClass () 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. | |
Node * | getInput (Node *input) const |
Returns the node, which is bound to the given input. | |
Node * | getOutput (Node *output) const |
Returns the output clone from the instance for the given output node in the class. |
|
Create a new InstanceNode (representing an instance of master) in the given Class (insertIn).
|
|
Return the node category.
Implements HAPI::Node. |
|
Returns the node, which is bound to the given input.
|
|
Returns the output clone from the instance for the given output node in the class.
|
|
Bind an existing node to an input node in an instance.
|
|
Change this node to be an instance of newClass. newClass must be compatible with the original class (i.e., must have the same interface). |
|
Removes a binding to the input node given.
|