Multi-agent reinforcement learning environment for SWMM stormwater simulation
Project description
SWMMEnv
Multi-agent reinforcement learning environment for SWMM (Storm Water Management Model) simulation.
Overview
SWMMEnv provides a PettingZoo-compatible interface for training multi-agent reinforcement learning (MARL) algorithms on stormwater management simulations. It integrates:
- PySWMM: SWMM simulation engine
- PettingZoo: Multi-agent RL environment interface
- MARLlib: Training framework (MAPPO, QMIX, etc.)
Features
- Read standard SWMM
.inpfiles and rainfall.datfiles - Control pump stations, gates, and weirs
- Global reward for coupled stormwater systems
- Config-driven design for different SWMM models
- Time synchronization between RL steps and SWMM simulation steps
- State normalization for stable training
Installation
pip install -e .
Quick Start
from swmmEnv import SWMMParallelEnv, load_config
# Load configuration
config = load_config("config/example.yaml")
# Create environment
env = SWMMParallelEnv(config)
# Reset and get initial observations
observations, info = env.reset()
# Take a step
actions = {"pump_1": 0.8, "gate_1": 0.5}
observations, rewards, terminations, truncations, infos = env.step(actions)
# Close environment
env.close()
Configuration
See config/default_config.yaml for configuration structure.
Project Structure
swmmEnv/
├── swmmEnv/
│ ├── sim/ # Simulation modules (engine, time_sync, normalizer, mapping)
│ ├── envs/ # RL environments (core MDP + PettingZoo wrapper)
│ ├── reward/ # Reward functions
│ └── config/ # Configuration system
├── tests/ # Unit tests
├── examples/ # Example scripts
└── data/ # Sample SWMM models
License
MIT License
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file swmmenv-0.1.0.tar.gz.
File metadata
- Download URL: swmmenv-0.1.0.tar.gz
- Upload date:
- Size: 34.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a504ca8dec1be545c48f87fa7875757f9af2db742590451b07a4bbbae1ce3d58
|
|
| MD5 |
22651b2050249b8244b9d24d036e8aaf
|
|
| BLAKE2b-256 |
ba250721eb45ec75989f8a31ec0196d356705cef956a18f7c33f527f0a7fcf99
|
File details
Details for the file swmmenv-0.1.0-py3-none-any.whl.
File metadata
- Download URL: swmmenv-0.1.0-py3-none-any.whl
- Upload date:
- Size: 28.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
80a78d95c09a759da760cda714af6dacff0875ee56e7035936fd75ae81940fd8
|
|
| MD5 |
f6b221f7692121de24d207da9c1fc2c8
|
|
| BLAKE2b-256 |
6d0273f32e848c215fca65a63165359fcf64d61c93d3b368bdf4b84e83474767
|