question

Joerg Vogel avatar image
2 Likes"
Joerg Vogel asked Benjamin W2 commented

How can I query the slots of a storage system?

I am looking for a string which find a slot availble ordered by

  • level,
  • bay,
  • slot or
  • not populated in a combined query or each attribute alone.

Additional I thought it would be easier to get access to some basic data like maximum number of slots or available slots in the storage system.

But I didn't find such data. All I achieved, was to query the rack structure to put all slot nodes into a global list. Then I evaluated the value in the list to get additional data for level, bay, slot and dynamic current content. I queried this global list by a standard string and casted the pulled value into the Slot Assignment Strategy in the Rack object to realize placing the items by level > slot > bay into the rack. Attached is an example model.

How can I achieve such strategie without nested for-loops or my approach with a global list inside the Slot Assignment Strategy?

Many thanks! Regards Jörg

list-query-warhouse-rack.fsm

FlexSim 19.2.4
warehousefindslotquery slotassignment strategy
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

anthony.johnson avatar image
3 Likes"
anthony.johnson answered Benjamin W2 commented
Storage.system.findSlot("WHERE slot.slotItems.length < 1 ORDER BY slot.levelID ASC")

This will find an empty slot, ordered by level number.

Storage.system.findSlot("WHERE slot.hasSpace($1) ORDER BY slot.levelID ASC", 0, item)

This will find a slot that has space to place a specific item, ordered by level number.

I think all of the things you want to do can be done with the Storage.system.findSlot() method, without for loops or Table.query(). Also, although technically I don't think you need a list at all, even if you did, I would suggest not using tree-based traversals for access, but to use the Storage API. For example, the bay number can be accessed with the expression value.as(Storage.Slot).bayID. The level can be accessed with the expression value.as(Storage.Slot).levelID. The number of items in the slot can be accessed with value.as(Storage.Slot).slotItems.length.

See also this question., and the user manual.

· 5
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 ·

@anthony.johnson, thank you, I get it now. I oversaw the important parameter “slot” in the manual and its importance inside of SQL clauses. “findSlot” method works in my source code. I was just confused by the nested “for-loop” structure source code in the Assign Slot Strategy in rack objects, because a findSlot method looks so more elegant to me.
Currently I am struggling with the picklist warehousing options, but that will be perhaps another question.

1 Like 1 ·
Kyle Y avatar image Kyle Y Joerg Vogel commented ·

Hi Vogel,

i got inspiration from your answers. I got another doubt, how to query if I want to find the least item type in a storage system? Could you please help? Thank you.

0 Likes 0 ·
Braydn T avatar image Braydn T Kyle Y commented ·

@Kyle Y

Please ask a new question. so we can help other users. Thank you!

0 Likes 0 ·
Victoria M2 avatar image Victoria M2 commented ·

I can't get it to work if I have more than one rack in the model!

Can you help me?


twoRacks.fsm

0 Likes 0 ·
tworacks.fsm (41.5 KiB)
Benjamin W2 avatar image Benjamin W2 Victoria M2 commented ·

Hi @victoria.m2,

Go ahead and post this as a separate question. That will help us keep this forum more organized and help you faster.

0 Likes 0 ·