Sha256: dd8eac973c73c68f0b5ea26e84b3dede1c63f2e64fff2c200ebb515ae663e53b

Contents?: true

Size: 816 Bytes

Versions: 39

Compression:

Stored size: 816 Bytes

Contents

#encoding: utf-8

# A mixin for tS transition representations.
# 
class YPetri::Simulation::TransitionRepresentation
  module Type_tS
    include Type_t
    include Type_S
    
    attr_reader :firing_closure
    
    # Initialization subroutine.
    # 
    def init
      super
      @firing_closure = to_firing_closure
    end
    
    # Transition's firing, given the current system state.
    # 
    def firing
      firing_closure.call
    end
    
    # Change, to all places, as it would happen if the transition fired.
    # 
    def Δ
      codomain >> stoichiometry.map { |coeff| firing * coeff }
    end
    alias delta_all Δ
    
    # Builds a firing closure.
    # 
    def to_firing_closure
      build_closure
    end
  end # module Type_tS
end # class YPetri::Simulation::TransitionRepresentation

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
y_petri-2.2.4 lib/y_petri/simulation/transition_representation/tS.rb
y_petri-2.2.3 lib/y_petri/simulation/transition_representation/tS.rb
y_petri-2.2.2 lib/y_petri/simulation/transition_representation/tS.rb
y_petri-2.2.1 lib/y_petri/simulation/transition_representation/tS.rb
y_petri-2.2.0 lib/y_petri/simulation/transition_representation/tS.rb
y_petri-2.1.51 lib/y_petri/simulation/transition_representation/tS.rb
y_petri-2.1.50 lib/y_petri/simulation/transition_representation/tS.rb
y_petri-2.1.49 lib/y_petri/simulation/transition_representation/tS.rb
y_petri-2.1.48 lib/y_petri/simulation/transition_representation/tS.rb
y_petri-2.1.47 lib/y_petri/simulation/transition_representation/tS.rb
y_petri-2.1.46 lib/y_petri/simulation/transition_representation/tS.rb
y_petri-2.1.45 lib/y_petri/simulation/transition_representation/tS.rb
y_petri-2.1.44 lib/y_petri/simulation/transition_representation/tS.rb
y_petri-2.1.42 lib/y_petri/simulation/transition_representation/tS.rb
y_petri-2.1.40 lib/y_petri/simulation/transition_representation/tS.rb
y_petri-2.1.39 lib/y_petri/simulation/transition_representation/tS.rb
y_petri-2.1.37 lib/y_petri/simulation/transition_representation/tS.rb
y_petri-2.1.36 lib/y_petri/simulation/transition_representation/tS.rb
y_petri-2.1.35 lib/y_petri/simulation/transition_representation/tS.rb
y_petri-2.1.34 lib/y_petri/simulation/transition_representation/tS.rb