Skip to content

Commit

Permalink
Option to disable name creation (#936)
Browse files Browse the repository at this point in the history
  • Loading branch information
joaquimg authored Nov 27, 2024
1 parent 127db68 commit 0b6b646
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/create-model.jl
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function create_model!(energy_problem; kwargs...)
end

"""
model = create_model(graph, representative_periods, dataframes, timeframe, groups; write_lp_file = false)
model = create_model(graph, representative_periods, dataframes, timeframe, groups; write_lp_file = false, enable_names = true)
Create the energy model given the `graph`, `representative_periods`, dictionary of `dataframes` (created by [`construct_dataframes`](@ref)), timeframe, and groups.
"""
Expand All @@ -54,6 +54,7 @@ function create_model(
groups,
model_parameters;
write_lp_file = false,
enable_names = true,
)
# Maximum timestep
Tmax = maximum(last(rp.timesteps) for year in sets.Y for rp in representative_periods[year])
Expand All @@ -68,6 +69,8 @@ function create_model(
## Model
model = JuMP.Model()

JuMP.set_string_names_on_creation(model, enable_names)

## Variables
@timeit to "add_flow_variables!" add_flow_variables!(model, variables)
@timeit to "add_investment_variables!" add_investment_variables!(model, graph, sets, variables)
Expand Down

0 comments on commit 0b6b646

Please sign in to comment.