question

Ousmane avatar image
0 Likes"
Ousmane asked Ousmane commented

How to set priority for pulling from a list

Hello, I'm trying to do the same, but it's not working for me. Can you help me please ?

in my model i have 5 queues in a list. and I have two processes pulling from the list. the first is order delivery ("Preparation de commande") and the second is supply ("Approvisionnement"). I want the provisioning process to always have priority over the queue list. To do this, I put labels named Priority (4 for the delivery process and 3 for the supply process) and i use back order. but my delivery process still have the priority (i have a token in supply process, which is waiting for a queue, normaly it has to be a token of delivery process) i don't know why.


attached my model for detail.

Modèle actuel ++.fsm

FlexSim 23.0.2
pull from listtasksequencepriority
modele-actuel.fsm (1014.1 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

Allister Wilson avatar image
0 Likes"
Allister Wilson answered Ousmane commented

Hi Ousmane,

There are 2 issues in the current model.

1. With the way you have it setup right now, Preparation de commande does indeed have priority over Approvisionnement.
You have given Preparation de commande a priority of 4 and Approvisionnement a priority of 3.
The list's Queue Strategy is configured to sort backorders by priority in descending order (ORDER BY Puller.Priority DESC).
If you want a lower priority number to translate to a higher priority (ie: 3 gets its requests handled before 4) you can use ASC (ascending) instead of DESC (descending).

2. There may still be an order-of-events issue at startup.
Your queues are all on the list as soon as the simulation starts.
But your requests only come in later. When they do, the first request to arrive will immediately acquire a queue since nobody else is requesting one, therefore the priority mechanism isn't used.
If you also want your initial requests to be prioritised the simplest solution would be to add a Breathe (Delay activity with a zero delay time) in your lower priority logic so that those tokens arrive after the higher priority ones.
You could add this to the corresponding Day incrementation logic, just after the source.

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

Ousmane avatar image Ousmane commented ·

Hello Allister, hope you are doing well. the second option works, thank you for your helps

0 Likes 0 ·