java.lang.Object
es.upm.fi.cig.multictbnc.nodes.AbstractNode
- All Implemented Interfaces:
Node
- Direct Known Subclasses:
DiscreteStateNode
Abstract class defining common variables and methods for any kind of node.
-
Constructor Summary
ConstructorsConstructorDescriptionAbstractNode(String name) Common initialisation for nodes.AbstractNode(String name, boolean isClassVariable) Common initialisation for nodes. -
Method Summary
Modifier and TypeMethodDescriptionvoidRemove the set of parents and children of the node.booleanReturns the children of the node.getName()Returns the name of the node.intReturns the number of parents of the node.Returns the parents of the node.booleanSpecifies if the node has children.booleanSpecifies if the node has a class variable as parent.booleanSpecifies if the node has a class variable as spouse.inthashCode()booleanSpecifies if the node has parents.booleanSpecifies if the node is a class variable.voidisClassVariable(boolean isClassVariable) Defines if the node is a class variable.booleanSpecifies if the node is disconnected, i.e., it has neither parents or children.booleanSpecifies if the node is in the Markov blanket of at least one class variable.voidRemoves the parents and children of the node.voidremoveChild(Node nodeChild) Removes a certain child of the node.voidRemoves the children of the node.voidremoveParent(Node nodeParent) Removes a certain parent of the node.voidRemoves the parents of the node.voidDefines a provided node as a child of this one.voidDefines a provided node as a parent of this one.toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface es.upm.fi.cig.multictbnc.nodes.Node
areParametersEstimated, estimateLogLikelihood, setSufficientStatistics
-
Constructor Details
-
AbstractNode
Common initialisation for nodes. This constructor initialises the node as not being a class variable, a type of variable that does not appear in those models that are not meant for classification.- Parameters:
name- name of the node
-
AbstractNode
Common initialisation for nodes. This constructor allows specifying if the node is a class variable.- Parameters:
name- name of the nodeisClassVariable- true if the node represents a class variable, false otherwise
-
-
Method Details
-
clearParentAndChildrenSets
public void clearParentAndChildrenSets()Description copied from interface:NodeRemove the set of parents and children of the node. This method should be used with caution, as references to this node from others will not be affected. It is recommended its use when creating an empty PGM, i.e., we are removing all edges between nodes.- Specified by:
clearParentAndChildrenSetsin interfaceNode
-
getChildren
Description copied from interface:NodeReturns the children of the node.- Specified by:
getChildrenin interfaceNode- Returns:
- child node list
-
getName
Description copied from interface:NodeReturns the name of the node. -
getNumParents
public int getNumParents()Description copied from interface:NodeReturns the number of parents of the node.- Specified by:
getNumParentsin interfaceNode- Returns:
- parent node list
-
getParents
Description copied from interface:NodeReturns the parents of the node.- Specified by:
getParentsin interfaceNode- Returns:
- parent node list
-
hasChildren
public boolean hasChildren()Description copied from interface:NodeSpecifies if the node has children.- Specified by:
hasChildrenin interfaceNode- Returns:
trueif the node has children,falseotherwise
-
hasParents
public boolean hasParents()Description copied from interface:NodeSpecifies if the node has parents.- Specified by:
hasParentsin interfaceNode- Returns:
trueif the node has parents,falseotherwise
-
hasClassVariableAsParent
public boolean hasClassVariableAsParent()Description copied from interface:NodeSpecifies if the node has a class variable as parent.- Specified by:
hasClassVariableAsParentin interfaceNode- Returns:
trueif the node has a class variable as parent,falseotherwise
-
hasClassVariableAsSpouse
public boolean hasClassVariableAsSpouse()Description copied from interface:NodeSpecifies if the node has a class variable as spouse.- Specified by:
hasClassVariableAsSpousein interfaceNode- Returns:
trueif the node has a class variable as spouse,falseotherwise
-
isInMarkovBlanketClassVariable
public boolean isInMarkovBlanketClassVariable()Description copied from interface:NodeSpecifies if the node is in the Markov blanket of at least one class variable.- Specified by:
isInMarkovBlanketClassVariablein interfaceNode- Returns:
trueif the node is in the Markov blanket of a class variable,falseotherwise
-
isDisconnected
public boolean isDisconnected()Description copied from interface:NodeSpecifies if the node is disconnected, i.e., it has neither parents or children.- Specified by:
isDisconnectedin interfaceNode- Returns:
trueif the node is disconnected,falseotherwise
-
isClassVariable
public void isClassVariable(boolean isClassVariable) Description copied from interface:NodeDefines if the node is a class variable.- Specified by:
isClassVariablein interfaceNode- Parameters:
isClassVariable-trueif the node is a class variable,falseotherwise
-
isClassVariable
public boolean isClassVariable()Description copied from interface:NodeSpecifies if the node is a class variable.- Specified by:
isClassVariablein interfaceNode- Returns:
trueif the node is a class variable,falseotherwise
-
removeAllEdges
public void removeAllEdges()Description copied from interface:NodeRemoves the parents and children of the node.- Specified by:
removeAllEdgesin interfaceNode
-
removeChild
Description copied from interface:NodeRemoves a certain child of the node.- Specified by:
removeChildin interfaceNode- Parameters:
nodeChild- child node
-
removeChildren
public void removeChildren()Description copied from interface:NodeRemoves the children of the node.- Specified by:
removeChildrenin interfaceNode
-
removeParent
Description copied from interface:NodeRemoves a certain parent of the node.- Specified by:
removeParentin interfaceNode- Parameters:
nodeParent- parent node
-
removeParents
public void removeParents()Description copied from interface:NodeRemoves the parents of the node.- Specified by:
removeParentsin interfaceNode
-
setChild
Description copied from interface:NodeDefines a provided node as a child of this one. -
setParent
Description copied from interface:NodeDefines a provided node as a parent of this one. -
hashCode
public int hashCode() -
equals
-
toString
-