question

Jon Abbott avatar image
2 Likes"
Jon Abbott asked anthony.johnson commented

Finding the nearest open slots to an item in a rack

Is there a way to use findSlot to identify open rack slots nearest in distance to an item that is already stored in a rack? Thanks in advance for your help.

FlexSim 20.0.5
rackflowitemfindslotflexsim 20.0.5nearest
5 |100000

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

Phil BoBo avatar image
4 Likes"
Phil BoBo answered anthony.johnson commented

@Jon Abbott

Here's an example using the Warehousing pick options in Process Flow.

find_nearest_slot.fsm


1588807191412.png (525.7 KiB)
· 3
5 |100000

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

anthony.johnson avatar image
1 Like"
anthony.johnson answered

@Jon Abbott Here's sample code I executed in a script window:

  1. Storage.Slot other = Model.find("Rack1").as(Storage.Object).getSlot(7, 4, 1);
  2. return Storage.system.findSlot("ORDER BY (slot.location.project(slot.storageObject, model()) - $1.as(Storage.Slot).location.project($1.as(Storage.Slot).storageObject, model())).magnitude ASC", 0, other.as(treenode));

Or you can make a command that calculates the distance and call that from the query.

5 |100000

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