question

Jeremy R avatar image
0 Likes"
Jeremy R asked Felix Möhlmann commented

Get scenario title when setting to scenario from experimenter

In the experimenter, there is a button called "Set model to selected scenario". When setting a scenario in this way, I would like to preserve the scenario title and display that on the User Interface somewhere.

Is there a way to retrieve the scenario name when setting to a scenario, and potentially store it in a Global Variable?

The obvious choice would be store the scenario name redundantly in a parameter as well as the scenario title, but scenario parameters cannot store arbitrary strings (only pre-defined strings in a an Option type).

FlexSim 22.2.2
experimenterscenario
· 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.

Jeanette F avatar image Jeanette F ♦♦ commented ·

Hi @Jeremy R, was Jason Lightfoot's answer helpful? If so, please click the "Accept" button at the bottom of their answer. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always unaccept and comment back to reopen your question.

0 Likes 0 ·

1 Answer

·
Jason Lightfoot avatar image
0 Likes"
Jason Lightfoot answered Felix Möhlmann commented

Unfortunately, since the addition of parameter tables and experiment jobs there is often no such thing as a single scenario in which the model is guaranteed to be in having pressed the "Set model to selected scenario" button. It should really say "apply this configuration subset" or something less definitive. The exception to this could be when you only have one job defined in the experimenter.

The closest you could get would be to look at the current parameter settings, scan through all the job configurations and see which 'scenario' names match the model configuration.

· 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.

Jeremy R avatar image Jeremy R commented ·
My hope wasn't necessarily to get the "current" scenario as it was to get the "most recently set" scenario. Although either would do fine.


Matching the model parameters against the scenario tables is the approach I've settled on for now, although it's unfortunate there isn't an easier way to do this.

0 Likes 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦ Jeremy R commented ·
The simplest thing would be to add a model parameter just to store the scenario name and alter it to reflect the scenario name/description.
0 Likes 0 ·
Jeremy R avatar image Jeremy R Jason Lightfoot ♦ commented ·
This was my first instinct too, but as far as I can tell, you cannot store arbitrary strings in model parameters. The closest you can do is an Option variable, which would require setting up all of the scenario names in the dropdown list in advance.
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.