Behavior Suite#

DeepMind Behavior Suite#

Behavior Suite is a collection of carefully-designed experiments that investigate various aspects of agent behavior through shared benchmarks.

Shimmy provides compatibility wrappers to convert Behavior Suite environments to Gymnasium.

Behavior Suite Visualization


To install shimmy and required dependencies:

pip install shimmy[bsuite]

We also provide a Dockerfile for reproducibility and cross-platform compatibility:

curl | docker build -t bsuite -f - . && docker run -it bsuite


Load a bsuite environment:

import gymnasium as gym

env = gym.make("bsuite/catch-v0", render_mode="human")

Run the environment:

observation, info = env.reset(seed=42)
for _ in range(1000):
   action = env.action_space.sample()  # this is where you would insert your policy
   observation, reward, terminated, truncated, info = env.step(action)

   if terminated or truncated:
      observation, info = env.reset()

To get a list of all available bsuite environments (23 total):

from gymnasium.envs.registration import registry
    for env_id in registry
    if env_id.startswith("bsuite") and env_id != "bsuite/compatibility-env-v0"

Class Description#

class shimmy.bsuite_compatibility.BSuiteCompatibilityV0(env: Environment, render_mode: str | None = None)[source]#

A compatibility wrapper that converts a BSuite environment into a gymnasium environment.


Bsuite uses np.random.RandomState, a legacy random number generator while gymnasium uses np.random.Generator, therefore the return type of np_random is different from expected.

Initialises the environment with a render mode along with render information.

metadata: dict[str, Any] = {'render_modes': []}#
observation_space: spaces.Space[ObsType]#
action_space: spaces.Space[ActType]#
reset(*, seed: int | None = None, options: dict[str, Any] | None = None) tuple[ObsType, dict[str, Any]][source]#

Resets the bsuite environment.

step(action: int) tuple[ObsType, float, bool, bool, dict[str, Any]][source]#

Steps through the bsuite environment.

render() np.ndarray | None[source]#

Renders the bsuite env.


Closes the environment.

property np_random: RandomState#

This should be np.random.Generator but bsuite uses np.random.RandomState.