QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
|
Clubs Topology. More...
#include <particleswarmoptimization.hpp>
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< Size > | bestByClub_ |
std::vector< Size > | worstByClub_ |
std::mt19937 | generator_ |
std::uniform_int_distribution< QuantLib::Size > | distribution_ |
Additional Inherited Members | |
Protected Attributes inherited from ParticleSwarmOptimization::Topology | |
ParticleSwarmOptimization * | pso_ |
std::vector< Array > * | X_ |
std::vector< Array > * | V_ |
std::vector< Array > * | pBX_ |
std::vector< Array > * | gBX_ |
Array * | pBF_ |
Array * | gBF_ |
Clubs Topology.
Definition at line 401 of file particleswarmoptimization.hpp.
|
private |
Definition at line 419 of file particleswarmoptimization.hpp.
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.
|
overridevirtual |
initialize state for current problem
Implements ParticleSwarmOptimization::Topology.
Definition at line 262 of file particleswarmoptimization.cpp.
|
overridevirtual |
produce changes to PSO state for current iteration
Implements ParticleSwarmOptimization::Topology.
Definition at line 286 of file particleswarmoptimization.cpp.
Definition at line 369 of file particleswarmoptimization.cpp.
Definition at line 385 of file particleswarmoptimization.cpp.
|
private |
Definition at line 410 of file particleswarmoptimization.hpp.
|
private |
Definition at line 410 of file particleswarmoptimization.hpp.
|
private |
Definition at line 410 of file particleswarmoptimization.hpp.
|
private |
Definition at line 410 of file particleswarmoptimization.hpp.
|
private |
Definition at line 411 of file particleswarmoptimization.hpp.
|
private |
Definition at line 411 of file particleswarmoptimization.hpp.
|
private |
Definition at line 412 of file particleswarmoptimization.hpp.
|
private |
Definition at line 413 of file particleswarmoptimization.hpp.
|
private |
Definition at line 414 of file particleswarmoptimization.hpp.
|
private |
Definition at line 415 of file particleswarmoptimization.hpp.
|
private |
Definition at line 416 of file particleswarmoptimization.hpp.
|
private |
Definition at line 417 of file particleswarmoptimization.hpp.
|
private |
Definition at line 418 of file particleswarmoptimization.hpp.