question

Noah Z avatar image
0 Likes"
Noah Z asked Joerg Vogel commented

Pulling Content Value From a Specific Zone Partition Caclulation

I have a zone with partitions based on a string label on entering tokens. Further, there is a partition calculation based on a different numerical label on the entering token as well.

I'm trying to figure out the best way to pull the current value of the partition calculation for a specific partition. Is there a command that will allow me to do this? Ultimately I'm trying to check on the value of that specific partition calculation every so often from within a User Event.

FlexSim 19.2.0
zone partitionpartition calculations
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

·
Sam Stubbs avatar image
0 Likes"
Sam Stubbs answered Karan commented

The command you need to use to get Partition stats is getstat, and the parameters are as follows:

getstat(getactivity("ProcessFlow", "Zone"), "PartitionCalculationTotal", STAT_CURRENT,0,partition,"Partition Total Value")

The first parameter is the Zone, the second is the stat you want (in this case "PartitionCalculationTotal.) The third parameter is the value you want (STAT_CURRENT, STAT_AVERAGE,etc). The Fourth parameter is the instance the processflow is in (0 if it is a general flow, or the object the instance is attached to if it's instanced. Then fifth parameter is the partition value. (In your case the string name of the partition you'd like to look at.) And finally the last parameter is is the name of the Partition Calculation you defined.

· 3
5 |100000

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

Noah Z avatar image Noah Z commented ·

zone-partition-stat-not-updating-in-real-time-v1.fsm

Thanks @Sam Stubbs! That code worked perfectly.

I did stumble upon another question (I can make this it's own separate topic if you want?).

Basically, I sum up the numerical label to write to partition calculation. However, if while a token is within the zone that token label changes values it looks like the zone partition calculation is not updated. I've attached an example model to showcase this behavior. Is there a way to essentially force the zone to re-assess the sum of all the tokens that are within it via code?
The example model includes the situation where we start out a token with a 500 parts in a label and then halfway through it's process flow it loses 10% of the Parts (the label is updated). The current zone partition calculation, however, remains at 500 and doesn't change.

0 Likes 0 ·
Noah Z avatar image Noah Z Noah Z commented ·

@Sam Stubbs

Any thoughts?

0 Likes 0 ·
Joerg Vogel avatar image Joerg Vogel Noah Z commented ·

@Noah Zenker, please ask a new question. Then the question won’t be easily lost on weekly review, because the question hasn’t got an answer. A question after an answer looks already answered.

1 Like 1 ·

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.