添加检查站台状态以取消列车扣车状态的循环逻辑

This commit is contained in:
thesai 2021-03-18 18:58:31 +08:00
parent 8adda9b160
commit 0f81295f3f
2 changed files with 4 additions and 1 deletions

View File

@ -52,6 +52,9 @@ public class ATSLogicLoop {
this.atsStandService.countDown(simulation);
// 车站随时间变化的属性更新
this.atsStationService.updateField(simulation);
// 如果站台没有扣车取消列车的扣车状态
simulation.getRepository().getStandList().stream().filter(stand -> !stand.isHoldTrain())
.forEach(stand -> atsStandService.checkAndCancelTrainHold(simulation, stand));
// long end = System.currentTimeMillis();
// System.out.println(String.format("------------ATS自动排列进路逻辑耗时: %s ms", (end-start)));
}

View File

@ -384,7 +384,7 @@ public class AtsStandService {
}
}
private void checkAndCancelTrainHold(Simulation simulation, Stand stand) {
public void checkAndCancelTrainHold(Simulation simulation, Stand stand) {
if (!stand.isHoldTrain()) {
// 先默认CBTC模式取消扣车发送给列车
List<TrainInfo> superviseTrainList = simulation.getRepository().getSuperviseTrainList();