Trying to develop dynamic Queues using SimEvent example "Queueing Strategies"

3 次查看(过去 30 天)
Hi,
I am trying to model a system building on the example of Queuing Strategies. I have taken parrallel queues (3) and and trying to divert entties to take shortest queue (using the function). Initially example has one entity generator but in my case I want 3 entities that would work as different type of messages and those messages will have different priorities for instance, high, med and low. Now, I'm not sure if I set the priority of an entity lets say 50 from 'entity type' tab for high priority message would make an effect on the priority. Such as the case would for two other entities as well. After setting up my model like that when I run the simulation it goes into round robin after some time which makes me wonder if priority of message is making any effect or not? What I want to ask whoever reads this is that, how I can see my high priority message is being sent to the first and further what I can do to stop my queues behaving in round robin manner. Its is possible my approach for assigning priority could be wrong. Your valueable insights are appreciated.
Many thanks.

回答(1 个)

Ayush
Ayush 2023-9-6
Hi Muhammad,
I understand that you want to develop a dynamic queue based on different priorities (“high”, “med” and “low”) of the entity and assign them the shortest queue. You have built upon the SimEvent example for “Comparing Queueing Strategies” and want some workaround for your use case.
Here is a possible workaround from the above understanding:
1. Firstly, based on your description the priority set under the “entity type” tab won’t have effect on your use case, since that parameter dictates the Event Calendar. To set priority that would be used in your model, you need to create the attribute “priority” and set their values according to the priority you want in each Entity Generator block, for instance high-1, med-2 and low-3 (following the convention of the Entity Generator block where smaller value is higher priority). You can also refer to the below documentation to know more about the entity attributes and priorities:
2. After creating the respective Entity Generator blocks and setting their “priority” attributes, input the entities into the Entity Queue block and setting the block parameters with Queue Type: Priority, “Priority source: priority”, “Sorting direction: Ascending”. This would then sort the queue dynamically from highest priority (value=1) to the lowest priority (value=3). You can refer to the below documentation to know more about the Entity Queue Block:
3. The Entity Queue Block would then output the entity in their priority order, and move onto the Entity Output Switch block, where you can set the “Switching criterion: From Attribute” and “Switch attribute name: priority”. You can refer to the below documentation to know more about the Entity Output Switch Block:
4. After this the entities can be directed towards their specific queues based on their priority. You can refer to the below documentation to know more about a similar use case as yours:
Hope it helps,
Regards,
Ayush Misra

类别

Help CenterFile Exchange 中查找有关 Discrete-Event Simulation 的更多信息

产品


版本

R2017b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by