Varying Vehicle Speeds & Cost Matrices

Hi There,

I have vehicles with varying speeds. I tried to add dynamic costs to each vehicle being created by doing:

VehicleTypeImpl vehicleType = VehicleTypeImpl.Builder.newInstance("Semi-truck")
					.addCapacityDimension(0, capacity)
					.setCostPerTransportTime(50.0 / vehicleSpeed)
					.setCostPerDistance(50.0 / vehicleSpeed)

Vehicle Default speed is 50KM/hr, so the costs are 1. Vehicle speeds can be in between 50 to 100 km/hr

Additionally I have a cost matrix that has the default speed set to 50km/hr. I am thinking that this overrides the dynamic speeds. Just Looking for advice on how to implement these varying speeds with the cost matrix or there is a better way to go about this


Powered by Discourse