unbbayes.util
Class GraphLayoutUtil
java.lang.Object
unbbayes.util.GraphLayoutUtil
public class GraphLayoutUtil
- extends Object
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
network
protected Network network
graphLevelMatrix
protected List<List<Node>> graphLevelMatrix
nodeIndexMap
protected HashMap<Node,Integer> nodeIndexMap
nodeAddedList
protected boolean[] nodeAddedList
nodeLevelList
protected int[] nodeLevelList
GraphLayoutUtil
public GraphLayoutUtil(Network network)
doLayout
public void doLayout()
createGraphLevelMatrix
protected void createGraphLevelMatrix()
- Creates the queue of the nodes that are going to be analyzed.
wereAllNodesAdded
protected boolean wereAllNodesAdded()
initGraphLevelMatrix
protected void initGraphLevelMatrix()
- Initializes the queue with the nodes that are root. In other words.
It will put in the queue the nodes that do not have parents.
- Parameters:
nodeAddedList
- Keeps track of the nodes that have already been added to the queue (nodeAddedList[nodeIndex]=true).
addChildrenToNextLevel
protected boolean addChildrenToNextLevel(ArrayList<Node> children,
List<Node> nodeList)
- Take the children of a node that have already been added to the queue. Analyze them
one by one and add the child that is not in the queue yet.
- Parameters:
children
- Children of a node that is already in the queue.nodeAddedList
- Nodes that have already been added to the queue.
Copyright © 2001-2010 University of Brasilia - UnB. All Rights Reserved.