Monty.SensorModules.SensorModule.TransformContext (ExTbpMonty.Core v0.1.0)

Copy Markdown View Source

What a transform knows about the step it is transforming.

Mirrors tbp/monty/sensor_modules/sensor_module.py::TransformContext: the random stream, where the agent and this sensor are, and the two flags that decide whether the step is one to learn from and whether a failure inside a transform should be raised or reported.

Monty passes its one runtime rng here. The port passes the stream this sensor may draw from at this step (Monty.Context.rng_for/2), so a transform that samples is reproducible from the episode seed alone (docs/monty-differences.md §2.1).

Summary

Types

rng()

@type rng() :: :rand.state()

t()

@type t() :: %Monty.SensorModules.SensorModule.TransformContext{
  agent_state: Monty.Frameworks.Models.MotorSystemState.AgentState.t() | nil,
  motor_only_step: boolean(),
  rng: rng() | nil,
  sensor_state: Monty.Frameworks.Models.MotorSystemState.SensorState.t() | nil,
  suppress_runtime_errors: boolean()
}