From 549e1ef0585c389369971e64c710248112ba3d1e Mon Sep 17 00:00:00 2001 From: Jade Date: Wed, 8 Dec 2021 10:36:11 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=BD=A6=E8=BE=86=E6=AE=B5=E6=8E=92?= =?UTF-8?q?=E5=88=97=E8=BF=9B=E8=B7=AF=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../simulation/cbtc/depot/DepotService.java | 25 ++++++++++++------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/depot/DepotService.java b/src/main/java/club/joylink/rtss/simulation/cbtc/depot/DepotService.java index f0a28c8cf..8d91304bf 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/depot/DepotService.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/depot/DepotService.java @@ -7,6 +7,7 @@ import club.joylink.rtss.simulation.cbtc.constant.SimulationConstants; import club.joylink.rtss.simulation.cbtc.constant.SimulationModule; import club.joylink.rtss.simulation.cbtc.data.map.Route; import club.joylink.rtss.simulation.cbtc.data.map.Section; +import club.joylink.rtss.simulation.cbtc.data.map.Signal; import club.joylink.rtss.simulation.cbtc.data.map.Station; import club.joylink.rtss.simulation.cbtc.data.plan.SchedulingTrainPlan; import club.joylink.rtss.simulation.cbtc.data.support.RoutePath; @@ -69,6 +70,7 @@ public class DepotService { }); stationListMap.clear(); outboundPlanList.clear(); + inboundPlanList.clear(); simulation.getRepository().getSchedulingTrainPlanList().stream(). sorted(Comparator.comparing(schedulingTrainPlan -> schedulingTrainPlan.getOutDepotTrip().getStartTime().toSecondOfDay())) .forEach(schedulingTrainPlan -> { @@ -190,16 +192,21 @@ public class DepotService { return; } RoutePath routePath = routePaths.get(0); - for (Route route : routePath.getRouteList()) { - if (route.isSetting()) { - continue; - } - if (route.isLock()) { - continue; - } - ciRouteService.setRoute(simulation, route); - } Section lastSection = routePath.getEnd(); train.setRobotTargetPosition(new SectionPosition(lastSection, lastSection.getStopPointByDirection(routePath.isRight()))); + for (Signal signal : routePath.getSignalList()) { + for (Route route : signal.getRouteList()) { + if (routePath.getRouteList().contains(route)) { + if (route.isSetting()) { + return; + } + if (route.isLock()) { + break; + } + ciRouteService.setRoute(simulation, route); + return; + } + } + } } } From 2cad9aea1593eee770dc6d0106522d74fb86c5f7 Mon Sep 17 00:00:00 2001 From: Jade Date: Wed, 8 Dec 2021 10:57:35 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E8=BD=A6=E8=BE=86=E6=AE=B5fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../club/joylink/rtss/simulation/cbtc/depot/DepotService.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/depot/DepotService.java b/src/main/java/club/joylink/rtss/simulation/cbtc/depot/DepotService.java index 8d91304bf..e502933f9 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/depot/DepotService.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/depot/DepotService.java @@ -106,7 +106,8 @@ public class DepotService { LocalDateTime systemTime = simulation.getSystemTime(); stationListMap.forEach((section, list) -> { SchedulingTrainPlan schedulingTrainPlan = list.peek(); - if (schedulingTrainPlan.getOutDepotTrip().getStartTime().minusMinutes(10).isBefore(systemTime.toLocalTime())) { + if (!schedulingTrainPlan.getOutDepotTrip().isDeparture() + && schedulingTrainPlan.getOutDepotTrip().getStartTime().minusMinutes(10).isBefore(systemTime.toLocalTime())) { if (!outboundPlanList.contains(schedulingTrainPlan)) { outboundPlanList.add(schedulingTrainPlan); list.add(list.poll());