Skip to main content

Pogema logo

Partially-Observable Grid Environment for Multiple Agents

CodeFactor Downloads CI CodeQL

Partially Observable Multi-Agent Pathfinding (PO-MAPF) is a challenging problem that fundamentally differs from regular MAPF. In regular MAPF, a central controller constructs a joint plan for all agents before they start execution. However, PO-MAPF is intrinsically decentralized, and decision-making, such as planning, is interleaved with execution. At each time step, an agent receives a local observation of the environment and decides which action to take. The ultimate goal for the agents is to reach their goals while avoiding collisions with each other and the static obstacles.

POGEMA stands for Partially-Observable Grid Environment for Multiple Agents. It is a grid-based environment that was specifically designed to be flexible, tunable, and scalable. It can be tailored to a variety of PO-MAPF settings. Currently, the somewhat standard setting is supported, in which agents can move between the cardinal-adjacent cells of the grid, and each action (move or wait) takes one time step. No information sharing occurs between the agents. POGEMA can generate random maps and start/goal locations for the agents. It also accepts custom maps as input.

Installation

Just install from PyPI:

pip install pogema

Using Example

from pogema import pogema_v0, GridConfig

env = pogema_v0(grid_config=GridConfig())

obs, info = env.reset()

while True:
    # Using random policy to make actions
    obs, reward, terminated, truncated, info = env.step(env.sample_actions())
    env.render()
    if all(terminated) or all(truncated):
        break

Open In Colab

Baselines and Evaluation Protocol

The baseline implementations and evaluation pipeline are presented in POGEMA Benchmark repository.

Interfaces

Pogema provides integrations with a range of MARL frameworks: PettingZoo, PyMARL and SampleFactory.

PettingZoo

from pogema import pogema_v0, GridConfig

# Create Pogema environment with PettingZoo interface
env = pogema_v0(GridConfig(integration="PettingZoo"))

PyMARL

from pogema import pogema_v0, GridConfig

env = pogema_v0(GridConfig(integration="PyMARL"))

SampleFactory

from pogema import pogema_v0, GridConfig

env = pogema_v0(GridConfig(integration="SampleFactory"))

Gymnasium

Pogema is fully capable for single-agent pathfinding tasks.

from pogema import pogema_v0, GridConfig

env = pogema_v0(GridConfig(integration="gymnasium"))

Example of training stable-baselines3 DQN to solve single-agent pathfinding tasks: Open In Colab

Customization

Random maps

from pogema import pogema_v0, GridConfig

# Define random configuration
grid_config = GridConfig(num_agents=4,  # number of agents
                         size=8, # size of the grid
                         density=0.4,  # obstacle density
                         seed=1,  # set to None for random 
                                  # obstacles, agents and targets 
                                  # positions at each reset
                         max_episode_steps=128,  # horizon
                         obs_radius=3,  # defines field of view
                         )

env = pogema_v0(grid_config=grid_config)
env.reset()
env.render()

Custom maps

from pogema import pogema_v0, GridConfig

grid = """
.....#.....
.....#.....
...........
.....#.....
.....#.....
#.####.....
.....###.##
.....#.....
.....#.....
...........
.....#.....
"""

# Define new configuration with 8 randomly placed agents
grid_config = GridConfig(map=grid, num_agents=8)

# Create custom Pogema environment
env = pogema_v0(grid_config=grid_config)

Citation

If you use this repository in your research or wish to cite it, please make a reference to our paper:

@inproceedings{skrynnik2025pogema,
  title={POGEMA: A Benchmark Platform for Cooperative Multi-Agent Pathfinding},
  author={Skrynnik, Alexey and Andreychuk, Anton and Borzilov, Anatolii and Chernyavskiy, Alexander and Yakovlev, Konstantin and Panov, Aleksandr},
  booktitle={The Thirteenth International Conference on Learning Representations},
  year={2025}
}

Release files for pogema 1.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pogema 1.4.0
File Size Uploaded
pogema-1.4.0.tar.gz 35.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pogema 1.4.0
File Interpreter ABI Platform
pogema-1.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 68.9 kB

Release files / pogema-1.4.0.tar.gz

Download URL pogema-1.4.0.tar.gz
Size 35.7 kB
Tags Source
SHA-256 checksum
How to use checksums
536df9b5635273334afd26d2a083cb7166ea2c398fd19e7c68412328c450964f
BLAKE2b-256 checksum
How to use checksums
9938b7e02c82e68b962f33088df23096c099ed75430f63036ae88de82d1f6274
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.8.19

Release files / pogema-1.4.0-py3-none-any.whl

Download URL pogema-1.4.0-py3-none-any.whl
Size 33.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
50fdf30e3dc22c799d7a818625f9e4ab56643304394c58319f96ae4c6013860a
BLAKE2b-256 checksum
How to use checksums
211fde0c00f8480941531fa8a42d27b4e3a84cf103f954ab5b0311a619b36eae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.8.19

Release history Release notifications | RSS feed

This release

1.4.0 This release

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.6

2 release files

1.1.5

2 release files

1.1.4

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0

2 release files

0.545

2 release files

0.544

2 release files

0.543

2 release files

0.541

2 release files

0.54

2 release files

0.53

2 release files

0.52

2 release files

0.51

2 release files

0.50

2 release files

0.49

2 release files

0.48

2 release files

0.47

2 release files

0.46

2 release files

0.45

2 release files

0.44

2 release files

0.42

2 release files

0.41

2 release files

0.40

2 release files

0.39

2 release files

0.37

2 release files

0.36

2 release files

0.34

2 release files

0.33

2 release files

0.32

2 release files

0.31

2 release files

0.30

2 release files

0.29

2 release files

0.28

2 release files

0.27

2 release files

0.26

2 release files

0.25

2 release files

0.24

2 release files

0.23

2 release files

0.22

2 release files

0.21

2 release files

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page