question

GRodea avatar image
0 Likes"
GRodea asked GRodea commented

AverageContent of a Rack Using Statistic Collector

Hello,

I've set my statistics collector to generate the table of the average content of my racks but it not showing anything. I used the data.row.labels["Content"].as(TrackedVariable).average expression but seems there is something I am missing.

Could anyone please help to identify where I am missing anything?

thanksExample.fsm

FlexSim 23.1.2
rackstatistic collectorcontentaverage
example.fsm (308.0 KiB)
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

·
Jason Lightfoot avatar image
1 Like"
Jason Lightfoot answered GRodea commented

On row adding you need to add the Content tracked variable label and then refer to that when you increment by Delta (at the same time returning the current value to show in the column).

Hopefully that's what I've done in this version (please check the stats):

example_rackcontentstatscollector_jl.fsm


· 7
5 |100000

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

GRodea avatar image GRodea commented ·
Hello Jason, thanks for the quick reply!

I am not following your comment fully. Where should I add the row?

While running your proposal, it is showing me and average content of 1/2 max in each rack/object which it is not fully truth.

I would really appreciate if you could elaborate a bit more on how to achieve the avgcontent. Thanks for your patience

0 Likes 0 ·
Felix Möhlmann avatar image Felix Möhlmann GRodea commented ·
First I'd like to clear up a possible misconception: A label that is added to a row of the Statistics Collector is separate from the data that is added to the table. Row labels mostly serve to store data that is needed when the row is updated next.

The expression you tried to use to get the average content accesses a tracked variable label on the row, but no label is added to the row in your model. Jason fixed this by adding the tracked variable in the On Row Adding event trigger (see Triggers tab).

​In the CurrContent column, he

- chose the option that reads the label's value and assigns it to the column.
- added an extra line to the code of this option that increments the label's value by the delta value first.

1 Like 1 ·
Jason Lightfoot avatar image Jason Lightfoot ♦ GRodea commented ·

Can you tell us which entry looks wrong and why?

1688997914367.png

0 Likes 0 ·
1688997914367.png (26.6 KiB)
GRodea avatar image GRodea Jason Lightfoot ♦ commented ·
Sorry, my mistake... it was a matter of making the table bigger... I was only able to see the first digit
1 Like 1 ·
Show more comments

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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