question

Oscar C13 avatar image
0 Likes"
Oscar C13 asked Oscar C13 commented

Pull from List more than 1 item

Hello!
I want to pull from list 2 items at the same time. I want that the operator can load 2 items at the same time and unload at the queue. For example, one item of Tipo A and other of tipo B.
I´ve tried with 2 pull from list and with subflows butI have not found the correct way.
I attach the model.
question2.fsm

FlexSim 21.2.1
pull from list
question2.fsm (58.9 KiB)
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

·
Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered Oscar C13 commented

To pull two values based on different queries you have to use two separate "Pull from List" activities. You can then either assign the pulled items to different labels on the token, or choose "Insert at Front of" instead of "Assign To" in the properties of the second "Pull from List". This will add the new value to the label, rather than overwrite the old, creating an array.

The values in the array label can be accessed with "labelname[index]", where "index" defines the position/number of the entry you want to retrieve. "labelname.length" will return the total number of entries in the array.

If you want to pull the items in parallel rather than sequentially (which will rarely make a difference) you can use split and batch activities. "batch" rather than "join" because it offers the functionality to aggregate label values into arrays, similar to the option used above.

The attached model demonstrates both versions. (You also hadn't added the "Tipo" label to the created items yet)

question2_fm.fsm


question2-fm.fsm (70.8 KiB)
· 5
5 |100000

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

Oscar C13 avatar image Oscar C13 commented ·

If in later steps of the process you want to work with these items separately? For example, the item Tipo B you just picked up can be referred to as token.pulled[1]. But that is not very intuitive name, so, if I want to put a label that token called B, in the assign labels, what value do I have to put?

question2-fm.fsm

0 Likes 0 ·
question2-fm.fsm (72.5 KiB)
Felix Möhlmann avatar image Felix Möhlmann Oscar C13 commented ·

Whatever labelname you type into the "Assign to" field (after "token.") will be used to store the reference to the pulled item. This can, of course, also just be a single letter like "B".

1634205053894.png

If you store the pulled items in separate labels you will have to use separate load/unload activities, rather than a subflow.

1634205172471.png

0 Likes 0 ·
1634205053894.png (3.6 KiB)
1634205172471.png (8.4 KiB)
Oscar C13 avatar image Oscar C13 Felix Möhlmann commented ·

I think that you didn´t understand me very well, sorry.
In the model that I attach, I have tried, but I don´t know how to do this referrence.
question2-fm (1).fsm

0 Likes 0 ·
question2-fm-1.fsm (72.5 KiB)
Show more comments

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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