Sha256: 92a5efd9d4b5eb7685a8068abe5787ed29d7b6a13203eebe85edf25c97453fd2
Contents?: true
Size: 1.09 KB
Versions: 49
Compression:
Stored size: 1.09 KB
Contents
# encoding: utf-8 # Mixin for collections of TS transitions. # class YPetri::Simulation::Transitions module Type_TS include Type_T include Type_S # Rate (flux, propensity) closures. # def rate_closures map &:rate_closure end # Rate (flux/propensity) vector. # def rate_vector to_rate_closure.call end alias flux_vector rate_vector alias propensity_vector rate_vector # Firing vector (rate vector * Δtime). # def firing_vector Δt rate_vector * Δt end # Gradient contribution to free places. # def gradient stoichiometry_matrix * rate_vector end # Gradient contribution to all places. # def ∇ SM() * rate_vector end alias gradient_all ∇ # Builds the rate vector closure, that outputs the rate vector based on # the system state when called. # def to_rate_closure rc = rate_closures -> { rc.map( &:call ).to_column_vector } end alias rate_closure to_rate_closure end # module Type_TS end # class YPetri::Simulation::Transitions
Version data entries
49 entries across 49 versions & 1 rubygems