Just wanted to let everybody know they can read this other post that Jordan made that's related to this question: How can I get resource utilization statistics from a Process Flow resource?
Another way to get this statistic uses Process Flow. The model shown here gets the total staytime for all tokens that used the resource.
Every time you release that resource, have the token go to a Create activity. The Create activity should place an independent token on the start of the sub flow shown in the picture. You don't have to use a Create activity, but if there are multiple release activities, you only have to copy the Create activity, rather than all the activities on the side.
When you create the token, use the pick options to give it a label value. In the example above, I named the label staytime. For the value of the label, I used the pick options to get the current staytime of the Resource activity. The current staytime is the time the most recent token spent using the resource, which is the value we want to total.
The new token should enter a Zone. The Zone should be configured to have a Subset that includes all tokens. In addition, the Subset should have a Calculation that totals the staytime label, as shown in the following figure:
This way, the Zone will keep a custom statistic. Whenever a token enters the Zone, the Zone will increment that statistic (called Total Staytime) by the amount on the staytime label.
Then we set the staytime label to 0, and exit the Zone. Because the the Evaluate Calculations On Exit box is checked, the Zone decrements the Total Staytime statistic by 0, effectively leaving it unchanged. If the box were not checked, the Zone would remember the value of the staytime label, and decrement the statistic by that amount when the token left.
Once configured this way, the Total Staytime statistic on the Zone will sum the staytimes of each token. You can get that statistic by making a Process Flow chart, which I did in the attached model.
This would be great if my model wasn't already built- but going back through and clipping apart then adding this in and trying to move everything and re size stuff to make it not look crazy for EVERY instance of release operator is very unappealing.
I'm just curious what the plan was for collecting resource utilization since "acquire" in process flow doesn't seem to change the operator state for the operator associated with the resource?
I found a way to do it where you won't have to rearrange anything. You can use an event triggered source, and listen to the OnStaytimeChange event of the Resource, but still using the Zone. Here's a very similar model, but with those changes. You just need to add 6 activities and a Zone to your model.
Your second question deserves a good response, too. I'll make a separate question for it, and answer it (although you may see the question page before I can get a good answer for you)
Ok I've copied that into my model but I can't seem to figure out how you got the "Resource Staytime" to show up in the dashboard chart:
It seems like my zone settings are identical since i copied it in from your model, except the Groups tab in the chart. What am I missing?
If I'm understanding what you want to do correctly, I think you could approach it like this (and if there's an easier way to get this stat @jordan.johnson let me know)
The total staytime is something that isn't part of the standard min/max/average set of values that the resource knows how to give you, but we can get there using a command called getdatastat() during a Custom Code activity. This command lets us look at a set of data stored somewhere in FlexSim and find different stats about it, like the Sum or the Mean.
So we want to tell getdatastat() to look at all the staytimes for all the tokens that ever acquired a Resource and sum all those staytimes.
Luckily, the resource knows all of the staytimes for each token that acquires it and stores it here:
This 'history' node is a fine target for the getdatastat() command. So in a Custom Code activity you can type this:
The first line makes it easier to navigate to our 'history' node from before and gives an easy to work with reference to where all our staytime data is stored. The next line is setting a label on the ProcessFlow (rather than an individual token in ProcessFlow) that will hold the value given by getdatastat(). This lets me see the Summed calculation somewhere easily
Next is the call ot getdatastat() itself where it wants to know:
In the attached model file you can see this applied to a simple Process Flow, and a Dashboard that displays the label value.total-staytime.fsm
To save memory, Process Flow statistics don't keep a history by default. The history in the example above exists because a dashboard chart required the history.
This is more what I'm looking for, I would prefer to handle all the stat collection stuff in as few places as possible. I will test it out when I have a chance and let you know how it works. Thanks.
Ok this doesn't seem to be working for me. When I run, the dashboard doesnt seem to display anything. So I added:
double datastats = getdatastat(STAT_SUM, gettablerows(staytimedata), gettablenum(staytimedata, count, 2));
And stepping through the code datastats is always 0 for some reason.
It's because of what Jordan said up above; my way was dependent on a standard staytime dashboard being created, which makes the history node store the individual staytimes for each token. my use of getdatastat() piggy backed on that so if you delete or lose the staytime dashboard, you lose the history node which makes getdatastat give a zero. I wasn't aware of this when I put my example together.
11 People are following this question.
FlexSim can help you understand and improve any system or process. Transform your existing data into accurate predictions.
FlexSim is a fully 3D simulation software environment. FlexSim can be used to simulate any process in any industry.
FlexSim®, FlexSim Healthcare™, Problem Solved.®, the FlexSim logo, the FlexSim X-mark, and the FlexSim Healthcare logo with stylized Caduceus mark are trademarks of FlexSim Software Products, Inc. All rights reserved.
Privacy | Do not sell or share my personal information | Cookie preferences | Report noncompliance | Terms of use | Legal | © Autodesk Inc. All rights reserved