00001 // -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*- 00002 00003 // "route_eval.cpp" 00004 00005 // (c) OPAC Team, LIFL, 2003-2006 00006 00007 /* TEXT LICENCE 00008 00009 Contact: paradiseo-help@lists.gforge.inria.fr 00010 */ 00011 00012 #include "route_eval.h" 00013 #include "graph.h" 00014 00015 void RouteEval :: operator () (Route & __route) 00016 { 00017 00018 float len = 0 ; 00019 00020 for (unsigned int i = 0 ; i < Graph :: size () ; i ++) 00021 { 00022 len -= Graph :: distance (__route [i], __route [(i + 1) % Graph :: size ()]) ; 00023 } 00024 00025 __route.fitness (len) ; 00026 }
1.5.2