Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to disable name creation #936

Merged
merged 1 commit into from
Nov 27, 2024
Merged
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
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
Loading