TSP-VRP-GENETICS-ALGORITHM icon indicating copy to clipboard operation
TSP-VRP-GENETICS-ALGORITHM copied to clipboard

Only two routes?

Open olushako opened this issue 6 years ago • 3 comments

I am trying to test the model with more trucks with limited capacity, but the model continuously separating optimization for two parts: truck1 and rest. Can we somehow generate more routes for more trucks?

olushako avatar Mar 21 '18 16:03 olushako

Hi @olushako,

VRP algorithm generates routes that should be adjusted to the available fleet of trucks in order to get minimum costs. I set up the VRP algorithm in order to generates two routes only:

L325

def VRP(k):
    VRP_PROBLEM = Problem_Genetic([(0,10),(1,10),(2,10),(3,10),(4,10),(5,10),(6,10),(7,10),
                                   (trucks[0],capacity_trucks)],
len(cities), lambda x : decodeVRP(x), lambda y: fitnessVRP(y))

So you can set up the environments here:

capacity_trucks = 60
trucks = ['truck','truck']
num_trucks = len(trucks)
frontier = "---------"

fermenreq avatar Mar 21 '18 16:03 fermenreq

thanks Fernando for your reply. I have added additional 4 trucks (like example), but still this is dividing it only for two routes... until and after frontier.. maybe because of trucks[0]...

or do you mean to to execute VRP_PROBLEM for all trucks? but it will not balanced in the system and synchronized...

olushako avatar Mar 21 '18 16:03 olushako

Hi @olushako ,

Yes , you are on right. If you want you could improve the code adding new functionality, as you comment. For that, I just created a new branch develop.

Thanks!

fermenreq avatar Mar 22 '18 08:03 fermenreq