Skip to content
class

StepResult

extendsNamedTuple
StepResult()

What one environment step returns.

Attributes

observationTensor
What the agent sees after the step, (C, H, W) for the pixel world models.
rewardfloat
Reward for the transition.
terminatedbool
The episode reached a terminal state — a failure, a goal, an absorbing state. Nothing follows it, so a discount head should learn 0 here.
truncatedbool
The episode was cut short from outside — a time limit, a step budget. Something would have followed, so the value function should still bootstrap.

Notes

Termination and truncation are separated because a world model genuinely needs them apart. Collapsing them into one done flag, which is the older convention, teaches a discount head that running out of clock is the same as dying — and then the planner refuses to look past the horizon it was trained under.

Used by 1