itkOnePlusOneEvolutionaryOptimizer.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkOnePlusOneEvolutionaryOptimizer_h
00018 #define __itkOnePlusOneEvolutionaryOptimizer_h
00019
00020 #include <itkSingleValuedNonLinearOptimizer.h>
00021 #include <itkRandomVariateGeneratorBase.h>
00022 #include <string>
00023
00024 namespace itk
00025 {
00026
00069 class ITK_EXPORT OnePlusOneEvolutionaryOptimizer:
00070 public SingleValuedNonLinearOptimizer
00071 {
00072 public:
00074 typedef OnePlusOneEvolutionaryOptimizer Self;
00075 typedef SingleValuedNonLinearOptimizer Superclass;
00076 typedef SmartPointer<Self> Pointer;
00077 typedef SmartPointer<const Self> ConstPointer;
00078
00080 itkNewMacro(Self);
00081
00083 itkTypeMacro(OnePlusOneEvolutionaryOptimizer, SingleValuedNonLinearOptimizer );
00084
00086 typedef SingleValuedCostFunction CostFunctionType;
00087 typedef CostFunctionType::Pointer CostFunctionPointer;
00088
00090 typedef Statistics::RandomVariateGeneratorBase NormalVariateGeneratorType;
00091
00093 itkSetMacro( Maximize, bool );
00094 itkBooleanMacro( Maximize );
00096
00098 itkSetMacro( MaximumIteration, unsigned int );
00099 itkGetConstReferenceMacro( MaximumIteration, unsigned int );
00101
00103 itkSetMacro( GrowthFactor, double );
00104 itkGetConstReferenceMacro( GrowthFactor, double );
00106
00108 itkSetMacro( ShrinkFactor, double );
00109 itkGetConstReferenceMacro( ShrinkFactor, double );
00111
00113 itkSetMacro( InitialRadius, double );
00114 itkGetConstReferenceMacro( InitialRadius, double );
00116
00117
00120 itkSetMacro( Epsilon, double );
00121 itkGetConstReferenceMacro( Epsilon, double );
00123
00125 itkGetConstReferenceMacro( FrobeniusNorm, double );
00126
00127 void SetNormalVariateGenerator(NormalVariateGeneratorType* generator);
00128
00135 void Initialize(double initialRadius, double grow = -1, double shrink = -1);
00136
00138 itkGetConstReferenceMacro( CurrentCost, MeasureType );
00139 MeasureType GetValue() const { return this->GetCurrentCost(); }
00141
00143 itkGetConstReferenceMacro( CurrentIteration, unsigned int);
00144
00148 void StartOptimization();
00149
00153 void StopOptimization()
00154 { m_Stop = true; }
00155
00156 itkGetMacro(CatchGetValueException, bool);
00157 itkSetMacro(CatchGetValueException, bool);
00158
00159 itkGetMacro(MetricWorstPossibleValue, double);
00160 itkSetMacro(MetricWorstPossibleValue, double);
00161
00162 const std::string GetStopConditionDescription() const;
00163
00164 protected:
00165 OnePlusOneEvolutionaryOptimizer();
00166 OnePlusOneEvolutionaryOptimizer(const OnePlusOneEvolutionaryOptimizer&);
00167 virtual ~OnePlusOneEvolutionaryOptimizer();
00168 void PrintSelf(std::ostream& os, Indent indent) const;
00169
00170 private:
00171
00173 NormalVariateGeneratorType::Pointer m_RandomGenerator;
00174
00176 unsigned int m_MaximumIteration;
00177
00179 unsigned int m_CurrentIteration;
00180
00181 bool m_CatchGetValueException;
00182 double m_MetricWorstPossibleValue;
00183
00185 bool m_Maximize;
00186
00189 double m_Epsilon;
00190
00192 double m_InitialRadius;
00193
00195 double m_GrowthFactor;
00196
00198 double m_ShrinkFactor;
00199
00201 bool m_Initialized;
00202
00204 MeasureType m_CurrentCost;
00205
00210 bool m_Stop;
00211
00213 OStringStream m_StopConditionDescription;
00214
00217 double m_FrobeniusNorm;
00218
00219 };
00220
00221 }
00222
00223 #endif
00224