If your model is stochastic, the results of the single model run may not be representative. Therefore AnyLogic supports results of the iteration that are based on experimentation through the General Replication Algorithm. This feature allows the user to provide the AnyLogic Engine with results of multiple replications per simulation/iteration.

AnyLogic allows you to run a fixed number of replications per simulation or a varying number of replications per simulation.

When running a fixed number of replications, you explicitly define the number of replications to be run for every iteration.

The varying replications option allows AnyLogic to test for the statistical significance of the results. You are supposed to define confidence level, and some expression on which AnyLogic collects statistics, e.g. some variable from your Main agent. AnyLogic will always run the minimum number of replications. Then it will analyze the expression and calculate a confidence interval with the confidence level. Replications will be stopped if:

- the confidence interval is small enough to fit in the given percentage of expression value, or
- current expression value is not inside the mean confidence interval (not near the mean value), or
- the maximum number of replications is run.

Parameter variation experiment's properties view. Replications section

To schedule fixed number of replications- In the Projects view, select the parameter variation experiment.
- In the Replications section of the Properties view, select the Use Replications check box.
- Select the Fixed number of replications option.
- Specify the number of Replications per iteration in the box.

- In the Projects view, select the parameter variation experiment.
- In the Replications section of the Properties view, select the Use Replications check box.
- Select the Varying number of replications (Stop replications after minimum replications, when confidence level is reached) option.
- Specify the minimum number of replications in the Minimum replications box.
- Specify the maximum number of replications in the Maximum replications box.
- Define the Confidence level to be evaluated for the expression you define.
- Specify the percent of mean for which the confidence level is determined in the Error percent field.