fixed MinimalWorkingExample.jl with working paths
parent
7eed749d49
commit
a7e733dd8a
10
README.md
10
README.md
|
@ -17,8 +17,16 @@ Review the settings.yaml file for your appropriate settings.
|
||||||
|
|
||||||
# Minimal working example
|
# 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
|
# History
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
%YAML 1.2
|
||||||
---
|
---
|
||||||
path:
|
path:
|
||||||
name: "10 km, no gradient, 160 km/h"
|
name: "10 km, no gradient, 160 km/h"
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
%YAML 1.2
|
||||||
---
|
---
|
||||||
path:
|
path:
|
||||||
name: "10 km, different gradient, 160 km/h"
|
name: "10 km, different gradient, 160 km/h"
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
%YAML 1.2
|
||||||
---
|
---
|
||||||
path:
|
path:
|
||||||
name: "10 km, no gradient, different speed limits"
|
name: "10 km, no gradient, different speed limits"
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
%YAML 1.2
|
||||||
---
|
---
|
||||||
path:
|
path:
|
||||||
name: "'infra_Ostsachsen': track id='tr_80.6212_2' name='DG-DN' -> spp_5"
|
name: "'infra_Ostsachsen': track id='tr_80.6212_2' name='DG-DN' -> spp_5"
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
%YAML 1.2
|
||||||
---
|
---
|
||||||
settings:
|
settings:
|
||||||
# settings for the simulation
|
# 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)
|
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"
|
operationModeMinimumRunningTime: true # operation mode "minimum running time"
|
||||||
operationModeMinimumEnergyConsumption: true # operation mode "minimum energy consumption"
|
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"?
|
detailOfOutput: "driving course" # should the output be "reduced" or "driving course"?
|
||||||
csvFolderPath: "~/Desktop/TrainRun"
|
# csvDirectory: "~/Desktop/TrainRun"
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
%YAML 1.2
|
||||||
---
|
---
|
||||||
train:
|
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)
|
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)
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
%YAML 1.2
|
||||||
---
|
---
|
||||||
train:
|
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))
|
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))
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
%YAML 1.2
|
||||||
---
|
---
|
||||||
train:
|
train:
|
||||||
name: "Siemens Desiro Classic" # (source: https://de.wikipedia.org/wiki/Siemens_Desiro_Classic)
|
name: "Siemens Desiro Classic" # (source: https://de.wikipedia.org/wiki/Siemens_Desiro_Classic)
|
||||||
|
|
|
@ -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")
|
include("../src/TrainRun.jl")
|
||||||
using .TrainRun
|
using .TrainRun
|
||||||
|
|
||||||
|
train = "data/trains/train_freight_V90withOreConsist.yaml"
|
||||||
|
running_path = "data/paths/path_1_10km_nConst_vConst.yaml"
|
||||||
|
setting = "data/settings.yaml"
|
||||||
|
|
||||||
# println("")
|
train_run = calculateDrivingDynamics(train, running_path, setting)
|
||||||
# println("________________________")
|
runtime = last(train_run["outputArrayMinimumRunningTime"])[5]
|
||||||
# println("")
|
|
||||||
|
|
||||||
|
println("The V 90 with 10 ore wagons needs $runtime seconds for 10 km with no gradient.")
|
||||||
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
|
|
|
@ -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
|
using TrainRun, Test
|
||||||
|
|
||||||
|
|
||||||
allPaths=[]
|
allPaths=[]
|
||||||
push!(allPaths, "../data/paths/path_1_10km_nConst_vConst.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_2_10km_nVar_vConst.yaml")
|
||||||
push!(allPaths, "../data/paths/path_3_10km_nConst_vVar.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_4_real_Ostsachsen_DG-DN_spp_5.yaml")
|
||||||
|
|
||||||
allSettings=[]
|
allSettings=[]
|
||||||
push!(allSettings, "../data/settings.yaml")
|
push!(allSettings, "data/settings.yaml")
|
||||||
|
|
||||||
allTrains=[]
|
allTrains=[]
|
||||||
push!(allTrains, "../data/trains/train_freight_V90withOreConsist.yaml")
|
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_SiemensDesiroClassic.yaml")
|
||||||
push!(allTrains, "../data/trains/train_passenger_IC2.yaml")
|
push!(allTrains, "data/trains/train_passenger_IC2.yaml")
|
||||||
|
|
||||||
for pathDirectory in allPaths
|
for pathDirectory in allPaths
|
||||||
# println("")
|
|
||||||
# println(" - - - - - - - - -")
|
|
||||||
# println("path: ", pathDirectory)
|
|
||||||
for trainDirectory in allTrains
|
for trainDirectory in allTrains
|
||||||
# println("train: ", trainDirectory)
|
|
||||||
for settingsDirectory in allSettings
|
for settingsDirectory in allSettings
|
||||||
testDict=calculateDrivingDynamics(trainDirectory, pathDirectory, settingsDirectory)
|
testDict=calculateDrivingDynamics(trainDirectory, pathDirectory, settingsDirectory)
|
||||||
|
|
||||||
sleep(2)
|
sleep(2)
|
||||||
|
|
||||||
# println("")
|
# TODO:
|
||||||
# println("")
|
# compare result to test data set
|
||||||
# println("")
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
println("test finished")
|
println("test finished")
|
||||||
|
# TODO:
|
||||||
|
# print test results
|
||||||
|
|
Loading…
Reference in New Issue