客流策略计算bug修改

This commit is contained in:
walker-sheng 2021-03-19 18:26:55 +08:00
parent f56f08f0a3
commit 0553287cdb

View File

@ -169,7 +169,9 @@ public class ParkTimeStrategyServiceImpl implements StrategyService<ParkTimeStra
LocalTime arriveTime = stationPlan.getArriveTime();
LocalTime leaveTime = stationPlan.getLeaveTime();
// 列车到站乘客上车更新列车上人数
StandPassenger standPassenger = data.getStandPassengerByStand(stationPlan.getSection().getStandList().get(0));
List<Stand> standList = stationPlan.getSection().getStandList();
if (!CollectionUtils.isEmpty(standList)) {
StandPassenger standPassenger = data.getStandPassengerByStand(standList.get(0));
int wait = standPassenger.getWait(); // 站台等待乘客数
int normal = (parkTime - Config.INVALID_BOARD_TIME) * Config.PASSENGER_BOARD_SPEED; // 根据停站预测的可上车人数
int remain = Config.TRAIN_CAPACITY - trainPassenger.getNum(); // 列车上剩余可载人数
@ -200,6 +202,7 @@ public class ParkTimeStrategyServiceImpl implements StrategyService<ParkTimeStra
float min = Math.min(Math.min(wait, normal), remain); // 实际上车人数
standPassenger.minus(min);
trainPassenger.plus(min);
}
// 生成预测实际运行图
RealRun leave = this.buildRealRun(trainPassenger.getGroupNumber(), tripPlan, stationPlan, false, leaveTime, offsetTime, data.getSystemTime());
data.addRealRun(leave);