| | |
| | | |
| | | private final RedisSupport redis = RedisSupport.defaultRedisSupport; |
| | | |
| | | public static final int WEIGHT_CALC_COEFFICIENT = 1000; |
| | | public static final int WEIGHT_CALC_COEFFICIENT = 10000; |
| | | |
| | | @Autowired |
| | | private CodeService codeService; |
| | |
| | | RetreatNavigateNode availablePointOfTurn = null; |
| | | List<String> availablePointWaveScopeOfTurn = new ArrayList<>(); |
| | | int actualLanesOfTurn = 0; |
| | | int filterPointOfTurnTimes = 0; |
| | | |
| | | while (openQueue.size() > 0 && null == finialNode) { |
| | | |
| | |
| | | if (null == availablePointOfTurn) { |
| | | // 计算是否为可用转弯点 |
| | | if (neighborNodes.size() >= 2 && !isSame(start, currentNode)) { |
| | | filterPointOfTurnTimes ++; |
| | | if (filterPointOfTurnTimes > 2) { break; } |
| | | |
| | | for (RetreatNavigateNode node : neighborNodes) { |
| | | // lane |
| | | 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()) { |
| | | int[] laneCodeMatrixIdx = mapDataDispatcher.getCodeMatrixIdx(null, laneCodeData); |
| | | // scan dynamicMatrix or WaveMatrix |
| | | DynamicNode laneDynamicNode = dynamicMatrix[laneCodeMatrixIdx[0]][laneCodeMatrixIdx[1]]; |
| | |
| | | if (!laneVehicle.equals(DynamicNodeType.ACCESS.val)) { |
| | | if (!laneVehicle.equals(agvNo)) { |
| | | lanVehicleSet.add(laneVehicle); |
| | | // redis.setObject(RedisConstant.AGV_TO_STANDBY_FLAG, laneVehicle, true, 30); |
| | | // redis.setObject(RedisConstant.AGV_TO_STANDBY_FLAG, laneVehicle, true, 30); |
| | | } |
| | | } |
| | | } |
| | |
| | | if (null != availablePointOfTurn && actualLanesOfTurn > 0) { |
| | | actualLanesOfTurn --; |
| | | } |
| | | |
| | | continue label; |
| | | } else { |
| | | weight += WEIGHT_CALC_COEFFICIENT; |