lib/y_petri/net/visualization.rb in y_petri-2.0.15 vs lib/y_petri/net/visualization.rb in y_petri-2.1.3
- old
+ new
@@ -17,14 +17,14 @@
end
transition_nodes = transitions.map.with_object Hash.new do |tr, ꜧ|
ꜧ[tr] = γ.add_nodes tr.name.to_s,
shape: 'box',
fillcolor: if tr.assignment? then 'yellow'
- elsif tr.basic_type == :SR then 'lightcyan'
+ elsif tr.type == :TS then 'lightcyan'
else 'ghostwhite' end,
color: if tr.assignment? then 'goldenrod'
- elsif tr.basic_type == :SR then 'cyan'
+ elsif tr.type == :TS then 'cyan'
else 'grey' end,
style: 'filled'
end
# Add Petri net arcs.
transition_nodes.each { |tr, tr_node|
@@ -33,10 +33,10 @@
γ.add_edges tr_node, place_nodes[pl], color: 'goldenrod'
}
( tr.domain - tr.codomain ).each { |pl|
γ.add_edges tr_node, place_nodes[pl], color: 'grey', arrowhead: 'none'
}
- elsif tr.basic_type == :SR then
+ elsif tr.type == :TS then
tr.codomain.each { |pl|
if tr.stoichio[pl] > 0 then # producing arc
γ.add_edges tr_node, place_nodes[pl], color: 'cyan'
elsif tr.stoichio[pl] < 0 then # consuming arc
γ.add_edges place_nodes[pl], tr_node, color: 'cyan'