Our monetary cost model for routes consists of distance costs, working time costs, toll costs, and optionally energy costs. There are two features related to monetary costs:
- A summary of monetary costs of a route can be requested with results=MONETARY_COST. This has no influence on the routing itself and the other results, the only change is that the response additionally contains a report on the monetary costs.
- The route calculation can be changed to use monetary costs as objective function by setting options[routingMode]=MONETARY. The default routing mode FAST uses an abstract cost model tuned to calculate practical routes. In contrast, the monetary routing mode uses our monetary cost model to calculate a route with minimal total monetary cost. This gives interesting insights how much money could be saved - according to our monetary cost model. Furthermore, with the monetary routing mode toll costs are accurately integrated into the objective function to find the best tradeoff between the toll costs on the one hand and the distance, time, and energy costs on the other hand.
Each of these two features can be used separately, but also the combination of the two features is possible.
Parameters
The monetary cost calculation is based on the following three parameters:
- monetaryCostOptions[costPerKilometer] specifies the vehicle cost per kilometer
- monetaryCostOptions[workingCostPerHour] specifies the driver working cost per hour
- options[currency] specifies the currency for the monetary parameters and the monetary costs report
Energy costs can be modeled as part of the vehicle cost per kilometer. However, it is possible to optionally model the energy cost separately, as cost per kilowatt hour for vehicles with electric engines and cost per fuel unit for vehicles with combustion engines. The benefit of doing this is that the energy consumption depends on the vehicle's speed. For example, at low speeds in cities with stop-and-go traffic we assume a higher than average energy consumption, while traveling constantly at a medium speed we assume an energy consumption lower than average. Use the following parameters for energy costs, depending on the vehicle:
- monetaryCostOptions[costPerKwh] applies to vehicles with an electric engine and is related to the parameter vehicle[averageElectricityConsumption]
- monetaryCostOptions[costPerFuelUnit] applies to vehicles with a combustion engine and is related to the parameter vehicle[averageFuelConsumption]
All parameters mentioned in this section are optional, and the defaults depend on the used vehicle profile. If only some of the optional parameters are sent in the request it is important to know the defaults of the other parameters since they interact with each other. For example, if the request contains monetaryCostOptions[costPerKilometer] but not options[currency], it is important to know the currency of the vehicle profile to understand in which currency the cost per kilometer is interpreted. Furthermore, the default values for the monetary cost options serve as an example and may change at any time.
Report
The monetary costs report contains the following costs:
Monetary Costs | Description |
---|---|
Distance cost | Calculated by multiplying the road distance with the parameter monetaryCostOptions[costPerKilometer]. |
Working time cost | Calculated by multiplying the travel time with the parameter monetaryCostOptions[workingCostPerHour]. |
Energy cost | Depends on the engine of the vehicle. For electric engines calculated based on the electricity consumption and the parameter monetaryCostOptions[costPerKwh]. For combustion engines calculated based on the fuel consumption and the parameter monetaryCostOptions[costPerFuelUnit]. For hybrid engines the energy costs of the electric engine and the combustion engine are combined based on the parameter vehicle[hybridRatio]. |
Toll cost | Sum of all toll costs along the route. The toll costs depend on a lot of vehicle parameters. See also the concept on toll calculation. |
Routing Mode
With the monetary routing mode the objective function for routing is consistently reflecting the monetary costs that are returned in monetary cost report: distance cost, working time cost, toll cost and optionally energy cost.
When to Use the Monetary Routing Mode
The objective function of the default routing mode FAST combines distance and travel time to an abstract cost value, reduces that abstract cost for preferable roads like highways, and increases the abstract cost for roads that rather shall be avoided like residential roads far away from the waypoints. At the end the route with the smallest abstract cost value is calculated. The routing mode FAST is normally tuned to calculate practical routes a real driver would follow.
With the monetary routing mode, on the other hand, we calculate a route with minimal total monetary cost. All other routes have a higher total monetary cost according to our monetary cost model. So one use case of the monetary routing mode is to get a good lower bound for the total monetary cost of a route.
The monetary routing mode tends to prefer roads through cities compared to bypasses around the city, which in practice however are often preferred by the drivers. Energy costs can be used to achieve more practical routes: As mentioned above, the energy costs depend on the speed, and are higher for low speed. This makes city roads at low speed less attractive for the monetary routing mode.
Another benefit of the monetary routing mode is that the toll costs are accurately integrated into the objective function. In particular in countries like France, where often good alternatives to toll roads are available which are not much slower, this is very interesting. In such cases it is important to properly weigh which alternative is better, and with toll costs integrated into the monetary routing mode this is built-in. In contrast, routes calculated with the routing mode FAST can have much higher total monetary costs than the one with monetary calculation mode if often toll roads are used where good toll-free alternatives are available.
Limitations of the Monetary Routing Mode
When using the monetary routing mode, the routing performance is typically worse than with the default routing mode FAST. Furthermore, this routing mode cannot be used when alternative routes are requested (results=ALTERNATIVE_ROUTES), the avoid option is used (options[avoid]), turns on the passenger side should be preferred (options[preferTurnsOnPassengerSide]) or the vehicle should follow certain truck routes (vehicle[truckRoutes]).
There can be special cases of routes for which the total monetary cost calculated with the default routing mode FAST can be smaller than the total monetary cost calculated with the monetary routing mode. This is mainly due to heuristics that are applied to achieve a good performance. Because of such heuristics, in rare cases the monetary routing mode may return a route that has a higher total monetary cost than the optimal solution.
Try it in the Monetary Costs code sample.