Conditional Decide if Item with certain label is inside Queue?

Conditional Decide if Item with certain label is inside Queue?

lisa_marie_gl
Not applicable
143 Views
1 Reply
Message 1 of 2

Conditional Decide if Item with certain label is inside Queue?

lisa_marie_gl
Not applicable

[ FlexSim 21.0.0 ]

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

0 Likes
Accepted solutions (1)
144 Views
1 Reply
Reply (1)
Message 2 of 2

moehlmann_fe
Advocate
Advocate
Accepted solution

"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

0 Likes