添加配置<当进路的区段占用时不排列进路>

This commit is contained in:
joylink_zhangsai 2020-12-11 15:31:45 +08:00
parent 9911d0e109
commit ba2d75c0c0
3 changed files with 20 additions and 0 deletions

View File

@ -20,6 +20,7 @@ import org.springframework.util.CollectionUtils;
import java.time.LocalDateTime;
import java.util.*;
import java.util.stream.Collectors;
@Slf4j
@Component
@ -35,6 +36,14 @@ public class AtsRouteSettingService {
//根据一定规则清除掉冲突进路
this.filterConflictTrainRouteByPlanTime(simulation, waitSetList);
//如果进路区段有占用时不排列进路筛选出没有区段占用的进路
if (simulation.getRepository().getConfig().isDoNotSetRouteWhenSectionOccupied()) {
waitSetList = waitSetList.stream().filter(trainRoute -> {
Route route = trainRoute.getRoute();
return route.getSectionList().stream().noneMatch(section -> section.isCtOccupied() || section.isNctOccupied());
}).collect(Collectors.toList());
}
// 执行进路排列
for (TrainRoute trainRoute : waitSetList) {
Route route = trainRoute.getRoute();

View File

@ -131,6 +131,11 @@ public class MapConfig {
*/
private float urmAtpSpeed;
/**
* 当进路的区段占用时不排列进路
*/
private boolean doNotSetRouteWhenSectionOccupied;
private Set<SimulationMember.Type> needConfirmConnectMembers =
Stream.of(DISPATCHER, STATION_SUPERVISOR, MAINTAINER, ELECTRIC_DISPATCHER).collect(Collectors.toSet());
@ -158,6 +163,7 @@ public class MapConfig {
setParkingSM(configVO.getParkingSM());
setRmAtpSpeed(configVO.getRmAtpSpeed() / 3.6f);
setUrmAtpSpeed(configVO.getUrmAtpSpeed() / 3.6f);
setDoNotSetRouteWhenSectionOccupied(configVO.isDoNotSetRouteWhenSectionOccupied());
}
}

View File

@ -70,6 +70,11 @@ public class RealLineConfigVO {
*/
private boolean initSingleLockSwitch = false;
/**
* 当进路的区段占用时不排列进路
*/
private boolean doNotSetRouteWhenSectionOccupied = false;
public static RealLineConfigVO parseJsonStr(String configData) {
if (StringUtils.hasText(configData)) {
return JsonUtils.read(configData, RealLineConfigVO.class);