aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincenzo Maffione <[email protected]>2017-03-19 16:26:01 +0100
committerVincenzo Maffione <[email protected]>2017-03-19 16:26:01 +0100
commit48fffffde971102a07db602afd1bfa557d321c81 (patch)
tree9ebe5c44473dca296eed2ed96445d2581a5db233
parentc3d66b2da3c2f3e994ef83298fe0190f4cdb00dc (diff)
downloadrumba-48fffffde971102a07db602afd1bfa557d321c81.tar.gz
rumba-48fffffde971102a07db602afd1bfa557d321c81.zip
model: compute_ipcps(): compute registrations
-rw-r--r--rumba/model.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/rumba/model.py b/rumba/model.py
index 93b901b..0adb503 100644
--- a/rumba/model.py
+++ b/rumba/model.py
@@ -282,9 +282,12 @@ class IPCP:
self.name = name
self.node = node
self.dif = dif
+ self.registrations = []
def __repr__(self):
- return "IPCP %s in DIF %s" % (self.name, self.dif.name)
+ return "IPCP=%s DIF=%s N-1-DIFs=(%s)" % \
+ (self.name, self.dif.name,
+ ' '.join([dif.name for dif in self.registrations]))
def __hash__(self):
return hash((self.name, self.dif.name))
@@ -483,6 +486,11 @@ class Experiment:
for dif in node.difs:
ipcp = IPCP(name = '%s.%s.IPCP' % (dif.name, node.name),
node = node, dif = dif)
+
+ if dif in node.dif_registrations:
+ for lower in node.dif_registrations[dif]:
+ ipcp.registrations.append(lower)
+
node.ipcps.append(ipcp)
print("IPCP for node %s: %s" % (node.name, node.ipcps))