ElectricEngine
public class ElectricEngine
A electric vehicle engine for route planning and consumption estimation.
Important
This is a Public Preview API. It may be changed or removed at any time.-
Declaration
Swift
public init( consumption: Consumption? = nil, efficiency: ElectricVehicleEfficiency? = nil, chargeLevel: ChargeLevel? = nil )
Parameters
consumption
Specifies the consumption model of the electric vehicle.
efficiency
Specifies the efficiency of the engine.
chargeLevel
Specifies the current and maximum charge of the vehicle
-
Describes the capacity and consumption of a electric vehicle.
Declaration
Swift
public typealias Consumption = ConsumptionModel<TTUnitElectricEfficiency, UnitPower>
-
Specifies the consumption model of the electric vehicle.
Declaration
Swift
public let consumption: Consumption?
-
Specifies the efficiency of the engine
Declaration
Swift
public let efficiency: ElectricVehicleEfficiency?
-
Specifies the current and maximum charge of the vehicle
Declaration
Swift
public let chargeLevel: ChargeLevel?
-
Copies the current ElectricEngine with changes specified in build closure
Declaration
Swift
public func copy(build: (inout Builder) -> ()) -> ElectricEngine
Parameters
build
This closure allows for change of ElectricEngine values
Return Value
ElectricEngine with the changes set on the closure
-
The
Builder
creates a new instance ofElectricEngine
with modified fields.Declaration
Swift
public struct Builder