Definitions
Attributes
Attributes are placeholders associated with an individual entity. Its value cannot be seen or changed by any other entity. An attribute describes an entity such as name, size, color, type, condition, etc. They can be either numeric values or character descriptors (single-word descriptions). Attributes follow an entity as it moves through a model and can’t be changed globally by events that occur elsewhere in the model. All entities have 5 system-defined attributes, including Name, Cost, ID, VATime, and CycleStart. You may also create user-defined attributes. Attributes are often used to record time, control action logic, or make routing decisions in the model. User-defined attributes are not displayed in the output reports. You should begin all attribute names with “a_”. For example, a_Type, a_Color, a_Weight. That way, attribute names are easily recognized when reading your action logic. See What is an Attribute?
Variables
Variables are placeholders for either numeric values or character descriptors (single word descriptions). They may be used to describe or track activities and states in the system, such as the number of entities that have completed a particular activity, day of the week, an hour of the day, etc. Variables are global in nature. That means any entity can view them or assign a value in the Action tab of the Properties dialog at any location. Variables are shown in the output reports and may be used to export modeling results to Excel. You should begin all user-defined variable names with “v_”. For example, v_Count, v_Completed, v_BatchSize. That way, variable names are easily recognized when reading action logic. See What is a Variable?
Action logic
ProcessModel allows you to design custom behavior in your model by writing simple but powerful logic statements. Action logic allows you to go beyond the normal property fields to determine how an entity is processed. Examples include assigning values to attributes or variables or performing a test using an If…Then statement. See What is Action Logic?
Creating Attributes and Variables
You create an attribute by clicking the Insert menu and selecting Attributes & Variables. Then click New and enter the attribute name.
To create a variable click the Insert menu and selecting Attributes & Variables. Click the Global Variables tab, click New, and enter the variable name.
Customizing with Action Logic
Let’s begin customizing our model behavior by adding a variable that will track the number of entities in our model at any given time.
Open the Lesson 1 – Call Center model. Save the model as Lesson 5 In Process Count. Create a variable by clicking the Insert menu and selecting Attributes & Variables. Click the Global Variables tab. Click New and enter the name v_Count in the Name field.
Next, we need to write some action logic to use the v_Count variable.
Double click the arrival route (between the Call entity and the Take Call activity). Click the Action tab. In the window on the left, type Inc. That is a system statement that mean increment. Then click the Filter drop-down list on the right and select the Variable option. This will display the name of all variables you have created using the Insert / Attributes & Variables option. With v_Count highlighted, click the Paste button.
Even though you can just type v_Count rather than selecting it from the filter list, selecting from the list eliminates typing errors, and can save time when you have defined many variables and attributes but have trouble remembering exactly how you spelled each one.
Inc v_Count is equivalent to writing v_Count = v_Count + 1, just shorter.
Now that we are increasing v_Count each time an entity enters the model, we need to decrease or decrement v_Count when each entity leaves.
Double click the 75% route leaving Take Call, then click the Action tab. Repeat the steps to create the action logic on the arrival route, except use Dec (for decrement) instead of Inc.
Since entities also leave the model after the Return Call activity is complete, we need to add an exit route and add the needed action logic.
To save a little typing time, click and drag your mouse over the Dec v_Count action logic. Then hold down the Ctrl key on your keyboard and press C to copy the text. Now add an exit route to the Return Call activity by hovering your mouse over the Return Call activity. Then drag your mouse to the right. Click the Action tab. Click your mouse in the Action window. Hold down the Ctrl key on your keyboard and press V to paste the action logic from the Windows clipboard.
To get a longer look at the process increase the simulation run length to 100 hours.
Click the Simulation menu and select Options. Change the Run Length to 100 hours.