Refactor GeneticAlgorithm to accept generations as a parameter in run_evolution#45
Refactor GeneticAlgorithm to accept generations as a parameter in run_evolution#45JacobBorden wants to merge 2 commits into
Conversation
- Removes `num_generations` from the `Optimization::GeneticAlgorithm` constructor. - Adds `num_generations` as the first parameter to the `run_evolution` method. - Updates all callers including `tests/test_benchmarks.cpp`, `tests/test_genetic_algorithm.cpp`, and `examples/basic_usage_export.cpp`. - Specifically resolves the hardcoded generations workaround in `tests/test_genetic_algorithm.cpp`. - Updates `README.md` and `docs/modules/optimization.md` to reflect these signature changes. Co-authored-by: JacobBorden <22827637+JacobBorden@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
PR steward note: leaving this blocked for a maintainer decision. The change is a public API shift for |
Understood. The changes address the requested refactor to make |
- Removes `num_generations` from the `Optimization::GeneticAlgorithm` constructor. - Adds `num_generations` as the first parameter to the `run_evolution` method. - Updates all callers including `tests/test_benchmarks.cpp`, `tests/test_genetic_algorithm.cpp`, and `examples/basic_usage_export.cpp`. - Specifically resolves the hardcoded generations workaround in `tests/test_genetic_algorithm.cpp`. - Updates `README.md` and `docs/modules/optimization.md` to reflect these signature changes. Co-authored-by: JacobBorden <22827637+JacobBorden@users.noreply.github.com>
JacobBorden
left a comment
There was a problem hiding this comment.
PR steward recheck for 2026-06-12: this remains blocked on a maintainer API decision. The diff moves num_generations from GeneticAlgorithm constructor state into run_evolution(...), updates docs/examples/tests around that public call shape, and the branch is still conflicting with current master. I am leaving it open rather than resolving conflicts in a direction that could break downstream callers without maintainer approval.
JacobBorden
left a comment
There was a problem hiding this comment.
PR steward recheck for 2026-06-15: this remains blocked for the same maintainer API decision. The branch changes the public GeneticAlgorithm call shape by moving num_generations into run_evolution(...), is still stale/conflicting against current master, and has no fresh visible checks. I am leaving it open rather than resolving conflicts without an explicit direction on the API change.
This PR addresses an issue where the
num_generationswas passed to theGeneticAlgorithmconstructor and held as an internal state variable. The refactoring instead makesnum_generationsan explicit parameter when calling therun_evolutionmethod. This allows an existingGeneticAlgorithminstance to cleanly run varying numbers of generations on separate evolution calls without re-instantiating.src/optimization/genetic_algorithm.hand.cpp.run_evolutionmethod signature is changed.PR created automatically by Jules for task 6766763341250922330 started by @JacobBorden