Module: YPetri::Simulation::Transitions::Type_TS

Includes:
Type_S, Type_T
Defined in:
lib/y_petri/simulation/transitions/TS.rb

Instance Method Summary collapse

Methods included from Type_S

#SM, #stoichiometry_matrix

Methods included from Type_T

#delta, #gradient_closures,

Instance Method Details

#firing_vector(Δt) ⇒ Object

Firing vector (rate vector * Δtime).



26
27
28
# File 'lib/y_petri/simulation/transitions/TS.rb', line 26

def firing_vector Δt
  rate_vector * Δt
end

#gradientObject

Gradient contribution to free places.



32
33
34
# File 'lib/y_petri/simulation/transitions/TS.rb', line 32

def gradient
  stoichiometry_matrix * rate_vector
end

#rate_closuresObject

Rate (flux, propensity) closures.



12
13
14
# File 'lib/y_petri/simulation/transitions/TS.rb', line 12

def rate_closures
  map &:rate_closure
end

#rate_vectorObject Also known as: flux_vector, propensity_vector

Rate (flux/propensity) vector.



18
19
20
# File 'lib/y_petri/simulation/transitions/TS.rb', line 18

def rate_vector
  to_rate_closure.call
end

#to_rate_closureObject Also known as: rate_closure

Builds the rate vector closure, that outputs the rate vector based on the system state when called.



46
47
48
49
# File 'lib/y_petri/simulation/transitions/TS.rb', line 46

def to_rate_closure
  rc = rate_closures
  -> { rc.map( &:call ).to_column_vector }
end

#Object Also known as: gradient_all

Gradient contribution to all places.



38
39
40
# File 'lib/y_petri/simulation/transitions/TS.rb', line 38

def 
  SM() * rate_vector
end