Hello everybody!
I am trying to build a model focused on warehouse systems. In my warehouse, I have some drive-in racks with corridors, levels and bays. At every level, bay and corridor there is a control point on an AGV network. I would like some pallets (sku=1) to be stored as close as possible to a specific control point (called CP1). I have thought to put all the Control points of the rack (which are indications of the address of slots in the racks) in a list and to calculate for every control point the distance to CP1. I have filled the list as you can see in the code below.
I have then calculated the distance in another custom code and this is the result. As you can see the CPs in the list are ordered based on the way they have been pushed in the list. I would like to have the CPs in the list ordered by increasing distance (from lowest to highest). How do I put the CPs with the lowest distance in the first position? If I can do that, how can I pull the first CP from the list?
Maybe I am approaching the problem in a weird way but my end goal is to pull from that list, one CP at a time, the CPs with the lowest distance (and of course have them removed from the list after I have pulled them). Does anyone have ideas on the right commands to use to achieve that?
To be extra clear, if we look at the list above, I would like to pull CP11011, save this address in a variable, do some other things and then remove CP11011 from the list. I would then pull CP11021, save the address and remove CP11021 from the list. I would then like to pull CP12011 save this address and remove it from the list, and so on following the distance values from lowest to highest.
I have tried to pull items in this way but it does not work, I am doing something wrong:
Variant ind_CP = List("CP list").pull("ORDER BY distance ASC");
Thank you so much for your help!