Modular API for running large ensembles of real time control simulations in EPA-SWMM
This codebase heavily draws from the OWA's pyswmm and SWMM. Though this code can be used along pyswmm, I've provided the necessary components from pyswmm with this library, so that it can be used as a standalone package.
- Numpy
- Multiprocessing
git clone https://github.com/kLabUM/storm-swarm.git
pip/pip3 install .
This library is 3 primary components:
- Config (dict)
- Environment (class)
- Swarm (function)
This dictionary configures the storm water network being stimulated and identifies the state and action space.
config = { "swmm_input" : "./networks/parallel.inp",
"state_elements" : {"state_order" : ["P1", "P2"],
"P1" : "depth",
"P2" : "depth",
"state_len" : 2},
"control_elements" : ["1"],
"controller" : ctrl,
"reward_function" : reward,
"timesteps" : 1}
This class acts as a handle to control SWMM simulation and can also be used independently
env = environment(config)
This function can take single/mutiple config files and runs them in parallel.
generate_swarm(config, workers=3, jobs=10)