question

Fred Kan avatar image
0 Likes"
Fred Kan asked Benjamin W2 commented

How slot.isStorable and slot.hasSpace works?

Hi FlexSim,

I'm working with the storage system and would like to ask how two calls work:

slot.isStorable and slot.hasSpace

Assuming I'd like one item per slot on a rack, the slot.hasSpace seems to return true if the slot in the rack is slightly larger than the flow item. It only returns false if the slot on the rack is exactly the same size as the flow item.

@zachary.h was able to provide a conditional statement to help circumvent that issue as shown in the attached picture.

ima-001.jpg

Another alternative is I can keep the flow item exactly the same size as the rack slot and make the flow item graphic smaller than the selection box, but I want to avoid that.

Is there documentation available or clarification on how it works that can supplement the reference manual?

Thank you

FlexSim 20.0.3
flexsim commandsstorage system
ima-001.jpg (59.7 KiB)
· 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.

Benjamin W2 avatar image Benjamin W2 commented ·

Hi @Fred Kan,

Was Phil's answer helpful for you? If so, can you please click accept? If not, how else can we help?

0 Likes 0 ·

1 Answer

·
Phil BoBo avatar image
3 Likes"
Phil BoBo answered Phil BoBo edited

How the slot.hasSpace() method works is documented in detail within its description in the User Manual: Storage.Slot.hasSpace()

It uses a simplistic heuristic based on your object's Slot Stacking Order to determine how much space each item will take up in the slot, and if the item is smaller than the space available, then it returns true. If the slot doesn't have enough space for the item, then it returns false.

Attached is a sample model (one-slot-per-item.fsm) that has items exactly equal to the slot size, and the rack puts one item per slot.

The conditional statement posted by Zack in Problem with the "has space" function for a rack with pallets with 8 boxes doesn't just "circumvent that issue." That logic literally does what you want: the logic is "one item per slot" instead of trying do a mathematical calculation based on the size. If you want to just have one item per slot, the best solution is to use logic that is literally "use one item per slot" as that conditional statement does, instead of trying to manipulate a size calculation. That's not a workaround; it is a proper solution.

The slot.isStorable property is related to the Storable Slots checkbox on the Dimensions tab. If that checkbox is clear, then you cannot assign items to that slot, and it will be excluded by default from slot searches that are done with the Storage.system.findSlot() method. This is useful if there are particular slots that you don't want items assigned to, such as if the bottom level is unused in your rack (as shown in the example below):

Additionally, you can use the Slot Padding feature so that the amount of space available per slot is larger or smaller than the actual dimensions of the slot. For example, in the image below, the Rack is 1.5 meters deep, but it can hold 2 meter items because I set the Back slot padding to -0.5. You can use the slot padding values to make the available slot space larger or smaller than the physical dimensions of the slot.

Do you have a particular question about how slot.hasSpace() or slot.isStorable works that isn't described in the documentation?


slot-has-space.png (675.0 KiB)
equal-size.png (422.2 KiB)
slot-padding.png (321.5 KiB)
5 |100000

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

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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