question

Craig DIckson avatar image
0 Likes"
Craig DIckson asked Craig DIckson commented

Reading a zone partition's state in FlexScript

Hi,

I have a partitioned zone in my processflow. In a separate activity, I need to know how many tolens are in a particular partition in the zone. I see how to get the stat for the total, but not how to break that down by partition.

Thanks

Craig

FlexSim 21.1.4
flexsim 21.1.4zone partition
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

·
Felix Möhlmann avatar image
1 Like"
Felix Möhlmann answered Craig DIckson commented

There is an option for this in the "Assign Labels" activity.
getpartitioncontent.png

The "Requirement" is the partition ID (or variable/label containing that ID).

If you want to get the value in code, the command this option uses is:

getstat(<ZoneObject>, "PartitionContent", STAT_CURRENT, <InstanceObject>, <PartitionID);

The <InstanceObject> reference is only necessary if you are using an instanced process flow. Otherwise it would mostly be "current" if you want to get the value in the same process flow.

Warning:

Partitions will be created as soon as a token belonging to it first enters the zone. If you try to get the content of a not (yet) existant partition, both methods will return the maximum value for the class you assign it to (integer: -2147483648, double: 340282346638528859811704183484516925440)


· 1
5 |100000

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

Craig DIckson avatar image Craig DIckson commented ·
Thanks! That's what I needed.
0 Likes 0 ·

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.