question

michael.smith avatar image
3 Likes"
michael.smith asked Brandon Peterson edited

Average value of an object statistic

I'm trying to get the average value of an object's statistic. Can you help me with that?

FlexSim 16.0.1
process flowstatisticstracked variables
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
5 Likes"
Jordan Johnson answered anthony.johnson edited

To get the average staytime of this object, use the getstat command, passing in the following parameters:

  1. The object you want the average staytime for. In this case, the RN object.
  2. The name of the statistic you want. In this case, you need the name "Staytime"
  3. A flag, specifying which value you want from that statistic. In this case, you want STAT_AVERAGE
  4. This parameter depends on the object and statistic you are requesting. If your Process Flow is a general flow (not a task executer or fixed resource or sub flow), then you don't need to supply this parameter. Otherwise, it should be the name of the object attached to this Process Flow.

The command should look something like this:

  1. 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.

· 2
5 |100000

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