\r
// Dependencies\r
if (n instanceof ConnectionNode) {\r
- // See the first (and only) child of n has a DependencyNode as a child.\r
- n = ((ConnectionNode) n).getNodes().iterator().next();\r
- if (n instanceof ParentNode<?>) {\r
- nodeIds = ((ParentNode<?>)n).getNodeIds();\r
- for (String id : nodeIds) {\r
- if (id.startsWith("edge_"))\r
- return ((ParentNode<?>)n).getNode(id);\r
+ // See the if a child of n has a DependencyNode as a child.\r
+ Iterator<IG2DNode> it = ((ConnectionNode) n).getNodes().iterator();\r
+ while (it.hasNext()) {\r
+ n = it.next();\r
+ if (n instanceof ParentNode<?>) {\r
+ nodeIds = ((ParentNode<?>)n).getNodeIds();\r
+ for (String id : nodeIds) {\r
+ if (id.startsWith("edge_"))\r
+ return ((ParentNode<?>)n).getNode(id);\r
+ }\r
}\r
}\r
}\r
\r
// Go through forward dependencies and flows\r
Collection<Resource> forwardDependencies = graph.getObjects(loopItems.get(i), sr.Variable_isTailOf);\r
+ \r
+ // And also through the forward dependencies of possible shadows.\r
+ Collection<Resource> shadows = graph.getObjects(loopItems.get(i), sr.Shadow_original_Inverse);\r
+ for (Resource shadow : shadows)\r
+ forwardDependencies.addAll(graph.getObjects(shadow, sr.Variable_isTailOf));\r
+ \r
for (Resource dependency : forwardDependencies) {\r
Resource dependingVariable = graph.getSingleObject(dependency, sr.Variable_HasHead);\r
if (dependingVariable.equals(loopItems.get((i + 1) % loopItems.size()))) {\r
\r
// Go through forward dependencies and flows\r
Collection<Resource> forwardDependencies = graph.getObjects(loop.get(i), sr.Variable_isTailOf);\r
+ \r
+ // And also through the forward dependencies of possible shadows.\r
+ Collection<Resource> shadows = graph.getObjects(loop.get(i), sr.Shadow_original_Inverse);\r
+ for (Resource shadow : shadows)\r
+ forwardDependencies.addAll(graph.getObjects(shadow, sr.Variable_isTailOf));\r
+ \r
for (Resource dependency : forwardDependencies) {\r
Resource dependingVariable = graph.getSingleObject(dependency, sr.Variable_HasHead);\r
if (dependingVariable.equals(loop.get((i + 1) % loop.size()))) {\r
/*******************************************************************************\r
- * Copyright (c) 2007, 2011 Association for Decentralized Information Management in\r
+ * Copyright (c) 2007, 2011, 2014 Association for Decentralized Information Management in\r
* Industry THTH ry.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
SimulationResource SIMU = SimulationResource.getInstance(graph);\r
graph.claim(defaultProfile, SIMU.IsActive, null, sr.Profiles_IssueWarnings);\r
graph.claim(defaultProfile, SIMU.IsActive, null, sr.Profiles_ShadowVisualizations);\r
- graph.claim(model, DIA.HasActiveProfile, simulationPlaybackProfile);\r
graph.claim(simulationPlaybackProfile, SIMU.IsActive, null, sr.Profiles_SimulationPlaybackColours);\r
\r
// }\r