#
luxiaotao1123
2024-11-15 de726e3af84dd4bedc95b42b42132c728788a3b1
zy-acs-manager/src/main/java/com/zy/acs/manager/core/service/astart/AStarNavigateService.java
@@ -14,9 +14,7 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
import java.util.PriorityQueue;
import java.util.*;
/**
 * Created by vincent on 6/12/2024
@@ -85,6 +83,10 @@
//                    }
//                }
                if (!Cools.isEmpty(blackList) && blackList.contains(node.getCodeData())) {
                    continue;
                }
                // 节点被占用
                DynamicNode dynamicNode = dynamicMatrix[node.getX()][node.getY()];
                String vehicle = dynamicNode.getVehicle();
@@ -92,9 +94,6 @@
                if (!vehicle.equals(DynamicNodeType.ACCESS.val)) {
                    if (!vehicle.equals(agvNo)) {
                        if (!Cools.isEmpty(blackList) && blackList.contains(vehicle)) {
                            continue;
                        }
                        if (lock) {
                            continue;
                        }
@@ -109,9 +108,6 @@
                    List<String> otherWaveList = MapDataUtils.hasOtherWave(waveNodeList, agvNo);
                    if (!Cools.isEmpty(otherWaveList)) {
                        if (!Cools.isEmpty(blackList) && 0 < Cools.getIntersection(otherWaveList, blackList).size()) {
                            continue;
                        }
                        if (lock) {
                            continue;
@@ -122,7 +118,7 @@
                // 单巷道车辆容载数量
                Lane lane = laneService.search(node.getCodeData());
                if (null != lane) {
                    int otherVehicleCount = 0;
                    Set<String> lanVehicleSet = new HashSet<>();
                    List<String> laneCodes = lane.getCodes();
                    for (String laneCodeData : laneCodes) {
@@ -133,16 +129,17 @@
                        assert !laneVehicle.equals(DynamicNodeType.BLOCK.val);
                        if (!laneVehicle.equals(DynamicNodeType.ACCESS.val)) {
                            if (!laneVehicle.equals(agvNo)) {
                                otherVehicleCount++;
                                lanVehicleSet.add(laneVehicle);
//                                redis.setObject(RedisConstant.AGV_TO_STANDBY_FLAG, laneVehicle, true, 30);
                            }
                        }
                    }
                    if (otherVehicleCount + 1 > maxAgvCountInLane) {
                        if (lock) {
                            continue;
                        }
                    if (lanVehicleSet.size() + 1 > maxAgvCountInLane) {
//                        if (lock) {
//                            continue;
//                        }
                        continue;
                    }
                }