What is CapacityDimension in JSPRIT?

666 Views Asked by At

What is the dimensions in jsprit in VehicleTypeImpl.Builder.newInstance("vehicleType").addCapacityDimension(0, 2)?

We can add vehicle capacity using the above method. But can anyone describe clearly what is the dimension.

1

There are 1 best solutions below

1
On BEST ANSWER

Many problems involve multiple capacity dimensions. For example, in many cases vehicles are constrained by their maximum weight AND volume. These are two different dimensions. If you want to take them into account in jsprit, use .addCapacityDimension when specifying your vehicle types. Assign index 0 to weight (e.g. 2700kg) and 1 to volume (e.g. 17m^3) and add their maximum values as follows:

VehicleTypeImpl.Builder.newInstance("vehicleType")
.addCapacityDimension(0, 2700).addCapacityDimension(1,17)