1

I need to access a specific storage within a storage system (which is basically a list like this storageSystem= {storage1, storage2, storage3} in Anylogic.

I tried this, but it does not work:

storageSystem Storages[0].getSlot(0, Bay1, 0);

Thanks in advance :)

ujjaldey
  • 421
  • 2
  • 5
  • 17
sljb12
  • 11
  • 1
  • Can you provide some more information, what error are you getting? Why do you say it is not working what are you getting, and what have you tried. See here for more guidance on asking questions - https://stackoverflow.com/help/how-to-ask – Jaco-Ben Vosloo Oct 12 '21 at 10:04
  • probably a typing error, your error msg is always useful. – Benjamin Oct 12 '21 at 12:39

1 Answers1

0

So looks like you're using the new AnyLogic 8.7.7 Storage and Storage System (rather than the old Pallet Rack and Rack System).

The help page for Storage tells you that the constituent storages are held in an array called storages, and that getSlot takes integers for the rack/bay/shelf indices getSlot(int rack, int bay, int shelf), where these are zero-based (so rack 0 is the first rack, not rack 1).

So you'd use something like

storageSystem.storages[0].getSlot(0, 0, 0)

for the first storage in the system and the first rack/bay/shelf therein.

There's a wider question of whether you actually need to do this for what you want your model to do. (Add some detail to your question if you want to explore that angle.)

Stuart Rossiter
  • 2,432
  • 1
  • 17
  • 20