Merge remote-tracking branch 'origin/test' into test
This commit is contained in:
commit
e7114802cb
@ -1938,6 +1938,9 @@ public class DraftMapCiDataGeneratorImpl implements DraftMapCiDataGenerator {
|
||||
}
|
||||
if (Objects.isNull(section)) {
|
||||
// 找到尽头也没有构成进路,异常
|
||||
log.error(String.format("始端信号机[%s(%s)]:找到尽头也没有构成进路,所寻路径为[%s]",
|
||||
startSignal.getName(), startSignal.getCode(),
|
||||
tempPath.getSectionPathString()));
|
||||
errorList.add(String.format("始端信号机[%s(%s)]:找到尽头也没有构成进路,所寻路径为[%s]",
|
||||
startSignal.getName(), startSignal.getCode(),
|
||||
tempPath.getSectionPathString()));
|
||||
|
@ -86,7 +86,6 @@ public class RunPlanParktimeService implements IRunPlanParktimeService {
|
||||
example.createCriteria()
|
||||
.andMapIdEqualTo(parkingTimeVO.getMapId())
|
||||
.andUserIdEqualTo(parkingTimeVO.getUserId())
|
||||
.andStationCodeEqualTo(parkingTimeVO.getStationCode())
|
||||
.andSectionCodeEqualTo(parkingTimeVO.getSectionCode());
|
||||
if (this.parktimeDAO.countByExample(example) > 0) {
|
||||
return true;
|
||||
|
@ -768,7 +768,7 @@ public class RouteService {
|
||||
if (!CollectionUtils.isEmpty(standTracks)) {
|
||||
for (Section standTrack : standTracks) {
|
||||
List<Stand> standList = standTrack.getStandList();
|
||||
if (standList.stream().anyMatch(stand -> !stand.getPsd().isCloseAndLock()))
|
||||
if (standList.stream().anyMatch(stand -> stand.getPsd() != null && !stand.getPsd().isCloseAndLock()))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -639,11 +639,34 @@ public class CalculateService {
|
||||
|
||||
public static List<RoutePath> queryRoutePathsOnDirection(Section start, Section end, Boolean right) {
|
||||
List<RoutePath> list = new ArrayList<>();
|
||||
Signal signal;
|
||||
if (start.isSwitchTrack()) {
|
||||
signal = start.querySwitchSectionRelatedSignalByDirection(right);
|
||||
} else {
|
||||
signal = start.getSignalOf(right);
|
||||
Signal signal = null;
|
||||
// if (start.isSwitchTrack()) {
|
||||
// signal = start.querySwitchSectionRelatedSignalByDirection(right);
|
||||
// } else {
|
||||
// signal = start.getSignalOf(right);
|
||||
// }
|
||||
Section section = start;
|
||||
int rc = 0;
|
||||
while (signal == null && rc < 20) {
|
||||
++rc;
|
||||
if (section == null) {
|
||||
break;
|
||||
}
|
||||
signal = section.getSignalOf(right);
|
||||
if (signal != null) {
|
||||
break;
|
||||
}
|
||||
Section sectionOf = section.getSectionOf(!right);
|
||||
if (sectionOf != null) {
|
||||
section = sectionOf;
|
||||
} else if (sectionOf == null && section.isSwitchTrack()) {
|
||||
Switch relSwitch = section.getRelSwitch();
|
||||
if (relSwitch.isA(section)) {
|
||||
section = relSwitch.getB();
|
||||
} else {
|
||||
section = relSwitch.getA();
|
||||
}
|
||||
}
|
||||
}
|
||||
RoutePath routePath = new RoutePath(start, end, right);
|
||||
getRoutePaths(signal, right, end, 1, routePath, list);
|
||||
@ -655,7 +678,7 @@ public class CalculateService {
|
||||
if (Objects.isNull(signal)) {
|
||||
return;
|
||||
}
|
||||
if (iter > 8) {
|
||||
if (iter > 20) {
|
||||
return;
|
||||
}
|
||||
routePath.addSignal(signal);
|
||||
|
@ -219,14 +219,17 @@ public class ATPLogicLoop {
|
||||
case CLOSE_DOOR: // 关门
|
||||
Signal signal = train.getHeadPosition().getSection().getSignalOf(train.isRight());
|
||||
if (!train.isHold()) { // 列车未扣车
|
||||
if ((Objects.nonNull(signal) && signal.isNormalOpen()) ||
|
||||
(train.isRMMode() || train.isNRMMode())) { // 进路信号机正常开放 或 列车为RM/NRM
|
||||
// 可以关门
|
||||
this.ATOService.syncCloseDoor(simulation, train);
|
||||
if (this.isAllDoorClose(simulation, train)) {
|
||||
train.nextParkedTrainActivity();
|
||||
if (Objects.nonNull(signal) && !signal.isNormalOpen()) {
|
||||
if (!train.isRMMode() && !train.isNRMMode()) {
|
||||
// 信号机未正常开放
|
||||
break;
|
||||
}
|
||||
}
|
||||
// 可以关门
|
||||
this.ATOService.syncCloseDoor(simulation, train);
|
||||
if (this.isAllDoorClose(simulation, train)) {
|
||||
train.nextParkedTrainActivity();
|
||||
}
|
||||
}
|
||||
break;
|
||||
case START: // 准备出发
|
||||
@ -620,9 +623,8 @@ public class ATPLogicLoop {
|
||||
if (tailSection.isNormalStandTrack() &&
|
||||
Objects.equals(nextStation, tailSection.getStation())) {
|
||||
// 列车尾部在计划的下一站台轨
|
||||
Signal signal = tailSection.getSignalOf(right); // 出站信号机
|
||||
SectionPosition signalPosition = new SectionPosition(signal.getSection(), signal.getOffset());
|
||||
Float distance = CalculateService.calculateDistance(signalPosition, headPosition, right);
|
||||
SectionPosition standEndPosition = new SectionPosition(tailSection, right ? tailSection.getLen() : 0);
|
||||
Float distance = CalculateService.calculateDistance(standEndPosition, headPosition, right);
|
||||
if (Objects.nonNull(distance) && distance > 5) {
|
||||
// 列车成功越站
|
||||
this.atsApiService.handleTrainPassingStation(simulation, train.getGroupNumber(),
|
||||
|
@ -100,7 +100,9 @@ public class PassengerFlowSimulateService {
|
||||
if(Objects.isNull(group2mapPassengerFlowID.get(simulation.getGroup()))){
|
||||
//查询默认的数据
|
||||
passengerFlowData = this.mapPassengerFlowDataService.queryPassengerFlowDataOfMap(mapId,null);
|
||||
group2mapPassengerFlowID.put(simulation.getGroup(),passengerFlowData.getId());
|
||||
if (passengerFlowData != null) {
|
||||
group2mapPassengerFlowID.put(simulation.getGroup(),passengerFlowData.getId());
|
||||
}
|
||||
}else{
|
||||
//根据id查询数据
|
||||
passengerFlowData = this.mapPassengerFlowDataService.queryPassengerFlowDataOfMap(mapId,group2mapPassengerFlowID.get(simulation.getGroup()));
|
||||
|
@ -205,7 +205,7 @@ public interface IRunPlanStrategyNew {
|
||||
} else if (Objects.isNull(runPlanArrivalTime.getDepartureTime())) {
|
||||
runPlanArrivalTime.setDepartureTime(runPlanArrivalTime.getArriveTime());
|
||||
}
|
||||
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertTrue(runPlanArrivalTime.getArriveTime().isBefore(runPlanArrivalTime.getDepartureTime()),
|
||||
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertNotTrue(runPlanArrivalTime.getDepartureTime().isBefore(runPlanArrivalTime.getArriveTime()),
|
||||
String.format("数据异常:‘%s’到发时间异常", stationName));
|
||||
});
|
||||
// 按到达时间增序排序
|
||||
|
Loading…
Reference in New Issue
Block a user