aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincenzo Maffione <v.maffione@gmail.com>2017-06-01 22:56:07 +0200
committerVincenzo Maffione <v.maffione@gmail.com>2017-06-01 23:02:14 +0200
commite12ba0e3d6491a693ce63fe07f26b8d17ad5da5c (patch)
treeb203225b3cb2a09e05267d3626012eafc9c0dc28
parent430f1a369f9dbc1328abb3ea750cfcc0c4db0c3e (diff)
downloadrumba-e12ba0e3d6491a693ce63fe07f26b8d17ad5da5c.tar.gz
rumba-e12ba0e3d6491a693ce63fe07f26b8d17ad5da5c.zip
rumba: take into account DIFs that don't use nor are used by other DIFs
These DIFs needs to be considered for the Kahn algorithm and computation of IPCPs. Closes #11.
-rw-r--r--rumba/model.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/rumba/model.py b/rumba/model.py
index ccd60df..eee8fac 100644
--- a/rumba/model.py
+++ b/rumba/model.py
@@ -328,6 +328,10 @@ class Experiment:
difsdeps_inc = dict()
for node in self.nodes:
+ for dif in node.difs:
+ if dif not in difsdeps_adj:
+ difsdeps_adj[dif] = set()
+
for upper in node.dif_registrations:
for lower in node.dif_registrations[upper]:
if upper not in difsdeps_inc:
@@ -349,6 +353,14 @@ class Experiment:
difsdeps_inc_cnt[dif] = len(difsdeps_inc[dif])
del difsdeps_inc
+ # Init difsdeps_inc_cnt for those DIFs that do not
+ # act as lower IPCPs nor upper IPCPs for registration
+ # operations
+ for node in self.nodes:
+ for dif in node.difs:
+ if dif not in difsdeps_inc_cnt:
+ difsdeps_inc_cnt[dif] = 0
+
# Run Kahn's algorithm to compute topological
# ordering on the DIFs graph.
frontier = set()