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.

  • An error that occurs during the creation of the instance.

    See more

    Declaration

    Swift

    public enum InitializationError : Error