WNTR icon indicating copy to clipboard operation
WNTR copied to clipboard

WNTRSimulator simulates a single timestep every time run_sim is called even if the sim_time is past the duration

Open michaelbynum opened this issue 7 years ago • 1 comments

WNTRSimulator simulates a single timestep every time run_sim is called even if the sim_time is past the duration

michaelbynum avatar Oct 23 '18 15:10 michaelbynum

Hi, I find this behavior actually useful - you can set a duration equal to the hydraulic timestep, and then simulate an arbitrary number of steps (e.g. until a condition in your script is met). What bothers me is that sometimes when you call

sim = wntr.sim.EpanetSimulator(wn) results= sim.run_sim() results can be an empty dataframe. A workaround is adding something like: while results.node["pressure"].empty: results= sim.run_sim()

dionikolop avatar Jan 10 '19 11:01 dionikolop