question

David Besson avatar image
0 Likes"
David Besson asked Jason Lightfoot edited

Experimenter: export event log for each replication/scenario

Dear all,

I want to export the event log for each replication/scenario of an experiment.

To do so, I tried to follow the instructions according to this question: Start event log by Flexscript. Formally:

Trigger start of replication:

applicationcommand("seteventlogging",1,-1); // enable logging

Trigger end of replication:

if (!objectexists(childexpfolder)){
string fileName = "eventlog"+string.fromNum(scenario)+string.fromNum(replication)+".csv";
string filePath = modeldir()+fileName;
applicationcommand("saveeventlog", 0, filePath);
}

Unfortunately, each export is empty (expect the column headers). Using the function applicationcommand("saveeventlog", 0, filePath") in a script window works for the current simulation (not the experimenter).

How can I fix it? Please find attached a simple model. Thanks for you help!

xpEventlogExport.fsm

FlexSim 22.2.4
experimenterevent log
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
0 Likes"
Phil BoBo answered Jason Lightfoot edited

The Event Log does not record in experiment child replications. If you want to record the event log, you have to do it in the interactive FlexSim process.

If you want to run a particular scenario/replication, you can set the interactive FlexSim process to that scenario/replication using this button:

1678114993423.png

or these interfaces:

1678124096423.png

1678124127963.png

or this code:

treenode experimenter = Model.find("Tools/Experimenter");
int scenarioID = 1;
int replication = 2;
function_s(experimenter, "setModelToScenario", scenarioID, replication);

You can then run the model and record its events in the Event Log.


1678114993423.png (24.1 KiB)
1678124096423.png (28.2 KiB)
1678124127963.png (32.7 KiB)
· 4
5 |100000

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

David Besson avatar image David Besson commented ·

Thank you for the answer.

This would have been useful for debugging: some runs of specific scenarios/replications do not produce the same results as those produced via the experimenter (while manual runs of a specific scenario/replication systematically produce the same results). And then being able to compare the 2 logs (1 from the experimenter and 1 from the specific run) would have helped me.

But I note that this is not possible

0 Likes 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦ David Besson commented ·
Do you get any messages in the system consoles of the experiments?
1 Like 1 ·
David Besson avatar image David Besson Jason Lightfoot ♦ commented ·

Yes there are messages in the system console. And it seems only for specific replications/scenarios with different results between the experimenter and a manual run. We are working on it! =) Thanks.

0 Likes 0 ·
Show more comments

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.