Skip to main content

Simulation Sandbox for the development and evaluation of stormwater control algorithms

Project description

pystorms: simulation sandbox for the evaluation and design of stormwater control algorithms

License: GPL v3 Code style: black

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 three components:

  1. A library of scenarios that are built to allow for systematic quantitative evaluation of stormwater control algorithms,
  2. A stormwater hydraulic simulator named pyswmm_lite and forked heavily from OWA's SWMM and pyswmm, and
  3. An environment script that links the pyswmm_lite simulator to the scenarios, and can be edited/updated by users who might want to interface the scenarios with other stormwater simulator software (the environment script is included in pyswmm-lite).

This is a alpha version of the library, eventually pyswmm_lite dependency would be deprecated in the favour of pyswmm

Getting Started

Installation

Requirements

  • python 3+
  • numpy
  • pyswmm_lite
pip install pyswmm_lite
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


Download files

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

Files for pystorms, version 0.1.2
Filename, size File type Python version Upload date Hashes
Filename, size pystorms-0.1.2-py3-none-any.whl (32.4 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size pystorms-0.1.2.tar.gz (20.1 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page