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

How does DefaultStackValueConstraint.maxSupportedWeight work? #910

Open
woodward54 opened this issue Aug 10, 2024 · 3 comments
Open

How does DefaultStackValueConstraint.maxSupportedWeight work? #910

woodward54 opened this issue Aug 10, 2024 · 3 comments

Comments

@woodward54
Copy link

woodward54 commented Aug 10, 2024

I would expect this test to fail because maxSupportedWeight=1 and the box weight=6, but it succeeds (see screenshot).

The packer is placing boxes with a higher weight (6) on top of boxes with a maxSupportedWeight constraint of 1. Am I using this wrong? Some more documentation on this feature would be very helpful.

@Test
	public void runAlgo() throws Exception
	{
		List<ContainerItem> containers = ContainerItem
				.newListBuilder()
				.withContainer(Container.newBuilder().withDescription("1").withEmptyWeight(1).withSize(2, 2, 5).withMaxLoadWeight(10000).build(), 1)
				.build();

		// FastBruteForcePackager packager = FastBruteForcePackager.newBuilder().build();
		FastLargestAreaFitFirstPackager packager = FastLargestAreaFitFirstPackager.newBuilder().build();
		// LargestAreaFitFirstPackager packager = LargestAreaFitFirstPackager.newBuilder().build();

		List<StackableItem> products = new ArrayList<>();

		StackConstraint c = new DefaultStackValueConstraint(1);

		products.add(new StackableItem(Box.newBuilder().withConstraint(c).withDescription("A").withSize(1, 1, 1).withWeight(5).withRotate2D().build(), 5));

		//.withDeadline(ms) not working? causes failure no matter what value I use
		PackagerResult build = packager.newResultBuilder().withContainers(containers).withMaxContainerCount(1).withStackables(products).build();

		if(build.isSuccess()) {
			System.out.println("Success!");
			write(build.getContainers());
		} else {
			System.out.println("Failed");
		}
	}
Screenshot 2024-08-09 at 6 46 20 PM
@skjolber
Copy link
Owner

Hi, there is currently no proper logic for stackable support weight, but I am considering adding a few types of constraints.

  • weight-based
    • max weight
    • max pressure
  • x number of boxes
    • same type of box
    • box of a certain category or classification

Do you have any additional requirements?

@woodward54
Copy link
Author

woodward54 commented Aug 18, 2024

I see. Yes support for stack weight-based and x number of boxes of the same type would be very helpful. I appreciate all the work you've done on this.

if doable adding a priority system for the insert order would be amazing. i.e. Case A needs to be loaded first, then Case B. But thats a nice to have

@skjolber
Copy link
Owner

So that priority system should be reasonably simple to make.

Note to self: This will require throwing out some "inner" points.

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

No branches or pull requests

2 participants