|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectCOM.hugin.HAPI.Node
Nodes are one of the fundamental objects used in the construction of Bayesian networks and LIMIDs. All nodes need a NetworkModel (i.e., a Class or a Domain); that is, the network must exist before its nodes can be created.
Method Summary | |
void |
addParent(Node newParent)
Adds a node as a new parent of this Node. |
void |
addToInputs()
Makes this Node become an input node of its Class . |
void |
addToOutputs()
Makes this Node become an output node of its Class . |
java.lang.Object |
clone()
Clones this node. |
void |
delete()
Deletes this Node. |
boolean |
evidenceIsEntered()
Returns true if the evidence potential, currently
registered with this Node, is non-vacuous; otherwise, returns
false . |
boolean |
evidenceIsPropagated()
Returns true if the evidence potential for this
Node, incorporated within the current junction tree potentials,
is non-vacuous; otherwise, returns false . |
boolean |
evidenceToPropagate()
Returns true if the entered and the propagated
evidence differ; otherwise, returns false . |
java.lang.String |
getAttribute(java.lang.String key)
Returns the value associated with a particular attribute in the attribute list for this Node. |
java.util.LinkedList |
getAttributes()
Returns a LinkedList of attributes associated with this Node. |
abstract NetworkModel.Category |
getCategory()
Returns the Category of this Node. |
NodeList |
getChildren()
Returns a NodeList with the child Nodes of this Node. |
Domain |
getDomain()
Deprecated. Replaced by getHomeDomain() . |
NetworkModel.Constraint |
getEdgeConstraint(Node node)
Returns the constraint between this and node. |
NetworkModel |
getHome()
Returns the Class or Domain containing this Node. |
Class |
getHomeClass()
Returns the Class containing this Node. |
Domain |
getHomeDomain()
Returns the Domain containing this Node. |
Node |
getInstance()
Returns the InstanceNode containing this
(cloned) output node. |
JunctionTree |
getJunctionTree()
Returns the JunctionTree to which this Node belongs. |
abstract NetworkModel.Kind |
getKind()
Returns the Kind of this Node. |
java.lang.String |
getLabel()
Returns the label of this Node. |
Node |
getMaster()
Returns the "master" of this (cloned) output Node of an InstanceNode (i.e., the Node cloned to get this
output Node). |
Model |
getModel()
Returns the Model for this Node. |
java.lang.String |
getName()
Returns the name of this Node. |
NodeList |
getParents()
Returns a NodeList with the parents of this Node. |
java.awt.geom.Point2D |
getPosition()
Returns the position of this Node. |
NodeList |
getSource()
Returns a NodeList of Class nodes that identifies this Domain node. |
Table |
getTable()
Returns the table associated with this Node. |
java.lang.Object |
getUserData()
Returns the value stored within the user data slot of this node. |
boolean |
isAlive()
Is this Node object alive? |
boolean |
likelihoodIsEntered()
Returns true if the evidence potential, currently
registered with this Node, is a likelihood; otherwise, returns
false . |
boolean |
likelihoodIsPropagated()
Returns true if the evidence potential for this
Node, incorporated within the current junction tree potentials,
a likelihood; otherwise, returns false . |
void |
removeFromInputs()
Removes this Node from the set of input nodes of its class. |
void |
removeFromOutputs()
Removes this Node from the set of output nodes of its Class. |
void |
removeParent(Node parent)
Removes the directed link between a parent and this Node. |
void |
reverseEdge(Node node)
Reverses the edge between this Node and the specified neighbor. |
void |
setAttribute(java.lang.String key,
java.lang.String value)
Sets a value for a particular attribute in the attribute list for this Node. |
void |
setAttributes(java.util.LinkedList attributes)
Sets the attributes of this Node to attributes ,
which must be a LinkedList of Attribute objects. |
void |
setEdgeConstraint(Node node,
NetworkModel.Constraint constraint)
Sets a constraint between this Node and another Node. |
void |
setLabel(java.lang.String newLabel)
Sets the label of this Node. |
void |
setName(java.lang.String newName)
Sets the name of this Node. |
void |
setPosition(java.awt.geom.Point2D p)
Sets the position of this Node. |
void |
setUserData(java.lang.Object data)
Sets some user-defined data for this Node. |
void |
switchParent(Node oldParent,
Node newParent)
Replace the given parent node with the new node. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
java.lang.CloneNotSupportedException
public void addParent(Node newParent) throws ExceptionHugin
newParent
- the new parent Node.
ExceptionHugin
public void reverseEdge(Node node) throws ExceptionHugin
node
- the neighbor in question.
ExceptionHugin
public void removeParent(Node parent) throws ExceptionHugin
parent
- the parent Node that will be removed.
ExceptionHugin
public void switchParent(Node oldParent, Node newParent) throws ExceptionHugin
newParent
- The new parentoldParent
- The old parent
ExceptionHugin
public abstract NetworkModel.Category getCategory()
public abstract NetworkModel.Kind getKind()
public java.lang.String getLabel() throws ExceptionHugin
ExceptionHugin
public java.lang.String getName() throws ExceptionHugin
ExceptionHugin
public JunctionTree getJunctionTree() throws ExceptionHugin
ExceptionHugin
public NodeList getParents() throws ExceptionHugin
ExceptionHugin
public NodeList getChildren() throws ExceptionHugin
ExceptionHugin
public java.awt.geom.Point2D getPosition() throws ExceptionHugin
ExceptionHugin
public java.lang.Object getUserData()
public boolean evidenceIsEntered() throws ExceptionHugin
true
if the evidence potential, currently
registered with this Node, is non-vacuous; otherwise, returns
false
.
ExceptionHugin
public boolean evidenceIsPropagated() throws ExceptionHugin
true
if the evidence potential for this
Node, incorporated within the current junction tree potentials,
is non-vacuous; otherwise, returns false
.
ExceptionHugin
public boolean likelihoodIsEntered() throws ExceptionHugin
true
if the evidence potential, currently
registered with this Node, is a likelihood; otherwise, returns
false
.
ExceptionHugin
public boolean likelihoodIsPropagated() throws ExceptionHugin
true
if the evidence potential for this
Node, incorporated within the current junction tree potentials,
a likelihood; otherwise, returns false
.
ExceptionHugin
public boolean evidenceToPropagate() throws ExceptionHugin
true
if the entered and the propagated
evidence differ; otherwise, returns false
.
ExceptionHugin
public java.lang.String getAttribute(java.lang.String key) throws ExceptionHugin
key
- a String identifying the attribute in question.
ExceptionHugin
setAttribute
public void setAttribute(java.lang.String key, java.lang.String value) throws ExceptionHugin
key
- a String identifying the attribute in question.value
- a String containing the attribute value.
ExceptionHugin
getAttribute
public java.util.LinkedList getAttributes() throws ExceptionHugin
ExceptionHugin
public void setAttributes(java.util.LinkedList attributes) throws ExceptionHugin
attributes
,
which must be a LinkedList of Attribute objects.
ExceptionHugin
public void delete() throws ExceptionHugin
ExceptionHugin
public boolean isAlive()
public void setLabel(java.lang.String newLabel) throws ExceptionHugin
newLabel
- the label (a String).
ExceptionHugin
public void setName(java.lang.String newName) throws ExceptionHugin
newName
- the name of the Node (a String).
ExceptionHugin
public void setPosition(java.awt.geom.Point2D p) throws ExceptionHugin
p
- the desired (x,y) coordinates of the Node (a Point2D).
ExceptionHugin
public void setUserData(java.lang.Object data)
data
- an Object contaning the user-defined data
associated with this Node.public Table getTable() throws ExceptionHugin
ExceptionHugin
public Model getModel() throws ExceptionHugin
ExceptionHugin
public NetworkModel getHome() throws ExceptionHugin
ExceptionHugin
public Class getHomeClass() throws ExceptionHugin
null
if the Node belongs to a Domain.
ExceptionHugin
public Domain getHomeDomain() throws ExceptionHugin
null
if the Node belongs to a Class.
ExceptionHugin
public Domain getDomain() throws ExceptionHugin
getHomeDomain()
.
ExceptionHugin
public void setEdgeConstraint(Node node, NetworkModel.Constraint constraint) throws ExceptionHugin
node
- the second node in the constraint.constraint
- the NetworkModel.Constraint to be set.
ExceptionHugin
public NetworkModel.Constraint getEdgeConstraint(Node node) throws ExceptionHugin
node
- the second node in the constraint.
ExceptionHugin
public Node getMaster() throws ExceptionHugin
InstanceNode
(i.e., the Node cloned to get this
output Node). Note that "master" belongs to another Class
object. Note also that we clone all output nodes
when we create an InstanceNode. This is done in order to make
it possible to specify conditional probability tables involving
output nodes from InstanceNode's.
ExceptionHugin
public Node getInstance() throws ExceptionHugin
InstanceNode
containing this
(cloned) output node. Note that we clone all output nodes when
we create an InstanceNode. This is done in order to make it
possible to specify conditional probability tables involving
output nodes from InstanceNode's.
ExceptionHugin
public void addToOutputs() throws ExceptionHugin
Class
. The Node must not already be an output or input
Node of its Class.
ExceptionHugin
public void removeFromOutputs() throws ExceptionHugin
ExceptionHugin
public void addToInputs() throws ExceptionHugin
Class
. The node must not already be an input or output
node of its Class, it must not be an output clone associated
with an InstanceNode, and, most importantly, it must not have
parents.
ExceptionHugin
public void removeFromInputs() throws ExceptionHugin
ExceptionHugin
public NodeList getSource() throws ExceptionHugin
The createDomain
method of the
Class class unfolds an object-oriented (nested) specification
of a Bayesian network or a LIMID into a regular Domain
object.
Nodes in this Domain which originates from nodes residing in nested sub-networks (via InstanceNodes) can be uniquely related to a sequence of InstanceNodes and an ordinary Node of the object-oriented network.
ExceptionHugin
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |