question

Kuilin S avatar image
0 Likes"
Kuilin S asked Felix Möhlmann answered

Why does TaskSequence.priority doesn't work as expected?

Hello, everyone,

Now I have built a simple model. There are three sources, one dispatcher with a transporter and one destination(queue). I set three different priority value in the source. When the three task generated in the same time, I want the task with higher priority began first. But my model doesn't work as expected. Please help me, thanks in advance.

test.fsm


FlexSim 22.0.4
dispatchertasksequencepriorityqueue strategy
test.fsm (32.0 KiB)
· 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.

1 Answer

Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered

There are no (truly) parallel processes in FlexSim. What is happening here is that the source that is highest in the model tree generates a task sequence and passes it to the dispatcher. The dispatcher then passes it on before the other sources create their task sequences, preventing the priority to have any effect for the first dispatch.

I see two ways to fix this:

Allow the task sequences to preempt others. That way it doesn't matter which one is created/dispatched first. However if there are other tasks that the task executers should not be preempted away from, these would have to be assigned a higher priority.

test_preemption.fsm

You first push the task sequences to a list. Lists have the feature to allow multiple pushes before evaluating back orders.

1658819380909.png

A token can then pull the sequences in the right order off the list in a process flow and dispatch it back to the dispatcher in this priority-adjusted order.

1658819491923.png

test_ts_list.fsm


1658819380909.png (8.6 KiB)
1658819491923.png (9.4 KiB)
test-preemption.fsm (31.1 KiB)
test-ts-list.fsm (108.7 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.