question

Andrea M39 avatar image
0 Likes"
Andrea M39 asked Jeanette F commented

Getting right tokens for preemption tasks and pre-empting a lot of delay tasks

Trying to find a good way to preempt tokens from a lot of delays (like 80) to change up resources with a shift change. I tried a couple of different ways to get the tokens, but none work great.

When I use the shared resource, like in the sample model attached, I get occasions where it grabs the tokens from the task it should be doing while preempted. I want it to re-acquire the resource before it goes back to the preempted delay task where it left off. I am also updating the number available in the resource based on a shift schedule. In my actual model, I have 11 different resources each with 10+ delays to represent concurrent operations tasks.

So, what is the best way to pre-empt tokens from many delay tasks (all with different names and times).

testPreempt.fsm

Thanks,

Andrea

FlexSim 22.2.2
preemting tokenspreepmtion
· 4
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 ·
Please retry the model upload - the link seems empty.
0 Likes 0 ·
Andrea M39 avatar image Andrea M39 Jason Lightfoot ♦♦ commented ·
tried again in the comments - meant to reply but seemed to have added a new comment
0 Likes 0 ·
Andrea M39 avatar image Andrea M39 commented ·

testPreempt.fsm

Updated some things and tried to re-attach the model. There is only a process flow in this model - no 3d Model stuff.

0 Likes 0 ·
testpreempt.fsm (41.8 KiB)
Jeanette F avatar image Jeanette F ♦♦ commented ·

Hi @Andrea M39, was Jason Lightfoot's 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 edited

Push and pull the preemptable tokens to/from a list and then refer to that list to get an array of tokens you can preempt.

· 4
5 |100000

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

Andrea M39 avatar image Andrea M39 commented ·

I didn't think a list would help me here, but I will try it. I think I understand what you mean.

So if I push to the list and then release the token but keep on list, I can still pre-empt the delay, and come back to the delay using the same token. It is sort of in the core flow and on the list at the same time? I will try it today and see how it goes.

0 Likes 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦♦ Andrea M39 commented ·

preemptExample.fsm

Here's an example

0 Likes 0 ·
preemptexample.fsm (31.8 KiB)
Andrea M39 avatar image Andrea M39 commented ·
I don't see a way to do this that allows me to pre-empt the tokens, release the resources they have, then before they return to that same spot in the delay acquire a new resource.
0 Likes 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦♦ Andrea M39 commented ·

In that case don't use the prempting tokens, but release them from the delay and have them release the resources as you would when finishing normally. Use a flag on each token saying it has been preempted to route to a different part of the process and wait for reinsertion and reacquisition of the resources (as it would when normally routing through your process). Use a another label to store how much delay time was remaining or decrement the time in the delay from a 'remaining' delay time label.

0 Likes 0 ·