question

Nicole S2 avatar image
0 Likes"
Nicole S2 asked Matthew Gillespie edited

prioritize items in a queue

Hi all,

how can I send items from one specific processor into a queue and prioritize them before another queue?

In my model the items go from processor 1 to processor 3. Processor 3 decides if the item gets into the processor 4 or directly into the queue 2. The items from processor 4 go later also in queue 2.

If the items from processor 4 leave the processor 10 and go in the queue 3, I want that the items dont go to the "normal queue". They should go to the "priority queue" (only the items that come from processor 4). Those are prioritized and should "overtake" the items of the normal queue.

If there are items in the "normal queue" and in the "priority queue" at the same time, the items of "priority queue" should always go into queue 4 first.

Is therefore a specific setting excisting?

Thank you very much!

priority.fsmpriority.png

FlexSim 19.0.2
prioritization
priority.png (230.3 KiB)
priority.fsm (20.8 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

·
Joseph Gillespie avatar image
2 Likes"
Joseph Gillespie answered Joseph Gillespie commented

Hi @Nicole S2,

This can be done easily using labels. Either in your source or in Processor4 you could add a label to all priority flowitems. For example:

What I am doing here is at the source I am adding a priority label to all of the flowitems. 30% of them have a value of "1" (meaning high priority) and the rest have a value of "0" (normal priority). Also in the "On Exit" trigger I set the source to color normal priority flowitems black and high priority flowitems red.

Then in Queue4, I set it to pull items with the highest priority. This is under the Flow tab for Queue4:

Here is the model with this solution: priorityanswer1.fsm

I'm not sure if you need all of the queues you had, here is another model that does the same thing but with less queues: priorityanswer2.fsm (note that I changed some of the processing times in this one so that you could see that the priority items were being pulled out of Queue3 before the normal items).

Let us know if you have any further questions!


capture2.png (18.4 KiB)
capture3.png (6.1 KiB)
priorityanswer1.fsm (22.5 KiB)
priorityanswer2.fsm (21.7 KiB)
· 3
5 |100000

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

Joseph Gillespie avatar image Joseph Gillespie commented ·

I forgot to mention that in priorityanswer1 I sorted the flowitems into the "normal queue" and "priority queue" by using Send To Port - Port By Case in the settings for Queue3. Let me know if you have any questions on that.

0 Likes 0 ·
Nicole S2 avatar image Nicole S2 commented ·

Thank you very much @Joseph Gillespie

but I have one more question:

My items are not prioritized from the beginning. So I cant add a priority label at the source. Do I have to make it in the processor 3 then? Because there is the decision if the item has to go to the processor 4 or not (Trigger: On Exit -> Set Label?).

Why do you use the benoulli distribution and not another one? Is there a mathematical explanation? Can I make the setting without a distribution? Because I cant prove that the items act like a bernolli distribution and I have to explain my choice.

Thank you very much :)

0 Likes 0 ·
Joseph Gillespie avatar image Joseph Gillespie Nicole S2 commented ·

@Nicole S2

Yes, you could add the priority label in Processor 3 instead, and then send the items to either queue1 or queue2 depending on the priority. You could also give everything a priority label of 0 at the source, then send 30% of items to Processor 4 and have Processor 4 update the priority of the items that pass through it to 1. There are lots of ways you could do it, it just depends on your preference and what you are trying to simulate.

As for your second question, a bernoulli distribution is just another way of setting two values by percentage. In the example I gave, 30% will have a priority of 1 and 70% will have a priority of 0. You could also do this by using "Set Item Type by Percentage" instead of "Set Label":

This way you can specify as many types as you like and the percentages at which they occur. You could then have Queue4 pull items with the Maximum Item Type.

Hope this helps!

0 Likes 0 ·
capture4.png (9.3 KiB)

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.