SubPathSearchOptions
public struct SubPathSearchOptions
Horizon search options for a sub-path level.
These options specify the search distance and the search time for a sub-path level. The level of a sub-path is the number of times the user would have to deviate, starting from the main path, in order to reach that sub-path. The search distance and the search time define the extent of sub-paths of that level in the horizon.
To specify options for a sub-path level, create an instance of this class:
let subPathSearchOptionsLevel1 = try SubPathSearchOptions(
searchTime: .tt.minutes(5),
searchDistance: PathSearchDistance(
maxHorizonLength: .tt.kilometers(2)
)
)
For more information on horizon paths see HorizonEngine
.
For more information on horizon options see HorizonOptions
.
If both search time and search distance are specified (i.e., the options specify both a search time and a search
distance) for a given sub-path level, the HorizonEngine
extends horizon sub-paths of that level
until both time and distance have reached the limit.
If only the search distance is specified for a given sub-path level, the horizon engine works with a default value
Defaults
.pathSearchTime
for the search time and extends the sub-paths of that level based on the search
distance.
If only the search time is specified for a given sub-path level, the horizon engine works with a default value of
Defaults
.pathSearchDistance
maximum extension length for the search distance and extends sub-paths of that
level until both time and distance reach the limit.
Important
This is a Public Preview API. It may be changed or removed at any time.-
Initializes instance of
SubPathSearchOptions
.Declaration
Swift
public init( searchTime: Measurement<UnitDuration> = Defaults.pathSearchTime, searchDistance: PathSearchDistance = Defaults.pathSearchDistance ) throws
-
Contains default values for
See moreSubPathSearchOptions
.Declaration
Swift
public enum Defaults
-
Path search time.
Defaults.searchTime
if the options do not specify a path search time.Declaration
Swift
public let searchTime: Measurement<UnitDuration>
-
Path search distance. Maximum
Defaults.searchDistance
ifHorizonOptions
do not specify aPathSearchDistance
.Declaration
Swift
public let searchDistance: PathSearchDistance
-
An error that occurs during the creation of the instance.
See moreDeclaration
Swift
public enum InitializationError : Error