OptiPy
Loading...
Searching...
No Matches
ProblemFactory Class Reference

Utility to create problem instances dynamically. More...

#include <ProblemFactory.h>

Static Public Member Functions

static std::shared_ptr< Problemcreate (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)

Detailed Description

Utility to create problem instances dynamically.

Member Function Documentation

◆ create()

std::shared_ptr< Problem > ProblemFactory::create ( int id)
static

Factory method to instantiate a specific benchmark problem.

  • Parameters
    idInteger 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_argumentif 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