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
00023 namespace itk
00024 {
00025
00068 class ITK_EXPORT OnePlusOneEvolutionaryOptimizer:
00069 public SingleValuedNonLinearOptimizer
00070 {
00071 public:
00073 typedef OnePlusOneEvolutionaryOptimizer Self ;
00074 typedef SingleValuedNonLinearOptimizer Superclass;
00075 typedef SmartPointer<Self> Pointer;
00076 typedef SmartPointer<const Self> ConstPointer;
00077
00079 itkNewMacro(Self);
00080
00082 itkTypeMacro(OnePlusOneEvolutionaryOptimizer, SingleValuedNonLinearOptimizer );
00083
00085 typedef SingleValuedCostFunction CostFunctionType;
00086 typedef CostFunctionType::Pointer CostFunctionPointer;
00087
00089 typedef Statistics::RandomVariateGeneratorBase NormalVariateGeneratorType ;
00090
00092 itkSetMacro( Maximize, bool );
00093 itkBooleanMacro( Maximize );
00094
00096 itkSetMacro( MaximumIteration, unsigned int );
00097 itkGetConstReferenceMacro( MaximumIteration, unsigned int );
00098
00100 itkSetMacro( GrowthFactor, double );
00101 itkGetConstReferenceMacro( GrowthFactor, double );
00102
00104 itkSetMacro( ShrinkFactor, double );
00105 itkGetConstReferenceMacro( ShrinkFactor, double );
00106
00108 itkSetMacro( InitialRadius, double ) ;
00109 itkGetConstReferenceMacro( InitialRadius, double );
00110
00111
00114 itkSetMacro( Epsilon, double );
00115 itkGetConstReferenceMacro( Epsilon, double );
00116
00118 itkGetConstReferenceMacro( FrobeniusNorm, double );
00119
00120 void SetNormalVariateGenerator(NormalVariateGeneratorType* generator) ;
00121
00128 void Initialize(double initialRadius, double grow = -1, double shrink = -1) ;
00129
00131 itkGetConstReferenceMacro( CurrentCost, MeasureType );
00132 MeasureType GetValue() const { return this->GetCurrentCost(); }
00133
00135 itkGetConstReferenceMacro( CurrentIteration, unsigned int) ;
00136
00140 void StartOptimization() ;
00141
00145 void StopOptimization()
00146 { m_Stop = true ; }
00147
00148 protected:
00149 OnePlusOneEvolutionaryOptimizer() ;
00150 OnePlusOneEvolutionaryOptimizer(const OnePlusOneEvolutionaryOptimizer&) ;
00151 virtual ~OnePlusOneEvolutionaryOptimizer() ;
00152 void PrintSelf(std::ostream& os, Indent indent) const;
00153
00154 private:
00155
00157 NormalVariateGeneratorType::Pointer m_RandomGenerator ;
00158
00160 unsigned int m_MaximumIteration ;
00161
00163 unsigned int m_CurrentIteration ;
00164
00166 bool m_Maximize;
00167
00170 double m_Epsilon ;
00171
00173 double m_InitialRadius ;
00174
00176 double m_GrowthFactor ;
00177
00179 double m_ShrinkFactor ;
00180
00182 bool m_Initialized ;
00183
00185 MeasureType m_CurrentCost;
00186
00191 bool m_Stop ;
00192
00195 double m_FrobeniusNorm;
00196
00197 } ;
00198
00199 }
00200
00201 #endif