question

Axel Kohonen avatar image
0 Likes"
Axel Kohonen asked Axel Kohonen commented

Bug with the "Start of Replication" trigger in the advanced tab?

Hi,

I cannot get the "Start of replication" trigger to fire in the Experimenter or at least the breakpoint does not work. See the attached model where the trigger is using the standard picklist to write to the output console. Nothing is printed. Also, if I write custom code in the start of replication trigger and put a breakpoint in it then it does not stop at the breakpoint. Weirdly enough the example by @Ben Wilson works in that it prints the start of experiment to the text file, but if I put a breakpoint in the Start of Replication trigger the code does not stop. If I change the start of replication trigger to the standard picklist option "Display message in output console" nothing is displayed in the output console. So it seems that the code is executed, but breakpoints do not work.

I guess the breakpoint not working could have something to do with that multiple processor cores are used to run the replications, however, the end of replication trigger "works" with the debugger, or at least stops, though it does not behave entirely correct as it seems to trigger for all the replications that are running at the same time.

Is this a bug or is there something that I do wrong?

Thank you!

Kind regards,

Axel

FlexSim 16.2.0
experimenterstart of replication
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

Phil BoBo avatar image
3 Likes"
Phil BoBo answered Axel Kohonen commented

Start of Replication fires on the child process. Not the main process. You cannot use the Flexscript debugger on a background FlexSim child process that is running an experiment replication.

The output console prints will be in the Experiment Results, not the output console on the main FlexSim process:

End of Replication is called on the child process and then the main process, passing the Experimenter node from the child process to the main process so that you can record results from the child replication into the main FlexSim model tree.


· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Axel Kohonen avatar image Axel Kohonen commented ·

Thank you @phil,

That makes sense. Good to know that the output is available in the experimenter.

If possible it could be good to add this explanation to the user manual which only has a very brief description about the start of replication trigger. As I tried to debug it, then to notice that it works differently to everything else in FlexSim due to the child processes.

Axel

1 Like 1 ·