From 18c902e98c7df6b5a0fa33e922503049245c3406 Mon Sep 17 00:00:00 2001 From: Max Kannenberg <95709892+MaxKannenberg@users.noreply.github.com> Date: Fri, 8 Apr 2022 21:25:04 +0200 Subject: [PATCH] Refactor input and import and set default values --- examples/ExtendedWorkingExample.jl | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/examples/ExtendedWorkingExample.jl b/examples/ExtendedWorkingExample.jl index 7465bec..082249c 100644 --- a/examples/ExtendedWorkingExample.jl +++ b/examples/ExtendedWorkingExample.jl @@ -9,28 +9,30 @@ include("../src/TrainRun.jl") using .TrainRun allPaths=[] -push!(allPaths, importYamlFile(:path, "data/paths/path_1_10km_nConst_vConst.yaml")) -push!(allPaths, importYamlFile(:path, "data/paths/path_2_10km_nVar_vConst.yaml")) -push!(allPaths, importYamlFile(:path, "data/paths/path_3_10km_nConst_vVar.yaml")) -push!(allPaths, importYamlFile(:path, "data/paths/path_4_real_Germany_EastSaxony_DG-DN.yaml")) +push!(allPaths, importFromYaml(:path, "data/paths/path_1_10km_nConst_vConst.yaml")) +push!(allPaths, importFromYaml(:path, "data/paths/path_2_10km_nVar_vConst.yaml")) +push!(allPaths, importFromYaml(:path, "data/paths/path_3_10km_nConst_vVar.yaml")) +push!(allPaths, importFromYaml(:path, "data/paths/path_4_real_Germany_EastSaxony_DG-DN.yaml")) allSettings=[] -push!(allSettings, importYamlFile(:settings, "data/settings/settings_distanceStep_massPoint.yaml")) +push!(allSettings, importFromYaml(:settings, "data/settings/settings_distanceStep_massPoint.yaml")) allTrains=[] -push!(allTrains, importYamlFile(:train, "data/trains/train_freight_V90withOreConsist.yaml")) -push!(allTrains, importYamlFile(:train, "data/trains/train_passenger_SiemensDesiroClassic.yaml")) -push!(allTrains, importYamlFile(:train, "data/trains/train_passenger_IC2.yaml")) +push!(allTrains, importFromYaml(:train, "data/trains/train_freight_V90withOreConsist.yaml")) +push!(allTrains, importFromYaml(:train, "data/trains/train_passenger_SiemensDesiroClassic.yaml")) +push!(allTrains, importFromYaml(:train, "data/trains/train_passenger_IC2.yaml")) for path in allPaths # println(" - - - - - - - - -") - # println("path: ", path) + # println("path: ", path[:name]) for train in allTrains - # println("train: ", train) + # println("train: ", train[:name]) for settings in allSettings resultsDict = calculateDrivingDynamics(train, path, settings) - exportToCsv(resultsDict) - sleep(2) + if haskey(settings, :typeOfOutput) && settings[:typeOfOutput] == "CSV" + exportToCsv(resultsDict, settings) + sleep(2) + end # println("") end end