git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@2068 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
parent
d9916bec0e
commit
ee10f48842
6 changed files with 129 additions and 0 deletions
27
ParadisEO-GPU/tutoriel/QAP_CPU/src/QapEval.h
Normal file
27
ParadisEO-GPU/tutoriel/QAP_CPU/src/QapEval.h
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
#ifndef __QapEval
|
||||
#define __QapEval
|
||||
|
||||
template <class EOT>
|
||||
class QapEval : public eoEvalFunc<EOT>
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
QapEval(){}
|
||||
|
||||
~QapEval(){}
|
||||
|
||||
void operator() (EOT & _sol) {
|
||||
int cost=0;
|
||||
for (int i=0; i<n; i++)
|
||||
std::cout<<_sol[i]<<" ";
|
||||
std::cout<<std::endl;
|
||||
for (int i=0; i<n; i++)
|
||||
for (int j=0; j<n; j++)
|
||||
cost += a[i][j] * b[_sol[i]][_sol[j]];
|
||||
_sol.fitness(cost);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue