Model 7b - Multiple Looping Activity
How-to
In this lesson we will introduce the looping activity. This kind of activity is being executed until a specified Looping Condition is broken (evaluated to true).
Approach
-
First we define a variable x with a value of 0 in the first activity
-
Now we need to increment x by 1 in the second activity
-
Click the activity and enter
x=x+1;
in its Expression property
-
-
Finally it is necessary to set up the Looping Condition
-
Click the Edit button next to the Looping Condition property under Must-Have simulation Parameters (of the second activity)
-
Enter the condition
x>4
-
Evaluating the looping condition is always the last step in the execution of a looping activity
-
Explanation
The first activity initializes the variable x with the value of 0. When the process flow arrives at the second activity, x will be increased by 1 and after the activity has been worked off the condition will be checked. The activity will be executed as long as the value does not meet the condition. In result the second activity will be executed 5 times just like the multiple activity from Model 7a.
Report
See below for the run configuration, which we set up to receive the report statistics from below.
Please refer to the section Experiment Results for more information on the report specific data.
Run configuration
-
Stochastic Seed: 12345
-
Simulation start date: 1/1/2014 12:00:00 a.m.
-
Simulation stop time: 240
-
Simulation stop time unit: Hours
Report statistics
-
Just like in Model 7a the looping activity has been executed 5 times before the process instances proceeded to the end event
-
Note that the processing time is 7 hours, because we increased the "initialise value" activity’s duration to 2 hours