Skip to content

Commit

Permalink
update swmmtoolbox, closes lsmatott#15
Browse files Browse the repository at this point in the history
  • Loading branch information
kmmacro committed Jan 6, 2020
1 parent a2b8937 commit 4984111
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 12 deletions.
32 changes: 31 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,33 @@
# OSTRICH-SWMM

A toolset for connecting the OSTRICH optimization software toolkit with the SWMM simulation model.
A toolset for connecting the Optimization Software Toolkit for Computational Heuristics (OSTRICH) with the Stormwater Management Model (SWMM).

#### Process Flow Diagram



![](C:\PROJECTCODE\ostrich-swmm\static\OSTRICH-SWMM-process-diagram.png)

#### Optimization Features:

- Parallel processing
- Single- or multi-objective optimization using any algorithm available in OSTRICH. See the [OSTRICH Documentation](<http://www.eng.buffalo.edu/~lsmatott/Ostrich/OstrichMain.html>) for more details.

#### LID Optimization Modules

Modules for optimizing the size, type, and location of Low Impact Development (LID) projects in a SWMM model. This version of OSTRICH-SWMM includes modules for:

- Rain Barrels (RB)
- Simulates rooftop disconnection and routing to rain barrel within the impervious area of subcatchments
- Permeable Pavement (PP)
- Simulates conversion of subcatchment impervious area to permeable pavement

## Running OSTRICH - SWMM

#### ostrich-swmm.sh

```
ostrich-swmm run -c ostrich-swmm-config.json
```

An example config file can be found here: ostrich-swmm/templates/ostrich-swmm-config.json
7 changes: 3 additions & 4 deletions ostrich_swmm/extract.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def perform_node_extraction(
is considered to have flow. Defaults to 0.
"""
# Get the indicies of the relevant data in the binary output.
node_type = binary_output.TypeCheck('node')
node_type = binary_output.type_check('node')
node_total_inflow_variable_index = next(
index
for index, name
Expand All @@ -64,10 +64,10 @@ def perform_node_extraction(
previous_time = binary_output.startdate
report_interval_seconds = binary_output.reportinterval.total_seconds()
nodes_current_values = np.zeros(num_nodes, np.float64)
for period in range(binary_output.nperiods):
for period in range(binary_output.swmm_nperiods):
# Get this period's values for each node.
for node_index, node_name in enumerate(node_names):
swmm_timestamp, value = binary_output.GetSwmmResults(
swmm_timestamp, value = binary_output.get_swmm_results(
node_type,
node_name,
node_total_inflow_variable_index,
Expand Down Expand Up @@ -303,7 +303,6 @@ def perform_extraction_steps(config, validate=True):
binary_output = swmmtoolbox.SwmmExtract(
config['binary_output_path']
)

for step in config['extract']['steps']:
# If step has been explicitly disabled, skip it.
step_enabled = step.get('enabled', True)
Expand Down
7 changes: 4 additions & 3 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ mccabe==0.6.1
numpy==1.12.1
packaging==16.8
pandas==0.19.2
Pint==0.8
Pint==0.9
pycodestyle==2.3.1
pydocstyle==1.1.1
pyflakes==1.5.0
Expand All @@ -34,11 +34,12 @@ rst2ansi==0.1.5
ruamel.ordereddict==0.4.9
ruamel.yaml==0.14.8
scipy==0.19.0
Shapely==1.5.17.post1
Shapely==1.6.4.post2
six==1.10.0
snowballstemmer==1.2.1
Sphinx==1.5.5
subprocess32==3.2.7
swmmtoolbox==1.0.5.8
swmmtoolbox==1.3.6.8
tstoolbox==35.86.39.27
typing==3.6.1
tzlocal==1.4
7 changes: 4 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ matplotlib==2.0.0
numpy==1.12.1
packaging==16.8
pandas==0.19.2
Pint==0.8
Pint==0.9
Pygments==2.2.0
pyparsing==2.2.0
python-dateutil==2.6.0
Expand All @@ -25,11 +25,12 @@ rst2ansi==0.1.5
ruamel.ordereddict==0.4.9
ruamel.yaml==0.14.8
scipy==0.19.0
Shapely==1.5.17.post1
Shapely==1.6.4.post2
six==1.10.0
snowballstemmer==1.2.1
Sphinx==1.5.5
subprocess32==3.2.7
swmmtoolbox==1.0.5.8
swmmtoolbox==1.3.6.8
tstoolbox==35.86.39.27
typing==3.6.1
tzlocal==1.4
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
),
packages=find_packages(),
install_requires=[
'swmmtoolbox>=1.0.5.8,<2',
'swmmtoolbox==1.3.6.8',
'numpy>=1.12,<2',
'jsonschema>=2.6.0,<3',
'shapely>=1.5,<2',
Expand Down

0 comments on commit 4984111

Please sign in to comment.