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.
-
#direct_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.
-
#to_direct_assignment_closure ⇒ Object
(also: #direct_assignment_closure)
Builds a joint direct assignment closure, directly bound to the marking vector and changing its values when called.
Instance Method Details
#act ⇒ Object
Returns the assignments to all places, as they would happen if A transition could change their values.
32 33 34 |
# File 'lib/y_petri/simulation/transitions/A.rb', line 32 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.
25 26 27 |
# File 'lib/y_petri/simulation/transitions/A.rb', line 25 def action each_with_object Hash.new do |t, hsh| hsh.update( t.action ) end end |
#assignment_closures ⇒ Object
Assignment closures.
12 13 14 |
# File 'lib/y_petri/simulation/transitions/A.rb', line 12 def assignment_closures map &:assignment_closure end |
#direct_assignment_closures ⇒ Object
Assignment closures that directly affect the marking when called.
18 19 20 |
# File 'lib/y_petri/simulation/transitions/A.rb', line 18 def direct_assignment_closures map &:direct_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.
38 39 40 41 |
# File 'lib/y_petri/simulation/transitions/A.rb', line 38 def to_assignment_closure closures = assignment_closures -> { closures.each &:call } end |
#to_direct_assignment_closure ⇒ Object Also known as: direct_assignment_closure
Builds a joint direct assignment closure, directly bound to the marking vector and changing its values when called.
47 48 49 50 |
# File 'lib/y_petri/simulation/transitions/A.rb', line 47 def to_direct_assignment_closure closures = direct_assignment_closures -> { closures.each &:call } end |