4.15. repair_costs module

repair_costs.calc_typical_vmt_per_year(settings, vehicle, alt, model_year, averages_dict)[source]

This function calculates a typical annual VMT/vehicle over a set number of years as set via the General Inputs workbook. This typical annual VMT/vehicle can then be used to estimate the ages at which warranty and useful life will be reached. When insufficient years are available – e.g., if the typical_vmt_thru_ageID is set to >5 years and the given vehicle is a MY2041 vintage vehicle and the fleet input file contains data only thru CY2045, then insufficient data exist to calculate the typical VMT for that vehicle – the typical VMT for that vehicle will be set equal to the last prior MY vintage for which sufficient data were present.

Parameters:

settings: The SetInputs class.

vehicle: Tuple; represents a sourcetype_regclass_fueltype vehicle.

alt: Numeric; the Alternative or option ID.

model_year: Numeric; the model year of the passed vehicle.

averages_dict: Dictionary; contains cumulative annual average VMT/vehicle.

Returns:

A single typical annual VMT/veh value for the passed vehicle of the given model year.

repair_costs.calc_estimated_age(settings, vehicle, alt, model_year, identifier, typical_vmt, estimated_ages_dict)[source]
Parameters:

settings: The SetInputs class.

vehicle: Tuple; represents a sourcetype_regclass_fueltype vehicle.

alt: Numeric; the Alternative or option ID.

model_year: Numeric; the model year of the passed vehicle.

identifier: String; the identifier of the age being estimated (i.e., ‘Warranty’ or ‘Usefullife’).

typical_vmt: Numeric; the typical annual VMT/vehicle over a set number of years as set via the General Inputs workbook (see calc_typical_vmt_per_year function).

estimated_ages_dict: Dictionary in which to collect estimated ages to be included in the outputs for the given run.

Returns:

An integer representing the age at which the identifier will be reached for the passed vehicle/model year.

A dictionary that tracks those ages for all vehicles.

repair_costs.calc_emission_repair_costs_per_mile(settings, averages_dict)[source]
Parameters:

settings: The SetInputs class.

averages_dict: Dictionary; contains tech package direct costs/vehicle and cumulative annual average VMT/vehicle.

Returns:

The averages_dict dictionary updated to include emission repair costs/mile for each dictionary key.

A repair cost/mile dictionary containing details used in the calculation of repair cost/mile and which is then written to an output file for the given run.

An ‘estimated ages’ dictionary containing details behind the calculations and which is then written to an output file for the given run.

repair_costs.calc_per_veh_emission_repair_costs(averages_dict)[source]
Parameters:

averages_dict: Dictionary; contains annual emission repair costs/mile.

Returns:

The passed dictionary updated with annual emission repair costs/vehicle for each dictionary key.

repair_costs.calc_emission_repair_costs(totals_dict, averages_dict, vpop_arg)[source]
Parameters:

totals_dict: Dictionary; contains annual vehicle populations (VPOP).

averages_dict: Dictionary; contains annual average emission repair costs/mile.

vpop_arg: String; specifies the population attribute to use (e.g., “VPOP” or “VPOP_withTech”)

Returns:

The totals_dict dictionary updated with annual emission repair costs for all vehicles.