question

Gavin Douglas avatar image
0 Likes"
Gavin Douglas asked Anna Lisa Dierking commented

resource release?

I want six tokens to grab six resource and then get batched into one token. No problem so far. At some point in the model, the single token, needs to pass back six resources, not just one. I know its just one token now but can you release six resources based on one token? I have tried everything. Being able to track the number of resources that make up a batch and then release that number comes up in every model I write. I have hacked my around the problem and hope there is a clean way of doing this.

FlexSim 17.1.2
resource release
· 3
5 |100000

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

Kari Payton avatar image Kari Payton commented ·

Have you tried using synchronize and join tools instead of batching? @Gavin Douglas

0 Likes 0 ·
Matthew Gillespie avatar image Matthew Gillespie ♦♦ commented ·

You can set the # of Tokens to release on the Batch to be equal to the Batch Quantity. That way the batch doesn't destroy any tokens and each token can release it's own resource.

0 Likes 0 ·
Gina Lasure avatar image Gina Lasure Matthew Gillespie ♦♦ commented ·

I have some follow-up questions on this -

In my experience, releasing the batch quantity to retain resource information only works if you're releasing the same quantity that was collected in that specific activity.

I'd like to be able to have 10 items (each using 1 resource) be batched into a single token, run through several other activities as one token, and then be unbatched into 10 individual tokens again. It's easy to split the tokens back up, but I've never been able to correctly carry the resources through so they can be properly returned. 9 of them always go missing.

Is there a way to do this that I'm missing? Obviously you can get around it with code, but it would be easier if I didn't have to.

0 Likes 0 ·

1 Answer

Anna Lisa Dierking avatar image
0 Likes"
Anna Lisa Dierking answered Anna Lisa Dierking commented

I had the same issue recently.

In the attached example model each token acquires one resource. After that four tokens get batched to one token. I used the Label Aggergation to store the resource information of each token onto the token that is going to leave the batch activity.

Then I used the "Release All" function to release all the resources now stored on that one token. But the problem is that only one resource gets released. Is the "Release All" function not the right one to make this happen?


release-all.png (12.4 KiB)
release-all.fsm (19.7 KiB)
· 2
5 |100000

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

Steven Hamoen avatar image Steven Hamoen commented ·

@Anna Lisa Dierking If you put a delay after the batch and step through your model you will see that when the 3 tokens are destroyed in the batch, the 3 resources are already released. So apparently destroying a token automatically releases the resource. You could release the batch amount and store all but one in a list. When the last one is ready to release you pull all the tokens from the list and releasing every resource that way.

0 Likes 0 ·
Anna Lisa Dierking avatar image Anna Lisa Dierking Steven Hamoen commented ·

For some reason, I missed that. Thanks for pointing that out. Unfortunately, the resources seem to be released but can't be acquired again. If you step further you will see that only the fifth token can acquire a resource and the sixth token (and so on) can only send a request.

0 Likes 0 ·