question

Simpson S2 avatar image
0 Likes"
Simpson S2 asked Simpson S2 commented

Run and re-run model by Flexsim Script

Hi,

I have built a simple to run repeatedly with changing variables so I would like to create a script to start, change variables and then restart repeatedly. Each time it will run automatically, generate an .xlsx file for the result, and then alter the variables by Python script.

I have searched the answer from https://answers.flexsim.com/questions/106222/command-to-open-model-and-run-from-scripts.html.. I found it is time consuming for each iteration to open flexsim application , run the script and then alter the variables.

In stead, I am trying to use Flexsim Script to do, so it can save the time to open and close flexsim application. However, I found Flexsim will not run the scripts line by line, i.e. it will run all the line excpet 2 x go(), then run the first go() only with runspeed 30000.

Could anyone help me on this? Thank you so much.

/**1st iteration*/
resetmodel();
runspeed(10000);
go();
stoptime(90000);
getvarnode(Model.find("Tools/TimeTables/Worker_A1"), "table").as(Table)[1][3]=33000;

/**2nd iteration*/
resetmodel();
runspeed(30000);
go();
stoptime(90000);





FlexSim 20.1.3
flexscriptscriptingautomatic
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

·
Joerg Vogel avatar image
0 Likes"
Joerg Vogel answered Simpson S2 commented
· 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.

Simpson S2 avatar image Simpson S2 commented ·
Hi Joerg, thanks it work! Now I am troubling the different results from manual run and experimenter respectively but the variables are the same. Do you have any ideas? Thanks
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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