Using Variables to Model Time and Logic Relationships Between Object Instances

Real life includes not only time relationships between the sequence of process steps, but also more complex tasks like:

  • Pausing performance of the process instance until the required resources are available in the sufficient quantity;
  • Making start of task performance dependent upon some conditions.

To model such situations, the following methods are available:

  1. Model competition of process tasks for a limited amount of work resources and their available time;
  2. Model competition of process tasks for a limited amount of material resources;
  3. Use variables to control performance of simulation process instances.

The first method is used when you describe properties on the Shifts tab (see the Describing Resource and Product Models article) and on the Resources tab (see the How to Model Use of Resources article).

The following mechanism is used to apply the other methods: the analyst declares a variable for an object, and the simulation engine creates instance(s) of this variable during the simulation.

Variables can be global and local. The global variable is created in one instance that is used by all simulation process instances, it is available during the entire simulation period. Local variables have several instances – one variable instance for each simulation process instance, an instance of the local variable exists until the corresponding simulation process instance exists. Variables change their values according to the operations specified on the Operations on variables tab ("Activities" repository object Properties WindowSimulation properties tab).

We will now describe various methods of declaring variables.

Variables Specified for Objects of the "Org Units" and "Functional Objects" Repositories

Variables for objects of the "Org units" and "Functional objects" repositories are declared on the Variables tab ("Org units" or "Functional objects" repository object Properties WindowSimulation properties tab).

Start value can be defined in the form of a Constant, a Random value or a Value of another Variable.

It is the Resource type property ("Org units" or "Functional objects" repository object Properties WindowSimulation properties tab → Material resource Properties Group) that is in charge of the number and scope of the variable instances:

Resource Type Number of Instances and Scope
Global Only one variable instance is created.
The scope covers instances of all simulation processes and tasks.
Local The set of variable instances is created.
The scope of each instance is the simulation process instance where operations on this variable instance are performed when processing simulation tasks. The scope doesn’t cover instances of the simulation sub-processes.
Table 1. Dependence of the variable characteristics on the resource type


System Variables of Material Resources

The Quantity system variable can be added for a material resource ("Org units" or "Functional objects" repository object Properties WindowSimulation properties tab). Use the Add system variables of material resource hyperlink to add it. Start value and Minimum value property values are set to 0 by default but can be changed, if necessary.

Value of this system variable changes during the simulation period automatically when instances of material resources are used or instances of the corresponding products are produced (see the Modeling Use of Resources and Production of Products article).

Additional operations on this system variable can also be performed, if they are specified on the Operations on variables tab ("Activities" repository object Properties WindowSimulation properties tab).

It is the Resource type property ("Org units" or "Functional objects" repository object Properties WindowSimulation properties tab → Material resource Properties Group) that is in charge of the number and scope of the "Quantity" variable instances (see Table 2).

Resource Type Number of Instances and Scope
Global The simulation engine creates the material resource pool for all process instances. These resource instances can be used by all process instances.
Select Global as a Resource type value, in case you want various process tasks to compete for the material resource instances.
Local The simulation engine creates a separate pool of the resource for each process instance.
If there is no need to make the process instances compete for the material resource, then select Local as a Resource type value.
Table 2. Dependence of the "Quantity" variable characteristics on the resource type

No matter if the analyst adds the "Quantity" variable to the list of variables of the material resource model, this variable will be created automatically during the simulation. This is done on purpose, so that you can analyze the change of the variable values. Note though that the variable is created with a start value equal to 0 and has no limitations in quantity. If you do need the specified start value or want to limit the number of available instances and thus to pause the process performance when the limit ends, you need to add this system variable manually.

System Variables of Work Resources

System variables of work resources include:

  • Number of instances,
  • Number of occupied instances,
  • Number of vacant instances.

The variables are added to the Variables tab ("Org units" or "Functional objects" repository object Properties WindowSimulation properties tab) by clicking on the Add system variables of work resource hyperlink.

