Comments (2)
I tested this out using Net1. The following code correctly adds a rule to the water network model using a list of actions and runs the EpanetSimulator with no errors:
import wntr
inp_file = 'networks/Net1.inp'
wn = wntr.network.WaterNetworkModel(inp_file)
action_list = []
for pipe in ['11', '22']:
link=wn.get_link(pipe)
act = wntr.network.controls.ControlAction(link, 'status', 0)
action_list.append(act)
cond = wntr.network.controls.SimTimeCondition(wn, '=', '12:00:00')
rule = wntr.network.controls.Rule(cond,
action_list,
priority = 4,
name = 'rule_name'
)
wn.add_control('rule1', rule)
print(rule)
sim = wntr.sim.EpanetSimulator(wn)
results = sim.run_sim()
However, the WNTR code uses the control rule name (rule1
) if a rule name (rule_name
) is not provided and that name (rule1
) cannot include a space. This can result in EPANET Error 200. This doesn't appear to be your issue, since your rule is named tank1
. Let us know if this resolves the issue.
@dbhart, can you resolve this issue by adding an underscore to the RULE name when witting an INP file?
from wntr.
from wntr.
Related Issues (20)
- runnin the program HOT 3
- wntr.network.options has some abnormal annotation contents HOT 1
- Writing an inp file 'self' argument error message HOT 2
- Create a control object or rule object from text input HOT 5
- Get the reactions tab in the inp file from a water network instance HOT 1
- Add PBV support to [VALVES] section
- Generating Interactive leaflet networks HOT 7
- Pipe status problem HOT 4
- AttributeError: 'WaterNetworkModel' object has no attribute 'write_inpfile' HOT 3
- Differences with my epanet from zero model and inp from wntr model HOT 4
- Values in [DEMANDS] section are repetead and others are missing HOT 8
- Unable to remove leaks from network model HOT 3
- Not able to save the network with modified elements as an INP file. HOT 2
- EPANET Error 110 HOT 1
- leaflet map popups HOT 5
- Todini Index Calculation for the Net6 network - Values outside the range [0,1] HOT 5
- Update EPANET binaries for MacOS arm64 HOT 1
- Check deprecation and future warnings, and version compatibility for dependencies
- Pressure Threshold for Resilience indices like Todini and MRI HOT 2
- Problems to run parallel processing with WNTR / EPANET HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wntr.