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
d9708f38
Unverified
Commit
d9708f38
authored
Oct 17, 2018
by
Morten Knutsen
Committed by
GitHub
Oct 17, 2018
Browse files
Merge pull request #2 from he32/new-networx
Work also with newer networkx (tested with 2.1).
parents
a2cf8a09
a528cd88
Changes
2
Hide whitespace changes
Inline
Side-by-side
model.py
View file @
d9708f38
...
...
@@ -1504,7 +1504,7 @@ class Simulation:
self
.
graph
.
add_node
(
router
)
for
(
u
,
v
,
w
)
in
edges
:
self
.
graph
.
add_edge
(
u
,
v
,
w
)
self
.
graph
.
add_edge
(
u
,
v
,
**
w
)
del
self
.
changes
[
idx
]
...
...
pajek.py
View file @
d9708f38
...
...
@@ -85,9 +85,9 @@ def parse_pajek(lines):
edge_data
.
update
(
extra_attr
)
if
G
.
has_edge
(
u
,
v
):
if
G
[
u
][
v
][
'value'
]
>
float
(
w
):
G
.
add_edge
(
u
,
v
,
edge_data
)
G
.
add_edge
(
u
,
v
,
**
edge_data
)
else
:
G
.
add_edge
(
u
,
v
,
edge_data
)
G
.
add_edge
(
u
,
v
,
**
edge_data
)
if
not
G
.
name
:
raise
Exception
(
"No graph definition found"
)
if
len
(
G
.
nodes
())
==
0
:
...
...
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