Go to the documentation of this file.00001 #include "SMSEMOA_2D_MIES.h"
00002
00003
00004
00005
00006
00007
00008
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
00022 quickSort(currFront, 0, frontSize-1, &Q, selectFunction[1], NULL);
00023
00024
00025 volume[currFront[0]] = DBL_MAX;
00026 volume[currFront[frontSize-1]] = DBL_MAX;
00027
00028
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
00034 quickSort(currFront, 0, frontSize-1, NULL, 0, &volume);
00035 }
00036
00037