|
OptiPy
|
Implements the Particle Swarm Optimization algorithm. More...
#include <ParticleSwarm.h>
Public Member Functions | |
| ParticleSwarm (const ExperimentConfig &config, double c1, double c2, int popSize) | |
| std::vector< double > | optimize () override |
| Executes the Differential Evolution optimization process. | |
| Public Member Functions inherited from Optimizer | |
| Optimizer (std::shared_ptr< SolutionBuilder > solutionBuilder, std::shared_ptr< Problem > problem, int maxIterations) | |
| Constructs an Optimizer. | |
| virtual | ~Optimizer ()=default |
| Virtual destructor for safe polymorphic deletion. | |
| double | getBestFitness () |
| std::vector< double > & | getBestSolution () |
| std::vector< double > & | getBestFitnesses () |
| std::vector< std::vector< double > > & | getSolutions () |
| int | getMaxIterations () |
| std::shared_ptr< Problem > | getProblem () |
| std::shared_ptr< SolutionBuilder > | getSolutionBuilder () |
Additional Inherited Members | |
| Protected Attributes inherited from Optimizer | |
| std::shared_ptr< Problem > | problem |
| Optimization problem definition. | |
| std::shared_ptr< SolutionBuilder > | solutionBuilder |
| Solution generation utility. | |
| int | maxIterations |
| Maximum number of iterations. | |
| std::vector< double > | bestSolution |
| Best solution found. | |
| std::vector< double > | bestFitnesses |
| Best fitness value so far per iteration. | |
| std::vector< std::vector< double > > | solutions |
| All generated solutions. | |
Implements the Particle Swarm Optimization algorithm.
This optimizer simulates a swarm of particles moving in the search space, updating velocities and positions based on personal and global bests.
|
overridevirtual |
Executes the Differential Evolution optimization process.
Implements Optimizer.