3d-bin-container-packing
3d-bin-container-packing copied to clipboard
Containers only used once
Hi, I am working with 2 containers, is there a way to force to only use a container once? Here my example:
List<Container> containers = new ArrayList<Container>();
containers.add(new Container("c1",100, 100, 100, 0));
containers.add(new Container("c2",120, 120, 120, 0));
Packager packager = LargestAreaFitFirstPackager.newBuilder().withContainers(containers).build();
List<BoxItem> products = new ArrayList<BoxItem>();
products.add(new BoxItem(new Box("b1", 90, 90, 90, 0), 1));
products.add(new BoxItem(new Box("b2", 80, 80, 80, 0), 1));
List<Container> fits = packager.packList(products, containers.size(), System.currentTimeMillis() + 5000);
The result is c1 twice. Is there a way to get c1 and c2?
Hi, no, this is currently not supported.
@Macrox14 care to describe your use-case in more detail?
@skjolber Hi! I think this is the case.
I have N containers. They may be different or the same. I have K boxes that need to be distributed among N containers in order to spend as few containers as possible, and not to find the most suitable container to fit all the boxes at once.
Here is an example of a Python library that allows you to set the [distribute_items=True] parameter: https://github.com/enzoruiz/3dbinpacking.
Do I understand correctly that now your library can not distribute boxes between containers?
Hmm I understand having a fixed set of containers (i.e. a fixed quantity of each container).
I have K boxes that need to be distributed among N containers in order to spend as few containers as possible, and not to find the most suitable container to fit all the boxes at once.
But is not "one" a special case of "as few as possible"?
But is not "one" a special case of "as few as possible"?
For example there are 10 containers with a total volume of 10 cubic meters and many boxes with a total volume of 5 cubic meters. "As little as possible" means that the algorithm ideally will fill 5 containers to 100% and 5 containers will remain empty, rather than distribute boxes between containers to 50% of each container.
Fixed in 3.x branch.