Utility to create problem instances dynamically.
More...
#include <ProblemFactory.h>
|
| static std::shared_ptr< Problem > | create (int id) |
| | Factory method to instantiate a specific benchmark problem.
|
|
static OptResult | optimizeDE (int id, double f, double cr, size_t maxGenerations, size_t popSize, unsigned long seed, size_t dimensions, std::string &mutationStrategy, std::string &crossoverStrategy) |
Utility to create problem instances dynamically.
◆ create()
| std::shared_ptr< Problem > ProblemFactory::create |
( |
int | id | ) |
|
|
static |
Factory method to instantiate a specific benchmark problem.
- Parameters
-
| id | Integer ID corresponding to the desired problem (e.g., 1 for Ackley, 2 for DeJong). |
- Returns
- std::unique_ptr<Problem> A pointer to the newly created problem instance.
- Exceptions
-
| std::invalid_argument | if the ID does not match a known problem. |
The documentation for this class was generated from the following files:
- src/opti_py/cpp/include/opti_py/ProblemFactory.h
- src/opti_py/cpp/src/ProblemFactory.cpp