question

Elax Kot avatar image
0 Likes"
Elax Kot asked Felix Möhlmann commented

Exporting Data through experimenter

Hi all, I have a bunch of data being written to global tables at run time. At the end of each replication , I would like to export the data from the global tables to a CSV file.

It works, but I am getting weird results that are inconsistent with what I should observe. In particular, several of my iterations are giving me incomplete model runs. However, when I use "Apply the following scenario and replication to the model", I get a completely different result from what I exported. I am inclined to believe that the runs in the experimenter could be interfering with the export in a way or another.

I am using the following code:

  1. /**Custom Code*/
  2. Object current = ownerobject(c);
  3. int replication = param(1);
  4. int scenario = param(2);
  5. treenode childexpfolder = param(3);
  6. Map task = param(4);
  7.  
  8.  
  9. if (!objectexists(childexpfolder)){
  10. Table tbl = Table("Output_Result");
  11. string Name = "Output_Result_" + numtostring(replication) + ".csv";
  12. exporttable(tbl, Name,1,1);
  13. }
FlexSim 23.2.3
experimenter
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

Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered Felix Möhlmann commented

It's hard to help without seeing the model.

Just to be safe: Your experiment only has a single scenario? Otherwise using only the replication number in the file name would lead to multiple instances trying to write to the same file.
Can you clone the global table to a Calculated Table? Then you could check the values with "View Results" and compare to what you have in the csv-files.

· 2
5 |100000

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