question

Jordan Johnson avatar image
0 Likes"
Jordan Johnson asked Jonah K commented

Possible bug: dropuserlibraryobject() causes exceptions during an experiment

Note: This question was essentially asked originally in the comments attached to the following idea:

https://answers.flexsim.com/idea/175340/as-onpreparescenario-onscenariostart-trigger-to-ex.html

I chose to extract the relevant information to make it more discoverable.

I am trying to configure my model via code in the OnSet of a parameter. When I change the parameter and reset the model interactively, everything appears to work as I expect; the model is configured according to the parameter. However, when I run an experiment and view the performance measures, I see System Console exceptions on the Console Output tab.

To replicate this issue:

  1. Open the attached model TestDropUserLibrary_Broken.fsm
  2. Load the attached user library UserLibrary1.fsl
  3. Run the Experiment job in the Experimenter
  4. Open the Performance Measures window and view the System Console output.

I didn't expect these exception messages. It seems like a bug because the model behaves differently as part of an experiment run compared to interactive run. Is this a known issue? Is there a workaround I can use?

FlexSim 24.0.8
experimenterbug reportuser library
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

Jordan Johnson avatar image
2 Likes"
Jordan Johnson answered Jonah K commented

That does seem like a bug. After some investigation, it turns out that the dropuserlibraryobject() command uses the licensehasfeature() command, which is currently broken when called during an experiment. I have added this issue to the dev list.

Until we fix this bug, you can avoid it by removing that check. The check is there to prevent exceptions if a license isn't there. So if you delete the check and you don't have a license, you'll get different exceptions. But if you do have a license, deleting the check will avoid this issue. Add the following code to your OnSet (or in this case, a usercommand that OnSet calls):

  1. treenode licenseCheck = Model.find("MAIN:/project/exec/commandlist/dropuserlibraryobject/node/Check License");
  2. if (licenseCheck) {
  3. licenseCheck.destroy();
  4. }

See the attached model and use the same user library from the original question:

TestDropUserLibrary_Fixed.fsm


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