question

Patrick Cloutier avatar image
1 Like"
Patrick Cloutier asked Chandler commented

How to graph utilization vs time in dashboard?

@Jordan Johnson

Hello Jordan, this answer works awesomely great for operators and I'm using it right now in a case where I have 2 cranes and I measure their hourly utilization. It works great but I don't understand how it works.

And I'm trying to also plot the total utilization of both cranes. How could I tweak to process flow or the stats collector to also show the total utilization of both cranes?

On the same graph I'd have: crane1, crane2, total of both. Or it could be 2 different graphs if its easier.

I could export the current graph data to csv, make a pivot table and chart it in Excel but I was wondering if it can easily be done directly in FlexSim.

Thanks a lot,

FlexSim 22.0.2
utilization chart
5 |100000

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

1 Answer

Jordan Johnson avatar image
3 Likes"
Jordan Johnson answered Chandler commented

Here's quick review (or introduction for new users) on utilization in FlexSim. Hopefully, this will help you understand more about how the other answer works.

First, it's important to understand that utilization is based on "state". Every 3D object is in a single state at all times. For example, when a Processor isn't doing anything, it's probably in the "Idle" state. When it's handling an item, it might switch to the "Setup" state, and then to the "Processing" state. But it's only in one state at a time.

To calculate utilization, we use this equation:

(total time in utilized states) / ((total time in utilized states) + (total time in unutilized states))

But to use this equation, you have to indicate, for each state, whether it is utilized or unutilized. This is the purpose of the State Table. For each state your object can be in, you just specify whether time spent in that state is utilized or unutilized. For example, "Idle" time might count as unutilized, while "Processing" time might be considered utilized. You can also specify that it is excluded. You can see that the time spent in an excluded state doesn't affect the utilization calculation.

So to calculate utilization, you just have to know how long an object spent in each state, and whether to count that time as utilized or unutilized (or just ignore that time, if it's excluded).

To track the amount of time an object spends in each state, FlexSim uses something called TrackedVariable. To be specific, it uses a Categorical Tracked Variable. By default, the 3D objects all have a Categorical Tracked Variable that keeps track of which state the object is in, and how long it has been in that state. You can see that tracked variable in the tree:

1649172992869.png

A Categorical Tracked Variable is something that you set to a value. It assumes that those values are categorical. So 1 means "category 1". You'll notice in the above picture that this processor's current value is 1. Since this categorical tracked variable is being used to track state, we know that the object is in state 1, or the "Idle" state.

You can also see a subnode called "profile". This subnode is part of the categorical tracked variable. The profile node stores enough information so that you can call the getTotalTimeAt() method, and learn how long the tracked variable has been in each state.

So, now we can talk about hourly utilization. In order to calculate utilization, you need to define a time period. By default, the 3D objects track states from the time the model starts to the current clock time. So when you get the utilization, based on the object's state, that utilization is always from the model start to the current clock time. This means that, by default, the 3D objects can't tell you how utilized they were between 9 and 10, or between 10 and 11.

So how do you get utilization for a sub-interval, such as every hour? The approach I made a demo of in the previous question is to simply make a new Categorical Tracked Variable for every object for every hour. You can turn a label into a Categorical Tracked Variable, and that's what I did in that example model. So every hour, a blank new Categorical Tracked Variable appears. I set its value to the current value of the object I'm monitoring. And then, for the next hour, every time the object's state changes, I set that label tracked variable to the same state. After one hour, the new tracked variable has been in all the same states as the object, but it only considers that single hour. Then, all that's left is to ask the state table to calculate the utilization on the new tracked variable, and also plot that value vs time.

So, on to your second question, about "total utilization". Help me understand what you want. Are these two cranes working together, on the same gantry? So if either is utilized, then the whole "crane" counts as utilized? If so, you don't want to just add the two utilizations together; that would lead to the possibility of having a 200% utilized crane. And averaging is no good, because when only one crane is in use, it would be 50% utilized for that time period, and it sounds like you want it to be 100% utilized.

On the other hand, if the cranes are separate objects, then you probably do want the average utilization between the two of them. If that is what you want, I'd say the easiest way would be to use a Calculated Table. You can write a query that gets everything in the stats collector, and appends a new table that averages the utilization for each hour. See the attached model.

utilizationvstime-3.fsm



· 1
5 |100000

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

Chandler avatar image Chandler commented ·
This is a great write up. I am trying to implement something similar right now and hopefully this is a simple way to do it. I will comment here if it worked for me as well.
0 Likes 0 ·