| | |
| | | private SegmentService segmentService; |
| | | @Autowired |
| | | private JamService jamService; |
| | | @Autowired |
| | | private AgvAreaDispatcher agvAreaDispatcher; |
| | | |
| | | /** |
| | | * avoidPathList ===>> [ minor vehicle ] [wave] [ curr vehicle ] [ code2 ] [ code3 ] ...... |
| | |
| | | Integer lev = null; |
| | | Integer maxAgvCountInLane = configService.getVal("maxAgvCountInLane", Integer.class); |
| | | |
| | | // scope code area: 4ms |
| | | Long agvId = agvService.getAgvId(agvNo); |
| | | Boolean withinArea = agvAreaDispatcher.isAgvExistsInAnyArea(agvId); |
| | | List<String> scopeCodeList = new ArrayList<>(); |
| | | if (withinArea) { |
| | | scopeCodeList = agvAreaDispatcher.getCodesByAgvId(agvId); |
| | | if (!Cools.isEmpty(scopeCodeList) && !scopeCodeList.contains(start.getCodeData())) { |
| | | withinArea = false; |
| | | } |
| | | } |
| | | |
| | | String breakPoint = avoidPathList.stream().findFirst().orElse(null); |
| | | List<String> blackList = Utils.singletonList(sponsor); |
| | | |
| | | Double avoidDistance = MapDataUtils.getVehicleWaveSafeDistance(agvModelService.getById(agvService.selectByUuid(sponsor).getAgvModel()).getDiameter() |
| | | Double avoidDistance = MapDataUtils.getVehicleWaveSafeDistance(agvModelService.getByAgvNo(sponsor).getDiameter() |
| | | , MapDataConstant.MAX_DISTANCE_BETWEEN_ADJACENT_AGV_FACTOR); |
| | | List<String> avoidPathListWave = mapService.getWaveScopeByCodeList(lev, avoidPathList, avoidDistance); |
| | | |
| | |
| | | label: for (RetreatNavigateNode node : neighborNodes) { |
| | | if (node.getCodeData().equals(breakPoint)) { continue; } |
| | | |
| | | if (withinArea) { |
| | | assert !Cools.isEmpty(scopeCodeList); |
| | | if (!scopeCodeList.contains(node.getCodeData())) { continue; } |
| | | } |
| | | |
| | | int weight = 0; |
| | | |
| | | // wave |
| | |
| | | if (!Cools.isEmpty(blackList) && blackList.contains(otherWave)) { |
| | | continue label; |
| | | } |
| | | if (1 < mapService.queryCodeListFromDynamicNode(lev, otherWave).size()) { |
| | | if (mapService.isWalkingByVehicle(lev, otherWave)) { |
| | | phaseSecond = false; // there is a running way |
| | | continue label; |
| | | } else { |
| | |
| | | |
| | | } |
| | | |
| | | Code code = codeService.selectByData(node.getCodeData()); |
| | | Code code = codeService.getCacheByData(node.getCodeData()); |
| | | |
| | | // judge whether the node has already been marked as a retreat node? |
| | | // This is a very troublesome matter, if the node be repeatedly mark as a retreat node |
| | |
| | | if (!Cools.isEmpty(blackList) && blackList.contains(otherWave)) { |
| | | continue; |
| | | } |
| | | if (1 < mapService.queryCodeListFromDynamicNode(lev, otherWave).size()) { |
| | | if (mapService.isWalkingByVehicle(lev, otherWave)) { |
| | | |
| | | if (null != availablePointOfTurn && actualLanesOfTurn > 0) { |
| | | actualLanesOfTurn --; |