From 928bc386bea03b9d3157e6d66dcb7afc843e9964 Mon Sep 17 00:00:00 2001 From: Junjie <fallin.jie@qq.com> Date: 星期六, 17 六月 2023 15:55:50 +0800 Subject: [PATCH] 小车从提升机移动出去增强管控 --- src/main/java/com/zy/common/utils/NavigateUtils.java | 24 +++++++++++++++++++++++- 1 files changed, 23 insertions(+), 1 deletions(-) diff --git a/src/main/java/com/zy/common/utils/NavigateUtils.java b/src/main/java/com/zy/common/utils/NavigateUtils.java index 306a049..9ac5f03 100644 --- a/src/main/java/com/zy/common/utils/NavigateUtils.java +++ b/src/main/java/com/zy/common/utils/NavigateUtils.java @@ -26,7 +26,7 @@ start.setFather(null); NavigateNode end = new NavigateNode(endArr[0], endArr[1]); - NavigateSolution solution = new NavigateSolution(mapType); + NavigateSolution solution = new NavigateSolution(mapType, lev); NavigateNode res_node = solution.astarSearch(start, end); if (res_node == null) { System.out.println("鏈壘鍒拌矾寰�"); @@ -184,6 +184,19 @@ } /** + * 鏍规嵁鍘熷鑺傜偣缁撴灉锛岃绠楁�昏璧拌窛绂� + */ + public static Integer getOriginPathAllDistance(List<NavigateNode> path) { + ArrayList<ArrayList<NavigateNode>> sectionPath = NavigateUtils.getSectionPath(path); + Integer allDistance = 0; + for (ArrayList<NavigateNode> navigateNodes : sectionPath) { + Integer distance = NavigateUtils.getCurrentPathAllDistance(navigateNodes); + allDistance += distance; + } + return allDistance; + } + + /** * 鑾峰彇褰撳墠璺緞鎬昏璧拌窛绂� */ public static Integer getCurrentPathAllDistance(List<NavigateNode> path) { @@ -200,6 +213,15 @@ return allDistance; } + /** + * 鑾峰彇涓棿鐐瑰埌鐩爣鐐硅璧拌窛绂� + */ + public static Integer getMiddleToDistDistance(List<NavigateNode> path) { + //涓棿璺緞 + NavigateNode middlePath = path.get(path.size() - 2); + return middlePath.getMoveDistance(); + } + public static void main(String[] args) { //璁$畻璺緞 List<NavigateNode> calc = calc("1000901", "1800201", ShuttleTaskModeType.PAK_OUT.id); -- Gitblit v1.9.1