question

Diego Avila avatar image
0 Likes"
Diego Avila asked Logan Gold commented

Wait for event on partition content change not working

I have this concept model with a Wait for event On partition Content Change where I listen to a list object but some tokens are being stuck at the activity eventhough the value decreses to the fire event value.

Duda WAit for event particiones.fsm

Why may this happen?

FlexSim 24.0.2
list pull from listcontentpartitionswait for even
· 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.

Felix Möhlmann avatar image Felix Möhlmann commented ·

I did some more testing. The token it's not working for is the one with partition 3. This is the partition that the puller token created at time 0 is assigned. The problem seems to occur because the partition is created by both tokens (listener and puller) at the same time. If you place a "Breathe" directly after the source for either of those it works correctly.

0 Likes 0 ·
Logan Gold avatar image Logan Gold ♦♦ commented ·

Hi @Diego Avila, was my answer helpful? If so, please click the "Accept" button at the bottom of the 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 comment back to reopen your question.

0 Likes 0 ·

1 Answer

Logan Gold avatar image
0 Likes"
Logan Gold answered

The issue is that partitions can be destroyed after a listener is created, which destroys the listener.

So a token gets to the Pull from List and tries to pull something from partition 3, which creates partition 3 on the list, along with a backorder. Then, another token gets to the Wait for Event, which creates a listener for partition 3, and it waits for the content of the partition to decrease to 1. Next, a third token is pushed to the list on partition 3, which fulfills the backorder, both the pushed token and the puller token advance to their next activity, and partition 3 is destroyed on the list.

When another token is pushed to the list, on partition 3, the partition is created again, but it no longer has the listener. So there is nothing to tell the token in the Wait for Event to proceed when the change rule happens.

The fix is to go into the List's Properties, under the General tab, and check the box for "Keep Empty Partitions". This way, the partition (and its corresponding listener) will not be destroyed.

5 |100000

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