question

shiuan avatar image
0 Likes"
shiuan asked Jason Lightfoot commented

How to automatically change Replications per Scenario and run experiments?

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

FlexSim 23.0.10
scriptexperimeterautomatically
1702916680961.png (558.6 KiB)
aaa.fsm (37.9 KiB)
· 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.

Jason Lightfoot avatar image Jason Lightfoot ♦♦ commented ·

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

1 Answer

Jason Lightfoot avatar image
0 Likes"
Jason Lightfoot answered Jason Lightfoot commented

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);


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

shiuan avatar image shiuan commented ·

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 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦♦ shiuan commented ·

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 0 ·
1702924880570.png (24.9 KiB)