Skip to content

Use market prices for competitive algorithm appraisal - #1587

Open
tsmbland wants to merge 2 commits into
cumulative_appraisalfrom
competitive_algorithm_market_prices
Open

tsmbland wants to merge 2 commits into
cumulative_appraisalfrom
competitive_algorithm_market_prices

Conversation

@tsmbland

@tsmbland tsmbland commented Nov 10, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Modifying the competitive agent algorithm to use market prices instead of shadow prices. We want agents to be able to operate assets however they want, and it's market prices that matter. (Shadow prices are necessary if the goal is to minimise total system cost, but we're moving away from that)

Fixes # (issue)

Type of change

  • Bug fix (non-breaking change to fix an issue)
  • New feature (non-breaking change to add functionality)
  • Refactoring (non-breaking, non-functional change to improve maintainability)
  • Optimization (non-breaking change to speed up the code)
  • Breaking change (whatever its nature)
  • Documentation (improve or add documentation)

Key checklist

  • All tests pass: $ cargo test
  • The documentation builds and looks OK: $ cargo doc
  • Update release notes for the latest release if this PR adds a new feature or fixes a bug
    present in the previous release

Further checks

  • Code is commented, particularly in hard-to-understand areas
  • Tests added that prove fix is effective or that feature works

@tsmbland
tsmbland added this pull request to stack #1588 November 10, 2026 16:00
@tsmbland
tsmbland removed this pull request from stack #1588 November 11, 2026 16:29
@tsmbland
tsmbland added this pull request to stack #1594 November 11, 2026 16:29
@tsmbland
tsmbland force-pushed the competitive_algorithm_market_prices branch from 8cd1e73 to 9fb2696 Compare November 12, 2026 16:13
@codecov

codecov Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 3.70370% with 26 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.31%. Comparing base (ff73c3f) to head (3d79213).

Files with missing lines Patch % Lines
.../simulation/investment/competitive/coefficients.rs 0.00% 16 Missing ⚠️
src/simulation/investment/competitive.rs 0.00% 8 Missing ⚠️
src/simulation/investment/competitive/metrics.rs 33.33% 2 Missing ⚠️
Additional details and impacted files
@@                   Coverage Diff                    @@
##           cumulative_appraisal    #1587      +/-   ##
========================================================
+ Coverage                 82.25%   82.31%   +0.06%     
========================================================
  Files                        68       68              
  Lines                      9820     9812       -8     
  Branches                   9820     9812       -8     
========================================================
  Hits                       8077     8077              
+ Misses                     1464     1456       -8     
  Partials                    279      279              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@tsmbland
tsmbland force-pushed the competitive_algorithm_market_prices branch 4 times, most recently from c01f43a to 5a9f0ac Compare November 16, 2026 10:54
@tsmbland
tsmbland requested a balanced review from Copilot November 16, 2026 11:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The price-source change lacks a behavioral regression test using competitive agents and differing market and shadow prices to catch a reversion to shadow-price appraisal.

1 open issue
What changed in this PR

This PR switches competitive-agent investment appraisal from shadow prices to market prices, supporting the planned move towards agent-level operating decisions.

Changes:

  • Use market prices for appraisal activity coefficients while retaining fallback incentives.
  • Rename market_costs to metric_costs and simplify coefficient calculations.
  • Update model documentation and schema notes to reflect the new pricing basis.
File Description
src/​simulation/​investment/​competitive/​output.rs Update the test fixture to use metric_costs.
src/​simulation/​investment/​competitive/​optimisation.rs Revise comments about equal-cost solutions.
src/​simulation/​investment/​competitive/​metrics.rs Use the renamed metric-cost field.
src/​simulation/​investment/​competitive/​coefficients.rs Calculate activity coefficients from market prices and simplify metric costs.
src/​simulation/​investment/​competitive.rs Pass market and fallback prices explicitly to coefficient calculation.
schemas/​input/​model.yaml Describe fallback pricing relative to market prices.
docs/​model/​dispatch_optimisation.md Remove shadow-price appraisal claims.
docs/​model/​agents.md Align appraisal explanations and equations with market pricing.

Review effort: Balanced

model,
objective_type,
&opt_assets,
&prices.market,
@tsmbland
tsmbland force-pushed the competitive_algorithm_market_prices branch 3 times, most recently from 6ac8210 to 8c5771f Compare November 16, 2026 13:32
@tsmbland
tsmbland marked this pull request as ready for review November 16, 2026 13:34
@tsmbland
tsmbland requested a review from alexdewar November 16, 2026 13:34
@tsmbland
tsmbland force-pushed the competitive_algorithm_market_prices branch from 8c5771f to 3d79213 Compare November 16, 2026 15:00

This branch has not been deployed

No deployments
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