diff --git a/src/main/java/club/joylink/rtss/vo/training2/rule/BgSceneStatusRule.java b/src/main/java/club/joylink/rtss/vo/training2/rule/BgSceneStatusRule.java index 7c972812c..5ddf61bbc 100644 --- a/src/main/java/club/joylink/rtss/vo/training2/rule/BgSceneStatusRule.java +++ b/src/main/java/club/joylink/rtss/vo/training2/rule/BgSceneStatusRule.java @@ -214,7 +214,7 @@ public enum BgSceneStatusRule { public String doHandle(Simulation simulation, MapElement mapElement) { Signal signal = (Signal) mapElement; Route route = signal.getRouteList().stream() - .filter(r -> r.getSwitchList().stream().allMatch(switchElement -> switchElement.isNormal())) + // .filter(r -> r.getSwitchList().stream().allMatch(switchElement -> switchElement.isNormal())) .findFirst().orElse(null); if (route == null) { throw new SimulationException(SimulationExceptionType.Simulation_Map_Data_Error); diff --git a/src/main/java/club/joylink/rtss/vo/training2/rule/MapDeviceRule.java b/src/main/java/club/joylink/rtss/vo/training2/rule/MapDeviceRule.java index 46e06508b..138791766 100644 --- a/src/main/java/club/joylink/rtss/vo/training2/rule/MapDeviceRule.java +++ b/src/main/java/club/joylink/rtss/vo/training2/rule/MapDeviceRule.java @@ -595,7 +595,13 @@ public enum MapDeviceRule { return route.getStart().isCallOn() && route.isGuide(); }), NUMBER); } - } + }, + ROUTE_DEPARTURE_LIST("发车进路列表") { + @Override + public List filterMapDeviceList(Simulation simulation) { + return generateRandomElement(queryNormalRouteList(simulation, route -> Objects.equals(Route.Type.DEPARTURE, route.getType())), NUMBER); + } + }, ; private String description; @@ -794,7 +800,7 @@ public enum MapDeviceRule { */ private static List queryNormalRouteList(Simulation simulation, Function filterFun) { return simulation.getRepository().getRouteList().stream().filter(route -> { - if (route.getInterlockStation().isDepot()) { // 停车场进路排除 + if (route.getInterlockStation() == null || route.getInterlockStation().isDepot()) { // 停车场进路排除 return false; } if (route.getStart() == null || route.getDestination() == null) {