• Main Page
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

WDN_MIES.h

Go to the documentation of this file.
00001 #ifndef WDNMIES_
00002 #define WDNMIES_
00003 
00004 #include "WDN.h"
00005 
00006 #ifdef NSGAII
00007 #include "mies/SerialES/NSGAII_MIES.h"
00008 class WDN_MIES: public NSGAII_MIES, public WDN
00009 #else
00010 #include "mies/SerialES/SMSEMOA_Steady3D_MIES.h"
00011 class WDN_MIES: public SMSEMOA_Steady3D_MIES, public WDN
00012 #endif       
00013 {
00014   public:
00015     WDN_MIES(unsigned n_r_, unsigned n_z_, unsigned n_d_, unsigned n_sigma_r_, unsigned n_sigma_z_, unsigned n_prob_, unsigned n_f_, 
00016               unsigned mu_, unsigned rho_, unsigned kappa_, unsigned lambda_,  
00017                 vector<double>& lBound_r_, vector<double>& uBound_r_, vector<int>& lBound_z_, vector<int>& uBound_z_, 
00018                   vector<int>& lBound_d_, vector<int>& uBound_d_, double prob_min_, double prob_max_,
00019                     bool disRec_r_, bool disRec_z_, bool disRec_sigma_r_, bool disRec_sigma_z_, bool disRec_prob_,
00020                       bool selfAdaptation_, vector<int>& direction_, 
00021                         unsigned evaluations_, vector<double>& optimalF_, 
00022                           double initialSigma_r_, double initialSigma_z_, double initialProb_,
00023                             ifstream* initialPopFile_, int randomSeed_, bool feedback_, bool snapShots_, 
00024                               unsigned timeOutValue_,
00025                                 string simInputFileName_, string simOutputFileName_,
00026                                   unsigned selectDimension_, vector<unsigned>& selectFunction_,
00027                                     bool excludeParent_,
00028                                       double cvDemand_, double cvRoughness_, unsigned sampleSetSize_, bool LH_ = true) 
00029       :
00030 #ifdef SMSEMOA3D
00031        SMSEMOA_Steady3D_MIES(n_r_, n_z_, n_d_, n_sigma_r_, n_sigma_z_, n_prob_, n_f_, 
00032                               mu_, rho_, kappa_, lambda_,  
00033                                 lBound_r_, uBound_r_, lBound_z_, uBound_z_, 
00034                                   lBound_d_, uBound_d_, prob_min_, prob_max_,
00035                                     disRec_r_, disRec_z_, disRec_sigma_r_, disRec_sigma_z_, disRec_prob_,
00036                                       selfAdaptation_, direction_, 
00037                                         evaluations_, optimalF_, initialSigma_r_, initialSigma_z_, initialProb_,
00038                                           initialPopFile_, randomSeed_, feedback_, timeOutValue_,
00039                                             selectDimension_, selectFunction_,
00040                                               excludeParent_),
00041 #endif
00042        NSGAII_MIES(n_r_, n_z_, n_d_, n_sigma_r_, n_sigma_z_, n_prob_, n_f_, 
00043                     mu_, rho_, kappa_, 
00044 #ifdef LAMBDA
00045                                        lambda_, // Use (mu + lambda)-selection
00046 #else
00047                                        mu_,     // Use (mu + mu)-selection, like prescribed in Deb, 2000 - NSGA-II                 
00048 #endif
00049                       lBound_r_, uBound_r_, lBound_z_, uBound_z_, 
00050                         lBound_d_, uBound_d_, prob_min_, prob_max_,
00051                           disRec_r_, disRec_z_, disRec_sigma_r_, disRec_sigma_z_, disRec_prob_,
00052                             selfAdaptation_, direction_, 
00053                               evaluations_, optimalF_, initialSigma_r_, initialSigma_z_, initialProb_,
00054                                 initialPopFile_, randomSeed_, feedback_, timeOutValue_,
00055                                   selectDimension_, selectFunction_),
00056        WDN(simInputFileName_, simOutputFileName_,  cvDemand_, cvRoughness_, sampleSetSize_, LH_) 
00057        {  
00058          snapShots = snapShots_;
00059 
00060          if (evaluations > 0)
00061          {
00062 #ifdef ROBUST
00063            generations = (evaluations - ((initialPopFile == NULL) ? mu * sampleSetSize : 0)) / (lambda * sampleSetSize); 
00064 #endif
00065          }
00066          else
00067          {   
00068            cerr << "Supplied value for mumber of evaluations is " << evaluations << ", but should be larger than 0! Exiting." << endl;
00069            exit(1);
00070          }
00071 
00072          if (isParallelExp())
00073          { 
00074            /* Enable selection of zero diameter */ 
00075            if (n_d == 0) // Added for integer-based optimization
00076            {
00077              for (unsigned i = 0; i < n_z; i++)
00078                uBound_z[i]++;
00079            }
00080            else
00081            {       
00082              for (unsigned i = 0; i < n_d; i++)
00083                uBound_d[i]++;
00084            }
00085          }
00086        }
00087 
00088     ~WDN_MIES() {}
00089 
00090   private: 
00091     bool snapShots;
00092 
00097     void initialize(); 
00098 
00100     void evaluate();
00101 
00103     void simulate(Individual* I);
00104 
00106     void recombineMutate();
00107 
00109     void writePop(time_t id);
00110 
00112     void writeStep(time_t id);
00113 
00115     void writeLog(time_t elapsed, time_t id);
00116 };
00117 
00118 #endif

Generated on Tue Oct 4 2011 16:25:19 for WDN by  doxygen 1.7.2