References (iOS)

DKDriverTimeline

DKDriverTimeline is an object that contains timeline data for the given period.

public struct DKDriverTimeline: Codable {
    public let period: DKPeriod
    public let allContext: [DKAllContextItem]
    public let roadContexts: [DKRoadContext: [DKRoadContextItem]]
}
AttributeTypeDescription

period

The kind of aggregation period for this timeline

allContext

The list of all global context sorted by date

roadContexts

The dictionary of all road context and their associated list of context data sorted by date

DKPeriod

DKPeriod indicates the aggregation size of each timeline object. It is an enum with the following values:

ValueDescription

week

Timeline data is aggregated week by week

month

Timeline data is aggregated month by month

year

Timeline data is aggregated year by year

public enum DKPeriod: Int, Codable {
    case week
    case month
    case year
}

DKAllContextItem

DKAllContextItem is an object that contains data for global context for the given period.

public struct DKAllContextItem: Codable {
    public let date: Date
    public let numberTripTotal: Int
    public let numberTripScored: Int
    public let distance: Double
    public let duration: Int

    public var safety: DKSafety?
    public var ecoDriving: DKEcoDriving?
    public var phoneDistraction: DKDistraction?
    public var speeding: DKSpeeding?
    public var drivingConditions: DKDrivingConditions?
}
AttributeTypeDescription

date

Date

Start date of the given period

numberTripTotal

Int

Total number of trips made during the given period

numberTripScored

Int

Number of trips made that were long enough to have a score during the given period

distance

Double

Total distance travelled during the given period (in kilometers)

duration

Int

Total trip duration during the given period (in minutes)

safety

Safety's score and sub scores for the given period (present only if safety score is configured and the period has some scored trips)

ecoDriving

Eco-driving's score and sub scores for the given period (present only if eco-driving score is configured and the period has some scored trips)

phoneDistraction

Distraction's score and sub scores for the given period (present only if distraction score is configured)

speeding

Speeding's score and sub scores for the given period (present only if speeding score is configured)

drivingConditions

Advanced informations for a given period (total trip and distance for a specific DKDrivingCategory and by DKWeather, distance travelled by day/night and by weekdays/weekend)

DKSafety

DKSafety is an object that contains data for safety's score and sub scores.

public struct DKSafety: Codable {
    public let score: Double
    public let acceleration: Int
    public let braking: Int
    public let adherence: Int
}
AttributeTypeDescription

score

Double

Global safety score for the given period (ranging from 3 to 10)

acceleration

Int

Number of harsh accelerations during the given period

braking

Int

Number of hard breakings during the given period

adherence

Int

Number of adherence limits during the given period

DKEcoDriving

DKEcoDriving is an object that contains data for eco-driving's score and sub scores.

public struct DKEcoDriving: Codable {
    public let score: Double
    public let efficiencyAcceleration: Double
    public let efficiencyBrake: Double
    public let efficiencySpeedMaintain: Double
    public let fuelVolume: Double
    public let fuelSaving: Double
    public let co2Mass: Double
}
AttributeTypeDescription

score

Double

Global eco-driving score for the given period (ranging from 6 to 10)

efficiencyAcceleration

Double

Sub score of acceleration efficiency for the given period (ranging from -5 to 5)

efficiencyBrake

Double

Sub score of braking efficiency for the given period (ranging from -5 to 5)

efficiencySpeedMaintain

Double

Sub score of speed maintain efficiency for the given period (ranging from 0 to 5)

fuelVolume

Double

Fuel consumption during the given period (in liters)

fuelSaving

Double

Achievable fuel savings during the given period (in liters)

co2Mass

Double

COâ‚‚ mass consumed during the given period (in kilograms)

DKDistraction

DKDistraction is an object that contains data for distraction's score and sub scores.

public struct DKDistraction: Codable {
    public let score: Double
    public let unlock: Int
    public let lock: Int
    public let callForbiddenDuration: Int
    public let numberTripWithForbiddenCall: Int
    public let callForbidden: Int
    public let callAuthorizedDuration: Int
    public let callAuthorized: Int
}
AttributeTypeDescription

