24282 1 năm trước cách đây
mục cha
commit
e98c563481

+ 1 - 1
sd-framework/src/main/java/com/sd/framework/util/packing/model/Genome.java

@@ -68,7 +68,7 @@ public class Genome {
         for (int i = 0; i < genomeArray.length; i++) {
             items[i] = this.items[genomeArray[i]];
         }
-        solution = new SkyLinePacking(isRotateEnable, width, length, items).packing();
+        solution = new SkyLinePacking(isRotateEnable, length, width, items).packing();
         fitness = solution.getRate();
     }
 

+ 7 - 7
sd-framework/src/main/java/com/sd/framework/util/packing/model/SkyLinePacking.java

@@ -10,14 +10,14 @@ import java.util.concurrent.PriorityBlockingQueue;
 public class SkyLinePacking {
 
     /**
-     * 边界的
+     * 边界的
      */
-    private final double width;
+    private final double length;
 
     /**
-     * 边界的
+     * 边界的
      */
-    private final double length;
+    private final double width;
 
     /**
      * 矩形数组
@@ -38,14 +38,14 @@ public class SkyLinePacking {
      * 构造函数
      *
      * @param isRotateEnable 是否允许矩形旋转
-     * @param width          边界宽度
      * @param length         边界长度
+     * @param width          边界宽度
      * @param items          矩形集合
      */
-    public SkyLinePacking(boolean isRotateEnable, double width, double length, Item[] items) {
+    public SkyLinePacking(boolean isRotateEnable, double length, double width, Item[] items) {
         this.isRotateEnable = isRotateEnable;
-        this.width = width;
         this.length = length;
+        this.width = width;
         this.items = items;
     }