19 #ifndef itkParticleSwarmOptimizerBase_h
20 #define itkParticleSwarmOptimizerBase_h
24 #include "ITKOptimizersExport.h"
96 itkSetMacro( InitializeNormalDistribution,
bool )
97 itkGetMacro( InitializeNormalDistribution,
bool )
98 itkBooleanMacro( InitializeNormalDistribution )
105 void SetInitialSwarm( const
SwarmType &initialSwarm );
114 itkSetMacro( PrintSwarm,
bool )
115 itkGetMacro( PrintSwarm,
bool )
116 itkBooleanMacro( PrintSwarm )
119 void StartOptimization() override;
164 itkSetMacro( FunctionConvergenceTolerance,
MeasureType )
165 itkGetMacro( FunctionConvergenceTolerance,
MeasureType )
169 void SetParametersConvergenceTolerance( ValueType convergenceTolerance,
173 itkGetMacro( PercentageParticlesConverged,
double )
174 itkSetMacro( PercentageParticlesConverged,
double )
185 itkSetMacro( UseSeed,
bool )
186 itkGetMacro( UseSeed,
bool )
187 itkBooleanMacro( UseSeed)
195 const std::
string GetStopConditionDescription() const override;
201 void PrintSwarm( std::ostream& os,
Indent indent ) const;
205 ~ParticleSwarmOptimizerBase() override;
206 void PrintSelf( std::ostream& os,
Indent indent ) const override;
207 void PrintParamtersType( const
ParametersType& x, std::ostream& os ) const;
211 virtual
void UpdateSwarm() = 0;
213 virtual
void ValidateSettings();
218 virtual
void Initialize();
220 void RandomInitialization();
221 void FileInitialization();
224 std::ostringstream m_StopConditionDescription;
225 bool m_InitializeNormalDistribution;
231 double m_PercentageParticlesConverged;
This class is a base for the CostFunctions returning a single value.
Light weight base class for most itk classes.
std::vector< MeasureType > m_FunctionBestValueMemory
CostFunctionType::MeasureType m_BestValue
MersenneTwisterRandom random variate generator.
ParametersType::ValueType ValueType
std::vector< std::pair< ParametersType::ValueType, ParametersType::ValueType > > ParameterBoundsType
ParametersType m_CurrentParameters
This class is a base for the Optimization methods that optimize a single valued function.
RandomVariateGeneratorType::IntegerType m_Seed
unsigned int NumberOfParticlesType
CostFunctionType::MeasureType m_CurrentValue
ParametersType m_ParametersBestValue
ParametersType m_CurrentVelocity
CostFunctionType::MeasureType MeasureType
ParametersType m_BestParameters
unsigned int NumberOfIterationsType
std::vector< ParticleData > SwarmType
Control indentation during Print() invocation.
unsigned int NumberOfGenerationsType
Abstract implementation of a Particle Swarm Optimization (PSO) algorithm.