From 5f9b1a9bfd2f588ef6d5529e79d93257bad06407 Mon Sep 17 00:00:00 2001 From: maartenkeijzer Date: Thu, 30 Aug 2007 22:30:52 +0000 Subject: [PATCH] fixed bug in NSGA-II, only niching on last objective --- eo/src/eoNDSorting.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eo/src/eoNDSorting.h b/eo/src/eoNDSorting.h index 4500edcb..476edbcf 100644 --- a/eo/src/eoNDSorting.h +++ b/eo/src/eoNDSorting.h @@ -473,7 +473,7 @@ class eoNDSorting_II : public eoNDSorting std::vector nc(niche_count.size(), 0.0); 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; } @@ -485,7 +485,7 @@ class eoNDSorting_II : public eoNDSorting for (i = 0; i < nc.size(); ++i) { - niche_count[i] = (max_dist + 1 - nc[i]); + niche_count[i] += (max_dist + 1 - nc[i]); } }