From 3cd7d4f58dc4f457f23b1a544ebcaf220d60ffe6 Mon Sep 17 00:00:00 2001 From: joylink_zhangsai <1021828630@qq.com> Date: Fri, 11 Dec 2020 11:07:48 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E8=81=94=E9=94=81=E7=94=9F=E6=88=90?= =?UTF-8?q?=E8=BF=9B=E8=B7=AFbug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rtss/services/draftData/DraftMapCiDataGeneratorImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/club/joylink/rtss/services/draftData/DraftMapCiDataGeneratorImpl.java b/src/main/java/club/joylink/rtss/services/draftData/DraftMapCiDataGeneratorImpl.java index aab41ce71..583e37fc2 100644 --- a/src/main/java/club/joylink/rtss/services/draftData/DraftMapCiDataGeneratorImpl.java +++ b/src/main/java/club/joylink/rtss/services/draftData/DraftMapCiDataGeneratorImpl.java @@ -453,7 +453,7 @@ public class DraftMapCiDataGeneratorImpl implements DraftMapCiDataGenerator { clickEnd = this.queryNearlySignalOf(start, sectionPath); } // 构建进路 - if (config.isRouteApartByOverlap() && overlapList.size() > 1) { + if (config.isRouteApartByOverlap() && overlapList != null && overlapList.size() > 1) { int index = 1; for (RouteOverlap routeOverlap : overlapList) { String code = routeCodeGenerator.next(); From 9911d0e109c2418b7c2ac80d9ea5a25725ff08c0 Mon Sep 17 00:00:00 2001 From: joylink_zhangsai <1021828630@qq.com> Date: Fri, 11 Dec 2020 13:37:38 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E8=BF=90=E8=A1=8C=E5=9B=BE=E5=8A=A0?= =?UTF-8?q?=E8=BD=BD=E8=AE=A1=E5=88=92=E6=9F=A5=E8=AF=A2bug=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/club/joylink/rtss/services/LoadPlanService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/club/joylink/rtss/services/LoadPlanService.java b/src/main/java/club/joylink/rtss/services/LoadPlanService.java index d8c4daa40..1ae3f91a6 100644 --- a/src/main/java/club/joylink/rtss/services/LoadPlanService.java +++ b/src/main/java/club/joylink/rtss/services/LoadPlanService.java @@ -136,7 +136,7 @@ public class LoadPlanService implements ILoadPlanService { @Override public PageVO queryPagedLoadPlan(RunPlanLoadQueryVO queryVO) { RunPlanLoadExample runPlanLoadExample = new RunPlanLoadExample(); - runPlanLoadExample.setOrderByClause(" load_time DESC"); + runPlanLoadExample.setOrderByClause(" load_time DESC, id"); RunPlanLoadExample.Criteria loadExampleCriteria = runPlanLoadExample.createCriteria(); if (Objects.nonNull(queryVO.getUserId())) { loadExampleCriteria.andUserIdEqualTo(queryVO.getUserId()); From ba2d75c0c04446fcaee585315d57eaab4b3e6aa8 Mon Sep 17 00:00:00 2001 From: joylink_zhangsai <1021828630@qq.com> Date: Fri, 11 Dec 2020 15:31:45 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cbtc/ATS/service/AtsRouteSettingService.java | 9 +++++++++ .../joylink/rtss/simulation/cbtc/data/map/MapConfig.java | 6 ++++++ .../joylink/rtss/vo/client/map/RealLineConfigVO.java | 5 +++++ 3 files changed, 20 insertions(+) diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/AtsRouteSettingService.java b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/AtsRouteSettingService.java index 9057390ef..947833fd1 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/AtsRouteSettingService.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/AtsRouteSettingService.java @@ -20,6 +20,7 @@ import org.springframework.util.CollectionUtils; import java.time.LocalDateTime; import java.util.*; +import java.util.stream.Collectors; @Slf4j @Component @@ -35,6 +36,14 @@ public class AtsRouteSettingService { //根据一定规则清除掉冲突进路 this.filterConflictTrainRouteByPlanTime(simulation, waitSetList); + //如果进路区段有占用时不排列进路,筛选出没有区段占用的进路 + if (simulation.getRepository().getConfig().isDoNotSetRouteWhenSectionOccupied()) { + waitSetList = waitSetList.stream().filter(trainRoute -> { + Route route = trainRoute.getRoute(); + return route.getSectionList().stream().noneMatch(section -> section.isCtOccupied() || section.isNctOccupied()); + }).collect(Collectors.toList()); + } + // 执行进路排列 for (TrainRoute trainRoute : waitSetList) { Route route = trainRoute.getRoute(); diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/MapConfig.java b/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/MapConfig.java index f00ebf26c..866ae18e4 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/MapConfig.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/MapConfig.java @@ -131,6 +131,11 @@ public class MapConfig { */ private float urmAtpSpeed; + /** + * 当进路的区段占用时不排列进路 + */ + private boolean doNotSetRouteWhenSectionOccupied; + private Set needConfirmConnectMembers = Stream.of(DISPATCHER, STATION_SUPERVISOR, MAINTAINER, ELECTRIC_DISPATCHER).collect(Collectors.toSet()); @@ -158,6 +163,7 @@ public class MapConfig { setParkingSM(configVO.getParkingSM()); setRmAtpSpeed(configVO.getRmAtpSpeed() / 3.6f); setUrmAtpSpeed(configVO.getUrmAtpSpeed() / 3.6f); + setDoNotSetRouteWhenSectionOccupied(configVO.isDoNotSetRouteWhenSectionOccupied()); } } diff --git a/src/main/java/club/joylink/rtss/vo/client/map/RealLineConfigVO.java b/src/main/java/club/joylink/rtss/vo/client/map/RealLineConfigVO.java index ae8998aed..8e9a68d11 100644 --- a/src/main/java/club/joylink/rtss/vo/client/map/RealLineConfigVO.java +++ b/src/main/java/club/joylink/rtss/vo/client/map/RealLineConfigVO.java @@ -70,6 +70,11 @@ public class RealLineConfigVO { */ private boolean initSingleLockSwitch = false; + /** + * 当进路的区段占用时不排列进路 + */ + private boolean doNotSetRouteWhenSectionOccupied = false; + public static RealLineConfigVO parseJsonStr(String configData) { if (StringUtils.hasText(configData)) { return JsonUtils.read(configData, RealLineConfigVO.class);