Zone data into Statistics Collector

Zone data into Statistics Collector

alaaeldakrory
Not applicable
18 Views
3 Replies
Message 1 of 4

Zone data into Statistics Collector

alaaeldakrory
Not applicable

[ FlexSim 23.2.0 ]

Hello,

I am building a statistics collector to pull data from zones. I need to get the total value of a subset calculation. I'm using a timer event, so every 7 days I'll pull all zones data.


The stat collector gives the option to get data from zones and I can specify that I need a calculation request input. However, I can't find a way to tell it what calculation I need to pull data for, and I end up with a long number that doesn't really represents what I want. Is that what the "requirement" filed is for? or do I need to edit the code to do this?



1711553955119.png

1711554030684.png


1711554288458.png


0 Likes
Accepted solutions (1)
19 Views
3 Replies
Replies (3)
Message 2 of 4

alaaeldakrory
Not applicable

I don't think the format is the issue. This number is way more than my zone calculation. Here's a demo model. I want to know the total weight of all tokens in Zone 3. I put a bar chart for reference. If you look at my stat collector, I'm getting another huge number.


Zone_StatCollector.fsm

0 Likes
Message 3 of 4

moehlmann_fe
Observer
Observer
Accepted solution

If there is a working default chart, then you can install its components to inspect how they work and even possibly start from there to adjust the Statistics Collector to your needs.

1711561422505.png

The correct expression in this case is the following.

getstat(data.rowValue, "CalculationTotal", STAT_CURRENT, instance, "Weight", "TotalWeight")

The "requirement" is two separate values in this case, so the GUI is actually inadequate and doesn't allow you to input both. Only option I see is to edit the code manually.

In the attached model I also modified your collector further to get the sum of the calculation over all four 4 zones by using an array with all zones as the row value and running a for-loop over all of them when determining the column value.

zone-statcollector_1.fsm

0 Likes
Message 4 of 4

alaaeldakrory
Not applicable

Thank you!

That saved me hours of having to manually create 6-7 columns for every zone. I can now loop through the whole group. My actual model has 30+ zones. I was sure there's a smarter way to do this!

0 Likes