Help custom code

Help custom code

SerenaCR99
Not applicable
69 Views
3 Replies
Message 1 of 4

Help custom code

SerenaCR99
Not applicable

[ FlexSim 22.2.4 ]

Hi, I'm having problems with the following custom code:


1671202259216.png

Object current = param(1);
treenode activity = param(2);
Token token = param(3);
treenode processFlow = ownerobject(activity);


Array racks_LU = [Model.find("Libre_1"),Model.find("Libre_2"),Model.find("Libre_3"),Model.find("Libre_4"),Model.find("Libre_5")];


if(racks_LU[1].subnodes.length < Model.parameters.cap_rack_LUg){
  
    token.donde2 = Model.find("Libre_1");
}
else {
  
    for (i=1;i<=5;i++){
  
        if(racks_LU.subnodes.length < Model.parameters.cap_rack_LU){
  
            token.donde2 = racks_LU;
            break;
        }
    }
}



The idea is to set a storage location with the label "donde2".

The array contains the different racks in the model in ascending order. The purpose is to store in one rack at a time, once the rack is full proceed with the next one.


Thank you!.

0 Likes
Accepted solutions (1)
70 Views
3 Replies
Replies (3)
Message 2 of 4

jason_lightfootVL7B4
Autodesk
Autodesk
Accepted solution

You probably should be using the storage system to find the slots for you. In that case you could order the slots by slot.AisleID and set the AisleID to increment for each of the racks in your array.

Without seeing your model there are a few areas that might cause a problem with your method - one being transport time from the point you decide on the rack and arriving at the rack. The time in between is not value to use your code, since subnodes length does not yet reflect the part enRoute. If you're using regular 3D send/receive logic with transport then there is another variable "nroftransportsin" which you could use to try and estimate the capacity correctly, but all of this is handles for you if you use the storage system methods to findSlot, findItem etc..

0 Likes
Message 3 of 4

joerg_vogel_HsH
Mentor
Mentor
Fill racks in order of connection for example by a queue you need not to write source code. You set in output pane of such a queue for Send To function just “first available”. In each rack you choose a template to fill rack by bay, level, slot with a restriction of how many items are allowed in a slot. A restriction can be a number of items or a method like hasSpace.
0 Likes
Message 4 of 4

Jeanette_Fullmer
Community Manager
Community Manager

Hi @SerenaCR, was Jason Lightfoot's answer helpful? If so, please click the "Accept" button at the bottom of their answer. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always unaccept and comment back to reopen your question.

0 Likes