10.9 – Statistics Gathering Techniques
Common model statistics are gathered by ProcessModel automatically and reported after the model is simulated (see Chapter 6, Analyzing Output Data). This section covers techniques involved in gathering additional statistics of particular interest through the use of variables and attributes. To learn more about variables and attributes, see Attributes and Variables.
10.9.1 – Tracking Entity Conditions
Counting the total number of entities meeting a special condition.
1. Determine the condition or attribute to be counted.
2. Create a variable of type Integer to use to keep a tally.
3. In the appropriate Action logic, increment or decrement the variable to reflect the condition being counted.
Example: A restaurant has a buffet. The management wants to know how many men, women, and children go through the buffet. An attribute called a_Gender has been defined and assigned one of three descriptors (man, woman, kid) in the arrival Action logic of the Customer entity according to a discrete distribution. Three variables have been defined to count the number for each gender: Children, Men, and Women.
TO DO: Create the variables and attribute as described above. Enter the Action logic as shown in the above illustration in the properties dialog for the Buffet activity.
To examine the results, look for variable statistics in the General Statistics Report (see General Statistics Report) where you will find the average value of each variable. The total count is reported as the current value of each variable.
10.9.2 – Tracking Contents
Tracking the time-weighted average number of entities occupying a stage in the process that consists of more than a single activity.
1. Define a variable of type Integer to track the contents.
2. Increment the variable in Action logic when entering the particular processing stage.
3. Decrement the variable in Action logic after leaving the processing stage.
Example: Once a customer leaves a car at the repair shop, it is serviced, cleaned, and readied for the customer to pickup. We want to know the average number of cars between the start of the Service and the end of the Cleaning activities.
TO DO: Define the variable Serv_Clean_Content as type Integer . Enter the Action logic as depicted in the illustration above.
To examine the results, look for variable statistics in the General Statistics Report (see General Statistics Report) where you will find the average value of the variable. The average value is the average contents of the processing stage being tracked. The change in the contents over time can be viewed by selecting Time Series from the View menu in the Output Module . See Time Series Plots & Histograms.
10.9.3 – Tracking Times
Tracking the length of time spent in a particular stage of a process.
1. Define an attribute of type Real called a_ Start_Time (or some other appropriate name) to record when each entity starts a process stage.
2. Define a variable of type Real to store the accumulated time called v_ Accum_Time (or some other appropriate name).
3. Define a variable of type Integer to count the number of entities passing through the stage called v_ Entity_Count (or some other appropriate name).
4. Define a variable of type Real to which the average time may be assigned called v_ Avg_Time (or some other appropriate name).
5. When entering the processing stage, enter the following Action logic: a_Start_Time = Clock()
6. When leaving the processing stage, enter the following Action logic:
INC v_Accum_Time, Clock() – a_Start_Time
v_Avg_Time = v_Accum_Time / v_Entity_Count
Example: Once a customer leaves a car at the repair shop, it is serviced, cleaned, and readied for customer pickup. We want to know the average time spent from the time it is sent to service to the time it is returned from cleaning.
TO DO: Create the attribute and variables. Enter the Action logic as shown in the above illustration.
The ending or current value of the Avg_Time variable is reported under variable statistics in the General Statistics Report (see General Statistics Report). You may also want to examine the Time Series graphs on the Avg_Time variable to see how the average time varied during the duration of the simulation run.
10.9.4 – Tracking Times Against a Standard
Counting the number of times that an activity or other time consuming events fell within a particular range.
1. Create two variables and an attribute (all of type Real) used in tracking the statistic.
2. In the appropriate Action logic, increment or decrement the variable accordingly.
Example: A call service center with 50 operators wants to measure its level of service by tracking the number of calls that are answered within 30 seconds compared with the number of calls that are not. Calls are answered by an automated system and put on hold until they can be answered by an operator. A variable is created to track each number: v_ Above and v_ Below . An attribute called a_ Start_Time is used to track the waiting time.
TO DO: Create the variables v_ Above and v_ Below and the attribute a_ Start_Time . Enter the Action logic in the storage and activity as shown above. Enter an Input Queue Size of 0 (zero) and a capacity of 50 for the activity. Enter a Move time of 0 (zero) for the routing connection between the storage and activity.
10.9.5 – Tracking Resource Uses
Tracking the number of times a particular resource is used for a particular activity or set of activities.
1. Create a variable used to track the statistic.
2. In the appropriate Action logic, test for the resource being used.
3. Based on the outcome of the test, increment the tracking variable accordingly.
Example: A team leader takes support calls when no other technicians are available. We want to know how many calls the team leader is taking. A variable called Lead_Calls is defined to track the number of calls the team leader takes.
TO DO: Define the variable Lead_Calls . In the resource connection for the Lead, select the Use as alternate option. Enter the Action logic as shown in the above illustration in the Answer activity.
10.9.6 – Creating a 24-Hour Clock
Create an on-screen clock that will display the time of day and day of week.
1. Create a variable for the hour of the day (v_Hour) and for the day of the week (v_Day).
2. Place both newly created variables in screen (See Display a variable in a user defined position)
3. Place an entity with a single arrival (periodic with an arrival frequency of zero).
4. Have the entity arrive at a location with the following action logic.
Example: For presentation purposes, a display of a 24-hour clock and day of week is critical to help team leaders see the timing of certain events.
v_Day = 1
While 1 = 1 Do
If v_Hour = 24 Then
v_Hour = 0
If v_Day = 8 Then
v_Day = 1
TO DO: Define the variables V_Hour and V_Day. Create a new entity arriving at a new activity. Set the arrival type to periodic and the arrival frequency to zero. In the action logic at the activity place the action logic provided above.
10.9.7 – On-Screen Variables
Show dynamic variables while the simulation runs.
1. Create a variable used to track the statistic.
2. From the Variable dialog, select the Scoreboard check box.
Example: A new statistic is created to show the number completions per day. The output graphs will adequately display the statistics but the dynamic view of the statistic on the screen will aid in developing understanding.
TO DO: Define a variable to collect the desired statistic and place a check in the check box labeled Scoreboard. Place the desired logic in the action tab to manipulate the variable and collect the statistic needed. Run the model and the view the variable on the scoreboard.
10.10 – Animation Techniques
The animation can be manipulated from within the model in two ways: an entity graphic may be changed part-way through the model, and routing lines may be hidden from the view.
10.10.1 – Changing Entity Graphics During Simulation
There are two methods of changing the entity graphic during the simulation. Both methods are described below with separate suggested techniques.
1. Change the graphic without affecting output statistics (visual change only).
2. Change the graphic and collect statistics under the new name (visual and statistics).
Suggested Technique — Change graphic only
1. Create each entity graphic that may be needed by placing a separate graphic on the layout with a unique name. Label the first entity placed on the screen #21, the second #22, etc. The count starts with 21 because ProcessModel has 20 built-in graphics. You can label the entities by using the text tool to place text label next to the entity.
2. In the Action logic where the graphic is to be changed, use the NewGraphic( ) statement to assign it the graphic defined in step 1. Use the NewGraphic statement combined with the appropriate graphic number to change the graphic as desired.
Example: A manufacturing line assembles cement trucks. One of the key metrics is total cycle time. However, it is important to the client to see the build-up of the assembly. Different graphics are developed for stages of the assembly process. The change in graphic is shown writing action logic for each graphic change. If 5 entity graphics had been developed and placed in order of creation, then the first entity (for example the frame) would become graphic #21 and the second entity (frame plus the drive train) would become graphic #22. The entity graphic could be changed from the first graphic to the second by placing the following statement in the Action Logic of the activity where the change will take place.
TO DO: Create the entities that may be used (different stages of the assembly buildup) and use the NewGraphic( ) statement to change the graphic in the Action logic as shown above.
Suggested Technique — Change graphic and collect statistics under a new name
1. Create each entity graphic that may be needed by placing a separate graphic on the layout with a unique name.
2. Select the name of the new graphic from the New Name drop down in the routing dialog.
Example: Calls arrive into a call center based a predefined pattern. Calls are classified into three categories (Simple, medium and difficult) by percentage routings. It is desirable to track each of the categories separately.
TO DO: Place the entities to be used in the model on the layout. Go to the routing where the graphic will be changed and select the name of the graphic from the New Name drop down.
10.10.2 – Hiding Connection Lines
Making the connection invisible entities so that appear to move without a path connecting the origin and destination of the entity.
1. Right-click on the line.
2. Select Format… from the pop-up menu.
3. Change the Color of the line and the arrowheads to the same color as the background.
10.10.3 – Creating a Background Graphic
Creating a background for the model. Useful in illustrating your model.
1. From the Insert menu select Picture.
2. Locate and select a file form the Insert Graphic dialog. Only use WMF or EMF files for background graphics.
3. Move and size the shape as needed.
Creating a layer for the background graphic is advisable so that model graphics can edited without interference from the background graphic. The layer to the right will be on top during the simulation.
To add, rename or change the order of layers, right-mouse click on existing layer in the lower left corner of the screen.
10.10.4 – Changing the Speed of Animation
During presentations it is often desirable to change the speed of animation to skip over periods of time that are uneventful and to slow the simulation to enhance understanding or make specific points.
1. Create an IF-Then statement that checks for time range and then either speeds up or slows down the animation.
Example: At the start of the model run turn the animation off until the simulation reaches 168 hours. At the simulation clock time of 168 hours the simulation speed will be set to 30
TO DO: At the first activity, use an If-Then-Else statement to check the simulation clock. If the time is less than 168 hours, use the Animate statement to set the animation speed to 0 (turns the animation off). Otherwise set the animation speed to 30 (30% of full speed).
10.10.5 – Importing Entity Graphics
Import graphics to be used as entities to enhance the dynamic representation of your model. The files that work best for entities are WMF and EMF. Other file types will work but with some limitations. JPG and GIF file types will animate properly but the static representation of the entity will often be shifted or discolored. BMP files should not be used.
Many free WMF files are available on the internet. Most graphics used in websites are either JPG or GIF which means that you can pull graphics from your company website and use them as animated graphics.
1. Import graphics directly into the palette by right-mouse clicking inside the palette and selecting Add Files.
2. Select the files to import. Multiple files can be selected at the same time by holding down the Ctrl key during selection.
3. Press the Add button to add files to the palette.
4. To make a graphic on the palette an entity, double-click on the graphic. The Shape Properties dialog will appear. Enter a name for the graphic, followed by the word Entity enclosed in parenthesis as shown above.
When shapes with this designation are placed on the layout the entity dialog will appear. To create a Storage or Resource, place those words in parentheses after the name of the shape.