Number of replications

218 views
Skip to first unread message

José Airton Azevedo dos Santos

unread,
Dec 11, 2014, 12:34:50 PM12/11/14
to jaamsi...@googlegroups.com
Hi

How to do various replications of a model, as in the arena, in Jaamsim?


thank you

Airton

Harry King

unread,
Dec 12, 2014, 3:24:41 PM12/12/14
to jaamsi...@googlegroups.com

Airton,

Replications are performed by preparing a batch file with the desired simulation runs. See section 12.4 of the user manual.

You can use the input GlobalSubstreamSeed to change the seed for ALL the probability distributions in your model (see section 9.3). The best way to set up each run is to prepare a run file containing an Include statement (section 12.3) that loads the base version of your model, followed by the GlobalSubstreamSeed statement. That is all you need for each run.

This may seem like more work for the user, but the advantage is that you can manage your runs anyway you want. For example, you can create a spreadsheet or a Python program to launch thousands of simulation runs in this way. Or you can write an optimiser that launches and analyses a series of JaamSim runs. We routinely launch tens of thousands of simulation runs for batch processing using these methods.

Harry

Harry King

unread,
Dec 14, 2014, 5:37:42 PM12/14/14
to jaamsi...@googlegroups.com
Airton,

Attached to this posted are five files that show how to execute replications using a batch file:
  • "Example 2 - Server and Queue.cfg" - the example model. The attached copy is identical to the one on the Downloads webpage.
  • run1,cfg, run2,cfg, and run3.cfg - the configuration file for each of the three simulation runs to be batched.
  • BatchRuns1-3.bat - the batch file that will execute the three runs one after another. You can double-click on this file to launch the batched runs. Note - the file was renamed as "BatchRuns1-3.bat.txt" to allow it to be attached to the post. If you have any difficulty downloading this file, you can create it yourself by copying the text given later in this post.
The first run files contain the following lines (the other two are similar):

Include  'Example 2 - Server and Queue.cfg'
Simulation  RealTime { FALSE }
ExponentialDistribution-1  GlobalSubstreamSeed { 1 }

The include statement in the first line loads all the inputs from the file 'Example 2 - Server and Queue.cfg' to the present run. The second line turns off RealTime mode so that the run executes as fast as possible. The third line selects the first global sub-stream -- this input automatically changes the effective seed for ALL the random distributions.

The batch file contains the following lines:

jaamsim2014-50.exe  run1.cfg  -b
jaamsim2014-50.exe  run2.cfg  -b
jaamsim2014-50.exe  run3.cfg  -b

This is just a standard DOS batch file that executes three runs in succession. All the files need to be in the same directory for this batch file to execute correctly.

Normally, each run would produce a separate report file, however, the model used for this example, "Example 2 - Server and Queue.cfg", does not generate a report, so nothing is generated by each run. Add the ReportGenerator object to your model to create an output report for each run.

This should be enough to get you started. Let me know if you have any difficulty.

Harry
Example 2 - Server and Queue.cfg
run1.cfg
run2.cfg
run3.cfg
BatchRuns1-3.bat.txt
Reply all
Reply to author
Forward
0 new messages