Shortcuts

openrl.envs.wrappers package

Submodules

openrl.envs.wrappers.base_wrapper module

class openrl.envs.wrappers.base_wrapper.BaseObservationWrapper(env)[源代码]

基类:gymnasium.core.Wrapper[gymnasium.core.WrapperObsType, gymnasium.core.ActType, gymnasium.core.ObsType, gymnasium.core.ActType]

class openrl.envs.wrappers.base_wrapper.BaseWrapper(env, reward_class=None)[源代码]

基类:gymnasium.core.Env[gymnasium.core.WrapperObsType, gymnasium.core.WrapperActType], Generic[gymnasium.core.WrapperObsType, gymnasium.core.WrapperActType, gymnasium.core.ObsType, gymnasium.core.ActType]

property agent_num
property env_name
property has_auto_reset
step(action)[源代码]

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

property use_monitor

openrl.envs.wrappers.extra_wrappers module

class openrl.envs.wrappers.extra_wrappers.AutoReset(env: gymnasium.core.Env)[源代码]

基类:gymnasium.core.Env[gymnasium.core.WrapperObsType, gymnasium.core.WrapperActType], Generic[gymnasium.core.WrapperObsType, gymnasium.core.WrapperActType, gymnasium.core.ObsType, gymnasium.core.ActType]

property has_auto_reset
class openrl.envs.wrappers.extra_wrappers.DictWrapper(env)[源代码]

基类:gymnasium.core.Wrapper[gymnasium.core.WrapperObsType, gymnasium.core.ActType, gymnasium.core.ObsType, gymnasium.core.ActType]

observation(observation)[源代码]

Returns a modified observation.

Args:

observation: The env observation

Returns:

The modified observation

class openrl.envs.wrappers.extra_wrappers.GIFWrapper(env, gif_path: str)[源代码]

基类:gymnasium.core.Env[gymnasium.core.WrapperObsType, gymnasium.core.WrapperActType], Generic[gymnasium.core.WrapperObsType, gymnasium.core.WrapperActType, gymnasium.core.ObsType, gymnasium.core.ActType]

close()[源代码]

Closes the wrapper and env.

reset(**kwargs)[源代码]

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

step(action)[源代码]

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

class openrl.envs.wrappers.extra_wrappers.RemoveTruncated(env: gymnasium.core.Env)[源代码]

基类:gymnasium.core.Env[gymnasium.core.WrapperObsType, gymnasium.core.WrapperActType], Generic[gymnasium.core.WrapperObsType, gymnasium.core.WrapperActType, gymnasium.core.ObsType, gymnasium.core.ActType]

openrl.envs.wrappers.multiagent_wrapper module

class openrl.envs.wrappers.multiagent_wrapper.Single2MultiAgentWrapper(env)[源代码]

基类:gymnasium.core.Env[gymnasium.core.WrapperObsType, gymnasium.core.WrapperActType], Generic[gymnasium.core.WrapperObsType, gymnasium.core.WrapperActType, gymnasium.core.ObsType, gymnasium.core.ActType]

property agent_num
reset(*, seed=None, options=None)[源代码]

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

step(action)[源代码]

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

openrl.envs.wrappers.util module

openrl.envs.wrappers.util.nest_expand_dim(input: Any) Any[源代码]

Module contents

class openrl.envs.wrappers.AutoReset(env: gymnasium.core.Env)[源代码]

基类:gymnasium.core.Env[gymnasium.core.WrapperObsType, gymnasium.core.WrapperActType], Generic[gymnasium.core.WrapperObsType, gymnasium.core.WrapperActType, gymnasium.core.ObsType, gymnasium.core.ActType]

property has_auto_reset
class openrl.envs.wrappers.BaseObservationWrapper(env)[源代码]

基类:gymnasium.core.Wrapper[gymnasium.core.WrapperObsType, gymnasium.core.ActType, gymnasium.core.ObsType, gymnasium.core.ActType]

class openrl.envs.wrappers.BaseWrapper(env, reward_class=None)[源代码]

基类:gymnasium.core.Env[gymnasium.core.WrapperObsType, gymnasium.core.WrapperActType], Generic[gymnasium.core.WrapperObsType, gymnasium.core.WrapperActType, gymnasium.core.ObsType, gymnasium.core.ActType]

property agent_num
property env_name
property has_auto_reset
step(action)[源代码]

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

property use_monitor
class openrl.envs.wrappers.DictWrapper(env)[源代码]

基类:gymnasium.core.Wrapper[gymnasium.core.WrapperObsType, gymnasium.core.ActType, gymnasium.core.ObsType, gymnasium.core.ActType]

observation(observation)[源代码]

Returns a modified observation.

Args:

observation: The env observation

Returns:

The modified observation

class openrl.envs.wrappers.GIFWrapper(env, gif_path: str)[源代码]

基类:gymnasium.core.Env[gymnasium.core.WrapperObsType, gymnasium.core.WrapperActType], Generic[gymnasium.core.WrapperObsType, gymnasium.core.WrapperActType, gymnasium.core.ObsType, gymnasium.core.ActType]

close()[源代码]

Closes the wrapper and env.

reset(**kwargs)[源代码]

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

step(action)[源代码]

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

class openrl.envs.wrappers.RemoveTruncated(env: gymnasium.core.Env)[源代码]

基类:gymnasium.core.Env[gymnasium.core.WrapperObsType, gymnasium.core.WrapperActType], Generic[gymnasium.core.WrapperObsType, gymnasium.core.WrapperActType, gymnasium.core.ObsType, gymnasium.core.ActType]

class openrl.envs.wrappers.Single2MultiAgentWrapper(env)[源代码]

基类:gymnasium.core.Env[gymnasium.core.WrapperObsType, gymnasium.core.WrapperActType], Generic[gymnasium.core.WrapperObsType, gymnasium.core.WrapperActType, gymnasium.core.ObsType, gymnasium.core.ActType]

property agent_num
reset(*, seed=None, options=None)[源代码]

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

step(action)[源代码]

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