These variables are always global. Start value for each variable is set to 0. It will be changed during the simulation automatically considering calendars assigned to work resource instances. Also, the number of available resource instances changes when one of the instances starts performing a task instance.

Values of the variables can be used to select the way in the branching points of process diagrams (see the Setting up Conditions in the Branching Point article for details).

Variables Specified for Objects of the "Activities" Repository

Use the Variables tab ("Activities" repository object Properties WindowSimulation properties tab) to specify variables of the activity. This data is used by the simulation engine to create instances of the local variable. The scope of this local variable is the process instance and instances of all sub-processes up to the lowest level.

Note that Minimum and Maximum values are not specified for variables of the "Activities" repository objects.

Global and System Variables

The "Global and system variables" repository (Main Menu → Process Analysis → Simulation Variables) contains the system variables by default. The user has no rights to modify them. But they can add user global variables there. All the variables of this repository are used to manage performance of process instances.

The Current date and Current time system variables are global.

The Current cost of process instance and Current duration of process instance variables are local. The scope of each variable instance is the simulation process instance.

The user variables that are added to this repository are considered to be global and their values can be changed, i.e. you can perform an operation on these variables on the Operations on variables tab ("Activities" repository object Properties WindowSimulation properties tab).

The Minimum and Maximum values are not specified for these variables.

Operations on Variables

Operations on variables are performed when performing instances of simulation tasks. As a result, the start value of the variable changes. Operations that should be performed are described on the Operations on variables tab ("Activities" repository object Properties WindowSimulation properties tab).

Variable type defines the list of operators used to perform operations on variables (see Table 3).


Variable Type Operators
Integer (= ), (+), (-), (*), (/).
Decimal (= ), (+), (-), (*), (/).
String (= ), (+).
Logic (= ), (+), (*).
Date (= ), (+), (-).
Time (= ), (+), (-).
Duration (= ), (+), (-).
Table 3. Dependence of Available Operators on Variable Type


Example: How to Control Process Performance Based on Variable Values

Imagine you have to develop a model of processing a batch of parts. Every morning a batch of parts arrives at 9 AM (the number of parts in a batch varies from 10 to 15 pieces). There is a 20% likelihood that a part becomes defective after it is processed and additional processing actions will be required afterwards. Thus, the number of the “Process a part” task instances varies and has more instances than the number of pieces in a batch, in general. After the batch is processed, the order is marked as finished (Figure 1).

Figure 1. The "Process batch of parts" process diagram

1. First, we create the Event instantiation model for the "Batch of parts arrived" event (see Figures 2 and 3).

Figure 2. Event instantiation model of the start event
Figure 3. Interval of event instance occurrences

2. Then we add a "Batch of parts" object to the "Functional objects" repository. And we add the system "Quantity" variable for this material resource (Figure 4).

Figure 4. Adding the "Quantity" variable

Note that the Resource type property value is Local. It means that a separate batch is created for each simulation process instance.

3. Describe Operations on the "Quantity" variable that are performed when performing a "Process a part" process instance (Figure 5).

Figure 5. Properties of the Operations on variables tab of the "Process a part" object of the "Activities" repository

4. Describe Operations of the "Quantity" variable that are performed when performing a "Register defective part" process instance (Figure 6).

Figure 6. Properties of the Operations on variable tab of the "Register defective part" object of the "Activities" repository

5. Set up probability values for the relationships that follow the XOR gateway (Figures 7, 8).

Figure 7. The "Defective" relationship properties
Figure 8. The "Not defective" relationship properties

6. Define conditions for the occurrence of the "All parts are processes" event instances. To do this, describe the properties of the relationship that follows the XOR gateway and is not of the "Default" type (Figure 9).

Figure 9. Properties of the relationship

Thus, now performance of the "Process batch of parts" simulation process instance depends on the "Quantity" variable value.

« PreviousLevel upNext »
 
Driven by DokuWiki