Module: YPetri::Simulation::TransitionRepresentation::Type_tS
Instance Attribute Summary collapse
-
#firing_closure ⇒ Object
readonly
Returns the value of attribute firing_closure.
Attributes included from Type_S
#sparse_stoichiometry_vector, #sparse_sv, #stoichiometry
Instance Method Summary collapse
-
#firing ⇒ Object
Transition's firing, given the current system state.
-
#init ⇒ Object
Initialization subroutine.
-
#to_firing_closure ⇒ Object
Builds a firing closure.
-
#Δ ⇒ Object
(also: #delta_all)
Change, to all places, as it would happen if the transition fired.
Methods included from Type_S
Methods included from Type_a
Methods included from Type_t
Instance Attribute Details
#firing_closure ⇒ Object (readonly)
Returns the value of attribute firing_closure
10 11 12 |
# File 'lib/y_petri/simulation/transition_representation/tS.rb', line 10 def firing_closure @firing_closure end |
Instance Method Details
#firing ⇒ Object
Transition's firing, given the current system state.
21 22 23 |
# File 'lib/y_petri/simulation/transition_representation/tS.rb', line 21 def firing firing_closure.call end |
#init ⇒ Object
Initialization subroutine.
14 15 16 17 |
# File 'lib/y_petri/simulation/transition_representation/tS.rb', line 14 def init super @firing_closure = to_firing_closure end |
#to_firing_closure ⇒ Object
Builds a firing closure.
34 35 36 |
# File 'lib/y_petri/simulation/transition_representation/tS.rb', line 34 def to_firing_closure build_closure end |
#Δ ⇒ Object Also known as: delta_all
Change, to all places, as it would happen if the transition fired.
27 28 29 |
# File 'lib/y_petri/simulation/transition_representation/tS.rb', line 27 def Δ codomain >> stoichiometry.map { |coeff| firing * coeff } end |