question

Tuan avatar image
0 Likes"
Tuan asked Julie Weller commented

Experimenter problem

@Kavika F Hello!! I have a question

Connect flexsim and python via Socket

python as client flexsim as server

{

python is responsible for passing variables to flexsim

flexsim take variables to scenario and executes experimenter

After flexsim executes the experimenter, the value is passed to python

}

Execute the above process 100,000 times

There is no way to execute 100,000 times because the experimenter will be broken. Until a certain time you can only take variables to the scenario, but the experimenter cannot be enabled.

How to solve??

練習4.py

socket new.fsm

FlexSim 20.0.10
experimentersocket
練習4.py (1.4 KiB)
socket-new.fsm (100.8 KiB)
· 14
5 |100000

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

Kavika F avatar image Kavika F ♦ commented ·

Hey @Tuan, what do you mean that the "experimenter will be broken"? Is there a specific number of replications where it fails? What kind of errors are you getting?

Please note that running 100,000 experiments would take a very long time. If every iteration only took 1 second, it would take over 27 hours to run.

0 Likes 0 ·
Tuan avatar image Tuan Kavika F ♦ commented ·

@Kavika F Hi

No errors are displayed and suddenly cannot communicate with each other because the experimenter can no longer execute!!

0 Likes 0 ·
Kavika F avatar image Kavika F ♦ Tuan commented ·

How do you know it is the experimenter and not the socket connection breaking?

0 Likes 0 ·
Show more comments
Julie Weller avatar image Julie Weller commented ·

Hi @Tuan, was Kavika F'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

Kavika F avatar image
1 Like"
Kavika F answered

Hey @Tuan, I recommend that you try to run FlexSim instances in parallel to get your results faster so the Experimenter has less time to "break". There are a number of ways you could do this.

You could try increasing the number of scenarios you run in the experimenter. Simply take in multiple inputs from the python script before running, and then after running the experimenter, you can export all the results to your script to process.

You can use distributed CPUs on the Advanced tab of the experimenter to break up the work to help the experiments run faster.

You could use the FlexSim Web Server to run the experimenter and avoid crashing. This will allow you to specify the number of instances of FlexSim you can have open, and run multiple at a time so you can get results back faster.

5 |100000

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