修改非通信车占用区段
This commit is contained in:
parent
2ef600d906
commit
96ab9cd256
@ -4,6 +4,7 @@ import club.joylink.rtss.simulation.cbtc.CI.CiApiService;
|
||||
import club.joylink.rtss.simulation.cbtc.Simulation;
|
||||
import club.joylink.rtss.simulation.cbtc.data.CalculateService;
|
||||
import club.joylink.rtss.simulation.cbtc.data.SimulationDataRepository;
|
||||
import club.joylink.rtss.simulation.cbtc.data.map.MapConfig;
|
||||
import club.joylink.rtss.simulation.cbtc.data.map.Section;
|
||||
import club.joylink.rtss.simulation.cbtc.data.map.Signal;
|
||||
import club.joylink.rtss.simulation.cbtc.data.support.SectionPosition;
|
||||
@ -102,12 +103,14 @@ public class AtpSectionService {
|
||||
boolean right = train.isRight();
|
||||
SectionPosition trainHeadPosition = train.getHeadPosition();
|
||||
SimulationDataRepository repository = simulation.getRepository();
|
||||
MapConfig config = repository.getConfig();
|
||||
boolean switchSingleHandle = config.isSwitchSingleHandle();
|
||||
if (train.isCommunicable()) { // 通信车占用
|
||||
// 车尾位置追加不确定性距离:(速度*2)m
|
||||
SectionPosition trainTailPosition = CalculateService
|
||||
.calculateNextPositionByStartAndLen(trainHeadPosition, !right, train.getLen() + train.getSpeed()*2);
|
||||
.calculateNextPositionByStartAndLen(trainHeadPosition, !right, train.getLen() + train.getSpeed() * 2);
|
||||
atpSectionList = CalculateService.getAtpSections(trainHeadPosition, trainTailPosition,
|
||||
right, repository.getConfig().isSwitchSingleHandle());
|
||||
right, switchSingleHandle);
|
||||
List<Section> removes = new ArrayList<>();
|
||||
for (Section atpSection : atpSectionList) {
|
||||
Section axle = atpSection;
|
||||
@ -128,6 +131,11 @@ public class AtpSectionService {
|
||||
List<Section> sectionList = repository.queryTrainOccupySectionList(train.getGroupNumber());
|
||||
if (!CollectionUtils.isEmpty(sectionList)) {
|
||||
for (Section section : sectionList) {
|
||||
if (section.isSwitchAxleCounterSection()) {
|
||||
Section switchSection = section.getLogicList().get(0);
|
||||
atpSectionList.addAll(switchSection.getSwitchAxleSectionsBySwitchPosition());
|
||||
continue;
|
||||
}
|
||||
if (CollectionUtils.isEmpty(section.getLogicList())) {
|
||||
atpSectionList.add(section);
|
||||
} else {
|
||||
|
@ -346,15 +346,6 @@ public class SpeedCurve {
|
||||
base = base.getNextRunningSectionOf(right);
|
||||
}
|
||||
}
|
||||
// if (Objects.nonNull(endPosition)) {
|
||||
// Float distance = CalculateService.calculateDistance(headPosition, endPosition, right);
|
||||
// if (Objects.isNull(distance) || distance > totalLen) {
|
||||
// return buildTargetSpeedCurve(totalLen, v0, 0, limitSpeed);
|
||||
// } else {
|
||||
// return buildTargetSpeedCurve(distance, v0, vt, limitSpeed);
|
||||
// }
|
||||
// }
|
||||
// return buildTargetSpeedCurve(totalLen, v0, 0, limitSpeed);
|
||||
SpeedCurve normalSpeedCurve = buildTargetSpeedCurve(totalLen, v0, 0, limitSpeed);
|
||||
if (endPosition != null) {
|
||||
Float distance = CalculateService.calculateDistance(headPosition, endPosition, right);
|
||||
|
Loading…
Reference in New Issue
Block a user