QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
LevyFlightInertia Class Reference

Levy Flight Inertia. More...

#include <particleswarmoptimization.hpp>

+ Inheritance diagram for LevyFlightInertia:
+ Collaboration diagram for LevyFlightInertia:

Public Member Functions

 LevyFlightInertia (Real alpha, Size threshold, unsigned long seed=SeedGenerator::instance().get())
 
void setSize (Size M, Size N, Real c0, const EndCriteria &endCriteria) override
 initialize state for current problem More...
 
void setValues () override
 produce changes to PSO state for current iteration More...
 
- Public Member Functions inherited from ParticleSwarmOptimization::Inertia
virtual ~Inertia ()=default
 
virtual void setSize (Size M, Size N, Real c0, const EndCriteria &endCriteria)=0
 initialize state for current problem More...
 
virtual void setValues ()=0
 produce changes to PSO state for current iteration More...
 

Protected Member Functions

void init (ParticleSwarmOptimization *pso) override
 
virtual void init (ParticleSwarmOptimization *pso)
 

Private Attributes

MersenneTwisterUniformRng rng_
 
std::mt19937 generator_
 
IsotropicRandomWalk< LevyFlightDistribution, std::mt19937 > flight_
 
Array personalBestF_
 
std::vector< SizeadaptiveCounter_
 
Real c0_
 
Size M_
 
Size N_
 
Size threshold_
 

Additional Inherited Members

- Protected Attributes inherited from ParticleSwarmOptimization::Inertia
ParticleSwarmOptimizationpso_
 
std::vector< Array > * X_
 
std::vector< Array > * V_
 
std::vector< Array > * pBX_
 
std::vector< Array > * gBX_
 
ArraypBF_
 
ArraygBF_
 
ArraylX_
 
ArrayuX_
 

Detailed Description

Levy Flight Inertia.

Definition at line 262 of file particleswarmoptimization.hpp.

Constructor & Destructor Documentation

◆ LevyFlightInertia()

LevyFlightInertia ( Real  alpha,
Size  threshold,
unsigned long  seed = SeedGenerator::instance().get() 
)

Definition at line 264 of file particleswarmoptimization.hpp.

Member Function Documentation

◆ setSize()

void setSize ( Size  M,
Size  N,
Real  c0,
const EndCriteria endCriteria 
)
overridevirtual

initialize state for current problem

Implements ParticleSwarmOptimization::Inertia.

Definition at line 269 of file particleswarmoptimization.hpp.

◆ setValues()

void setValues ( )
overridevirtual

produce changes to PSO state for current iteration

Implements ParticleSwarmOptimization::Inertia.

Definition at line 275 of file particleswarmoptimization.hpp.

+ Here is the call graph for this function:

◆ init()

void init ( ParticleSwarmOptimization pso)
overrideprotectedvirtual

Reimplemented from ParticleSwarmOptimization::Inertia.

Definition at line 297 of file particleswarmoptimization.hpp.

+ Here is the call graph for this function:

Member Data Documentation

◆ rng_

Definition at line 304 of file particleswarmoptimization.hpp.

◆ generator_

std::mt19937 generator_
private

Definition at line 305 of file particleswarmoptimization.hpp.

◆ flight_

IsotropicRandomWalk<LevyFlightDistribution, std::mt19937> flight_
private

Definition at line 306 of file particleswarmoptimization.hpp.

◆ personalBestF_

Array personalBestF_
private

Definition at line 307 of file particleswarmoptimization.hpp.

◆ adaptiveCounter_

std::vector<Size> adaptiveCounter_
private

Definition at line 308 of file particleswarmoptimization.hpp.

◆ c0_

Real c0_
private

Definition at line 309 of file particleswarmoptimization.hpp.

◆ M_

Size M_
private

Definition at line 310 of file particleswarmoptimization.hpp.

◆ N_

Size N_
private

Definition at line 310 of file particleswarmoptimization.hpp.

◆ threshold_

Size threshold_
private

Definition at line 311 of file particleswarmoptimization.hpp.