git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@88 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
parent
055b0ff739
commit
81871bb536
74 changed files with 91611 additions and 0 deletions
23
trunk/paradiseo-mo/tutorial/examples/tsp/src/route_eval.cpp
Normal file
23
trunk/paradiseo-mo/tutorial/examples/tsp/src/route_eval.cpp
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
// -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
|
||||
|
||||
// "route_eval.cpp"
|
||||
|
||||
// (c) OPAC Team, LIFL, 2003-2006
|
||||
|
||||
/* TEXT LICENCE
|
||||
|
||||
Contact: paradiseo-help@lists.gforge.inria.fr
|
||||
*/
|
||||
|
||||
#include "route_eval.h"
|
||||
#include "graph.h"
|
||||
|
||||
void RouteEval :: operator () (Route & __route) {
|
||||
|
||||
float len = 0 ;
|
||||
|
||||
for (unsigned i = 0 ; i < Graph :: size () ; i ++)
|
||||
len -= Graph :: distance (__route [i], __route [(i + 1) % Graph :: size ()]) ;
|
||||
|
||||
__route.fitness (len) ;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue