简体   繁体   English

2D Bin包装Java?

[英]2d bin packing Java?

I need to solve a 2d bin packing problem using best fit on line in Java. 我需要使用Java中的最佳拟合来解决二维装箱问题。 I don't know how exactly should I find the correct location to put the next box. 我不知道我应该如何准确找到放置下一个框的正确位置。

I was thinking. 我刚在想。 Should I store all the top box positions of each 2d bin somewhere? 我应该将每个2d容器的所有顶部盒位置存储在某个地方吗? Should I keep something like an array and a 2d array in each bin with how empty they are in an array and the position of each top box in the 2d array? 我是否应该在每个bin中保留一个数组和一个2d数组之类的东西,它们在数组中有多少空以及2d数组中每个顶盒的位置?

You can try a treemap. 您可以尝试树状图。 Sort the boxes store the first into a tree and split the tree on both axis. 排序框将第一个存储在树中,然后在两个轴上将树拆分。 Find the best fit for the next box and rinse and repeat. 找到最适合下一盒的产品,然后冲洗并重复。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM