Skip to content

Pig chase

Pig chase

Two hunters start in opposite corners of a 9×9 maze with the pig in the middle. Catching the pig needs both hunters on its cell at once; after every capture everyone returns to their starting cells. The scenario has no randomness, so it tests whether a team can learn and keep a fixed joint plan.

import gridhunt
env = gridhunt.make("GridHunt-PigChase-v0")

What it tests

Learning and keeping one joint plan. Nothing is random, the pig needs both hunters at once and everyone restarts after a capture, so the same plan works every time once a team finds it.

  • Removing one agent costs the scripted team: predator_0 100%, predator_1 100% (interdependence ablation; capture only, not information)
  • Vary it with: the maze (terrain_config), max_steps

Overview

Environment ID GridHunt-PigChase-v0
Grid 9 × 9
Agents 2
Episode length 1000 steps
Actions Discrete(5): stay, up, down, left, right
Observations one_hot, 330 values per agent
Global state 89 values (env.state())
Prey motion static

Agents

Agent Capture power Speed Vision Terrain Notes
predator_0 1 1 whole board - starts at (2, 2)
predator_1 1 1 whole board - starts at (6, 6)

Prey

Prey Type Reward Capture power needed Reappears after capture Notes
pig pig 1 2 yes -

A capture happens when the hunters on a prey's cell have at least the capture power it needs. With more power than needed, the prey's overcrowding penalty is subtracted from its reward.

Terrain

Terrain Movement Layout
obstacle impassable fixed layout

Benchmark

The benchmark plays it with team reward, 200-step episodes and a budget of 20M environment steps. Scores are team returns: IQM over 20 seeds with 95% bootstrap intervals (details).

Configuration Algorithm IQM [95% CI] Normalized Random Scripted
pig_chase IPPO 45.0 [25.0, 50.0] 0.90 0.3 50.0
pig_chase MAPPO 50.0 [50.0, 50.0] 1.00 0.3 50.0
pig_chase HAPPO 50.0 [50.0, 50.0] 1.00 0.3 50.0

Version history

  • v0 (GridHunt 1.0.0): first release.