-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Starting to develop New MSX API #10
Comments
Here are a couple of questions:
|
@LRossman these are fantastic questions, and I thank you for biting! First, to clarify: this type of lower-level API would be in addition to the current API. The motivation, as @karrowood mentioned, is to allow better extensibility (i.e., service-wrapping) of the core MSX functionality. A RESTful API would be a few layers up from here, and may not even belong in this project, but we do need to think about how to decouple the core propagation/reaction logic from any reliance on input files, binary files, or other libraries. Similar to the network-building API in EPANET, we are looking for a way to isolate a set of public functions that are safe mutators of the underlying data model. So I would see the suggestion on the table as a re-arranging of code to allow separate compilation of the core logic apart from file I/O and epanet dependency. Does that make sense? As to the question of forking into another project, I guess that could be put to a vote. But I don't see any fundamental changes to the architecture or legacy API/CLI resulting from this proposal. |
OK, I get the concept of EPANET2.2-ifying the MSX API by adding some project-building functions (it appears that the |
Yep, that's it in a nutshell. This rearrangement and exposing of functionality has some benefits as described - like using with any simulation model (if the lower level API relies on state vector input), and potentially using this as a basis for backtracking. so maybe the next step would be to propose a non-pseudo-code version of what a set of API functions would look like, using an opaque project pointer for the main struct, and an example of how the network topology and hydraulic state vectors would be represented? |
Here's all that's needed to describe network topology:
Pumps and valves are identified by having no length. MSX also needs to know which nodes are tanks and what mixing model they use, but that could be accomplished with a For hydraulic state, it's basically a subset of what's in an EPANET hydraulics file:
There are additional hydraulic variables in an EPANET hydraulics file that MSX uses, like Reynolds number and friction factor, but these can be re-computed within MSX from knowing pipe flow and node head. |
The new MSX API has a few specific goals that it will need to accomplish in order to be successful. First, it will not be dependent on the EPANET libraries as the current version of MSX is. Next, it will not use input files such as the .inp EPANET input file, or the .msx MSX input file. Instead it will take input through a REST API with higher level language bindings. In this way, users will not have to worry about following a specific particular input/output format.
In order to start development of this, it will likely be easiest if we have a test environment that calls the API in the ways we desire, and then move over the functional pieces implementing the core logic of MSX. For example, a simple pseudo-code:
After this starts to become more and more functional, then it will be important to start building adaptors to allow the old API to work with the new one for full backwards compatibility.
Let me know if you have any thoughts!
The text was updated successfully, but these errors were encountered: