00001 #ifndef TESTMIES 00002 #define TESTMIES 00003 00004 #include <map> 00005 00006 #ifdef MSCTHES 00007 #include "../mscthes/MOTestFunctions.h" 00008 #endif 00009 00010 #ifdef APRIORI 00011 #include "APriori_MIES.h" 00012 class TestFunctions_MIES:public APriori_MIES 00013 # ifdef MSCTHES 00014 , public MOTestFunctions 00015 # endif 00016 { 00017 public: 00018 TestFunctions_MIES(unsigned n_r_, unsigned n_z_, unsigned n_d_, unsigned n_sigma_r_, unsigned n_sigma_z_, unsigned n_prob_, unsigned n_f_, 00019 unsigned mu_, unsigned rho_, unsigned kappa_, unsigned lambda_, 00020 vector<double>& lBound_r_, vector<double>& uBound_r_, vector<int>& lBound_z_, vector<int>& uBound_z_, 00021 vector<int>& lBound_d_, vector<int>& uBound_d_, double prob_min_, double prob_max_, 00022 bool disRec_r_, bool disRec_z_, bool disRec_sigma_r_, bool disRec_sigma_z_, bool disRec_prob_, 00023 bool selfAdaptation_, vector<int>& direction_, 00024 unsigned evaluations_, vector<double>& optimalF_, 00025 double initialSigma_r_, double initialSigma_z_, double initialProb_, 00026 ifstream* initialPopFile_, int randomSeed_, bool feedback_, 00027 unsigned timeOutValue_, 00028 unsigned selectDimension_, vector<unsigned>& selectFunction_, 00029 string MOproblem_, bool excludeParent_) 00030 :APriori_MIES(n_r_, n_z_, n_d_, n_sigma_r_, n_sigma_z_, n_prob_, n_f_, 00031 mu_, rho_, kappa_, lambda_, 00032 lBound_r_, uBound_r_, lBound_z_, uBound_z_, 00033 lBound_d_, uBound_d_, prob_min_, prob_max_, 00034 disRec_r_, disRec_z_, disRec_sigma_r_, disRec_sigma_z_, disRec_prob_, 00035 selfAdaptation_, direction_, 00036 evaluations_, optimalF_, initialSigma_r_, initialSigma_z_, initialProb_, 00037 initialPopFile_, randomSeed_, feedback_, timeOutValue_, 00038 selectDimension_, selectFunction_) 00039 #endif 00040 #ifdef NSGAII 00041 # ifdef STEADY 00042 #include "NSGAII_Steady_MIES.h" 00043 class TestFunctions_MIES:public NSGAII_Steady_MIES 00044 # else 00045 #include "NSGAII_MIES.h" 00046 class TestFunctions_MIES:public NSGAII_MIES 00047 # endif 00048 # ifdef MSCTHES 00049 , public MOTestFunctions 00050 # endif 00051 { 00052 public: 00053 TestFunctions_MIES(unsigned n_r_, unsigned n_z_, unsigned n_d_, unsigned n_sigma_r_, unsigned n_sigma_z_, unsigned n_prob_, unsigned n_f_, 00054 unsigned mu_, unsigned rho_, unsigned kappa_, unsigned lambda_, 00055 vector<double>& lBound_r_, vector<double>& uBound_r_, vector<int>& lBound_z_, vector<int>& uBound_z_, 00056 vector<int>& lBound_d_, vector<int>& uBound_d_, double prob_min_, double prob_max_, 00057 bool disRec_r_, bool disRec_z_, bool disRec_sigma_r_, bool disRec_sigma_z_, bool disRec_prob_, 00058 bool selfAdaptation_, vector<int>& direction_, 00059 unsigned evaluations_, vector<double>& optimalF_, 00060 double initialSigma_r_, double initialSigma_z_, double initialProb_, 00061 ifstream* initialPopFile_, int randomSeed_, bool feedback_, 00062 unsigned timeOutValue_, 00063 unsigned selectDimension_, vector<unsigned>& selectFunction_, 00064 string MOproblem_, bool excludeParent_) 00065 : 00066 # ifdef STEADY 00067 NSGAII_Steady_MIES(n_r_, n_z_, n_d_, n_sigma_r_, n_sigma_z_, n_prob_, n_f_, 00068 mu_, rho_, kappa_, lambda_, 00069 lBound_r_, uBound_r_, lBound_z_, uBound_z_, 00070 lBound_d_, uBound_d_, prob_min_, prob_max_, 00071 disRec_r_, disRec_z_, disRec_sigma_r_, disRec_sigma_z_, disRec_prob_, 00072 selfAdaptation_, direction_, 00073 evaluations_, optimalF_, initialSigma_r_, initialSigma_z_, initialProb_, 00074 initialPopFile_, randomSeed_, feedback_, timeOutValue_, 00075 selectDimension_, selectFunction_, 00076 excludeParent_), 00077 # endif 00078 NSGAII_MIES(n_r_, n_z_, n_d_, n_sigma_r_, n_sigma_z_, n_prob_, n_f_, 00079 mu_, rho_, kappa_, lambda_, 00080 lBound_r_, uBound_r_, lBound_z_, uBound_z_, 00081 lBound_d_, uBound_d_, prob_min_, prob_max_, 00082 disRec_r_, disRec_z_, disRec_sigma_r_, disRec_sigma_z_, disRec_prob_, 00083 selfAdaptation_, direction_, 00084 evaluations_, optimalF_, initialSigma_r_, initialSigma_z_, initialProb_, 00085 initialPopFile_, randomSeed_, feedback_, timeOutValue_, 00086 selectDimension_, selectFunction_) 00087 #endif 00088 #ifdef SMSEMOA2D 00089 # ifdef STEADY 00090 #include "SMSEMOA_Steady2D_MIES.h" 00091 class TestFunctions_MIES:public SMSEMOA_Steady2D_MIES 00092 # else 00093 #include "SMSEMOA_2D_MIES.h" 00094 class TestFunctions_MIES:public SMSEMOA_2D_MIES 00095 # endif 00096 # ifdef MSCTHES 00097 , public MOTestFunctions 00098 # endif 00099 { 00100 public: 00101 TestFunctions_MIES(unsigned n_r_, unsigned n_z_, unsigned n_d_, unsigned n_sigma_r_, unsigned n_sigma_z_, unsigned n_prob_, unsigned n_f_, 00102 unsigned mu_, unsigned rho_, unsigned kappa_, unsigned lambda_, 00103 vector<double>& lBound_r_, vector<double>& uBound_r_, vector<int>& lBound_z_, vector<int>& uBound_z_, 00104 vector<int>& lBound_d_, vector<int>& uBound_d_, double prob_min_, double prob_max_, 00105 bool disRec_r_, bool disRec_z_, bool disRec_sigma_r_, bool disRec_sigma_z_, bool disRec_prob_, 00106 bool selfAdaptation_, vector<int>& direction_, 00107 unsigned evaluations_, vector<double>& optimalF_, 00108 double initialSigma_r_, double initialSigma_z_, double initialProb_, 00109 ifstream* initialPopFile_, int randomSeed_, bool feedback_, 00110 unsigned timeOutValue_, 00111 unsigned selectDimension_, vector<unsigned>& selectFunction_, 00112 string MOproblem_, bool excludeParent_) 00113 # ifdef STEADY 00114 :SMSEMOA_Steady2D_MIES(n_r_, n_z_, n_d_, n_sigma_r_, n_sigma_z_, n_prob_, n_f_, 00115 mu_, rho_, kappa_, lambda_, 00116 lBound_r_, uBound_r_, lBound_z_, uBound_z_, 00117 lBound_d_, uBound_d_, prob_min_, prob_max_, 00118 disRec_r_, disRec_z_, disRec_sigma_r_, disRec_sigma_z_, disRec_prob_, 00119 selfAdaptation_, direction_, 00120 evaluations_, optimalF_, initialSigma_r_, initialSigma_z_, initialProb_, 00121 initialPopFile_, randomSeed_, feedback_, timeOutValue_, 00122 selectDimension_, selectFunction_, 00123 excludeParent_), 00124 # else 00125 :SMSEMOA_2D_MIES(n_r_, n_z_, n_d_, n_sigma_r_, n_sigma_z_, n_prob_, n_f_, 00126 mu_, rho_, kappa_, lambda_, 00127 lBound_r_, uBound_r_, lBound_z_, uBound_z_, 00128 lBound_d_, uBound_d_, prob_min_, prob_max_, 00129 disRec_r_, disRec_z_, disRec_sigma_r_, disRec_sigma_z_, disRec_prob_, 00130 selfAdaptation_, direction_, 00131 evaluations_, optimalF_, initialSigma_r_, initialSigma_z_, initialProb_, 00132 initialPopFile_, randomSeed_, feedback_, timeOutValue_, 00133 selectDimension_, selectFunction_), 00134 # endif 00135 NSGAII_MIES(n_r_, n_z_, n_d_, n_sigma_r_, n_sigma_z_, n_prob_, n_f_, 00136 mu_, rho_, kappa_, lambda_, 00137 lBound_r_, uBound_r_, lBound_z_, uBound_z_, 00138 lBound_d_, uBound_d_, prob_min_, prob_max_, 00139 disRec_r_, disRec_z_, disRec_sigma_r_, disRec_sigma_z_, disRec_prob_, 00140 selfAdaptation_, direction_, 00141 evaluations_, optimalF_, initialSigma_r_, initialSigma_z_, initialProb_, 00142 initialPopFile_, randomSeed_, feedback_, timeOutValue_, 00143 selectDimension_, selectFunction_) 00144 #endif 00145 #ifdef SMSEMOA3D 00146 # ifdef STEADY 00147 #include "SMSEMOA_Steady3D_MIES.h" 00148 class TestFunctions_MIES:public SMSEMOA_Steady3D_MIES 00149 # else 00150 #include "SMSEMOA_3D_MIES.h" 00151 class TestFunctions_MIES:public SMSEMOA_3D_MIES 00152 # endif 00153 # ifdef MSCTHES 00154 , public MOTestFunctions 00155 # endif 00156 { 00157 public: 00158 TestFunctions_MIES(unsigned n_r_, unsigned n_z_, unsigned n_d_, unsigned n_sigma_r_, unsigned n_sigma_z_, unsigned n_prob_, unsigned n_f_, 00159 unsigned mu_, unsigned rho_, unsigned kappa_, unsigned lambda_, 00160 vector<double>& lBound_r_, vector<double>& uBound_r_, vector<int>& lBound_z_, vector<int>& uBound_z_, 00161 vector<int> lBound_d_, vector<int> uBound_d_, double prob_min_, double prob_max_, 00162 bool disRec_r_, bool disRec_z_, bool disRec_sigma_r_, bool disRec_sigma_z_, bool disRec_prob_, 00163 bool selfAdaptation_, vector<int>& direction_, 00164 unsigned evaluations_, vector<double>& optimalF_, 00165 double initialSigma_r_, double initialSigma_z_, double initialProb_, 00166 ifstream* initialPopFile_, int randomSeed_, bool feedback_, 00167 unsigned timeOutValue_, 00168 unsigned selectDimension_, vector<unsigned>& selectFunction_, 00169 string MOproblem_, bool excludeParent_) 00170 # ifdef STEADY 00171 :SMSEMOA_Steady3D_MIES(n_r_, n_z_, n_d_, n_sigma_r_, n_sigma_z_, n_prob_, n_f_, 00172 mu_, rho_, kappa_, lambda_, 00173 lBound_r_, uBound_r_, lBound_z_, uBound_z_, 00174 lBound_d_, uBound_d_, prob_min_, prob_max_, 00175 disRec_r_, disRec_z_, disRec_sigma_r_, disRec_sigma_z_, disRec_prob_, 00176 selfAdaptation_, direction_, 00177 evaluations_, optimalF_, initialSigma_r_, initialSigma_z_, initialProb_, 00178 initialPopFile_, randomSeed_, feedback_, timeOutValue_, 00179 selectDimension_, selectFunction_, 00180 excludeParent_), 00181 NSGAII_MIES(n_r_, n_z_, n_d_, n_sigma_r_, n_sigma_z_, n_prob_, n_f_, 00182 mu_, rho_, kappa_, lambda_, 00183 lBound_r_, uBound_r_, lBound_z_, uBound_z_, 00184 lBound_d_, uBound_d_, prob_min_, prob_max_, 00185 disRec_r_, disRec_z_, disRec_sigma_r_, disRec_sigma_z_, disRec_prob_, 00186 selfAdaptation_, direction_, 00187 evaluations_, optimalF_, initialSigma_r_, initialSigma_z_, initialProb_, 00188 initialPopFile_, randomSeed_, feedback_, timeOutValue_, 00189 selectDimension_, selectFunction_) 00190 # else 00191 :SMSEMOA_3D_MIES(n_r_, n_z_, n_d_, n_sigma_r_, n_sigma_z_, n_prob_, n_f_, 00192 mu_, rho_, kappa_, lambda_, 00193 lBound_r_, uBound_r_, lBound_z_, uBound_z_, 00194 lBound_d_, uBound_d_, prob_min_, prob_max_, 00195 disRec_r_, disRec_z_, disRec_sigma_r_, disRec_sigma_z_, disRec_prob_, 00196 selfAdaptation_, direction_, 00197 evaluations_, optimalF_, initialSigma_r_, initialSigma_z_, initialProb_, 00198 initialPopFile_, randomSeed_, feedback_, timeOutValue_, 00199 selectDimension_, selectFunction_) 00200 # endif 00201 #endif 00202 #ifdef MSCTHES 00203 { MOproblem = MOproblem_; } 00204 #else 00205 { MOproblem = " "; } 00206 #endif 00207 00208 ~TestFunctions_MIES() {} 00209 00210 protected: 00212 string MOproblem; 00213 00215 void simulate(Individual* I); 00217 double f1(Individual* I); 00219 double f2(Individual* I); 00221 double f3(Individual* I); 00223 double f_sphere(Individual* I, unsigned n_r, unsigned n_z, unsigned n_d); 00225 double f_barrier(Individual* I, int C); 00226 00228 void writePop(time_t id); 00229 00231 void writeLog(time_t elapsed, time_t id); 00232 }; 00233 00234 #endif