Running the simulation several times automatically

The basics of how to develop, test, and use models.
Post Reply
Bill Connelly
Posts: 86
Joined: Thu May 22, 2008 11:54 pm
Location: Australian National University

Running the simulation several times automatically

Post by Bill Connelly »

I was hoping to be able to get the simulation to run several times but doing thing

Code: Select all

runtimes=20
xpanel("Run Control")
xvalue("Simulation Repititions", "runtimes")
xbutton("Run", "gorun()")
xpanel()

proc gorun() {
  for n=0, runtimes-1 {
    run()
  }
}

proc run() {
  preprocess()
  print "RUNNING SIMULATION..."
  stdinit()
  continuerun(tstop)
  postprocess()
}
but it just runs once. What can I do about this?
ted
Site Admin
Posts: 5810
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Running the simulation several times automatically

Post by ted »

Offhand, I'd guess that some other code is stepping on n, in which case
proc gorun() { local n
should fix the problem.
Bill Connelly
Posts: 86
Joined: Thu May 22, 2008 11:54 pm
Location: Australian National University

Re: Running the simulation several times automatically

Post by Bill Connelly »

...sigh...
Thanks Ted.
Post Reply