I am a beginner of or-Tools.
I have a goal to implement itinerary builder for trip using PYTHON based on VRP with time window library. I need to implement following scenario;
"When a user chooses several places to visit on the map, computer automatically build itinerary which include sequence of visit, arrival time for each place, and so on. However, some places should be visited within specified time window."
So I modified VRPTW Python code which is provided on the following web page.
1) For the itinerary builder for trip, 1 vehicle with infinitive capacity is enough and there exist no time constraints so I changed following statements from original Python code;
num_vehicles = 1
VehicleCapacity = 10000000000
horizon = 40 * 3600
tw_duration = 40 * 3600
start_times = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
After I run, I satisfied with following results;
Route 0: 0 Load(0) Time(0, 0) -> 30 Load(0) Time(1, 20954) -> 26 Load(14) Time(4202, 25155) -> ...
Next, I set start_times of almost places to 0 and tw_duration to horizon except a place because most places can be visited at any time but some places should be visited specified time. For example, museum should be visited only at day time and some night market should be visited only at night time. So I set start_times of 30th location to 15000 so that 30th location can be visited later.
For this purpose, I changed start_times of places as follows;
start_times = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15000,0]
But the result was not what I wanted. A vehicle waited until 15000 seconds in order to keep the visiting sequence ;
Route 0: 0 Load(0) Time(0, 0) -> 30 Load(0) Time(15000, 20954) -> 26 Load(14) Time(19201, 25155) -> ...
I guess above result happens because cost function is defined with only distance. Is it correct guess? How can I change cost function from distance to total travel time (waiting time + service time + transit time) ?
2) For my itinerary builder, start depot and end depot will be different. How can I set end_depot location differently?
I am using Spyder 3 editor with anaconda 3-4.2.0 windows version and recent or-tools (library.or-tools.python.examples_4.3.3805) in windows 7 OS.
Please answer me with Python code! Thanks in advance.
From Song
--
You received this message because you are subscribed to the Google Groups "or-tools-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to or-tools-discuss+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to or-tools-discu...@googlegroups.com.