Repository navigation
Feature/memetic - #658
Open
luishpmendes wants to merge 4 commits into
Open
Feature/memetic#658luishpmendes wants to merge 4 commits into
luishpmendes wants to merge 4 commits into
Conversation
…ators - Implemented a snapping mechanism for decision vectors in `snap_udp` and `snap_udp_batch` to align with a grid, enhancing fitness evaluation. - Added tests for fitness rewriting capabilities in `population`, `problem`, and `thread_bfe` to ensure correctness and thread safety. - Introduced a new tutorial demonstrating the use of a rewriting decoder for a bi-objective traveling salesman problem using random keys. - Enhanced type traits to check for fitness rewriting capabilities in user-defined problems.
…_adaptive - nlopt and ipopt now rewrite the final solution they find (via problem::fitness_rewrite()) before comparing it with the selected individual; the points evaluated during the local optimisation are still plain evaluations. For rewriting problems, ipopt first projects its final point into the bounds, since Ipopt may relax them. - The penalized problem used internally by cstrs_self_adaptive now implements fitness_rewrite() and has_fitness_rewrite(), forwarding the rewriting to the original problem and caching the rewritten decision vectors, so that its inner algorithm stores them. - Document that cmaes and xnes deliberately never rewrite the decision vectors they sample, and how nlopt, ipopt and cstrs_self_adaptive handle rewriting. - Add regression tests: cstrs_self_adaptive forwarding and caching, nlopt/ipopt rewriting exactly the final solution, and cmaes/xnes never calling fitness_rewrite(). Problems which do not rewrite are not affected, and the archive formats are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
In the scout bee phase, the abandoned food source was replaced (and the population updated consistently), but the internal fitness array kept the fitness of the abandoned source. The subsequent comparisons and onlooker selection probabilities thus used a stale value. This changes the results of seeded bee_colony runs whenever a scout bee is triggered. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
The fitness_rewrite() and has_fitness_rewrite() methods of prob_inner_base and bfe_inner_base are not pure virtual, so that the specialisations of prob_inner and bfe_inner written outside pagmo (e.g., by pygmo) keep compiling. Test them via such specialisations: a binding written before the introduction of fitness_rewrite() does not rewrite and behaves as before, while a binding which advertises the rewriting capability without implementing it gets a not_implemented_error, with the decision vectors and the fevals counter left untouched. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
|
memetic algorithm can be implemented also in the current code as meta-problems though. The fitness of the meta-problem would call life long learning on the chromosome, returning a fitness that associated to the untouched chromosome. |
This branch has not been deployed
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.
Summary
This PR introduces optional in-place modification of decision vectors during fitness evaluation, enabling memetic optimization techniques such as BRKGA-style chromosome rewriting.
Changes
fitness_rewrite()andhas_fitness_rewrite()in the problem interface.Compatibility
The feature is optional and preserves existing behavior for problems that do not implement chromosome rewriting. Existing
fitness()interfaces remain unchanged.Motivation
Memetic algorithms often improve chromosomes during decoding through local search. This enhancement allows these improvements to be preserved in the population and inherited by subsequent generations.