question

Vns avatar image
0 Likes"
Vns asked David Chan answered

Dynamic Rack Initialisation with inventory type

Hi All - im trying to dynamically fill all the racks in the same order at startup. Where the first 1/3 of bays will be filled with part type ‘A’ followed by 2/3 by ‘B’ and the remaining ‘C’. Considering the length of the racks.


Thanks in advance for the advice.


FlexSim 23.2.3
rack
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

David Chan avatar image
0 Likes"
David Chan answered

You can use the reset trigger where you can define the Type. But, first set up a label in the Storage System call Type.

Using a for loop in the reset trigger, you can define the starting bay to the ending bay with the respective level with Type value.

The following example is for loop. You need to have three sets of these for the different range of the bay.

Object current = ownerobject(c);
Storage.Object rack = current;
int ending_bay= rack.bays.length;

for (int row=1; row<= ending_bay ; row++)
{
int ending_level = rack.bays[row].levels.length;
for (int col =1; col<=ending_level;col++)
{
Storage.Slot slot = rack.as(Storage.Object).bays[row].levels[col].slots[1];
slot.Type = 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.