Module: YPetri::Simulation::Transitions::Type_tS

Includes:
Type_S, Type_t
Defined in:
lib/y_petri/simulation/transitions/tS.rb

Instance Method Summary collapse

Methods included from Type_S

#SM, #stoichiometry_matrix

Instance Method Details

#deltaObject

Delta contribution to free places.


30
31
32
# File 'lib/y_petri/simulation/transitions/tS.rb', line 30

def delta
  stoichiometry_matrix * firing_vector
end

#firingObject

Firing vector for these tS transitions, returned as array.


24
25
26
# File 'lib/y_petri/simulation/transitions/tS.rb', line 24

def firing
  firing_closures.map &:call
end

#firing_closuresObject

tS transitions have firing closures.


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

def firing_closures
  map &:firing_closure
end

#firing_vectorObject

Firing vector (to be multiplied by the stoichiometry to get deltas)


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

def firing_vector
  firing_closure.call
end

#to_firing_closureObject Also known as: firing_closure

Builds the firing vector closure, that outputs the firing vector based on the system state when called.


44
45
46
47
# File 'lib/y_petri/simulation/transitions/tS.rb', line 44

def to_firing_closure
  closures = firing_closures
  -> { closures.map( &:call ).to_column_vector }
end

#ΔObject Also known as: delta_all

Delta contribution to all places


36
37
38
# File 'lib/y_petri/simulation/transitions/tS.rb', line 36

def