Adding inputs while the simulation is running

153 views
Skip to first unread message

yara nefaa

unread,
Jul 22, 2018, 5:37:21 PM7/22/18
to Jaamsim Users Discussion Group
Hello !

I'd like to know if there is any way in which we can edit or add new inputs to our simulation while it's running. I've tried editing my .cfg file and saving it during my simulation but it seems like JaamSim reads my input once and that's only at the moment I run my simulation. I'd really appreciate your help.

Thank you!

Harry King

unread,
Jul 22, 2018, 7:41:15 PM7/22/18
to Jaamsim Users Discussion Group
Yara,

You can pause your simulation in mid-run and use the Input Editor to change a value. A better solution would be to use an expression for the input that makes the change at the appropriate time. You could use a TimeSeries object to do this.

Harry

yara nefaa

unread,
Jul 24, 2018, 4:47:58 AM7/24/18
to Jaamsim Users Discussion Group
Hello again!
First and foremost, thanks for your fast reply.

This works well, but not in my situation. The problem here is that I'm not using the graphical user interface of JaamSim to change my inputs. I'm using a third-party app that only interacts with my ".cfg" files or FileToVector files. Is there any way we can do this while avoiding working with the graphical interface?
I really appreaciate your help.

Thank you!

Harry King

unread,
Jul 24, 2018, 12:42:03 PM7/24/18
to Jaamsim Users Discussion Group
Yara,

FileToVector re-reads its data file whenever it receives an entity. The .cfg file is read only once when a model is first opened.

Harry

yara nefaa

unread,
Jul 25, 2018, 6:52:14 AM7/25/18
to Jaamsim Users Discussion Group
Dear Harry,

I'm using the latest version of JaamSim and I tried to edit my "input.txt" file during simulation run-time, but nothing changes unless I reset my simulation. 
Kindly find my config file and FileToVector input file attached.

Thank you,
Yara
input.txt
test.cfg

Harry King

unread,
Jul 29, 2018, 7:21:48 PM7/29/18
to Jaamsim Users Discussion Group
Yara,

Your FileToVector object must receive an entity for it to re-read its data file. I've modified your example to show you how this works -- see attached.

The attached model re-reads the data file every time an entity is generated, which really slows its execution speed. You should set up your model to re-read the data file much less frequently. One way to do this would be to use the EntityLauncher object, which would let the user trigger the re-read.

Harry
test - HK.cfg

yara nefaa

unread,
Jul 30, 2018, 7:35:57 AM7/30/18
to Jaamsim Users Discussion Group
Dear Harry, 

Thanks a lot! It worked well.
Just one more thing. We're trying to make JaamSim and another software communicate, and we're wondering if it's possible in any way to change the present simulation time so that it starts at a customized time (i.e. 3h) rather than the preset value 0. Also, if it might be possible to initialize my outputs; for instance, initializing my queue1's length to 4.
I really appreciate your help!

Thank you,
Yara

Harry King

unread,
Aug 1, 2018, 12:19:33 AM8/1/18
to Jaamsim Users Discussion Group
Yara,
 
 if it's possible in any way to change the present simulation time so that it starts at a customized time (i.e. 3h) rather than the preset value 0.
 
HK - No, the start of the simulation is time zero by definition. Eventually, we intend to allow user to assign a calendar date and time that corresponds to time zero.
 
initializing my queue1's length to 4.

HK - Use a separate EntityGenerator to create the four entities at time zero and send them to your queue. Set the inputs to the EntitiesPerArrival and MaxNumber keywords to four.

Harry
Reply all
Reply to author
Forward
0 new messages