Merge remote-tracking branch 'origin/test' into test

This commit is contained in:
walker-sheng 2021-03-16 13:30:44 +08:00
commit c521b9dcd6

View File

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