Sha256: 4250a760d00c50ca7eff2ad9a728ffa8d8da053274b88f2d944cdb9638afb7f2

Contents?: true

Size: 1.08 KB

Versions: 39

Compression:

Stored size: 1.08 KB

Contents

#encoding: utf-8

# A mixin for S transition representations.
# 
class YPetri::Simulation::TransitionRepresentation
  module Type_S
    include Type_a
    
    attr_reader :stoichiometry
    
    # Sparse stoichiometry vector corresponding to the free places.
    # 
    attr_reader :sparse_stoichiometry_vector
    
    # Sparse stoichiometry vector corresponding to all the places.
    # 
    attr_reader :sparse_sv
    
    # True for stoichiometric transitions.
    # 
    def S?
      true
    end
    alias stoichiometric? S?
    
    # False for stoichiometric transitions.
    # 
    def s?
      false
    end
    alias nonstoichiometric? s?
    
    # Initialization subroutine.
    # 
    def init
      super
      @stoichiometry = source.stoichiometry
      @sparse_stoichiometry_vector =
        Matrix.correspondence_matrix( codomain, free_places ) *
        stoichiometry.to_column_vector
      @sparse_sv = Matrix.correspondence_matrix( codomain, places ) *
        stoichiometry.to_column_vector
    end
  end # module Type_S
end # class YPetri::Simulation::TransitionRepresentation

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
y_petri-2.2.4 lib/y_petri/simulation/transition_representation/S.rb
y_petri-2.2.3 lib/y_petri/simulation/transition_representation/S.rb
y_petri-2.2.2 lib/y_petri/simulation/transition_representation/S.rb
y_petri-2.2.1 lib/y_petri/simulation/transition_representation/S.rb
y_petri-2.2.0 lib/y_petri/simulation/transition_representation/S.rb
y_petri-2.1.51 lib/y_petri/simulation/transition_representation/S.rb
y_petri-2.1.50 lib/y_petri/simulation/transition_representation/S.rb
y_petri-2.1.49 lib/y_petri/simulation/transition_representation/S.rb
y_petri-2.1.48 lib/y_petri/simulation/transition_representation/S.rb
y_petri-2.1.47 lib/y_petri/simulation/transition_representation/S.rb
y_petri-2.1.46 lib/y_petri/simulation/transition_representation/S.rb
y_petri-2.1.45 lib/y_petri/simulation/transition_representation/S.rb
y_petri-2.1.44 lib/y_petri/simulation/transition_representation/S.rb
y_petri-2.1.42 lib/y_petri/simulation/transition_representation/S.rb
y_petri-2.1.40 lib/y_petri/simulation/transition_representation/S.rb
y_petri-2.1.39 lib/y_petri/simulation/transition_representation/S.rb
y_petri-2.1.37 lib/y_petri/simulation/transition_representation/S.rb
y_petri-2.1.36 lib/y_petri/simulation/transition_representation/S.rb
y_petri-2.1.35 lib/y_petri/simulation/transition_representation/S.rb
y_petri-2.1.34 lib/y_petri/simulation/transition_representation/S.rb