1. Mark Howison
  2. gabi

Commits

Mark Howison  committed 10393ab

graph: fixed bug in deactivating path in perturb_path()

  • Participants
  • Parent commits 33cb6ac
  • Branches chloroplast, devel 4
    1. hiv
    2. issue-6
    3. issue-7
    4. issue7a

Comments (0)

Files changed (1)

File gabi/graph.py

View file
  • Ignore whitespace
         return self.G.node[n]['visited']
 
     def activate(self, e):
-        self.A.add_path(self.edges[e])
+        self.A.add_edge(*self.edges[e])
 
     def deactivate(self, e):
         n1, n2 = self.edges[e]
             assert n1 == n2
 
     def get_nodes(self):
-	return sorted(self.A.nodes_iter())
+        return sorted(self.A.nodes_iter())
 
     def get_edges(self):
-        return sorted(self.edge(*e) for e in  self.A.edges_iter())
+        return sorted(self.edge(*e) for e in self.A.edges_iter())
 
     def get_state(self):
         return str(self.get_edges()), str(self.get_nodes())
                 n = self.backward_random(n)
             start = n
             # Deactivate old path forward
-            if start:
+            if start is not None:
                 assert self.A.has_node(start)
                 n = self.forward_active(start)
                 while not (n is None or n == end):
                     n = n1
                 path.insert(0, start)
             # Deactivate old path backward
-            if end:
+            if end is not None:
                 assert self.A.has_node(end)
                 n = self.backward_active(end)
                 while not (n is None or n == start):