paradiseo new mo added

git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@1712 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
jhumeau 2010-03-24 10:07:28 +00:00
commit d7496cafff
116 changed files with 12034 additions and 0 deletions

View file

@ -0,0 +1,38 @@
#ifndef _oneMaxBitNeighbor_h
#define _oneMaxBitNeighbor_h
#include <neighborhood/moBitNeighbor.h>
#include <ga.h>
/*
contener of the neighbor information
*/
template< class Fitness >
class OneMaxBitNeighbor : public moBitNeighbor<Fitness>
{
public:
typedef eoBit<Fitness> EOType ;
using moBitNeighbor<Fitness>::bit ;
/*
* incremental evaluation of the solution for the oneMax problem
*/
virtual void eval(EOType & solution) {
if (solution[bit] == 0)
fitness(solution.fitness() + 1);
else
fitness(solution.fitness() - 1);
};
};
#endif
// Local Variables:
// coding: iso-8859-1
// mode: C++
// c-file-offsets: ((c . 0))
// c-file-style: "Stroustrup"
// fill-column: 80
// End: