Global Variables store information referenced and manipulated by the model. Variables are global, meaning they can be seen and changed by the action of any entity from anywhere in the model. Variables can be set, incremented, decremented, and examined in the Action tab of the dialog — Access and use variables in many fields in dialogs throughout ProcessModel.
Values written to a variable are summarized in the output tables, may be plotted to a time-series graph, summarized in a histogram, and exported to Excel.
Examples of variable usage
Variables record changes during the simulation
To see the volume of people in a waiting room over time, INC (increment) a variable when people arrive and DEC (decrement) when people leave.
A plot of the variable shows the value over time. Charts such as the one below are easily accessible and valuable for uncovering opportunities. See How do I use Smart Stats?
A variable changed in one area of the model allows a gate to open and close in another model area.
Several Model Objects provide the functionality of a gate. Each of the gate model objects (1-11) uses a variable to signal when the gate opens and closes. The variable combines with a trigger activity and a Wait Until statement. See What is a Trigger Activity? What is a Wait Until statement? What is a Model Object?
Variables hold the value of an entity’s name.
Many situations require a change-over or setup if the product changes. To track changes, the value of the past product must be stored in a variable and compared to the current product. If the product is different, then perform a setup.
An explanation of the previous example follows. Every entity entering this activity checks its current name (a_Name) against the value of the last name stored in a variable (v_PreviousName). If the name does not match, a setup time occurs, and the new name replaces the previous name in the variable. See the articles: What is an IF-Then statement? What is an Attribute? What is a Time statement?
Variables used in fields
Use variables in fields to modify information, such as times, or to check values to determine actions.
The largest variable values ProcessModel can use is: 2,147,483,647.
Display user-defined variables on the scoreboard or in a user-defined position during the simulation.
Creating User-Defined Variables
Create user-defined variables in the Attributes & Variables dialog accessed from the Insert menu.
The example above results from selecting the new New button and adding a variable.
New This button creates a new variable.
Delete This button deletes the selected variable.
Name The name of the variable. Letters, numbers, and the underscore “_” character are allowed in the name. The name must be one continuous word (i.e., v_Inventory_Level).
Type Change the type of variable to Integer, Real, or Descriptive.
If you assign a real value (containing a decimal portion) to an integer parameter (user or system defined), the value will be truncated to 0 decimal places. It will not be rounded. Capacity, input queue, output queue, batch size, and resource quantity fields are all integer fields which will be truncated if you enter a number with a decimal value.
• Integer Any whole number (no digits to the right of the decimal).
• Real Any number, including those with digits to the right of the decimal.
• Descriptive Defined with a string of adjectives or descriptors allowable (Descriptors must be one continuous word).
For more information, see Using Descriptors below.
Initial value The value assigned to the variable at the beginning of the simulation. If you do not enter a descriptor, ProcessModel will use the first descriptor in the list as the initial value for the variable.
Stats Changes the type of statistics that are collected.
• None Collect no statistics
• Basic Collects basic statistics such as total changes, average minutes per change, current value, and average value. Observation-based.
• Basic Time Same information as Basic, but the information is Time-weighted.
• Detailed Allows the same information as the Basic option plus standard deviation information.
• Detailed Time Same information as Detailed, but the information is Time-weighted.
• Observation-based Variable information is calculated based on a simple average.
• Time-weighted Variable information is calculated based on the average of the products of the variable multiplied by the length of time it remained at that value.
Paste Rule How Global Variable add to the model when pasted.
• Duplicate If the Global Variable does not exist in the target model, add it to the Global Variable dialog. If the Global Variable exists in the target model, do not add it.
• Clone If the Global Variable does not exist in the target model, add it to the Global Variable dialog. If the Global Variable exists, add it with a suffix (v_Reject_Count will become v_Reject_Count1). In addition, all instances of the v_Reject_Count in the logic change to v_Reject_Count1.
Scoreboard With the scoreboard option enabled the variable displays on the simulation scoreboard.
Descriptor list The list of adjectives or descriptors allowed. Only available for variables whose Type is Descriptive.
Define a variable
1. Select Attributes & Variables from the Insert menu.
2. Click on the Global Variables tab.
3. Click on the New button.
4. Enter the name of the variable.
5. Select the type: Real, Integer, or Descriptive. If you select Descriptive, you must enter the list of descriptors in the box provided with a separate descriptor entered on each line.
6. Enter an initial value.
Display a Variable on the Scoreboard
1. Select Attributes & Variables from the Insert menu.
2. Click on the Global Variables tab.
3. Select the Scoreboard check box.
Display a variable in a user-defined position
1. Select the Label palette from the Gallery.
2. Select a Label graphic and place it on the layout to the left of where you want the variable to be displayed.
3. In the label dialog box, select the variable name.
When a variable is marked to be displayed in the scoreboard, it cannot be displayed by a Label. Remove the checkmark from the Scoreboard option when defining the variable (click Insert / Variables & Attributes / Global Variables).
Hierarchical Model – Delete Variables
Linked hierarchical model files synchronize data when you save each file. When you delete a variable, attribute, or scenario parameter in one model file, it is added back in from the other linked files during synchronization.
- Unlink your hierarchical model files.
- Make your change in each file and save it.
- Re-link the hierarchical structure