Swarm¶

Ten hunters on a 23×23 grid with three stags and five hares. Stags need two hunters, and more than one hunter on a hare costs half its value, so the team has to spread out and pair up.
import gridhunt
env = gridhunt.make("GridHunt-Swarm-v0")
What it tests¶
Scale without roles. Ten identical hunters have to pair up on stags and spread out over hares, where crowding costs.
- Removing one agent costs the scripted team: any one: 0–5% (interdependence ablation; capture only, not information)
- Vary it with: numbers of hunters and prey, overcrowding penalties
Overview¶
| Environment ID | GridHunt-Swarm-v0 |
| Grid | 23 × 23 |
| Agents | 10 |
| Episode length | 300 steps |
| Actions | Discrete(5): stay, up, down, left, right |
| Observations | one_hot, 9528 values per agent |
| Global state | 52 values (env.state()) |
| Prey motion | static |
Agents¶
| Agent | Capture power | Speed | Vision | Terrain | Notes |
|---|---|---|---|---|---|
predator_0 |
1 | 1 | whole board | - | - |
predator_1 |
1 | 1 | whole board | - | - |
predator_2 |
1 | 1 | whole board | - | - |
predator_3 |
1 | 1 | whole board | - | - |
predator_4 |
1 | 1 | whole board | - | - |
predator_5 |
1 | 1 | whole board | - | - |
predator_6 |
1 | 1 | whole board | - | - |
predator_7 |
1 | 1 | whole board | - | - |
predator_8 |
1 | 1 | whole board | - | - |
predator_9 |
1 | 1 | whole board | - | - |
Prey¶
| Prey | Type | Reward | Capture power needed | Reappears after capture | Notes |
|---|---|---|---|---|---|
stag_0 |
stag | 5 | 2 | yes | - |
stag_1 |
stag | 5 | 2 | yes | - |
stag_2 |
stag | 5 | 2 | yes | - |
hare_0 |
hare | 1 | 1 | yes | overcrowding costs 0.5 |
hare_1 |
hare | 1 | 1 | yes | overcrowding costs 0.5 |
hare_2 |
hare | 1 | 1 | yes | overcrowding costs 0.5 |
hare_3 |
hare | 1 | 1 | yes | overcrowding costs 0.5 |
hare_4 |
hare | 1 | 1 | yes | overcrowding costs 0.5 |
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.
Benchmark¶
The benchmark plays it with team reward, 300-step episodes and a budget of 20M environment steps, with flat_coords observations. Scores are team returns: IQM over 20 seeds with 95% bootstrap intervals (details).
| Configuration | Algorithm | IQM [95% CI] | Normalized | Random | Scripted |
|---|---|---|---|---|---|
swarm |
IPPO | 22.3 [21.9, 22.9] | 0.05 | 10.8 | 256.7 |
swarm |
MAPPO | 22.9 [22.0, 23.6] | 0.05 | 10.8 | 256.7 |
swarm |
HAPPO | 19.4 [18.7, 20.0] | 0.03 | 10.8 | 256.7 |
Version history¶
v0(GridHunt 1.0.0): first release.