Repository navigation
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## agent_dispatch_simulation_protocol #1603 +/- ##
======================================================================
+ Coverage 75.45% 75.69% +0.24%
======================================================================
Files 73 79 +6
Lines 10246 10930 +684
Branches 10246 10930 +684
======================================================================
+ Hits 7731 8274 +543
- Misses 2244 2376 +132
- Partials 271 280 +9 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Critical capacity-handling errors can violate committed assets’ minimum activity bounds and round selected capacity twice, allowing dispatch beyond the returned asset’s capacity.
2 open issues
What changed in this PR
Adds a population agent type to MUSE2’s investment simulation. It represents entities with identical needs by appraising each asset against the full demand profile, then selecting assets in merit order.
Changes:
- Registers population agents in model input and market execution.
- Implements profile optimisation, cost ranking, capacity selection and debug output, with initial tests.
- Documents the new agent’s behaviour and adds a release note.
| File | Description |
|---|---|
src/simulation/market.rs |
Routes population agents to their selection algorithm. |
src/simulation/investment/population/output.rs |
Adds appraisal debug output and a serialisation test. |
src/simulation/investment/population/optimisation.rs |
Optimises each option against the full demand profile. |
src/simulation/investment/population/metrics.rs |
Ranks appraisals by cost and asset tie-break rules. |
src/simulation/investment/population/costs.rs |
Calculates annual fixed costs for appraisal. |
src/simulation/investment/population/constraints.rs |
Defines availability, demand and utilisation constraints. |
src/simulation/investment/population.rs |
Implements asset selection, capacity limits and initial tests. |
src/simulation/investment.rs |
Exposes the population module. |
src/input/agent.rs |
Tests parsing the population agent type. |
src/agent.rs |
Adds the Population enum variant. |
schemas/input/agents.yaml |
Allows and describes population agents in input. |
docs/release_notes/upcoming.md |
Announces the new agent type. |
docs/model/investment.md |
Documents population capacity and retention behaviour. |
docs/model/agents.md |
Explains population appraisal and asset selection. |
Review effort: Balanced
Comment on lines
+224
to
+228
| let selected_capacity = capacity_for_remaining_demand( | ||
| appraisal.capacity, | ||
| remaining_demand_fraction(demand, &remaining_demand), | ||
| ) | ||
| .min(appraisal.asset.active_capacity()); |
| continue; | ||
| } | ||
|
|
||
| let selected_asset = selected_asset(&appraisal.asset, selected_capacity, agent); |
tsmbland
force-pushed
the
population_agents
branch
from
November 17, 2026 14:33
72bc2ab to
e99c82e
Compare
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
Adds a new agent type, as described in the docs
Fixes # (issue)
Type of change
Key checklist
$ cargo test$ cargo docpresent in the previous release
Further checks