Sha256: 420889decaa5adc9de66bf13e7d74c589b05f10c48aeff212b285ca68fd9a4e0

Contents?: true

Size: 1.01 KB

Versions: 1

Compression:

Stored size: 1.01 KB

Contents

# encoding: utf-8

# Timeless simulator core. Knows thus far only one, but potentially several
# methods applicable to timeless systems simulations.
# 
class YPetri::Core::Timeless
  ★ YPetri::Core
  
  require_relative 'timeless/basic'
  
  METHODS = { basic: Basic } # basic PN execution
  # Note: the reason why Timeless core has distinct basic method is because
  # without having to consider timed transitions, it can be made simpler.

  # This inquirer (=Boolean selector) is always false for timeless cores.
  # 
  def timed?; false end

  # This inquirer (=Boolean selector) is always true for timeless cores.
  # 
  def timeless?; true end

  def initialize **named_args
    super
    extend METHODS.fetch simulation_method
  end
  
  # Computes the system state delta.
  # 
  def delta
    delta_timeless # this method was taken from core.rb
    # delta_ts + delta_tS # this is the contents of delta_timeless method
  end

  # Computes the system state delta.
  # 
  def Δ
    delta
  end
end # module YPetri::Core::Timeless

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
y_petri-2.4.0 lib/y_petri/core/timeless.rb