@@ -30,6 +30,8 @@ import kotlin.math.min
30
30
* @param addRollingStockLength whether the rolling stock length should be taken into account in the
31
31
* computation.
32
32
* @param trainTag corresponding train.
33
+ * @param useInfraSpeedLimits whether the speed limits coming from the infrastructure should be
34
+ * taken into account in the computation
33
35
* @return the corresponding MRSP as an Envelope.
34
36
*/
35
37
fun computeMRSP (
@@ -39,6 +41,7 @@ fun computeMRSP(
39
41
trainTag : String? ,
40
42
temporarySpeedLimitManager : TemporarySpeedLimitManager ? ,
41
43
safetySpeedRanges : DistanceRangeMap <Speed >? = null,
44
+ useInfraSpeedLimits : Boolean = true,
42
45
): Envelope {
43
46
return computeMRSP(
44
47
path,
@@ -48,6 +51,7 @@ fun computeMRSP(
48
51
trainTag,
49
52
temporarySpeedLimitManager,
50
53
safetySpeedRanges,
54
+ useInfraSpeedLimits,
51
55
)
52
56
}
53
57
@@ -62,6 +66,8 @@ fun computeMRSP(
62
66
* @param trainTag corresponding train.
63
67
* @param safetySpeedRanges Extra speed ranges, used for safety speeds. Note: rolling stock length
64
68
* is *not* added at the end of these ranges.
69
+ * @param useInfraSpeedLimits whether the speed limits coming from the infrastructure should be
70
+ * taken into account in the computation
65
71
* @return the corresponding MRSP as an Envelope.
66
72
*/
67
73
fun computeMRSP (
@@ -72,12 +78,15 @@ fun computeMRSP(
72
78
trainTag : String? ,
73
79
temporarySpeedLimitManager : TemporarySpeedLimitManager ? ,
74
80
safetySpeedRanges : DistanceRangeMap <Speed >? = null,
81
+ useInfraSpeedLimits : Boolean = true,
75
82
): Envelope {
76
83
val builder = MRSPEnvelopeBuilder ()
77
84
val pathLength = toMeters(path.getLength())
78
85
79
86
val offset = if (addRollingStockLength) rsLength else 0.0
80
- val speedLimitProperties = path.getSpeedLimitProperties(trainTag, temporarySpeedLimitManager)
87
+ val speedLimitProperties =
88
+ if (useInfraSpeedLimits) path.getSpeedLimitProperties(trainTag, temporarySpeedLimitManager)
89
+ else distanceRangeMapOf<SpeedLimitProperty >()
81
90
for (speedLimitPropertyRange in speedLimitProperties) {
82
91
// Compute where this limit is active from and to
83
92
val start = toMeters(speedLimitPropertyRange.lower)
@@ -117,7 +126,7 @@ fun computeMRSP(
117
126
)
118
127
119
128
// Add safety speeds
120
- if (safetySpeedRanges != null ) {
129
+ if (useInfraSpeedLimits && safetySpeedRanges != null ) {
121
130
for (range in safetySpeedRanges) {
122
131
val speed = range.value
123
132
val newAttrs =
0 commit comments