lib/y_petri/transition/A.rb in y_petri-2.2.4 vs lib/y_petri/transition/A.rb in y_petri-2.3.2

- old
+ new

@@ -1,6 +1,6 @@ -# -*- coding: utf-8 -*- +# encoding: utf-8 # Mixin for the transitions with assignment action. # module YPetri::Transition::Type_A # Transition's action (before validation). @@ -22,18 +22,24 @@ consciously "to #fire!" do act = note "action", is: Array( action ) msg = "Wrong output arity of the action closure of #{self}" fail TypeError, msg if act.size != codomain.size codomain.each_with_index { |p, i| - note "assigning action element no. #{i} to #{p}" + note "assigning action node no. #{i} to #{p}" p.marking = note "marking to assign", is: act.fetch( i ) } end return nil end # A transitions are always _enabled_. # def enabled? true + end + + # Transition's assignment action under current simulation. + # + def a simulation=world.simulation + simulation.net.State.Feature.Assignment( self ) % simulation end end # class YPetri::Transition::Type_A