转换轨相邻车站交路生成修改

This commit is contained in:
DU 2021-03-15 17:03:40 +08:00
parent d3f45b1b5e
commit 6cdc61151e

View File

@ -759,23 +759,69 @@ public class DraftMapCiDataGeneratorImpl implements DraftMapCiDataGenerator {
if (Math.abs(start.getStation().getSn() - end.getStation().getSn()) == 1) { if (Math.abs(start.getStation().getSn() - end.getStation().getSn()) == 1) {
if (this.canArriveNearby(start, end, right)) { if (this.canArriveNearby(start, end, right)) {
// 相邻车站起始是转换轨且终点是正常站台轨或特殊站台无正常站台轨且不是停车场的车站 // 相邻车站起始是转换轨且终点是正常站台轨或特殊站台无正常站台轨且不是停车场的车站
if ((start.isTransferTrack() && (end.isNormalStandTrack() || end.getStation().isNoDepotAndNoNormalStand())) // if ((start.isTransferTrack() && (end.isNormalStandTrack() || end.getStation().isNoDepotAndNoNormalStand()))
|| ((start.isNormalStandTrack() || start.getStation().isNoDepotAndNoNormalStand()) && end.isTransferTrack())) { // || ((start.isNormalStandTrack() || start.getStation().isNoDepotAndNoNormalStand()) && end.isTransferTrack())) {
// paths.add(end);
// pathsList.add(paths);
// return;
// }
if(start.isTransferTrack()){
if(end.isNormalStandTrack() || end.getStation().isNoDepotAndNoNormalStand()){
paths.add(end); paths.add(end);
pathsList.add(paths); pathsList.add(paths);
return; return;
} }
Signal signal = start.querySignalOnDirectionConsiderSectionType(right);
this.queryNormalStandTracksOnDirectionFromSignal(signal, right, nstdList);
if(nstdList.size()==0){
paths.add(end);
pathsList.add(paths);
return;
}
if(nstdList.size()==1){
if (!this.canArriveNearby(nstdList.get(0), end, right)){
paths.add(end);
pathsList.add(paths);
return;
}
}
}
if(end.isTransferTrack()){
if(start.isNormalStandTrack() || start.getStation().isNoDepotAndNoNormalStand()){
paths.add(end);
pathsList.add(paths);
return;
}
Signal signal = start.querySignalOnDirectionConsiderSectionType(right);
this.queryNormalStandTracksOnDirectionFromSignal(signal, right, nstdList);
if(nstdList.size()==0){
paths.add(end);
pathsList.add(paths);
return;
}
if(nstdList.size()==1){
if (!this.canArriveNearby(nstdList.get(0), end, right)){
paths.add(end);
pathsList.add(paths);
return;
}
}
}
} else { // 相邻站不能到达的直接返回 } else { // 相邻站不能到达的直接返回
return; return;
} }
} }
// 起始查询 // 起始查询
if(CollectionUtils.isEmpty(nstdList)){
Signal signal = start.querySignalOnDirectionConsiderSectionType(right); Signal signal = start.querySignalOnDirectionConsiderSectionType(right);
this.queryNormalStandTracksOnDirectionFromSignal(signal, right, nstdList); this.queryNormalStandTracksOnDirectionFromSignal(signal, right, nstdList);
}
if (CollectionUtils.isEmpty(nstdList)) { if (CollectionUtils.isEmpty(nstdList)) {
// 未找到如果是折返轨/转换轨反向尝试 // 未找到如果是折返轨/转换轨反向尝试
if ((start.isTurnBackTrack() || start.isTransferTrack()) && !start.isNormalStandTrack()) { if ((start.isTurnBackTrack() || start.isTransferTrack()) && !start.isNormalStandTrack()) {
signal = start.getSignalOf(!right); Signal signal = start.getSignalOf(!right);
this.queryNormalStandTracksOnDirectionFromSignal(signal, right, nstdList); this.queryNormalStandTracksOnDirectionFromSignal(signal, right, nstdList);
} }
} }