00001
00015 #ifndef _ProblemWithPenalty_h
00016 #define _ProblemWithPenalty_h
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #include "CountedPtr.h"
00029 #include "PenaltyFunction.h"
00030 #include "UnconstrainedProblem.h"
00031
00032
00033
00034
00035
00036 class ProblemWithPenalty
00037 : public UnconstrainedProblem
00038 {
00039 public:
00040
00041 friend class ProblemWithPenaltyPanel;
00042 friend class ProblemWithPenaltyValidator;
00043 friend class PwpAdvancedDialog;
00044
00045
00046
00049 ~ProblemWithPenalty(void);
00050
00051
00052
00053
00054
00057 std::auto_ptr<ProblemBase> Clone() const;
00058
00059
00060
00063
00064 PenaltyFunction*& rpPenalty();
00065
00068 const PenaltyFunction& Penalty() const;
00069
00077 virtual const FunctionBase& BaseFunction() const;
00078
00081 virtual wxString Name() const;
00082
00085 static ProblemIdType ClassId();
00086
00089 virtual ProblemIdType Id() const;
00090
00091 virtual void SetFunction(
00092 auto_ptr<FunctionBase> cpFunction,
00093 auto_ptr<VariableNames> cpVariables);
00094
00095
00096 bool ReuseStartingPoint() const;
00097
00098 protected:
00099
00104 ProblemWithPenalty(bool doRegister = false);
00105
00106
00111 ProblemWithPenalty(const ProblemWithPenalty& from);
00112
00113 private:
00114
00117 virtual std::auto_ptr<Result> Solve() const throw(OptimizationError);
00118
00121 void SetPenaltyFunction();
00122
00123 static const wxString mName;
00124 static ProblemWithPenalty mProblemWithPenalty;
00125
00126 DoubleParameter mEpsilon;
00127 bool mReuseStartingPoint;
00128
00129 mutable PenaltyFunction* mpPenaltyFunction;
00130
00131 };
00132
00133
00134
00135
00136
00137
00138
00139 #endif // _ProblemWithPenalty_h_