﻿ Assigning Process Variables

Assigning Process Variables

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

How-to

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. Figure 1: Model 3a from the Simulation Tutorial

Approach

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:

1. Click any activity
2. Click the Edit button next to the Expression property under the Optional Simulation Properties of the activity
3. IYOPRO's Expression Editor will show up. Here you can define your variables.
4. To give an example we will define the variables x and y by putting the following lines into the expression editor (See Figure 2)
1. x=1; which defines the variable x with a value of 1
2. y=1; which defines the variable y with a value of 1
5. 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

1. Repeat the steps 1 to 3 for the second activity of the model depicted above
2. We will now increment x by one and define the new variable z that takes its value from y (See Figure 3)
1. x=x+1; which increments x's value by 1
2. z=y; which defines a new variable z that will be given y's value
3. 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:

1. Make sure, you selected the Simulation option from the Property Set drop-down-box
2. Click the activity
3. Click the button right to the Stochastic Attribute Assignment property under Optional Simulation Properties
4. The Process Attribute Editor shows up (see the picture below) Figure 4: IYOPRO'S Simulation Process Attribute Editor