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

D:/LIACS/mies/SerialES/SMSEMOA_2D_MIES.cpp

Go to the documentation of this file.
00001 #include "SMSEMOA_2D_MIES.h"
00002 
00003 //------------------------------------------------------------------------------
00004 // Class SMSEMOA_2D_MIES
00005 //-------------------------------------------------
00006 // Protected Members
00007 
00008 /* Sort Individuals within same front: 2D hypervolume sorting (see SMS-EMOA by Emmerich, 2005) */
00009 void SMSEMOA_2D_MIES::frontSort(vector<int>& currFront, vector<Individual*>& Q, vector<int>& direction)
00010 {
00011 #ifdef DEBUG
00012   cout << "SMSEMOA_2D_MIES::frontSort(), 2D hypervolume sorting" << endl;
00013 #endif
00014 
00015   int frontSize = currFront.size();
00016   map<int, double> volume;
00017 
00018   for (int i = 0; i < frontSize; i++)
00019     volume[currFront[i]] = 0;
00020 
00021   /* Sort front on second objective, in descending order */
00022   quickSort(currFront, 0, frontSize-1, &Q, selectFunction[1], NULL); 
00023 
00024   /* Boundary points are always kept */
00025   volume[currFront[0]] = DBL_MAX;
00026   volume[currFront[frontSize-1]] = DBL_MAX;
00027 
00028   /* For rest of the points, determine hypervolume contribution */
00029   for (int i = 1; i < frontSize-1; i++) 
00030     volume[currFront[i]] += (Q[currFront[i+1]]->F[selectFunction[0]] - Q[currFront[i]]->F[selectFunction[0]]) 
00031                               * (Q[currFront[i-1]]->F[selectFunction[1]] - Q[currFront[i]]->F[selectFunction[1]]);
00032 
00033   /* Sort front index currFront on hypervolume, in descending order */
00034   quickSort(currFront, 0, frontSize-1, NULL, 0, &volume);
00035 }
00036 
00037 

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