Skip to content

Commit

Permalink
Option to disable name creation
Browse files Browse the repository at this point in the history
  • Loading branch information
joaquimg committed Nov 26, 2024
1 parent 72889d1 commit ae4e92f
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 @@ -74,6 +75,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)
Expand Down

0 comments on commit ae4e92f

Please sign in to comment.