fixed bug in NSGA-II, only niching on last objective
This commit is contained in:
parent
28e59ff064
commit
5f9b1a9bfd
1 changed files with 2 additions and 2 deletions
|
|
@ -473,7 +473,7 @@ class eoNDSorting_II : public eoNDSorting<EOT>
|
||||||
std::vector<double> nc(niche_count.size(), 0.0);
|
std::vector<double> nc(niche_count.size(), 0.0);
|
||||||
|
|
||||||
for (i = 1; i < _cf.size()-1; ++i)
|
for (i = 1; i < _cf.size()-1; ++i)
|
||||||
{ // and yet another level of indirection
|
{ // calculate distance
|
||||||
nc[performance[i].second] = performance[i+1].first - performance[i-1].first;
|
nc[performance[i].second] = performance[i+1].first - performance[i-1].first;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -485,7 +485,7 @@ class eoNDSorting_II : public eoNDSorting<EOT>
|
||||||
|
|
||||||
for (i = 0; i < nc.size(); ++i)
|
for (i = 0; i < nc.size(); ++i)
|
||||||
{
|
{
|
||||||
niche_count[i] = (max_dist + 1 - nc[i]);
|
niche_count[i] += (max_dist + 1 - nc[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Reference in a new issue