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

K-Neighbor Topology. More...

#include <particleswarmoptimization.hpp>

+ Inheritance diagram for KNeighbors:
+ Collaboration diagram for KNeighbors:

Public Member Functions

 KNeighbors (Size K=1)
 
void setSize (Size M) override
 initialize state for current problem More...
 
void findSocialBest () override
 produce changes to PSO state for current iteration More...
 
- Public Member Functions inherited from ParticleSwarmOptimization::Topology
virtual ~Topology ()=default
 
virtual void setSize (Size M)=0
 initialize state for current problem More...
 
virtual void findSocialBest ()=0
 produce changes to PSO state for current iteration More...
 

Private Attributes

Size K_
 
Size M_
 

Additional Inherited Members

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

Detailed Description

K-Neighbor Topology.

Definition at line 376 of file particleswarmoptimization.hpp.

Constructor & Destructor Documentation

◆ KNeighbors()

KNeighbors ( Size  K = 1)

Definition at line 378 of file particleswarmoptimization.hpp.

Member Function Documentation

◆ setSize()

void setSize ( Size  M)
overridevirtual

initialize state for current problem

Implements ParticleSwarmOptimization::Topology.

Definition at line 381 of file particleswarmoptimization.hpp.

◆ findSocialBest()

void findSocialBest ( )
overridevirtual

produce changes to PSO state for current iteration

Implements ParticleSwarmOptimization::Topology.

Definition at line 208 of file particleswarmoptimization.cpp.

Member Data Documentation

◆ K_

Size K_
private

Definition at line 388 of file particleswarmoptimization.hpp.

◆ M_

Size M_
private

Definition at line 388 of file particleswarmoptimization.hpp.