Module: YPetri::Simulation::Transitions::Type_A

Defined in:
lib/y_petri/simulation/transitions/A.rb

Instance Method Summary collapse

Instance Method Details

#actObject

Returns the assignments to all places, as they would happen if A transition could change their values.



32
33
34
# File 'lib/y_petri/simulation/transitions/A.rb', line 32

def act
  each_with_object Hash.new do |t, hsh| hsh.update( t.act ) end
end

#actionObject

Combined assignment action, as it would occur if these A transitions fired in order, as hash place >> action.



25
26
27
# File 'lib/y_petri/simulation/transitions/A.rb', line 25

def action
  each_with_object Hash.new do |t, hsh| hsh.update( t.action ) end
end

#assignment_closuresObject

Assignment closures.



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

def assignment_closures
  map &:assignment_closure
end

#direct_assignment_closuresObject

Assignment closures that directly affect the marking when called.



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

def direct_assignment_closures
  map &:direct_assignment_closure
end

#initializeObject



7
8
# File 'lib/y_petri/simulation/transitions/A.rb', line 7

def initialize
end

#to_assignment_closureObject Also known as: assignment_closure

Builds a joint assignment closure.



38
39
40
41
# File 'lib/y_petri/simulation/transitions/A.rb', line 38

def to_assignment_closure
  closures = assignment_closures
  -> { closures.each &:call }
end

#to_direct_assignment_closureObject Also known as: direct_assignment_closure

Builds a joint direct assignment closure, directly bound to the marking vector and changing its values when called.



47
48
49
50
# File 'lib/y_petri/simulation/transitions/A.rb', line 47

def to_direct_assignment_closure
  closures = direct_assignment_closures
  -> { closures.each &:call }
end