question

Ankur A3 avatar image
0 Likes"
Ankur A3 asked Ankur A3 commented

Getting scenario description before optimizer results?

Hi Team,

I have observed that scenarios description can only be checked after successful optimizer run. But there are few scenarios in which optimizer is not able to complete the run and stuck in the middle.

How to find those scenarios so that we can check it while running the model?

Thank you!

FlexSim 23.2.2
optimizerscenariocheck
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
1 Like"
Felix Möhlmann answered Ankur A3 commented

You could write the parameters to an excel file in the On Start Of Replication trigger of the experimenter.

The code below assumes that all parameters are numerical values. I do not know the format of how other parameter types would be stored in the task map, since this is, as far as I could find, not documented anywhere. The code is based on some trial and error experimentation to find out where and how the paramters are accessible in the trigger. (And you would of course have to adjust the file directory and sheet name.)

Object current = ownerobject(c);
int replication = param(1); int scenario = param(2); Map task = param(3); excelopen("D:/ScenarioParamsTest.xlsx"); excelsetsheet("Tabelle1"); // Find next empty column int col = 2; double cellValue = excelreadnum(1, col); while(cellValue != 0) {     col += 2;     cellValue = excelreadnum(1, col); } // Write data to excel file excelwritestr(1, col-1, "Scenario"); excelwritenum(1, col, scenario); excelwritestr(2, col-1, "Replication"); excelwritenum(2, col, replication); Map params = task["parameters"]; Array names = params.keys; for(int i = 1; i <= names.length; i++) {     excelwritestr(i+2, col-1, names[i]);     excelwritenum(i+2, col, params[names[i]]); } excelclose(1);
· 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.

Ankur A3 avatar image Ankur A3 commented ·
Thank you! @Felix Möhlmann
0 Likes 0 ·

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.