How to automatically change Replications per Scenario and run experiments?

Shiuan
Not applicable
7 Views
4 Replies
Message 1 of 5

How to automatically change Replications per Scenario and run experiments?

Shiuan
Not applicable

[ FlexSim 23.0.10 ]

I need to accomplish the following two things

1. Use script to execute experiments.

I have found the following syntax, but cannot execute it.

applicationcommand("runExperimenter");
runExperimenter();


2. Read the value of "Simulation times" as the Replications per Scenario of the experiment.

1702916680961.png

How should I write the script?

aaa.fsm

0 Likes
Accepted solutions (1)
8 Views
4 Replies
Replies (4)
Message 2 of 5

jason_lightfootVL7B4
Autodesk
Autodesk
Accepted solution

An example of the location of the numreps node:

MODEL:/Tools/Experimenter>variables/jobs/Experiment2/numReps

To run an experiment:

Object experimenter = node("/Tools/Experimenter", model());
treenode experiment=node("jobs/Experiment2",variables(experimenter));
function_s(experimenter, "run",experiment);


0 Likes
Message 3 of 5

Shiuan
Not applicable

Sorry, I still don't understand how to make the value of Replications per Scenario of the experiment change according to the parameter "Simulation times"

Can you give an example?

Thank you for your reply!

0 Likes
Message 4 of 5

jason_lightfootVL7B4
Autodesk
Autodesk

In the OnSet of the parameter you set the value of the node of the experiment for which you wish it to apply. If you have several jobs defined then having a single value for numReps doesn't qualify it - unless you want to change all jobs, in which case you'll need to write a loop to set all experiment jobs. Take a look at the tree for the structure:

1702924880570.png


0 Likes
Message 5 of 5

jason_lightfootVL7B4
Autodesk
Autodesk

Hi @shiuan, 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 comment back to reopen your question.

0 Likes