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
  1. Storage.system.findSlot("WHERE slot.slotItems.length < 1 ORDER BY slot.levelID ASC")

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

  1. 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.