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 three simulations (assuming that simulation stop criteria are met in the three simulations).

Run simulation replications

Run simulation replications

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.

Replication output

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.

Replication output directory

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

Related pages

Simulation

Simulation feedback
Simulation report

You must be logged in to post a comment.