question

Jose G43 avatar image
0 Likes"
Jose G43 asked Connor A commented

Discard defective items in queue's batch size

Hello,

I'm trying to make a model where a batch of pieces is initially delivered. I defined a label calle "Cantidad" which value is the quantity of delivered items and used it to assign this size to the queue's batch sizing.

My model contains five processors and, at every processor, a defective percentage of pieces is discarded. I want to update the new label "Cantidad" by substracting the number of defective pieces removed at every processor, so the following queues just don't mix different types of items.

I attach my model where for the first processor I already tried to update this label on the code used in "Send to Port" but it's not working.

Could anyone help me to achieve this?

Thank you very much in advance.

TG4_SEQUENCE_BATCH.fsm

FlexSim 21.1.0
queuebatchbatchingbatch size
· 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.

Connor A avatar image Connor A commented ·

Hi @Jose G43, was Felix Möhlmann's answer helpful? If so, please click the "Accept" button at the bottom of their 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 ·

1 Answer

·
Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered

Updating the batch size while the queue is accumulating has several problems. The biggest one is that, if the last item of the batch is discarded, the release of the other items will not be triggered when the batch size is reduced to the current fill level (it is only evaluated when an item enters).

Instead I would suggest the following. "Faulty" items get a label when they finish processing. Have all items (faulty and ok) enter the same queue. When the batch size is reached, count in code how many items have the "faulty" label and subtract that amount from the Cantidad label for all items. This way the next processor/queue will know the correct number of items. The faulty parts can then leave into a sink by modifying the Send to Port logic to contain a clause at the beginning to send all items with the fault label to the last port (which connects to a sink).

This is demonstrated for the first processor and the connected queues in the attached model. I increased the fault percentage to 30 so the logic can be seen better.

tg4-sequence-batch_1.fsm


5 |100000

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

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.