question

Tony Nikolov avatar image
0 Likes"
Tony Nikolov asked Adrian Haws edited

Running Multiple Replications

I have model where the complexity and time constraints don't really give me the luxury of using the experimenter. As a result, I was wondering if there was a way to run multiple replications such that the Statistics and Reports tab can collect the data?

FlexSim 16.1.0
experimenterstatisticsperformance measuresreplicationsstatistics and reports
· 3
5 |100000

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

Adrian Haws avatar image
0 Likes"
Adrian Haws answered

@Tony Nikolov

Looking at your follow-up questions, it seems that there are two main things you want to do with the Experimenter:

  1. Add an operator to a specific shift in the Experimenter.
  2. Access data from all of your performance measures in one place.

For your first question, you can run a code in the Experimenter to join an operator to a specific time table in the model tree. It is run in the "Start of Replication" code of the "Advanced" tab in the Experimenter. This is what it would look like, only with the specific names and locations for your model:

  1. treenode operator = node("Operator8", model());
  2. treenode timetable = node("Tools/TimeTables/TimeTable1", model());
  3.  
  4. treenode operatorTimeTableNode = nodeadddata(nodeinsertinto(getvarnode(operator,"timetables")), DATATYPE_COUPLING);
  5. treenode timetableMemberNode = nodeadddata(nodeinsertinto(getvarnode(timetable,"members")), DATATYPE_COUPLING);
  6.  
  7. setname(operatorTimeTableNode, getname(timetable));
  8. setname(timetableMemberNode, getname(operator));
  9.  
  10. nodejoin(operatorTimeTableNode, timetableMemberNode);

For your second question, you can access your performance measure data in the tree. Under Tools->Experimenter->Performance Measures you can select each performance measure and look at their stats.

5 |100000

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

Adrian Haws avatar image
1 Like"
Adrian Haws answered Brandon Peterson commented

You could do this by running the model multiple times and collecting a report for each one. In the Statistics tab you should first unselect the "Repeat Random Streams" option so that every model run is different. Then arrange your Summary Report or State Report as needed. You can then set a model trigger for "On Run Stop", which will execute the given code whenever the model is stopped. The following is the code if you are generating a summary report and below that for a state report.

Summary report:

  1. string directory = modeldir();
  2. if (stringlen(directory) < 3)
  3. directory = documentsdir();
  4. string filepath = concat(directory,"summaryreport.csv");
  5. fileopen(filepath);nodefunction(node("/project/exec/globals/nodefunctions/summaryreport",maintree())); // This functionality had to be C++
  6. fileclose();

State report:

  1. string directory = modeldir();
  2. if (stringlen(directory) < 3)
  3. directory = documentsdir();
  4. string filepath = concat(directory,"statereport.csv");
  5. fileopen(filepath);nodefunction(node("/project/exec/globals/nodefunctions/statereport",maintree())); // This functionality had to be C++
  6. fileclose();
· 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.