Class NodeRelations
java.lang.Object
de.aristaflow.adept2.model.processmodel.tools.NodeRelations
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThis represents the relation between two nodes. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionNodeRelations(Template template) Create a new NodeRelations object for the given template. -
Method Summary
Modifier and TypeMethodDescriptionbooleanatLeastOneIsExecutedBefore(Collection<Integer> optionalPreds, int nodeID) Determines that at least one of the designated preceding nodes is really executed before the designated reading node.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.Print stats.static booleanisBefore(NodeRelations.NodeRelation nodeRelation) protected static booleannodesAreOnDifferentBranchesOfSplit(Template template, int nodeID1, int nodeID2, int commonSplitNodeID) Returns true, if the given nodes are on different branches relative to the given split node.
-
Field Details
-
logger
my logger
-
-
Constructor Details
-
NodeRelations
Create a new NodeRelations object for the given template.- Parameters:
template-
-
-
Method Details
-
getNodeRelation
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:
-
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 \ ... n2FIXME this is just quick'n'dirty low-performance garbage code, rewrite- Parameters:
template- TODOnodeID1-nodeID2-commonSplitNodeID-- Returns:
-
isBefore
-
getStatsString
Print stats. -
atLeastOneIsExecutedBefore
Determines that at least one of the designated preceding nodes is really executed before the designated reading node. The designated preceding nodes may be in an alternative branch and thus only executed "optionally". The reason behind this is that the designated node reads a data element mandatorily which is written by the designated preceding nodes. So each execution path has to contain at least one of these preceding nodes to ensure the data element has been written.- Parameters:
optionalPreds- Predecessors of node, which have an OPTIONAL before relation to node and which write the data element.nodeID- ID of the node which reads the data element.- Returns:
- Whether all execution paths to the designated reading nodes contains at least one of the designated preceding nodes.
-