00001
00002
00003
00004
00005
00006
00007
00008
00009
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 }