question

Afonso Teberga avatar image
0 Likes"
Afonso Teberga asked Joao Victor Amaral answered

Run replicates using FlexSimPy

Hi

I'm trying to run replications of a scenario using the FlexSimPy's runToTime() method. However, I haven't found a way to run the scenario with different random streams. Therefore, all results are deterministic. Is there a way to run replications with FlexSimPy?

These are the Python commands I'm using:


  1. import os
  2. import FlexSimPy as fp
  3.  
  4. scriptPath = os.path.dirname(os.path.realpath(__file__))
  5. programDir = scriptPath + "\\..\\..\\..\\..\\program\\"
  6.  
  7. # Launch FlexSim
  8. controller = fp.launch(evaluationLicense=True, showGUI=False, programDir=programDir)
  9.  
  10. # Open model
  11. controller.open(scriptPath + "\\MeuModelo.fsm")
  12.  
  13. # Set parameter
  14. controller.setParameter("NumOperators", 1)
  15.  
  16. # Reset and run
  17. controller.reset()
  18. controller.runToTime(1440)
  19.  
  20. # Get performance measure
  21. print(controller.getPerformanceMeasure("Output"))


Thanks!

FlexSim 22.1.4
pythonexperimentflexsimpy
· 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.

Jordan Johnson avatar image
1 Like"
Jordan Johnson answered Afonso Teberga commented

One possibility would be to use a Model Parameter. Set its type to Pass-Through, and point it at the node MODEL:/Tools/randomrepeatrep. If that node isn't present, you can just add it, and give it number data.

Then, in your python code, call setParameter() to set that parameter, and then reset the model.

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

Joao Victor Amaral avatar image
0 Likes"
Joao Victor Amaral answered

Hi,

I'm using the same code as Afonso, but when I pass evaluationLicense=False, it returns the error "lc_flexinit failed: 1". I'm using an Educational License, but I already tried it using an Enterprise License and got the same error.

How can I fix it?

Thanks.

5 |100000

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