Repository navigation
Conversation
5d1baf8 to
9ea0958
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Critical agent-dispatch defects can leave demand unmet despite sufficient capacity, bypass commodity limits, and accept unbalanced cyclic flows, while the protocol change also breaks regression fixtures.
4 open issues
What changed in this PR
Adds agent_dispatch as MUSE2’s default simulation protocol, deriving commodity flows and prices directly from agents’ optimisations without system-wide dispatch.
Changes:
- Implements agent-driven dispatch, iterative investment pricing, and activity re-keying when assets are commissioned.
- Makes
agent_dispatchthe default and requires dangerous-options opt-in forsystem_dispatch. - Makes unmet demand in competitive appraisal an error and updates schemas and documentation.
| File | Description |
|---|---|
src/simulation/investment/competitive.rs |
Errors when appraisal leaves demand unmet. |
src/simulation/investment.rs |
Adds and tests commissioning with activity re-keying. |
src/simulation/agent_dispatch.rs |
Implements the agent-dispatch simulation lifecycle and flow estimator. |
src/simulation.rs |
Registers agent dispatch and makes it the default. |
src/model/parameters.rs |
Adds experimental-protocol validation and removes previous protocol-parsing tests. |
src/asset/pool.rs |
Clarifies returned asset ordering in documentation. |
schemas/input/model.yaml |
Documents both protocols, the new default, and opt-in requirements. |
docs/release_notes/upcoming.md |
Announces agent dispatch and the default change. |
docs/model/README.md |
Explains the new protocol and system-dispatch opt-in. |
docs/model/prices.md |
Describes activity-based pricing and documents full_average. |
docs/model/investment.md |
Updates flow propagation and unmet-demand behaviour. |
docs/model/commodity_graphs.md |
Makes demand-update descriptions protocol-neutral. |
docs/model/agents.md |
Updates price sourcing and competitive-appraisal failure behaviour. |
docs/glossary.md |
Revises dispatch, ironing-out, and pricing definitions. |
docs/developer_guide/custom_highs_options.md |
Clarifies that dispatch solver options remain system-dispatch-specific. |
Review effort: Balanced
| use anyhow::{Context, Result}; | ||
| use log::info; | ||
|
|
||
| /// Run the simulation using the `agent_dispatch` protocol. | ||
| /// | ||
| /// # Arguments: | ||
| /// | ||
| /// * `model` - The model to run | ||
| /// * `writer` - The data writer to which results are written | ||
| #[allow(clippy::too_many_lines)] | ||
| pub fn run(model: &Model, writer: &mut DataWriter) -> Result<()> { |
There was a problem hiding this comment.
Agree. Think we should hide commodity constraints behind the broken options guard (if not already).
| AgentRunMode::Dispatch, | ||
| &Prices::default(), |
There was a problem hiding this comment.
I think this is a known issue and fine for now
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## simulation_mode_refactor_v2 #1593 +/- ##
===============================================================
- Coverage 82.80% 75.45% -7.36%
===============================================================
Files 72 73 +1
Lines 10115 10246 +131
Branches 10115 10246 +131
===============================================================
- Hits 8376 7731 -645
- Misses 1465 2244 +779
+ Partials 274 271 -3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Flows and prices come directly from the activities determined by agents' own optimisations, with no system-wide dispatch. Adds Selection::commission, an AgentActivities FlowEstimator, schema/docs/release notes, and makes unmet demand in competitive appraisal an error for all protocols. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
d4ccfb3 to
88c5022
Compare

Flows and prices come directly from the activities determined by agents' own optimisations, with no system-wide dispatch. Adds Selection::commission, an AgentActivities FlowEstimator, schema/docs/release notes, and makes unmet demand in competitive appraisal an error for all protocols.
Description
Please include a summary of the change and which issue is fixed (if any). Please also
include relevant motivation and context. List any dependencies that are required for
this change.
Fixes # (issue)
Type of change
Key checklist
$ cargo test$ cargo docpresent in the previous release
Further checks