|
OptiPy
|
Encapsulates the complete output of a Differential Evolution optimization run. More...
#include <OptResult.h>
Public Attributes | |
Solution | |
| std::vector< double > | bestSolution |
| The best parameter vector found during optimization. | |
Fitness Values | |
| std::vector< double > | bestFitnesses |
| Convergence history: best fitness per generation. | |
| double | bestFitness |
| The best (lowest) fitness value found during optimization. | |
Encapsulates the complete output of a Differential Evolution optimization run.
OptResult contains all relevant data produced by DifferentialEvolution::optimize(), including the best solution discovered, its fitness value, and the convergence trajectory showing how fitness improved over generations.
Output from DifferentialEvolution::optimize():
When calling DifferentialEvolution::optimize(), the returned OptResult contains:
Data Relationships:
The fields are internally consistent:
Usage Example:
Thread Safety:
OptResult is not thread-safe for concurrent modifications. However, once fully constructed by the optimizer, it can be safely read by multiple threads without synchronization.
Typical Size:
For a 30-dimensional problem with 100 generations:
| double OptResult::bestFitness |
The best (lowest) fitness value found during optimization.
The minimum fitness achieved by the optimizer across all generations. This scalar represents the quality of the solution.
Semantics:
Relationship to bestFitnesses:
Example:
For Sphere function minimization:
Convergence Assessment:
Comparison Between Runs:
Statistical Analysis:
Unit and Scale:
| std::vector<double> OptResult::bestFitnesses |
Convergence history: best fitness per generation.
A record of the best fitness value found at each generation during the optimization. Enables analysis of how the optimization progressed and assessment of convergence behavior.
Content:
Size: maxGenerations (from optimizer call)
Indexing:
Invariant Properties:
Example Convergence:
Analysis Use Cases:
Visualization:
Parameter Tuning Based on Convergence:
| std::vector<double> OptResult::bestSolution |
The best parameter vector found during optimization.
The parameter vector that achieved the lowest (best) fitness value during the entire optimization run. This is the primary output of the optimizer representing the solution to the optimization problem.
Content:
Size: problem.dimension
Semantics:
Example:
For a 3D Rosenbrock minimization:
Access Pattern:
Post-Processing:
You may want to post-process the solution: