3d-bin-container-packing icon indicating copy to clipboard operation
3d-bin-container-packing copied to clipboard

If there is no match, then return the result instead of null

Open 4ybakut2004 opened this issue 3 years ago • 4 comments

Hey! Thanks for the library!

If there are no matches, then it would be useful to get a not-null result with the following information about each container:

  1. List of boxes that were placed in the container.
  2. List of boxes that could not be placed in the container.

I, as a cargo carrier, can first send the first batch of boxes that fit into the container, and then the second batch of boxes in another container.

4ybakut2004 avatar Feb 17 '22 05:02 4ybakut2004

@4ybakut2004 so the packager.packList(..) method(s) do not work?

skjolber avatar Feb 21 '22 01:02 skjolber

@4ybakut2004 so the packager.packList(..) method(s) do not work?

@skjolber, my Issue is about the return value. The packager.packList method returns null, but null cannot be used to determine why the error occurred. For example, if the box is larger than the container or the number of containers is too small to fit all boxes, then the method returns null. However, it would be useful to return a not-null result such as structure with containers and unfitted boxes like:

class Result(
  val containers: List<Container>,
  val unfittedItems: List<StackableItem>
)

4ybakut2004 avatar Feb 21 '22 08:02 4ybakut2004

Right, it would be possible to capture the state when the packager gives up, and capture boxes which are too heavy or too big for any container, ++.

skjolber avatar Feb 21 '22 19:02 skjolber

@4ybakut2004 reviewing this issue, I do not understand why the packList is no good - what will become of the unfitted items?

skjolber avatar Jul 24 '22 19:07 skjolber