DynamicRoutingEngine (API Reference)
Class DynamicRoutingEngine
This class queries the HERE routing backend to find routes with less traffic and therefore an earlier remaining estimated time of arrival.
DynamicRoutingEngine polls the HERE routing backend periodically to find the best new route out
of a given initial route.
For initial route calculation it is recommended to use the RoutingEngine
as it already requests traffic-optimized routes.
When a better route is found, it is recommended to follow these steps to set the new route:
- Stop the
DynamicRoutingEngine. - Update the currently active
Navigatorinstance with the newly found route. - Restart the
DynamicRoutingEngine. This should be done outside of theonBetterRouteFound()callback.
For both DynamicRoutingEngine and RoutingEngine,
the resulting routes are optimized based on speed flow changes such as traffic jams,
street closures or road accidents.
To get the best result, it is recommended to not specify the
RouteOptions.departureTime as then the current time is used by default.
The poll interval is defined by
DynamicRoutingEngineOptions.pollInterval and
triggered by updateCurrentLocation(com.here.sdk.navigation.MapMatchedLocation, int).
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumStart errorstatic final classStart exception -
Constructor Summary
ConstructorsConstructorDescriptionDynamicRoutingEngine(SDKNativeEngine sdkEngine, DynamicRoutingEngineOptions options) Creates a new instance of this class.Creates a new instance of this class. -
Method Summary
Modifier and TypeMethodDescriptionvoidstart(RouteHandle routeHandle, List<Waypoint> waypoints, RefreshRouteOptions refreshRouteOptions, DynamicRoutingListener listener) Deprecated.Will be removed in v4.28.0.voidstart(RouteHandle routeHandle, List<Waypoint> waypoints, RoutingOptions routingOptions, DynamicRoutingListener listener) Starts polling the HERE backend services to find a better route, as defined by theDynamicRoutingEngineOptions.voidstart(Route route, DynamicRoutingListener listener) Starts polling the HERE backend services to find a better route, as defined by the DynamicRoutingEngineOptions.voidstop()Stops polling the HERE backend services.voidupdateCurrentLocation(MapMatchedLocation mapMatchedLocation, int sectionIndex) Updates the current location.
-
Constructor Details
-
Method Details
-
stop
public void stop()Stops polling the HERE backend services.
Note: The engine is not automatically stopped when the destination is reached. Therefore, it is recommended to stop the engine when the destination was reached.