AverageContent of a Rack Using Statistic Collector

AverageContent of a Rack Using Statistic Collector

GerardoRodea
Not applicable
1,525 Views
8 Replies
Message 1 of 9

AverageContent of a Rack Using Statistic Collector

GerardoRodea
Not applicable

[ FlexSim 23.1.2 ]

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

0 Likes
Accepted solutions (1)
1,526 Views
8 Replies
Replies (8)
Message 2 of 9

jason_lightfoot_adsk
Autodesk
Autodesk
Accepted solution

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

Message 3 of 9

GerardoRodea
Not applicable
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
Message 4 of 9

FelixMoehlmann
Collaborator
Collaborator
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.

Message 5 of 9

jason_lightfoot_adsk
Autodesk
Autodesk

Can you tell us which entry looks wrong and why?

1688997914367.png

0 Likes
Message 6 of 9

GerardoRodea
Not applicable
Sorry, my mistake... it was a matter of making the table bigger... I was only able to see the first digit
Message 7 of 9

GerardoRodea
Not applicable

I havent been able to get the number working by myself. I've already follow every step you described.

Moreover, when I change the CurrContent as you are modifying it, it simply shows nothing.

I am driving myself crazy!

example to modify_autosave.fsm

0 Likes
Message 8 of 9

FelixMoehlmann
Collaborator
Collaborator

Your statistics collector is missing the trigger that adds the Content TR-label to the rows.

capture1.png

And the AvgContent column is currently set to display the current value of the label instead of the average.

capture2.png

0 Likes
Message 9 of 9

GerardoRodea
Not applicable
THANKS A LOT!
0 Likes