How to add time constraints in jsprit?

坚强是说给别人听的谎言 提交于 2020-01-07 02:56:06

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!