19 #ifndef itkParticleSwarmOptimizerBase_h 20 #define itkParticleSwarmOptimizerBase_h 24 #include "ITKOptimizersExport.h" 95 itkSetMacro( InitializeNormalDistribution,
bool )
96 itkGetMacro( InitializeNormalDistribution,
bool )
97 itkBooleanMacro( InitializeNormalDistribution )
104 void SetInitialSwarm( const SwarmType &initialSwarm );
113 itkSetMacro( PrintSwarm,
bool )
114 itkGetMacro( PrintSwarm,
bool )
115 itkBooleanMacro( PrintSwarm )
118 virtual
void StartOptimization(
void ) ITK_OVERRIDE;
123 void SetNumberOfParticles( NumberOfParticlesType n );
124 itkGetMacro( NumberOfParticles, NumberOfParticlesType )
128 itkSetMacro( MaximalNumberOfIterations, NumberOfIterationsType )
129 itkGetMacro( MaximalNumberOfIterations, NumberOfIterationsType )
135 itkSetMacro( NumberOfGenerationsWithMinimalImprovement, NumberOfGenerationsType )
136 itkGetMacro( NumberOfGenerationsWithMinimalImprovement, NumberOfGenerationsType )
163 itkSetMacro( FunctionConvergenceTolerance, MeasureType )
164 itkGetMacro( FunctionConvergenceTolerance, MeasureType )
168 void SetParametersConvergenceTolerance( ValueType convergenceTolerance,
172 itkGetMacro( PercentageParticlesConverged,
double )
173 itkSetMacro( PercentageParticlesConverged,
double )
184 itkSetMacro( UseSeed,
bool )
185 itkGetMacro( UseSeed,
bool )
186 itkBooleanMacro( UseSeed)
191 MeasureType GetValue() const;
194 virtual const
std::
string GetStopConditionDescription() const ITK_OVERRIDE;
200 void PrintSwarm(
std::ostream& os,
Indent indent ) const;
204 virtual ~ParticleSwarmOptimizerBase();
205 virtual
void PrintSelf(
std::ostream& os,
Indent indent ) const ITK_OVERRIDE;
210 virtual
void UpdateSwarm() = 0;
212 ParticleSwarmOptimizerBase( const Self& ) ITK_DELETE_FUNCTION;
213 void operator=( const Self& ) ITK_DELETE_FUNCTION;
215 virtual
void ValidateSettings();
220 virtual
void Initialize();
222 void RandomInitialization();
223 void FileInitialization();
226 std::ostringstream m_StopConditionDescription;
227 bool m_InitializeNormalDistribution;
228 NumberOfParticlesType m_NumberOfParticles;
229 NumberOfIterationsType m_MaximalNumberOfIterations;
230 NumberOfGenerationsType m_NumberOfGenerationsWithMinimalImprovement;
233 double m_PercentageParticlesConverged;
237 std::vector<MeasureType> m_FunctionBestValueMemory;
239 NumberOfIterationsType m_IterationIndex;
SmartPointer< Self > Pointer
std::vector< ParticleData > SwarmType
std::vector< std::pair< ParametersType::ValueType, ParametersType::ValueType > > ParameterBoundsType
This class is a base for the CostFunctions returning a single value.
Statistics::MersenneTwisterRandomVariateGenerator RandomVariateGeneratorType
unsigned int NumberOfParticlesType
CostFunctionType::MeasureType m_BestValue
MersenneTwisterRandom random variate generator.
ParametersType m_CurrentParameters
This class is a base for the Optimization methods that optimize a single valued function.
ParametersType::ValueType ValueType
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes...
ParticleSwarmOptimizerBase Self
unsigned int NumberOfIterationsType
CostFunctionType::MeasureType m_CurrentValue
ParametersType m_CurrentVelocity
SmartPointer< const Self > ConstPointer
unsigned int NumberOfGenerationsType
ParametersType m_BestParameters
SingleValuedNonLinearOptimizer Superclass
Control indentation during Print() invocation.
Abstract implementation of a Particle Swarm Optimization (PSO) algorithm.
CostFunctionType::MeasureType MeasureType