Skip to content

Cvar factor add investment cost expression#1615

Closed
florinelaseur wants to merge 19 commits into
TulipaEnergy:mainfrom
florinelaseur:cvar-factor
Closed

Cvar factor add investment cost expression#1615
florinelaseur wants to merge 19 commits into
TulipaEnergy:mainfrom
florinelaseur:cvar-factor

Conversation

@florinelaseur

Copy link
Copy Markdown
Contributor

Hi Diego, this is the TEM version I locally run in the Experiments_CVaR repo. Thanks for pulling it before considering my other PR. Cheers,

Florine

Related issues

Closes #

Checklist

  • I am following the contributing guidelines
  • Tests are passing
  • Lint workflow is passing
  • Docs were updated and workflow is passing

datejada and others added 19 commits May 5, 2026 14:53
Wrap stochastic_scenario selection in an ordered_scenarios CTE so
nextval('id') assigns ids only after ORDER BY scenario. This guarantees
all per-scenario tables align to scenario 1..N in alphabetical order,
a prerequisite for positional index access in the CVaR expressions.

Co-Authored-By: GitHub Copilot (claude-sonnet-4-6) <noreply@github.com>
Builds one TulipaExpression per operational cost type (flows,
vintage_flows, units_on) before the objective is assembled, so the
CVaR constraint can read precomputed per-scenario sums directly.
Renames units_on_cost.jl to units_on_operational_cost.jl for
consistency. Splits prepare_objective_tables! out of add_objective!
so discount-table preparation runs before expression building.

Co-Authored-By: GitHub Copilot (claude-sonnet-4-6) <noreply@github.com>
Builds total_cost_per_scenario as a TulipaExpression by summing the
three precomputed per-scenario cost expressions. Creates tail excess
constraints xi_s >= cost_s - mu using row.id-based access throughout,
eliminating the _scenario_cost_lookup Dict and any |> collect on CVaR
indices. Registers :cvar and :objective tags in TAGS_DATA and replaces
the outdated CVaR objective test with an updated one.

Co-Authored-By: GitHub Copilot (claude-sonnet-4-6) <noreply@github.com>
Co-authored-by: Abel Soares Siqueira <abel.siqueira@esciencecenter.nl>
Co-authored-by: Abel Soares Siqueira <abel.s.siqueira@gmail.com>
Co-authored-by: Abel Soares Siqueira <abel.siqueira@esciencecenter.nl>
Fix test assertion for cost per scenario in tail excess constraints
@datejada

Copy link
Copy Markdown
Member

close in favour of #1631

@datejada datejada closed this Jun 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants