Closed littlebox692 closed 7 months ago
` @Test public void testPackager2(){ Container container = Container.newBuilder() .withDescription("anything") .withSize(90, 60, 120) .withEmptyWeight(1) .withMaxLoadWeight(100) .build();
List<ContainerItem> containerItems = ContainerItem .newListBuilder() .withContainer(container,1) .build(); LargestAreaFitFirstPackager packager = LargestAreaFitFirstPackager .newBuilder() .build(); List<StackableItem> products = new ArrayList<>(); // this will be failed products.add(new StackableItem(Box.newBuilder().withSize((int)Math.ceil(90), (int)Math.ceil(50), (int)Math.ceil(30)).withRotate3D().withWeight(1).withDescription("fff").build(), 1)); products.add(new StackableItem(Box.newBuilder().withSize((int)Math.ceil(90), (int)Math.ceil(50), (int)Math.ceil(30)).withRotate3D().withWeight(1).withDescription("fff").build(), 1)); products.add(new StackableItem(Box.newBuilder().withSize((int)Math.ceil(120), (int)Math.ceil(60), (int)Math.ceil(40)).withRotate3D().withWeight(1).withDescription("fff").build(), 1)); // TODO this will be succeed // products.add(new StackableItem(Box.newBuilder().withSize((int)Math.ceil(120), (int)Math.ceil(60), (int)Math.ceil(40)).withRotate3D().withWeight(1).withDescription("fff").build(), 1)); // products.add(new StackableItem(Box.newBuilder().withSize((int)Math.ceil(90), (int)Math.ceil(50), (int)Math.ceil(30)).withRotate3D().withWeight(1).withDescription("fff").build(), 1)); // products.add(new StackableItem(Box.newBuilder().withSize((int)Math.ceil(90), (int)Math.ceil(50), (int)Math.ceil(30)).withRotate3D().withWeight(1).withDescription("fff").build(), 1)); PackagerResult result = packager .newResultBuilder() .withContainers(containerItems) .withMaxContainerCount(1) .withStackables(products) .build(); if(result.isSuccess()) { System.out.println("=======succeed====="); } else { System.out.println("=======failed======="); }
` why i need to deal with StackableItem added order with myself, not this lib? that's very ridiculous
The LAFF packager is not intelligent, it is most like "happy go lucky".
` @Test public void testPackager2(){ Container container = Container.newBuilder() .withDescription("anything") .withSize(90, 60, 120) .withEmptyWeight(1) .withMaxLoadWeight(100) .build();
` why i need to deal with StackableItem added order with myself, not this lib? that's very ridiculous