HorizonOptions
Horizon configuration options.
Horizon options define the extent of the paths in the horizon and the map attributes to be collected for these paths. A set of horizon options consists of the following:
the set of horizon element types the client is interested in,
the path search options for the main path,
the path search options for sub-paths,
the maximum number of paths the client can receive.
To specify horizon options, create an instance of this class:
val mainPathSearchOptions = MainPathSearchOptions(
searchTime = 10.minutes,
searchDistancePolicy = ExplicitDistancePolicy(
searchDistance = PathSearchDistance(
maxHorizonLength = Distance.kilometers(5)
)
)
)
val subPathSearchOptionsLevel1 = SubPathSearchOptions(
searchTime = 5.minutes,
searchDistance = PathSearchDistance(
maxHorizonLength = Distance.kilometers(2)
)
)
val subPathSearchOptionsLevel2 = SubPathSearchOptions(
searchTime = 3.minutes,
searchDistance = PathSearchDistance(
maxHorizonLength = Distance.kilometers(1)
)
)
val horizonOptions = HorizonOptions(
elementTypes = listOf(SpeedLimitsElementType, RegionElementType),
mainPathSearchOptions = mainPathSearchOptions,
subPathSearchOptions = listOf(subPathSearchOptionsLevel1, subPathSearchOptionsLevel2),
numberOfPaths = 4
)
For more information on horizon element types and horizon paths see HorizonEngine.
A client application can register multiple sets of horizon options and request the engine to provide data for all or only some of the registered option sets. The engine generates a separate horizon result for each set of options in the request. The client can also update horizon configuration by registering a new set of options or unregistering a previously registered set.
To register a set of horizon options, call the HorizonEngine.registerHorizonOptions function.
To unregister a set of horizon options, call the HorizonEngine.unregisterHorizonOptions function.
Important: This is a Public Preview API. It may be changed or removed at any time.
Throws
if elementTypes is empty or if minDistanceAhead is negative.
Constructors
Properties
Types of horizon elements of interest.
Search options for the main path.
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.
Maximum number of paths the client can receive. The default value is DEFAULT_NUMBER_OF_PATHS.
Search options for sub-paths, specified per path level. The list element at index i encodes search options for path level i + 1. The horizon is extended to the deepest path level, as determined by this parameter. The default value is an empty list.