Module: YPetri::Simulation::Transitions::Type_A
- Defined in:
- lib/y_petri/simulation/transitions/A.rb
Instance Method Summary collapse
-
#act ⇒ Object
Returns the assignments to all places, as they would happen if A transition could change their values.
-
#action ⇒ Object
Combined assignment action, as it would occur if these A transitions fired in order, as hash place >> action.
-
#assignment_closures ⇒ Object
Assignment closures that directly affect the marking when called.
- #initialize ⇒ Object
-
#to_assignment_closure ⇒ Object
(also: #assignment_closure)
Builds a joint assignment closure.
Instance Method Details
#act ⇒ Object
Returns the assignments to all places, as they would happen if A transition could change their values.
26 27 28 |
# File 'lib/y_petri/simulation/transitions/A.rb', line 26 def act each_with_object Hash.new do |t, hsh| hsh.update( t.act ) end end |
#action ⇒ Object
Combined assignment action, as it would occur if these A transitions fired in order, as hash place >> action.
19 20 21 |
# File 'lib/y_petri/simulation/transitions/A.rb', line 19 def action each_with_object Hash.new do |t, hsh| hsh.update( t.action ) end end |
#assignment_closures ⇒ Object
Assignment closures that directly affect the marking when called.
12 13 14 |
# File 'lib/y_petri/simulation/transitions/A.rb', line 12 def assignment_closures map &:assignment_closure end |
#initialize ⇒ Object
7 8 |
# File 'lib/y_petri/simulation/transitions/A.rb', line 7 def initialize end |
#to_assignment_closure ⇒ Object Also known as: assignment_closure
Builds a joint assignment closure.
32 33 34 35 |
# File 'lib/y_petri/simulation/transitions/A.rb', line 32 def to_assignment_closure closures = assignment_closures -> { closures.each &:call } end |