Skip to content

Commit

Permalink
Fix retrofit examples after merge
Browse files Browse the repository at this point in the history
  • Loading branch information
lbonaldo committed Mar 8, 2024
1 parent 10d0b75 commit 10505d4
Show file tree
Hide file tree
Showing 70 changed files with 16 additions and 23 deletions.
3 changes: 2 additions & 1 deletion Example_Systems/RetrofitExample/OneZone/Run.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using GenX
using Gurobi

run_genx_case!(dirname(@__FILE__))
run_genx_case!(dirname(@__FILE__), Gurobi.Optimizer)
3 changes: 2 additions & 1 deletion Example_Systems/RetrofitExample/OneZone_MultiStage/Run.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using GenX
using Gurobi

run_genx_case!(dirname(@__FILE__))
run_genx_case!(dirname(@__FILE__), Gurobi.Optimizer)
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
NetworkExpansion: 1 # Transmission network expansionl; 0 = not active; 1 = active systemwide
OverwriteResults: 0 # Overwrite existing results in output folder or create a new one; 0 = create new folder; 1 = overwrite existing results
PrintModel: 0 # Write the model formulation as an output; 0 = active; 1 = not active
NetworkExpansion: 0 # Transmission network expansionl; 0 = not active; 1 = active systemwide
Trans_Loss_Segments: 1 # Number of segments used in piecewise linear approximation of transmission losses; 1 = linear, >2 = piecewise quadratic
<<<<<<<< HEAD:Example_Systems/RetrofitExample/OneZone_MultiStage/Settings/genx_settings.yml
Reserves: 1 # Regulation (primary) and operating (secondary) reserves; 0 = not active, 1 = active systemwide
========
>>>>>>>> origin/develop:example_systems/1_three_zones/settings/genx_settings.yml
EnergyShareRequirement: 0 # Minimum qualifying renewables penetration; 0 = not active; 1 = active systemwide
CapacityReserveMargin: 0 # Number of capacity reserve margin constraints; 0 = not active; 1 = active systemwide
CO2Cap: 2 # CO2 emissions cap; 0 = not active (no CO2 emission limit); 1 = mass-based emission limit constraint; 2 = demand + rate-based emission limit constraint; 3 = generation + rate-based emission limit constraint
StorageLosses: 1 # Energy Share Requirement and CO2 constraints account for energy lost; 0 = not active (DO NOT account for energy lost); 1 = active systemwide (DO account for energy lost)
MinCapReq: 1 # Activate minimum technology carveout constraints; 0 = not active; 1 = active
MinCapReq: 0 # Activate minimum technology carveout constraints; 0 = not active; 1 = active
MaxCapReq: 0 # Activate maximum technology carveout constraints; 0 = not active; 1 = active
ParameterScale: 1 # Turn on parameter scaling wherein demand, capacity and power variables are defined in GW rather than MW. 0 = not active; 1 = active systemwide
WriteShadowPrices: 1 # Write shadow prices of LP or relaxed MILP; 0 = not active; 1 = active
UCommit: 2 # Unit committment of thermal power plants; 0 = not active; 1 = active using integer clestering; 2 = active using linearized clustering
TimeDomainReduction: 1 # Time domain reduce (i.e. cluster) inputs based on Demand_data.csv, Generators_variability.csv, and Fuels_data.csv; 0 = not active (use input data as provided); 0 = active (cluster input data, or use data that has already been clustered)
MultiStage: 1
3 changes: 2 additions & 1 deletion Example_Systems/RetrofitExample/ThreeZones/Run.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using GenX
using Gurobi

