question

Karan avatar image
0 Likes"
Karan asked Karan edited

Find Slot activity vs List with slots and fields

I have noticed and read that the Find Slot activity is very slow in certain situations. I was able to work around this because I knew my slot addresses and used Assign Labels to get the slot I needed.
However, if in a case where a work around is not possible, would it fundamentally be faster to create a List with slots as entries, bays, levels, aisles as fields and use a Pull from List activity?
Is something like that possible? If so, how would you get the slots to be entries on the list?

FlexSim 23.2.2
pull from listfind slot
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
0 Likes"
Joerg Vogel answered Karan edited

Slots are by design treenodes in a rack object attribute variables subnode. Then you can push them onto a list. An individual list makes only sense, if you want to manage a much smaller cluster of slots in comparison to all slots of a warehouse. Once you have pushed a treenode onto a list you have to cast this list value into a Storage System Class or you must evaluate bay and level relatively from this slot treenode up in the tree. An Aisle attribute is an Address value, that you can get only from the Storage Class properties.

· 4
5 |100000

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

Karan avatar image Karan commented ·

Rack Slot List Test.fsm


Thank you for the response Joerg.

How could i push slots to a list? I tried finding all slots and adding them to a label, then pushing the array label but seem to be unsuccessful. Later in the list we would add expressions that reference the value as Storage System and find the required attributes, correct?

What do you mean by aisle is an address value? Could you please show how that could be added to the list fields?

0 Likes 0 ·
Joerg Vogel avatar image Joerg Vogel Karan commented ·

@Karan

There are two methods to gather slots:
  • findSlot
  • querySlots

you need query slots to collect all slots or a subset of your model. querySlots returns an array. You can push an array onto a list and each array member creates a list entry or list value. List values loose their class inherited family feature: a slot becomes a treenode. If you add fields by expression to a list then you have to cast a slot treenode list entry value into a Storage.Slot class member to evaluate an address aisle or zone property.

0 Likes 0 ·
Joerg Vogel avatar image Joerg Vogel Joerg Vogel commented ·

@Karan,

querySlots:

Array slots = Storage.system.querySlots("WHERE slot.storageObject.name = 'PushBackRack1'",0);
token.slots = slots;

Please add a global list to your model and choose this list for your list resource activity.

You can edit list fields from Global List in Toolbox or by Advanced in Quick Properties of List resource activity.

Expression in added list field

value.as(Storage.Slot).bay... 

after start typing l e a pop up menu with possible suggestions occurs. you can type more characters or select a suitable method or property.

rack-slot-list-test_JV.fsm

0 Likes 0 ·
Show more comments
Jason Lightfoot avatar image
1 Like"
Jason Lightfoot answered Karan edited

For speed accessing a large storage system by it's find and query methods, you should use one or more index on the slots and items.

1701253387480.png

1701253450643.png

Whenever you use the ORDER BY clause with a large number of returned elements you will slow things down considerably. If you want to choose a random item you might consider just getting the unordered array and selecting a random element from it (hopefully this will be implemented as an standard option in the future)

If that's still not fast enough you could use partitioned lists to reduce the number of elements in each partition and store the slot in the list.

You can add all the slots by pushing the array returned by:

Storage.system.querySlots("")

for which there's an example model attached. pushAllSlotsToList.fsm

You could also consider using a map of the slots.




· 1
5 |100000

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

Karan avatar image Karan commented ·

Thank you Jason, your answer is equally valid as Joerg's. If I could select 2 answers for this post I would select this too.


I did notice the ORDER BY slowing the find slot down.

I will try to learn more about indexing slots and items.

0 Likes 0 ·