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

Clubs Topology. More...

#include <particleswarmoptimization.hpp>

+ Inheritance diagram for ClubsTopology:
+ Collaboration diagram for ClubsTopology:

Public Member Functions

 ClubsTopology (Size defaultClubs, Size totalClubs, Size maxClubs, Size minClubs, Size resetIteration, unsigned long seed=SeedGenerator::instance().get())
 
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 Types

using param_type = decltype(distribution_)::param_type
 

Private Member Functions

void leaveRandomClub (Size particle, Size currentClubs)
 
void joinRandomClub (Size particle, Size currentClubs)
 

Private Attributes

Size totalClubs_
 
Size maxClubs_
 
Size minClubs_
 
Size defaultClubs_
 
Size iteration_ = 0
 
Size resetIteration_
 
Size M_
 
std::vector< std::vector< bool > > clubs4particles_
 
std::vector< std::vector< bool > > particles4clubs_
 
std::vector< SizebestByClub_
 
std::vector< SizeworstByClub_
 
std::mt19937 generator_
 
std::uniform_int_distribution< QuantLib::Sizedistribution_
 

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

Clubs Topology.

Definition at line 401 of file particleswarmoptimization.hpp.

Member Typedef Documentation

◆ param_type

using param_type = decltype(distribution_)::param_type
private

Definition at line 419 of file particleswarmoptimization.hpp.

Constructor & Destructor Documentation

◆ ClubsTopology()

ClubsTopology ( Size  defaultClubs,
Size  totalClubs,
Size  maxClubs,
Size  minClubs,
Size  resetIteration,
unsigned long  seed = SeedGenerator::instance().get() 
)

Definition at line 243 of file particleswarmoptimization.cpp.

Member Function Documentation

◆ setSize()

void setSize ( Size  M)
overridevirtual

initialize state for current problem

Implements ParticleSwarmOptimization::Topology.

Definition at line 262 of file particleswarmoptimization.cpp.

◆ findSocialBest()

void findSocialBest ( )
overridevirtual

produce changes to PSO state for current iteration

Implements ParticleSwarmOptimization::Topology.

Definition at line 286 of file particleswarmoptimization.cpp.

+ Here is the call graph for this function:

◆ leaveRandomClub()

void leaveRandomClub ( Size  particle,
Size  currentClubs 
)
private

Definition at line 369 of file particleswarmoptimization.cpp.

+ Here is the caller graph for this function:

◆ joinRandomClub()

void joinRandomClub ( Size  particle,
Size  currentClubs 
)
private

Definition at line 385 of file particleswarmoptimization.cpp.

+ Here is the caller graph for this function:

Member Data Documentation

◆ totalClubs_

Size totalClubs_
private

Definition at line 410 of file particleswarmoptimization.hpp.

◆ maxClubs_

Size maxClubs_
private

Definition at line 410 of file particleswarmoptimization.hpp.

◆ minClubs_

Size minClubs_
private

Definition at line 410 of file particleswarmoptimization.hpp.

◆ defaultClubs_

Size defaultClubs_
private

Definition at line 410 of file particleswarmoptimization.hpp.

◆ iteration_

Size iteration_ = 0
private

Definition at line 411 of file particleswarmoptimization.hpp.

◆ resetIteration_

Size resetIteration_
private

Definition at line 411 of file particleswarmoptimization.hpp.

◆ M_

Size M_
private

Definition at line 412 of file particleswarmoptimization.hpp.

◆ clubs4particles_

std::vector<std::vector<bool> > clubs4particles_
private

Definition at line 413 of file particleswarmoptimization.hpp.

◆ particles4clubs_

std::vector<std::vector<bool> > particles4clubs_
private

Definition at line 414 of file particleswarmoptimization.hpp.

◆ bestByClub_

std::vector<Size> bestByClub_
private

Definition at line 415 of file particleswarmoptimization.hpp.

◆ worstByClub_

std::vector<Size> worstByClub_
private

Definition at line 416 of file particleswarmoptimization.hpp.

◆ generator_

std::mt19937 generator_
private

Definition at line 417 of file particleswarmoptimization.hpp.

◆ distribution_

std::uniform_int_distribution<QuantLib::Size> distribution_
private

Definition at line 418 of file particleswarmoptimization.hpp.