Skip to content

Commit 756922f

Browse files
committed
core: allow braking curve to go beyond path end
Signed-off-by: Erashin <[email protected]>
1 parent 3d1d563 commit 756922f

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

core/envelope-sim/src/main/kotlin/fr/sncf/osrd/envelope_sim/etcs/ETCSBrakingCurves.kt

+4-6
Original file line numberDiff line numberDiff line change
@@ -116,14 +116,12 @@ private fun computeBrakingCurve(
116116
targetSpeed: Double,
117117
brakingType: BrakingType
118118
): EnvelopePart {
119-
// if the stopPosition is below zero, or above path length, the input is invalid
120-
if (targetPosition <= 0.0 || targetPosition > context.path.length)
119+
// If the stopPosition is below zero, the input is invalid
120+
if (targetPosition <= 0.0)
121121
throw RuntimeException(
122122
String.format(
123-
"Trying to compute ETCS braking curve from out of bounds ERTMS marker board (position = %f," +
124-
"path length = %f)",
125-
targetPosition,
126-
context.path.length
123+
"Trying to compute ETCS braking curve from out of bounds ERTMS end/limit of authority: %s",
124+
targetPosition
127125
)
128126
)
129127
val partBuilder = EnvelopePartBuilder()

0 commit comments

Comments
 (0)