OpenWaterAnalytics / EPANET

The Water Distribution System Hydraulic and Water Quality Analysis Toolkit
MIT License
279 stars 204 forks source link

Issues with the dev-rule-apis branch #85

Closed eladsal closed 7 years ago

eladsal commented 7 years ago

This aims to be a place holder for issues in the dev-rule-apis branch which was contributed by @AngelaMarchi (thanks). In short this contribution adds get\set apis for the rule based controls. The code compiles with no errors.

A few issues:

  1. The [RULES] section should be written in the INP file right after the [CONTROLS] section.
  2. EN_API_FLOAT_TYPE should be used in function calls.
  3. The SYSTEM keyword is being written as SYST. This is due to the w_SYSTEM definition. I think that w_SYSTEM is only used by the rules so the keyword might be changed or some local fix could be made. The same might be for w_RESERV.
  4. Basic descriptions could be added to the writeRuleinInp in rules.c.
  5. Premises and actions are written in a reverse order to the INP. If the original INP contains the action THEN PUMP 335 STATUS IS OPEN AND PIPE 330 STATUS IS CLOSED it will be written as THEN PIPE 330 STATUS IS CLOSED AND PUMP 335 STATUS IS OPEN. The outcome is the same but not very user friendly.

To start I'm taking care of 2.

eladsal commented 7 years ago

Closing as @AngelaMarchi submitted #87 to fix these issue, thanks.