rlmesh.types.PredictContext

classfrom rlmesh.types import PredictContext[source]

What a predict corner is told about the episode it is predicting for.

Delivered as a trailing context argument, and only to a corner whose signature declares one – so it is additive. A model that interleaves episodes keys everything it remembers by episode_id; state is the slot to keep it in, so it does not need its own bookkeeping.

episode_id

attribute[source]
episode_id: str

The runtime-minted id of this episode (UUIDv7, never repeats). "" for an anonymous lane with no identity.

episode_seed

attribute[source]
episode_seed: int | None

The seed this episode was reset with, or None when it was not explicitly seeded.

predict_index

attribute[source]
predict_index: int

How many times this episode has been predicted for already – 0 on its first predict. The re-plan ordinal, not the env step count (a chunked model re-plans once per chunk).

predict_seed

attribute[source]
predict_seed: int | None

A reproducible per-predict seed mixed from episode_seed and predict_index; None when the episode carries no seed. Seed a stochastic head with this rather than once per episode: interleaved episodes advance the same global generators, so seeding once cannot reproduce.

state

attribute[source]
state: dict[str, Any]

A dict that lives as long as the episode does, for whatever the model wants to carry across its predicts. Dropped when the episode ends.