Conversation
Co-authored-by: jolutz <81515870+jolutz@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Make the bias towards the average of the time over the remaining laps configurable from the settings section.
Add configurable time bias factor to karma calculation algorithm
Jul 12, 2025
Owner
|
The parameter shouldn't control how fast the car is but how strongly the selection is biased towards the average |
… time Co-authored-by: jolutz <81515870+jolutz@users.noreply.github.com>
Author
Fixed in commit 465fb18. The bias factor now controls how strongly the selection is biased towards the average time, rather than shifting the target time itself. The algorithm now calculates the true mathematical average and uses the bias factor to control the weighting strength in the selection process. |
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.
Overview
This PR implements a configurable bias factor for the average time calculation in the karma algorithm, addressing the requirement to make the bias towards the average of the time over the remaining laps configurable from the settings section.
Changes Made
Algorithm Updates
fallback_strategy(): Uses(remaining_target / remaining_needed) * bias_factorselect_candidate(): Uses((target - current_sum) / remaining_needed) * bias_factorKarmaArgsstruct for worker communicationConfiguration
src/config.rs:DEFAULT_TIME_BIAS_FACTOR = 1.0MIN_TIME_BIAS_FACTOR = 0.5MAX_TIME_BIAS_FACTOR = 2.0UI Implementation
Behavior
The bias factor controls car selection preferences:
Example
With target 9000ms, current sum 3000ms, and 2 remaining cars needed:
Screenshot
The new field appears in the Settings section with clear labeling and help text to guide users.
Backward Compatibility
Files Modified
src/config.rs- Added bias factor configuration constantssrc/lib.rs- Updated core algorithm functions and signaturessrc/main.rs- Added UI controls, state management, and validationsrc/worker_agent.rs- Updated worker parametersThe implementation provides users with fine-grained control over the car selection algorithm while ensuring no disruption to existing usage patterns.
Warning
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
www.unpkg.com/tmp/cargo-installhd9p7S/release/build/minify-html-common-afec95f0a85adebb/build-script-build(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.