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

Specify the domain of decommission variables #846

Merged
merged 6 commits into from
Oct 14, 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
35 changes: 29 additions & 6 deletions src/create-model.jl
Original file line number Diff line number Diff line change
Expand Up @@ -672,18 +672,41 @@ function create_model(
)

# Create sets of tuples for decommission variables/accumulated capacity of compact method

# Create conditions for decommission variables
# Cond1: asset a invested in year v has to be operational at milestone year y
# Cond2: invested in non-milestone years (i.e., initial units from non-milestone years), or
# Cond3: invested in investable milestone years, or initial units from milestone years
cond1_domain_decommission_variables(a, y, v) =
starting_year_using_compact_method[y, a] ≤ v < y
cond2_domain_decommission_variables(a, v) =
(v in V_non_milestone && a in existing_assets_by_year_using_compact_method[v])
cond3_domain_decommission_variables(a, v) =
v in Y &&
(a in investable_assets_using_compact_method[v] || (graph[a].initial_units[v][v] != 0))

decommission_set_using_compact_method = [
(a, y, v) for a in decommissionable_assets_using_compact_method for y in Y for
v in V_all if starting_year_using_compact_method[y, a] ≤ v < y && ((
(v in V_non_milestone && a in existing_assets_by_year_using_compact_method[v]) || (v in Y)
))
v in V_all if cond1_domain_decommission_variables(a, y, v) && (
cond2_domain_decommission_variables(a, v) ||
cond3_domain_decommission_variables(a, v)
)
]

# Create conditions for accumulated units compact method
# Cond1: asset a invested in year v has to be operational at milestone year y
# Note it is different from cond1_domain_decommission_variables because here, we allow accumulation at the year of investment
# Cond2: same as cond2_domain_decommission_variables(a, v)
# Cond3: same as cond3_domain_decommission_variables(a, v)
cond1_domain_accumulated_units_using_compact_method(a, y, v) =
starting_year_using_compact_method[y, a] ≤ v ≤ y

accumulated_set_using_compact_method = [
(a, y, v) for a in decommissionable_assets_using_compact_method for y in Y for
v in V_all if starting_year_using_compact_method[y, a] ≤ v ≤ y && ((
(v in V_non_milestone && a in existing_assets_by_year_using_compact_method[v]) || (v in Y)
))
v in V_all if cond1_domain_accumulated_units_using_compact_method(a, y, v) && (
cond2_domain_decommission_variables(a, v) ||
cond3_domain_decommission_variables(a, v)
)
]

# Create a lookup set for compact method
Expand Down