Abstract base class for all optimization algorithms.
virtual void setCallback(StepCallback cb)=0
virtual void setObjectiveFunction(ObjectiveFunction func)=0
Set the function to optimize (the "black box").
virtual void setMode(OptimizationMode mode)=0
Set the optimization goal.
virtual void step()=0
Perform a single iteration/generation of the algorithm.
virtual Solution getBestSolution() const =0
Get the best solution found so far.
virtual ~Optimizer()=default
std::function< void(const Solution ¤t_best, size_t iteration)> StepCallback
Callback invoked after each step/generation.
virtual void setBounds(const Coordinates &lower_bounds, const Coordinates &upper_bounds)=0
Define the search space boundaries (hyper-rectangle).
virtual Solution optimize()=0
Run the optimization loop until the stopping criterion is met.
OptimizationMode
Optimization goal.
std::function< Real(const Coordinates &)> ObjectiveFunction
Objective function signature.
std::vector< Real > Coordinates
A point in the N-dimensional search space.
Represents a candidate solution in the search space.
Core optimizer type definitions for the Monte Carlo toolkit.