I'm trying to get the average value of an object's statistic. Can you help me with that?
I'm trying to get the average value of an object's statistic. Can you help me with that?
To get the average staytime of this object, use the getstat command, passing in the following parameters:
The command should look something like this:
getstat(getactivity("Intake Process", "RN"), "Staytime", STAT_AVERAGE)
The average is accurate, even if the full history isn't present. In general, statistics don't keep a full history unless absolutely required.
If you want to get the Stats from a general object (not Process Flow), you should keep in mind that the 2nd parameter would be like "Content" or "Staytime" (Capitalized and ignore the "stats_"). So if you want to get the average_content of Queue3, you can use:
getstat(node("Queue3", model()),"Content",STAT_AVERAGE);
To who know much about programming or data structure, it maybe useless, but to someone, like me(I have learn few programming before using FlexSim) it will be very helpful.
Hope it will help someone~
Also, if you want a list of the available stats an object has, you can do one of the following:
Additionally, you can use the getstat() command if you have a direct reference to the node holding the statistics data, by just passing an empty string as the stat name. For example:
getstat(processor, "Content", STAT_AVERAGE)
will give the same result as
getstat(stats_content(processor), "", STAT_AVERAGE)
Although I'd suggest just using the "Content" option, accessing the node directly would most commonly be used for global tracked variables:
getstat(trackedvariable("MyGlobalTrackedVariable"), "", STAT_AVERAGE)
(BTW, by adding comments to the correct answer, I'm trying to "get a piece of the action". Too bad Jordan, I'm stealing your thunder :-)
6 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