Add getLastRunBestChromosome() and release 0.3.0#3
Merged
Conversation
Expose the historical best solution of a run, which survives shake/reset, unlike getBestChromosome() (the current-population best that a later shake/reset may drop). - native: brkga_get_last_status_best_chromosome copies last_status.best_chromosome (the incumbent run() snapshots on every improvement), with bounds check + guard. - Java: BrkgaMpIpr.getLastRunBestChromosome() mirrors the getBestChromosome pattern via a new NativeBrkga handle; its fitness equals the AlgorithmStatus bestFitness that run() returns. Clarify getBestChromosome's javadoc to point here. - test: LastRunBestChromosomeTest covers throw-before-run, survival across forced shake/reset, and fitness matching the run's bestFitness. - Bump 0.2.0 -> 0.3.0 across POMs, examples brkga.version, README/GUIDE/JAVA_GUIDE dependency snippets and the native build script; add a README upgrade note that custom native libs must be rebuilt from 0.3.0 for the new symbol.
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.
What
Adds
getLastRunBestChromosome()— the historical best solution of a run, whichsurvives
shake/reset, unlikegetBestChromosome()(the current-population bestthat a later shake/reset may drop). Bumps the version to 0.3.0 for release.
Changes
brkga_bridge.cpp): newbrkga_get_last_status_best_chromosome, copyinglast_status.best_chromosome(the incumbentrun()snapshots on every improvement),with bounds check + exception guard.
BrkgaMpIpr,NativeBrkga): newgetLastRunBestChromosome()mirroring thegetBestChromosomepattern; its fitness equals theAlgorithmStatus.bestFitnessthatrun()returns. ClarifiesgetBestChromosome's javadoc to point here.LastRunBestChromosomeTest): throw-before-run, survival across forcedshake/reset, and fitness matching the run's
bestFitness.brkga.version,README/GUIDE/JAVA_GUIDE dependency snippets and the native build script; README upgrade
note that custom native libs must be rebuilt from 0.3.0 for the new symbol.
Notes
The native
.sois recompiled from source at build time, so the new symbol ships in thepublished artifact. Local build here is blocked by an ancient system g++ (9.4, no
<concepts>); CI (modern g++) is the authoritative build.