renamed calculateDrivingDynamics() in trainRun()
parent
01c1751001
commit
237729ce5b
|
@ -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)
|
||||
```
|
||||
|
||||
------------
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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.")
|
||||
|
|
|
@ -30,7 +30,7 @@ using .AdditionalOutput
|
|||
using .EnergySaving
|
||||
|
||||
# main function
|
||||
export calculateDrivingDynamics,
|
||||
export trainRun,
|
||||
|
||||
# import functions
|
||||
importYamlFiles, importFromYaml,
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in New Issue