Add C++/Python ACO, PSO, GSA, fuzzy, and hybrid optimization - #22
Merged
Conversation
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
IContinuousOptimizerinterface, common result/configuration types, seeded populations, and a heterogeneous solution-transfer pipelinePython API
Python now exposes:
SearchConfig,ProgressState,ControlSignal, andOptimizationResultContinuousAntColonyOptimizer(ACOR) andGravitationalSearchOptimizerFuzzyCMeansand fully configurableFuzzyAdaptiveControllerGeneticAlgorithmAdapterandMetaheuristicPipelineAdaptiveControllerandContinuousOptimizerimplementationsThe bindings release the main GIL during optimization and safely reacquire it for Python fitness/controller callbacks. Smart-holder lifetime management keeps Python-defined controllers and optimizers valid while the C++ pipeline owns them.
User-controlled composition
MetaheuristicPipeline.add(...)FuzzyControllerConfigexposes membership thresholds, improvement scale, and every Sugeno consequentExisting GA improvements
For the default GA shape (
N=50, about 3 elites, crossover rate0.8), removing pre-mutation crossover evaluations reduces expected offspring objective calls from about 86.4 to 47 per generation (about 45.6%). The exact reduction depends on crossover rate and elite count.Validation
-Wall -Wextra -Wpedantic -Wshadow -Wconversion -Wsign-conversioncompile for modified headers/examples passedScope note
“Every ACO/PSO type” is not a finite set in the literature. This PR implements the major distinct families listed above and provides extension interfaces for additional C++ or Python optimizers without changing the user-defined pipeline.