VariationWrapper

class VariationWrapper(env, variation_mode: str | Space = 'same')[source]

Bases: VectorWrapper

Manages variation spaces for vectorized environments.

Handles batching of variation spaces across multiple environments, supporting either shared variations (same) or independent variations (different).

Parameters:
  • env – The vectorized Gymnasium environment to wrap.

  • variation_mode – Mode for handling variations across environments: - “same”: All environments share the same variation space (batched). - “different”: Each environment has independent variation spaces.

Raises:

ValueError – If variation_mode is invalid or sub-environment spaces don’t match.

Note

Base environment must have a variation_space attribute. If missing, variation spaces are set to None.

property envs