simulation

Loading docks and box stacking

These loading docks I saw recently in Osaka that drop directly onto the street.

 
 

The loading docks reminded me of an optimal box packing project I worked on. The goal was to optimse both the package stacking solution, as well as the route management for the trucks picking up the packages, in one problem.

 

These loading docks I saw recently in Osaka that drop directly onto the street.

The loading docks reminded me of an optimal box packing project I worked on. The goal was to optimse both the package stacking solution, as well as the route management for the trucks picking up the packages, in one problem. The stacking process follows a deterministic and greedy approach and handled 3D rectangular objects or cuboids.

Firstly, the origin is set at (0,0,0) inside the truck, e.g. at the bottom-left-rear. So-called 'pivot points' are then set which represent candidate locations for the next package. These pivot points represent the frontier, which moves outwards as more packages are stacked. For each pivot point, we attempt to place a package, and can use the 6 unique 3D spatial rotations. To place a package we need to check the following criteria:

  • Boundary: The package location must lie entirely within the bounds of the truck.
  • Collisions: The package must not overlap with any previously packed items.
  • Support: The package must sit on the container floor or be supported from below by the top surfaces of existing items.

I found writing the collision tests the most challenging. Here I checked the intervals taken up by the packages already stacked, and looked for intersections with the space proposed for the next package. Two 3D boxes overlap if their spatial projections overlap simultaneously along all three axes (x,y,z).

Every time a box is successfully placed at a pivot point, that point is removed from the candidate locations. Then 3 new potential pivot points are added adjacent to the new box's outer boundaries along the (x,y,z) axes. This process continues, with the frontier moving outwards until the truck is full or all the packages are stacked.