MainPathSearchOptions
Horizon search options for the main path.
These options specify the search distance policy and the search time for the main path. The main path is the path the user currently follows, extending along the most likely trajectory. The search distance policy and the search time define the extent of the main path.
To specify horizon options for the main path, create an instance of this class:
val mainPathSearchOptions = MainPathSearchOptions(
searchTime = 10.minutes,
searchDistancePolicy = ExplicitDistancePolicy(
searchDistance = PathSearchDistance(
maxHorizonLength = Distance.kilometers(5)
)
)
)
For more information on horizon paths see HorizonEngine.
For more information on horizon options see HorizonOptions.
The search distance policy determines whether the horizon engine must search along the entire route (see RouteLengthPolicy) or within an explicitly specified distance (see ExplicitDistancePolicy).
If both search time and search distance policy are provided (i.e., the options specify both a search time and a search distance policy) for the main path, the horizon engine extends the main path until time and distance have both reached their limits. If the search time is not specified, the horizon engine works with a default value of DEFAULT_MAIN_PATH_SEARCH_TIME for the search time and extends the main path based on the search distance directly specified by or derived from the search policy.
Important: This is a Public Preview API. It may be changed or removed at any time.
Throws
if one of the following occurs:
searchTime is negative.
minDistanceAhead is negative.
searchDistancePolicy is ExplicitDistancePolicy and minDistanceAhead is greater than the maximum horizon length as specified by ExplicitDistancePolicy.searchDistance.
Constructors
Properties
The minimum length of the horizon ahead for which a horizon snapshot update is triggered. If the distance between the vehicle and the end of the horizon snapshot since the last snapshot update is less than this value, the client will receive a new horizon snapshot. If the explicit distance policy is used for the main path, a value for the minimum distance ahead that is greater than the main path search distance will result in the snapshot being updated on every tick. To trigger update of the horizon snapshot on every tick, regardless of the search distance policy used for the main path, define this parameter to Int.MAX_VALUE in meters.
Path search time. The default value is DEFAULT_MAIN_PATH_SEARCH_TIME.