RBNinference
Class BNNode

java.lang.Object
  extended by RBNinference.BNNode
Direct Known Subclasses:
ComplexBNNode, DummyBNNode, PFNetworkNode, SimpleBNNode

public class BNNode
extends java.lang.Object


Field Summary
 java.util.LinkedList children
           
protected  int depth
           
 int instantiated
           
 java.lang.String name
           
 java.util.LinkedList parents
           
 
Constructor Summary
BNNode()
          Creates new BNNode
BNNode(java.lang.String n)
           
BNNode(java.lang.String n, int val)
           
BNNode(java.lang.String n, java.util.LinkedList par, java.util.LinkedList chil)
           
 
Method Summary
 void addToChildren(BNNode newchild)
          Adds newchild to children if not in children list already
 void addToParents(BNNode newpar)
           
 java.util.Vector buildNodeStack()
           
 int depth()
           
 double familyXcenter()
          Computes the mean of the (current) xcoords of parents and children.
 void instantiate(int truthval)
           
 int instantiatedTo()
           
 boolean parentsSubset(BNNode bnn)
          returns true if this.parents is subset of bnn.parents
 void replaceInChildrenList(BNNode oldchil, BNNode newchil)
           
 void replaceInParentList(BNNode oldpar, BNNode newpar)
           
 void resetParents()
           
 void resetVisited(int ind)
           
 void resetVisitedUpDownstream(int ind)
           
 void resetVisitedUpstream(int ind)
           
 void setDepth(int d)
           
 void showAllReachable()
          Prints names of all nodes connected to this one
 int sizeFamily()
           
static double xSum(java.util.Collection<BNNode> bnnodes)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

public java.lang.String name

parents

public java.util.LinkedList parents

children

public java.util.LinkedList children

instantiated

public int instantiated

depth

protected int depth
Constructor Detail

BNNode

public BNNode()
Creates new BNNode


BNNode

public BNNode(java.lang.String n)

BNNode

public BNNode(java.lang.String n,
              int val)

BNNode

public BNNode(java.lang.String n,
              java.util.LinkedList par,
              java.util.LinkedList chil)
Method Detail

addToChildren

public void addToChildren(BNNode newchild)
Adds newchild to children if not in children list already


addToParents

public void addToParents(BNNode newpar)

buildNodeStack

public java.util.Vector buildNodeStack()

depth

public int depth()

instantiate

public void instantiate(int truthval)

instantiatedTo

public int instantiatedTo()

resetParents

public void resetParents()

replaceInParentList

public void replaceInParentList(BNNode oldpar,
                                BNNode newpar)

replaceInChildrenList

public void replaceInChildrenList(BNNode oldchil,
                                  BNNode newchil)

resetVisited

public void resetVisited(int ind)

resetVisitedUpstream

public void resetVisitedUpstream(int ind)

resetVisitedUpDownstream

public void resetVisitedUpDownstream(int ind)

setDepth

public void setDepth(int d)

showAllReachable

public void showAllReachable()
Prints names of all nodes connected to this one


parentsSubset

public boolean parentsSubset(BNNode bnn)
returns true if this.parents is subset of bnn.parents


sizeFamily

public int sizeFamily()
Since:
20061010

familyXcenter

public double familyXcenter()
Computes the mean of the (current) xcoords of parents and children. Subroutine of balanceLevels Returns -1 if node has no family.


xSum

public static double xSum(java.util.Collection<BNNode> bnnodes)
Since:
20061010