Class: YPetri::Simulation::Timeless::Recorder

Inherits:
Recorder
  • Object
show all
Defined in:
lib/y_petri/simulation/timeless/recorder.rb

Overview

Timeless recorder.

Constant Summary

Constants inherited from Recorder

Recorder::SAMPLING_DECIMAL_PLACES

Instance Attribute Summary collapse

Attributes inherited from Recorder

#features

Instance Method Summary collapse

Methods inherited from Recorder

#alert!, #initialize, #new_recording, #recording

Constructor Details

This class inherits a constructor from YPetri::Simulation::Recorder

Instance Attribute Details

#next_eventObject (readonly)

Returns the value of attribute next_event.



5
6
7
# File 'lib/y_petri/simulation/timeless/recorder.rb', line 5

def next_event
  @next_event
end

Instance Method Details

#back!Object

Backsteps the simulation.



17
18
19
# 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) ⇒ Object

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



11
12
13
# File 'lib/y_petri/simulation/timeless/recorder.rb', line 11

def reset! next_event: 0, **named_args
  super.tap { @next_event = next_event }
end