Module: YPetri::Simulation::Transitions::Type_S

Includes:
Type_a
Included in:
Type_TS, Type_tS
Defined in:
lib/y_petri/simulation/transitions/S.rb

Instance Method Summary collapse

Instance Method Details

#SMObject Also known as: stoichiometry_matrix_all

Returns the collection’s stoichiometry matrix versus all places.



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

def SM
  map( &:sparse_sv )
    .reduce( Matrix.empty( places.size, 0 ), :join_right )
end

#stoichiometry_matrixObject

Returns the collection’s stoichiometry matrix versus free places.



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

def stoichiometry_matrix
  map( &:sparse_stoichiometry_vector )
    .reduce( Matrix.empty( places.free.size, 0 ), :join_right )
end