question

Marcello Rosadini avatar image
0 Likes"
Marcello Rosadini asked Marcello Rosadini commented

Wait for event: specific batch released

batching-matching.fsm

Hi,

in this sample model I have on the left a batching activity that groups based on a label:team

On the right I have tokens waiting in a wait for event activity that listens to the release of a batch.

What I would like to accomplish is that the wait for event gets the value of the label team from the batch released on the left and releases one token with a matching value for the label team.

FlexSim 17.1.2
wait for eventbatchingmatch label
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

Matthew Gillespie avatar image
2 Likes"
Matthew Gillespie answered Marcello Rosadini commented

That's not really how the label matching functionality of the Wait For Event works. The Release Batch event passes in an array of the batched tokens. If you say to match that with the listening token's team label then it's going to compare the array of batched tokens with the number on the token's team label and never match. The matching option is useful if you have a reference to a specific token on a label and you're waiting for that exact token to trigger an event.

I've modified your model to show a couple other ways of doing this.

The first method uses a Wait For Event that listens to the OnExit of the batch activity. I'm then assigning the exiting token to a label on the listening token. The listening tokens go to the following decide and then use that newly assigned label to compare team labels. If they don't match the token returns to the Wait For Event.

The second method uses a Synchronize activity with a PartitionID of token.team. This might not be what you want though since this will also make the tokens on the left wait for those on the right.


· 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.

Marcello Rosadini avatar image Marcello Rosadini commented ·

Thank you very much @Matthew Gillespie The first approach is definitely what I was looking for.

Thanks for the second example two, is always good to see different approaches to variants of a problem.

Thanks!

0 Likes 0 ·