From 4f5d79f008255c22e0a2b872ed8de755ec2f8683 Mon Sep 17 00:00:00 2001 From: joylink_zhangsai <1021828630@qq.com> Date: Thu, 3 Jun 2021 17:57:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=9A=E8=BF=9B=E8=B7=AF?= =?UTF-8?q?=E8=B7=AF=E5=BE=84=E6=9E=84=E5=BB=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cbtc/build/InterlockBuilder2.java | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/build/InterlockBuilder2.java b/src/main/java/club/joylink/rtss/simulation/cbtc/build/InterlockBuilder2.java index feb4ecb46..c21180629 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/build/InterlockBuilder2.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/build/InterlockBuilder2.java @@ -615,7 +615,7 @@ public class InterlockBuilder2 { Section endSection4RoutePath = selectSection4DestinationCode(rightStation, rightFrontTurnBack, necessarySectionSet, false); //查询路径的终点区段 routes = new ArrayList<>(); //选择并添加进路 - selectAndAddRoutes(startSection4RoutePath, endSection4RoutePath,true, stationList, standTrackAdjoinMap, routes, necessaryRoutes, necessarySectionSet); + selectAndAddRoutes(startSection4RoutePath, endSection4RoutePath, true, stationList, standTrackAdjoinMap, routes, necessaryRoutes, necessarySectionSet); //选择并添加反向的进路 selectAndAddRoutes(endSection4RoutePath, startSection4RoutePath, false, stationList, standTrackAdjoinMap, routes, necessaryRoutes, necessarySectionSet); runPath = routes.stream().flatMap(route -> route.getSectionList().stream()).distinct().collect(Collectors.toList()); @@ -886,6 +886,23 @@ public class InterlockBuilder2 { routePathMap.put(routePaths.get(0).getKey(), routePaths); } } + long l = System.currentTimeMillis(); + /* 根据交路数据,构建缺失的进路路径 */ + for (Routing routing : buildResult.getRoutingList()) { + List
allSections = routing.getAllSections().stream().distinct().collect(Collectors.toList()); + for (int i = 0, size = allSections.size(); i < size - 1; i++) { + Section one = allSections.get(i); + Section two = allSections.get(i + 1); + String key = RoutePath.buildKey(one, two); + if (!routePathMap.containsKey(key)) { + List routePaths = CalculateService.queryRoutePathsOnDirection(one, two, routing.isRight(), 10); + if (!CollectionUtils.isEmpty(routePaths)) { + routePathMap.put(routePaths.get(0).getKey(), routePaths); + } + } + } + } + System.out.println("用时" + (System.currentTimeMillis() - l)); log.debug("构建进路路径耗时:" + (System.currentTimeMillis() - start)); }