Class NodeRelations
- java.lang.Object
- 
- de.aristaflow.adept2.model.processmodel.tools.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.
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classNodeRelations.NodeRelationThis represents the relation between two nodes.
 - 
Constructor SummaryConstructors Constructor Description NodeRelations(Template template)Create a new NodeRelations object for the given template.
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanatLeastOneIsExecutedBefore(Collection<Integer> optionalPreds, int nodeID)Determines that at least one of the designated preceding nodes is really executed before the designated reading node.NodeRelations.NodeRelationgetNodeRelation(int nodeID1, int nodeID2)Get the BEFORE relation between the given nodes, or what the relation is like, if node1 is not before node2.StringgetStatsString()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 Detail- 
loggerprotected final Logger logger my logger
 
- 
 - 
Constructor Detail- 
NodeRelationspublic NodeRelations(Template template) Create a new NodeRelations object for the given template.- Parameters:
- template-
 
 
- 
 - 
Method Detail- 
getNodeRelationpublic 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)
 
 - 
nodesAreOnDifferentBranchesOfSplitprotected 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- TODO
- nodeID1-
- nodeID2-
- commonSplitNodeID-
- Returns:
 
 - 
isBeforepublic static boolean isBefore(NodeRelations.NodeRelation nodeRelation) 
 - 
getStatsStringpublic String getStatsString() Print stats.
 - 
atLeastOneIsExecutedBeforepublic boolean atLeastOneIsExecutedBefore(Collection<Integer> optionalPreds, int nodeID) 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.
 
 
- 
 
-