0

我需要使用 VRP 并考虑到客户想要取货或送货。我知道 VRPB 满足这些要求,但要等到卡车空了再从客户那里取货。

VRPC 是否能够处理负面需求?这将使它成为一个交付。

4

1 回答 1

0

环顾四周后,我发现了这个链接: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);
于 2021-04-03T10:40:19.950 回答