Print

Print


> 
> This is off the top of my head, but maybe you're calling start while on
> the calling stack of the stop. If you call start before super.stop, the
> effect of start gets cancelled by super.stop.
> 
> The way I'd do this is:
> 
> for i =1,#Runs
>  	sim.start()
>  	while(sim.step());
> 	sim.finish()
> 
> So the new start comes after the previous stop ;)

OK, after investigation I've decided to adopt Gabriel's suggestion. In order
to deal with multiple short runs for parameter sweeps an external class
building a simulation is created, which contains more or less following
code:

/* myModel is SimState */

myModel mm = new myModel(parameters1);

for (i = 0:MaxRuns) {
	mm.setSweepedParameter(parametrs2);
	mm.start();
	while(!mm.finishCondition()) {
		mm.schedule.step(mm);
	}
	mm.report();
	mm.finish();
}

I randomly generate parametrs2 vector, but it has been suggested it is
possible to introduce them using ParameterDatabse snippet from precomputed
list.

Sean and Gabriel: thank you very much for help,

Maciek