Repository navigation
Conversation
tsmbland
force-pushed
the
simulation_mode_refactor_v2
branch
from
November 16, 2026 08:57
8c50734 to
e3f7ea3
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## remove_shadow_scarcity_strategies #1592 +/- ##
=====================================================================
+ Coverage 82.67% 82.80% +0.13%
=====================================================================
Files 69 72 +3
Lines 9986 10115 +129
Branches 9986 10115 +129
=====================================================================
+ Hits 8256 8376 +120
- Misses 1452 1465 +13
+ Partials 278 274 -4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
tsmbland
force-pushed
the
simulation_mode_refactor_v2
branch
5 times, most recently
from
November 16, 2026 13:32
2e0ea01 to
49a9b70
Compare
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Move the partial dispatch runs out of the shared investment and market code into a PartialDispatch implementation, and remove shadow prices from Prices. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
output.rs no longer depends on dispatch internals. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
tsmbland
force-pushed
the
simulation_mode_refactor_v2
branch
from
November 16, 2026 15:00
49a9b70 to
ecf145d
Compare
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the simulation-protocol refactor.
No open issues 🎉
What changed in this PR
Refactors MUSE2’s simulation code to support multiple protocols, preparing for agent-level dispatch in #1593 while retaining system_dispatch as the only available mode and default behaviour.
Changes:
- Adds the
simulation_protocolsetting and moves the existing simulation loop into a dedicated module. - Introduces
FlowEstimatorto separate demand propagation from dispatch, and extracts shared optimisation helpers. - Relocates dispatch debug output and tests, updates benchmark references, and documents protocol selection.
| File | Description |
|---|---|
src/simulation/system_dispatch/output.rs |
Houses dispatch debug output and its tests. |
src/simulation/system_dispatch/optimisation/constraints.rs |
Uses the shared asset-grouping helper. |
src/simulation/system_dispatch/optimisation.rs |
Uses shared solver helpers and relocated debug output. |
src/simulation/system_dispatch.rs |
Encapsulates the existing simulation loop and partial dispatch. |
src/simulation/prices.rs |
Separates shared prices from dispatch-specific shadow prices. |
src/simulation/market.rs |
Delegates cycle flow estimation to FlowEstimator. |
src/simulation/investment/portfolio/optimisation.rs |
Imports shared solver helpers. |
src/simulation/investment/portfolio.rs |
Generalises the price parameter documentation. |
src/simulation/investment/competitive/optimisation.rs |
Imports shared optimisation helpers. |
src/simulation/investment/competitive/constraints.rs |
Imports the shared asset-grouping helper. |
src/simulation/investment/competitive.rs |
Generalises the price parameter documentation. |
src/simulation/investment.rs |
Defines and integrates the flow-estimation interface. |
src/simulation.rs |
Defines protocol selection and delegates execution. |
src/output.rs |
Removes dispatch-specific output responsibilities. |
src/optimisation.rs |
Centralises solver and asset-grouping helpers. |
src/model/parameters.rs |
Adds the protocol setting, default and parsing tests. |
src/lib.rs |
Registers the shared optimisation module. |
src/graph/investment.rs |
Uses shared solver helpers. |
schemas/input/model.yaml |
Documents protocol selection and related settings. |
docs/release_notes/upcoming.md |
Announces the optional protocol setting. |
docs/model/README.md |
Explains the shared lifecycle and system-dispatch protocol. |
docs/model/dispatch_optimisation.md |
Identifies the protocol using this formulation. |
docs/developer_guide/custom_highs_options.md |
Clarifies the scope of dispatch solver options. |
benches/assets.rs |
Updates dispatch imports and price-result handling. |
Review effort: Balanced
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The new approach will be do do-away with full-system dispatch and use agent-level activities directly, but I didn't want to remove all this code yet. The aim here is to refactor the code so it can support multiple simulation "modes". One mode will use full-system dispatch to get activities (and partial system dispatch to get intermediate demands), and the other one (#1593) will use agent-level activities directly.
This PR just does the necessary refactoring so that #1593 can slot in a second mode.
Fixes # (issue)
Type of change
Key checklist
$ cargo test$ cargo docpresent in the previous release
Further checks