Sha256: 0c8eec7b0828c4a5e19765f2e6df2f38a84e4c3d3b04518329be238b4655ba0a

Contents?: true

Size: 623 Bytes

Versions: 1

Compression:

Stored size: 623 Bytes

Contents

# encoding: utf-8

# Euler method with timeless transitions firing after each step.
# 
class YPetri::Core::Timed
  module PseudoEuler
    include Euler

    # Name of this method.
    # 
    def simulation_method
      :pseudo_euler
    end

    # Computes Δ for the period of Δt.
    # 
    def delta Δt
      super + delta_timeless
    end
    alias Δ delta

    # Makes a single step by Δt.
    # 
    def step! Δt=simulation.step
      increment_marking_vector Δ( Δt )
      assignment_transitions_all_fire!
      simulation.increment_time! Δt
      alert
    end
  end # PseudoEuler
end # YPetri::Core::Timed

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
y_petri-2.1.3 lib/y_petri/core/timed/pseudo_euler.rb