Module: YPetri::Simulation::TransitionRepresentation::Type_S

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Type_a

#A?, #a?, #delta

Instance Attribute Details

#sparse_stoichiometry_vectorObject (readonly)

Sparse stoichiometry vector corresponding to the free places.


13
14
15
# File 'lib/y_petri/simulation/transition_representation/S.rb', line 13

def sparse_stoichiometry_vector
  @sparse_stoichiometry_vector
end

#sparse_svObject (readonly)

Sparse stoichiometry vector corresponding to all the places.


17
18
19
# File 'lib/y_petri/simulation/transition_representation/S.rb', line 17

def sparse_sv
  @sparse_sv
end

#stoichiometryObject (readonly)

Returns the value of attribute stoichiometry


9
10
11
# File 'lib/y_petri/simulation/transition_representation/S.rb', line 9

def stoichiometry
  @stoichiometry
end

Instance Method Details

#build_closureObject

Builds the S transition's function into a closure. Functions of S transitions return only a single number (flux for TS, firing for tS).


49
50
51
52
53
# File 'lib/y_petri/simulation/transition_representation/S.rb', line 49

def build_closure
  mv, f = simulation.m_vector, function
  

#initObject

Initialization subroutine.


35
36
37
38
39
40
41
42
43
# File 'lib/y_petri/simulation/transition_representation/S.rb', line 35

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

#s?Boolean Also known as: nonstoichiometric?

False for stoichiometric transitions.

Returns:

  • (Boolean)

28
29
30
# File 'lib/y_petri/simulation/transition_representation/S.rb', line 28

def s?
  false
end

#S?Boolean Also known as: stoichiometric?

True for stoichiometric transitions.

Returns:

  • (Boolean)

21
22
23
# File 'lib/y_petri/simulation/transition_representation/S.rb', line 21

def S?
  true
end