4.8. fleet_averages_dict module
- class fleet_averages_dict.FleetAverages(fleet_dict)[source]
Bases:
objectA FleetAverages object contains annual averages for vehicles by model year and by calendar year.
- Parameters:
fleet_dict: Dictionary; contains fleet data, averages by model year and calendar year.
- create_new_attributes()[source]
- Returns:
A list of new attributes to be calculated and provided in output files.
- create_fleet_averages_dict(settings, fleet_df)[source]
This function creates a dictionary of fleet average values and adds a discount rate element to the key. It also calculates an average annual VMT/vehicle and a cumulative annual average VMT/vehicle.
- Parameters:
settings: The SetInputs class.
fleet_df: DataFrame; the project fleet DataFrame.
- Returns:
A dictionary of the fleet having keys equal to ((vehicle), modelYearID, ageID, discount_rate) where vehicle is a tuple representing an alt_sourcetype_regclass_fueltype vehicle, and values representing per vehicle or per mile averages for each key over time.
- update_dict(key, input_dict)[source]
- Parameters:
key: Tuple; the key of the dictionary instance.
input_dict: Dictionary; represents the attribute-value pairs to be updated.
- Returns:
The dictionary instance with ‘attribute’ updated with ‘value.’
- get_attribute_value(key, attribute)[source]
- Parameters:
key: Tuple; the key of the dictionary instance.
attribute: String; represents the attribute to be updated.
- Returns:
The value of ‘attribute’ within the dictionary instance.
- static calc_per_veh_cumulative_vmt(fleet_dict)[source]
This function calculates cumulative average VMT/vehicle year-over-year for use in estimating a typical VMT per year and for estimating emission repair costs.
- Parameters:
fleet_dict: Dictionary; represents the dictionary instance.
- Returns:
The dictionary instance updated with cumulative annual average VMT/vehicle.
- Note:
VMT does not differ across options.