# path to Net1.inp example file included with this package
inp <- file.path( find.package("epanet2toolkit"), "extdata","Net1.inp")
ENopen( inp, "Net1.rpt")
# store simulation times
t = NULL
ENopenH()
ENinitH(11)
repeat {
t <- c(t, ENrunH())
tstep <- ENnextH()
if (tstep == 0) {
break
}
}
ENcloseH()
ENclose()
# clean-up the created files
file.remove("Net1.rpt")
Run the code above in your browser using DataLab