From eb478783f0f4401badd42aae6458c8cdc516925e Mon Sep 17 00:00:00 2001 From: Eloi Charpentier Date: Fri, 20 Dec 2024 11:54:42 +0100 Subject: [PATCH] core: stdcm: add comment to clarify earliest conflict operation Signed-off-by: Eloi Charpentier --- core/src/main/kotlin/fr/sncf/osrd/stdcm/graph/TimeData.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/src/main/kotlin/fr/sncf/osrd/stdcm/graph/TimeData.kt b/core/src/main/kotlin/fr/sncf/osrd/stdcm/graph/TimeData.kt index f033df64176..9dd2ff50919 100644 --- a/core/src/main/kotlin/fr/sncf/osrd/stdcm/graph/TimeData.kt +++ b/core/src/main/kotlin/fr/sncf/osrd/stdcm/graph/TimeData.kt @@ -90,8 +90,13 @@ data class TimeData( val nextEarliestReachableTime = earliestReachableTime + extraTravelTime + (extraStopTime ?: 0.0) var timeOfNextConflict = timeOfNextConflictAtLocation - if (maxAdditionalStopTime != null) + if (maxAdditionalStopTime != null) { + // We could have added a `min(timeOfNextConflict, ...)`, + // but we're specifically not interested in what happens before + // the stop. Engineering margins and other delay constraints + // would stop at the stop and ignore anything before. timeOfNextConflict = nextEarliestReachableTime + maxAdditionalStopTime + } if (extraStopTime != null) { val stopDataCopy = newStopData.toMutableList() stopDataCopy.add(