Ajout de incremental evaluation for the royal road problem

git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@1768 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
verel 2010-04-29 15:36:43 +00:00
commit d6e7fcd286

View file

@ -66,7 +66,7 @@ public:
_neighbor.fitness(_solution.fitness() - 1); _neighbor.fitness(_solution.fitness() - 1);
else { else {
if ((_solution[_neighbor.index()] == 0) && (offset + j == _neighbor.index())) { // can the block be filled? if ((_solution[_neighbor.index()] == 0) && (offset + j == _neighbor.index())) { // can the block be filled?
j++; j++; // next bit
while (_solution[offset + j] && j < k) j++; while (_solution[offset + j] && j < k) j++;
if (j == k) // the block can be filled, so the fitness increases from one if (j == k) // the block can be filled, so the fitness increases from one