score

Double

Global distraction score for the given period (ranging from 0 to 10)

unlock

Int

Number of screen unlocks during the given period

lock

Int

Number of screen locks during the given period

callForbiddenDuration

Int

Duration of forbidden calls during the given period (in seconds)

numberTripWithForbiddenCall

Int

Number of trips during which the driver made forbidden calls during the given period

callForbidden

Int

Number of forbidden calls during the given period

callAuthorizedDuration

Int

Duration of authorized calls during the given period (in seconds)

callAuthorized

Int

Number of authorized calls during the given period

DKSpeeding

DKSpeeding is an object that contains data for speeding's score and sub scores.

public struct DKSpeeding: Codable {
    public let score: Double
    public let speedingDuration: Int
    public let speedingDistance: Double
}
AttributeTypeDescription

score

Double

Global speeding score for the given period (ranging from 0 to 10)

speedingDuration

Int

Overspeeding duration during the given period (in seconds)

speedingDistance

Double

Overspeeding distance travelled during the given period (in meters)

DKDrivingConditions

DKDrivingConditions is an object that contains advanced driving information for the given period.

public struct DKDrivingConditions: Codable {
        public let tripCountByCategory: [DKDrivingCategory: Int]
        public let distanceByCategory: [DKDrivingCategory: Double]
        public let tripCountByWeatherType: [DKWeather: Int]
        public let distanceByWeatherType: [DKWeather: Double]
        public let dayDistance: Double
        public let nightDistance: Double
        public let weekdaysDistance: Double
        public let weekendDistance: Double
}
AttributeTypeDescription

tripCountByCategory

Total trips count by driving category

distanceByCategory

Total distance in km by driving category

tripCountByWeatherType

[DKWeather: Int]

Total trips count by weather category

distanceByWeatherType

[DKWeather: Double]

Total distance in km count by weather category

dayDistance

Double

Total distance traveled by the day in km

nightDistance

Double

Total distance traveled by night in km

weekdaysDistance

Double

Total distance traveled during weekdays in km

weekendDistance

Double

Total distance traveled during weekend in km

DKDrivingCategory

public enum DKDrivingCategory: Int, Codable {
    case lessThan2Km = 0
    case from2To10Km = 1
    case from10To50Km = 2
    case from50To100Km = 3
    case moreThan100Km = 4
}
AttributeDescription

lessThan2Km

Trip distance strictly below 2 km

from2To10Km

