自动化立体仓库 - WMS系统
#
luxiaotao1123
2020-06-30 a78f80c36b64a69b1293289dad908abcb12858a8
src/main/java/com/zy/common/model/Shelves.java
@@ -20,7 +20,7 @@
    private final int offset;
    // 货架实例节点集合
    private List<List<Integer>> nodes;
    public List<List<Integer>> nodes;
    public Shelves(int size, int group) {
        this(size, group, 0);
@@ -58,9 +58,11 @@
    /**
     * 开始计算 =======>>>
     *
     *          货架命中规则如下:
     *              安装位置:   [1]  [2]  |  [3]  [4]  --------  [5] [6]  |  [7] [8]
     *                  命中顺序:      1 -> 5 -> 4 -> 8 -> 2 -> 6 -> 3 -> 9 -> 1 ...
     *
     *          1.该规则适不限制货架数量,总数与组别在构造器中设置
     *          2.如有序列号起始问题,用偏移量规避即可
     *
@@ -78,8 +80,8 @@
                    return iterator.next().get(idx);
                } else {
                    List<Integer> first = nodes.get(0);
                    Integer val = first.get(idx);
                    int res = size /group + 1 + offset - val;
                    int val = first.get(idx);
                    int res = size / group + 1 + offset - val;
                    // 反向命中货架时不再是对立下标(相对于巷道)
                    if (res < val) {
                        // 轮询所有货架后重新开始定位
@@ -92,12 +94,12 @@
                }
            }
        }
        return 0;
        return -1;
    }
    public static void main(String[] args) throws InterruptedException {
        Shelves shelves = new Shelves(4,2);
        Shelves shelves = new Shelves(8,2);
        System.out.println(shelves.nodes.toString());
        int start = 1;
        while (true) {