question

Nguyen Thai avatar image
0 Likes"
Nguyen Thai asked Felix Möhlmann commented

How to send items to port according to the specified quantity

a queue have 10 item and i want send 3 item to port 1 and 7 item to port 2

FlexSim 19.0.0
send to port
5 |100000

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

Nguyen Thai avatar image
0 Likes"
Nguyen Thai answered Felix Möhlmann commented

thanks for your help
flow item similar to my attached file mophong cell 4 buoc_autosave.fsm
but layout look quite complicated
How can i make it look simpler.

And have a problem at the end order, because batch at queue 1 is 10 due to some WIP inventory at queue, i want it go to queue next


· 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.

You could just set a maximum wait time in the queue. For example, if it normally takes 852s for a batch to complete after the initial item arrives (71*12) you might set a maximum wait time of 900s to release partial batches after that time.

Other than that you would need a way to determine that no more items are expected to arrive. If the source creates a fixed number of items, you could alter the batch quantity after all full batches have been released.

0 Likes 0 ·
Nguyen Thai avatar image Nguyen Thai Felix Möhlmann commented ·
i can't set maximum wait time because i set batchsize 15 for the first flow item and update down to 12 after
0 Likes 0 ·
Felix Möhlmann avatar image Felix Möhlmann Nguyen Thai commented ·

You could update the wait time at the same time.

Or you build a small Process Flow. A token waits for entries into the queue (Wait for Event with maximum wait time). If no item has entered the queue for X seconds, the items already in the queue are released by the token.

It's a similar logic but the wait time is with respect to the latest entry instead of the first.

0 Likes 0 ·
Show more comments
Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered

In a given order or at random?

In both cases I would first initialize an array with the distribution of port numbers (7 ones and 3 twos).

If the order is fixed, the array should contain the port numbers in that order and you call them according to the output stat of the queue.

If random, pick and remove a random entry from the array and send the item there.

5 |100000

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