Skip to content
Bryant E. McDonnell edited this page Jan 2, 2017 · 1 revision

Roadmapping

(Updated 2017/01/02 BEM)

Background

The current toolkit API on SWMM is mainly for interfacing with and managing a simulation. The API up until recently gave the user the ability to open and run (or step through) a simlation, then end and close the model. Historically the purposed of the API was interface with the SWMM5-UI. The API is currently being expanded to allow the user to retrieve results during a simulation for hydraulic and hydrologic entities and is going to be outfitted with parameter setters to allow control routines to be done outside of the actual simulation engine. For example, if the user would like to use Python to control a gate level, this interface will support the objective. The following page illustrates some of the inital roadmapping strategies and todo items

Development Goals

Provide an interface to:

  • The SWMM5 Data model to read and write parameters and to add and remove network elements
  • The current simulated values and enable wrapper based control of link settings
  • The final simulated values available from the *.out and *.rpt files.

SWMM5 API Expansion

The following figure illustrates the high-level goals for the SWMM5 API Expansion. The three main divisions are clearly shown (Input API / Toolkit API / and Output API). Together the APIs will provide complete access to the the entire data model.

Exposing Data Model

Exposing the SWMM5 data model will help begin the process of building a complete Input API. A complete Input API will allow model objects to be created and destroyed. For instance, the swmm_open function is called and an *.inp is parsed out an all attributes are placed inside the SWMM5 data model. A compete input API will allow the user to add and remove hydralic components (such as junctions). Moreover, once the input API is exposed and complete, the community can move away from the using the traditional text-based input file and fill the SWMM data model from any source.

As a transitional approach to a clean Input API, the concept for accessing the data model is to use as much as the existing functionality as possible. Currently the data model is filled using the input file parser. The parser read a line from the input file, and based on the section, an array of strings is passed to a function that pushes the values into the data model. The evolution of building the formal input API will probably involve many updates to the existing infrastructure. The greatest challenge will be to give the user the ability to pass an input file then add or remove components.