update the use of comparator
git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@310 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
parent
fca8cf40ea
commit
53dec9c788
1 changed files with 6 additions and 5 deletions
|
|
@ -60,7 +60,8 @@ public:
|
||||||
{
|
{
|
||||||
for (unsigned i = 0; i<size(); i++)
|
for (unsigned i = 0; i<size(); i++)
|
||||||
{
|
{
|
||||||
if ( comparator(operator[](i).fitness(), _objectiveVector) )
|
// if _objectiveVector is dominated by the ith individual of the archive...
|
||||||
|
if ( comparator(_objectiveVector, operator[](i).objectiveVector()) )
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
@ -95,8 +96,8 @@ public:
|
||||||
// first step: removing the dominated solutions from the archive
|
// first step: removing the dominated solutions from the archive
|
||||||
for (unsigned j=0; j<size();)
|
for (unsigned j=0; j<size();)
|
||||||
{
|
{
|
||||||
// if _moeo dominates the jth solution contained in the archive
|
// if the jth solution contained in the archive is dominated by _moeo
|
||||||
if ( comparator(_moeo.objectiveVector(), operator[](j).objectiveVector()) )
|
if ( comparator(operator[](j).objectiveVector(), _moeo.objectiveVector()) )
|
||||||
{
|
{
|
||||||
operator[](j) = back();
|
operator[](j) = back();
|
||||||
pop_back();
|
pop_back();
|
||||||
|
|
@ -115,8 +116,8 @@ public:
|
||||||
bool dom = false;
|
bool dom = false;
|
||||||
for (unsigned j=0; j<size(); j++)
|
for (unsigned j=0; j<size(); j++)
|
||||||
{
|
{
|
||||||
// if the jth solution contained in the archive dominates _moeo
|
// if _moeo is dominated by the jth solution contained in the archive
|
||||||
if ( comparator(operator[](j).objectiveVector(), _moeo.objectiveVector()) )
|
if ( comparator(_moeo.objectiveVector(), operator[](j).objectiveVector()) )
|
||||||
{
|
{
|
||||||
dom = true;
|
dom = true;
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue