- Main Page
- Namespaces
- Classes
- Files

- Search for |

# part_route_eval.cpp

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