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 void MaximizeOn() {m_Maximize=true;}
00093
00095 itkSetMacro( MaximumIteration, unsigned int );
00096 itkGetConstMacro( MaximumIteration, unsigned int );
00097
00099 itkGetConstMacro( GrowthFactor, double );
00100
00102 itkGetConstMacro( ShrinkFactor, double );
00103
00105 itkGetConstMacro( InitialRadius, double );
00106
00107
00110 itkSetMacro( Epsilon, double );
00111 itkGetConstMacro( Epsilon, double );
00112
00113 void SetNormalVariateGenerator(NormalVariateGeneratorType* generator) ;
00114
00121 void Initialize(double initialRadius, double grow = -1, double shrink = -1) ;
00122
00123 MeasureType GetValue()
00124 { return m_CurrentCost ; }
00125
00126 itkGetConstMacro( CurrentIteration, unsigned int) ;
00130 void StartOptimization() ;
00131
00135 void StopOptimization()
00136 { m_Stop = true ; }
00137
00138 protected:
00139 OnePlusOneEvolutionaryOptimizer() ;
00140 virtual ~OnePlusOneEvolutionaryOptimizer() ;
00141 void PrintSelf(std::ostream& os, Indent indent) const;
00142
00143 private:
00144
00146 NormalVariateGeneratorType* m_RandomGenerator ;
00147
00149 unsigned int m_MaximumIteration ;
00150
00152 unsigned int m_CurrentIteration ;
00153
00155 bool m_Maximize;
00156
00159 double m_Epsilon ;
00160
00162 double m_InitialRadius ;
00163
00165 double m_GrowthFactor ;
00166
00168 double m_ShrinkFactor ;
00169
00171 bool m_Initialized ;
00172
00174 MeasureType m_CurrentCost;
00175
00180 bool m_Stop ;
00181 } ;
00182
00183 }
00184
00185 #endif