openrl.selfplay.wrappers package¶
Submodules¶
openrl.selfplay.wrappers.base_multiplayer_wrapper module¶
- class openrl.selfplay.wrappers.base_multiplayer_wrapper.BaseMultiPlayerWrapper(env, cfg=None, reward_class=None)[source]¶
Bases:
gymnasium.core.Env[gymnasium.core.WrapperObsType,gymnasium.core.WrapperActType],Generic[gymnasium.core.WrapperObsType,gymnasium.core.WrapperActType,gymnasium.core.ObsType,gymnasium.core.ActType]Base class for multi-player wrappers.
- property action_space: Union[gymnasium.spaces.space.Space[gymnasium.core.ActType], gymnasium.spaces.space.Space[gymnasium.core.WrapperActType]]¶
Return the
Envaction_spaceunless overwritten then the wrapperaction_spaceis used.
- abstract get_opponent_action(player_name: str, observation, reward, termination, truncation, info)[source]¶
- property np_random: numpy.random._generator.Generator¶
Returns the environment’s internal
_np_randomthat if not set will initialise with a random seed.- Returns:
Instances of np.random.Generator
- property observation_space: Union[gymnasium.spaces.space.Space[gymnasium.core.ObsType], gymnasium.spaces.space.Space[gymnasium.core.WrapperObsType]]¶
Return the
Envobservation_spaceunless overwritten then the wrapperobservation_spaceis used.
- reset(*, seed: Optional[int] = None, **kwargs)[source]¶
Uses the
reset()of theenvthat can be overwritten to change the returned data.
- self_player: Optional[str] = None¶
openrl.selfplay.wrappers.human_opponent_wrapper module¶
- class openrl.selfplay.wrappers.human_opponent_wrapper.HumanOpponentWrapper(env, cfg=None, reward_class=None)[source]¶
Bases:
gymnasium.core.Env[gymnasium.core.WrapperObsType,gymnasium.core.WrapperActType],Generic[gymnasium.core.WrapperObsType,gymnasium.core.WrapperActType,gymnasium.core.ObsType,gymnasium.core.ActType]
openrl.selfplay.wrappers.opponent_pool_wrapper module¶
- class openrl.selfplay.wrappers.opponent_pool_wrapper.OpponentPoolWrapper(env, cfg, reward_class=None)[source]¶
Bases:
gymnasium.core.Env[gymnasium.core.WrapperObsType,gymnasium.core.WrapperActType],Generic[gymnasium.core.WrapperObsType,gymnasium.core.WrapperActType,gymnasium.core.ObsType,gymnasium.core.ActType]
openrl.selfplay.wrappers.random_opponent_wrapper module¶
- class openrl.selfplay.wrappers.random_opponent_wrapper.RandomOpponentWrapper(env, cfg=None, reward_class=None)[source]¶
Bases:
gymnasium.core.Env[gymnasium.core.WrapperObsType,gymnasium.core.WrapperActType],Generic[gymnasium.core.WrapperObsType,gymnasium.core.WrapperActType,gymnasium.core.ObsType,gymnasium.core.ActType]