question

David Seo avatar image
0 Likes"
David Seo asked Victoria M2 commented

how to change the stacking sequence in the rack

@tanner.p

I want to change the stacking sequence to level>bay in the rack storage.

The default rule of stacking in the rack is 'a bay levels full' and then 'next bay' currently. But I want to change the sequence of stacking item to 'After one level of all bays is full' and then 'next level' stride.

How can I change the rule or script in the Slot Assignment Strategy field?

FlexSim 19.2.4
how to change the stacking rule in the 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

·
Joerg Vogel avatar image
0 Likes"
Joerg Vogel answered Victoria M2 commented

The dirty approach is to rotate the rack object by 90 degree around y coordinate direction. The rack object is set to be invisible and another rack object gives just the visual look.

The advanced approach uses a list of all slots references. The list fields contain an index which is ordered by the rule of filling. Another field tells you if the slot is available. If an item enters rack, you query the list to find an available slot ordered by filling index. You set the chosen slot to be unavailable. Then you assign a label at the item to store the slot references. You evaluate the bay at the place in bay function from the label at the item, the level at the place in level function.
When the item leaves the rack, you set slot reference value in the list to be available again.

· 4
5 |100000

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

David Seo avatar image David Seo commented ·

@Jörg Vogel. Thanks.

I think using the stacked racks by one level rack will be easier than your two opinions.

I want to know if there is a way to customize the current script of 'First Slot with Space' to "First Level ...".

How to customize the default script to new "First level full and then next bay sequence..."?

0 Likes 0 ·
pc neo avatar image pc neo David Seo commented ·

hi @Seung Yong Seo, I've attempted to customize the script as below.

int j = 0;
int maxlevelfound = 0;
while (maxlevelfound == 0 ){ 
    j++;
    maxlevelfound = 1; // set placeholder in case maxlevel has reach across all bays
    
 for (int i = 1; i <= current.bays.length; i++) {
  Storage.Bay bay = current.bays[i];
  if (bay.levels.length >= j) {
   maxlevelfound = 0;
   Storage.Level level = bay.levels[j];
   for (int k = 1; k <= level.slots.length; k++) {
    Storage.Slot slot = level.slots[k];
    int mustHaveSpace = /**\r\nMust Have Space: *//***tag:mustHaveSpace*//**/1/**/;
    if (mustHaveSpace && !slot.hasSpace(item))
     continue;
    int condition = /**\r\nCondition: *//***tag:condition*//**/true/**/;
    if (condition) {
     storageItem.assignedSlot = slot;
     return 0;
    }
   }
  }
 }
}


0 Likes 0 ·
Joerg Vogel avatar image Joerg Vogel David Seo commented ·

Anthony Johnson answered on a similar question in the year. The source code is much shorter:

Storage.Item storageItem = Storage.Item(item);<br>Storage.Slot slot = Storage.system.findSlot(
         "WHERE slot.slotItems.length < 1 
          ORDER BY slot.levelID ASC"
          );

storageItem.assignedSlot = slot;

The WHERE clause can include or consists of other conditions. You find an example for hasSpace in Anthonys' answer.

fill-rack-by-level.fsm

0 Likes 0 ·
Victoria M2 avatar image Victoria M2 Joerg Vogel commented ·

I can't get it to work if I have more than one rack in the model!

Can you help me?


twoRacks.fsm

0 Likes 0 ·
tworacks.fsm (41.5 KiB)

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.