| | |
| | | |
| | | openQueue.add(start); |
| | | existNodes.add(start); |
| | | boolean phaseSecond = true; |
| | | |
| | | while (openQueue.size() > 0 && null == finialNode) { |
| | | |
| | |
| | | List<RetreatNavigateNode> enableNodes = new ArrayList<>(); |
| | | |
| | | ArrayList<RetreatNavigateNode> neighborNodes = this.getNeighborNodes(currentNode, existNodes); |
| | | boolean pointOfTurn = neighborNodes.size() >= 2; |
| | | label: for (RetreatNavigateNode node : neighborNodes) { |
| | | if (node.getCodeData().equals(breakPoint)) { continue; } |
| | | |
| | |
| | | continue label; |
| | | } |
| | | if (1 < mapDataDispatcher.queryCodeListFromDynamicNode(lev, otherWave).size()) { |
| | | phaseSecond = false; // there is a way to go |
| | | continue label; |
| | | } else { |
| | | weight += WEIGHT_CALC_FACTOR; |
| | |
| | | } |
| | | |
| | | // lane |
| | | if (pointOfTurn) { |
| | | Lane lane = laneService.search(node.getCodeData()); |
| | | if (null != lane) { |
| | | Set<String> lanVehicleSet = new HashSet<>(); |
| | | |
| | | List<String> laneCodes = lane.getCodes(); |
| | | for (String laneCodeData : laneCodes) { |
| | | for (String laneCodeData : lane.getCodes()) { |
| | | // overlap with sponsor |
| | | if (avoidPathList.contains(laneCodeData)) { |
| | | lanVehicleSet.add(sponsor); |
| | | } |
| | | |
| | | int[] laneCodeMatrixIdx = mapDataDispatcher.getCodeMatrixIdx(null, laneCodeData); |
| | | // scan dynamicMatrix or WaveMatrix |
| | | DynamicNode laneDynamicNode = dynamicMatrix[laneCodeMatrixIdx[0]][laneCodeMatrixIdx[1]]; |
| | |
| | | } |
| | | |
| | | if (lanVehicleSet.size() + 1 > maxAgvCountInLane) { |
| | | phaseSecond = false; // there is a way to go |
| | | continue; |
| | | } |
| | | if (lanVehicleSet.contains(sponsor)) { |
| | | weight += WEIGHT_CALC_FACTOR * 2; |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | if (null == finialNode) { |
| | | if (null == finialNode && phaseSecond) { |
| | | // assert openQueue.size() == 0; |
| | | |
| | | existNodes.clear(); |