Change behavior section "standstill" to "halt"

development
Max Kannenberg 2022-05-24 16:15:08 +02:00
parent ae5cc07862
commit 4c7980bbe6
3 changed files with 31 additions and 31 deletions

View File

@ -1304,11 +1304,11 @@ function addBrakingSection!(CS::Dict, drivingCourse::Vector{Dict}, stateFlags::D
end #function addBrakingSection! end #function addBrakingSection!
## This function calculates the data point of the standstill. ## This function calculates the data point of the halt.
# Therefore it gets its first data point and the characteristic section and returns the characteristic section including the standstill if needed. # Therefore it gets its first data point and the characteristic section and returns the characteristic section including the halt if needed.
function addStandstill!(CS::Dict, drivingCourse::Vector{Dict}, settings::Settings, train::Train, CSs::Vector{Dict}) function addHalt!(CS::Dict, drivingCourse::Vector{Dict}, settings::Settings, train::Train, CSs::Vector{Dict})
if drivingCourse[end][:v] == 0.0 if drivingCourse[end][:v] == 0.0
BS = createBehaviorSection("standstill", drivingCourse[end][:s], drivingCourse[end][:v], drivingCourse[end][:i]) BS = createBehaviorSection("halt", drivingCourse[end][:s], drivingCourse[end][:v], drivingCourse[end][:i])
merge!(BS, Dict(:length => 0.0, # total length (in m) merge!(BS, Dict(:length => 0.0, # total length (in m)
:t => 0.0, # total running time (in s) :t => 0.0, # total running time (in s)
:E => 0.0, # total energy consumption (in Ws) :E => 0.0, # total energy consumption (in Ws)
@ -1319,10 +1319,10 @@ function addStandstill!(CS::Dict, drivingCourse::Vector{Dict}, settings::Setting
# traction effort and resisting forces (in N) # traction effort and resisting forces (in N)
calculateForces!(drivingCourse[end], CSs, CS[:id], BS[:type], train, settings.massModel) calculateForces!(drivingCourse[end], CSs, CS[:id], BS[:type], train, settings.massModel)
merge!(CS[:behaviorSections], Dict(:standstill => BS)) merge!(CS[:behaviorSections], Dict(:halt => BS))
end # else: return the characteristic section without a standstillSection section end # else: return the characteristic section without a halt section section
return (CS, drivingCourse) return (CS, drivingCourse)
end #function addStandstill! end #function addHalt!
function mergeBehaviorSection!(BSs::Dict, BS::Dict) function mergeBehaviorSection!(BSs::Dict, BS::Dict)
if !haskey(BSs, Symbol(BS[:type])) if !haskey(BSs, Symbol(BS[:type]))

View File

@ -44,7 +44,7 @@ function calculateMinimumRunningTime!(movingSection::Dict, settings::Settings, t
:speedLimitReached => drivingCourse[end][:v] > CS[:v_limit], :speedLimitReached => drivingCourse[end][:v] > CS[:v_limit],
:error => false) :error => false)
# determine the behavior sections for this characteristic section. It has to be at least one of those BS: "breakFree", "clearing", "accelerating", "cruising", "diminishing", "coasting", "braking" or "standstill") # determine the behavior sections for this characteristic section. It has to be at least one of those BS: "breakFree", "clearing", "accelerating", "cruising", "diminishing", "coasting", "braking" or "halt")
while !stateFlags[:endOfCSReached] # s < s_exit while !stateFlags[:endOfCSReached] # s < s_exit
if !stateFlags[:brakingStartReached] # s+s_braking < s_exit if !stateFlags[:brakingStartReached] # s+s_braking < s_exit
if !stateFlags[:tractionDeficit] if !stateFlags[:tractionDeficit]
@ -103,7 +103,7 @@ function calculateMinimumRunningTime!(movingSection::Dict, settings::Settings, t
end end
end end
#if s == s_exit #if s == s_exit
# standstill # halt
#end #end
@ -116,7 +116,7 @@ function calculateMinimumRunningTime!(movingSection::Dict, settings::Settings, t
end end
end #for end #for
(CSs[end], drivingCourse) = addStandstill!(CSs[end], drivingCourse, settings, train, CSs) (CSs[end], drivingCourse) = addHalt!(CSs[end], drivingCourse, settings, train, CSs)
movingSection[:t] = drivingCourse[end][:t] # total running time (in s) movingSection[:t] = drivingCourse[end][:t] # total running time (in s)
movingSection[:E] = drivingCourse[end][:E] # total energy consumption (in Ws) movingSection[:E] = drivingCourse[end][:E] # total energy consumption (in Ws)

View File

@ -727,7 +727,7 @@ BehaviorSection() TODO!
""" """
function createBehaviorSection(type::String, s_entry::Real, v_entry::Real, startingPoint::Integer) function createBehaviorSection(type::String, s_entry::Real, v_entry::Real, startingPoint::Integer)
BS= Dict( BS= Dict(
:type => type, # type of behavior section: "breakFree", "clearing", "accelerating", "cruising", "downhillBraking", "diminishing", "coasting", "braking" or "standstill" :type => type, # type of behavior section: "breakFree", "clearing", "accelerating", "cruising", "downhillBraking", "diminishing", "coasting", "braking" or "halt"
:length => 0.0, # total length (in m) :length => 0.0, # total length (in m)
:s_entry => s_entry, # first position (in m) :s_entry => s_entry, # first position (in m)
:s_exit => 0.0, # last position (in m) :s_exit => 0.0, # last position (in m)