Hi,

I guess I should send this to @jordan.johnson

I want to get the % of the limit for a Zone partition calculation. In the attached model I get it for the partition content as I know the maximum limit for the partitions, but I do not know how to get it for the calculation instead.

How do I access the current value of the "Result" calculation?

See the attached model where I have the code that prints the stats into the output console.

Thank you!

Kind regards,

Axel

zonepartitionstatstest.fsm
(118.0 kB)

Comment

Any change you would have time to answer this? Or someone else that knows?

Thank you!

Axel

Best Answer

**Answer** by jordan.johnson
·
Apr 08 at 03:12 PM

There is not a way to get that value directly. See this answer to the same question about subsets:

https://answers.flexsim.com/questions/61427/plotting-the-zone-statistic-for-a-subset-of-limit.html

Hi @jordan.johnson

I seem to have been unclear in my description. I have done as in the post you linked to get the percentage by having the limit in a global table. Also, my model was incorrect as I had placed the Partition Constraint limit on the number of tokens, when it was supposed to be using the "Result" calculation. The fixed model is attached.

zonepartitionstatstest2.fsm

The problem is that I do not know how to get the partition calculation value (the total value), but only the partition content. Currently I use the code below to get the partition content, but that seems to be the number of tokens in the partition which I do not want.

double value = getstat(zone, "PartitionContent", STAT_CURRENT, instance, partitionID);

I want to get the value of the "Result" calculation so that I can divide this with the limit to get the percentage. So can I replace "PartitionContent" with something else to get the value?

The partition calculation values seem to be in the Zone variables tree under "partitionCalculations/Result/instances", but getting them from here does not seem very easy although probably not a problem to get. Although the instance values to not exist at the time of model reset.

Thank you.

Kind regards,

Axel

zonepartitionstatstest2.fsm
(118.1 kB)

Ah, that makes sense now. I think this is the code you need:

double value = getstat(zone, "PartitionCalculationTotal", STAT_CURRENT, instance, partitionID, "Result");

Partition Calculation statistics are per partition, per calculation. You can get the input, total, output, and perToken value of the partition calculation.

Great! That works! A few more question

1. Is there a list somewhere of the parameters that one can give to getstat?

2. Or are the ones you listed, i.e. input, total, output and perToken the ones that exist?

3. And are they are given as "PartitionCalculationInput", "PartitionCalculationOutput" and "PartitionCalculationPerToken"?

The list in the getstat command documentation does not contain these. In case I would need to get something else than the total at some stage.

Thank you!

Axel

Follow
### Follow this Question

Incorrect calculation values 1 Answer

Statistical tool setting problem 1 Answer

Cycle Time of Item Type 1 Answer

referencing node numeric value of a zone partition 2 Answers

Zone allocation: bug or error in the implementations? 1 Answer

© 1993- FlexSim Software Products, Inc. All Rights Reserved.

FlexSim is a fully 3D simulation software environment. FlexSim can be used to simulate any process in any industry.

FlexSim®, FlexSim Healthcare™, Problem Solved.®, the FlexSim logo, the FlexSim X-mark, and the FlexSim Healthcare logo with stylized Caduceus mark are trademarks of FlexSim Software Products, Inc. All rights reserved.

- site links
- www.flexsim.com
- contact us
- blog
- privacy policy
- archived forum

- Anonymous
- Sign in
- Create
- Ask a question
- Post an idea
- Create an article
- Spaces
- Software & Simulation Questions
- Accounts & Licensing
- FlexSim
- FlexSim Healthcare
- Explore
- Topics
- Questions
- Ideas
- Articles
- Users
- Badges