Message 1 of 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
[ FlexSim 16.0.1 ]
I'm trying to get the average value of an object's statistic. Can you help me with that?
Solved! Go to Solution.
[ FlexSim 16.0.1 ]
I'm trying to get the average value of an object's statistic. Can you help me with that?
Solved! Go to Solution.
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 🙂