我需要使用VRP,并考虑到客户想要取货或送货。我知道VRPB满足这些要求,但这要等到卡车清空后才能从客户那里取货。
VRPC是否能够应对负面需求?这将使它成为一个交付。
环顾四周后,我发现了这个链接:https://discuss.graphhopper.com/t/negative-values-as-capacities/1310
您可以使用PickUp类或Delivery类,代码将完成其余工作。所以,是的,它是受支持的。
Delivery delivery1 = Delivery.Builder.newInstance("1").addSizeDimension(WEIGHT_INDEX, 1).setLocation(Location.newInstance(5, 7)).build();
Delivery delivery2 = Delivery.Builder.newInstance("2").addSizeDimension(WEIGHT_INDEX, 1).setLocation(Location.newInstance(5, 13)).build();
Delivery delivery3 = Delivery.Builder.newInstance("3").addSizeDimension(WEIGHT_INDEX, 1).setLocation(Location.newInstance(15, 7)).build();
Delivery delivery4 = Delivery.Builder.newInstance("5").addSizeDimension(WEIGHT_INDEX, 1).setLocation(Location.newInstance(15, 7)).build();
Pickup pickup1 = Pickup.Builder.newInstance("4").addSizeDimension(WEIGHT_INDEX, 1).setLocation(Location.newInstance(15, 13)).build();
VehicleRoutingProblem.Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance();
vrpBuilder.addVehicle(vehicle);
vrpBuilder.addJob(delivery1).addJob(delivery2).addJob(delivery3).addJob(pickup1).addJob(delivery4);