MeltingPot-PettingZoo¶
MeltingPot-PettingZoo ports Melting Pot substrates into native PettingZoo environments. The goal is behavioral parity with Melting Pot while keeping the runtime implementation easy to inspect, modify, and extend.
The reference Melting Pot checkout lives in refs/. Runtime code in this
project should not depend on meltingpot, dmlab2d, dm_env, or
ml_collections.
Install and run¶
Use uv for local commands:
Create an implemented substrate as a PettingZoo parallel environment:
from mp.coins.coins import parallel_env
env = parallel_env(render_mode="rgb_array")
observations, infos = env.reset(seed=0)
actions = {agent: env.action_space(agent).sample() for agent in env.agents}
observations, rewards, terminations, truncations, infos = env.step(actions)
Use render_mode=None for compact, raster-free categorical observations. See
Structured observations for the mode contract and
the grid keys exposed by each substrate. Spatial environments offer
observation_mode="local" (the default upstream view), "global" (the map in
world coordinates), and "focal" (the whole map centered on the agent and
rotated with its facing direction). All three work with categorical or RGB
observations; Real Matrix offers local/global payoff views only.
Implemented native families:
mp.coins.coinsmp.allelopathic_harvest.openmp.chemistrymp.commons_harvestmp.clean_up.clean_upmp.collaborative_cookingmp.coop_mining.coop_miningmp.daycare.daycaremp.externality_mushrooms.densemp.factory_commons.either_ormp.fruit_market.concentric_riversmp.gift_refinements.gift_refinementsmp.hidden_agenda.hidden_agendamp.paintballmp.predator_preymp.real_matrixmp.territorymp.the_matrix
Documentation¶
Build this site locally with:
Preview it while editing with: