Skip to content

Add decision_lexico_order parameter to agent_objectives table#461

Merged
tsmbland merged 4 commits intomainfrom
lexico_order
Mar 20, 2025
Merged

Add decision_lexico_order parameter to agent_objectives table#461
tsmbland merged 4 commits intomainfrom
lexico_order

Conversation

@tsmbland
Copy link
Copy Markdown
Collaborator

@tsmbland tsmbland commented Mar 19, 2025

Description

Adding the decision_lexico_order parameter to the objectives table, and some validation

So far the validation is checking:

  • if decision rule is lexico, the decision_lexico_order must be specified, otherwise it mustn't be
  • the number of objectives will depend on the decision rule: if "single" there should be one objective in each year, if "weighted" there should be more than 1, and if "lexico" there should be 2 and these should have weights 1 and 2 (i.e. a primary and a secondary)

There is still more validation to do for the objectives such as ensuring weights add to 1 (see #458), so I imagine a lot of this will change when I come to tackle that

Fixes #457

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

Further checks

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

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 19, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.47%. Comparing base (78b707c) to head (3200df0).
Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #461      +/-   ##
==========================================
+ Coverage   95.40%   95.47%   +0.06%     
==========================================
  Files          31       31              
  Lines        4588     4658      +70     
  Branches     4588     4658      +70     
==========================================
+ Hits         4377     4447      +70     
  Misses        106      106              
  Partials      105      105              

☔ View full report in Codecov by Sentry.
📢 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 marked this pull request as ready for review March 19, 2025 13:33
@tsmbland tsmbland requested a review from alexdewar March 19, 2025 13:33
@tsmbland
Copy link
Copy Markdown
Collaborator Author

I wonder if there might be a better way to structure the data, such as storing the objectives within DecisionRule? Not sure

Copy link
Copy Markdown
Member

@alexdewar alexdewar left a comment

Choose a reason for hiding this comment

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

LGTM!

I guess you could store the objectives inside the decision rule enum, but I'd worry that that might make the code to access them a bit convoluted. The extra safety would be nice though. Maybe let's see how we end up using them and see if it makes sense further down the line.

@tsmbland tsmbland merged commit 2a58ffe into main Mar 20, 2025
7 checks passed
@tsmbland tsmbland deleted the lexico_order branch March 20, 2025 11:09
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.

Add decision_lexico_order parameter to agent_objectives table

2 participants