Goals of this lesson
- Defining local variables
- Changing the values of already defined variables
- Defining Stochastic Attributes / Variables to increase your models dynamics and by that making it more realistic
Model 3.a explains how to use exclusive gateways for a simulation. Contrary to parallel gateways a branching exclusive gateway needs a condition on every outgoing sequence flow depending on (a) process variable(s). During the simulation the conditions on the outgoing edges will be evaluated to determine exactly one edge as the next path element. You have to ensure that the conditions will determine exactly one sequence flow, otherwise (two or more edges meet the conditions) the simulation results will be useless due to this modeling fault.
But first we will learn how to setup variables and conditions.
Setting up variables
To set up conditions you need at least one process variable. We will create two variables called x and y to make the decision at e. g. an exclusive gateway:
- Click any activity
- Click the Edit button next to the Expression property under the Optional Simulation Properties of the activity
- IYOPRO's Expression Editor will show up. Here you can define your variables.
- To give an example we will define the variables x and y by putting the following lines into the expression editor (See Figure 2)
- x=1; which defines the variable x with a value of 1
- y=1; which defines the variable y with a value of 1
- These variables are now known to the simulation
Figure 2: Expression Editor - Defining variables
Changing the variables' values
Since our both variables contain the same value, we will alter them
- Repeat the steps 1 to 3 for the second activity of the model depicted above
- We will now increment x by one and define the new variable z that takes its value from y (See Figure 3)
- x=x+1; which increments x's value by 1
- z=y; which defines a new variable z that will be given y's value
- Our variables have now these values: x = 2, y = 1, z = 1
We can now use them in logical conditions to make decisions at exclusive or inclusive gateways
Figure 3: Expression Editor - Changing variables' values
Creating Stochastic Attributes
Stochastic attributes will increase your model's dynamics and by that make it more realistic. Since they base on a Stochastic Distribution, their values will always change (except for the Constant Distribution).
To use a stochastic variable, we need to define it at an activity:
- Make sure, you selected the Simulation option from the Property Set drop-down-box
- Click the activity
- Click the button right to the Stochastic Attribute Assignment property under Optional Simulation Properties
- The Process Attribute Editor shows up (see the picture below)
- Click the Add button to add a new stochastic attribute
- The Distribution Editor shows up. You will notice, that it is the same Distribution Editor that you already got to know by assigning durations of activities or inter-arrival times of start events.
- Now e. g. select the normal distribution with a mean value of 10 and a standard deviation of 3
- The variable will be given a name (something like "v1"). You can change this by double-clicking into the Name field. Rename it to X.
- You can the use it in decision making at gateways just like the simple variables from above
Figure 4: IYOPRO'S Simulation Process Attribute Editor