|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectCOM.hugin.HAPI.Node
COM.hugin.HAPI.InstanceNode
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".
Constructor Summary | |
InstanceNode(Class home,
Class instanceOf)
Constructs a new InstanceNode. |
Method Summary | |
void |
delete()
Deletes this InstanceNode. |
NetworkModel.Category |
getCategory()
Returns the Category for this InstanceNode. |
Node |
getInput(Node formalInput)
Returns the actual input node associated with a formal input node for this InstanceNode. |
Class |
getInstanceClass()
Returns the instance Class of this InstanceNode (i.e., the Class on which this InstanceNode is based). |
NetworkModel.Kind |
getKind()
Returns the Kind for this InstanceNode. |
Node |
getOutput(Node output)
Returns the output node of this InstanceNode that is a clone of a given output node of the Class from which this InstanceNode has been instantiated. |
NodeList |
getOutputs()
Returns the output nodes (i.e., output clones) of this InstanceNode. |
void |
setInput(Node formalInput,
Node actualInput)
Binds a node to an input node of this InstanceNode. |
void |
substituteClass(Class newClass)
Replace the class that this instance node represents. |
void |
unsetInput(Node formalInput)
Unbinds an input node of this InstanceNode. |
Methods inherited from class COM.hugin.HAPI.Node |
addParent, addToInputs, addToOutputs, evidenceIsEntered, evidenceIsPropagated, evidenceToPropagate, getAttribute, getAttributes, getChildren, getDomain, getEdgeConstraint, getHome, getHomeClass, getHomeDomain, getInstance, getJunctionTree, getLabel, getMaster, getModel, getName, getParents, getPosition, getSource, getUserData, likelihoodIsEntered, likelihoodIsPropagated, removeFromInputs, removeFromOutputs, removeParent, reverseEdge, setAttribute, setAttributes, setEdgeConstraint, setLabel, setName, setPosition, setUserData, switchParent |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public InstanceNode(Class home, Class instanceOf) throws ExceptionHugin
home
- the home Class of the new InstanceNode.instanceOf
- the Class from which to instantiate the
new InstanceNode.Method Detail |
public NetworkModel.Category getCategory() throws ExceptionObjectNotAlive
getCategory
in class Node
ExceptionObjectNotAlive
public NetworkModel.Kind getKind() throws ExceptionObjectNotAlive
getKind
in class Node
ExceptionObjectNotAlive
public Node getOutput(Node output) throws ExceptionHugin
output
- the output node of the Class from which this
InstanceNode has been instantiated.
ExceptionHugin
public NodeList getOutputs() throws ExceptionHugin
ExceptionHugin
public void setInput(Node formalInput, Node actualInput) throws ExceptionHugin
formalInput
- the formal input node of this
InstanceNode. This node is to be considered a placeholder for
the 'actualInput'.actualInput
- the actual input node to be bound to
'formalInput'. This node must belong to the same Class as this
InstanceNode.
ExceptionHugin
public void unsetInput(Node formalInput) throws ExceptionHugin
formalInput
- the input node to become unbound.
ExceptionHugin
public Node getInput(Node formalInput) throws ExceptionHugin
formalInput
- The formal input node of this
InstanceNode.
ExceptionHugin
public Class getInstanceClass() throws ExceptionHugin
ExceptionHugin
public void delete() throws ExceptionHugin
delete
in class Node
ExceptionHugin
public void substituteClass(Class newClass) throws ExceptionHugin
This operation is only allowed, if the interface of the original class is a true subset of the interface of the given newClass argument.
newClass
- The class that the instance node should
represent.
ExceptionHugin
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |