Skip to main content

Sustainable Foraging environment for multi-agent RL

Project description

Sustainable Foraging Benchmark

A reproducible benchmark for comparing multi-agent RL algorithms on the Sustainable Foraging environment (PettingZoo AEC API).

Forked from lb-foraging. Built on the Level-Based Foraging framework, adapted for sustainable foraging research.

Sustainable Foraging

Install

git clone https://github.com/pixel-87/sustainable-foraging.git
cd sustainable-foraging
uv sync

Quick Start

# Train with stable-baselines3 (choose preset: easy, fair, hard)
python -m scripts.train_sb3 --preset fair

# Run inference with a trained model
python -m scripts.inference_sb3 --preset fair --model logs/<run_name>/model

# List available presets and settings
python -m scripts.train_sb3 --list-presets

The benchmark protocol is documented in docs/benchmark_protocol.md.

Creating Environments

This is a PettingZoo AEC environment:

from sustainable_foraging.foraging import AECForagingEnv

env = AECForagingEnv(
    players=2,
    field_size=(8, 8),
    max_num_food=2,
    sight=8,
    max_episode_steps=500,
)

env.reset()
while env.agents:
    agent = env.agent_selection
    obs, reward, terminated, truncated, info = env.last()
    action = env.action_space(agent).sample()
    env.step(action)
    env.render()

Citation

If you use this benchmark, please cite the original work:

@inproceedings{christianos2020shared,
  title={Shared Experience Actor-Critic for Multi-Agent Reinforcement Learning},
  author={Christianos, Filippos and Schäfer, Lukas and Albrecht, Stefano V},
  booktitle = {Advances in Neural Information Processing Systems (NeurIPS)},
  year={2020}
}
@inproceedings{papoudakis2021benchmarking,
  title={Benchmarking Multi-Agent Deep Reinforcement Learning Algorithms in Cooperative Tasks},
  author={Georgios Papoudakis and Filippos Christianos and Lukas Schäfer and Stefano V. Albrecht},
  booktitle = {Proceedings of the Neural Information Processing Systems Track on Datasets and Benchmarks (NeurIPS)},
  year={2021}
}

Contributing

Contributions are welcome! Please open an issue to discuss changes before submitting PRs.

License

Apache License 2.0 - see LICENSE for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sustainable_foraging-2.0.0.tar.gz (84.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sustainable_foraging-2.0.0-py3-none-any.whl (104.6 kB view details)

Uploaded Python 3

File details

Details for the file sustainable_foraging-2.0.0.tar.gz.

File metadata

  • Download URL: sustainable_foraging-2.0.0.tar.gz
  • Upload date:
  • Size: 84.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for sustainable_foraging-2.0.0.tar.gz
Algorithm Hash digest
SHA256 82dbfb7de840f133498de8eecb33f5a3a31e853335e9a8282b79160bce514ff4
MD5 e0c9b7404d0ad77dff1dc3bd5ebc7a01
BLAKE2b-256 714ffbb32f6e1f5bd26b259f2f6860ec0a5c4bbba2886cc434539b9e894b1ac8

See more details on using hashes here.

Provenance

The following attestation bundles were made for sustainable_foraging-2.0.0.tar.gz:

Publisher: python-publish.yml on pixel-87/sustainable-foraging

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sustainable_foraging-2.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for sustainable_foraging-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 060d050289792bfbf5bba012a2d12b5d5e393f4422c8af55394d0b070fd06bf1
MD5 db2b4f7de94c168f1cbf37a3cc9dcc98
BLAKE2b-256 cbd4a187076acb8b6017e183ffee405c44fad0cd0d30884511f4a67b1ef1326f

See more details on using hashes here.

Provenance

The following attestation bundles were made for sustainable_foraging-2.0.0-py3-none-any.whl:

Publisher: python-publish.yml on pixel-87/sustainable-foraging

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page