Skip to main content

SimulationGrid

observations.SimulationGrid(t0, dt, n_steps, first_sample_offset=None)

Describe the regular input grid presented to a temporal monitor.

t0 is the original simulation origin and may be a scalar JAX value. The other fields are structural. first_sample_offset describes the first input label relative to t0 and defaults to dt for raw native solver output.

Parameters

Name Type Description Default
t0 Any Original simulation origin. Callback code may use it in JAX arithmetic but must not require its Python value. required
dt float Input interval in milliseconds. required
n_steps int Number of input samples in the complete trajectory. required
first_sample_offset float | None Label of the first input sample relative to t0. None means dt, the native solver’s post-step convention. None

Methods

Name Description
output Describe an output sampled every period on this grid.

output

observations.SimulationGrid.output(
    period,
    *,
    label='last_input',
    variable_names=None,
)

Describe an output sampled every period on this grid.

Parameters

Name Type Description Default
period Output interval. It must be a positive integer multiple of dt. required
label Timestamp rule for each emitted sample. "last_input" labels it with the last consumed input sample, "window_center" with the center of the completed window, and "period_end" with the end of the period measured from the original origin t0. Labels do not change when a sample is emitted: every rule emits only after its complete window was consumed. 'last_input'
variable_names Output channel names, or None. None

Returns

Name Type Description
ObservationOutput