y_petri 2.1.46 → 2.1.47

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bc7af28887341704a71e56203783fb4bddf63620
4
- data.tar.gz: d54f85e5195a01293b15cdeed75d6bf0a61da35c
3
+ metadata.gz: dfddc6ced509606c4f4f8b4bd6fb55e17002f336
4
+ data.tar.gz: b1c0ba4a9b0cfa73ebeb6a0e7730e3dbb0b1ba31
5
5
  SHA512:
6
- metadata.gz: 9ecc3db4760965a35f227361883969c8ed2718c24c257d2aade5edbbe2191c76bafc3f7f28a467937f0aa4d7a79b7246293f38d280de13a2ed8e58ce25275852
7
- data.tar.gz: bcfa5add5ff22907980903ae337900976448841d3c4598288277964619be91fac81f707e9693a6f40879eff870331acae5337d8c737dff83906c6ab67b0d30be
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
  }
@@ -1,4 +1,4 @@
1
1
  module YPetri
2
- VERSION = "2.1.46"
2
+ VERSION = "2.1.47"
3
3
  DEBUG = false
4
4
  end
@@ -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.46
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-24 00:00:00.000000000 Z
11
+ date: 2013-08-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: y_support