00001 00111 #ifndef _EvolutionaryMethod_h 00112 #define _EvolutionaryMethod_h 00113 00114 // SYSTEM INCLUDES 00115 // 00116 00117 // PROJECT INCLUDES 00118 // 00119 00120 // LOCAL INCLUDES 00121 // 00122 #include "../CrossoverMethod.h" 00123 #include "../DoubleParameter.h" 00124 #include "../FunctionBase.h" 00125 #include "../ProblemBase.h" 00126 #include "../Method.h" 00127 #include "../MutationMethod.h" 00128 #include "../SelectionMethod.h" 00129 #include "../EMStopCondition.h" 00130 //#include "EvolutionaryMethodIteration.h" 00131 00132 // FORWARD REFERENCES 00133 // 00134 00135 00136 class EvolutionaryMethod 00137 : public Method 00138 { 00139 public: 00140 00141 friend class EvolutionaryMethodPanel; 00142 friend class InitialRangeValidator; 00143 00144 // LIFECYCLE 00145 00148 ~EvolutionaryMethod(void); 00149 00150 // OPERATORS 00151 00152 // OPERATIONS 00153 00156 virtual std::auto_ptr<Method> Clone() const; 00157 00158 virtual void UpdateStartingConditions 00159 (const Result* result) const; 00160 00161 virtual void ResetStartingConditions() const; 00162 00163 // ACCESS 00164 00167 virtual const wxString& Name() const; 00168 00171 virtual MethodIdType Id() const; 00172 00175 static MethodIdType ClassId(); 00176 00177 virtual wxString ToString(bool standalone = true) const; 00178 00179 // INQUIRY 00180 00183 virtual bool CanHandle(const ProblemBase* pProblem) 00184 const; 00185 00186 virtual StopConditions AllowedStopConditions() const; 00187 00188 protected: 00189 00192 EvolutionaryMethod(void); 00193 00198 EvolutionaryMethod(const EvolutionaryMethod& from); 00199 00202 ColumnVector mInitialRangeMinBounds; 00203 ColumnVector mInitialRangeMaxBounds; 00204 mutable ColumnVector mRangeMinBounds; 00205 mutable ColumnVector mRangeMaxBounds; 00206 unsigned mNumberOfChromosomes; 00207 00210 DoubleParameter mSurvivalRate; 00213 DoubleParameter mRadioactivity; 00217 DoubleParameter mMutationRate; 00221 DoubleParameter mCrossoverRate; 00222 00223 CountedPtr<const SelectionMethod> mcpSelectionMethod; 00224 CountedPtr<const MutationMethod> mcpMutationMethod; 00225 CountedPtr<const CrossoverMethod> mcpCrossoverMethod; 00226 00229 CountedPtr<const EMStopCondition> mcpStopCondition; 00230 00231 virtual wxString& rName(); 00232 00233 private: 00234 00235 virtual std::auto_ptr<Result> Optimize(const ProblemBase& problem) const 00236 throw(OptimizationError); 00237 00238 00241 static wxString mName; 00242 00245 static EvolutionaryMethod mEvolutionaryMethod; 00246 00247 }; 00248 00249 // INLINE METHODS 00250 // 00251 00252 // EXTERNAL REFERENCES 00253 // 00254 00255 #endif // _EvolutionaryMethod_h