According to the official documentation:
Specify the parameter &rollups instead of &rollup, and don't specify &cost_optimize, to get the route computed within Fleet Telematics API. Fleet Telematics API ignores the shortest/fastest in the mode parameter. Instead, it minimizes the sum of driver_cost, vehicle_cost and toll cost. This yields fully cost optimized routes
But in fact it's not what I observe after testing. I've tried route from Lviv to Berlin, I've set driver_cost
to 100 euro and vehicle_cost
to 0. I received the route which takes 20 hours and costs 43 euros (toll roads). This is not optimal route as the driver cost is really high - 2000 euro.
If I add cost_optimize=0
and change rollups
to rollup
(which should turn off cost optimization) as a parameter to request I receive bit more expensive route, in terms of toll roads - 54 euro, but the duration is 13 hours, which gives 1300 euro driver cost and lower overall cost.
How so? Is this some kind of a bug?
P.S. I've been using official examples to double check my results e.g. this
This is the (rather weird) full section of the documentation:
It says that there's two optimisation engines, one (Fleet Telematics API) that should find the optimal route, one (Routing API) than "usually" (but not always) finds the optimal route. And you need to define
tollVehicleType
in both cases.In your first test, if you have
cost_optimize=1
, it's either the R-API or no optimization (you don't provide your request, so I can't tell). In your second test, I think you're just asking for the fastest route. If you want the FT-API, you have to remove thecost_optimize
parameter and userollups
, notrollup
.