public abstract class TopologicalSorterBasis
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.util.List<EdgeInterface> |
f_allEdges |
protected java.util.List<NodeInterface> |
f_allNodes |
protected java.util.List<EdgeInterface> |
f_backwardsEdges |
protected AbstractModelAdapter |
f_model |
protected java.util.List<NodeInterface> |
f_removedYourEdge |
protected java.util.List<NodeInterface> |
f_selectedNodes |
protected java.util.List<NodeInterface> |
f_sortedNodes |
Constructor and Description |
---|
TopologicalSorterBasis(AbstractModelAdapter copy) |
Modifier and Type | Method and Description |
---|---|
protected int |
getInDegree(NodeInterface curr) |
AbstractModelAdapter |
getModel()
the given processModel, with reversed edges.
|
protected int |
getOutDegree(NodeInterface curr) |
java.util.List<NodeInterface> |
getSortedNodes()
a list with all nodes in the topologically sorted order
|
protected void |
initLists(AbstractModelAdapter model)
initialises starting lists
|
protected boolean |
isCyclic(NodeInterface n) |
protected boolean |
isCyclicR(NodeInterface current,
java.util.LinkedList<NodeInterface> visited) |
protected void |
removeIncomingEdges(NodeInterface n)
removes all outgoing edges of Node n from the list
|
protected void |
removeOutgoingEdges(NodeInterface n)
removes all outgoing edges of Node n from the list
|
void |
restoreEdges()
restores the original direction of all edges
|
protected void |
selectEndNodes()
puts all nodes into the f_SelectedNodes Nodelist, which
have an OutFlow = 0
|
protected void |
selectStartNodes()
puts all nodes into the f_SelectedNodes Nodelist, which
have an InFlow = 0
|
protected NodeInterface |
switchEdge(EdgeInterface processEdge)
reverses the edge to break cycles.
|
protected AbstractModelAdapter f_model
protected java.util.List<EdgeInterface> f_allEdges
protected java.util.List<NodeInterface> f_allNodes
protected java.util.List<NodeInterface> f_selectedNodes
protected java.util.List<NodeInterface> f_sortedNodes
protected java.util.List<EdgeInterface> f_backwardsEdges
protected java.util.List<NodeInterface> f_removedYourEdge
public TopologicalSorterBasis(AbstractModelAdapter copy)
protected int getOutDegree(NodeInterface curr)
curr
- protected int getInDegree(NodeInterface curr)
curr
- public java.util.List<NodeInterface> getSortedNodes()
public AbstractModelAdapter getModel()
protected boolean isCyclic(NodeInterface n)
n
- protected boolean isCyclicR(NodeInterface current, java.util.LinkedList<NodeInterface> visited)
protected NodeInterface switchEdge(EdgeInterface processEdge)
processEdge
- protected void initLists(AbstractModelAdapter model)
model
- protected void selectStartNodes()
protected void selectEndNodes()
protected void removeOutgoingEdges(NodeInterface n)
n
- protected void removeIncomingEdges(NodeInterface n)
n
- public void restoreEdges()