question

harish.varma avatar image
0 Likes"
harish.varma asked harish.varma commented

How do I set priority for input ports in an combiner?

combiner-test.fsm

If there are items in queue1, then the combiner should get one item from queue1 and send it to queue3 until queue1 is empty.

If queue1 is empty, only then the combiner should change its priority and should get one item from queue2 until queue1 gets an item. As soon as queue1 gets an item, the combiner should change its priority to queue1 and repeat the above process.

FlexSim 7.7.4
combinerpriorityinput port
combiner-test.fsm (16.0 KiB)
5 |100000

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

1 Answer

Logan Gold avatar image
1 Like"
Logan Gold answered harish.varma commented

I would add another Queue (a dummy Queue) between your two Queues and the Combiner. Keep the Combiner's Component List so it still combines 1 item from input port 2 (the dummy Queue) and set the dummy Queue to have a maximum content of 1. Then, as long as Queue1 is connected to the dummy Queue first, the dummy Queue will always try to retrieve an item from Queue1 first and feed it to the Combiner. It will only retrieve an item from Queue2 if Queue1 is empty. I am attaching your model with those changes already made (combiner-test-fs1.fsm).

I am also attaching another model (combiner-test-fs2.fsm) with those changes made, plus I added some logic to the dummy Queue's OnEntry trigger to close its input ports every time an item arrives. I also added logic to the Combiner's OnExit trigger to open the dummy Queue's input ports when a (combined) item leaves the Combiner. That way, the dummy Queue and Combiner act like one resource that will only allow one item in at a time. Otherwise, you might see a item in the dummy Queue waiting for the Combiner to become available. If it is an item from Queue2 and a item arrives into Queue1, the Queue2 item will still enter the Combiner first when the Combiner becomes available. With this model, if there are items in Queue2 waiting for the Combiner to become available and an item arrives into Queue1, the item from Queue1 will enter the Combiner first when the Combiner become available.


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

harish.varma avatar image harish.varma commented ·

Thanks Logan, It worked.

0 Likes 0 ·