edu.ucla.belief.dtree
Class DtreeNodeLeaf

Object
  extended by DtreeNode
      extended by DtreeNodeLeaf

public class DtreeNodeLeaf
extends DtreeNode

This class represents family dtree leaf nodes.


Constructor Summary
DtreeNodeLeaf(Collection vars, FiniteVariable child)
          Creates a new DtreeNodeLeaf using the Collection vars.
 
Method Summary
 FiniteVariable child()
           
 int getHeight()
          This height is calculated by how many levels of nodes there are, not by how many edges there are between them.
 Collection getLargestCluster(int largest)
          Returns the largest cluster (actually the first it finds which is at least as big as the parameter largest).
 int getNumberInternalNodes()
          Returns the number of internal nodes including (possibly) this one and all below it.
 int getNumberLeafNodes()
          Returns the number of leaf nodes including (possibly) this one and all below it.
 boolean isLeaf()
           
 void populate(Collection acutset)
          Should only be called through dtree.
 String toString()
           
 void writeToParenFile(Writer out)
           
 
Methods inherited from class DtreeNode
containsVar, getCluster, getContext, getCutset, getNumberNodes, getVars, hashCodeSpecial
 
Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DtreeNodeLeaf

public DtreeNodeLeaf(Collection vars,
                     FiniteVariable child)
Creates a new DtreeNodeLeaf using the Collection vars.

Parameters:
vars - A Collection of FiniteVariables. (This Collection will be used and modified, so pass copies of anything that cannot be changed.)
Method Detail

toString

public String toString()
Overrides:
toString in class Object

isLeaf

public boolean isLeaf()
Specified by:
isLeaf in class DtreeNode

child

public FiniteVariable child()

populate

public void populate(Collection acutset)
Description copied from class: DtreeNode
Should only be called through dtree. Sets cutset and context.


getNumberInternalNodes

public int getNumberInternalNodes()
Description copied from class: DtreeNode
Returns the number of internal nodes including (possibly) this one and all below it.

Specified by:
getNumberInternalNodes in class DtreeNode

getNumberLeafNodes

public int getNumberLeafNodes()
Description copied from class: DtreeNode
Returns the number of leaf nodes including (possibly) this one and all below it.

Specified by:
getNumberLeafNodes in class DtreeNode

getLargestCluster

public Collection getLargestCluster(int largest)
Description copied from class: DtreeNode
Returns the largest cluster (actually the first it finds which is at least as big as the parameter largest).

Specified by:
getLargestCluster in class DtreeNode

getHeight

public int getHeight()
Description copied from class: DtreeNode
This height is calculated by how many levels of nodes there are, not by how many edges there are between them. (e.g. leaf nodes have height of 1, their parents have a height of 2...)

Specified by:
getHeight in class DtreeNode

writeToParenFile

public void writeToParenFile(Writer out)
                      throws IOException
Throws:
IOException
Since:
121302


Copyright 2010 UCLA Automated Reasoning Group