fontanf / packingsolver

A solver for (geometrical) packing problems
https://fontanf.github.io/packingsolver
MIT License
92 stars 14 forks source link

How to use infinite copies of bins? #8

Closed mobilarte closed 9 months ago

mobilarte commented 9 months ago

Hi,

I tried to modify the README example like this:

./bazel-bin/packingsolver/rectangleguillotine/main --objective knapsack --items data/rectangle/alvarez2002/ATP35_items.csv --bins data/rectangle/alvarez2002/ATP35_bins.csv --certificate ATP35_solution.csv --predefined 3EAR --bin-infinite-copies --time-limit 10

thinking that it would replicate the single bin to fit all items. It produced only 2 bins.

I then added 10 bins to ATP35_bins.csv, numbering them, still only 2 bins.

Is this just a plain RTFM question? but then, please, where is the M?

P.S.: I used the dev branch.

fontanf commented 9 months ago

Hi,

That seems to be a bug with the knapsack objective with multiple bins.

I'll try to look at it in a few days

Note that if you want to pack all items while minimizing the number of bins used, you should use the bin-packing objective:

./bazel-bin/packingsolver/rectangleguillotine/main  --verbosity-level 2  --objective bin-packing  --items data/rectangle/alvarez2002/ATP35_items.csv  --bins data/rectangle/alvarez2002/ATP35_bins.csv   --certificate ATP35_solution.csv  --predefined 3EAR  --bin-infinite-copies  --time-limit 10
fontanf commented 9 months ago

Fixed in 8b09bd1. It was a bug in the computation of the total item profit of an instance

mobilarte commented 9 months ago

Thank you!