Skip to content

Refactoring to allow multiple asset selection algorithms - #1577

Draft
tsmbland wants to merge 6 commits into
circularity_milpfrom
multi_investment_algorithms_prep
Draft

tsmbland wants to merge 6 commits into
circularity_milpfrom
multi_investment_algorithms_prep

Conversation

@tsmbland

@tsmbland tsmbland commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator

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

  • 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 and others added 6 commits November 4, 2026 11:47
Pure move: appraisal.rs becomes competitive/metrics.rs and the appraisal
submodules move alongside it, in preparation for supporting multiple asset
selection algorithms.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…module

select_best_assets, its helpers and the candidate/tranche logic move from
investment.rs and market.rs into investment/competitive.rs. No behaviour
change.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Option building and process exclusion move inside the algorithm, so
select_assets_for_single_market only computes demand portions and limits.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Allows modules such as asset selection algorithms to own their debug files,
which are created lazily on first write.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Remove appraisal-specific code from the output module. The competitive
algorithm now writes debug_asset_selection_competitive.csv and
debug_asset_selection_competitive_time_slices.csv via DataWriter::write_debug_rows.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The optional agent_type column selects the asset selection algorithm for each
agent. Currently the only option is `competitive` (the default), so existing
models are unaffected.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@tsmbland tsmbland changed the title Multi investment algorithms prep Refactoring to allow multiple investment algorithms Nov 4, 2026
@tsmbland tsmbland changed the title Refactoring to allow multiple investment algorithms Refactoring to allow multiple asset selection algorithms Nov 4, 2026

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.

1 participant