@@ -45,41 +45,6 @@ fun computeMRSP(
45
45
rollingStock.getMaxSpeed(),
46
46
rollingStock.getLength(),
47
47
addRollingStockLength,
48
- ignoreInfraSpeedLimits = false ,
49
- trainTag,
50
- temporarySpeedLimitManager,
51
- safetySpeedRanges,
52
- )
53
- }
54
-
55
- /* *
56
- * Computes the MSRP for a rolling stock on a given path, taking into account the infrastructure speed limits.
57
- *
58
- * @param path corresponding path.
59
- * @param rsMaxSpeed rolling stock max speed (m/s)
60
- * @param rsLength length of the rolling stock (m)
61
- * @param addRollingStockLength whether the rolling stock length should be taken into account in the
62
- * computation.
63
- * @param trainTag corresponding train.
64
- * @param safetySpeedRanges Extra speed ranges, used for safety speeds. Note: rolling stock length
65
- * is *not* added at the end of these ranges.
66
- * @return the corresponding MRSP as an Envelope.
67
- */
68
- fun computeMRSP (
69
- path : PathProperties ,
70
- rsMaxSpeed : Double ,
71
- rsLength : Double ,
72
- addRollingStockLength : Boolean ,
73
- trainTag : String? ,
74
- temporarySpeedLimitManager : TemporarySpeedLimitManager ? ,
75
- safetySpeedRanges : DistanceRangeMap <Speed >? = null,
76
- ): Envelope {
77
- return computeMRSP(
78
- path,
79
- rsMaxSpeed,
80
- rsLength,
81
- addRollingStockLength,
82
- ignoreInfraSpeedLimits = false ,
83
48
trainTag,
84
49
temporarySpeedLimitManager,
85
50
safetySpeedRanges,
@@ -106,18 +71,17 @@ fun computeMRSP(
106
71
rsMaxSpeed : Double ,
107
72
rsLength : Double ,
108
73
addRollingStockLength : Boolean ,
109
- ignoreInfraSpeedLimits : Boolean ,
110
74
trainTag : String? ,
111
75
temporarySpeedLimitManager : TemporarySpeedLimitManager ? ,
112
76
safetySpeedRanges : DistanceRangeMap <Speed >? = null,
77
+ ignoreInfraSpeedLimits : Boolean = false,
113
78
): Envelope {
114
79
val builder = MRSPEnvelopeBuilder ()
115
80
val pathLength = toMeters(path.getLength())
116
81
117
82
val offset = if (addRollingStockLength) rsLength else 0.0
118
- val speedLimitProperties = distanceRangeMapOf< SpeedLimitProperty >( )
83
+ val speedLimitProperties = path.getSpeedLimitProperties(trainTag, temporarySpeedLimitManager )
119
84
if (! ignoreInfraSpeedLimits) { // if we take into account speedlimits coming from the infrastructure
120
- val speedLimitProperties = path.getSpeedLimitProperties(trainTag, temporarySpeedLimitManager)
121
85
for (speedLimitPropertyRange in speedLimitProperties) {
122
86
// Compute where this limit is active from and to
123
87
val start = toMeters(speedLimitPropertyRange.lower)
0 commit comments