Simulation sandbox for stormwater control algorithms
Project description
pystorms: simulation sandbox for the evaluation and design of stormwater control algorithms
Overview
This library has been developed in an effort to systematize quantitative analysis of stormwater control algorithms. It is a natural extension of the Open-Storm's mission to open up and ease access into the technical world of smart stormwater systems. Our initial efforts allowed us to develop open source and free tools for anyone to be able to deploy flood sensors, measure green infrastructure, or even control storm or sewer systems. Now we have developed a tool to be able to test the performance of algorithms used to coordinate these different sensing and control technologies that have been deployed throughout urban water systems.
For the motivation behind this effort, we refer the reader to our manuscript pystorms. In general, this repo provides a library of scenarios
that are built to allow for systematic quantitative evaluation of stormwater control algorithms.
Getting Started
Installation
Requirements
- PyYAML >= 5.3
- numpy >= 18.4
- pyswmm
pip install pystorms
Please raise an issue on the repository or reach out if you run into any issues installing the package.
Example
Here is an example implementation on how you would use this library for evaluating the ability of a rule based control in maintaining the flows in a network below a desired threshold.
import pystorms
import numpy as np
# Define your awesome controller
def controller(state):
actions = np.ones(len(state))
for i in range(0, len(state)):
if state[i] > 0.5:
actions[i] = 1.0
return actions
env = pystorms.scenarios.theta() # Initialize scenario
done = False
while not done:
state = env.state()
actions = controller(state)
done = env.step(actions)
performance = env.performance()
Detailed documentation can be found on the webpage
Project details
Release history Release notifications | RSS feed
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
File details
Details for the file pystorms-1.0.0.tar.gz
.
File metadata
- Download URL: pystorms-1.0.0.tar.gz
- Upload date:
- Size: 249.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.9.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0d2d96785d821a83c9efcd1419a90b8074b6d441fe59e14a0f6643cb2b2c66b4 |
|
MD5 | d96b087cf380d00caac72744826508e9 |
|
BLAKE2b-256 | 7a16a7d98e700c617fad04665216b61998d31fd346ac62b09020fc0259f2996c |
File details
Details for the file pystorms-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: pystorms-1.0.0-py3-none-any.whl
- Upload date:
- Size: 263.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.9.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5c78f9f7d4154e49c6f9aef3a8886b97d5b485961ad084cadfa0fb16c1d7a3cd |
|
MD5 | 2b9eb13f87940273db9212244eccd2df |
|
BLAKE2b-256 | 3e12147c02b4d666d6e8b355a24c0661b2cf49b8e63b1da62443f2021c5f5a5f |