Package deepboof.graph
Class SequenceForwardOrder
java.lang.Object
deepboof.graph.SequenceForwardOrder
public class SequenceForwardOrder extends Object
Orders an unsorted list of nodes so that they can be processed in sequence and have all of their dependencies meet
prior to being invoked. The graph must not have islands or cycles. Some sanity checking is done to
ensure that these preconditions are meet, but not all situations are currently caught.
Assumptions: - One input node - One output node - No islands - No cycles
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSequenceForwardOrder.NodeData -
Constructor Summary
Constructors Constructor Description SequenceForwardOrder(List<Node<?,?>> list)Constructor -
Method Summary
Modifier and Type Method Description protected voidassignDepth()Assigns a depth from the input node for all the elements in the graph.protected SequenceForwardOrder.NodeDatafindInput()Finds the input node.List<Node<?,?>>putIntoForwardOrder()Orders list to ensure sequential forward ordering of nodes.
-
Constructor Details
-
SequenceForwardOrder
Constructor- Parameters:
list- Input list, not modified.
-
-
Method Details
-
putIntoForwardOrder
Orders list to ensure sequential forward ordering of nodes.- Returns:
- Ordered list of nodes.
-
assignDepth
protected void assignDepth()Assigns a depth from the input node for all the elements in the graph. Depth is defined as the distance of the longest path to the node. -
findInput
Finds the input node. Throws an error if there isn't one and only one input node- Returns:
- Input node
-