class YPetri::Simulation::Timeless::Recorder

Timeless recorder.

Attributes

next_event[R]

Public Instance Methods

back!() click to toggle source

Backsteps the simulation.

# File lib/y_petri/simulation/timeless/recorder.rb, line 17
def back!
  fail NotImplementedError, "Backstep for timeless simulation not done yet!"
end
reset!(next_event: 0, **named_args) click to toggle source

Like +YPetri::Simulation::Recording#reset+, but allowing for additional named argument :next_event that sets the event (label, hash key) of the next sample.

Calls superclass method YPetri::Simulation::Recorder#reset!
# File lib/y_petri/simulation/timeless/recorder.rb, line 11
def reset! next_event: 0, **named_args
  super.tap { @next_event = next_event }
end

Private Instance Methods

sample!() click to toggle source

Records the current system state under a numbered sample.

Calls superclass method YPetri::Simulation::Recorder#sample!
# File lib/y_petri/simulation/timeless/recorder.rb, line 25
def sample!
  super next_event
  @next_event = @next_event.next # "event" shoud implement next method
end