Recording and playback#

Genesis World records simulation data through a recorder framework: register a recorder with the scene, describe what to sample, then step the scene as usual. The recorder samples on its own schedule and either writes the data to a file or draws it in a live plot, so you never thread logging code through your step loop.

For the recording workflow and worked examples, see Recording data.

Components#

  • Recorder: the base class that processes each sampled value. See Recorder.

  • RecorderManager: the per-scene coordinator that drives every registered recorder as the scene builds, steps, and resets. See RecorderManager.

  • File writers: NPZFile, CSVFile, and VideoFile persist data to disk, and TrajectoryFile records the scene itself for replay. See File writers.

  • Plotters: PyQtLinePlot, MPLLinePlot, MPLImagePlot, and MPLVectorFieldPlot visualize data live and can save the animation. See Plotters.

Every recorder options class is exported from gs.recorders.

Components reference#

Shared options#

Every recorder options class inherits these fields from RecorderOptions.

class genesis.options.recorders.RecorderOptions(*, hz: float | None = None, buffer_size: int = 0, buffer_full_wait_time: float = 0.1) None[source]#

Options for recording simulation data by automatically sampling data from a data source, e.g. a sensor.

Parameters:
  • hz (float, optional) – The frequency at which to sample data, in Hz (samples per second). If None, the data will be sampled every step.

  • buffer_size (int, optional) – Applicable when run_in_thread is True. The size of the data queue buffer. Defaults to 0, which means infinite size.

  • buffer_full_wait_time (float, optional) – Applicable when run_in_thread is True. The time to wait for buffer space to become available when the buffer is full. Defaults to 0.1 seconds.

See also#