question

Felipe Capalbo avatar image
0 Likes"
Felipe Capalbo asked Jordan Johnson answered

Control Experimenter Externally

Hello,

Is it possible to set up and control the Experimenter’s scenario parameters externally, including creating new scenarios and running them?

1731955274622.png

I've tried different approaches but faced some challenges. For instance, while FlexSimPy offers potential, it often fails when running scripts to control FlexSim as a background process. Alternatively, using sockets has been more reliable, but I’m unclear on how to use them to fully control the Experimenter, particularly for creating and managing scenarios.

1731955434969.png

When I inspect the tree, I notice that some controls are available, but I’m unsure how to extend this functionality to achieve my goal. Any advice on using sockets or other methods to manage the Experimenter externally would be greatly appreciated.

FlexSim 24.1.1
experimenterpythonsocket
1731955274622.png (40.6 KiB)
1731955434969.png (16.8 KiB)
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
0 Likes"
Jordan Johnson answered

The experimenter isn't designed to be controlled externally. However, it is designed to allow additional job types. You could use a module to inherit a new ExperimentJob class. Then you could overload the methods to add the tasks you want. You can add tasks at any time, not just when the job starts. This is how the Optimizer job works. It essentially queries the optimization engine for the next task as previous tasks finish.

If you go the C++ module route, be sure to look at Experimenter.h, and at the class Experimenter::ExperimentJob. That's the class you'll need to inherit.


5 |100000

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