- Main Page
- Classes
- Files

- Search for |

# part_route_eval.cpp

    00001 // "part_route_eval.cpp"
    00002
    00003 // (c) OPAC Team, LIFL, 2003
    00004
    00005 /*
    00006    Contact: paradiseo-help@lists.gforge.inria.fr
    00007 */
    00008
    00009 #include "part_route_eval.h"
    00010 #include "node.h"
    00011
    00012 PartRouteEval :: PartRouteEval (float __from,
    00013                                 float __to
    00014                                 ) : from (__from),
    00015                                     to (__to) {
    00016
    00017 }
    00018
    00019 void PartRouteEval :: operator () (Route & __route) {
    00020
    00021
    00022   unsigned len = 0 ;
    00023
    00024   for (unsigned i = (unsigned) (__route.size () * from) ;
    00025        i < (unsigned) (__route.size () * to) ;
    00026        i ++)
    00027     len += distance (__route [i], __route [(i + 1) % numNodes]) ;
    00028
    00029   __route.fitness (- (int) len) ;
    00030 }