MainPathSearchOptions

public struct MainPathSearchOptions

Horizon search options for the main path.

These options specify the PathSearchDistancePolicy 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:

let mainPathSearchOptions = try MainPathSearchOptions(
    searchTime: .tt.minutes(10),
    searchDistancePolicy: ExplicitDistancePolicy(
        searchDistance: PathSearchDistance(
            maxHorizonLength: .tt.kilometers(5)
        )
    )
)

For more information on horizon paths see HorizonEngine.

For more information on horizon options see HorizonOptions.

The PathSearchDistancePolicy 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 HorizonEngine 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 Defaults .pathSearchTime 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.

Lifecycle

Public

  • Contains default values for MainPathSearchOptions.

    See more

    Declaration

    Swift

    public enum Defaults
  • Path search time. 0 if the horizon options do not specify a path search time.

    Declaration

    Swift

    public let searchTime: Measurement<UnitDuration>
  • Path search distance policy. It determines whether the horizon engine must search along the entire route (see RouteLengthPolicy) or within an explicitly specified distance (see ExplicitDistancePolicy).

    Declaration

    Swift

    public let searchDistancePolicy: PathSearchDistancePolicy

MainPathSearchOptions.InitializationError

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

    See more

    Declaration

    Swift

    public enum InitializationError : Error