diff options
-rw-r--r-- | rumba/elements/experimentation.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/rumba/elements/experimentation.py b/rumba/elements/experimentation.py index e8e3c27..da81c6c 100644 --- a/rumba/elements/experimentation.py +++ b/rumba/elements/experimentation.py @@ -307,6 +307,7 @@ class Experiment(object): # breadth-first traversal. enrolled = {first} frontier = {first} + dt_connected = set() while len(frontier): cur = frontier.pop() for edge in dif_graphs[dif][cur]: @@ -323,9 +324,9 @@ class Experiment(object): 'lower_dif': edge[1]}) self.mgmt_flows[-1].append({'src': enrollee, 'dst': enroller}) - if self.dt_strategy == 'minimal': - self.dt_flows[-1].append({'src': enrollee, - 'dst': enroller}) + self.dt_flows[-1].append({'src': enrollee, + 'dst': enroller}) + dt_connected.add((enrollee, enroller)) frontier.add(edge[0]) if len(dif.members) != len(enrolled): raise Exception("Disconnected DIF found: %s" % (dif,)) @@ -344,8 +345,10 @@ class Experiment(object): 'enroller': enroller, 'lower_dif': edge[1]}) if self.dt_strategy == 'full-mesh': - self.dt_flows[-1].append({'src': enrollee, - 'dst': enroller}) + if ((enrollee, enroller) not in dt_connected and + (enroller, enrollee) not in dt_connected): + self.dt_flows[-1].append({'src': enrollee, + 'dst': enroller}) if not (self.dt_strategy == 'minimal' or self.dt_strategy == 'full-mesh') \ |