y_petri 2.1.46 → 2.1.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/y_petri/net/visualization.rb +23 -3
- data/lib/y_petri/version.rb +1 -1
- data/test/acceptance/visualization_test.rb +15 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dfddc6ced509606c4f4f8b4bd6fb55e17002f336
|
4
|
+
data.tar.gz: b1c0ba4a9b0cfa73ebeb6a0e7730e3dbb0b1ba31
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 12152cc39d1fc4259d56705fded129bb5c475d1223d949c8e6b58224670338c745989e1dacdb7ba4b4ce89b14b90310c8bf41bcd2e2dbe64842433c57de043f6
|
7
|
+
data.tar.gz: 460307f2c328568e56e3e384562bd2d2075d5987215fd0882964a91aa37708876cd3666b9880e4cb57b20745fe7e645358206b082f05b00e731121f4b058a3a6
|
@@ -40,11 +40,31 @@ module YPetri::Net::Visualization
|
|
40
40
|
if tr.stoichio[pl] > 0 then # producing arc
|
41
41
|
γ.add_edges tr_node, place_nodes[pl], color: 'cyan'
|
42
42
|
elsif tr.stoichio[pl] < 0 then # consuming arc
|
43
|
-
γ.add_edges place_nodes[pl], tr_node, color: 'cyan'
|
44
|
-
else
|
45
|
-
γ.add_edges place_nodes[pl], tr_node, color: 'grey', arrowhead: 'none'
|
43
|
+
γ.add_edges place_nodes[ pl ], tr_node, color: 'cyan'
|
44
|
+
else # zero stoichiometry => test arc
|
45
|
+
γ.add_edges place_nodes[ pl ], tr_node, color: 'grey', arrowhead: 'none'
|
46
46
|
end
|
47
47
|
}
|
48
|
+
( tr.domain - tr.codomain ).each { |pl| # remaining test arcs
|
49
|
+
γ.add_edges tr_node, place_nodes[pl], color: 'grey', arrowhead: 'none'
|
50
|
+
}
|
51
|
+
elsif tr.S?
|
52
|
+
tr.codomain.each { |pl|
|
53
|
+
if tr.stoichio[pl] > 0 then # producing arc
|
54
|
+
γ.add_edges tr_node, place_nodes[pl], color: 'cyan'
|
55
|
+
elsif tr.stoichio[pl] < 0 then # consuming arc
|
56
|
+
γ.add_edges place_nodes[ pl ], tr_node, color: 'cyan'
|
57
|
+
else # zero stoichiometry => test arc
|
58
|
+
γ.add_edges place_nodes[ pl ], tr_node, color: 'grey', arrowhead: 'none'
|
59
|
+
end
|
60
|
+
}
|
61
|
+
( tr.domain - tr.codomain ).each { |pl| # remaining test arcs
|
62
|
+
γ.add_edges tr_node, place_nodes[pl], color: 'grey', arrowhead: 'none'
|
63
|
+
}
|
64
|
+
else
|
65
|
+
tr.codomain.each { |pl|
|
66
|
+
γ.add_edges tr_node, place_nodes[pl], color: 'cyan'
|
67
|
+
}
|
48
68
|
( tr.domain - tr.codomain ).each { |pl|
|
49
69
|
γ.add_edges tr_node, place_nodes[pl], color: 'grey', arrowhead: 'none'
|
50
70
|
}
|
data/lib/y_petri/version.rb
CHANGED
@@ -23,3 +23,18 @@ describe "Graphviz visualization" do
|
|
23
23
|
@m.net.visualize
|
24
24
|
end
|
25
25
|
end
|
26
|
+
|
27
|
+
describe "Another visualization" do
|
28
|
+
before do
|
29
|
+
class Object
|
30
|
+
include YPetri
|
31
|
+
end
|
32
|
+
A = Place()
|
33
|
+
B = Place()
|
34
|
+
A2B = Transition( s: { A: -1, B: 1 } )
|
35
|
+
end
|
36
|
+
|
37
|
+
it "should visualize as expected" do
|
38
|
+
net.visualize
|
39
|
+
end
|
40
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: y_petri
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.47
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- boris
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-08-
|
11
|
+
date: 2013-08-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: y_support
|