19#ifndef itkParticleSwarmOptimizerBase_h
20#define itkParticleSwarmOptimizerBase_h
24#include "ITKOptimizersExport.h"
70 using ParameterBoundsType = std::vector<std::pair<ParametersType::ValueType, ParametersType::ValueType>>;
94 itkSetMacro(InitializeNormalDistribution,
bool);
95 itkGetMacro(InitializeNormalDistribution,
bool);
96 itkBooleanMacro(InitializeNormalDistribution);
115 itkSetMacro(PrintSwarm,
bool);
116 itkGetMacro(PrintSwarm,
bool);
117 itkBooleanMacro(PrintSwarm);
152 SetParameterBounds(std::pair<ParametersType::ValueType, ParametersType::ValueType> & bounds,
unsigned int n);
181 itkGetMacro(PercentageParticlesConverged,
double);
182 itkSetMacro(PercentageParticlesConverged,
double);
195 itkSetMacro(UseSeed,
bool);
196 itkGetMacro(UseSeed,
bool);
197 itkBooleanMacro(UseSeed);
245 std::ostringstream m_StopConditionDescription{};
246 bool m_InitializeNormalDistribution{};
252 double m_PercentageParticlesConverged{};
254 std::vector<ParticleData> m_Particles{};
256 std::vector<MeasureType> m_FunctionBestValueMemory{};
Control indentation during Print() invocation.
Light weight base class for most itk classes.
Abstract implementation of a Particle Swarm Optimization (PSO) algorithm.
ParameterBoundsType GetParameterBounds() const
void SetParameterBounds(std::pair< ParametersType::ValueType, ParametersType::ValueType > &bounds, unsigned int n)
unsigned int NumberOfGenerationsType
std::string GetStopConditionDescription() const override
void FileInitialization()
void RandomInitialization()
MeasureType GetValue() const
~ParticleSwarmOptimizerBase() override
void SetInitialSwarm(const SwarmType &initialSwarm)
virtual void ValidateSettings()
virtual void Initialize()
void PrintSelf(std::ostream &os, Indent indent) const override
void StartOptimization() override
virtual void UpdateSwarm()=0
CostFunctionType::MeasureType MeasureType
void PrintSwarm(std::ostream &os, Indent indent) const
ParticleSwarmOptimizerBase()
unsigned int NumberOfIterationsType
void PrintParamtersType(const ParametersType &x, std::ostream &os) const
void SetParametersConvergenceTolerance(ValueType convergenceTolerance, unsigned int sz)
void SetNumberOfParticles(NumberOfParticlesType n)
std::vector< std::pair< ParametersType::ValueType, ParametersType::ValueType > > ParameterBoundsType
virtual void SetParameterBounds(ParameterBoundsType &bounds)
std::vector< ParticleData > SwarmType
ParametersType::ValueType ValueType
unsigned int NumberOfParticlesType
This class is a base for the Optimization methods that optimize a single valued function.
MersenneTwisterRandom random variate generator.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
ParametersType m_CurrentParameters
ParametersType m_BestParameters
ParametersType m_CurrentVelocity
CostFunctionType::MeasureType m_CurrentValue
CostFunctionType::MeasureType m_BestValue