Sorry, you need to enable JavaScript to visit this website.

Consumption model

Consumption model

Allow your user to utilise the vehicle-specific consumption model when requesting a new route.
The consumption model can be calculated based on a number of Routing API
parameters for two vehicle types: combustion or electric and the output will
contain the additional field fuelConsumptionInLiters or batteryConsumptionInkWh.
For more details, please refer to: this documentation.

Sample use case: You are planning a journey and you want to select the most optimal route
in terms of fuel / energy consumption.

To request a route and calculate consumption model for combustion vehicle:

_

RouteQuery queryBuilder = RouteQueryBuilder.create(routeConfig.getOrigin(), routeConfig.getDestination())
        .withConsiderTraffic(false)
        .withMaxAlternatives(2)
        .withVehicleWeightInKg(1600) //vehicle weight in kilograms
        .withCurrentFuelInLiters(50.0)
        .withAuxiliaryPowerInLitersPerHour(0.2)
        .withFuelEnergyDensityInMJoulesPerLiter(34.2)
        .withAccelerationEfficiency(0.33) //e.g. KineticEnergyGained/ChemicalEnergyConsumed
        .withDecelerationEfficiency(0.33) //e.g. ChemicalEnergySaved/KineticEnergyLost
        .withUphillEfficiency(0.33) //e.g. PotentialEnergyGained/ChemicalEnergyConsumed
        .withDownhillEfficiency(0.33) //e.g. ChemicalEnergySaved/PotentialEnergyLost
        .withVehicleEngineType(VehicleEngineType.COMBUSTION)
        .withConstantSpeedConsumptionInLitersPerHundredKm(SpeedToConsumptionMap.create(ImmutableMap.<Integer, Double>builder()
                //vehicle specific consumption model <speed, consumption in liters>
                .put(10, 6.5)
                .put(30, 7.0)
                .put(50, 8.0)
                .put(70, 8.4)
                .put(90, 7.7)
                .put(120, 7.5)
                .put(150, 9.0)
                .build())
        ).build();
val routeQuery = RouteQueryBuilder.create(origin, destination)
        .withConsiderTraffic(false)
        .withMaxAlternatives(MAX_ALTERNATIVES)
        .withVehicleWeightInKg(VEHICLE_WEIGHT)
        .withCurrentFuelInLiters(CURRENT_FUEL)
        .withAuxiliaryPowerInLitersPerHour(AUXILIARY_POWER_COMBUSTION)
        .withFuelEnergyDensityInMJoulesPerLiter(FUEL_ENERGY_DENSITY)
        .withAccelerationEfficiency(EFFICIENCY) //e.g. KineticEnergyGained/ChemicalEnergyConsumed
        .withDecelerationEfficiency(EFFICIENCY) //e.g. ChemicalEnergySaved/KineticEnergyLost
        .withUphillEfficiency(EFFICIENCY) //e.g. PotentialEnergyGained/ChemicalEnergyConsumed
        .withDownhillEfficiency(EFFICIENCY) //e.g. ChemicalEnergySaved/PotentialEnergyLost
        .withVehicleEngineType(VehicleEngineType.COMBUSTION)
        .withConstantSpeedConsumptionInLitersPerHundredKm(SpeedToConsumptionMap.create(ImmutableMap.builder<Int, Double>()
                //vehicle specific consumption model <speed, consumption in liters>
                .put(10, 6.5)
                .put(30, 7.0)
                .put(50, 8.0)
                .put(70, 8.4)
                .put(90, 7.7)
                .put(120, 7.5)
                .put(150, 9.0)
                .build())
        )
        .build()

To request a route and calculate consumption model for electric vehicle:

_

RouteQuery queryBuilder = RouteQueryBuilder.create(routeConfig.getOrigin(), routeConfig.getDestination())
        .withConsiderTraffic(false)
        .withMaxAlternatives(2)
        .withVehicleWeightInKg(1600) //vehicle weight in kilograms
        .withCurrentChargeInKWh(43.0)
        .withMaxChargeInKWh(85.0)
        .withAuxiliaryPowerInKW(1.7)
        .withAccelerationEfficiency(0.33) //e.g. KineticEnergyGained/ChemicalEnergyConsumed
        .withDecelerationEfficiency(0.33) //e.g. ChemicalEnergySaved/KineticEnergyLost
        .withUphillEfficiency(0.33) //e.g. PotentialEnergyGained/ChemicalEnergyConsumed
        .withDownhillEfficiency(0.33) //e.g. ChemicalEnergySaved/PotentialEnergyLost
        .withVehicleEngineType(VehicleEngineType.ELECTRIC)
        .withConstantSpeedConsumptionInKWhPerHundredKm(SpeedToConsumptionMap.create(ImmutableMap.<Integer, Double>builder()
                //vehicle specific consumption model <speed, consumption in kWh>
                .put(10, 5.0)
                .put(30, 10.0)
                .put(50, 15.0)
                .put(70, 20.0)
                .put(90, 25.0)
                .put(120, 30.0)
                .build())
        ).build();
val routeQuery = RouteQueryBuilder.create(origin, destination)
        .withConsiderTraffic(false)
        .withMaxAlternatives(MAX_ALTERNATIVES)
        .withVehicleWeightInKg(VEHICLE_WEIGHT)
        .withCurrentChargeInKWh(CURRENT_ELECTRIC_CHARGE)
        .withMaxChargeInKWh(MAX_ELECTRIC_CHARGE)
        .withAuxiliaryPowerInKW(AUXILIARY_POWER_ELECTRIC)
        .withAccelerationEfficiency(EFFICIENCY) //e.g. KineticEnergyGained/ChemicalEnergyConsumed
        .withDecelerationEfficiency(EFFICIENCY) //e.g. ChemicalEnergySaved/KineticEnergyLost
        .withUphillEfficiency(EFFICIENCY) //e.g. PotentialEnergyGained/ChemicalEnergyConsumed
        .withDownhillEfficiency(EFFICIENCY) //e.g. ChemicalEnergySaved/PotentialEnergyLost
        .withVehicleEngineType(VehicleEngineType.ELECTRIC)
        .withConstantSpeedConsumptionInKWhPerHundredKm(SpeedToConsumptionMap.create(ImmutableMap.builder<Int, Double>()
                //vehicle specific consumption model <speed, consumption in kWh>
                .put(10, 5.0)
                .put(30, 10.0)
                .put(50, 15.0)
                .put(70, 20.0)
                .put(90, 25.0)
                .put(120, 30.0)
                .build())
        )
        .build()


image

Combustion

image

Electric

You are here