Environment Wrappers

class xuance.environment.utils.wrapper.XuanCeAtariEnvWrapper(env, **kwargs)[源代码]

基类:XuanCeEnvWrapper

Wraps an Atari environment that can run in XuanCe.

reset(**kwargs)[源代码]

Resets the environment with kwargs.

step(action)[源代码]

Steps through the environment with action.

class xuance.environment.utils.wrapper.XuanCeEnvWrapper(env, **kwargs)[源代码]

基类:object

Wraps an environment for single-agent system that can run in XuanCe.

property action_space

Returns the action space of the environment.

close()[源代码]

Closes the environment.

property max_episode_steps: int

Returns the maximum of episode steps.

property metadata: dict

Returns the environment metadata.

property observation_space: gymnasium.spaces.Space

Returns the observation space of the environment.

render(*args, **kwargs)[源代码]

Renders the environment.

property render_mode: str | None

Returns the environment render_mode.

reset(**kwargs)[源代码]

Resets the environment with kwargs.

step(action)[源代码]

Steps through the environment with action.

property unwrapped

Returns the base environment of the wrapper.

class xuance.environment.utils.wrapper.XuanCeMultiAgentEnvWrapper(env, **kwargs)[源代码]

基类:XuanCeEnvWrapper

Wraps an environment for multi-agent system that can run in XuanCe.

property agent_mask

Returns mask variables to mark alive agents in multi-agent environment.

property avail_actions

Returns mask variables to mark available actions for each agent.

property env_info: dict | None

Returns the information of the environment.

reset(**kwargs) Tuple[dict, dict][源代码]

Resets the environment with kwargs.

property state

Returns global states in the multi-agent environment.

property state_space: gymnasium.spaces.Space

Returns the global state space of the environment.

step(action)[源代码]

Steps through the environment with action.