question

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

Check if there is what I need

Hi,
I made a model where the operator checks that in queue 1 there is everything he needs (Item1, item2 and item3). If something is missing, he has to go find it and take it away. I have a label assignment error and I don´t know why. It always take the value 0.
question.fsm


I have donde the same but using lists and it does work. But then I have ordered the operator to take me a type 2 item and he takes me a type 1. I don´t know why.
From the 3d model, i put a trigger on entry and another on exit in the queue1 so that it would put and remove elements from the list.
question2.fsm

FlexSim 21.2.2
process flowassign labels
question.fsm (41.4 KiB)
question2.fsm (42.2 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 Felix Möhlmann commented

First model:

You overwrite the "item1" and "item2" labels when creating items in Queue2. As a result you are checking if the items you created in Queue2 are positioned in Queue1, which of course they aren't.

The way you wrote the for-loop it will always run to the end and return whatever value resulted from the last check. If, for example, you are looking for the second item in the queue, "recoger" would be set to 1 on the second check but then set back to zero on the third. You need to abort the loop when the item was found. You can stop any loop ("for" or "while") with the "break" command. Using "return" will end the code execution entirely, so it can also be used to only run until a fitting item was found.

question1_fm.fsm

Second model:

In the exit trigger you are pulling any item from the list, not the one that exits the queue. You have to use the query to tell FlexSim it should pull that specific item.

At the end you are telling the operator to load the item that you assigned to label "item2", which is what he does. This item is of type 2, but the wrong value gets pulled from the list in the exit trigger.

question2_fm.fsm

In general:

I believe there is some confusion here about what the labels you assign do. The "Assign To" option in the "Create Objects" activity creates a reference to that specific, created item in the label. In your first model you are not looking for an item of the given type but for specific items. The same is true with the load activity in your second model. You are not telling the operator to take "a type 2 item" but rather to load the item that was created in the second "Create Objects" activity and assigned to that label.

If you want to look for any item of a type, you have to either compare the items type label to the required number (first model), or use a list like in the second model.


question1-fm.fsm (41.9 KiB)
question2-fm.fsm (41.5 KiB)
· 2
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 ·

Thank you very much, but I have a doubt with that you say in "in general"
"You are not telling the operator to take "a type 2 item" but rather to load the item that was created in the second "Create Objects" activity and assigned to that label."
How do you do that then?

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

The "Load" activity only tells the task executer to load a specific item that is referenced in the respective field. So that reference has to be for an item of the type. There are multiple ways to get there. A common one is to have the items on a list and pull them based on a query that let's you specify certain conditions that the item has to fulfill. That's what happens in the second model.

In the following updated version of the first model, I loop through the items in Queue2 in the "Assign" activities placed directly ahead of the load activities. If one is found, it is assigned to a label that is then used in the load activity to reference the item. If no item is found, the token skips the load activity.

question1-fm_1.fsm

If the item is inside a storage object (Rack, Floor Storage) you can use the "Find Item" activity. It works similarly to pulling a value from a list. There too you can define conditions in a query that the item has to fulfill.

0 Likes 0 ·
question1-fm-1.fsm (44.4 KiB)