Multiple simulation runs can be executed automatically, one after another, using the keywords under the Multiple Runs tab for the Simulation object. The NumberOfReplications input specifies the number of simulation runs to perform for each scenario. The Simulation outputs ScenarioNumber and ScenarioIndex are used to change selected inputs between simulation scenarios. By default, the ScenarioNumber output starts at 1 and is incremented by one with each simulation scenario that is performed. This output can be used to vary one or more inputs by referencing [Simulation].ScenarioNumber in an expression. For example, setting the ServiceTime input for a Server to the following expression:
'{1.0[s], 1.1[s], 1.2[s]}([Simulation].ScenarioNumber)'
assigns the service time to 1.0 s, 1.1 s, 1.2 s, etc., as the scenario number is incremented over from 1 to 3.
The ScenarioIndex output is used when there are multiple inputs to test. This output contains an array of integers that are each incremented from 1 to N, where a separate value for N can be specified for each index. The number of run indices and the ranges over which they are incremented are determined by the ScenarioIndexDefinitionList keyword.
For example, suppose there are two Servers and service times of 1.0 s, 1.1 s, and 1.2 s are to be tested for Server1 and service times of 2.0 s and 2.5 s are to be tested for Server2. Ten replications are to be made for each combination of service times. In this case, two run indices are needed – one for each variable that is to be changed. The run indices are defined by entering the values 3 2 to the ScenarioIndexDefinitionList keyword. This input indicates that ScenarioIndex(1) will be incremented over the range 1 to 3, and ScenarioIndex(2) will be incremented over 1 to 2. The two scenario indices are used in the model inputs as follows:
· ServiceTime input for Server1:
'{1.0[s], 1.1[s], 1.2[s]}([Simulation].ScenarioIndex(1))'
· ServiceTime input for Server2:
'{2.0[s], 2.5[s]'}([Simulation].ScenarioIndex(2))
The GlobalSubstreamSeed input can be left blank so that its value defaults to the present replication number.
With these inputs, a total of six scenarios each consisting of ten runs would be performed. The scenario indices would be incremented in the sequence: 1-1, 1-2, 2-1, 2-2, 3-1, 3-2.
The notation i-j indicates scenario indices ScenarioIndex(1) = i, and ScenarioIndex(2) = k.
It is not necessary to perform all the scenarios defined by the scenario indices. The Simulation keywords StartingScenarioNumber and EndingScenarioNumber can be used to determine the scenarios that will be performed. To perform all six scenarios, the StartingScenarioNumber should be set to 1 (the default value) and the EndingScenarioNumber should be set to 6.
Scenario indices are related to the scenario number by a mathematical equation that performs the necessary transformation. In the example given above, the ScenarioNumber increases from 1 to 6, at the same time as the scenario indices increase from 1-1 to 3-2. Scenario numbers and scenario indices in the i-j notation can be used interchangeably for the StartingScenaroNumber and EndingScenarioNumber inputs. For example, to perform all six scenarios, the StartingScenarioNumber could be set to 1-1 and EndingScenarioNumber to 3-2 instead of 1 and 6.