Skip to content

Commit

Permalink
Add all considered techs to results_summary even if sized to zero for…
Browse files Browse the repository at this point in the history
… optimal
  • Loading branch information
Bill-Becker committed Dec 21, 2023
1 parent 23db924 commit e6cfd7e
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/core/reopt_multi_solutions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ function run_reopt_multi_solutions(fp::String, size_scale::Union{Vector{Any},Vec
else
simresults = Dict()
end
results_summary = Dict("optimal" => get_multi_solutions_results_summary(results_dict, p, ms[ms_count-1], techs_sized, simresults, outage_start_hour, outage_duration_hours))
results_summary = Dict("optimal" => get_multi_solutions_results_summary(results_dict, p, ms[ms_count-1], techs_considered, simresults, outage_start_hour, outage_duration_hours))
results_summary["incentive_used"] = Dict("best_incentive_program_name" => best_incentive_program_name,
"net_metering_from_dsire" => net_metering_from_dsire,
"state" => state,
Expand All @@ -119,7 +119,8 @@ function run_reopt_multi_solutions(fp::String, size_scale::Union{Vector{Any},Vec

# Remove techs which were considered but not sized (size=0) in optimal case
for t in techs_to_zero
delete!(input_data_s, t)
# delete!(input_data_s, t)
input_data_s[t]["max_kw"] = 0.0
end

# Force size based on size_scale factor for tech, and set other techs to optimal size
Expand Down Expand Up @@ -170,7 +171,7 @@ function run_reopt_multi_solutions(fp::String, size_scale::Union{Vector{Any},Vec
simresults = Dict()
end
# Build results summary, a select number of outputs for Eaton
results_summary[p[1]] = get_multi_solutions_results_summary(results_dict, p[2], ms[n], techs_sized, simresults, outage_start_hour, outage_duration_hours)
results_summary[p[1]] = get_multi_solutions_results_summary(results_dict, p[2], ms[n], techs_considered, simresults, outage_start_hour, outage_duration_hours)
results_dict["resilience"] = results_summary[p[1]]["resilience"]
results_all[p[1]] = results_dict
else
Expand All @@ -184,14 +185,14 @@ function run_reopt_multi_solutions(fp::String, size_scale::Union{Vector{Any},Vec
end

"""
get_multi_solutions_results_summary(results::Dict, p::REoptInputs, m::JuMP.AbstractModel, techs_sized::Vector{String}, simresults::Dict,
get_multi_solutions_results_summary(results::Dict, p::REoptInputs, m::JuMP.AbstractModel, techs_considered::Vector{String}, simresults::Dict,
outage_start_hour::Int64, outage_duration_hours::Int64)
Get the results summary dictionary which is a selected number of outputs for Financial, Emissions, and
the relevant techs
"""
function get_multi_solutions_results_summary(results::Dict, p::REoptInputs, m::JuMP.AbstractModel, techs_sized::Vector{String}, simresults::Dict,
function get_multi_solutions_results_summary(results::Dict, p::REoptInputs, m::JuMP.AbstractModel, techs_considered::Vector{String}, simresults::Dict,
outage_start_hour::Int64, outage_duration_hours::Int64)
# results_summary always has Financial and emissions, and then add techs as needed
results_summary = Dict(
Expand Down Expand Up @@ -264,7 +265,7 @@ function get_multi_solutions_results_summary(results::Dict, p::REoptInputs, m::J
end

# Add techs if they have been sized in the optimal case
for key in techs_sized
for key in techs_considered
if key == "PV"
# Note, capital cost is "net" of incentives, and Maintenance cost is year-one
results_summary["PV"] =
Expand Down

0 comments on commit e6cfd7e

Please sign in to comment.