question

Guillaume V avatar image
0 Likes"
Guillaume V asked Guillaume V commented

Loop tokens until labels are matched in lists

Loop until same labels are in lists.fsm

Hello there,

Sorry I'm asking a 2nd question in less then 24hours but I am again stuck. Hopefully this will be the last challenge for my model...

I generate a Token on the "Left" that has 2 Labels:
A = 3
B = 2
I want to loop that Token on the "Left" until:
=> There is 1 token with Label A=3 in the list in the "Centre"
AND
=> There is 1 token with Label B=2 in the list in the "Right"


So far, the best result I have is using a Decide and a delay to loop the token back.
But this process makes my simulation very slow and is obviously not the best way to do it.
I tried to use WaitForEvent but I only managed to read the number of tokens in the list, I can't manage to match it with the label of token in the WaitForEvent.

Any idea please shout.

1625559922621.png

FlexSim 19.0.0
process flowlistlabelloopwhile
· 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.

Ryan Clark avatar image Ryan Clark commented ·

Hi @guillaume.v,

We haven't more from you. Sorry for not responding in a while! Were you able to solve your problem? If so, please add and accept an answer to let others know the solution. Or please respond to the previous comment so that we can help you more.

If we don't hear back in the next 3 business days, we'll assume you were able to solve your problem and we'll close this case in our tracker. You can always comment back at any time to reopen your question, or you can contact your local FlexSim distributor for phone or email help.

0 Likes 0 ·

1 Answer

AndrewR avatar image
0 Likes"
AndrewR answered Guillaume V commented

Hi,

I would change the thinking behind this and restructure the 'Left' as shown below

1625561910355.png

Then change the two Pull From Lists to include a Request and Require number of 1 and then tick the All or Nothing check box. 1625562243622.png

The token will then wait in the Pull from List until the query can be fulfilled and it can then pass through to the second Pull from List.



1625561859316.png (31.7 KiB)
1625561910355.png (31.7 KiB)
1625562243622.png (21.1 KiB)
· 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.

Guillaume V avatar image Guillaume V commented ·

Thank you @LeGrand Gold

Let me complicate the problem:
1) I want the token on the left to pass when there are simultaneously a token with label A = 3 in the list on the "Centre" and a token with label B = 2 in the list on the "Right".
2) I don't want to remove the token from the Lists on the "Centre" & the "Right" as I use the lists for other purposes in my entire model. What I'm trying to do is just read the labels present in the list without affecting its content.

Quite a puzzle isn't it?
Any idea?

0 Likes 0 ·
Joerg Vogel avatar image Joerg Vogel Guillaume V commented ·
Option: Leave entries on List!
0 Likes 0 ·
Guillaume V avatar image Guillaume V commented ·

@Joerg Vogel @AndrewR
Thank you both,

The problem I'm facing is:

1) I want the token on the left to pass when there are simultaneously a token with label A = 3 in the list on the "Centre" and a token with label B = 2 in the list on the "Right".

In our current model there's a risk that at time=t we found a label A=3 in the list in the centre. At time=t+dt we find a label B=2 in the list in right; but at t=t+dt there's not anymore a label A=3 in the list in the centre. I want to token in the left to pass when both condition are respected at the same time.

0 Likes 0 ·