| Forum | GitHub | Maps | Blog

setCostPerTransportTime doesn't seem to work


I have a simple problem with a vehicle and two shipments in the attached code. Somehow the setCostPerTransportTime(whatever value) does not take effect. Could you please help? In general, I would like to customise the cost calculation function (e.g. taking into account starting/ending times and the total loads delivered). Which class(es) should I modify? Thank you. (5.0 KB)


When you do not specify any transport costs, Jsprit will use CrowFlyCosts, which extends EuclideanCosts. In the latter you can see it only considers distance cost and does not use cost per time at all.


Thanks a lot jie31best for your quick help. Modifying that function indeed works.