Skip to content

CSH Environments

RL Engine includes the runtime CSH environment ports under rle.environments.multi_agent. These ports keep the general environment mechanics, PettingZoo factories, Gymnasium registration points where applicable, and local RGB renderers, while leaving out the old labelling logic, constraint logic, shield, experiment, and obsolete demo layers.

Packages

Each package exposes its own env, raw_env, or parallel_env factories when the underlying environment supports them. Import factory names from the concrete package to avoid collisions:

from rle.environments.multi_agent.connector import parallel_env

env = parallel_env(
    grid_size=5,
    n_agents=2,
    generator="reservation_priority_conflict",
    render_mode="rgb_array",
)
observations, infos = env.reset(seed=0)
frame = env.render()
env.close()

Available ports:

Environment Package Notes
Car Platoon rle.environments.multi_agent.car_platoon Parallel PettingZoo platoon dynamics with CarAction and ANSI/RGB rendering.
Connector rle.environments.multi_agent.connector Jumanji-style grid routing with fixed reservation-conflict layouts and helper grid constants.
CookingZoo rle.environments.multi_agent.cooking_zoo AEC base plus parallel wrapper, recipe levels, graphics assets, and ActionScheme1/2/3.
Flatland rle.environments.multi_agent.flatland PettingZoo wrapper around the vendored Flatland runtime, including the single-track smoke scenario.
Level-Based Foraging rle.environments.multi_agent.level_based_foraging General LBF mechanics with cooperative loading and RGB rendering.
Pressure Plate rle.environments.multi_agent.pressure_plate Linear 3-6 agent layouts with icon-based RGB rendering.
RWARE rle.environments.multi_agent.rware Robotic warehouse mechanics, Gymnasium registrations, queue-conflict benchmark, and pygame/numpy renderer.

Rendering

All seven ports accept render_mode="rgb_array" and return a non-empty uint8 RGB frame from render(). render_mode="human" opens a pygame display where supported. Car Platoon also keeps render_mode="ansi" for text snapshots.

The renderers are environment-local. They do not depend on rle.reusable.rendering, so vendoring or adapting these environments in future projects only requires changing import paths and copying the matching assets.

Play Notebooks

Local play notebooks live at notebooks/environments/multi_agent/<environment>/play_mo.py. They use the repo's restartable PygameLaunchManager pattern and are intended for quick manual inspection, not reproducible experiments.