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
 
  • Constructor Details

    • SequenceForwardOrder

      public SequenceForwardOrder(List<Node<?,?>> list)
      Constructor
      Parameters:
      list - Input list, not modified.
  • Method Details

    • putIntoForwardOrder

      public List<Node<?,?>> 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

      protected SequenceForwardOrder.NodeData findInput()
      Finds the input node. Throws an error if there isn't one and only one input node
      Returns:
      Input node