aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rumba/model.py37
1 files changed, 34 insertions, 3 deletions
diff --git a/rumba/model.py b/rumba/model.py
index 946d85d..1ed67dc 100644
--- a/rumba/model.py
+++ b/rumba/model.py
@@ -243,6 +243,31 @@ class Node:
def del_binding(self, name):
del self.dif_bindings[name]
+# Class representing an IPC Process to be created in the experiment
+#
+# @name [string]: IPCP name
+# @node: Node where the IPCP gets created
+# @dif: the DIF the IPCP belongs to
+#
+class IPCP:
+ def __init__(self, name, node, dif):
+ self.name = name
+ self.node = node
+ self.dif = dif
+
+ def __repr__(self):
+ return "IPCP %s in DIF %s" % (self.name, self.dif.name)
+
+ def __hash__(self):
+ return hash((self.name, self.dif.name))
+
+ def __eq__(self, other):
+ return other != None and self.name == other.name \
+ and self.dif == other.dif
+
+ def __neq__(self, other):
+ return not (self == other)
+
# Base class for ARCFIRE experiments
#
# @name [string] Name of the experiment
@@ -255,6 +280,8 @@ class Experiment:
self.nodes = nodes
self.testbed = testbed
self.enrollment_strategy = 'minimal' # 'full-mesh', 'manual'
+ self.dif_ordering = []
+ self.enrollments = dict()
def __repr__(self):
s = ""
@@ -343,7 +370,7 @@ class Experiment:
print("DIF topological ordering: %s" % self.dif_ordering)
- # Compute per-DIF graphs, to be called after compute_dif_ordering()
+ # Compute per-DIF enrollments, to be called after compute_dif_ordering()
def compute_enrollments(self):
dif_graphs = dict()
self.enrollments = dict()
@@ -421,11 +448,15 @@ class Experiment:
e['enroller'].name,
e['lower_dif']))
- # Examine the nodes, DIFs, registrations and compute the registration
- # and enrollment order, etc.
+ def compute_ipcps(self):
+ pass
+
+ # Examine the nodes and DIFs, compute the registration nd enrollment
+ # order, the list of IPCPs to create, registrations, ...
def generate(self):
self.compute_dif_ordering()
self.compute_enrollments()
+ self.compute_ipcps()
# Realize the experiment, using a testbed-specific setup
def swap_in(self):