Merged
Conversation
…tness values Co-authored-by: HyperCodec <72839119+HyperCodec@users.noreply.github.com>
Co-authored-by: HyperCodec <72839119+HyperCodec@users.noreply.github.com>
Co-authored-by: HyperCodec <72839119+HyperCodec@users.noreply.github.com>
…values Fix SpeciatedFitnessEliminator observer to receive pre-division fitness values
There was a problem hiding this comment.
Pull request overview
Fixes SpeciatedFitnessEliminator so FitnessObservers are notified with raw fitness values (pre species-size division), while elimination logic continues to use the species-balanced (divided/multiplied) fitness values. This aligns observer reporting with the true fitness function output and updates the version as a hotfix.
Changes:
- Split fitness computation into raw vs species-adjusted values and ensure observers receive the raw values.
- Add an integration test asserting the observer sees pre-division fitness values.
- Bump workspace/crate versions to
1.4.1and update an example comment accordingly.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| genetic-rs-common/src/builtin/eliminator.rs | Computes raw+divided fitness separately; observer now receives raw fitness while selection uses divided fitness. |
| genetic-rs/tests/speciation.rs | Adds regression test ensuring observers see raw (pre-division) fitness values. |
| genetic-rs/examples/speciation.rs | Removes outdated note implying observer values are species-adjusted. |
| Cargo.toml | Bumps workspace version and workspace dependency versions to 1.4.1. |
| Cargo.lock | Updates lockfile versions to 1.4.1. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Fixes
FitnessObservers not being passed the actual fitness, but rather the adjusted fitness for species balancing.