|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectDtree
public class Dtree
This class represents dtree objects.
Nested Class Summary | |
---|---|
static class |
Dtree.Create
Each instantiation of this class represents a way of generating dtrees. |
static class |
Dtree.DtreeComparatorHeightLowToHigh
This comparator will first sort based on height, then on hashCode, and then try a few different things before returning 0. |
static class |
Dtree.DtreeCreationException
|
Field Summary | |
---|---|
CreationMethod |
myCreationMethod
|
Constructor Summary | |
---|---|
Dtree(DirectedGraph dag,
Dtree.Create createAlgo)
Create a Dtree using the createAlgo algorithm and the DirectedGraph dag. |
|
Dtree(DtreeNode inRoot)
Create a Dtree with inRoot as the root of the tree. |
|
Dtree(Map varToFamily,
Dtree.Create createAlgo)
Create a Dtree using the createAlgo algorithm. |
Method Summary | |
---|---|
static Collection |
colOfColOfFVarsToColDtreeNodes(Map varToFamily,
Collection ret)
Convert a Collection of Collections of FiniteVariables (Collection of Families or UndirectedEdges) to a Collection of DtreeNodes. |
static Map |
convertDAGtoMap(DirectedGraph dag,
Map varToFamily)
Convert a DirectedGraph to a Map from a FiniteVariable to a collection of FiniteVariables (its family, & itself). |
int |
getClusterSize()
|
int |
getContextSize()
|
int |
getCutsetSize()
|
void |
getElimOrder(ArrayList ord)
|
int |
getHeight()
|
static String |
getTagName()
|
static Collection |
getVars(Collection A)
Get all the vars contained within a collection of DtreeNodes. |
static Collection |
getVars(Collection A,
Collection ret)
Get all the vars contained within a collection of DtreeNodes. |
int |
getWidth()
Same as getClusterSize - 1. |
void |
populate()
|
DtreeNode |
root()
|
static Dtree |
selectBestDtree(Dtree n1,
Dtree n2)
Will determine which dtree is better and return it. |
String |
toString()
|
void |
unpopulate()
|
void |
write(File ofile)
|
void |
write(Writer out)
|
void |
write(Writer out,
CharArrayWriter outtmp)
|
void |
writeToDOTFile(Writer out)
Writes this Dtree to a DOT file. |
void |
writeToVCGFile(Writer out)
Writes this Dtree to a VCG file. |
Methods inherited from class Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public CreationMethod myCreationMethod
Constructor Detail |
---|
public Dtree(DtreeNode inRoot)
Dtree.DtreeCreationException
- if inRoot is null.public Dtree(DirectedGraph dag, Dtree.Create createAlgo)
dag
- A DirectedGraph to create the Dtree from.createAlgo
- The algorithm to use.
Dtree.DtreeCreationException
- if could not create a Dtree.public Dtree(Map varToFamily, Dtree.Create createAlgo)
varToFamily
- A Map of a FiniteVariable to a Collection of FiniteVariables (Its Family, including itself).
(These Collections will be used and modified, so pass copies of anything that cannot
be changed.)createAlgo
- The algorithm to use.
Dtree.DtreeCreationException
- if could not create a Dtree.Method Detail |
---|
public String toString()
toString
in class Object
public DtreeNode root()
public int getCutsetSize()
public int getContextSize()
public int getClusterSize()
public int getWidth()
public int getHeight()
public void getElimOrder(ArrayList ord)
public void populate()
public void unpopulate()
public static Collection getVars(Collection A)
public static Collection getVars(Collection A, Collection ret)
public static String getTagName()
public void write(File ofile) throws IOException
IOException
public void write(Writer out) throws IOException
IOException
public void write(Writer out, CharArrayWriter outtmp) throws IOException
IOException
public void writeToVCGFile(Writer out) throws IOException
out
- The file to write the object to.
IOException
- if there is a file error.public void writeToDOTFile(Writer out) throws IOException
out
- The file to write the object to.
IOException
- if there is a file error.public static Dtree selectBestDtree(Dtree n1, Dtree n2)
public static Map convertDAGtoMap(DirectedGraph dag, Map varToFamily)
varToFamily
- The Map which will be returned (if null, a new HashMap
will be created and returned with the result).public static Collection colOfColOfFVarsToColDtreeNodes(Map varToFamily, Collection ret)
varToFamily
- A Map of a FiniteVariable to a Collection of FiniteVariables (Its Family, including itself).
(These Collections will be used and modified, so pass copies of anything that cannot
be changed.)ret
- The Collection to add the DtreeNodes to and return (can be null
in which case a new Collection will be created).
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |