diversity assignment corrected in moeoFrontByFrontCrowdingDiversityAssignment.h
This commit is contained in:
parent
c9475c4ed0
commit
c0bf207fc1
1 changed files with 111 additions and 106 deletions
|
|
@ -5,6 +5,8 @@
|
|||
*
|
||||
* Arnaud Liefooghe, Waldo Cancino
|
||||
*
|
||||
* April 2016: Bug fix in the sorting of population (corrected thanks to Martin Stehlik)
|
||||
*
|
||||
* This software is governed by the CeCILL license under French law and
|
||||
* abiding by the rules of distribution of free software. You can use,
|
||||
* modify and/ or redistribute the software under the terms of the CeCILL
|
||||
|
|
@ -124,7 +126,10 @@ class moeoFrontByFrontCrowdingDiversityAssignment : public moeoCrowdingDiversity
|
|||
// sort in the descending order using the values of the objective 'obj'
|
||||
moeoOneObjectiveComparator < MOEOT > objComp(obj);
|
||||
moeoPtrComparator<MOEOT> cmp2( objComp );
|
||||
std::sort(sortedptrpop.begin(), sortedptrpop.end(), cmp2);
|
||||
// erroneous part
|
||||
// std::sort(sortedptrpop.begin(), sortedptrpop.end(), cmp2);
|
||||
// correct version
|
||||
std::sort(sortedptrpop.begin()+a, sortedptrpop.begin()+b+1, cmp2);
|
||||
// min & max
|
||||
min = (sortedptrpop[b])->objectiveVector()[obj];
|
||||
max = (sortedptrpop[a])->objectiveVector()[obj];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue