Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/generic_io.jl
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ function _get_core_load!(input::AbstractJulESInput, subsystems::Vector{Tuple{Sub
core_loads[core] += num_elements

else
println("Warning: Core $core not found in core_loads dictionary. Skipping...")
@warn("Warning: Core $core not found in core_loads dictionary. Skipping...")
end
end
return core_loads
Expand Down
1 change: 1 addition & 0 deletions src/io.jl
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,7 @@ get_result_prices_ppp(settings::Dict)::Int = get(settings["results"], "prices_pp

has_statedependentprod(settings::Dict)::Bool = get(settings, "statedependentprod", false)
has_statedependentpump(settings::Dict)::Bool = get(settings, "statedependentpump", false)
has_statedependentleveling(settings::Dict)::Bool = get(settings, "statedependentleveling", false)
has_headlosscost(settings::Dict)::Bool = get(settings, "headlosscost", false)
has_onlyagghydro(settings::Dict)::Bool = get(settings["problems"], "onlyagghydro", false)
has_keephydroramping_evp(settings::Dict)::Bool = get(settings["problems"]["endvalue"], "keep_hydroramping", false)
Expand Down
1 change: 1 addition & 0 deletions src/prob_cp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ function update_statedependent_cp(stepnr, t)

has_statedependentprod(settings["problems"]["clearing"]) && TuLiPa.statedependentprod!(db.cp.prob, db.startstates, init=init)
has_statedependentpump(settings["problems"]["clearing"]) && TuLiPa.statedependentpump!(db.cp.prob, db.startstates)
has_statedependentleveling(settings["problems"]["clearing"]) && TuLiPa.statedependentleveling!(db.cp.prob, db.startstates)

# Headlosscosts
if has_headlosscost(settings["problems"]["clearing"])
Expand Down
17 changes: 10 additions & 7 deletions src/prob_stoch.jl
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,9 @@ function solve_benders(stepnr::Int, subix::SubsystemIx)
count == 0 && TuLiPa.clearcuts!(mp.cuts)
count += 1
catch e
showerror(stdout, e, catch_backtrace())
count == 0 && println("Retrying first iteration without cuts from last time step")
count > 0 && println("Restarting iterations without cuts from last time step")
errtxt = sprint(showerror, e, catch_backtrace())
count == 0 && @warn("Retrying first iteration without cuts from last time step: $errtxt")
count > 0 && @warn("Restarting iterations without cuts from last time step: $errtxt")
TuLiPa.clearcuts!(mp.prob, mp.cuts)
cutreuse = false
count = 0
Expand All @@ -221,9 +221,11 @@ function solve_benders(stepnr::Int, subix::SubsystemIx)
count += 1
end
count == 0 && TuLiPa.setwarmstart!(mp.prob, true)
prev_lb = lb
lb = TuLiPa.getvarvalue(mp.prob, TuLiPa.getfuturecostvarid(mp.cuts), 1)
TuLiPa.getoutgoingstates!(mp.prob, mp.states)
if count != 0
prev_lb = lb
lb = TuLiPa.getvarvalue(mp.prob, TuLiPa.getfuturecostvarid(mp.cuts), 1)
TuLiPa.getoutgoingstates!(mp.prob, mp.states)
end
end
end

Expand Down Expand Up @@ -273,7 +275,7 @@ function solve_benders(stepnr::Int, subix::SubsystemIx)
end
end
if count == 15
println("Warning: Benders did not converge within 15 iterations, reltol=$(reltol), ub=$(ub), lb=$(lb), step=$(stepnr), subix=$(subix)")
@warn("Warning: Benders did not converge within 15 iterations, reltol=$(reltol), ub=$(ub), lb=$(lb), step=$(stepnr), subix=$(subix)")
end

maintiming[5] = count
Expand Down Expand Up @@ -351,6 +353,7 @@ end
function update_statedependent_mp(stepnr::Int, prob::TuLiPa.Prob, startstates::Dict{String, Float64}, settings::Dict)
has_statedependentprod(settings["problems"]["stochastic"]["master"]) && TuLiPa.statedependentprod!(prob, startstates, init=(stepnr==1))
has_statedependentpump(settings["problems"]["stochastic"]["master"]) && TuLiPa.statedependentpump!(prob, startstates)
has_statedependentleveling(settings["problems"]["stochastic"]["master"]) && TuLiPa.statedependentleveling!(prob, startstates)
return
end

Expand Down
Loading