question

gaubu avatar image
0 Likes"
gaubu asked Logan Gold commented

Accessing Slot Content for Custom Slot Assignment Strategy in FloorStorage

Hello everyone,

I'm a beginner with FlexSim (less than a week of experience), and I'm trying to reproduce the results of a scientific article: Modeling and Simulating Warehouse Storage Policies Using FlexSim. The goal is to simulate different storage policies in a warehouse environment.

In my simulation, I have the following setup for pallet storage:

  • Pallet Composition: Each pallet is composed of 16 tiles.
  • Three Levels of Placement Strategy:
    1. Primary Sorting: Based on label1_id (e.g., product type).
    2. Soft-Mix: If the primary location is full, pallets are placed based on label2_classe (same destination).
    3. Mix: If no suitable location is found, pallets are placed in any available free space, but pallets with different label1_id should not be stacked together.

storage-system.jpeg

I'm facing an issue with the custom slot assignment in the "Slot Assignment Strategy" using the "Matching Labels" option. Here's the problem:

  • Observation: The variable k (1 to level.slots.length) seems to only give access only to the slot. When I try to place an object, it uses the function slot.hasSpace(item), which seems to checks if there's enough space in the slot based on dimensions (I have configured the pallets dimensions to stack up to 4 high. However, this function only returns 0 or 1, and there doesn't seem to be a way to know how many items are already in the slot or to access them.

  • Objective: I want to determine if there's already an object in a slot. If there is, I need to check its label1_id. If the label1_id matches the current item, I can place the new item in the same slot. If not, I need to place the item in the next level (to avoid stacking pallets of different types together, even in Mix mode).

Question:

Is there a way in FlexSim scripting to:

  • Access the contents of a slot to check if it already contains items?
  • Retrieve the labels (e.g., label1_id) of the items in a slot?
  • Modify the "Slot Assignment Strategy" script to implement this logic, ensuring that two items with different label1_id are not placed in the same stack during the Mix mode?

Any guidance or examples on how to achieve this would be greatly appreciated. I'm still new to FlexSim and scripting within it, so detailed explanations or code snippets would be very helpful.

Thank you in advance for your assistance!

Best regards,Buffer_Storage_System_G.fsm

FlexSim 23.0.15
floor storageflexsim script
· 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.

Logan Gold avatar image Logan Gold ♦♦ commented ·

Hi @gaubu, was Felix Möhlmann's answer helpful? If so, please click the "Accept" button at the bottom of their answer. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always comment back to reopen your question.

0 Likes 0 ·

1 Answer

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

From the slot you can access the "slotItems" therein as an array. Important to note: These are not the items themselves but a representation inside the storage system. You can access labels on the items through it though.

I have linked the documentation of the "slot" class below.

https://docs.flexsim.com/en/24.2/Reference/CodingInFlexSim/FlexScriptAPIReference/Warehousing/Storage.Slot.html

https://docs.flexsim.com/en/24.2/Reference/CodingInFlexSim/FlexScriptAPIReference/Warehousing/Storage.Slot.Item.html

Rather than checking all items in a slot each time, it might make sense to assign labels to the slot itself when items enter and its classification changes. This would enable you to use the "findSlot()" and "querySlot()" methods that use SQL like queries to filter the slots.

https://docs.flexsim.com/en/24.2/Reference/CodingInFlexSim/FlexScriptAPIReference/Warehousing/Storage.System.html

5 |100000

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