Skip to content

Commit b29487e

Browse files
author
Alex Rolland
committed
core: fix tests
Signed-off-by: Alex Rolland <alex.rolland@reseau.sncf.fr>
1 parent dd7835a commit b29487e

File tree

1 file changed

+2
-38
lines changed
  • core/src/main/kotlin/fr/sncf/osrd/envelope_sim_infra

1 file changed

+2
-38
lines changed

core/src/main/kotlin/fr/sncf/osrd/envelope_sim_infra/MRSP.kt

+2-38
Original file line numberDiff line numberDiff line change
@@ -45,41 +45,6 @@ fun computeMRSP(
4545
rollingStock.getMaxSpeed(),
4646
rollingStock.getLength(),
4747
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,
8348
trainTag,
8449
temporarySpeedLimitManager,
8550
safetySpeedRanges,
@@ -106,18 +71,17 @@ fun computeMRSP(
10671
rsMaxSpeed: Double,
10772
rsLength: Double,
10873
addRollingStockLength: Boolean,
109-
ignoreInfraSpeedLimits: Boolean,
11074
trainTag: String?,
11175
temporarySpeedLimitManager: TemporarySpeedLimitManager?,
11276
safetySpeedRanges: DistanceRangeMap<Speed>? = null,
77+
ignoreInfraSpeedLimits: Boolean = false,
11378
): Envelope {
11479
val builder = MRSPEnvelopeBuilder()
11580
val pathLength = toMeters(path.getLength())
11681

11782
val offset = if (addRollingStockLength) rsLength else 0.0
118-
val speedLimitProperties = distanceRangeMapOf<SpeedLimitProperty>()
83+
val speedLimitProperties = path.getSpeedLimitProperties(trainTag, temporarySpeedLimitManager)
11984
if (!ignoreInfraSpeedLimits) { //if we take into account speedlimits coming from the infrastructure
120-
val speedLimitProperties = path.getSpeedLimitProperties(trainTag, temporarySpeedLimitManager)
12185
for (speedLimitPropertyRange in speedLimitProperties) {
12286
// Compute where this limit is active from and to
12387
val start = toMeters(speedLimitPropertyRange.lower)

0 commit comments

Comments
 (0)