From 4a047f4cf2f8f858fa4b1f76d6bacd45083ec9c7 Mon Sep 17 00:00:00 2001 From: Max Kannenberg <95709892+MaxKannenberg@users.noreply.github.com> Date: Wed, 17 Aug 2022 22:30:32 +0200 Subject: [PATCH] Remove CharacteristicSections as return value from function 'calculateMinimumRunningTime' --- src/TrainRuns.jl | 2 +- src/calc.jl | 9 ++------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/TrainRuns.jl b/src/TrainRuns.jl index 5cf5801..98882bb 100644 --- a/src/TrainRuns.jl +++ b/src/TrainRuns.jl @@ -50,7 +50,7 @@ function trainrun(train::Train, path::Path, settings=Settings()::Settings) # TODO settings.outputDetail == :verbose && println("The characteristics haven been determined.") # calculate the train run with the minimum running time - (characteristicSections, drivingCourse) = calculateMinimumRunningTime!(characteristicSections, settings, train) + drivingCourse = calculateMinimumRunningTime(characteristicSections, settings, train) # TODO settings.outputDetail == :verbose && println("The driving course for the shortest running time has been calculated.") # accumulate data and create an output dictionary diff --git a/src/calc.jl b/src/calc.jl index e756332..0018e9b 100644 --- a/src/calc.jl +++ b/src/calc.jl @@ -7,12 +7,7 @@ # Calculate the running time of a train run on a path with special settings with information from the corresponding YAML files with the file paths `trainDirectory`, `pathDirectory`, `settingsDirectory`. # calculate a train run focussing on using the minimum possible running time -function calculateMinimumRunningTime!(CSs::Vector{Dict}, settings::Settings, train::Train) - - if settings.massModel == :homogeneous_strip && settings.stepVariable == speed - println("WARNING: ! ! ! TrainRuns.jl doesn't work reliably for the mass model homogeneous strip with step size v in m/s. The calculation time can be extremely high when calcutlating paths with steep gradients ! ! !") - end # TODO - +function calculateMinimumRunningTime(CSs::Vector{Dict}, settings::Settings, train::Train) startingPoint = SupportPoint() startingPoint[:i] = 1 startingPoint[:s] = CSs[1][:s_entry] @@ -119,7 +114,7 @@ function calculateMinimumRunningTime!(CSs::Vector{Dict}, settings::Settings, tra drivingCourse = addHalt!(drivingCourse, CSs, length(CSs), settings, train) - return (CSs, drivingCourse) + return drivingCourse end #function calculateMinimumRunningTime