Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
verktoy
PyMetric
Commits
8a8c4ab7
Commit
8a8c4ab7
authored
Nov 09, 2011
by
Morten Knutsen
Browse files
Fiks minimize-function, broken during API changes
parent
8b13ec85
Changes
2
Hide whitespace changes
Inline
Side-by-side
command.py
View file @
8a8c4ab7
...
...
@@ -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
)
...
...
model.py
View file @
8a8c4ab7
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment