| | |
| | | import com.zy.acs.common.utils.Utils; |
| | | import com.zy.acs.framework.common.Cools; |
| | | import com.zy.acs.manager.common.utils.MapDataUtils; |
| | | import com.zy.acs.manager.core.constant.MapDataConstant; |
| | | import com.zy.acs.manager.core.service.astart.*; |
| | | import com.zy.acs.manager.core.service.astart.domain.DynamicNode; |
| | | import com.zy.acs.manager.core.utils.RouteGenerator; |
| | | import com.zy.acs.manager.manager.entity.AgvModel; |
| | | import com.zy.acs.manager.manager.entity.Code; |
| | | import com.zy.acs.manager.manager.entity.Jam; |
| | | import com.zy.acs.manager.manager.entity.Segment; |
| | |
| | | @Autowired |
| | | private AgvModelService agvModelService; |
| | | @Autowired |
| | | private LaneService laneService; |
| | | private LaneBuilder laneBuilder; |
| | | @Autowired |
| | | private ConfigService configService; |
| | | @Autowired |
| | | private SegmentService segmentService; |
| | | @Autowired |
| | | private JamService jamService; |
| | | @Autowired |
| | | private AgvAreaDispatcher agvAreaDispatcher; |
| | | |
| | | /** |
| | | * agvNo: 阻塞AGV,挡道者 |
| | | * sponsor: 被阻塞AGV,寻址发起者 |
| | | * avoidPathList ===>> [ minor vehicle ] [wave] [ curr vehicle ] [ code2 ] [ code3 ] ...... |
| | | **/ |
| | | // @SuppressWarnings("all") |
| | |
| | | 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.getByAgvNo(sponsor).getDiameter() |
| | | , MapDataConstant.MAX_DISTANCE_BETWEEN_ADJACENT_AGV_FACTOR); |
| | | AgvModel agvModel = agvModelService.getByAgvNo(agvNo); |
| | | AgvModel sponsorModel = agvModelService.getByAgvNo(sponsor); |
| | | double avoidDistance = MapDataUtils.buildFootprint(agvModel).maxExtent() + MapDataUtils.buildFootprint(sponsorModel).maxExtent(); |
| | | List<String> avoidPathListWave = mapService.getWaveScopeByCodeList(lev, avoidPathList, avoidDistance); |
| | | |
| | | String[][] codeMatrix = mapDataDispatcher.getCodeMatrix(lev); |
| | |
| | | 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 |
| | |
| | | |
| | | // lane |
| | | if (pointOfTurn) { |
| | | List<int[]> laneCodeIdxList = laneService.getLaneCodeIdxList(node.getCodeData()); |
| | | List<int[]> laneCodeIdxList = laneBuilder.getLaneCodeIdxList(node.getCodeData()); |
| | | if (!Cools.isEmpty(laneCodeIdxList)) { |
| | | Set<String> lanVehicleSet = new HashSet<>(); |
| | | |
| | |
| | | |
| | | for (RetreatNavigateNode node : neighborNodes) { |
| | | // lane |
| | | List<int[]> laneCodeIdxList = laneService.getLaneCodeIdxList(node.getCodeData()); |
| | | List<int[]> laneCodeIdxList = laneBuilder.getLaneCodeIdxList(node.getCodeData()); |
| | | if (!Cools.isEmpty(laneCodeIdxList)) { |
| | | Set<String> lanVehicleSet = new HashSet<>(); |
| | | |