When you want to calculate how long an entity spent between two points in your model. By capturing the elapsed time to a variable, you can plot the results in a Time Series plot (as shown after simulating this model object).
Where to Find the Model Object
The following model object can be found in the model objects directory:
- Reporting \ Calculate Elapsed Time
Difficulty Level
- Ease of Use: Easy
- Ease of Modification: Easy
How to Use the Model Object
- Open Your Model: Open your model or create a new blank model.
- Insert the Model Object into Your Model
- Locate the model object Calculate Elapsed Time and select the insert button.
- Move the cursor to the point of insertion and left mouse-click. The upper left corner of the model object will be inserted at the location of the mouse-click.
- Connect to Your Model: You should see two percentage route routes copied to your model a route to the left and a route to the right.
- Connect the arrival part of the percentage route on the left to the part of your model where you would like to start collecting time information / start tracking time.
- Connect the exit part of the percentage route on the left to the rest of your model.
- Connect the arrival part of the percentage route on the right to the part of your model where you would like to stop collecting time information / stop tracking time.
- Connect the exit part of the percentage route on the right to the rest of your model. The location of the action logic used in this model object can be moved to any location you like. For example, you could assign the start time in an activity and calculate the elapsed time in another activity. Just be aware that in this case, the start time will begin “after” the entity has left the input queue of the first activity. Therefore, any waiting time in the input queue will not be included in the elapsed time.
If you calculate the elapsed time in an activity rather than on the route leaving it, make sure you use a TIME statement in that activity’s action tab because any time assigned on the General tab for that activity will occur “after” the action logic has been executed. Also be aware that, in this case, the calculation will occur “before” entering the activity’s output queue (if you have one assigned).
- Connect the exit part of the percentage route on the right to the rest of your model. The location of the action logic used in this model object can be moved to any location you like. For example, you could assign the start time in an activity and calculate the elapsed time in another activity. Just be aware that in this case, the start time will begin “after” the entity has left the input queue of the first activity. Therefore, any waiting time in the input queue will not be included in the elapsed time.
- Connect the arrival part of the percentage route on the left to the part of your model where you would like to start collecting time information / start tracking time.
- Review Output Report
- Simulate the model.
- Open the Output Report for information on v_Elapsed_Time1 variable.
- Export the variable data by clicking the second Excel icon that will Export Variable Report to Excel.
- Choose the location where you would like the Excel file to be saved.
- Choose the variables you would like to export and click OK. Goto the location chosen at step 4.3.1 and open the Excel file.The reason for using Output Report for exporting variable data is that ir can export more than one million rows of data (Excel limitation), while Output Detailed Report can only export upto 16,382 rows.
- Open the Output Detailed Report, click the Generate a time series plot icon, add v_Elapsed_Time1 to Selected Values and then click OK.
- Completion: The model object is now integrated into your model, you should now be able to save and then simulate the model.
Controls Usage
Attributes:
- a_Start: Do not change.Simulation clock time when the entity enters the Process activity.
Variables:
- v_Elapsed_Time1: Do not change. The difference between the current simulation clock time and the start time.