问题
setTimeWindow(new TimeWindow(start_time, end_time))
Is used to add time constraints for a task/shipment. But I want to have a complete example. Is there any complete example of jsprit on time bound shipment?
回答1:
You can set pickup and delivery time windows of shipments this way:
Shipment shipment = Shipment.Builder.newInstance("1")
.addSizeDimension(0,1)
.setPickupLocation(Location.newInstance(5,7))
.setPickupTimeWindow(TimeWindow.newInstance(0,1200))
.setDeliveryLocation(Location.newInstance(6,9))
.setDeliveryTimeWindow(TimeWindow.newInstance(2000,4000))
.build();
来源:https://stackoverflow.com/questions/35080600/how-to-add-time-constraints-in-jsprit