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
itkSetMacro( GrowthFactor,
double );
00100
itkGetConstMacro( GrowthFactor,
double );
00101
00103
itkSetMacro( ShrinkFactor,
double );
00104
itkGetConstMacro( ShrinkFactor,
double );
00105
00107
itkSetMacro( InitialRadius,
double ) ;
00108
itkGetConstMacro( InitialRadius,
double );
00109
00110
00113
itkSetMacro( Epsilon,
double );
00114
itkGetConstMacro( Epsilon,
double );
00115
00116
void SetNormalVariateGenerator(NormalVariateGeneratorType* generator) ;
00117
00124
void Initialize(
double initialRadius,
double grow = -1,
double shrink = -1) ;
00125
00126 MeasureType GetValue()
00127 {
return m_CurrentCost ; }
00128
00129
itkGetConstMacro( CurrentIteration,
unsigned int) ;
00133
void StartOptimization() ;
00134
00138
void StopOptimization()
00139 { m_Stop =
true ; }
00140
00141
protected:
00142 OnePlusOneEvolutionaryOptimizer() ;
00143 OnePlusOneEvolutionaryOptimizer(
const OnePlusOneEvolutionaryOptimizer&) ;
00144
virtual ~OnePlusOneEvolutionaryOptimizer() ;
00145
void PrintSelf(std::ostream& os,
Indent indent)
const;
00146
00147
private:
00148
00150 NormalVariateGeneratorType::Pointer m_RandomGenerator ;
00151
00153
unsigned int m_MaximumIteration ;
00154
00156
unsigned int m_CurrentIteration ;
00157
00159
bool m_Maximize;
00160
00163
double m_Epsilon ;
00164
00166
double m_InitialRadius ;
00167
00169
double m_GrowthFactor ;
00170
00172
double m_ShrinkFactor ;
00173
00175
bool m_Initialized ;
00176
00178 MeasureType m_CurrentCost;
00179
00184
bool m_Stop ;
00185 } ;
00186
00187 }
00188
00189
#endif