jsprit
jsprit copied to clipboard
VRP with Custom Distances
Hello!
I would like to use Jsprit for solving a Vehicle Routing Problem (VRP) that involves pickups and deliveries. Is it possible to incorporate custom distances into the model, perhaps with a distance matrix, for specifying distances between vehicles and services, as well as between different services?
Thanks
com.graphhopper.jsprit.core.problem.VehicleRoutingProblem.Builder#setRoutingCost(new AbstractForwardVehicleRoutingTransportCosts() {
@Override
public double getTransportCost(Location from, Location to, double departureTime, Driver driver, Vehicle vehicle) {
// TODO return cost base on transportTime and distance
return 0;
}
@Override
public double getTransportTime(Location from, Location to, double departureTime, Driver driver, Vehicle vehicle) {
// TODO return transportTime
return 0;
}
@Override
public double getDistance(Location from, Location to, double departureTime, Vehicle vehicle) {
// TODO return distance
return 0;
}
})