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] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=85=8D=E7=BD=AE<=E5=BD=93?= =?UTF-8?q?=E8=BF=9B=E8=B7=AF=E7=9A=84=E5=8C=BA=E6=AE=B5=E5=8D=A0=E7=94=A8?= =?UTF-8?q?=E6=97=B6=E4=B8=8D=E6=8E=92=E5=88=97=E8=BF=9B=E8=B7=AF>?= 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);