Skip to content

Move decision_lexico_tolerance parameter to agents table#460

Merged
tsmbland merged 5 commits intomainfrom
lexico_tolerance
Mar 19, 2025
Merged

Move decision_lexico_tolerance parameter to agents table#460
tsmbland merged 5 commits intomainfrom
lexico_tolerance

Conversation

@tsmbland
Copy link
Copy Markdown
Collaborator

@tsmbland tsmbland commented Mar 18, 2025

Description

This moves the decision_lexico_tolerance parameter from the agent_objectives table over to the agents table, as we want the parameter to be defined at the agent level rather than the objective level.

I've incorporated the parameter into the DecisionRule enum as this applies specifically to DecisionRule::Lexicographical.

Initially, decision_rule and decision_lexico_tolerance are read in to AgentRaw as a String and Option<f64>, which are then parsed in read_agents_file_from_iter to create a DecisionRule which is stored in Agent

Done my best at the error handling, but there are probably some improvements to be made here

Fixes #454

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

@tsmbland tsmbland linked an issue Mar 18, 2025 that may be closed by this pull request
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 18, 2025

Codecov Report

Attention: Patch coverage is 83.33333% with 7 lines in your changes missing coverage. Please review.

Project coverage is 95.40%. Comparing base (c0e354b) to head (52a8abe).
Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
src/input/agent.rs 80.00% 5 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #460      +/-   ##
==========================================
- Coverage   95.53%   95.40%   -0.14%     
==========================================
  Files          31       31              
  Lines        4571     4588      +17     
  Branches     4571     4588      +17     
==========================================
+ Hits         4367     4377      +10     
- Misses        101      106       +5     
- Partials      103      105       +2     

☔ 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 18, 2025 18:59
@tsmbland tsmbland requested a review from alexdewar March 18, 2025 18:59
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.

Spotted a few things that are mostly stylistic, but otherwise looks good! Definitely nicer having that value inside the enum.

Comment thread src/input/agent.rs Outdated
Comment thread src/input/agent.rs Outdated
Comment thread src/input/agent.rs Outdated
@tsmbland tsmbland enabled auto-merge March 19, 2025 08:42
@tsmbland tsmbland merged commit 78b707c into main Mar 19, 2025
5 checks passed
@tsmbland tsmbland deleted the lexico_tolerance branch March 19, 2025 08:47
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.

Move decision_lexico_tolerance parameter to agents table

2 participants