From 237729ce5b1efa5a1dadf5f77ae741daeec57919 Mon Sep 17 00:00:00 2001 From: Martin Scheidt Date: Thu, 21 Apr 2022 14:24:22 +0200 Subject: [PATCH] renamed calculateDrivingDynamics() in trainRun() --- README.md | 2 +- examples/ExtendedWorkingExample.jl | 2 +- examples/MinimalWorkingExample.jl | 2 +- src/TrainRun.jl | 2 +- src/TrainRunCalc.jl | 10 +++++----- test/runtests.jl | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index f03917a..88d15dc 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ running_path_directory = "data/paths/path_1_10km_nConst_vConst.yaml" settings_directory = "data/settings.yaml" (train, running_path, settings) = importYamlFiles(train_directory, running_path_directory, setting_directory) -train_run = calculateDrivingDynamics(train, running_path, settings) +train_run = trainRun(train, running_path, settings) ``` ------------ diff --git a/examples/ExtendedWorkingExample.jl b/examples/ExtendedWorkingExample.jl index 082249c..ebb68e3 100644 --- a/examples/ExtendedWorkingExample.jl +++ b/examples/ExtendedWorkingExample.jl @@ -28,7 +28,7 @@ for path in allPaths for train in allTrains # println("train: ", train[:name]) for settings in allSettings - resultsDict = calculateDrivingDynamics(train, path, settings) + resultsDict = trainRun(train, path, settings) if haskey(settings, :typeOfOutput) && settings[:typeOfOutput] == "CSV" exportToCsv(resultsDict, settings) sleep(2) diff --git a/examples/MinimalWorkingExample.jl b/examples/MinimalWorkingExample.jl index c197589..47382f5 100644 --- a/examples/MinimalWorkingExample.jl +++ b/examples/MinimalWorkingExample.jl @@ -13,7 +13,7 @@ running_path_directory = "data/paths/path_1_10km_nConst_vConst.yaml" setting_directory = "data/settings/settings_distanceStep_massPoint_runningTime.yaml" (train, running_path, settings) = importYamlFiles(train_directory, running_path_directory, setting_directory) -runtime = calculateDrivingDynamics(train, running_path, settings) +runtime = trainRun(train, running_path, settings) exportToCsv(runtime, settings) println("The V 90 with 10 ore wagons needs $runtime seconds for 10 km with no gradient.") diff --git a/src/TrainRun.jl b/src/TrainRun.jl index c811985..aaf7f2f 100644 --- a/src/TrainRun.jl +++ b/src/TrainRun.jl @@ -30,7 +30,7 @@ using .AdditionalOutput using .EnergySaving # main function -export calculateDrivingDynamics, +export trainRun, # import functions importYamlFiles, importFromYaml, diff --git a/src/TrainRunCalc.jl b/src/TrainRunCalc.jl index 41fe7c4..6e980e8 100644 --- a/src/TrainRunCalc.jl +++ b/src/TrainRunCalc.jl @@ -21,7 +21,7 @@ using .Behavior using .Output # export main function -export calculateDrivingDynamics +export trainRun approximationLevel = 6 # value for approximation to intersections and precisely calculated digits # TODO: define it here and give it to each function? (Behavior, ...) @@ -29,17 +29,17 @@ approximationLevel = 6 # value for approximation to intersections and precisely # Calculate the driving dynamics of a train run on a path with special settings with information from the corresponding YAML files with the file paths `trainDirectory`, `pathDirectory`, `settingsDirectory`. """ - calculateDrivingDynamics(train::Dict, path::Dict, settings::Dict) + trainRun(train::Dict, path::Dict, settings::Dict) Calculate the driving dynamics of a train run on a path with special settings with information from the corresponding dictionaries `train`, `path`, `settings`. # Examples ```julia-repl -julia> calculateDrivingDynamics(trainDict, pathDict, settingsDict) +julia> trainRun(trainDict, pathDict, settingsDict) todo !!! ``` """ -function calculateDrivingDynamics(trainInput::Dict, pathInput::Dict, settingsInput::Dict) +function trainRun(trainInput::Dict, pathInput::Dict, settingsInput::Dict) # copy Input data for not changing them # TODO: or should they be changed? normally it would only make it "better" except for settings[:detailOfOutput] == "points of interest" && !haskey(path, :pointsOfInterest) train = copy(trainInput) @@ -68,7 +68,7 @@ function calculateDrivingDynamics(trainInput::Dict, pathInput::Dict, settingsInp end #if return output -end # function calculateDrivingDynamics +end # function trainRun # calculate a train run focussing on using the minimum possible running time function calculateMinimumRunningTime!(movingSection::Dict, settings::Dict, train::Dict) diff --git a/test/runtests.jl b/test/runtests.jl index f0b6d63..5e98cc6 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -25,7 +25,7 @@ push!(allTrains, importYamlFile(:train, "data/trains/train_passenger_IC2.yaml")) for path in allPaths for train in allTrains for settings in allSettings - testDict=calculateDrivingDynamics(train, path, settings) + testDict=trainRun(train, path, settings) exportToCsv(testDict) sleep(2)