Simulation Replications | CPN Tools help |
How to run multiple simulation replications | How-to |
Single simulations can be run by applying the Fast forward, Play, Single Step, and Bind manually tools. To start a new simulation the Rewind tool must be applied, and a new single simulation can be started. Using these tools, each new simulation must be started manually.
It is frequently useful to be able to run several simulation replications. For example, when doing performance analysis, it is often necessary to run several simulations in order to collect statistically reliable data.
The function CPN'Replications.nreplications
can be used to automatically run a given number of simulations. Applying the Evaluate ML tool to the code shown below would run 3 simulations (assuming that simulation stop criteria are met in the 3 simulations).
If the above code is evaluated, and no simulation stop criteria are met in a particular simulation, then the function call will never terminate. In this case, the only way to stop the simulation is to close CPN Tools.
When simulation replications are run, a replication output directory is created, and a replication status report will be generated. The replication status report is named replication_report.txt
and it contains information about the simulations that have been run.
The additional files and directories in the replication directory shown above are performance output.
Below is an example of a replication report.
CPN Tools report for simulation replications Net: C:\nets\QueueSystem\QueueSystem.cpn Output directory: C:\nets\QueueSystem\output\reps_1 Simulation no.: 1 Steps.........: 306 Model time....: 8551 Stop reason...: The following stop criteria are fulfilled: - Breakpoint: OneHundred_QueueDelays Time to run simulation: 0 seconds Simulation no.: 2 Steps.........: 300 Model time....: 9930 Stop reason...: The following stop criteria are fulfilled: - Breakpoint: OneHundred_QueueDelays Time to run simulation: 0 seconds Simulation no.: 3 Steps.........: 306 Model time....: 11046 Stop reason...: The following stop criteria are fulfilled: - Breakpoint: OneHundred_QueueDelays Time to run simulation: 0 seconds