Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strange packaging result: Four items in four containers #574

Closed
shuairan opened this issue Oct 11, 2022 · 2 comments
Closed

Strange packaging result: Four items in four containers #574

shuairan opened this issue Oct 11, 2022 · 2 comments
Labels

Comments

@shuairan
Copy link

Hey, for the following example the packager packs every box in a single container:

@Test
public void testFourForTwo() throws Exception {
	List<Container> containers = new ArrayList<>();
	containers.add(Container.newBuilder().withDescription("1").withEmptyWeight(0).withSize(60, 40, 25).withMaxLoadWeight(100).build());

	LargestAreaFitFirstPackager packager = LargestAreaFitFirstPackager.newBuilder().withContainers(containers).build();

	StackableItem b1 = new StackableItem(Box.newBuilder().withId("b1").withDescription("b1").withSize(35, 25, 14).withWeight(0).withRotate3D().build(), 1);
	StackableItem b2 = new StackableItem(Box.newBuilder().withId("b2").withDescription("b2").withSize(35, 25, 14).withWeight(0).withRotate3D().build(), 1);
	StackableItem b3 = new StackableItem(Box.newBuilder().withId("b3").withDescription("b3").withSize(35, 23, 13).withWeight(0).withRotate3D().build(), 1);
	StackableItem b4 = new StackableItem(Box.newBuilder().withId("b4").withDescription("b4").withSize(35, 25, 14).withWeight(0).withRotate3D().build(), 1);

	List<Container> packaging = packager.packList(Arrays.asList(b1, b2, b3, b4), 100);
	write(packaging);
}

When Box b3 has withSize(35, 23, 14) (dz +1) it packs the four boxes into two containers. That seems to be kind of strange. Is that a bug or misbehaviour in LAFF?

@shuairan
Copy link
Author

Visualisation
574_3d-skjober_four_containers

@skjolber skjolber added the bug label Oct 19, 2022
skjolber added a commit that referenced this issue Oct 21, 2022
@skjolber
Copy link
Owner

Fixed in 2.1.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants