question

wl86 avatar image
0 Likes"
wl86 asked Patrick Zweekhorst answered

Getting random slot from racks created by code

I'm running into a problem finding random slots on racks that are created by code at the beginning of a simulation.

Basically, my warehouse is divided into different zones, and I'm just trying to get a random slot in a specific zone. However, while filtering on zone works, the Find Slot activity always returns the same slot within a zone: aisle 1, bay 1, level 1, slot 1. The problem does not occur when querying racks that are created "manually": I'm guessing that something happens on model reset that is required for proper functioning of the Storage System, which is then missed by the racks that are created by code after model start.

Attached is a minimal example with a Process Flow and some racks, showing the difference between "code" racks and "manual" racks. The Code Rack Slotting.fsmSQL query used for getting a slot is simply WHERE slot.zoneID == "X" ORDER BY RAND() ASC, where X is the zone ID.

Why is this not working for "code" racks? Is there a way to get this working simply with Find Slot + a query? I can think of some workarounds to this using more code, but I'd rather just use Find Slot, as this seems like the most direct approach.code-rack-slots.pngmanual-rack-slots.png

FlexSim 22.1.4
codestoragefind 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.

1 Answer

Patrick Zweekhorst avatar image
1 Like"
Patrick Zweekhorst answered

Hi @wl86 ,

This indeed looks like a small bug. When I open the model in FS2022.1 it indeed does not give a random location. I am not sure why. Would it be an option to upgrade your FlexSim version? Because it does work when I open the model in FlexSim 2024.0.


If that is not an option, could you move the code to the OnModelReset trigger? That also seems to work. If that is not possible, why is that not possible? Maybe there are other option to solve that problem.

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

wl86 avatar image wl86 commented ·

Thanks @Patrick Zweekhorst, moving the code to the OnModelReset trigger appears to solve my problem.

0 Likes 0 ·