Skip to main content
The EnvironmentWrapper class provides a common interface for interacting with environments, whether they are local (LocalEnvironmentWrapper) or remote (RemoteEnvironmentWrapper).

Properties

observation_space

Get the observation space (last response data). Returns:
  • FrameDataRaw or None: The FrameDataRaw object from the last response, or None if no response has been set yet.
Example:

action_space

Get the action space (available actions). Returns:
  • list[GameAction]: A list of GameAction objects representing available actions. Returns an empty list if no response has been set yet.
Example:

info

Get the environment information. Returns:
  • EnvironmentInfo: The EnvironmentInfo object for this environment.
Example:

Methods

reset()

Reset the environment and return the initial frame data. Returns:
  • FrameDataRaw or None: FrameDataRaw object with initial game state, or None if reset failed.
Example:

step()

Perform a step in the environment. Signature: step(action, data=None, reasoning=None) Parameters:
  • action (GameAction): The game action to perform (e.g., GameAction.ACTION1, GameAction.ACTION2).
  • data (dict[str, Any], optional): Optional action data dictionary. For complex actions, should contain "x" and "y" coordinates.
  • reasoning (dict[str, Any], optional): Optional reasoning dictionary to include in recordings.
Returns:
  • FrameDataRaw or None: FrameDataRaw object with updated game state, or None if step failed.
Example: