| | |
| | | import com.zy.acs.framework.common.Cools; |
| | | import com.zy.acs.manager.common.utils.MapDataUtils; |
| | | import com.zy.acs.manager.core.domain.Lane; |
| | | import com.zy.acs.manager.core.domain.type.BlockSeverityType; |
| | | import com.zy.acs.manager.core.service.LaneService; |
| | | import com.zy.acs.manager.core.service.astart.domain.DynamicNode; |
| | | import com.zy.acs.manager.manager.entity.Route; |
| | |
| | | private ConfigService configService; |
| | | |
| | | public synchronized NavigateNode execute(String agvNo, NavigateNode start, NavigateNode end |
| | | , Boolean lock, List<String> blackList, Segment segment) { |
| | | , Boolean lock, List<String> blackList, Segment segment, BlockSeverityType blockSeverity) { |
| | | if (start.getX() == end.getX() && start.getY() == end.getY()) { |
| | | return end; |
| | | } |
| | |
| | | DynamicNode[][] dynamicMatrix = mapDataDispatcher.getDynamicMatrix(null); |
| | | String[][] waveMatrix = mapDataDispatcher.getWaveMatrix(null); |
| | | |
| | | // List<String> included = new ArrayList<>(); |
| | | // if (!Cools.isEmpty(whiteList)) { |
| | | // included.addAll(whiteList); |
| | | // } |
| | | // included.add(agvNo); |
| | | // List<VehicleDto> vehicleDtoList = agvService.getVehicleDtoList(included); |
| | | |
| | | while (openQueue.size() > 0) { |
| | | // 取优先队列顶部元素并且把这个元素从Open表中删除,取F值最小的节点 |
| | | NavigateNode currentNode = openQueue.poll(); |
| | | // 对当前结点进行扩展,得到一个四周结点的数组 |
| | | |
| | | ArrayList<NavigateNode> neighbourNodes = this.getNeighborNodes(currentNode, mapMatrix, existNodes); |
| | | // 对这个结点遍历,看是否有目标结点出现 |
| | | label: for (NavigateNode node : neighbourNodes) { |
| | | for (NavigateNode node : neighbourNodes) { |
| | | boolean isEndNode = node.getX() == end.getX() && node.getY() == end.getY(); |
| | | |
| | | int weight = 0; |
| | | // 节点存在其他车辆 |
| | | // for (VehicleDto vehicleDto : vehicleDtoList) { |
| | | // if (node.getCodeData().equals(vehicleDto.getPosCode())) { |
| | | // if (!Cools.isEmpty(blackList) && blackList.contains(vehicleDto.getVehicle())) { |
| | | // continue label; |
| | | // } |
| | | // if (lock) { |
| | | // continue label; |
| | | // } |
| | | // } |
| | | // } |
| | | |
| | | if (!Cools.isEmpty(blackList) && blackList.contains(node.getCodeData())) { |
| | | continue; |
| | |
| | | |
| | | |
| | | //找到目标结点就返回 |
| | | if (node.getX() == end.getX() && node.getY() == end.getY()) { |
| | | if (isEndNode) { |
| | | //并且计算出G, F, H等值 |
| | | node.initNode(currentNode, end); |
| | | return node; |