Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Franck Pommereau
/
snakes
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Franck Pommereau
2017-02-06 11:26:27 +0100
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
7bfa686bab1ea52bc37bc3714b51eb0806efc037
7bfa686b
1 parent
c8e06856
fixed a bug with MultiArcs + invalid test in plugin gv
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
snakes/nets.py
snakes/plugins/gv.py
snakes/nets.py
View file @
7bfa686
...
...
@@ -2435,12 +2435,12 @@ class Transition (Node) :
if
input
:
for
place
,
label
in
self
.
input
()
:
try
:
place
.
check
(
v
.
value
for
v
in
iterate
(
label
.
bind
(
binding
)))
place
.
check
(
v
for
v
in
iterate
(
label
.
flow
(
binding
)))
except
ValueError
:
return
False
for
place
,
label
in
self
.
output
()
:
try
:
place
.
check
(
v
.
value
for
v
in
iterate
(
label
.
bind
(
binding
)))
place
.
check
(
v
for
v
in
iterate
(
label
.
flow
(
binding
)))
except
ValueError
:
return
False
return
True
...
...
snakes/plugins/gv.py
View file @
7bfa686
...
...
@@ -22,6 +22,11 @@ GraphViz; we can also draw the state graph:
>>> for engine in ('neato', 'dot', 'circo', 'twopi', 'fdp') :
... n.draw(',test-gv-
%
s.png'
%
engine, engine=engine)
Graph(...)
Graph(...)
Graph(...)
Graph(...)
Graph(...)
>>> s = StateGraph(n)
>>> s.build()
>>> s.draw(',test-gv-graph.png')
...
...
@@ -204,6 +209,7 @@ def extend (module) :
... attr['label'] = '
%
s
\\
n
%
s'
%
(trans.name, trans.guard)
>>> n.draw(',net-with-colors.png',
... place_attr=draw_place, trans_attr=draw_transition)
Graph(...)
@param filename: the name of the image file to create
@type filename: `str`
...
...
Please
register
or
login
to post a comment