Add Vehicle costs to optimization problem

Hi All,

Hope you are all doing well in these challenging times.

I am quite new to graphhopper and can’t seem to find the way to implement costs of a vehicle in my optimization problem.

Let’s say I have 3 vehicles of similar type but different costs per hour. With costs I mean actual euro’s per hour of using that vehicle with driver. So:
Vehicle 1: Diesel Van with a capacity of 4000 L which the real use cost is 50 euros per hour with a range of 250km.
Vehicle 2: Electric Van with a capacity of 4000 L of which the real use cost is 25 euros per hour with a range of 100km.
Vehicle 3: Small Diesel Van with a capacity of 3000 Lof which the real use cost is 30 euros per hour with a range of 300km.

From an operations perspective the priority of using these Vans would be: 1. Vehicle 2 because it is the cheapest, then 2. Vehicle 3 because it is cheaper and longest range and lastly 3. Vehicle 1 because it is the most expensive and has the shortest range.

In the documentation I’ve found reference to cost_per_second which is a BETA feature! but I can’t figure out if this is the cost_per_second is the equavalent of my cost per hour. Does anyone know?
Secondly, in objectives there is no option of setting minimal costs as an objective. Does anyone know how to include costs as an optimization objective?
From an operational perspective we want the cheapest vehicles to be used first before any of the more expensive vehicles.

Looking forward to your help here. Many thanks!

Powered by Discourse