Run and re-run model by Flexsim Script

Run and re-run model by Flexsim Script

simpson_s2
Not applicable
274 Views
2 Replies
Message 1 of 3

Run and re-run model by Flexsim Script

simpson_s2
Not applicable

[ FlexSim 20.1.3 ]

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





0 Likes
Accepted solutions (1)
275 Views
2 Replies
Replies (2)
Message 2 of 3

joerg_vogel_HsH
Mentor
Mentor
Accepted solution
0 Likes
Message 3 of 3

simpson_s2
Not applicable
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