libROM  v1.0
Data-driven physical simulation library
Public Member Functions | List of all members
CAROM::DifferentialEvolution Class Reference

#include <DifferentialEvolution.h>

Public Member Functions

 DifferentialEvolution (const IOptimizable &costFunction, unsigned int populationSize, double F=0.8, double CR=0.9, int randomSeed=1, bool shouldCheckConstraints=true, std::function< void(const DifferentialEvolution &)> callback=nullptr, std::function< bool(const DifferentialEvolution &)> terminationCondition=nullptr)
 Constructor. More...
 
std::vector< double > Optimize (int min_iterations, int max_iterations, double cost_tolerance, bool verbose=true)
 Constructor. More...
 

Detailed Description

Class DifferentialEvolution is a general purpose black box optimizer for the class IOptimizable.

Definition at line 120 of file DifferentialEvolution.h.

Constructor & Destructor Documentation

◆ DifferentialEvolution()

CAROM::DifferentialEvolution::DifferentialEvolution ( const IOptimizable costFunction,
unsigned int  populationSize,
double  F = 0.8,
double  CR = 0.9,
int  randomSeed = 1,
bool  shouldCheckConstraints = true,
std::function< void(const DifferentialEvolution &)>  callback = nullptr,
std::function< bool(const DifferentialEvolution &)>  terminationCondition = nullptr 
)

Constructor.

Parameters
[in]costFunctionCost function to minimize
[in]populationSizeNumber of agents in each optimization step
[in]FThe differential weight.
[in]CRThe crossover probability.
[in]randomSeedSet random seed to a fix value to have repeatable (non stochastic) experiments
[in]shouldCheckConstraintsShould constraints be checked on for each new candidate. This check may be turned off to increase performance if the cost function is defined and has no local minimum outside of the constraints.
[in]callbackOptional callback to be called after each optimization iteration has finished.
[in]terminationConditionOptional termination condition callback to be called after each optimization iteration has finished.

Definition at line 22 of file DifferentialEvolution.cpp.

Member Function Documentation

◆ Optimize()

std::vector< double > CAROM::DifferentialEvolution::Optimize ( int  min_iterations,
int  max_iterations,
double  cost_tolerance,
bool  verbose = true 
)

Constructor.

Parameters
[in]min_iterationsThe minimum number of iterations to run. Cost tolerance is not checked until then.
[in]max_iterationsThe maximum number of iterations to run.
[in]cost_toleranceThe cost tolerance to determine convergence.
[in]verboseVerbosity.

Definition at line 66 of file DifferentialEvolution.cpp.


The documentation for this class was generated from the following files: