| | |
| | | return turnMatrixNode == TurnNodeType.TURN.val; |
| | | } |
| | | |
| | | /** |
| | | * That vehicle is walking if the dynamic node count > 1 |
| | | */ |
| | | @SuppressWarnings("all") |
| | | public boolean isWalkingByVehicle(Integer lev, String vehicle) { |
| | | if (Cools.isEmpty(vehicle)) { |
| | | return false; |
| | | } |
| | | |
| | | lev = Optional.ofNullable(lev).orElse(MapDataDispatcher.MAP_DEFAULT_LEV); |
| | | DynamicNode[][] dynamicMatrix = mapDataDispatcher.getDynamicMatrix(lev); |
| | | |
| | | int count = 0; |
| | | for (int i = 0; i < dynamicMatrix.length; i++) { |
| | | for (int j = 0; j < dynamicMatrix[i].length; j++) { |
| | | if (vehicle.equals(dynamicMatrix[i][j].getVehicle())) { |
| | | count++; |
| | | if (count > 1) { |
| | | return true; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | return false; |
| | | } |
| | | |
| | | public List<String> queryCodeListFromDynamicNode(Integer lev, String nodeType) { |
| | | if (Cools.isEmpty(nodeType)) { |
| | | return new ArrayList<>(); |
| | |
| | | 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 { |
| | |
| | | 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 --; |
| | |
| | | List<String> otherWaveList = MapDataUtils.hasOtherWave(waveNodeList, agvNo); |
| | | if (!Cools.isEmpty(otherWaveList)) { |
| | | for (String otherWave : otherWaveList) { |
| | | if (1 < mapService.queryCodeListFromDynamicNode(lev, otherWave).size()) { |
| | | if (mapService.isWalkingByVehicle(lev, otherWave)) { |
| | | blockVehicleList.add(new BlockVehicleDto(otherWave, false)); |
| | | } else { |
| | | blockVehicleList.add(new BlockVehicleDto(otherWave, true)); |