From 280cafcf13ef807c7bb20a5cfa28722e5475ad9e Mon Sep 17 00:00:00 2001 From: joylink_zhangsai <1021828630@qq.com> Date: Thu, 30 Jun 2022 16:31:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=BA=E4=BA=86=E5=8A=A0=E5=BF=AB=E4=BB=BF?= =?UTF-8?q?=E7=9C=9F=E5=88=9B=E5=BB=BA=EF=BC=8C=E5=8E=BB=E6=8E=89=E9=81=8D?= =?UTF-8?q?=E5=8E=86=E6=89=80=E6=9C=89=E5=8A=9F=E8=83=BD=E8=BD=A8=E6=9E=84?= =?UTF-8?q?=E5=BB=BA=E8=BF=9B=E8=B7=AF=E8=B7=AF=E5=BE=84=E7=9A=84=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cbtc/build/InterlockBuilder2.java | 64 ++++++++++--------- .../cbtc/build/SimulationBuilder.java | 4 -- .../cbtc/data/CalculateService.java | 2 +- 3 files changed, 34 insertions(+), 36 deletions(-) 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 effa53598..049a3f9de 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 @@ -1125,41 +1125,43 @@ public class InterlockBuilder2 { private static void buildRoutePathFromStationRunLevel(MapCiGenerateConfig generateConfig, List stationRunLevelList, SimulationBuilder.SimulationDeviceBuildResult buildResult, List errMsgList) { +// long s = System.currentTimeMillis(); +// Map> routePathMap = buildResult.getRoutePathMap(); +// Map deviceMap = buildResult.getDeviceMap(); +// if (generateConfig != null && generateConfig.isRailway()) { +// List
sections = deviceMap.values().stream() +// .filter(device -> device instanceof Section) +// .map(device -> (Section) device) +// .filter(Section::isFunctionTrack) +// .collect(Collectors.toList()); +// for (int i = 0; i < sections.size(); i++) { +// Section start = sections.get(i); +// for (int j = 0; j < sections.size() && i != j; j++) { +// Section end = sections.get(j); +// List routePaths = CalculateService.queryRoutePathsOnDirection(start, end, true, 100); +// if (!CollectionUtils.isEmpty(routePaths)) { +// routePathMap.put(routePaths.get(0).getKey(), routePaths); +// } +// } +// } +// } +// System.out.println("无脑构建进路路径耗时:" + (System.currentTimeMillis() - s)); + Map> routePathMap = buildResult.getRoutePathMap(); - Map deviceMap = buildResult.getDeviceMap(); - if (generateConfig != null && generateConfig.isRailway()) { - List
sections = deviceMap.values().stream() - .filter(device -> device instanceof Section) - .map(device -> (Section) device) - .filter(Section::isFunctionTrack) - .collect(Collectors.toList()); - for (int i = 0; i < sections.size(); i++) { - Section start = sections.get(i); - for (int j = 0; j < sections.size() && i != j; j++) { - Section end = sections.get(j); - List routePaths = CalculateService.queryRoutePathsOnDirection(start, end, true, 100); - if (!CollectionUtils.isEmpty(routePaths)) { - routePathMap.put(routePaths.get(0).getKey(), routePaths); - } + if (!CollectionUtils.isEmpty(stationRunLevelList)) { + for (StationRunLevel runLevel : stationRunLevelList) { + Section startSection = runLevel.getStartSection(); + Section endSection = runLevel.getEndSection(); + boolean right = runLevel.isRight(); + List routePaths = CalculateService.queryRoutePathsOnDirection(startSection, endSection, right, 10); + if (CollectionUtils.isEmpty(routePaths)) { + errMsgList.add(String.format("站间运行等级[%s]无法找到路径", + runLevel.debugStr(), startSection.debugStr(), endSection.debugStr())); + } else { + routePathMap.put(routePaths.get(0).getKey(), routePaths); } } } - if (CollectionUtils.isEmpty(stationRunLevelList)) { - return; - } - for (StationRunLevel runLevel : stationRunLevelList) { - Section startSection = runLevel.getStartSection(); - Section endSection = runLevel.getEndSection(); - boolean right = runLevel.isRight(); - List routePaths = CalculateService.queryRoutePathsOnDirection(startSection, endSection, right, 10); - if (CollectionUtils.isEmpty(routePaths)) { - errMsgList.add(String.format("站间运行等级[%s]无法找到路径", - runLevel.debugStr(), startSection.debugStr(), endSection.debugStr())); - } else { - 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()); diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/build/SimulationBuilder.java b/src/main/java/club/joylink/rtss/simulation/cbtc/build/SimulationBuilder.java index 47db31510..6b6d260ea 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/build/SimulationBuilder.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/build/SimulationBuilder.java @@ -100,13 +100,9 @@ public class SimulationBuilder { loadDepotInOutRoutePath(simulation); // CTC行车日志数据结构构建 if (simulation.getRepository().getConfig().isHasCTC()) { - LocalDateTime now = LocalDateTime.now(); - System.out.println("CTC行车日志耗时:" + Duration.between(now, LocalDateTime.now()).getSeconds()); buildCtcRailwayInfo(simulation); buildCtcStationRunPlanLog(simulation); - now = LocalDateTime.now(); generateRouteSequence(simulation); - System.out.println("CTC进路序列耗时:" + Duration.between(now, LocalDateTime.now()).getSeconds()); } return simulation; } diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/data/CalculateService.java b/src/main/java/club/joylink/rtss/simulation/cbtc/data/CalculateService.java index cccaf34fd..181343dfd 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/data/CalculateService.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/data/CalculateService.java @@ -650,7 +650,7 @@ public class CalculateService { for (RoutePath path : list) { path.calculateDistance(); path.calculateSwitchCount(); - log.debug(path.debugStr2()); +// log.debug(path.debugStr2()); } } else { log.debug(String.format("进路路径[%s]未找到:[%s]",