Module: YPetri::Simulation::TransitionRepresentation::Type_TS
Instance Attribute Summary collapse
-
#rate_closure ⇒ Object
readonly
Returns the value of attribute rate_closure.
Attributes included from Type_S
#sparse_stoichiometry_vector, #sparse_sv, #stoichiometry
Instance Method Summary collapse
-
#firing(Δt) ⇒ Object
Firing of the transition (rate * Δtime).
-
#init ⇒ Object
Initialization subroutine.
-
#rate ⇒ Object
(also: #flux, #propensity)
Transition's rate, given the current system state.
-
#to_rate_closure ⇒ Object
Builds a flux closure.
-
#∇ ⇒ Object
(also: #gradient_all)
Gradient contribution of the transition to all places.
Methods included from Type_S
Methods included from Type_a
Methods included from Type_T
#T?, #d, #d_all, #delta, #g, #g_all, #gradient, #t?, #Δ
Instance Attribute Details
#rate_closure ⇒ Object (readonly)
Returns the value of attribute rate_closure
10 11 12 |
# File 'lib/y_petri/simulation/transition_representation/TS.rb', line 10 def rate_closure @rate_closure end |
Instance Method Details
#firing(Δt) ⇒ Object
Firing of the transition (rate * Δtime).
29 30 31 |
# File 'lib/y_petri/simulation/transition_representation/TS.rb', line 29 def firing Δt rate * Δt end |
#init ⇒ Object
Initialization subroutine.
14 15 16 17 |
# File 'lib/y_petri/simulation/transition_representation/TS.rb', line 14 def init super @rate_closure = to_rate_closure end |
#rate ⇒ Object Also known as: flux, propensity
Transition's rate, given the current system state.
21 22 23 |
# File 'lib/y_petri/simulation/transition_representation/TS.rb', line 21 def rate rate_closure.call end |
#to_rate_closure ⇒ Object
Builds a flux closure.
42 43 44 |
# File 'lib/y_petri/simulation/transition_representation/TS.rb', line 42 def to_rate_closure build_closure end |
#∇ ⇒ Object Also known as: gradient_all
Gradient contribution of the transition to all places.
35 36 37 |
# File 'lib/y_petri/simulation/transition_representation/TS.rb', line 35 def ∇ codomain >> stoichiometry.map { |coeff| rate * coeff } end |