HERE Android SDK Developer's Guide

ConsumptionParameters

The class ConsumptionParameters is a member of com.here.android.mpa.routing .

Class Summary

public final class ConsumptionParameters

extends java.lang.Object

Stores information about consumption parameters of vehicle.

[For complete information, see the section Class Details]

Nested Class Summary

Table 1. Nested Classes in ConsumptionParameters
Nested Classes

public static final class ConsumptionParameters.ConsumptionForSpeed

Specifies consumption per meter for different travel speeds.

public static final class ConsumptionParameters.TrafficScale

Defines the traffic speed/free-flow speed adjustment scale.

Constructor Summary

Table 2. Constructors in ConsumptionParameters
Constructors

ConsumptionParameters ()

Default Constructor

Method Summary

Table 3. Methods in ConsumptionParameters
Methods

public static ConsumptionParameters createDefaultConsumptionParameters ()

Creates consumption parameters with default values.

public double getAccelerationMultiplier ()

Gets the acceleration multiplier.

public double getAscentMultiplier ()

Gets the ascent multiplier.

public double getAuxiliaryConsumption ()

Gets the auxiliary consumption.

public double getDecelerationMultiplier ()

Gets the deceleration multiplier.

public double getDescentMultiplier ()

Gets the descent multiplier.

public boolean getHighSpeedConsumptionEnabled ()

Gets "high speed consumption" mode state.

public int getHighSpeedConsumptionThresholdKmh ()

Gets free flow speed threshold [kmh] for a link to satisfy "high speed consumption" conditions.

public java.util.List <ConsumptionForSpeed> getSpeedParameters ()

Gets consumption per meter for different travel speeds.

public java.util.List <TrafficScale> getTrafficScales ()

Gets the traffic scaling coefficients.

public java.util.List <ConsumptionForSpeed> getTrafficSpeedParameters ()

Gets consumption per meter for different travel speeds for heavy traffic.

public double getTurnTimeMultiplier ()

Gets the turn time multiplier.

public int hashCode ()

For documentation, see java.lang.Object

public void setAccelerationMultiplier (double multiplier)

Sets acceleration multiplier.

public void setAscentMultiplier (double multiplier)

Sets the ascent multiplier.

public void setAuxiliaryConsumption (double auxiliaryConsumption)

Sets auxiliary consumption per second.

public void setDecelerationMultiplier (double multiplier)

Sets deceleration multiplier.

public void setDescentMultiplier (double multiplier)

Sets descent multiplier.

public void setHighSpeedConsumptionEnabled (boolean enabled)

Enables/disables "high speed consumption" mode.

public void setHighSpeedConsumptionThresholdKmh (int speedConsumptionThresholdKmh)

Sets free flow speed threshold [kmh] for a link to satisfy "high speed consumption" conditions.

public void setSpeedParameters (java.util.List <ConsumptionForSpeed> consumptionForSpeedList)

Sets consumption per meter according to travel speeds.

public void setTrafficScale (java.util.List <TrafficScale> trafficScales)

Sets the traffic scaling coefficients.

public void setTrafficSpeedParameters (java.util.List <ConsumptionForSpeed> consumptionForSpeedList)

Sets consumption per meter for different travel speeds for heavy traffic.

public void setTurnTimeMultiplier (double multiplier)

Sets turn time multiplier.

Class Details

Stores information about consumption parameters of vehicle. Consumption parameters are used for consumption calculation (See Route and RouteConsumption).

Consumption describes the usage rate of a resource that is used by the vehicle, such as electrical energy, over a period of time.

IMPORTANT: Consumption calculation is a Beta feature. The related classes are subject to change without notice.

Constructor Details

ConsumptionParameters ()

Default Constructor

Method Details

public static ConsumptionParameters createDefaultConsumptionParameters ()

Creates consumption parameters with default values.

public double getAccelerationMultiplier ()

Gets the acceleration multiplier.

Returns:

The multiplier

public double getAscentMultiplier ()

Gets the ascent multiplier.

Returns:

The multiplier

public double getAuxiliaryConsumption ()

Gets the auxiliary consumption.

Returns:

The consumption value

public double getDecelerationMultiplier ()

Gets the deceleration multiplier.

Returns:

The multiplier

public double getDescentMultiplier ()

Gets the descent multiplier.

Returns:

The multiplier

public boolean getHighSpeedConsumptionEnabled ()

Gets "high speed consumption" mode state.

public int getHighSpeedConsumptionThresholdKmh ()

Gets free flow speed threshold [kmh] for a link to satisfy "high speed consumption" conditions. See setHighSpeedConsumptionEnabled(boolean)

public java.util.List <ConsumptionForSpeed> getSpeedParameters ()

Gets consumption per meter for different travel speeds.

Returns:

List of ConsumptionParameters.ConsumptionForSpeed instances or null if none are available.

public java.util.List <TrafficScale> getTrafficScales ()

Gets the traffic scaling coefficients.

Returns:

List of ConsumptionParameters.TrafficScale instances or null if none are available.

public java.util.List <ConsumptionForSpeed> getTrafficSpeedParameters ()

Gets consumption per meter for different travel speeds for heavy traffic.

Returns:

List of ConsumptionParameters.ConsumptionForSpeed instances or null if none are available.

public double getTurnTimeMultiplier ()

Gets the turn time multiplier.

Returns:

The multiplier

public int hashCode ()

For documentation, see java.lang.Object

public void setAccelerationMultiplier (double multiplier)

Sets acceleration multiplier.

During speed up, this parameter is used to model capacity expenditure in capacity units per km/h^2 of acceleration. A higher value corresponds to greater capacity expenditure while the vehicle is accelerating.

Parameters:

  • multiplier

    The acceleration multiplier

public void setAscentMultiplier (double multiplier)

Sets the ascent multiplier. Ascent multiplier models capacity expenditure during ascent in capacity units per meter of ascent. A higher value corresponds to greater capacity expenditure while driving up-hill.

Parameters:

  • multiplier

    The ascent multiplier

public void setAuxiliaryConsumption (double auxiliaryConsumption)

Sets auxiliary consumption per second.

Auxiliary consumption is used to account for the consumption by items such as lights, air conditioner, or stereo. A higher value corresponds to greater capacity expenditure over time.

Parameters:

  • auxiliaryConsumption

    The combined auxiliary consumption value

public void setDecelerationMultiplier (double multiplier)

Sets deceleration multiplier.

During slowdown, this parameter is used to model capacity gain in capacity units per km/h^2 of deceleration. A higher value corresponds to greater capacity gain while the vehicle is decelerating.

Parameters:

  • multiplier

    The deceleration multiplier

public void setDescentMultiplier (double multiplier)

Sets descent multiplier.

Descent multiplier is the model's capacity gained during descent, in capacity units per meter of descent. A higher value corresponds to greater capacity gain while driving down-hill.

Parameters:

  • multiplier

    The descent multiplier

public void setHighSpeedConsumptionEnabled (boolean enabled)

Enables/disables "high speed consumption" mode.

Link satisfies "high speed consumption" mode conditions when it:

  • is a highway;
  • has no speed limit;
  • has no time-aware speed limit;
  • has no dynamic speed limit;
  • has free flow speed above threshold get_high_speed_consumption_threshold_kmh.

When "high speed consumption" mode is enabled and link satisfies its conditions, then consumption for this link is calculated not based on its free flow speed, but based on the highest consumption provided by get_speed_parameters.

The idea is to better predict consumption for drivers going on considerably higher speed than free flow values, eg. in sport mode.

Parameters:

  • enabled

public void setHighSpeedConsumptionThresholdKmh (int speedConsumptionThresholdKmh)

Sets free flow speed threshold [kmh] for a link to satisfy "high speed consumption" conditions. See setHighSpeedConsumptionEnabled(boolean)

Parameters:

  • speedConsumptionThresholdKmh

public void setSpeedParameters (java.util.List <ConsumptionForSpeed> consumptionForSpeedList)

Sets consumption per meter according to travel speeds.

Setting only this value is sufficient to perform basic consumption calculation.

This list is made up of pairs of values representing the speed (in km/h) and the consumption per meter in the capacity unit.

Consider a simple consumption table for a sample electric vehicle where the consumption unit is kilowatt hours (kWh):

  • 0 - 30 km/h - 38.82 kWh
  • 31 - 90 km/h - 18.20 kWh
  • More than 90 km/h - 27.41 kWh

The speeds should be set with the upper bound of each speed range:

      List<ConsumptionParameters.ConsumptionForSpeed>
speedParameters = Arrays.asList(
     new ConsumptionParameters.ConsumptionForSpeed(30, 38.82),
     new ConsumptionParameters.ConsumptionForSpeed(90, 18.20),
     new ConsumptionParameters.ConsumptionForSpeed(250,
27.41));      
         

Note: Default values are assigned when the object is instantiated.

Parameters:

Throws:

  • IllegalArgumentException

    if consumptionForSpeedList is null or empty.

public void setTrafficScale (java.util.List <TrafficScale> trafficScales)

Sets the traffic scaling coefficients. Traffic Scale coefficients specifies a piece-wise linear scaling between the traffic speed parameters and the speed parameters. For a given traffic value (calculated as 1 - traffic speed/free-flow speed) this mapping is applied to determine the interpolation point between free-flow consumption and traffic consumption for the traffic speed defined by the speed parameters (see getSpeedParameters()) and traffic speed parameters (see getTrafficSpeedParameters()).

Parameters:

Throws:

  • IllegalArgumentException

    if trafficScales is null or empty.

public void setTrafficSpeedParameters (java.util.List <ConsumptionForSpeed> consumptionForSpeedList)

Sets consumption per meter for different travel speeds for heavy traffic. The exact consumption per meter that is used will be an interpolated value between the standard consumption for speed and the traffic consumption for speed, depending on the amount of traffic along each part of the route. The interpolation can be configured with setTrafficScale(List).

Note: This is an advanced consumption calculation feature. For more information, please contact your HERE representative.

This list is made up of pairs of values representing the speed (in km/h) and the consumption per meter in the capacity unit. See setSpeedParameters(List) for more details on how the values should be filled in.

Parameters:

Throws:

  • IllegalArgumentException

    if consumptionForSpeedList is null or empty.

public void setTurnTimeMultiplier (double multiplier)

Sets turn time multiplier.

Capacity expenditure while turning, in capacity units per second of travel time. A higher value corresponds to greater capacity expenditure while the vehicle is turning.

Parameters:

  • multiplier

    The turn time multiplier