cannot halt simulation

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

cannot halt simulation

jlefur
Hello,
We cannot manage to halt our simulation and we have no idea of where this problem comes from. The following two points were not occurring in former versions of our model and of Simphony :

1) In the source code, the main step procedure is tagged annotated with @ScheduledMethod(start = 0, interval = 1, shuffle = false). Within this procedure we test if simulation must halt and, if yes, trigger RepastEssentials.EndSimulationRun();. However, the simulation continue stepping.

2) in the graphical user interface the 'pause at' and 'stop at' function in the run options panel do not work any more.

We wonder whether these two behaviours come from the same problem.
We would greatly appreciate if you have any clue about where to search for a solution ?
Regards,
Jean
Reply | Threaded
Open this post in threaded view
|

Re: cannot halt simulation

srcnick
Are you getting any errors displayed in the eclipse console? It sounds like this used to work, but now doesn’t. What are the differences between the two (e.g. different version of simphony, different code etc.)?

Nick

> On Sep 9, 2016, at 4:49 AM, jlefur <[hidden email]> wrote:
>
> Hello,
> We cannot manage to halt our simulation and we have no idea of where this
> problem comes from. The following two points were not occurring in former
> versions of our model and of Simphony :
>
> 1) In the source code, the main step procedure is tagged annotated with
> /@ScheduledMethod(start = 0, interval = 1, shuffle = false)/. Within this
> procedure we test if simulation must halt and, if yes, trigger
> /RepastEssentials.EndSimulationRun();/. However, the simulation continue
> stepping.
>
> 2) in the graphical user interface the '/pause at/' and '/stop at/' function
> in the /run options/ panel do not work any more.
>
> We wonder whether these two behaviours come from the same problem.
> We would greatly appreciate if you have any clue about where to search for a
> solution ?
> Regards,
> Jean
>
>
>
>
> --
> View this message in context: http://repast.10935.n7.nabble.com/cannot-halt-simulation-tp11676.html
> Sent from the repast-interest mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Repast-interest mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/repast-interest


------------------------------------------------------------------------------
_______________________________________________
Repast-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/repast-interest
Reply | Threaded
Open this post in threaded view
|

Re: cannot halt simulation

jlefur
Hello Nick,
I have found the solution.
I have checked back the successive versions of our model until I found a version that work correctly.
For information, this was caused by a set of instructions that we have blindly pasted from internet at the beginning of the context build (we were trying to get the cleanest restart of the context): the error is within one of these instructions but I did not search for the one that was causing the halting problem.

GUIRegistry gRegistry = RunState.getInstance().getGUIRegistry();
RunInfo runInfo = RunState.getInstance().getRunInfo();
DefaultScheduleRegistry defaultScheduleRegistry = new DefaultScheduleRegistry();
RunState.init(runInfo, defaultScheduleRegistry, gRegistry);
RunState.getInstance().setMasterContext(context);
ISchedule schedule = RunEnvironment.getInstance().getCurrentSchedule();
Parameters parameters = RunEnvironment.getInstance().getParameters();
Runner defaultScheduleRunner = new DefaultScheduleRunner();
RunEnvironment.init(schedule, defaultScheduleRunner, parameters, false);


Thank you again for your always quick answers and for the commitment of the development team for the forum

regards,
Jean