fixed MinimalWorkingExample.jl with working paths

pull/1/head
Martin Scheidt 2021-12-10 18:30:08 +01:00
parent 7eed749d49
commit a7e733dd8a
11 changed files with 56 additions and 61 deletions

View File

@ -17,8 +17,16 @@ Review the settings.yaml file for your appropriate settings.
# Minimal working example
See folder examples.
```julia
include("../src/TrainRun.jl")
using .TrainRun
train = "data/trains/train_freight_V90withOreConsist.yaml"
running_path = "data/paths/path_1_10km_nConst_vConst.yaml"
setting = "data/settings.yaml"
train_run = calculateDrivingDynamics(train, running_path, setting)
```
------------
# History

View File

@ -1,3 +1,4 @@
%YAML 1.2
---
path:
name: "10 km, no gradient, 160 km/h"

View File

@ -1,3 +1,4 @@
%YAML 1.2
---
path:
name: "10 km, different gradient, 160 km/h"

View File

@ -1,3 +1,4 @@
%YAML 1.2
---
path:
name: "10 km, no gradient, different speed limits"

View File

@ -1,3 +1,4 @@
%YAML 1.2
---
path:
name: "'infra_Ostsachsen': track id='tr_80.6212_2' name='DG-DN' -> spp_5"

View File

@ -1,3 +1,4 @@
%YAML 1.2
---
settings:
# settings for the simulation
@ -6,6 +7,6 @@ settings:
stepSize: 10 # step size (unit depends on stepVariable s in m, t in s and v in m/s)
operationModeMinimumRunningTime: true # operation mode "minimum running time"
operationModeMinimumEnergyConsumption: true # operation mode "minimum energy consumption"
typeOfOutput: "CSV" # output as "julia dictionary" or as "CSV"
typeOfOutput: "julia dictionary" # output as "julia dictionary" or as "CSV"
detailOfOutput: "driving course" # should the output be "reduced" or "driving course"?
csvFolderPath: "~/Desktop/TrainRun"
# csvDirectory: "~/Desktop/TrainRun"

View File

@ -1,3 +1,4 @@
%YAML 1.2
---
train:
name: "V 90 with 10 ore wagons of type Facs 124" # (source: https://de.wikipedia.org/wiki/DB-Baureihe_V_90 and https://dybas.de/dybas/gw/gw_f_1/g124.html)

View File

@ -1,3 +1,4 @@
%YAML 1.2
---
train:
name: "Intercity 2 (Traxx P160 AC2 + double deck coaches)" # (source: https://de.wikipedia.org/wiki/Bombardier_Twindexx_Vario#Intercity_2 and https://de.wikipedia.org/wiki/Intercity_2_(Deutsche_Bahn))

View File

@ -1,3 +1,4 @@
%YAML 1.2
---
train:
name: "Siemens Desiro Classic" # (source: https://de.wikipedia.org/wiki/Siemens_Desiro_Classic)

View File

@ -1,40 +1,18 @@
#!/usr/bin/env julia
# -*- coding: UTF-8 -*-
# __julia-version__ = 1.7.0
# __author__ = "Max Kannenberg"
# __copyright__ = "2021"
# __license__ = "ISC"
include("../src/TrainRun.jl")
using .TrainRun
train = "data/trains/train_freight_V90withOreConsist.yaml"
running_path = "data/paths/path_1_10km_nConst_vConst.yaml"
setting = "data/settings.yaml"
# println("")
# println("________________________")
# println("")
train_run = calculateDrivingDynamics(train, running_path, setting)
runtime = last(train_run["outputArrayMinimumRunningTime"])[5]
allPaths=[]
push!(allPaths, "../data/paths/path_1_10km_nConst_vConst.yaml")
push!(allPaths, "../data/paths/path_2_10km_nVar_vConst.yaml")
push!(allPaths, "../data/paths/path_3_10km_nConst_vVar.yaml")
push!(allPaths, "../data/paths/path_4_real_Ostsachsen_DG-DN_spp_5.yaml")
allSettings=[]
push!(allSettings, "../data/settings.yaml")
allTrains=[]
push!(allTrains, "../data/trains/train_freight_V90withOreConsist.yaml")
push!(allTrains, "../data/trains/train_yaml_files\\train_passenger_SiemensDesiroClassic.yaml")
push!(allTrains, "../data/trains/train_passenger_IC2.yaml")
for pathDirectory in allPaths
# println("")
# println(" - - - - - - - - -")
# println("path: ", pathDirectory)
for trainDirectory in allTrains
# println("train: ", trainDirectory)
for settingsDirectory in allSettings
testDict=calculateDrivingDynamics(trainDirectory, pathDirectory, settingsDirectory)
sleep(2)
# println("")
# println("")
# println("")
end
end
end
println("The V 90 with 10 ore wagons needs $runtime seconds for 10 km with no gradient.")

View File

@ -1,38 +1,39 @@
# access in pkg mode with >>>>> ] test TrainRun <<<<
#!/usr/bin/env julia
# -*- coding: UTF-8 -*-
# __julia-version__ = 1.7.0
# __author__ = "Max Kannenberg"
# __copyright__ = "2021"
# __license__ = "ISC"
using TrainRun, Test
allPaths=[]
push!(allPaths, "../data/paths/path_1_10km_nConst_vConst.yaml")
push!(allPaths, "../data/paths/path_2_10km_nVar_vConst.yaml")
push!(allPaths, "../data/paths/path_3_10km_nConst_vVar.yaml")
push!(allPaths, "../data/paths/path_4_real_Ostsachsen_DG-DN_spp_5.yaml")
push!(allPaths, "data/paths/path_1_10km_nConst_vConst.yaml")
push!(allPaths, "data/paths/path_2_10km_nVar_vConst.yaml")
push!(allPaths, "data/paths/path_3_10km_nConst_vVar.yaml")
push!(allPaths, "data/paths/path_4_real_Ostsachsen_DG-DN_spp_5.yaml")
allSettings=[]
push!(allSettings, "../data/settings.yaml")
push!(allSettings, "data/settings.yaml")
allTrains=[]
push!(allTrains, "../data/trains/train_freight_V90withOreConsist.yaml")
push!(allTrains, "../data/trains/train_yaml_files\\train_passenger_SiemensDesiroClassic.yaml")
push!(allTrains, "../data/trains/train_passenger_IC2.yaml")
push!(allTrains, "data/trains/train_freight_V90withOreConsist.yaml")
push!(allTrains, "data/trains/train_passenger_SiemensDesiroClassic.yaml")
push!(allTrains, "data/trains/train_passenger_IC2.yaml")
for pathDirectory in allPaths
# println("")
# println(" - - - - - - - - -")
# println("path: ", pathDirectory)
for trainDirectory in allTrains
# println("train: ", trainDirectory)
for settingsDirectory in allSettings
testDict=calculateDrivingDynamics(trainDirectory, pathDirectory, settingsDirectory)
for trainDirectory in allTrains
for settingsDirectory in allSettings
testDict=calculateDrivingDynamics(trainDirectory, pathDirectory, settingsDirectory)
sleep(2)
sleep(2)
# println("")
# println("")
# println("")
end
end
# TODO:
# compare result to test data set
end
end
end
println("test finished")
# TODO:
# print test results