Conversation
Co-authored-by: HyperCodec <72839119+HyperCodec@users.noreply.github.com>
Fix ActionIfIsolated::DoNothing infinite loop when all species are isolated
Rewrite speciation feature
…Cargo.toml Co-authored-by: HyperCodec <72839119+HyperCodec@users.noreply.github.com>
Co-authored-by: HyperCodec <72839119+HyperCodec@users.noreply.github.com>
…ayered-observer Add QoL trait impls to `LayeredObserver`
Co-authored-by: HyperCodec <72839119+HyperCodec@users.noreply.github.com>
Add examples to CI workflow, register missing example metadata, and add comprehensive test suite
There was a problem hiding this comment.
Pull request overview
This PR updates genetic-rs toward the 1.4.0 release by introducing a redesigned speciation core (shared in genetic-rs-common), updating builtin speciated eliminator/repopulator behavior, and adding a larger integration-test suite plus CI coverage for examples.
Changes:
- Add new
speciationmodule ingenetic-rs-common(Speciated,SpeciatedPopulation) and re-exportSpeciatedvia the prelude under thespeciationfeature. - Implement/update speciated builtin components (
SpeciatedFitnessEliminator,SpeciatedCrossoverRepopulator) and observer QoL (FitnessObserverlayering trait impls). - Add integration tests + feature-gated
[[test]]entries and run examples in CI; update speciation example + README text.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| genetic-rs/tests/speciation.rs | New integration tests covering speciated population grouping/iteration and speciated eliminator invariants. |
| genetic-rs/tests/simulation.rs | New integration tests for GeneticSim invariants and FitnessEliminator behavior. |
| genetic-rs/tests/repopulator.rs | New integration tests for builtin repopulators and FromParent. |
| genetic-rs/tests/knockout.rs | New integration tests for knockout eliminator behavior and helpers. |
| genetic-rs/tests/eliminator.rs | Adds tests validating new LayeredObserver trait impls (Default/Clone/Debug/Eq). |
| genetic-rs/examples/speciation.rs | Updates speciation example to new divergence-based API and new speciated wrappers. |
| genetic-rs/Cargo.toml | Adds [[example]] and [[test]] entries with required-features for gated execution. |
| genetic-rs-common/src/speciation.rs | New shared speciation API: Speciated + SpeciatedPopulation utilities. |
| genetic-rs-common/src/prelude.rs | Re-exports Speciated behind the speciation feature. |
| genetic-rs-common/src/lib.rs | Exposes new speciation module behind the speciation feature. |
| genetic-rs-common/src/builtin/repopulator.rs | Adds FromParent, Default for crossover repopulator, and rewrites speciated crossover repopulator logic. |
| genetic-rs-common/src/builtin/eliminator.rs | Adds closure observer impl and derives for LayeredObserver; introduces SpeciatedFitnessEliminator. |
| README.md | Adds ecosystem section and updates “minimal usage” wording. |
| .github/workflows/ci-cd.yml | Adds a job to run examples in CI. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@HyperCodec I've opened a new pull request, #149, to work on those changes. Once the pull request is ready, I'll request review from you. |
|
@HyperCodec I've opened a new pull request, #150, to work on those changes. Once the pull request is ready, I'll request review from you. |
Co-authored-by: HyperCodec <72839119+HyperCodec@users.noreply.github.com>
Broaden FitnessObserver blanket impl to accept FnMut closures
…rce invariants Co-authored-by: HyperCodec <72839119+HyperCodec@users.noreply.github.com>
Restrict `SpeciatedPopulation::species` to enforce non-empty species invariant
Many small internal rewrites/QoL features, as well as a complete rewrite of the speciation feature with tons of new functionality.