Trip distance in [2, 10[ km

from10To50Km

Trip distance in [10, 50[ km

from50To100Km

Trip distance in [50, 100[ km

moreThan100Km

Trip distance is equals or above 100 km

DKRoadContextItem

DKRoadContextItem is an object that contains data for the given road context and given period.

public struct DKRoadContextItem: Codable {
    public let type: DKRoadContext
    public let date: Date
    public let numberTripTotal: Int
    public let numberTripScored: Int
    public let distance: Double
    public let duration: Int
    
    public var ecoDriving: DKEcoDriving?
    public var safety: DKSafety?
}
AttributeTypeDescription

type

Road context for the given period

date

Date

Start date of the given period

numberTripTotal

Int

Total number of trips made during the given period and road context

numberTripScored

Int

Number of trips made that were long enough to have a score during the given period and road context

distance

Double

Total distance travelled during the given period and road context (in kilometers)

duration

Int

Total trip duration during the given period and road context (in minutes)

safety

Safety's score and sub scores for the given period and road context (present only if safety score is configured and the period has some scored trips)

ecoDriving

Eco-driving's score and sub scores for the given period and road context (present only if eco-driving score is configured and the period has some scored trips)

DKRoadContext

DKRoadContext indicates the kind of roads where the data was gathered. It is an enum with the following values:

ValueDescription

trafficJam

The targeted driver was in traffic jams

heavyUrbanTraffic

The targeted driver was in dense city roads

city

The targeted driver was in light traffic city roads

suburban

The targeted driver was in suburban or countryside roads

expressways

The targeted driver was in express ways

public enum DKRoadContext: Int, Codable {
    case trafficJam
    case heavyUrbanTraffic
    case city
    case suburban
    case expressways
}


DKDriverProfile

DKDriverProfile is the object describing the driver profile.

AttributeTypeDescription

distance

Distance class

activity

Activity class

regularity

Regularity class

mainRoadContext

Main road context

mobility

Mobility class

statistics

Statistics about the driver

weekRegularity

Information about driver’s week regularity

monthRegularity

Information about driver’s month regularity

distanceEstimation

Distance estimation by week, month or year

roadContextInfoByRoadContext

Contains information about road contexts

commonTripByType

Provides information about common trips, by type of trip

mobilityAreaRadiusByType

Provides radius of mobility area by type of mobility

public struct DKDriverProfile: Codable {
    public var distance: DKDistanceProfile
    public var activity: DKActivityProfile
    public var regularity: DKRegularityProfile
    public var mainRoadContext: DKRoadContext
    public var mobility: DKMobilityProfile
    public var statistics: DKDriverStatistics
    public var weekRegularity: DKDriverRegularity
    public var monthRegularity: DKDriverRegularity
    public var distanceEstimation: DKDriverDistanceEstimation
    public var roadContextInfoByRoadContext: [DKRoadContext: DKRoadContextInfo]
    public var commonTripByType: [DKCommonTripType: DKCommonTrip]
    public var mobilityAreaRadiusByType: [DKMobilityAreaType: Int]
}

DKDistanceProfile

DKDistanceProfile indicates the distance class of the driver.

ValueDescriptionEstimated yearly distance (in km)

.veryShort

Very short distance driver

less than 5 000

.short

Short distance driver

5 000 to 10 000

.medium

Medium distance driver

10 000 to 20 000

.long

Long distance driver

20 000 to 40 000

.veryLong

Professional driver

more than 40 000

public enum DKDistanceProfile: String, Codable {
    case veryShort = "VERY_SHORT"
    case short = "SHORT"
    case medium = "MEDIUM"
    case long = "LONG"
    case veryLong = "VERY_LONG"
}

DKActivityProfile

DKActivityProfile indicates the activity class of the driver.

ValueDescriptionPercentage of active weeks

.low

Low activity driver

less than 30 %

.medium

Medium activity driver

30 to 60 %

.high

High activity driver

more than 60 %

public enum DKActivityProfile: String, Codable {
    case low = "LOW"
    case medium = "MEDIUM"
    case high = "HIGH"
}

DKRegularityProfile

DKRegularityProfile indicates the regularity class of the driver.

ValueDescription

.regular

Regular driver

.intermittent

Intermittent driver

public enum DKRegularityProfile: String, Codable {
    case regular = "REGULAR"
    case intermittent = "INTERMITTENT"
}

DKMobilityProfile

DKMobilityProfile indicates the mobility class of the driver.

ValueDescription

.narrow

90% of trips are within a radius of less than 10 km

.small

90% of trips are within a radius of less than 20 km

.medium

90% of trips are within a radius of less than 30 km

.large

90% of trips are within a radius of less than 50 km

.wide

90% of trips are within a radius of less than 100 km

.vast

90% of trips are within a radius of 100 km or more

public enum DKMobilityProfile: String, Codable {
    case narrow = "NARROW"
    case small = "SMALL"
    case medium = "MEDIUM"
    case large = "LARGE"
    case wide = "WIDE"
    case vast = "VAST"
}

DKDriverStatistics

DKDriverStatistics is an object providing statistics about the driver.

AttributeTypeDescription

tripsNumber

Int

Total number of trips

totalDistance

Int

Total distance (in km)

totalDuration

Int

Total driving duration (in min)

weekNumber

Int

Number of weeks since user registration

activeWeekNumber

Int

Number of active weeks since user registration

monthNumber

Int

Number of months since user registration

activeMonthNumber

Int

Number of active months since user registration

peakTime

DKTime

Peak time trip starts

peakDay

DKDay

Weekday with most trips completed

public struct DKDriverStatistics: Codable {
    public var tripsNumber: Int
    public var totalDistance: Int
    public var totalDuration: Int
    public var weekNumber: Int
    public var activeWeekNumber: Int
    public var monthNumber: Int
    public var activeMonthNumber: Int
    public var peakTime: DKTime
    public var peakDay: DKDay
}

DKDriverRegularity

DKDriverRegularity is an object providing information about driver’s regularity.

AttributeTypeDescription

periodNumber

Int

Number of weeks or months used to calculate regularity

tripNumberMean

Int

Average number of trips per week or month

tripNumberStandardDeviation

Int

Standard deviation of the number of trips per week or month

distanceMean

Int

Average weekly or monthly distance (in km)

distanceStandardDeviation

Int

Standard deviation of the weekly or monthly distance (in km)

durationMean

Int

Average weekly or monthly driving duration (in min)

durationStandardDeviation

Int

Standard deviation of the weekly or monthly driving duration (in min)

public struct DKDriverRegularity: Codable {
    public var periodNumber: Int
    public var tripNumberMean: Int
    public var tripNumberStandardDeviation: Int
    public var distanceMean: Int
    public var distanceStandardDeviation: Int
    public var durationMean: Int
    public var durationStandardDeviation: Int
}

DKDriverDistanceEstimation

DKDriverDistanceEstimation is an object providing distance estimation by week, month or year.

AttributeTypeDescription

weekDistance

Int

Estimated weekly distance (in km)

monthDistance

Int

Estimated monthly distance (in km)

yearDistance

Int

Estimated annual distance (in km)

confidence

Confidence level indicator, based on the available data

public struct DKDriverDistanceEstimation: Codable {
    public var weekDistance: Int
    public var monthDistance: Int
    public var yearDistance: Int
    public var confidence: DKDriverDistanceEstimationConfidence
}

DKDriverDistanceEstimationConfidence

DKDriverDistanceEstimationConfidence indicates the distance estimation confidence class.

ValueDescription

.low

If less than 8 weeks since driver’s subscription

.medium

If between 9 and 16 weeks since driver’s subscription

.high

If more than 16 weeks since driver’s subscription

public enum DKDriverDistanceEstimationConfidence: String, Codable {
    case low = "LOW"
    case medium = "MEDIUM"
    case high = "HIGH"
}

DKRoadContextInfo

DKRoadContextInfo is an object providing information about road context for the driver.

AttributeTypeDescription

roadContext

Road context

distancePercentage

Double

Percentage of total distance driven in this context

durationPercentage

Double

Percentage of total duration driven in this context

consumedEnergyPercentage

Double

Percentage of total energy driven in this context

public struct DKRoadContextInfo: Codable {
    public var roadContext: DKRoadContext
    public var distancePercentage: Double
    public var durationPercentage: Double
    public var consumedEnergyPercentage: Double
}

DKCommonTripType

DKCommonTripType indicates the type of trip.

ValueDescription

.mostFrequent

Most frequent trip

.unknown

Unknown type for the SDK (if a new type is added but the SDK is not up to date)

public enum DKCommonTripType: String, Codable {
    case mostFrequent = "MOST_FREQUENT"
    case unknown = "UNKNOWN"
}

DKCommonTrip

DKCommonTrip is an object providing information about a trip.

AttributeTypeDescription

type

Type of trip

tripNumber

Int

Number of trips

distanceMean

Int

Average trip distance (in km)

durationMean

Int

Average trip duration (in min)

roadContext

Road context type

public struct DKCommonTrip: Codable {
    public var type: DKCommonTripType
    public var tripNumber: Int
    public var distanceMean: Int
    public var durationMean: Int
    public var roadContext: DKRoadContext
}

DKMobilityAreaType

DKMobilityAreaType indicates the type of mobility area.

ValueDescription

.percentile50Th

The radius including 50% of all the user’s trips

.percentile90Th

The radius including 90% of all the user’s trips

public enum DKMobilityAreaType: String, Codable {
    case percentile50Th = "PERCENTILE_50TH"
    case percentile90Th = "PERCENTILE_90TH"
}

Last updated