Module: YPetri::Transition::Type_T
- Defined in:
- lib/y_petri/transition/T.rb
Overview
Mixin for timed Petri net transitions.
Instance Method Summary collapse
-
#action(Δt) ⇒ Object
Transition’s action (before validation).
-
#enabled?(Δt) ⇒ Boolean
YPetri transitions are enabled if and only if the intended action would lead to a legal codomain marking.
-
#f(simulation = world.simulation) ⇒ Object
Transition’s flux under current simulation.
-
#fir(simulation = world.simulation, **nn) ⇒ Object
Transition’s firing under current simulation.
-
#fire(Δt) ⇒ Object
Fires the transition, honoring cocking.
-
#fire!(Δt) ⇒ Object
Fires the transition regardless of cocking.
-
#function ⇒ Object
For timed transitions, “function” refers to their rate closure.
-
#pa(simulation = world.simulation, **nn) ⇒ Object
Prints the transition’s action under current simulation.
Instance Method Details
#action(Δt) ⇒ Object
Transition’s action (before validation). Requires Δt as an argument.
14 15 16 17 18 19 20 21 |
# File 'lib/y_petri/transition/T.rb', line 14 def action |
#enabled?(Δt) ⇒ Boolean
YPetri transitions are enabled if and only if the intended action would lead to a legal codomain marking. For timed transitions, #enabled? method takes Δt as an argument.
48 49 50 51 52 53 |
# File 'lib/y_petri/transition/T.rb', line 48 def enabled? |
#f(simulation = world.simulation) ⇒ Object
Transition’s flux under current simulation.
65 66 67 |
# File 'lib/y_petri/transition/T.rb', line 65 def f simulation=world.simulation simulation.net.State.Feature.Flux( self ) % simulation end |
#fir(simulation = world.simulation, **nn) ⇒ Object
Transition’s firing under current simulation.
57 58 59 60 61 |
# File 'lib/y_petri/transition/T.rb', line 57 def fir simulation=world.simulation, **nn nn.must_have :delta_time, syn!: : |
#fire(Δt) ⇒ Object
Fires the transition, honoring cocking. Returns true if the transition fired, false if it wasn’t cocked.
26 27 28 |
# File 'lib/y_petri/transition/T.rb', line 26 def fire |
#fire!(Δt) ⇒ Object
Fires the transition regardless of cocking. For timed transitions, takes Δt as an argument.
33 34 35 36 37 38 39 40 41 42 |
# File 'lib/y_petri/transition/T.rb', line 33 def fire! |
#function ⇒ Object
For timed transitions, “function” refers to their rate closure.
8 9 10 |
# File 'lib/y_petri/transition/T.rb', line 8 def function rate_closure end |
#pa(simulation = world.simulation, **nn) ⇒ Object
Prints the transition’s action under current simulation.
71 72 73 74 75 76 |
# File 'lib/y_petri/transition/T.rb', line 71 def pa simulation=world.simulation, **nn nn.must_have :delta_time, syn!: : |