pull the items from list based on label value

KANG
Not applicable
6 Views
9 Replies
Message 1 of 10

pull the items from list based on label value

KANG
Not applicable

[ FlexSim 24.0.0 ]

Hi flexsim,

I would like to let Queue2 pull the items from list(SlotList1).The smaller the label value ,the earlier it will be moved from Rack to Queue2.

I have pushed the label value to list on slot entry trigger.

1716117556747.png

And set Queue2's Pull Strategy.

1716117885381.png

But it can't work.

The attachment is as follows.Thanks in advance.

pull the items from list based on label value_Question.fsm

0 Likes
Accepted solutions (1)
7 Views
9 Replies
Replies (9)
Message 2 of 10

joerg_vogel_HsH
Mentor
Mentor
@Rykou, your value is an array. If you evaluate an array like a single value, only first entry gets evaluated.
0 Likes
Message 3 of 10

KANG
Not applicable
Thanks for your reply. I've tried to use unnested the array structure and store the single value.But it seems that flexsim doesn't support the unnested function. I'm confused about is there any other possible way to do it?If so, can you help me to fix it? Thanks in advance.
0 Likes
Message 4 of 10

moehlmann_fe
Community Visitor
Community Visitor
Accepted solution

The list in your model does not contain any reference to the items themselves. It only holds information about the slots (address, content and which order the content belongs to). To pull items, it would be better to create a separate list to which you push the individual items. Pulling them ordered by the "Order" value should be straightforward then.

0 Likes
Message 5 of 10

KANG
Not applicable

Hi, @Felix Möhlmann. Thanks for your reply. I've tried to push the label(item.order) to a new list(IitemList1) dynamically and let Queue2 pull from list by label(item.order).

But it exists two problems.

1.It only works when all the items are on the rack at the beginning. If I set the items first enter Queue1 then move to Queue2, the logic will be invalid.

2.List does not display item information.

How can I fix the problem?

The attachment is as follows.

pull the items from list based on label value_Question.fsm

0 Likes
Message 6 of 10

moehlmann_fe
Community Visitor
Community Visitor

Queue2 will pull items as long as it has capacity. As such the list will immediately be empty, because all items are pulled at the beginning of the simulation. The resulting task sequences are queued up in the ASRS and by default done in the order in which they were created.

You can either limit the capacity of the queue to 1, so it only pulls one item at a time (then move the item to a different queue upon entry). Or you alter the "Queue Strategy" of the ASRS so it finishes task sequences that involve items with a lower "Order" value first.


/**Custom Code*/
TaskSequence taskSequence = param(1); Dispatcher current = ownerobject(c); Object item = taskSequence.tasks[2].involved1; return -item.Order;

(The negative "Order" value is returned because the queue strategy orders in descending order.)

pull-the-items-from-list-based-on-label-value-ques(1).fsm

0 Likes
Message 7 of 10

KANG
Not applicable

Hi, @Felix Möhlmann. Thanks for your reply. I realized that I can set the moving rules through the Query Strategy.

I would like to separate the logic of moving items between input and output, such as first input all the items to rack by random, then output items from rack to Queue2 by label(item.order) value ASC. So I prefer to limit the capacity of the Queue2 to 1. But I found it isn't work properly.

One of the bug I found is that Items are stacked in the same slot .But I want each slot just can contains one item.

I have set the storage method in Queue1 on exit trigger.
1716309936300.png
And I have set the MaxContent of Rack.

1716309941282.pngBut it exists one of the slot contains more than one item.1716310111916.png

I think this might be one of the reason that it can't output by label(item.order) properly. But I have no idea to solve the bug.

The attachment is as follows.Thanks alot.
pull by label _Question.fsm

0 Likes
Message 8 of 10

KANG
Not applicable

I uploaded the wrong file. The attachment is the updated file.Thanks alot.

pull-the-items-from-list-based-on-label-value-ques.fsm

0 Likes
Message 9 of 10

moehlmann_fe
Community Visitor
Community Visitor

It's important here to understand how the send/pull logic between a fixed resource and a rack works.

By default, a storage object (rack or floor storage) will have its "Pull" option on the Input tab in the properties activated. This means that when an fixed resource sends an item to the port that leads to the rack, this item is 'made available' for the rack to pull. Whether or not the item is actually pulled and moved to the rack is determined by the rack's "Pull Requirement". By default, this tries to assign to a slot to the item based on the rack's Slot Assignment Strategy. Only if this was successful is the item moved.

This means that the item will only exit the queue, firing the On Exit trigger after it has already been assigned a slot. This slot is then overwritten in the On Exit trigger. For the first 5 items this still works, because the code in the On Exit trigger can always find another valid in the rack. However for the 6th item, since it has already been assigned to a slot, there are no empty slots left and "findSlot" returns NULL. This is then set as the item's slot, essentiall removing the slot assignment. The transport still happens though because the item as pulled by the rack before all of this happened. So when the item is supposed to be unloaded to the rack, FlexSim notices that it has no slot assigned to it and uses the rack's Slot Assignment Strategy to find a slot for the item. Since this only checks if there is space, not if there are any items already in the slot, the first available slot is chosen and the item is placed into an already occupied slot.

Fixing this would be easiest by removing the exit trigger and altering the Slot Assignment Strategy of the rack to choose a random empty slot in the first place.

To stop the queue from pulling items while the ASRS is still filling up the rack, you could alter the Pull Strategy to not add a backorder when not item is found. (So the queue doesn't 'wait' for items to be available if it couldn't find one). Then, in the "On Resource Available" trigger of the ASRS, make the queue reevaluate the pull strategy by sending a message to the queue (see On Message trigger of queue) if the ASRS has no further tasks (and thus, no more input into the rack is pending).

Overall, you'd probably have more control by building the pull logic in Process Flow though.

pull-items-fm.fsm

0 Likes
Message 10 of 10

KANG
Not applicable

Thank you very much for your reply with patient. I learned how the send/pull logic works. Your reply is very helpful.

0 Likes