Sha256: e2f3d3bfed1a965b082fdba3d69877a5a230275b1ff9fdce8616da150903fe69

Contents?: true

Size: 668 Bytes

Versions: 39

Compression:

Stored size: 668 Bytes

Contents

module YPetri::Simulation::Timeless
  # A timeless recorder.
  # 
  class Recorder < YPetri::Simulation::Recorder
    attr_reader :next_event

    # Like +YPetri::Simulation::Recording#reset+, but allowing for additional
    # named argument +:next_sample+ that sets the event (label, hash key) of
    # the next sample.
    # 
    def reset! **nn
      super
      @next_event = nn[:next_event] || 0
    end

    private

    # Records the current system state under a numbered sample.
    # 
    def sample!
      super next_event
      @next_event = @next_event.next # "event" shoud implement next method
    end
  end # Recorder
end # YPetri::Simulation::Timeless

Version data entries

39 entries across 39 versions & 1 rubygems

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