Method: Petri::Transition#produce
- Defined in:
- lib/petri/transition.rb
#produce(label, options = {}) ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/petri/transition.rb', line 34 def produce(label, ={}) @net.add_place(label, ) raise TypeError unless ([:with_guard].is_a? Symbol or [:with_guard].nil?) guard = [:with_guard] @production << {label: label, guard: guard} if label.is_a? Symbol if label.is_a? Array for place in label raise TypeError unless place.is_a? Symbol @production << {label: label, guard: guard} end end end |