@Test @Disabled void testRunsPerformanceGraphLinearStacking() { long duration = 60 * 10; System.out.println("Run for " + duration + " seconds"); long deadline = System.currentTimeMillis() + duration * 1000; int n = 1; while(deadline > System.currentTimeMillis()) { List<Container> containers = new ArrayList<>(); containers.add(new ValidatingContainer(5 * n, 10, 10, 0)); Packager bruteForcePackager = new BruteForcePackager(containers, true, true, 1); List<BoxItem> products1 = new ArrayList<>(); for(int i = 0; i < n; i++) { Box box = new Box(Integer.toString(i), 5, 10, 10, 0); for(int k = 0; k < i % 2; k++) { box.rotate3D(); } products1.add(new BoxItem(box, 1)); } long time = System.currentTimeMillis(); Container container = bruteForcePackager.pack(products1, deadline); if(container != null) { System.out.println(n + " in " + (System.currentTimeMillis() - time)); } else { System.out.println(n + " discarded in " + (System.currentTimeMillis() - time)); } n++; } }
public BruteForceResult pack(List<Placement> placements, Container container, PermutationRotationIterator rotator, long deadline, int checkpointsPerDeadlineCheck) { return pack(placements, container, rotator, BooleanSupplierBuilder.builder().withDeadline(deadline, checkpointsPerDeadlineCheck).build()); }
BruteForcePackager extends Packager { public BruteForceResult pack(List<Placement> placements, Container container, PermutationRotationIterator rotator, long deadline, int checkpointsPerDeadlineCheck) { return pack(placements, container, rotator, BooleanSupplierBuilder.builder().withDeadline(deadline, checkpointsPerDeadlineCheck).build()); } }
BruteForcePackager extends Packager { public BruteForceResult pack(List<Placement> placements, Container container, PermutationRotationIterator rotator, long deadline, int checkpointsPerDeadlineCheck) { return pack(placements, container, rotator, BooleanSupplierBuilder.builder().withDeadline(deadline, checkpointsPerDeadlineCheck).build()); } BruteForcePackager(List<Container> containers, boolean rotate3D, boolean binarySearch, int checkpointsPerDeadlineCheck);  BruteForcePackager(List<Container> containers); }
BruteForcePackager extends Packager { public BruteForceResult pack(List<Placement> placements, Container container, PermutationRotationIterator rotator, long deadline, int checkpointsPerDeadlineCheck) { return pack(placements, container, rotator, BooleanSupplierBuilder.builder().withDeadline(deadline, checkpointsPerDeadlineCheck).build()); } BruteForcePackager(List<Container> containers, boolean rotate3D, boolean binarySearch, int checkpointsPerDeadlineCheck);  BruteForcePackager(List<Container> containers); static BruteForcePackagerBuilder newBuilder(); BruteForceResult pack(List<Placement> placements, Container container, PermutationRotationIterator rotator, long deadline, int checkpointsPerDeadlineCheck); BruteForceResult pack(List<Placement> placements, Container container, PermutationRotationIterator rotator, long deadline, int checkpointsPerDeadlineCheck, BooleanSupplier interrupt); BruteForceResult pack(List<Placement> placements, Container container, PermutationRotationIterator rotator, BooleanSupplier interrupt); static int pack(List<Placement> placements, Dimension container, PermutationRotationIterator rotator, long deadline, int checkpointsPerDeadlineCheck, Container holder, int index); static int pack(List<Placement> placements, Dimension container, PermutationRotationIterator rotator, long deadline, int checkpointsPerDeadlineCheck, Container holder, int index, BooleanSupplier interrupt); static int pack(List<Placement> placements, Dimension remainingSpace, PermutationRotationIterator rotator, Container holder, int index, BooleanSupplier interrupt); }
BruteForcePackager extends Packager { public BruteForceResult pack(List<Placement> placements, Container container, PermutationRotationIterator rotator, long deadline, int checkpointsPerDeadlineCheck) { return pack(placements, container, rotator, BooleanSupplierBuilder.builder().withDeadline(deadline, checkpointsPerDeadlineCheck).build()); } BruteForcePackager(List<Container> containers, boolean rotate3D, boolean binarySearch, int checkpointsPerDeadlineCheck);  BruteForcePackager(List<Container> containers); static BruteForcePackagerBuilder newBuilder(); BruteForceResult pack(List<Placement> placements, Container container, PermutationRotationIterator rotator, long deadline, int checkpointsPerDeadlineCheck); BruteForceResult pack(List<Placement> placements, Container container, PermutationRotationIterator rotator, long deadline, int checkpointsPerDeadlineCheck, BooleanSupplier interrupt); BruteForceResult pack(List<Placement> placements, Container container, PermutationRotationIterator rotator, BooleanSupplier interrupt); static int pack(List<Placement> placements, Dimension container, PermutationRotationIterator rotator, long deadline, int checkpointsPerDeadlineCheck, Container holder, int index); static int pack(List<Placement> placements, Dimension container, PermutationRotationIterator rotator, long deadline, int checkpointsPerDeadlineCheck, Container holder, int index, BooleanSupplier interrupt); static int pack(List<Placement> placements, Dimension remainingSpace, PermutationRotationIterator rotator, Container holder, int index, BooleanSupplier interrupt);  }