Skip to content

GridHunt

Heterogeneous, mixed-motive predator-prey environments for multi-agent reinforcement learning and human-agent teaming, with a PettingZoo ParallelEnv API.

Toxic stag Military Swarm

  • Heterogeneous agents. Capture power, speed, vision radius and terrain restrictions are set per agent: scouts that cannot capture, strong but short-sighted bruisers, boats confined to the sea.
  • Mixed-motive scenarios. Stag hunts, toxic prey that only one agent can recognise, trapped targets, crowding penalties. Rewards are individual by default, or shared with reward_mode="team".
  • Human-agent teaming. gridhunt.hat runs studies with people in or on the loop: keyboard control with reaction times, AI teammates, buttons that switch which team of policies plays, cues only the participant can see, questionnaires and per-participant logs.
  • Baselines and pretrained teams. IPPO, MAPPO and HAPPO over 20 seeds with confidence intervals (benchmark), and the trained teams as numpy-only policies (gridhunt.zoo).

Install

pip install gridhunt            # environments only (numpy, gymnasium, pettingzoo)
pip install "gridhunt[render]"  # + pygame window, rgb_array frames and the interactive GUI
pip install "gridhunt[hat]"     # + the human-agent teaming toolkit

Quick start

import gridhunt

env = gridhunt.make("GridHunt-ClassicStag-v0")
observations, infos = env.reset(seed=42)
while env.agents:
    actions = {agent: env.action_space(agent).sample() for agent in env.agents}
    observations, rewards, terminations, truncations, infos = env.step(actions)

Continue with getting started, browse the environments, or see how to run a study.