Documentation and tests added
git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@1697 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
parent
e6d874bc1b
commit
92251dc96f
20 changed files with 626 additions and 247 deletions
|
|
@ -40,6 +40,16 @@
|
|||
#include <neighborhood/moNeighbor.h>
|
||||
#include <neighborhood/moBackableNeighbor.h>
|
||||
#include <neighborhood/moNeighborhood.h>
|
||||
#include <eval/moEval.h>
|
||||
|
||||
#include <ga/eoBit.h>
|
||||
#include <eoScalarFitness.h>
|
||||
#include <neighborhood/moOrderNeighborhood.h>
|
||||
#include <neighborhood/moBitNeighbor.h>
|
||||
|
||||
typedef eoBit<eoMinimizingFitness> bitVector;
|
||||
typedef moBitNeighbor<eoMinimizingFitness> bitNeighbor ;
|
||||
typedef moOrderNeighborhood<bitNeighbor> bitNeighborhood ;
|
||||
|
||||
typedef EO<int> Solution;
|
||||
|
||||
|
|
@ -90,4 +100,24 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
class evalOneMax : public moEval< bitNeighbor >
|
||||
{
|
||||
private:
|
||||
unsigned size;
|
||||
|
||||
public:
|
||||
evalOneMax(unsigned _size) : size(_size) {};
|
||||
|
||||
~evalOneMax(void) {} ;
|
||||
|
||||
void operator() (bitVector& _sol, bitNeighbor& _n) {
|
||||
unsigned int fit = _sol.fitness();
|
||||
if(_sol[_n.index()])
|
||||
fit--;
|
||||
else
|
||||
fit++;
|
||||
_n.fitness(fit);
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue