Class NodeRelations


  • public class NodeRelations
    extends Object
    Class which allows for work on execution orders between nodes. FIXME must handle or join of and-or-blocks like and-joins(!) Requires: correct branch IDs, topological order.
    Author:
    Kevin Goeser
    • Field Detail

      • logger

        protected final Logger logger
        my logger
    • Constructor Detail

      • NodeRelations

        public NodeRelations​(Template template)
        Create a new NodeRelations object for the given template.
        Parameters:
        template -
    • Method Detail

      • getNodeRelation

        public NodeRelations.NodeRelation getNodeRelation​(int nodeID1,
                                                          int nodeID2)
        Get the BEFORE relation between the given nodes, or what the relation is like, if node1 is not before node2.
        Parameters:
        nodeID1 - The first node, preferably it is before node2.
        nodeID2 - The second node, preferable after node1.
        Returns:
        The relation between node1 and node2.
        See Also:
        NodeRelations(Template)
      • nodesAreOnDifferentBranchesOfSplit

        protected static boolean nodesAreOnDifferentBranchesOfSplit​(Template template,
                                                                    int nodeID1,
                                                                    int nodeID2,
                                                                    int commonSplitNodeID)
        Returns true, if the given nodes are on different branches relative to the given split node.
         false:
                n1          n2
              /    \      /   \
            x ----- x ---x-----x--...
           /
         sn --- ...
        
        
         true:
             ... n1
            /
         sn
            \
             ... n2
         
        FIXME this is just quick'n'dirty low-performance garbage code, rewrite
        Parameters:
        template - TODO
        nodeID1 -
        nodeID2 -
        commonSplitNodeID -
        Returns:
      • getStatsString

        public String getStatsString()
        Print stats.
      • atLeastOneIsExecutedBefore

        public boolean atLeastOneIsExecutedBefore​(HashSet<Integer> optionalPreds,
                                                  int nodeID)
        Returns true, if one of the predecessors is executed for sure. TODO re-check if complete / partly re-code / optimize
        Parameters:
        optionalPreds - Predecessors of node, which have an OPTIONAL before relation to node.
        nodeID -
        Returns: