-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0ca7298
commit 0f72f01
Showing
17 changed files
with
226 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
7.4.0 | ||
7.5.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
110 changes: 110 additions & 0 deletions
110
Sources/StadiaMaps/Models/LowSpeedVehicleCostingOptions.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
// | ||
// LowSpeedVehicleCostingOptions.swift | ||
// | ||
// Generated by openapi-generator | ||
// https://openapi-generator.tech | ||
// | ||
|
||
import Foundation | ||
#if canImport(AnyCodable) | ||
import AnyCodable | ||
#endif | ||
|
||
public struct LowSpeedVehicleCostingOptions: Codable, JSONEncodable, Hashable { | ||
public enum VehicleType: String, Codable, CaseIterable { | ||
case lowSpeedVehicle = "low_speed_vehicle" | ||
case golfCart = "golf_cart" | ||
} | ||
|
||
static let useLivingStreetsRule = NumericRule<Double>(minimum: 0, exclusiveMinimum: false, maximum: 1, exclusiveMaximum: false, multipleOf: nil) | ||
static let useFerryRule = NumericRule<Double>(minimum: 0, exclusiveMinimum: false, maximum: 1, exclusiveMaximum: false, multipleOf: nil) | ||
static let topSpeedRule = NumericRule<Int>(minimum: 20, exclusiveMinimum: false, maximum: 60, exclusiveMaximum: false, multipleOf: nil) | ||
static let maxAllowedSpeedLimitRule = NumericRule<Int>(minimum: 20, exclusiveMinimum: false, maximum: 80, exclusiveMaximum: false, multipleOf: nil) | ||
/** A penalty (in seconds) applied when transitioning between roads (determined by name). */ | ||
public var maneuverPenalty: Int? = 5 | ||
/** The estimated cost (in seconds) when a gate is encountered. */ | ||
public var gateCost: Int? = 15 | ||
/** A penalty (in seconds) applied to the route cost when a gate is encountered. This penalty can be used to reduce the likelihood of suggesting a route with gates unless absolutely necessary. */ | ||
public var gatePenalty: Int? = 300 | ||
/** The estimated cost (in seconds) when encountering an international border. */ | ||
public var countryCrossingCost: Int? = 600 | ||
/** A penalty applied to transitions to international border crossings. This penalty can be used to reduce the likelihood of suggesting a route with border crossings unless absolutely necessary. */ | ||
public var countryCrossingPenalty: Int? = 0 | ||
/** A penalty applied to transitions to service roads. This penalty can be used to reduce the likelihood of suggesting a route with service roads unless absolutely necessary. The default penalty is 15 for cars, busses, motor scooters, and motorcycles; and zero for others. */ | ||
public var servicePenalty: Int? | ||
/** A factor that multiplies the cost when service roads are encountered. The default is 1.2 for cars and busses, and 1 for trucks, motor scooters, and motorcycles. */ | ||
public var serviceFactor: Double? = 1 | ||
/** A measure of willingness to take living streets. Values near 0 attempt to avoid them, and values near 1 will favour them. Note that as some routes may be impossible without living streets, 0 does not guarantee avoidance of them. The default value is 0 for trucks; 0.1 for other motor vehicles; 0.5 for bicycles; and 0.6 for pedestrians. */ | ||
public var useLivingStreets: Double? | ||
/** A measure of willingness to take ferries. Values near 0 attempt to avoid ferries, and values near 1 will favour them. Note that as some routes may be impossible without ferries, 0 does not guarantee avoidance of them. */ | ||
public var useFerry: Double? = 0.5 | ||
/** If set to true, ignores any restrictions (eg: turn and conditional restrictions). Useful for matching GPS traces to the road network regardless of restrictions. */ | ||
public var ignoreRestrictions: Bool? | ||
/** If set to true, ignores most restrictions (eg: turn and conditional restrictions), but still respects restrictions that impact vehicle safety such as weight and size. */ | ||
public var ignoreNonVehicularRestrictions: Bool? | ||
/** If set to true, ignores directional restrictions on roads. Useful for matching GPS traces to the road network regardless of restrictions. */ | ||
public var ignoreOneways: Bool? | ||
/** The type of vehicle: * low_speed_vehicle (BETA): a low-speed vehicle which falls under a different regulatory and licensing regime than automobiles (ex: LSV in the US and Canada, Quadricycles in the EU, etc.) * golf_cart: a street legal golf cart that is under a similar regulator regime as the generic LSV laws, but may need to follow special paths when available or abide by restrictions specific to golf carts. */ | ||
public var vehicleType: VehicleType? = .lowSpeedVehicle | ||
/** The top speed (in kph) that the vehicle is capable of travelling. This impacts travel time calculations as well as which roads are preferred. A very low speed vehicle will tend to prefer lower speed roads even in the presence of other legal routes. */ | ||
public var topSpeed: Int? = 35 | ||
/** The maximum speed limit for highways on which it is legal for the vehicle to travel. Defaults to 57 (kph; around 35 mph). Acceptable values range from 20 to 80. Highways with *tagged* speed limits higher than this value will not be routed over (some caveats apply; this feature is still BETA). */ | ||
public var maxAllowedSpeedLimit: Int? = 57 | ||
|
||
public init(maneuverPenalty: Int? = 5, gateCost: Int? = 15, gatePenalty: Int? = 300, countryCrossingCost: Int? = 600, countryCrossingPenalty: Int? = 0, servicePenalty: Int? = nil, serviceFactor: Double? = 1, useLivingStreets: Double? = nil, useFerry: Double? = 0.5, ignoreRestrictions: Bool? = nil, ignoreNonVehicularRestrictions: Bool? = nil, ignoreOneways: Bool? = nil, vehicleType: VehicleType? = .lowSpeedVehicle, topSpeed: Int? = 35, maxAllowedSpeedLimit: Int? = 57) { | ||
self.maneuverPenalty = maneuverPenalty | ||
self.gateCost = gateCost | ||
self.gatePenalty = gatePenalty | ||
self.countryCrossingCost = countryCrossingCost | ||
self.countryCrossingPenalty = countryCrossingPenalty | ||
self.servicePenalty = servicePenalty | ||
self.serviceFactor = serviceFactor | ||
self.useLivingStreets = useLivingStreets | ||
self.useFerry = useFerry | ||
self.ignoreRestrictions = ignoreRestrictions | ||
self.ignoreNonVehicularRestrictions = ignoreNonVehicularRestrictions | ||
self.ignoreOneways = ignoreOneways | ||
self.vehicleType = vehicleType | ||
self.topSpeed = topSpeed | ||
self.maxAllowedSpeedLimit = maxAllowedSpeedLimit | ||
} | ||
|
||
public enum CodingKeys: String, CodingKey, CaseIterable { | ||
case maneuverPenalty = "maneuver_penalty" | ||
case gateCost = "gate_cost" | ||
case gatePenalty = "gate_penalty" | ||
case countryCrossingCost = "country_crossing_cost" | ||
case countryCrossingPenalty = "country_crossing_penalty" | ||
case servicePenalty = "service_penalty" | ||
case serviceFactor = "service_factor" | ||
case useLivingStreets = "use_living_streets" | ||
case useFerry = "use_ferry" | ||
case ignoreRestrictions = "ignore_restrictions" | ||
case ignoreNonVehicularRestrictions = "ignore_non_vehicular_restrictions" | ||
case ignoreOneways = "ignore_oneways" | ||
case vehicleType = "vehicle_type" | ||
case topSpeed = "top_speed" | ||
case maxAllowedSpeedLimit = "max_allowed_speed_limit" | ||
} | ||
|
||
// Encodable protocol methods | ||
|
||
public func encode(to encoder: Encoder) throws { | ||
var container = encoder.container(keyedBy: CodingKeys.self) | ||
try container.encodeIfPresent(maneuverPenalty, forKey: .maneuverPenalty) | ||
try container.encodeIfPresent(gateCost, forKey: .gateCost) | ||
try container.encodeIfPresent(gatePenalty, forKey: .gatePenalty) | ||
try container.encodeIfPresent(countryCrossingCost, forKey: .countryCrossingCost) | ||
try container.encodeIfPresent(countryCrossingPenalty, forKey: .countryCrossingPenalty) | ||
try container.encodeIfPresent(servicePenalty, forKey: .servicePenalty) | ||
try container.encodeIfPresent(serviceFactor, forKey: .serviceFactor) | ||
try container.encodeIfPresent(useLivingStreets, forKey: .useLivingStreets) | ||
try container.encodeIfPresent(useFerry, forKey: .useFerry) | ||
try container.encodeIfPresent(ignoreRestrictions, forKey: .ignoreRestrictions) | ||
try container.encodeIfPresent(ignoreNonVehicularRestrictions, forKey: .ignoreNonVehicularRestrictions) | ||
try container.encodeIfPresent(ignoreOneways, forKey: .ignoreOneways) | ||
try container.encodeIfPresent(vehicleType, forKey: .vehicleType) | ||
try container.encodeIfPresent(topSpeed, forKey: .topSpeed) | ||
try container.encodeIfPresent(maxAllowedSpeedLimit, forKey: .maxAllowedSpeedLimit) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.