public abstract class TreeBuilder extends Object
Modifier and Type | Field and Description |
---|---|
protected int |
max_depth
The level of the last depth (corresponding to the terminal node in widthPerDepth)
|
protected int |
max_terminal
Indicates the maximum count of terminal.
|
protected List<RegulatoryNode> |
nodeOrder |
static String |
PARAM_NODEORDER |
protected int[] |
realDetph
As the omdd diagram could not contain all the levels (some could be skipped...),
we try to reduce the tree width, by assigning a depth to each __used__ level.
|
protected int |
total_levels
The total number of levels that are not skipped
|
protected Tree |
tree |
protected int[] |
widthPerDepth
Indicates for each depth, the sub-total (width) of children or 0 if the depth is not skipped (realDepth == -1).
|
protected int[] |
widthPerDepth_acc
Indicates for each depth, the total (width) of children or 0 if the depth is not skipped (realDepth == -1).
|
Constructor and Description |
---|
TreeBuilder() |
Modifier and Type | Method and Description |
---|---|
protected List<TreeNode> |
addChildren(int j,
int mult,
List<TreeNode> parents,
int childIndex,
int[] currentWidthPerDepth,
EdgeAttributesReader ereader) |
void |
clearTree()
Remove all the vertices from the tree
|
protected void |
computeWidthPerDepthFromRegGraph() |
int |
getMaxDepth() |
int |
getMaxTerminal() |
protected abstract String |
getNodeName(int level)
Return the name of the node at level
|
Object |
getParameter(String key) |
protected int |
getRealDepth(TreeNode node) |
int[] |
getRealDetph() |
int |
getTerminalWidth() |
int |
getTotalLevels() |
int[] |
getWidthPerDepth_acc() |
protected int |
getWidthPerDepth_acc(TreeNode node) |
int[] |
getWidthPerDepth() |
abstract void |
init()
This method is called before parsing the tree.
|
protected int |
jump(int lastLevel,
int maxLevel,
int[] currentWidthPerDepth)
Try to jump over the skipped nodes between lastLevel and maxLevel and fill currentWidthPerDepth accordingly.
|
protected void |
linkNode(TreeNode source,
TreeNode target,
int colorIndex)
Create an edge from source to target
Also set the right color according to colorIndex, and the dashed line if the target is a leaf.
|
abstract void |
parseOmdd() |
void |
run(int treeMode)
Run the parser on the OMDDNode root, and fill the tree.
|
void |
setParameter(String key,
Object value) |
void |
setTree(Tree tree) |
protected String |
tab(int tabs)
Little helper function to write a tree in stdout
|
protected void |
updateLayout(NodeAttributesReader vreader,
TreeNode vertex) |
void |
updateNodeLayout()
Compute the layout for each node in this tree
|
public static final String PARAM_NODEORDER
protected Tree tree
protected List<RegulatoryNode> nodeOrder
protected int max_terminal
protected int[] widthPerDepth
protected int[] widthPerDepth_acc
protected int[] realDetph
protected int total_levels
protected int max_depth
public void run(int treeMode)
treeMode
- the kind of tree to parse (tree, diagram or diagramWithAllleafs)public void setTree(Tree tree)
public abstract void init()
public abstract void parseOmdd()
protected abstract String getNodeName(int level)
level
- the level of the nodepublic void updateNodeLayout()
protected void updateLayout(NodeAttributesReader vreader, TreeNode vertex)
protected void computeWidthPerDepthFromRegGraph()
public void clearTree()
protected String tab(int tabs)
tabs
- the count of tab to outputprotected List<TreeNode> addChildren(int j, int mult, List<TreeNode> parents, int childIndex, int[] currentWidthPerDepth, EdgeAttributesReader ereader)
protected int jump(int lastLevel, int maxLevel, int[] currentWidthPerDepth)
lastLevel
- maxLevel
- currentWidthPerDepth
- protected void linkNode(TreeNode source, TreeNode target, int colorIndex)
source
- target
- colorIndex
- public int[] getWidthPerDepth()
public int[] getWidthPerDepth_acc()
public int getMaxTerminal()
public int getMaxDepth()
public int[] getRealDetph()
public int getTerminalWidth()
public int getTotalLevels()
protected int getRealDepth(TreeNode node)
protected int getWidthPerDepth_acc(TreeNode node)
Copyright © 2005–2020. All rights reserved.