0

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?

sutirtha
  • 375
  • 3
  • 21

1 Answers1

2

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();

Stefan Schröder
  • 1,037
  • 7
  • 13