Question
A customer calculates a route with routingMode=MONETARY and finds that it crosses a city center (e.g. central Paris) instead of using the ring road. The same request with routingMode=FAST gives a different route. The customer asks why MONETARY makes this choice.
Answer
This comes from the way the MONETARY cost model works.
The MONETARY routing mode calculates the route that minimizes the monetary cost. Its course is influenced by monetaryCostOptions[costPerKilometer] and monetaryCostOptions[workingCostPerHour], the energy cost, and the speeds per road category. Blockings are obeyed as violations.
The FAST routing mode uses an abstract cost model with penalties for road categories and many other road attributes. These penalties cannot be expressed as monetary costs, so they cannot be used in the MONETARY mode.
Because the two modes use different cost models, they can calculate different routes. With the default parameters (costPerKilometer=2, workingCostPerHour=20), the MONETARY route tends to be the one with the shortest distance.
Resolution / recommendation
With different cost parameters, more realistic routes are obtained. The values below are based on a cost study for a diesel trailer truck, with a diesel price of 1.60€/L:
monetaryCostOptions[costPerKilometer] = 0.89
monetaryCostOptions[workingCostPerHour] = 24
You can test these values instead of the defaults when MONETARY returns unrealistic routes for a diesel trailer truck.
Additions hints
- trafficMode=REALISTIC takes traffic incidents into account, so the route can change depending on the time of day. If a MONETARY route looks unexpected, check both the cost parameters and the traffic mode.
- The values above are specific to a diesel trailer truck and a diesel price of 1.60€/L. Adapt them if the fuel price or the vehicle type is different.
- The same difference between the FAST and MONETARY cost models also explains why MONETARY can be faster than FAST (see the KB “How can a MONETARY route be faster than a FAST route?”).
Related articles
- Monetary Costs concept: https://developer.myptv.com/en/documentation/routing-api/concepts/monetary-costs
- Short and Fast Routes concept: https://developer.myptv.com/en/documentation/routing-api/concepts/short-and-fast-routes
- PTV Developer (Routing API): How can a MONETARY route be faster than a FAST route?
Comments
0 comments
Article is closed for comments.