import java.util.Map;
import java.util.Map.Entry;
import org.apache.commons.lang3.StringUtils;
-import org.jgrapht.DirectedGraph;
+import org.jgrapht.Graph;
import org.jgrapht.graph.ClassBasedEdgeFactory;
import org.jgrapht.graph.DefaultEdge;
import org.jgrapht.graph.DirectedMultigraph;
//
// For this version we can use a directed multigraph, in the future we may not be able to
//
- DirectedGraph<NodeWrapper, LabeledEdge> graph =
+ Graph<NodeWrapper, LabeledEdge> graph =
new DirectedMultigraph<>(new ClassBasedEdgeFactory<NodeWrapper,
LabeledEdge>(LabeledEdge.class));
//
}
private static Map<Policy, PolicyNodeWrapper> addPoliciesAsNodes(ControlLoopPolicy policy,
- DirectedGraph<NodeWrapper, LabeledEdge> graph, TriggerNodeWrapper triggerNode,
+ Graph<NodeWrapper, LabeledEdge> graph, TriggerNodeWrapper triggerNode,
ControlLoopCompilerCallback callback) {
Map<Policy, PolicyNodeWrapper> mapNodes = new HashMap<>();
for (Policy operPolicy : policy.getPolicies()) {
return mapNodes;
}
- private static void addEdge(DirectedGraph<NodeWrapper, LabeledEdge> graph, Map<Policy, PolicyNodeWrapper> mapNodes,
+ private static void addEdge(Graph<NodeWrapper, LabeledEdge> graph, Map<Policy, PolicyNodeWrapper> mapNodes,
String policyId, String connectedPolicy,
FinalResultNodeWrapper finalResultNodeWrapper,
PolicyResult policyResult, NodeWrapper node) throws CompilerException {
}
}
- private static void validateNodesAndEdges(DirectedGraph<NodeWrapper, LabeledEdge> graph,
+ private static void validateNodesAndEdges(Graph<NodeWrapper, LabeledEdge> graph,
ControlLoopCompilerCallback callback) throws CompilerException {
for (NodeWrapper node : graph.vertexSet()) {
if (node instanceof TriggerNodeWrapper) {
}
}
- private static void validateTriggerNodeWrapper(DirectedGraph<NodeWrapper, LabeledEdge> graph,
+ private static void validateTriggerNodeWrapper(Graph<NodeWrapper, LabeledEdge> graph,
NodeWrapper node) throws CompilerException {
if (LOGGER.isDebugEnabled()) {
LOGGER.info("Trigger Node {}", node);
}
}
- private static void validateFinalResultNodeWrapper(DirectedGraph<NodeWrapper, LabeledEdge> graph,
+ private static void validateFinalResultNodeWrapper(Graph<NodeWrapper, LabeledEdge> graph,
NodeWrapper node) throws CompilerException {
if (LOGGER.isDebugEnabled()) {
LOGGER.info("FinalResult Node {}", node);
}
}
- private static void validatePolicyNodeWrapper(DirectedGraph<NodeWrapper, LabeledEdge> graph,
+ private static void validatePolicyNodeWrapper(Graph<NodeWrapper, LabeledEdge> graph,
NodeWrapper node, ControlLoopCompilerCallback callback) throws CompilerException {
if (LOGGER.isDebugEnabled()) {
LOGGER.info("Policy Node {}", node);