Closed rohams closed 10 years ago
How do I know which truck goes what route?
use the breaks array for that. if the breaks array is: 2,5 that means the fist truck serves up to index 2 of the routes array and the second truck up to index 5, and the last truck from index 6 to end.
So off_routing_distance() should take routes and brks as the parameters? off_routing_rate and off_routing_distance is to come from global variable?
yes!
I've committed the code. What I see is it's just basically like the totalDist() function with the additional calculation of off_routing_distance
Write up of the fitness value:
fitness value = off_routing_rate * off_routing_distance + total distance
off_routing_distance() function:
If truck x is visiting: s1, s5, s9, s7, s2 off-routing distance for truck x is: (dc, s1, s5, s9, s7, s2) - (dc , s2) the output of off_routing_distance() function is the off-routing distances of all the trucks.