| | |
| | | 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.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.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()); |
| | |
| | | // navigateNode.setParent(null); |
| | | // } |
| | | |
| | | return navigateNodes.stream().map(NavigateNode::getCodeData).collect(Collectors.toList()); |
| | | List<String> navigatePath = navigateNodes.stream().map(NavigateNode::getCodeData).collect(Collectors.toList()); |
| | | |
| | | // max count of steps |
| | | if (navigatePath.size() > MapDataConstant.MAX_STEPS_SINGLE) { |
| | | navigatePath = navigatePath.subList(0, MapDataConstant.MAX_STEPS_SINGLE); |
| | | } |
| | | |
| | | return navigatePath; |
| | | } |
| | | |
| | | /** |