Getting scenario description before optimizer results?

Getting scenario description before optimizer results?

rajankur6494
Collaborator Collaborator
79 Views
2 Replies
Message 1 of 3

Getting scenario description before optimizer results?

rajankur6494
Collaborator
Collaborator

[ FlexSim 23.2.2 ]

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!

0 Likes
Accepted solutions (1)
80 Views
2 Replies
Replies (2)
Message 2 of 3

moehlmann_fe
Enthusiast
Enthusiast
Accepted solution

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);     excelwritenum(i+2, col, params[names]); } excelclose(1);
Message 3 of 3

rajankur6494
Collaborator
Collaborator
Thank you! @Felix Möhlmann
0 Likes