From 395b7eb11c051396573ecfb9dd12711aea80bfd5 Mon Sep 17 00:00:00 2001 From: Max Kannenberg <95709892+MaxKannenberg@users.noreply.github.com> Date: Fri, 12 Aug 2022 13:24:27 +0200 Subject: [PATCH] Add rounding up at the CS's end if difference is beyond accuracy level --- src/calc.jl | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/calc.jl b/src/calc.jl index 2824f1b..c97d744 100644 --- a/src/calc.jl +++ b/src/calc.jl @@ -99,6 +99,13 @@ function calculateMinimumRunningTime!(CSs::Vector{Dict}, settings::Settings, tra #else # error() end + + if CS[:s_exit] - drivingCourse[end][:s] < 1/10^(settings.approxLevel) + drivingCourse[end][:s] = CS[:s_exit] # round s up to CS[:s_exit] + + # set state flag + stateFlags[:endOfCSReached] = true + end end #if s == s_exit # halt