{
  "name": "PettingZoo and RLlib multi-agent API vocabulary compared",
  "description": "Compares how PettingZoo's Parallel API and Ray RLlib's MultiAgentEnv name the same multi-agent reinforcement learning concepts, compiled from each project's current official documentation pages.",
  "page": "https://casrai.org/guides/multi-agent-reinforcement-learning",
  "publisher": "CASRAI",
  "license": "https://creativecommons.org/licenses/by/4.0/",
  "dateModified": "2026-11-16T22:02:55Z",
  "temporalCoverage": null,
  "spatialCoverage": null,
  "columns": [
    {
      "name": "Concept",
      "unit": "",
      "description": ""
    },
    {
      "name": "PettingZoo (Parallel API)",
      "unit": "",
      "description": ""
    },
    {
      "name": "RLlib (MultiAgentEnv)",
      "unit": "",
      "description": ""
    }
  ],
  "rows": [
    {
      "Concept": "Reset return",
      "PettingZoo (Parallel API)": "observations, infos: dictionaries keyed by agent name",
      "RLlib (MultiAgentEnv)": "Dictionaries keyed by agent ID"
    },
    {
      "Concept": "Step input",
      "PettingZoo (Parallel API)": "One dictionary of actions keyed by agent name",
      "RLlib (MultiAgentEnv)": "Dictionary of actions keyed by agent ID"
    },
    {
      "Concept": "Step return",
      "PettingZoo (Parallel API)": "Five dictionaries: observations, rewards, terminations, truncations, infos",
      "RLlib (MultiAgentEnv)": "Dictionaries keyed by agent ID"
    },
    {
      "Concept": "Agent roster",
      "PettingZoo (Parallel API)": "agents (current, can change in an episode); possible_agents (fixed, matches space keys)",
      "RLlib (MultiAgentEnv)": "possible_agents, agents, observation_spaces, action_spaces"
    },
    {
      "Concept": "Who acts next",
      "PettingZoo (Parallel API)": "All agents in agents act each step",
      "RLlib (MultiAgentEnv)": "Agent IDs present in the returned observation dictionary"
    },
    {
      "Concept": "Episode end",
      "PettingZoo (Parallel API)": "Loop ends when agents is empty",
      "RLlib (MultiAgentEnv)": "The special key __all__ ends the episode for all agents"
    },
    {
      "Concept": "Agent-to-policy link",
      "PettingZoo (Parallel API)": "Not part of the environment API",
      "RLlib (MultiAgentEnv)": "Each agent maps to one policy; one policy may control several agents via policy_mapping_fn"
    }
  ],
  "sources": [
    {
      "title": "PettingZoo Parallel API",
      "url": "https://pettingzoo.farama.org/api/parallel/",
      "accessed": "2026-11-14"
    },
    {
      "title": "Ray RLlib Multi-agent environments",
      "url": "https://docs.ray.io/en/latest/rllib/multi-agent-envs.html",
      "accessed": "2026-11-14"
    }
  ]
}