question

Meaghan Griffith avatar image
1 Like"
Meaghan Griffith asked Regan Blackett edited

Tracking staytime of two different itemtypes

I'm trying to track the staytime of two different itemtypes from creation to exit.

Using the “Tracked Variable vs. Time” on the Dashboard works almost perfectly, except it gives the data for all items created. Is there a way to create a chart on the Dashboard that gives the information for the two items distinctly? Or be able to export to .csv (The Tracked Variable vs. time does give all the data points, there just doesn't seem to be an efficient way for me to distinguish which staytimes are for item 1 or item 2).

FlexSim 16.0.1
itemtypestaytime
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Logan Gold avatar image
3 Likes"
Logan Gold answered Logan Gold edited

I suggest making two new Tracked Variables and have each variable record data for only one itemtype. I am attaching an example model to show you how to do this.

I have the model set up with an even split between itemtype 1 (red) and 2 (green). Each type goes to a different Processor to show a generally higher time in system for the green flowitems.

To add a new Tracked Variable, you just need to go into the Toolbox, click on the green plus sign, go to Statistics, then click on Tracked Variable. It will give you a window with TrackedVariable1 in the dropdown. If you were to click in the dropdown, you would see the other two default Tracked Variables plus the new one. If you make sure the new one is selected from the dropdown, you can change its name if you want. I went ahead and changed it to TimeInSystem1. Then, I added another Tracked Variable with the green plus sign in the Tracked Variable window and named it TimeInSystem2. It's possible to change a Tracked Variable's type depending on the information you want to keep track of, but I only needed to keep both the new variables as a "Time Series (e.g. Staytime)" to match the default TimeInSystem variable.

Then, it was just a matter of setting data on those Tracked Variables in the Sink's OnEntry trigger. If you add one of the predefined picklist options for this trigger, you can go to Data then "Set Tracked Variable". I made sure it was the correct variable selected in the new window that pops up. I also used another predefined option for the "To" field labelled "Item's Time in System". After this option is selected, it uses this code:

time() - getcreationtime(item)

Which simply takes the current time (when the flowitem is leaving the model) and subtracts the time the item was created using the getcreationtime() command. Finally, I set the Condition to be "Specific Item Type" and made sure the number was correct - either a 1 or 2. I decided TimeInSystem1 should represent items of type 1, so I left it as a 1.

Then, I made a second operation to the Sink's OnEntry trigger by clicking on the green plus sign and set it up the same way as the first time except I chose TimeInSystem2 as the variable and changed the 1 to a 2 for the Condition.

Now we have the time in system for a specific itemtype being recorded to the same custom Tracked Variable each time. TimeInSystem1 will only keep track of the time in system for itemtype 1, and TimeInSystem2 will do the same for itemtype 2.

To have both Tracked Variables show up on the Dashboard, I used the "Time In System vs Time" option, but the "Tracked Variable vs Time" option will do the same thing. I just made sure to remove the original TimeInSystem variable from the list of Tracked Variables in the widget's options and added my new custom Tracked Variables. You can change how the data is displayed in the widget's General tab, but I left it alone as a Time Plot with all the defaults.


5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Regan Blackett avatar image
5 Likes"
Regan Blackett answered Regan Blackett edited

Just for another point of view, you may be interested in the answers to this question:

Tracked variables and Zones

That talks about using the Process Flow 'Zone' to achieve the same results

5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.