Sha256: b7266fb17128c52a568768598f8b15d6ca05210dbea8aa170f9c78c4b14f95cc
Contents?: true
Size: 918 Bytes
Versions: 52
Compression:
Stored size: 918 Bytes
Contents
# encoding: utf-8 # A mixin for TS transition representations. # class YPetri::Simulation::TransitionRepresentation module Type_TS include Type_T include Type_S attr_reader :rate_closure # Initialization subroutine. # def init super @rate_closure = to_rate_closure end # Transition's rate, given the current system state. # def rate rate_closure.call end alias flux rate alias propensity rate # Firing of the transition (rate * Δtime). # def firing Δt rate * Δt end # Gradient contribution of the transition to all places. # def ∇ codomain >> stoichiometry.map { |coeff| rate * coeff } end alias gradient_all ∇ # Builds a flux closure. # def to_rate_closure build_closure end end # module Type_TS end # class YPetri::Simulation::TransitionRepresentation
Version data entries
52 entries across 52 versions & 1 rubygems