question

Rykou avatar image
0 Likes"
Rykou asked Rykou commented

pull the items from list based on label value

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

FlexSim 24.0.0
pull strategylabel valuepullfromlist
· 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.

Joerg Vogel avatar image Joerg Vogel commented ·
@Rykou, your value is an array. If you evaluate an array like a single value, only first entry gets evaluated.
0 Likes 0 ·
Rykou avatar image Rykou Joerg Vogel commented ·
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 0 ·

1 Answer

Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered Rykou commented

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.

· 6
5 |100000

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

Rykou avatar image Rykou commented ·

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 0 ·
Felix Möhlmann avatar image Felix Möhlmann Rykou commented ·

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 0 ·
Rykou avatar image Rykou Felix Möhlmann commented ·

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 0 ·
Show more comments