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( MaximumIteration, unsigned int );
00093 itkGetConstMacro( MaximumIteration, unsigned int );
00094
00096 itkGetConstMacro( GrowthFactor, double );
00097
00099 itkGetConstMacro( ShrinkFactor, double );
00100
00102 itkGetConstMacro( InitialRadius, double );
00103
00106 itkSetMacro( Epsilon, double );
00107 itkGetConstMacro( Epsilon, double );
00108
00109 void SetNormalVariateGenerator(NormalVariateGeneratorType* generator) ;
00110
00117 void Initialize(double initialRadius, double grow = -1, double shrink = -1) ;
00118
00119 MeasureType GetCurrentCost()
00120 { return m_CurrentCost ; }
00121
00122 itkGetConstMacro( CurrentIteration, unsigned int) ;
00126 void StartOptimization() ;
00127
00131 void StopOptimization()
00132 { m_Stop = true ; }
00133
00134 protected:
00135 OnePlusOneEvolutionaryOptimizer() ;
00136 virtual ~OnePlusOneEvolutionaryOptimizer() ;
00137 void PrintSelf(std::ostream& os, Indent indent) const;
00138
00139 private:
00140
00142 NormalVariateGeneratorType* m_RandomGenerator ;
00143
00145 unsigned int m_MaximumIteration ;
00146
00148 unsigned int m_CurrentIteration ;
00149
00152 double m_Epsilon ;
00153
00155 double m_InitialRadius ;
00156
00158 double m_GrowthFactor ;
00159
00161 double m_ShrinkFactor ;
00162
00164 bool m_Initialized ;
00165
00167 MeasureType m_CurrentCost;
00168
00173 bool m_Stop ;
00174 } ;
00175
00176 }
00177
00178 #endif