question

Claire Krupp avatar image
0 Likes"
Claire Krupp asked Andrew O commented

PF Batch w "Hold Excess Quantity" - next Batch Quantity is not recalculated

I am using the Process Flow Batch activity to pull in multiple tokens and produce 4 outgoing tokens representing pallets, each one with a different density. I have custom code to figure out what the density should be for each batch. Any excess quantity on the last token of a batch is carried over and it becomes the first token of the new batch:

1676670865768.png


The Batch Quantity for the first batch is calculated correctly, and the excess 200 units are carried forward to the second batch, but the second batch uses the same density as the first batch. I have breakpoints in the code, and they are never triggered, which means the Batch Quantity calculation is not being re-evaluated.

I could do the calculation earlier and put the density I want on a label of the incoming tokens, but if the quantity is not re-evaluated, then that will not work either.

Any suggestions?

The model is confidential, but I can send it to the Dev team if needed.

Thanks

FlexSim 23.0.1
process flow batch
1676670865768.png (22.0 KiB)
· 2
5 |100000

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

Claire Krupp avatar image Claire Krupp commented ·
Update: If I adjust the batch quantities so that I do not have any overflow, and each batch starts with a new token, then the batch quantities are calculated as expected. It must be a problem with the overflowing token only.
0 Likes 0 ·
Andrew O avatar image Andrew O commented ·

Hi @Claire Krupp, was Felix Möhlmann's answer helpful? If so, please click the "Accept" button at the bottom of the answer. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always unaccept and comment back to reopen your question.

0 Likes 0 ·
Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered Jason Lightfoot commented

As you say, it seems that the batch quantity is not re-evaluated when a token for an excess quantity is created by the Batch activity.

As a workaround, you can write the target quantity to a label on the token (either when calculating it in the respective field, or beforehand). Choose the option to always release the excess amount as well. Then check if the batch quantity is larger than the target quantity. If so, create an "excess-token" manually and adjust the batch quantity label of the released token.

The excess token entering the Batch activity will correctly evaluate the quantity anew.

1676880997638.png

workaround_fm.fsm


1676880997638.png (24.0 KiB)
workaround-fm.fsm (30.6 KiB)
· 4
5 |100000

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

Claire Krupp avatar image Claire Krupp commented ·
Thanks @Felix Möhlmann I did already find a simpler workaround by just revising my target quantities to be exact units of the incoming token densities, so that there is never any excess, and a new token starts the new batch. I then adjust the outgoing quantities to what they should be after the batch.


Has the error been reported to the Dev team?

0 Likes 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦♦ Claire Krupp commented ·
I've tagged it as a possible bug for discussion.
0 Likes 0 ·
Claire Krupp avatar image Claire Krupp Jason Lightfoot ♦♦ commented ·
0 Likes 0 ·
Show more comments
Claire Krupp avatar image
0 Likes"
Claire Krupp answered

Temporary workaround: I adjusted the outgoing batch quantity to be an exact multiple of the incoming quantities, so that there is never an "excess" token, and the new batch quantity is always calculated because it's a new token coming in.

In my case I have 800 units each token coming in, and I want 5000, 5000, 4000, 2000 going out, so I changed the outbound quantities to 4800, 4800, 4000, 2400, and then corrected them after they had left the batch activity.

5 |100000

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