Open shzq opened 10 years ago
So I made a function, fitVal, that takes in routes, brks, off_route_lim, and off_route_rate and return the fitness value.
In the function, I calculate the fitness value like this: fitnessValue = temp_dist + totWeight*capacity_rate
where temp_dist = tot_dist + tot_off_route*off_route_rate (if tot_off_route is bigger than off_route_lim), or temp_dist = tot_dist otherwise. and totWeight is the sum of the difference between each path's capacity and the truck capacity times the capacity_rate if the path capacity is bigger than the truck capacity and only if the capacity binary flag is on (checked), otherwise totWeight is 0.
pathsCap and route_cap seem to do the same thing. route_cap doesn't seem to be used in the code
Have you fixed it?
I think so. I commented the route_cap.
The fitness value with capacity consideration is:
fitness value = totDist + totOffRoute_off_route_rate + x_c
where
c is binary flag if the user checks in to consider capacity or not,
and
x is the sum of x_temp where for all the trucks in the route, if (truck.capacity - truck's.path.capacity > 0) x_temp = 0; else x_temp = (truck.capacity - truck's.path.capacity)*capacity_rate;
where capacity_rate = 10*off_rate;