#
Junjie
1 天以前 95a193eef12a217076be6ba280190b3104daf967
#
1个文件已修改
37 ■■■■■ 已修改文件
src/main/java/com/zy/common/utils/NavigateUtils.java 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/common/utils/NavigateUtils.java
@@ -1250,42 +1250,7 @@
                                           StationTrafficSnapshot trafficSnapshot,
                                           LoopMergeGuardContext loopMergeGuardContext,
                                           Set<LoopMergeEntry> mandatoryLoopMergeEntrySet) {
        if (path == null || path.size() < 2 || loopMergeGuardContext == null || loopMergeGuardContext.loopStationIdSet.isEmpty()) {
            return true;
        }
        List<Integer> stationIdList = extractStationIdList(path);
        if (stationIdList.size() < 2) {
            return true;
        }
        for (int i = 1; i < stationIdList.size(); i++) {
            Integer prevStationId = stationIdList.get(i - 1);
            Integer currentStationId = stationIdList.get(i);
            if (prevStationId == null || currentStationId == null) {
                continue;
            }
            if (loopMergeGuardContext.loopStationIdSet.contains(prevStationId)
                    || !loopMergeGuardContext.loopStationIdSet.contains(currentStationId)) {
                continue;
            }
            Set<Integer> trunkNeighborSet = loopMergeGuardContext.loopNeighborMap.getOrDefault(currentStationId, Collections.emptySet());
            if (trunkNeighborSet.size() < 2) {
                continue;
            }
            LoopMergeEntry currentEntry = new LoopMergeEntry(prevStationId, currentStationId);
            for (Integer trunkNeighborStationId : trunkNeighborSet) {
                if (isStationOccupiedForLoopMerge(trunkNeighborStationId, statusMap, trafficSnapshot)) {
                    return false;
                }
            }
            boolean mandatoryEntry = mandatoryLoopMergeEntrySet != null && mandatoryLoopMergeEntrySet.contains(currentEntry);
            if (!mandatoryEntry && !isLoopTrunkVeryIdle(currentStationId, loopMergeGuardContext, statusMap, trafficSnapshot)) {
                return false;
            }
        }
        // 环线并入保护已停用:允许候选路径直接参与后续评分。
        return true;
    }