skjolber/3d-bin-container-packing

Bug in the BruteForcePackager

ViveLeQuebec opened this issue · 5 comments

We found some scenario in which the BruteForcePackager fails unexpectedly.

Using the version 1.2.14 of you library, the packager regularly throws an IllegalArgumentException with message Remaining free space is negative at -1220 for Container [stackWeight=0, stackHeight=1360, levels=[[Placement [E 0x0x0, width=930, depth=1900, height=1360]]], weight=0, width=1000, depth=2000, height=1500, volume=3000000000, name=container1].

This PR presents an example of said scenarios. The test should succeed, but fails by throwing an exception.

@claire-mielcarek ok, I confirm it is a bug

@claire-mielcarek please run your tests against the latest code in the 1.x branch

Wonderful, it pass now !

Hmm by pure chance I found that the PBT still reproduces this bug : #505

I've tried to reproduce it on a simple test case with testForIllegalArgumentException but the test passes.

However identicalBoxesShouldFitInContainers when run enough times (100 is enough for me) reproduces the bug.

@tyrcho @claire-mielcarek I just released 1.2.15 for this. See the 1.x for further details.