Perhaps we can use the golden hammer of deep learning for this? Maybe the input layer would be a 3d tensor with a 1 for the of space taken by each box, or the edge of each box, and a zero for everything else. The output layer would be a quality score that would be the result of a simulation of how badly the boxes were damaged given the truck shifting wildly. Then the model, when sufficiently trained, could be used by the packer robot to iterate solutions on the boxes it had for packing to achieve the best predicted quality score?