renamed calculateDrivingDynamics() in trainRun()

development
Martin Scheidt 2022-04-21 14:24:22 +02:00
parent 01c1751001
commit 237729ce5b
6 changed files with 10 additions and 10 deletions

View File

@ -34,7 +34,7 @@ running_path_directory = "data/paths/path_1_10km_nConst_vConst.yaml"
settings_directory = "data/settings.yaml" settings_directory = "data/settings.yaml"
(train, running_path, settings) = importYamlFiles(train_directory, running_path_directory, setting_directory) (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)
``` ```
------------ ------------

View File

@ -28,7 +28,7 @@ for path in allPaths
for train in allTrains for train in allTrains
# println("train: ", train[:name]) # println("train: ", train[:name])
for settings in allSettings for settings in allSettings
resultsDict = calculateDrivingDynamics(train, path, settings) resultsDict = trainRun(train, path, settings)
if haskey(settings, :typeOfOutput) && settings[:typeOfOutput] == "CSV" if haskey(settings, :typeOfOutput) && settings[:typeOfOutput] == "CSV"
exportToCsv(resultsDict, settings) exportToCsv(resultsDict, settings)
sleep(2) sleep(2)

View File

@ -13,7 +13,7 @@ running_path_directory = "data/paths/path_1_10km_nConst_vConst.yaml"
setting_directory = "data/settings/settings_distanceStep_massPoint_runningTime.yaml" setting_directory = "data/settings/settings_distanceStep_massPoint_runningTime.yaml"
(train, running_path, settings) = importYamlFiles(train_directory, running_path_directory, setting_directory) (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) exportToCsv(runtime, settings)
println("The V 90 with 10 ore wagons needs $runtime seconds for 10 km with no gradient.") println("The V 90 with 10 ore wagons needs $runtime seconds for 10 km with no gradient.")

View File

@ -30,7 +30,7 @@ using .AdditionalOutput
using .EnergySaving using .EnergySaving
# main function # main function
export calculateDrivingDynamics, export trainRun,
# import functions # import functions
importYamlFiles, importFromYaml, importYamlFiles, importFromYaml,

View File

@ -21,7 +21,7 @@ using .Behavior
using .Output using .Output
# export main function # export main function
export calculateDrivingDynamics export trainRun
approximationLevel = 6 # value for approximation to intersections and precisely calculated digits approximationLevel = 6 # value for approximation to intersections and precisely calculated digits
# TODO: define it here and give it to each function? (Behavior, ...) # 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`. # 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`. Calculate the driving dynamics of a train run on a path with special settings with information from the corresponding dictionaries `train`, `path`, `settings`.
# Examples # Examples
```julia-repl ```julia-repl
julia> calculateDrivingDynamics(trainDict, pathDict, settingsDict) julia> trainRun(trainDict, pathDict, settingsDict)
todo !!! todo !!!
``` ```
""" """
function calculateDrivingDynamics(trainInput::Dict, pathInput::Dict, settingsInput::Dict) function trainRun(trainInput::Dict, pathInput::Dict, settingsInput::Dict)
# copy Input data for not changing them # 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) # 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) train = copy(trainInput)
@ -68,7 +68,7 @@ function calculateDrivingDynamics(trainInput::Dict, pathInput::Dict, settingsInp
end #if end #if
return output return output
end # function calculateDrivingDynamics end # function trainRun
# calculate a train run focussing on using the minimum possible running time # calculate a train run focussing on using the minimum possible running time
function calculateMinimumRunningTime!(movingSection::Dict, settings::Dict, train::Dict) function calculateMinimumRunningTime!(movingSection::Dict, settings::Dict, train::Dict)

View File

@ -25,7 +25,7 @@ push!(allTrains, importYamlFile(:train, "data/trains/train_passenger_IC2.yaml"))
for path in allPaths for path in allPaths
for train in allTrains for train in allTrains
for settings in allSettings for settings in allSettings
testDict=calculateDrivingDynamics(train, path, settings) testDict=trainRun(train, path, settings)
exportToCsv(testDict) exportToCsv(testDict)
sleep(2) sleep(2)