question

Cetim C avatar image
0 Likes"
Cetim C asked Jason Lightfoot commented

Problems with preemption

Hello,
I want that the operator travel to queue2 and have 40 second delay, but he will be interrupted every 10 seconds so he has to go to queue1 and come back. On return, I want the delay to be at the same point, and that is the proble, that every time he returns, the counter is reset. It is as if the save context is not running.
Attach the model.
Thanks in advance
InterruptionV2.fsm

FlexSim 22.1.2
preemption
interruptionv2.fsm (51.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.

Jason Lightfoot avatar image Jason Lightfoot ♦♦ commented ·

Hi @Cetim C, was our answer helpful? If so, please click the "Accept" button at the bottom of their answer. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always unaccept and comment back to reopen your question.

0 Likes 0 ·

1 Answer

Jason Lightfoot avatar image
0 Likes"
Jason Lightfoot answered Jason Lightfoot commented

You should not preempt tokens that are waiting for a task to complete - instead you should preempt the task executer by using a higher priority task sequence with prempt set to PREEMPT_ONLY. When that sequence is complete the task executer will resume the preempted task and fire the callback at the correct time. If you need to, insert milestone tasks in order that you repeat things like travel if needed.


· 6
5 |100000

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

Cetim C avatar image Cetim C commented ·
Thank you for your reply but, sorry, I didn´t understand what you explained. I don´t understand what should I change
0 Likes 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦♦ Cetim C commented ·

Here's the modified model.

Note that by using a milestone the preempting set of tasks doesn't need to know anything about which task is was interrupting - so does not include the travel task back to queue2. I added a small delay to indicate something is done at queue1.

Also note that the range of the milestone task is not 2, but 4 - this is to include the callback task for each task activity.

interruptionv2_jl.fsm

0 Likes 0 ·
Cetim C avatar image Cetim C Jason Lightfoot ♦♦ commented ·

Thanks for the clarification, but the problem still exists. It is like an infinite loop. Main delay progress has not been saved

0 Likes 0 ·
Show more comments