HorizonOptions

class HorizonOptions(val elementTypes: List<HorizonElementType>, val mainPathSearchOptions: MainPathSearchOptions, val subPathSearchOptions: List<SubPathSearchOptions> = listOf(), val numberOfPaths: Int = DEFAULT_NUMBER_OF_PATHS, val minDistanceAhead: Distance = DEFAULT_MIN_DISTANCE_AHEAD)

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

Constructors

Link copied to clipboard
constructor(elementTypes: List<HorizonElementType>, mainPathSearchOptions: MainPathSearchOptions, subPathSearchOptions: List<SubPathSearchOptions> = listOf(), numberOfPaths: Int = DEFAULT_NUMBER_OF_PATHS, minDistanceAhead: Distance = DEFAULT_MIN_DISTANCE_AHEAD)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Types of horizon elements of interest.

Link copied to clipboard
Link copied to clipboard

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.

Link copied to clipboard

Maximum number of paths the client can receive. The default value is DEFAULT_NUMBER_OF_PATHS.

Link copied to clipboard

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.

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun toString(): String