Début du dev de newMo
git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@1639 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
parent
25c45dd1fa
commit
e13fd250d1
34 changed files with 1946 additions and 48 deletions
27
branches/newMo/tutorial/oneMax/src/bitMoveIncrEval.h
Normal file
27
branches/newMo/tutorial/oneMax/src/bitMoveIncrEval.h
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
|
||||
|
||||
// "incrEval_funcNK.h"
|
||||
|
||||
#ifndef __incr_eval_funcNK_h
|
||||
#define __incr_eval_funcNK_h
|
||||
|
||||
#include <move/moMoveIncrEval.h>
|
||||
#include "bitMove.h"
|
||||
|
||||
template <class EOT>
|
||||
class OneMaxIncrEval : public moMoveIncrEval < BitMove<EOT> > {
|
||||
|
||||
public :
|
||||
OneMaxIncrEval(){ };
|
||||
|
||||
typename EOT::Fitness operator () (const BitMove<EOT> & move, const EOT & chrom) {
|
||||
if(chrom[move.bit]==0){
|
||||
return chrom.fitness()+1;
|
||||
}
|
||||
else{
|
||||
return chrom.fitness()-1;
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue