jsprit可以解决负需求的VRPC还是VRPB更好?
Can jsprit solve the VRPC with negative demand or is VRPB better?
我需要使用 VRP 并考虑到客户想要取货或送货。我知道 VRPB 满足这些要求,但它会等到卡车空了再从客户那里取货。
VRPC能应对负需求吗?这将使它成为交付。
环顾四周后,我发现了这个 link:https://discuss.graphhopper.com/t/negative-values-as-capacities/1310
您可以使用 PickUp class 或 Delivery class,代码将完成剩下的工作。
所以是的,它是支持的。
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);
我需要使用 VRP 并考虑到客户想要取货或送货。我知道 VRPB 满足这些要求,但它会等到卡车空了再从客户那里取货。
VRPC能应对负需求吗?这将使它成为交付。
环顾四周后,我发现了这个 link:https://discuss.graphhopper.com/t/negative-values-as-capacities/1310
您可以使用 PickUp class 或 Delivery class,代码将完成剩下的工作。 所以是的,它是支持的。
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);