EnsureGoalInfoWrapper

class EnsureGoalInfoWrapper(env, check_reset, check_step: bool = False)[source]

Bases: Wrapper

Validates that ‘goal’ key is present in info dict during reset and/or step.

Useful for goal-conditioned environments to ensure goal information is provided.

Parameters:
  • env – The Gymnasium environment to wrap.

  • check_reset – If True, validates ‘goal’ key is in info after reset().

  • check_step – If True, validates ‘goal’ key is in info after step().

Raises:

RuntimeError – If ‘goal’ key is missing when validation is enabled.

reset(*args, **kwargs)[source]

Uses the reset() of the env that can be overwritten to change the returned data.

step(action)[source]

Uses the step() of the env that can be overwritten to change the returned data.