Reputation: 11
I need to generate the following routing scenario:
The vehicle leaves the warehouse with the deliveries and after making them it does not return to the warehouse.
The next day it does the opposite, picks up the parcels and goes to the warehouse.
I tried routing but all the examples were with closed circuits. The vehicles leave and return to the warehouse.
Upvotes: 0
Views: 67
Reputation: 2013
You would need to modify the code that calculate the total distance travelled per vehicle. In particular, you need to replace the part that calculate return distance
// previousLocation.getDrivingTimeTo(homeLocation)
// is the return distance when going back to the starting location
totalDrivingTime += previousLocation.getDrivingTimeTo(homeLocation);
with something else depending on where does the vehicle goes after picking up all deliveries:
To a fixed warehouse that may be different than the starting warehouse.
For this, I would add a new property to vehicle that stores the return location. The return distance is the distance between the final delivery and the return location.
To the warehouse that is closest to the final delivery.
For this, I would add a custom shadow variable that tracks the closest warehouse to the final delivery. The return distance is the distance between the final delivery and the closest warehouse to that delivery.
Nowhere
The return distance is 0. Remove the code that adds the return distance.
Upvotes: 2