25#ifndef quantlib_optimization_differential_evolution_hpp
26#define quantlib_optimization_differential_evolution_hpp
104 "Crossover probability (" << p
105 <<
") must be in [0,1] range");
111 QL_REQUIRE(
n>0,
"Positive number of population members required");
145 "Step size weight ("<< w
146 <<
") must be in [0,2] range");
183 std::vector<Array>& invCrossoverMask,
184 const Array& mutationProbabilities)
const;
187 const std::vector<Candidate>& population)
const;
198 void crossover(
const std::vector<Candidate>& oldPopulation,
199 std::vector<Candidate> & population,
200 const std::vector<Candidate>& mutantPopulation,
201 const std::vector<Candidate>& mirrorPopulation,
1-D array used in linear algebra.
Configuration & withInitialPopulation(const std::vector< Array > &c)
std::vector< Array > initialPopulation
Configuration & withUpperBound(const Array &u)
Configuration & withBounds(bool b=true)
Configuration & withAdaptiveCrossover(bool b=true)
Configuration & withCrossoverType(CrossoverType t)
Configuration & withSeed(unsigned long s)
Configuration & withStepsizeWeight(Real w)
Real crossoverProbability
Configuration & withStrategy(Strategy s)
Configuration & withCrossoverProbability(Real p)
Configuration & withPopulationMembers(Size n)
CrossoverType crossoverType
Configuration & withLowerBound(const Array &l)
Differential Evolution configuration object.
void fillInitialPopulation(std::vector< Candidate > &population, const Problem &p) const
Candidate bestMemberEver_
const Configuration & configuration() const
void adaptCrossover() const
DifferentialEvolution(const Configuration &configuration=Configuration())
void getCrossoverMask(std::vector< Array > &crossoverMask, std::vector< Array > &invCrossoverMask, const Array &mutationProbabilities) const
MersenneTwisterUniformRng rng_
void calculateNextGeneration(std::vector< Candidate > &population, Problem &costFunction) const
void crossover(const std::vector< Candidate > &oldPopulation, std::vector< Candidate > &population, const std::vector< Candidate > &mutantPopulation, const std::vector< Candidate > &mirrorPopulation, Problem &costFunction) const
Array currGenSizeWeights_
Array getMutationProbabilities(const std::vector< Candidate > &population) const
EndCriteria::Type minimize(Problem &p, const EndCriteria &endCriteria) override
minimize the optimization problem P
@ Rand1DiffWithPerVectorDither
@ EitherOrWithOptimalRecombination
@ Rand1SelfadaptiveWithRotation
Array rotateArray(Array inputArray) const
Configuration configuration_
void adaptSizeWeights() const
Criteria to end optimization process:
Abstract class for constrained optimization method.
Constrained optimization problem.
Abstract constraint class.
#define QL_ENSURE(condition, message)
throw an error if the given post-condition is not verified
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
ext::function< Real(Real)> b
std::size_t Size
size of a container
Abstract optimization problem class.