Module: YPetri::Simulation::Transitions::Type_ts
Instance Method Summary collapse
-
#delta ⇒ Object
Delta contribution to free places.
-
#delta_closures ⇒ Object
ts transitions have action closures.
-
#to_delta_closure ⇒ Object
(also: #delta_closure)
Constructs a delta closure that outputs a delta vector corresponding to free places.
-
#Δ ⇒ Object
(also: #delta_all)
Delta contribution to all places.
Instance Method Details
#delta ⇒ Object
Delta contribution to free places.
18 19 20 |
# File 'lib/y_petri/simulation/transitions/ts.rb', line 18 def delta delta_closure.call end |
#delta_closures ⇒ Object
ts transitions have action closures.
12 13 14 |
# File 'lib/y_petri/simulation/transitions/ts.rb', line 12 def delta_closures map &:delta_closure end |
#to_delta_closure ⇒ Object Also known as: delta_closure
Constructs a delta closure that outputs a delta vector corresponding to free places. The vector is the delta contribution of the transitions in this collection.
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/y_petri/simulation/transitions/ts.rb', line 33 def to_delta_closure fp = free_places closures = delta_closures sMV = simulation.MarkingVector code_sections = map.with_index do |t, i| "a = closures[#{i}].call\n" + t.increment_by_codomain_code( vector: "delta", source: "a" ) end body = code_sections.join( "\n" ) λ = <<-LAMBDA -> do delta = sMV.zero( fp ) #{body} return delta end LAMBDA eval λ end |
#Δ ⇒ Object Also known as: delta_all
Delta contribution to all places
24 25 26 |
# File 'lib/y_petri/simulation/transitions/ts.rb', line 24 def Δ f2a * delta end |