question

Morgan Ulesich avatar image
1 Like"
Morgan Ulesich asked Ben Wilson edited

Why does FlexSim run EndOfReplication twice for each replication?

FlexSim 16.0.1
replicationendofreplication
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

·
Ben Wilson avatar image
2 Likes"
Ben Wilson answered Ben Wilson edited

When running an experiment, FlexSim spawns new child processes for each replication. When a replication finishes, it runs its own EndOfReplication from the child process. Then the parent process also runs EndOfReplication.

This is by design and allows you to do different behaviors if you need to access the child process or the parent process. That third parameter, the childexpfolder, whether it exists or not is what tells us whether it is a child process or parent process calling the trigger.

if (objectexists(childexpfolder)) {
    // End of Replication on the main process
}
else {
    // End of Replication on the child process
}
5 |100000

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

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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