You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a use case where I try to fit a set of items that stays constant to a varying set of bins (or actually one bin at a time). Which means I would like to try different bins one at a time, starting with the cheapest package and then moving to more expensive ones if the items don't fit.
However, I am running into problems since it seems to me that the initialisation call of Packer() does not work properly. It would seem it maintains some history of the items I've tried to pack but clears the initialisation of bins, which leads to a situation where two subsequent packing attempts generate different results - the latter requiring a larger bin than on the previous run, and failing to pack in the bin it had found a solution for on the previous run. The only way to get stable results is if the kernel is restarted in between. I think one would expect the call to initialise Packer() to be equivalent to getting a fresh start, but that does not seem to be the case.
The problem is not visible in the results, which shows just the items I've tried to pack both times, but the fact that the 2nd attempt requires a larger bin makes the library where hard to use in practice.
I have a use case where I try to fit a set of items that stays constant to a varying set of bins (or actually one bin at a time). Which means I would like to try different bins one at a time, starting with the cheapest package and then moving to more expensive ones if the items don't fit.
However, I am running into problems since it seems to me that the initialisation call of Packer() does not work properly. It would seem it maintains some history of the items I've tried to pack but clears the initialisation of bins, which leads to a situation where two subsequent packing attempts generate different results - the latter requiring a larger bin than on the previous run, and failing to pack in the bin it had found a solution for on the previous run. The only way to get stable results is if the kernel is restarted in between. I think one would expect the call to initialise Packer() to be equivalent to getting a fresh start, but that does not seem to be the case.
The problem is not visible in the results, which shows just the items I've tried to pack both times, but the fact that the 2nd attempt requires a larger bin makes the library where hard to use in practice.
First run:
Found solution:
::::::::::: 790713(800.000x270.000x330.000, max_weight:999.000) vol(71280000.000)
FITTED ITEMS:
====> 226(130.000x200.000x100.000, weight: 0.000) pos([0, 0, 0]) rt(0) vol(2600000.000)
====> 330(330.000x120.000x220.000, weight: 4.800) pos([Decimal('130.000'), 0, 0]) rt(0) vol(8712000.000)
====> 330(330.000x120.000x220.000, weight: 4.800) pos([Decimal('460.000'), 0, 0]) rt(0) vol(8712000.000)
====> 206(300.000x650.000x150.000, weight: 10.000) pos([Decimal('130.000'), Decimal('120.000'), 0]) rt(2) vol(29250000.000)
UNFITTED ITEMS:
Second run:
Found solution:
::::::::::: 790079(790.000x300.000x580.000, max_weight:999.000) vol(137460000.000)
FITTED ITEMS:
====> 226(130.000x200.000x100.000, weight: 0.000) pos([0, 0, 0]) rt(0) vol(2600000.000)
====> 330(330.000x120.000x220.000, weight: 4.800) pos([Decimal('130.000'), 0, 0]) rt(0) vol(8712000.000)
====> 330(330.000x120.000x220.000, weight: 4.800) pos([Decimal('460.000'), 0, 0]) rt(0) vol(8712000.000)
====> 206(300.000x650.000x150.000, weight: 10.000) pos([Decimal('130.000'), Decimal('120.000'), 0]) rt(2) vol(29250000.000)
UNFITTED ITEMS:
The text was updated successfully, but these errors were encountered: