question

Ilenia avatar image
0 Likes"
Ilenia asked Ilenia commented

Dynamic queue Maxcontent

I would like to make the MaxContent of a queue variable. I have two queues: one feeding into a processor and another one receiving items from it. I want the total number of items in both queues combined to always be a maximum of 10. How can I achieve this? Thank you!

FlexSim 24.2.1
queuedynamicmaxcontent
5 |100000

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

Sebastián Cañas avatar image
0 Likes"
Sebastián Cañas answered Ilenia commented

Hey @Ilenia,

The easiest way that comes to my mind is using a Process Flow Zone. You add both Queues to a Group and you add the tokens to a Zone whenever an item enters or exits the Queues. You set the maximum quantity of the Zone as 10.

1733764356963.png

I attached a demo model: DynamicQueueContent-sc.fsm


· 5
5 |100000

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

Ilenia avatar image Ilenia commented ·

Thank you very much! However, more than 10 boxes still enter the two queues!

0 Likes 0 ·
Sebastián Cañas avatar image Sebastián Cañas Ilenia commented ·

@Ilenia ,

You're right! That solution would've worked using process flow when moving items. I attached a model using a different approach: I create a label in the processor that count the current content of both queues and the processor. Then, there is a logic in the first queue that closes the input port when that value reaches 10, and open it when it below that value.

The graphs of the label and the content between the queues shows that there are never than 10 items

1733841881577.png

DynamicQueueContent-sc.fsm

0 Likes 0 ·
Ilenia avatar image Ilenia Sebastián Cañas commented ·

Thank you very much, now it works! Do you think it would be possible to have the boxes handled by 10 Task Executers, but each staying with the same box from the source to the sink? Or would I need to use objects other than queues?

Thanks in advance

0 Likes 0 ·
Show more comments
Ilenia avatar image
0 Likes"
Ilenia answered

Thank you very much! However, more than 10 boxes still enter the two queues!

5 |100000

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