大铁线路2增加进路路径生成逻辑(因为没有站间运行等级和交路数据)

This commit is contained in:
joylink_zhangsai 2022-04-26 14:19:55 +08:00
parent af36dd547d
commit 75fc0d0915
2 changed files with 44 additions and 14 deletions

View File

@ -251,7 +251,7 @@ public class InterlockBuilder2 {
// if (!errMsgList.isEmpty()) {
// return;
// }
InterlockBuilder2.buildRoutePathFromStationRunLevel(stationRunLevelList, mapDataBuildResult, errMsgList);
InterlockBuilder2.buildRoutePathFromStationRunLevel(map.getLineCode(), stationRunLevelList, mapDataBuildResult, errMsgList);
// buildParkTimes(logicData, elementMap, mapDataBuildResult.getParkTimeMap(), errMsgList);
}
@ -1044,23 +1044,25 @@ public class InterlockBuilder2 {
return stationRunLevelList;
}
private static void buildRoutePathFromStationRunLevel(List<StationRunLevel> stationRunLevelList,
private static void buildRoutePathFromStationRunLevel(String lineCode, List<StationRunLevel> stationRunLevelList,
SimulationBuilder.SimulationDeviceBuildResult buildResult,
List<String> errMsgList) {
Map<String, List<RoutePath>> routePathMap = buildResult.getRoutePathMap();
Map<String, MapElement> deviceMap = buildResult.getDeviceMap();
List<Section> 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<RoutePath> routePaths = CalculateService.queryRoutePathsOnDirection(start, end, true, 100);
if (!CollectionUtils.isEmpty(routePaths)) {
routePathMap.put(routePaths.get(0).getKey(), routePaths);
if (lineCode.equals("16")) {
List<Section> 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<RoutePath> routePaths = CalculateService.queryRoutePathsOnDirection(start, end, true, 100);
if (!CollectionUtils.isEmpty(routePaths)) {
routePathMap.put(routePaths.get(0).getKey(), routePaths);
}
}
}
}

View File

@ -0,0 +1,28 @@
package club.joylink.rtss.simulation.cbtc.data.plan;
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.Station;
import java.time.LocalTime;
/**
* 车站接发车计划
*/
public class StationPlan2 {
private TripPlan tripPlan;
private Station station;
private Plan receivingPlan;
private Plan departurePlan;
class Plan {
private LocalTime time;
private Section section;
private Route route;
}
}