| | |
| | | |
| | | // NONE(0), |
| | | NONE(0), |
| | | SEVERE(20000), |
| | | SEVERE(30000), |
| | | ; |
| | | |
| | | public long duration; |
| | |
| | | import com.zy.acs.common.enums.AgvDirectionType; |
| | | import com.zy.acs.framework.common.Cools; |
| | | import com.zy.acs.manager.common.utils.MapDataUtils; |
| | | import com.zy.acs.manager.core.domain.type.BlockSeverityType; |
| | | import com.zy.acs.manager.core.service.astart.*; |
| | | import com.zy.acs.manager.core.service.astart.domain.DynamicNode; |
| | | import com.zy.acs.manager.core.service.floyd.FloydNavigateService; |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.*; |
| | | import java.util.ArrayList; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | * 寻址 ===>> A Star |
| | | */ |
| | | public synchronized List<String> checkoutPath(String agvNo, Code startCode, Code endCode |
| | | , Boolean lock, List<String> blackList, Segment segment, BlockSeverityType blockSeverity) { |
| | | , Boolean lock, List<String> blackList, Segment segment) { |
| | | |
| | | int[] startMapIdx = mapDataDispatcher.getCodeMatrixIdx(null, startCode.getData()); |
| | | int[] endMapIdx = mapDataDispatcher.getCodeMatrixIdx(null, endCode.getData()); |
| | |
| | | NavigateNode startNode = new NavigateNode(startMapIdx[0], startMapIdx[1], startCode.getData()); |
| | | NavigateNode endNode = new NavigateNode(endMapIdx[0], endMapIdx[1], endCode.getData()); |
| | | |
| | | NavigateNode finishNode = aStarNavigateService.execute(agvNo, startNode, endNode, lock, blackList, segment, blockSeverity); |
| | | NavigateNode finishNode = aStarNavigateService.execute(agvNo, startNode, endNode, lock, blackList, segment); |
| | | |
| | | if (null == finishNode) { |
| | | log.warn("{} 号AGV检索[{}] ===>> [{}]路径失败......", agvNo, startCode.getData(), endCode.getData()); |
| | |
| | | List<String> pathList = new ArrayList<>(); |
| | | |
| | | // 无障碍解 |
| | | List<String> unlockPathList = mapService.checkoutPath(agvNo, startCode, endCode, false, blackPath, segment, null); |
| | | List<String> unlockPathList = mapService.checkoutPath(agvNo, startCode, endCode, false, blackPath, segment); |
| | | // 避让解 |
| | | List<String> lockPathList = mapService.checkoutPath(agvNo, startCode, endCode, true, blackPath, segment, null); |
| | | List<String> lockPathList = mapService.checkoutPath(agvNo, startCode, endCode, true, blackPath, segment); |
| | | |
| | | if (!Cools.isEmpty(lockPathList) && // 存在避让解 |
| | | Math.abs(lockPathList.size() - unlockPathList.size()) <= Arrays.stream(mapDataDispatcher.getCodeMatrix(lev)).mapToInt(row -> row.length).sum() / 10 |
| | |
| | | if (blockSeverity.equals(BlockSeverityType.SEVERE)) { |
| | | unlockPathList.remove(endCode.getData()); |
| | | blackPath.addAll(unlockPathList); |
| | | List<String> list = mapService.checkoutPath(agvNo, startCode, endCode, false, blackPath, segment, blockSeverity); |
| | | System.out.println(list.size()); |
| | | List<String> newUnlockPathList = mapService.checkoutPath(agvNo, startCode, endCode, false, blackPath, segment); |
| | | if (!Cools.isEmpty(newUnlockPathList)) { |
| | | draftPath = newUnlockPathList; |
| | | } |
| | | } |
| | | // 可走行路径集合计算 |
| | | List<BlockVehicleDto> blockVehicleList = this.slicePathAndReturnBlockVehicleList(lev, draftPath, agvNo, pathList); // jamAgvNo may was wave |
| | |
| | | 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, BlockSeverityType blockSeverity) { |
| | | , Boolean lock, List<String> blackList, Segment segment) { |
| | | if (start.getX() == end.getX() && start.getY() == end.getY()) { |
| | | return end; |
| | | } |