Compare commits
No commits in common. "25959f730233eb1003200047b0f68c2e0b709594" and "5d77fa97f1ef07b85981448f496b69c49ef5456d" have entirely different histories.
25959f7302
...
5d77fa97f1
|
@ -19,7 +19,7 @@ Refactor the modular structure:
|
||||||
* Extract the modules Export and AdditionalOutput from TrainRunCalc
|
* Extract the modules Export and AdditionalOutput from TrainRunCalc
|
||||||
* Divide the module Operationsmodes and add its functions to TrainRunCalc and EnergySaving
|
* Divide the module Operationsmodes and add its functions to TrainRunCalc and EnergySaving
|
||||||
* Add the remaining functions of the module types to EnergySaving
|
* Add the remaining functions of the module types to EnergySaving
|
||||||
* Divide the module MovingPhases into Behavior and Formulary
|
* Divide the module MovingPhases into Behavior and DrivingDynamics
|
||||||
* Rename the module Preparation to Characteristics
|
* Rename the module Preparation to Characteristics
|
||||||
|
|
||||||
|
|
||||||
|
@ -70,7 +70,7 @@ Add an attribute to DataPoint to record the corresponding driving behavior
|
||||||
|
|
||||||
Refactor some of the mutable structs from types.jl as Dictionaries
|
Refactor some of the mutable structs from types.jl as Dictionaries
|
||||||
* Remove the mutable structs Train, Path, PathSection, Settings and MovingSection
|
* Remove the mutable structs Train, Path, PathSection, Settings and MovingSection
|
||||||
* Create Dictionaries for train, path an settings in Validate.jl
|
* Create Dictionaries for train, path an settings in Input.jl
|
||||||
* Create a Dictionary for the whole moving section in Preperation.jl and a function for copying the moving section in OperationModes.jl
|
* Create a Dictionary for the whole moving section in Preperation.jl and a function for copying the moving section in OperationModes.jl
|
||||||
* Change the type of existing Dictionary keys from String to Symbol
|
* Change the type of existing Dictionary keys from String to Symbol
|
||||||
|
|
||||||
|
|
|
@ -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 = trainRun(train, running_path, settings)
|
train_run = calculateDrivingDynamics(train, running_path, settings)
|
||||||
```
|
```
|
||||||
|
|
||||||
------------
|
------------
|
||||||
|
|
|
@ -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 = trainRun(train, path, settings)
|
resultsDict = calculateDrivingDynamics(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)
|
||||||
|
|
|
@ -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 = trainRun(train, running_path, settings)
|
runtime = calculateDrivingDynamics(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.")
|
||||||
|
|
|
@ -7,14 +7,14 @@
|
||||||
|
|
||||||
module Behavior
|
module Behavior
|
||||||
|
|
||||||
include("./Formulary.jl")
|
include("./DrivingDynamics.jl")
|
||||||
using .Formulary
|
using .DrivingDynamics
|
||||||
|
|
||||||
export addBreakFreeSection!, addClearingSection!, addAcceleratingSection!, addCruisingSection!, addDiminishingSection!, addCoastingSection!, addBrakingSection!, addStandstill!,
|
export addBreakFreeSection!, addClearingSection!, addAcceleratingSection!, addCruisingSection!, addDiminishingSection!, addCoastingSection!, addBrakingSection!, addStandstill!,
|
||||||
# addBrakingSectionInOneStep! is not used in the current version of the tool
|
# addBrakingSectionInOneStep! is not used in the current version of the tool
|
||||||
calculateForces!, createDataPoint,
|
calculateForces!, createDataPoint,
|
||||||
|
|
||||||
# export functions from Formulary
|
# export functions from DrivingDynamics
|
||||||
calcBrakingDistance, calcBrakingStartVelocity, calc_Δs_with_Δt
|
calcBrakingDistance, calcBrakingStartVelocity, calc_Δs_with_Δt
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
# __copyright__ = "2022"
|
# __copyright__ = "2022"
|
||||||
# __license__ = "ISC"
|
# __license__ = "ISC"
|
||||||
|
|
||||||
module Formulary
|
module DrivingDynamics
|
||||||
|
|
||||||
#########################
|
#########################
|
||||||
## literature the driving dynamics equations are based on:
|
## literature the driving dynamics equations are based on:
|
||||||
|
@ -253,4 +253,4 @@ function calcBrakingAcceleration(v_start::Real, v_end::Real, s_braking::Real)
|
||||||
return a_braking
|
return a_braking
|
||||||
end #function calcBrakingAcceleration
|
end #function calcBrakingAcceleration
|
||||||
|
|
||||||
end #module Formulary
|
end #module DrivingDynamics
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
# TODO: calculation time for passenger trains on path1 is very long and should be reduced
|
# TODO: calculation time for passenger trains on path1 is very long and should be reduced
|
||||||
# TODO from 2022/01/18: Test if enum trainType is working correctly in function calculateRecoveryTime or if only the else-pathis taken
|
# TODO from 2022/01/18: Test if enum trainType is working correctly in function calculateRecoveryTime or if only the else-pathis taken
|
||||||
# TODO from 2022/01/19: Are here calculations that should be transferred to Formulary.jl?
|
# TODO from 2022/01/19: Are here calculations that should be transferred to DrivingDynamics.jl?
|
||||||
# TODO from 2022/01/22: use always copyCharacteristicSection and don't do it manually like "csModified=Dict(:id => csOriginal[:id], ..." three times
|
# TODO from 2022/01/22: use always copyCharacteristicSection and don't do it manually like "csModified=Dict(:id => csOriginal[:id], ..." three times
|
||||||
# TODO from 2022/03/18: stateFlags need to be added to functions that add behavior sections
|
# TODO from 2022/03/18: stateFlags need to be added to functions that add behavior sections
|
||||||
# TODO from 2022/03/21: consider previous speed limits during the coasting section in case F_R < 0.0 and the train is getting faster
|
# TODO from 2022/03/21: consider previous speed limits during the coasting section in case F_R < 0.0 and the train is getting faster
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
# __license__ = "ISC"
|
# __license__ = "ISC"
|
||||||
|
|
||||||
# TODO: 2022-04-07: if EnergySaving should be used. The train type has do be defined and checked
|
# TODO: 2022-04-07: if EnergySaving should be used. The train type has do be defined and checked
|
||||||
module Validate
|
module Input
|
||||||
|
|
||||||
export checkAndSetInput!
|
export checkAndSetInput!
|
||||||
|
|
||||||
|
@ -754,4 +754,4 @@ function informAboutUnusedKeys(allKeys::AbstractVector, usedKeys::Vector{Symbol}
|
||||||
end
|
end
|
||||||
end #function informAboutUnusedKeys
|
end #function informAboutUnusedKeys
|
||||||
|
|
||||||
end # module Validate
|
end # module Input
|
|
@ -30,7 +30,7 @@ using .AdditionalOutput
|
||||||
using .EnergySaving
|
using .EnergySaving
|
||||||
|
|
||||||
# main function
|
# main function
|
||||||
export trainRun,
|
export calculateDrivingDynamics,
|
||||||
|
|
||||||
# import functions
|
# import functions
|
||||||
importYamlFiles, importFromYaml,
|
importYamlFiles, importFromYaml,
|
||||||
|
|
|
@ -8,20 +8,20 @@
|
||||||
module TrainRunCalc
|
module TrainRunCalc
|
||||||
|
|
||||||
# include modules of TrainRunCalc
|
# include modules of TrainRunCalc
|
||||||
include("./Validate.jl")
|
include("./Input.jl")
|
||||||
include("./Characteristics.jl")
|
include("./Characteristics.jl")
|
||||||
include("./Behavior.jl")
|
include("./Behavior.jl")
|
||||||
include("./Output.jl")
|
include("./Output.jl")
|
||||||
|
|
||||||
|
|
||||||
# use modules of TrainRunCalc
|
# use modules of TrainRunCalc
|
||||||
using .Validate
|
using .Input
|
||||||
using .Characteristics
|
using .Characteristics
|
||||||
using .Behavior
|
using .Behavior
|
||||||
using .Output
|
using .Output
|
||||||
|
|
||||||
# export main function
|
# export main function
|
||||||
export trainRun
|
export calculateDrivingDynamics
|
||||||
|
|
||||||
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`.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
trainRun(train::Dict, path::Dict, settings::Dict)
|
calculateDrivingDynamics(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> trainRun(trainDict, pathDict, settingsDict)
|
julia> calculateDrivingDynamics(trainDict, pathDict, settingsDict)
|
||||||
todo !!!
|
todo !!!
|
||||||
```
|
```
|
||||||
"""
|
"""
|
||||||
function trainRun(trainInput::Dict, pathInput::Dict, settingsInput::Dict)
|
function calculateDrivingDynamics(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 trainRun(trainInput::Dict, pathInput::Dict, settingsInput::Dict)
|
||||||
end #if
|
end #if
|
||||||
|
|
||||||
return output
|
return output
|
||||||
end # function trainRun
|
end # function calculateDrivingDynamics
|
||||||
|
|
||||||
# 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)
|
||||||
|
|
|
@ -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=trainRun(train, path, settings)
|
testDict=calculateDrivingDynamics(train, path, settings)
|
||||||
exportToCsv(testDict)
|
exportToCsv(testDict)
|
||||||
sleep(2)
|
sleep(2)
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
# __license__ = "ISC"
|
# __license__ = "ISC"
|
||||||
|
|
||||||
include("../src/types.jl")
|
include("../src/types.jl")
|
||||||
include("../src/Validate.jl")
|
include("../src/Input.jl")
|
||||||
|
|
||||||
using .Input
|
using .Input
|
||||||
using YAML, Test
|
using YAML, Test
|
||||||
|
|
Loading…
Reference in New Issue