question

Lisa_marie Gl avatar image
0 Likes"
Lisa_marie Gl asked Felix Möhlmann answered

Conditional Decide if Item with certain label is inside Queue?

Decide_Function.fsm

Hello,

In my model I have two Queues for Material. One for new and full raw materials (Queue1) and one in which opened raw material drums are placed (Queue2).

For a dispensing activity of my operator I want a conditional decide in process flow which decides wether there is opened material in Queue2 or not. If there is the matching Material in Queue2 the operator should get it from there. If there is not, he should get it out of Queue1. It is guaranteed that the needed material is always either in Queue1 or Queue2.


The Token for my operator activity in process flow has the label "RawMaterial1" with value "silver". Because thats, what the operator should get. Inside Queue2 is the item with the label on the 3D Cylinder "RawMaterial_3D" = "silver". In the conditional decide function I am asking:

Model.find("Queue2").Cylinder1.labels["RawMaterial_3D"].value == token.RawMaterial1.value

which ist not working. I possibly do not "speak" to the item in Queue 2 properly but I couldnt find any other questions here, which solved my problem.

I would really appreciate any help! I attached the test model.

Best wishes,

Marie

FlexSim 21.0.0
conditional decidemodel.find
decide-function.fsm (49.7 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

"Model.find("Queue2").Cylinder1" tells FlexSim to read a label called "Cylinder1" on Queue2. To get a reference to the item either include the name in the find-command or use the subnodes syntax.

Model.find("Queue2/Cylinder1").labels["RawMaterial_3D"].value
Model.find("Queue2").subnodes["Cylinder1"].labels["RawMaterial_3D"].value
Model.find("Queue2").subnodes[1].labels["RawMaterial_3D"].value

In either case this assumes that there will always be exactly one item in the queue. It'd be better to use a for-loop to check all items in the queue for the correct label value. You can also "try" to pull from the list containing the items in Queue2 first by utilizing the "Use Max Wait Timer" option in the Pull from List activity.

Test_Decide_Function_2.fsm


5 |100000

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

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.