methods for calculating miles and fuel/electric usage for journeys
Methods
(inner) getElectricMiles(battery_range_miles, mpg, journey_miles) → {number}
work out the electric miles
Parameters:
Name | Type | Description |
---|---|---|
battery_range_miles |
number | |
mpg |
number | |
journey_miles |
number |
Returns:
- Type
- number
(inner) getICEMiles(electric_miles, journey_miles) → {number}
work out the ICE miles
Parameters:
Name | Type | Description |
---|---|---|
electric_miles |
number | |
journey_miles |
number |
Returns:
- Type
- number
(inner) getJourneyFuelRatio(travelled_miles, journey_miles) → {number}
proportion of journey carried out on fuel or electric miles
Parameters:
Name | Type | Description |
---|---|---|
travelled_miles |
number | fuel or electric miles travelled |
journey_miles |
number |
Returns:
- Type
- number
(inner) getJourneyMilesForPHEVs(skv_config) → {number}
for PHEVs, if a journey range is not provided then add how far the vehicle will travel on Charge Sustaining mode (previously called Condition B)
Parameters:
Name | Type | Description |
---|---|---|
skv_config |
struct | mpg, battery range, optional journey miles |
Returns:
- Type
- number
(inner) getMPGofficalRatio(mpg_official, mpg_user) → {number}
when user provides a custom mpg then we'll be applying a ratio to the official figures
Parameters:
Name | Type | Description |
---|---|---|
mpg_official |
number | |
mpg_user |
number |
Returns:
- Type
- number
(inner) journeyCostPortion(skv_data) → {struct}
Calculate fuel or electric portion of journey
Parameters:
Name | Type | Description |
---|---|---|
skv_data |
struct | struct of details for ppm, journey |
Returns:
- Type
- struct
(inner) journeyCostTotal(skv_journey_cost) → {struct}
combine the electric and ice miles and costs
Parameters:
Name | Type | Description |
---|---|---|
skv_journey_cost |
struct |
Returns:
- Type
- struct
(inner) journeyEmissionsPortion(skv_data) → {struct}
Calculate fuel or electric portion of journey
Parameters:
Name | Type | Description |
---|---|---|
skv_data |
struct | struct of optionally tailpipe and production for ppm, journey |
Returns:
- Type
- struct
(inner) journeyEmissionsTotal(skv_journey_emissions) → {struct}
combine the electric and ice miles and emissions
Parameters:
Name | Type | Description |
---|---|---|
skv_journey_emissions |
struct |
Returns:
- Type
- struct
(inner) numberOfJourneys(journey_miles, total_miles) → {number}
number of journeys carried out
Parameters:
Name | Type | Description |
---|---|---|
journey_miles |
number | |
total_miles |
number |
Returns:
- Type
- number
(inner) totalCostOfAllJourneys(skv_journey_cost, total_miles) → {struct}
bring together all the journeys to form the total overall cost
Parameters:
Name | Type | Description |
---|---|---|
skv_journey_cost |
struct | |
total_miles |
number |
Returns:
- Type
- struct
(inner) totalEmissionsOfAllJourneys(skv_journey_emissions, total_miles) → {struct}
total emissions for all journeys based on total_miles passed in
Parameters:
Name | Type | Description |
---|---|---|
skv_journey_emissions |
struct | |
total_miles |
number |
Returns:
- Type
- struct