Environment Wrappers

Atari Convenience Functions

ftw.wrappers.atari.make_canonical_atari_environment(environment_name: str, to_float=True, evaluation: bool = False) → dm_env._environment.Environment
ftw.wrappers.atari.make_rgb_atari_environment_wo_frame_stack(environment_name: str, to_float=True, evaluation: bool = False, is_non_atari: bool = False, full_action_space: bool = True) → dm_env._environment.Environment

Multi-Agent Reinforcement Learning (MARL) Wrappers

OpenAI Gym MARL Wrapper

class ftw.wrappers.MarlGymWrapper(environment: gym.core.Env)

Bases: acme.wrappers.gym_wrapper.GymWrapper

__init__(environment: gym.core.Env)

Initialize self. See help(type(self)) for accurate signature.

reward_spec()

Describes the reward returned by the environment.

By default this is assumed to be a tuple of floats, one for each agent.

Returns:
A tuple of Array specs, one for each agent.

MARL-compatible Observation Action Reward Wrapper

class ftw.wrappers.ObservationActionRewardMarlWrapper(environment: dm_env._environment.Environment)

Bases: acme.wrappers.observation_action_reward.ObservationActionRewardWrapper

A wrapper that puts the previous action and reward into the observation of each respective agent.

Requires that the underlying environment has implemented a public attribute ‘n_agents’, indicating the number of agents of that environment.

__init__(environment: dm_env._environment.Environment)

Initialize self. See help(type(self)) for accurate signature.

observation_spec()

Defines the observations provided by the environment.

May use a subclass of specs.Array that specifies additional properties such as min and max bounds on the values.

Returns:
An Array spec, or a nested dict, list or tuple of Array specs.