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.

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.