EmpiricalConsumptionModel
public struct EmpiricalConsumptionModel : Hashable
This model defines a data-driven energy consumption model for electric vehicles.
It estimates the electrical energy required to traverse a route by combining empirically derived vehicle parameters with route characteristics such as distance, elevation changes, and driving speed. Rather than relying on a full physical simulation, this model uses observed consumption behavior to produce realistic and efficient energy estimates suitable for routing, range prediction, and navigation use cases.
Parameters specific to the electric vehicle are used to calculate energy consumption on a given route.
At minimum, you must provide EmpiricalConsumptionModel.ascentConsumptionInWattHoursPerMeter,
EmpiricalConsumptionModel.descentRecoveryInWattHoursPerMeter and a
EmpiricalConsumptionModel.freeFlowSpeedTable.
Note: This is a beta release of this feature, so there could be a few bugs and unexpected behaviors.
Related APIs may change for new releases without a deprecation process.
-
Rate of energy consumed per meter rise in elevation (in Wh/m, i.e., Watt-hours per meter).
Declaration
Swift
public var ascentConsumptionInWattHoursPerMeter: Double -
Rate of energy recovered per meter fall in elevation (in Wh/m, i.e., Watt-hours per meter).
Declaration
Swift
public var descentRecoveryInWattHoursPerMeter: Double -
Free flow speed table describes energy consumption when traveling at constant speed. It defines a function curve specifying consumption rate at a given free flow speed on a flat stretch of road. Map keys represent speed values that are non-negative integers in units of (km/h). Map values represent consumption values that are non-negative floating point values in units of (Wh/m). The function is linearly interpolated between each successive pair of data points: For values below the first list value, the first value is used. For values after the last list value, the last list value is used. At minimum, one key/value pair must be set. In this case the consumption value is used for all possible speed keys.
Declaration
Swift
public var freeFlowSpeedTable: [Int32 : Double] -
Traffic speed table describes energy consumption when traveling under heavy traffic conditions, i.e. when the vehicle is expected to often change the travel speed. It defines a function curve specifying consumption rate at a given speed under traffic conditions on a flat stretch of road. Map keys represent traffic speed values that are non-negative integers in units of (km/h). Map values represent consumption values that are non-negative floating point values in units of (Wh/m). The function is linearly interpolated between each successive pair of data points: For values below the first list value, the first value is used. For values after the last list value, the last list value is used. If only one key/value pair is set, the consumption value is used for all possible traffic speed keys. If
EmpiricalConsumptionModel.trafficSpeedTableis empty then onlyEmpiricalConsumptionModel.freeFlowSpeedTableis used for calculating speed-related energy consumption.Declaration
Swift
public var trafficSpeedTable: [Int32 : Double] -
Rate of energy (in Wh/s) consumed by the vehicle’s auxiliary systems (e.g., air conditioning, lights) per second of travel.
Declaration
Swift
public var auxiliaryConsumptionInWattHoursPerSecond: Double -
init(ascentConsumptionInWattHoursPerMeter:descentRecoveryInWattHoursPerMeter: freeFlowSpeedTable: trafficSpeedTable: auxiliaryConsumptionInWattHoursPerSecond: ) Creates a new instance.
Declaration
Swift
public init(ascentConsumptionInWattHoursPerMeter: Double = 0.0, descentRecoveryInWattHoursPerMeter: Double = 0.0, freeFlowSpeedTable: [Int32 : Double] = [:], trafficSpeedTable: [Int32 : Double] = [:], auxiliaryConsumptionInWattHoursPerSecond: Double = 0.0)