#
luxiaotao1123
2024-12-30 3209b7899f99fbc567c24be9709ba289f33ea73b
zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/RetreatNavigateService.java
@@ -124,29 +124,26 @@
                // lane
                if (pointOfTurn) {
                    Lane lane = laneService.search(node.getCodeData());
                    if (null != lane) {
                    List<int[]> laneCodeIdxList = laneService.getLaneCodeIdxList(node.getCodeData());
                    if (!Cools.isEmpty(laneCodeIdxList)) {
                        Set<String> lanVehicleSet = new HashSet<>();
                        for (String laneCodeData : lane.getCodes()) {
                        for (int[] codeMatrixIdx : laneCodeIdxList) {
                            // overlap with sponsor
                            String laneCodeData = codeMatrix[codeMatrixIdx[0]][codeMatrixIdx[1]];
                            if (avoidPathList.contains(laneCodeData)) {
                                lanVehicleSet.add(sponsor);
                            }
                            int[] laneCodeMatrixIdx = mapDataDispatcher.getCodeMatrixIdx(null, laneCodeData);
                            // scan dynamicMatrix or WaveMatrix
                            DynamicNode laneDynamicNode = dynamicMatrix[laneCodeMatrixIdx[0]][laneCodeMatrixIdx[1]];
                            DynamicNode laneDynamicNode = dynamicMatrix[codeMatrixIdx[0]][codeMatrixIdx[1]];
                            String laneVehicle = laneDynamicNode.getVehicle();
                            assert !laneVehicle.equals(DynamicNodeType.BLOCK.val);
                            if (!laneVehicle.equals(DynamicNodeType.ACCESS.val)) {
                                if (!laneVehicle.equals(agvNo)) {
                                    lanVehicleSet.add(laneVehicle);
//                                    redis.setObject(RedisConstant.AGV_TO_STANDBY_FLAG, laneVehicle, true, 30);
                                }
                            }
                        }
                        if (lanVehicleSet.size() + 1 > maxAgvCountInLane) {
                            phaseSecond = false;    // there is a running way
                            continue;
@@ -155,6 +152,7 @@
                            weight += WEIGHT_CALC_FACTOR * 2;
                        }
                    }
                }
                Code code = codeService.selectByData(node.getCodeData());
@@ -224,24 +222,20 @@
                        for (RetreatNavigateNode node : neighborNodes) {
                            // lane
                            Lane lane = laneService.search(node.getCodeData());
                            if (null != lane) {
                            List<int[]> laneCodeIdxList = laneService.getLaneCodeIdxList(node.getCodeData());
                            if (!Cools.isEmpty(laneCodeIdxList)) {
                                Set<String> lanVehicleSet = new HashSet<>();
                                for (String laneCodeData : lane.getCodes()) {
                                    int[] laneCodeMatrixIdx = mapDataDispatcher.getCodeMatrixIdx(null, laneCodeData);
                                    // scan dynamicMatrix or WaveMatrix
                                    DynamicNode laneDynamicNode = dynamicMatrix[laneCodeMatrixIdx[0]][laneCodeMatrixIdx[1]];
                                for (int[] codeMatrixIdx : laneCodeIdxList) {
                                    DynamicNode laneDynamicNode = dynamicMatrix[codeMatrixIdx[0]][codeMatrixIdx[1]];
                                    String laneVehicle = laneDynamicNode.getVehicle();
                                    assert !laneVehicle.equals(DynamicNodeType.BLOCK.val);
                                    if (!laneVehicle.equals(DynamicNodeType.ACCESS.val)) {
                                        if (!laneVehicle.equals(agvNo)) {
                                            lanVehicleSet.add(laneVehicle);
//                                            redis.setObject(RedisConstant.AGV_TO_STANDBY_FLAG, laneVehicle, true, 30);
                                        }
                                    }
                                }
                                if (lanVehicleSet.size() + 1 > maxAgvCountInLane) {
                                    continue;
                                }