删除查询进路路径方法中,虚拟信号机下的进路只有一条的断言和逻辑

This commit is contained in:
thesai 2021-11-22 09:36:06 +08:00
parent 4ab64ffe1b
commit 6b16dc6fb4

View File

@ -755,22 +755,22 @@ public class CalculateService {
if (!CollectionUtils.isEmpty(routeList)) {
// 进路
boolean find = false;
if (signal.isVirtual()) { // 虚拟信号机应该只有一条进路
BusinessExceptionAssertEnum.SYSTEM_EXCEPTION.assertTrue(routeList.size() == 1);
Route route = routeList.get(0);
routePath.addRoute(route);
List<Section> sectionList = route.getSectionList();
int i = sectionList.indexOf(end);
if (i >= 0) {
// 找到
routePath.addSections(sectionList.subList(0, i));
list.add(routePath);
} else {
routePath.addSections(sectionList);
queryRoutePaths(iter + 1, iterTimes, route.getLastRouteSection(), routePath, list, warnList);
}
return;
}
// if (signal.isVirtual()) { // 虚拟信号机应该只有一条进路
// BusinessExceptionAssertEnum.SYSTEM_EXCEPTION.assertTrue(routeList.size() == 1);
// Route route = routeList.get(0);
// routePath.addRoute(route);
// List<Section> sectionList = route.getSectionList();
// int i = sectionList.indexOf(end);
// if (i >= 0) {
// // 找到
// routePath.addSections(sectionList.subList(0, i));
// list.add(routePath);
// } else {
// routePath.addSections(sectionList);0
// queryRoutePaths(iter + 1, iterTimes, route.getLastRouteSection(), routePath, list, warnList);
// }
// return;
// }
Map<Section, List<Route>> routeMap = new HashMap<>(); // 进路终端对应进路列表(ATP进路合并进正常进路终端)
routeList.sort(Comparator.comparing(Route::isAtp)); // 将ATP进路排在最后处理
for (Route route : routeList) {