run_genx_case!(dirname(@__FILE__))
run_genx_case!(dirname(@__FILE__), Gurobi.Optimizer)
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
OverwriteResults: 0 # Overwrite existing results in output folder or create a new one; 0 = create new folder; 1 = overwrite existing results
PrintModel: 0 # Write the model formulation as an output; 0 = active; 1 = not active
NetworkExpansion: 1 # Transmission network expansionl; 0 = not active; 1 = active systemwide
Trans_Loss_Segments: 1 # Number of segments used in piecewise linear approximation of transmission losses; 1 = linear, >2 = piecewise quadratic
Reserves: 0 # Regulation (primary) and operating (secondary) reserves; 0 = not active, 1 = active systemwide
EnergyShareRequirement: 0 # Minimum qualifying renewables penetration; 0 = not active; 1 = active systemwide
CapacityReserveMargin: 0 # Number of capacity reserve margin constraints; 0 = not active; 1 = active systemwide
CO2Cap: 2 # CO2 emissions cap; 0 = not active (no CO2 emission limit); 1 = mass-based emission limit constraint; 2 = demand + rate-based emission limit constraint; 3 = generation + rate-based emission limit constraint
Expand All @@ -12,10 +9,4 @@ MaxCapReq: 0 # Activate maximum technology carveout constraints; 0 = not active
ParameterScale: 1 # Turn on parameter scaling wherein demand, capacity and power variables are defined in GW rather than MW. 0 = not active; 1 = active systemwide
WriteShadowPrices: 1 # Write shadow prices of LP or relaxed MILP; 0 = not active; 1 = active
UCommit: 2 # Unit committment of thermal power plants; 0 = not active; 1 = active using integer clestering; 2 = active using linearized clustering
TimeDomainReductionFolder: "TDR_Results" # Directory name where results from time domain reduction will be saved. If results already exist here, these will be used without running time domain reduction script again.
TimeDomainReduction: 1 # Time domain reduce (i.e. cluster) inputs based on Demand_data.csv, Generators_variability.csv, and Fuels_data.csv; 0 = not active (use input data as provided); 0 = active (cluster input data, or use data that has already been clustered)
ModelingToGenerateAlternatives: 0 # Modeling to generate alternatives; 0 = not active; 1 = active. Note: produces a single solution as output
ModelingtoGenerateAlternativeSlack: 0.1 # Slack value as a fraction of least-cost objective in budget constraint used for evaluating alternative model solutions; positive float value
ModelingToGenerateAlternativeIterations: 3 # Number of MGA iterations with maximization and minimization objective
MultiStage: 0 # Multi-stage modeling; 0 if single-stage; 1 if multi-stage.
MethodofMorris: 0 #Flag for turning on the Method of Morris analysis
TimeDomainReduction: 1 # Time domain reduce (i.e. cluster) inputs based on Demand_data.csv, Generators_variability.csv, and Fuels_data.csv; 0 = not active (use input data as provided); 0 = active (cluster input data, or use data that has already been clustered)
6 changes: 3 additions & 3 deletions src/load_inputs/load_resources_data.jl
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ function check_resource(r::AbstractResource)
return e
end

function check_retrofit_id(rs::Vector{AbstractResource})
function check_retrofit_id(rs::Vector{T}) where T <: AbstractResource
warning_strings = String[]

units_can_retrofit = ids_can_retrofit(rs)
Expand All @@ -458,7 +458,7 @@ check_resource(resources::Vector{T})::Vector{String} where T <: AbstractResource
Validate the consistency of a vector of GenX resources
Reports any errors/warnings as a vector of messages.
"""
function check_resource(resources::T) where T <: Vector{AbstractResource}
function check_resource(resources::Vector{T}) where T <: AbstractResource
e = []
for r in resources
e = [e; check_resource(r)]
Expand Down Expand Up @@ -488,7 +488,7 @@ function announce_errors_and_halt(e::Vector)
return nothing
end

function validate_resources(resources::T) where T <: Vector{AbstractResource}
function validate_resources(resources::Vector{T}) where T <: AbstractResource
e = check_resource(resources)
if length(e) > 0
announce_errors_and_halt(e)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion test/test_retrofit.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ using Test
include(joinpath(@__DIR__, "utilities.jl"))

obj_true = 3179.6244
test_path = "Retrofit"
test_path = "retrofit"

# Define test inputs
genx_setup = Dict(
Expand Down

0 comments on commit 10505d4

Please sign in to comment.