Commit 8a8c4ab7 authored by Morten Knutsen's avatar Morten Knutsen
Browse files

Fiks minimize-function, broken during API changes

parent 8b13ec85
......@@ -820,6 +820,7 @@ class MetricShell(Cmd):
header = False
for (u,v,w) in sorted(H.edges(data=True)):
if (u,v) in shown: continue
w = H[u][v]['weight']
w_old = G[u][v]['weight']
if w_old != w:
if not header:
......@@ -840,6 +841,7 @@ class MetricShell(Cmd):
if apply.lower() == 'y':
for (u,v,w) in H.edges(data=True):
if (u,v) in applied: continue
w = H[u][v]['weight']
w_old = G[u][v]['weight']
if w_old != w:
self.simulation.change_metric(u,v,w, True)
......
......@@ -1845,10 +1845,10 @@ class Simulation:
G = self.graph
H = self.graph.copy()
edges = sorted(H.edges(data=True), cmp=lambda x,y: cmp(y[2], x[2]) \
edges = sorted(H.edges(data=True), cmp=lambda x,y: cmp(y[2]['weight'], x[2]['weight']) \
or cmp(ebc[(x[0],x[1])],
ebc[(y[0],y[1])]))
finished = False
while not finished:
......@@ -1856,6 +1856,7 @@ class Simulation:
adjustment_found = False
for (u,v,w) in edges:
w = w['weight']
if not w == H[v][u]['weight']:
continue
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment