diff --git a/.travis.yml b/.travis.yml index 8161c6e2cd..39a1edcab3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,6 +21,8 @@ jobs: - stage: Examples name: "MTC Example" env: TEST_SUITE=activitysim/examples/example_mtc/test + - name: "MTC Extended Example" + env: TEST_SUITE=activitysim/examples/example_mtc_extended/test - name: "Multizone Example" env: TEST_SUITE=activitysim/examples/example_multiple_zone/test - name: "Marin Example" diff --git a/activitysim/abm/models/__init__.py b/activitysim/abm/models/__init__.py index 351d9dc326..9e53fff809 100644 --- a/activitysim/abm/models/__init__.py +++ b/activitysim/abm/models/__init__.py @@ -36,3 +36,5 @@ from . import trip_scheduling_choice from . import trip_matrices from . import summarize +from . import vehicle_allocation +from . import vehicle_type_choice diff --git a/activitysim/abm/models/atwork_subtour_mode_choice.py b/activitysim/abm/models/atwork_subtour_mode_choice.py index 5b42c1b26e..41227670ba 100644 --- a/activitysim/abm/models/atwork_subtour_mode_choice.py +++ b/activitysim/abm/models/atwork_subtour_mode_choice.py @@ -10,6 +10,7 @@ from activitysim.core import inject from activitysim.core import pipeline from activitysim.core import simulate +from activitysim.core import expressions from activitysim.core import los from activitysim.core.pathbuilder import TransitVirtualPathBuilder @@ -166,6 +167,15 @@ def atwork_subtour_mode_choice( assign_in_place(tours, choices_df) pipeline.replace_table("tours", tours) + # - annotate tours table + if model_settings.get('annotate_tours'): + tours = inject.get_table('tours').to_frame() + expressions.assign_columns( + df=tours, + model_settings=model_settings.get('annotate_tours'), + trace_label=tracing.extend_trace_label(trace_label, 'annotate_tours')) + pipeline.replace_table("tours", tours) + if trace_hh_id: tracing.trace_df(tours[tours.tour_category == 'atwork'], label=tracing.extend_trace_label(trace_label, mode_column_name), diff --git a/activitysim/abm/models/tour_mode_choice.py b/activitysim/abm/models/tour_mode_choice.py index 0d0eb1adb4..9d9c725dac 100644 --- a/activitysim/abm/models/tour_mode_choice.py +++ b/activitysim/abm/models/tour_mode_choice.py @@ -10,6 +10,7 @@ from activitysim.core import config from activitysim.core import inject from activitysim.core import pipeline +from activitysim.core import expressions from activitysim.core import simulate from activitysim.core import logit from activitysim.core.util import assign_in_place, reindex @@ -353,6 +354,15 @@ def tour_mode_choice_simulate(tours, persons_merged, pipeline.replace_table("tours", all_tours) + # - annotate tours table + if model_settings.get('annotate_tours'): + tours = inject.get_table('tours').to_frame() + expressions.assign_columns( + df=tours, + model_settings=model_settings.get('annotate_tours'), + trace_label=tracing.extend_trace_label(trace_label, 'annotate_tours')) + pipeline.replace_table("tours", tours) + if trace_hh_id: tracing.trace_df(primary_tours, label=tracing.extend_trace_label(trace_label, mode_column_name), diff --git a/activitysim/abm/models/util/canonical_ids.py b/activitysim/abm/models/util/canonical_ids.py index 51d46d3022..915688044e 100644 --- a/activitysim/abm/models/util/canonical_ids.py +++ b/activitysim/abm/models/util/canonical_ids.py @@ -10,8 +10,8 @@ logger = logging.getLogger(__name__) -RANDOM_CHANNELS = ['households', 'persons', 'tours', 'joint_tour_participants', 'trips'] -TRACEABLE_TABLES = ['households', 'persons', 'tours', 'joint_tour_participants', 'trips'] +RANDOM_CHANNELS = ['households', 'persons', 'tours', 'joint_tour_participants', 'trips', 'vehicles'] +TRACEABLE_TABLES = ['households', 'persons', 'tours', 'joint_tour_participants', 'trips', 'vehicles'] CANONICAL_TABLE_INDEX_NAMES = { 'households': 'household_id', @@ -19,7 +19,8 @@ 'tours': 'tour_id', 'joint_tour_participants': 'participant_id', 'trips': 'trip_id', - 'land_use': 'zone_id' + 'land_use': 'zone_id', + 'vehicles': 'vehicle_id' } # unfortunately the two places this is needed (joint_tour_participation and estimation.infer diff --git a/activitysim/abm/models/vehicle_allocation.py b/activitysim/abm/models/vehicle_allocation.py new file mode 100644 index 0000000000..6a8dcd9dd1 --- /dev/null +++ b/activitysim/abm/models/vehicle_allocation.py @@ -0,0 +1,236 @@ +# ActivitySim +# See full license in LICENSE.txt. + +import logging + +import pandas as pd +import numpy as np +import itertools +import os + +from activitysim.core.interaction_simulate import interaction_simulate +from activitysim.core import simulate +from activitysim.core import tracing +from activitysim.core import config +from activitysim.core import inject +from activitysim.core import pipeline +from activitysim.core import expressions +from activitysim.core import logit +from activitysim.core import assign +from activitysim.core import los + +from activitysim.core.util import assign_in_place + +from .util.mode import mode_choice_simulate +from .util import estimation + +logger = logging.getLogger(__name__) + + +def annotate_vehicle_allocation(model_settings, trace_label): + """ + Add columns to the tours table in the pipeline according to spec. + + Parameters + ---------- + model_settings : dict + trace_label : str + """ + tours = inject.get_table('tours').to_frame() + expressions.assign_columns( + df=tours, + model_settings=model_settings.get('annotate_tours'), + trace_label=tracing.extend_trace_label(trace_label, 'annotate_tours')) + pipeline.replace_table("tours", tours) + + +def get_skim_dict(network_los, choosers): + """ + Returns a dictionary of skim wrappers to use in expression writing. + + Skims have origin as home_zone_id and destination as the tour destination. + + Parameters + ---------- + network_los : activitysim.core.los.Network_LOS object + choosers : pd.DataFrame + + Returns + ------- + skims : dict + index is skim wrapper name, value is the skim wrapper + """ + skim_dict = network_los.get_default_skim_dict() + orig_col_name = 'home_zone_id' + dest_col_name = 'destination' + + out_time_col_name = 'start' + in_time_col_name = 'end' + odt_skim_stack_wrapper = skim_dict.wrap_3d(orig_key=orig_col_name, dest_key=dest_col_name, + dim3_key='out_period') + dot_skim_stack_wrapper = skim_dict.wrap_3d(orig_key=dest_col_name, dest_key=orig_col_name, + dim3_key='in_period') + + choosers['in_period'] = network_los.skim_time_period_label(choosers[in_time_col_name]) + choosers['out_period'] = network_los.skim_time_period_label(choosers[out_time_col_name]) + + skims = { + "odt_skims": odt_skim_stack_wrapper.set_df(choosers), + "dot_skims": dot_skim_stack_wrapper.set_df(choosers), + } + return skims + + +@inject.step() +def vehicle_allocation( + persons, + households, + vehicles, + tours, + tours_merged, + network_los, + chunk_size, + trace_hh_id): + """Selects a vehicle for each occupancy level for each tour. + + Alternatives consist of the up to the number of household vehicles plus one + option for non-household vehicles. + + The model will be run once for each tour occupancy defined in the model yaml. + Output tour table will columns added for each occupancy level. + + The user may also augment the `tours` tables with new vehicle + type-based fields specified via the annotate_tours option. + + Parameters + ---------- + persons : orca.DataFrameWrapper + households : orca.DataFrameWrapper + vehicles : orca.DataFrameWrapper + vehicles_merged : orca.DataFrameWrapper + tours : orca.DataFrameWrapper + tours_merged : orca.DataFrameWrapper + chunk_size : orca.injectable + trace_hh_id : orca.injectable + """ + trace_label = 'vehicle_allocation' + model_settings_file_name = 'vehicle_allocation.yaml' + model_settings = config.read_model_settings(model_settings_file_name) + + logsum_column_name = model_settings.get('MODE_CHOICE_LOGSUM_COLUMN_NAME') + + estimator = estimation.manager.begin_estimation('vehicle_allocation') + + model_spec_raw = simulate.read_model_spec(file_name=model_settings['SPEC']) + coefficients_df = simulate.read_model_coefficients(model_settings) + model_spec = simulate.eval_coefficients(model_spec_raw, coefficients_df, estimator) + + nest_spec = config.get_logit_model_settings(model_settings) + constants = config.get_model_constants(model_settings) + + locals_dict = {} + locals_dict.update(constants) + locals_dict.update(coefficients_df) + + # ------ constructing alternatives from model spec and joining to choosers + vehicles_wide = vehicles.to_frame().pivot_table( + index='household_id', columns='vehicle_num', + values='vehicle_type', aggfunc=lambda x: ''.join(x)) + + alts_from_spec = model_spec.columns + # renaming vehicle numbers to alternative names in spec + vehicle_alt_columns_dict = {} + for veh_num in range(1, len(alts_from_spec)): + vehicle_alt_columns_dict[veh_num] = alts_from_spec[veh_num-1] + vehicles_wide.rename(columns=vehicle_alt_columns_dict, inplace=True) + + # if the number of vehicles is less than the alternatives, fill with NA + # e.g. all households only have 1 or 2 vehicles because of small sample size, + # still need columns for alternatives 3 and 4 + for veh_num, col_name in vehicle_alt_columns_dict.items(): + if col_name not in vehicles_wide.columns: + vehicles_wide[col_name] = '' + + # last entry in spec is the non-hh-veh option + assert alts_from_spec[-1] == 'non_hh_veh', "Last option in spec needs to be non_hh_veh" + vehicles_wide[alts_from_spec[-1]] = '' + + # merging vehicle alternatives to choosers + choosers = tours_merged.to_frame().reset_index() + choosers = pd.merge(choosers, vehicles_wide, how='left', on='household_id') + choosers.set_index('tour_id', inplace=True) + + # ----- setup skim keys + skims = get_skim_dict(network_los, choosers) + locals_dict.update(skims) + + # ------ preprocessor + preprocessor_settings = model_settings.get('preprocessor', None) + if preprocessor_settings: + expressions.assign_columns( + df=choosers, + model_settings=preprocessor_settings, + locals_dict=locals_dict, + trace_label=trace_label) + + logger.info("Running %s with %d tours", trace_label, len(choosers)) + + if estimator: + estimator.write_model_settings(model_settings, model_settings_file_name) + estimator.write_spec(model_settings) + estimator.write_coefficients(coefficients_df, model_settings) + estimator.write_choosers(choosers) + + tours = tours.to_frame() + + # ------ running for each occupancy level selected + tours_veh_occup_cols = [] + for occup in model_settings.get('OCCUPANCY_LEVELS', [1]): + logger.info("Running for occupancy = %d", occup) + # setting occup for access in spec expressions + locals_dict.update({'occup': occup}) + + choices = simulate.simple_simulate( + choosers=choosers, + spec=model_spec, + nest_spec=nest_spec, + skims=skims, + locals_d=locals_dict, + chunk_size=chunk_size, + trace_label=trace_label, + trace_choice_name='vehicle_allocation', + estimator=estimator) + + # matching alt names to choices + choices = choices.map(dict(enumerate(alts_from_spec))).to_frame() + choices.columns = ['alt_choice'] + + # last alternative is the non-household vehicle option + for alt in alts_from_spec[:-1]: + choices.loc[choices['alt_choice'] == alt, 'choice'] = \ + choosers.loc[choices['alt_choice'] == alt, alt] + choices.loc[choices['alt_choice'] == alts_from_spec[-1], 'choice'] = alts_from_spec[-1] + + # creating a column for choice of each occupancy level + tours_veh_occup_col = f'vehicle_occup_{occup}' + tours[tours_veh_occup_col] = choices['choice'] + tours_veh_occup_cols.append(tours_veh_occup_col) + + if estimator: + estimator.write_choices(choices) + choices = estimator.get_survey_values(choices, 'households', 'vehicle_allocation') + estimator.write_override_choices(choices) + estimator.end_estimation() + + pipeline.replace_table("tours", tours) + + tracing.print_summary('vehicle_allocation', tours[tours_veh_occup_cols], value_counts=True) + + annotate_settings = model_settings.get('annotate_tours', None) + if annotate_settings: + annotate_vehicle_allocation(model_settings, trace_label) + + if trace_hh_id: + tracing.trace_df(tours, + label='vehicle_allocation', + warn_if_empty=True) diff --git a/activitysim/abm/models/vehicle_type_choice.py b/activitysim/abm/models/vehicle_type_choice.py new file mode 100644 index 0000000000..2252700b31 --- /dev/null +++ b/activitysim/abm/models/vehicle_type_choice.py @@ -0,0 +1,526 @@ +# ActivitySim +# See full license in LICENSE.txt. + +import logging + +import pandas as pd +import numpy as np +import itertools +import os + +from activitysim.core.interaction_simulate import interaction_simulate +from activitysim.core import simulate +from activitysim.core import tracing +from activitysim.core import config +from activitysim.core import inject +from activitysim.core import pipeline +from activitysim.core import expressions +from activitysim.core import logit +from activitysim.core import assign +from activitysim.core import los + +from activitysim.core.util import assign_in_place +from .util import estimation + +logger = logging.getLogger(__name__) + + +def append_probabilistic_vehtype_type_choices( + choices, model_settings, trace_label): + """ + Select a fuel type for the provided body type and age of the vehicle. + + Make probabilistic choices based on the `PROBS_SPEC` file. + + Parameters + ---------- + choices : pandas.DataFrame + selection of {body_type}_{age} to append vehicle type to + probs_spec_file : str + trace_label : str + + Returns + ------- + choices : pandas.DataFrame + table of chosen vehicle types + """ + probs_spec_file = model_settings.get("PROBS_SPEC", None) + probs_spec = pd.read_csv( + config.config_file_path(probs_spec_file), comment='#') + + fleet_year = model_settings.get('FLEET_YEAR') + probs_spec['age'] = (1 + fleet_year - probs_spec['vehicle_year']).astype(int) + probs_spec['vehicle_type'] = probs_spec[ + ['body_type', 'age']].astype(str).agg('_'.join, axis=1) + + # left join vehicles to probs + choosers = pd.merge( + choices.reset_index(), probs_spec, + on='vehicle_type', + how='left', + indicator=True).set_index('vehicle_id') + + # checking to make sure all alternatives have probabilities + missing_alts = choosers.loc[choosers._merge == 'left_only', ['vehicle_type']] + assert len(missing_alts) == 0, \ + f"missing probabilities for alternatives:\n {missing_alts}" + + # chooser columns here should just be the fuel type probabilities + non_prob_cols = ['_merge', 'vehicle_type', 'body_type', 'age', 'vehicle_year'] + choosers.drop(columns=non_prob_cols, inplace=True) + + # probs should sum to 1 with residual probs resulting in choice of 'fail' + chooser_probs = choosers.div(choosers.sum(axis=1), axis=0).fillna(0) + chooser_probs['fail'] = 1 - chooser_probs.sum(axis=1).clip(0, 1) + + # make probabilistic choices + prob_choices, rands = logit.make_choices(chooser_probs, trace_label=trace_label, trace_choosers=choosers) + + # convert alt choice index to vehicle type attribute + prob_choices = chooser_probs.columns[prob_choices.values].to_series(index=prob_choices.index) + failed = (prob_choices == chooser_probs.columns.get_loc('fail')) + prob_choices = prob_choices.where(~failed, "NOT CHOSEN") + + # add new attribute to logit choice vehicle types + choices['vehicle_type'] = choices['vehicle_type'] + '_' + prob_choices + + return choices + + +def annotate_vehicle_type_choice_households(model_settings, trace_label): + """ + Add columns to the households table in the pipeline according to spec. + + Parameters + ---------- + model_settings : dict + trace_label : str + """ + households = inject.get_table('households').to_frame() + expressions.assign_columns( + df=households, + model_settings=model_settings.get('annotate_households'), + trace_label=tracing.extend_trace_label(trace_label, 'annotate_households')) + pipeline.replace_table("households", households) + + +def annotate_vehicle_type_choice_persons(model_settings, trace_label): + """ + Add columns to the persons table in the pipeline according to spec. + + Parameters + ---------- + model_settings : dict + trace_label : str + """ + persons = inject.get_table('persons').to_frame() + expressions.assign_columns( + df=persons, + model_settings=model_settings.get('annotate_persons'), + trace_label=tracing.extend_trace_label(trace_label, 'annotate_persons')) + pipeline.replace_table("persons", households) + + +def annotate_vehicle_type_choice_vehicles(model_settings, trace_label): + """ + Add columns to the vehicles table in the pipeline according to spec. + + Parameters + ---------- + model_settings : dict + trace_label : str + """ + vehicles = inject.get_table('vehicles').to_frame() + expressions.assign_columns( + df=vehicles, + model_settings=model_settings.get('annotate_vehicles'), + trace_label=tracing.extend_trace_label(trace_label, 'annotate_vehicles')) + pipeline.replace_table("vehicles", vehicles) + + +def get_combinatorial_vehicle_alternatives(alts_cats_dict): + """ + Build a pandas dataframe containing columns for each vehicle alternative. + + Rows will correspond to the alternative number and will be 0 except for the + 1 in the column corresponding to that alternative. + + Parameters + ---------- + alts_cats_dict : dict + model_settings : dict + + Returns + ------- + alts_wide : pd.DataFrame in wide format expanded using pandas get_dummies function + alts_long : pd.DataFrame in long format + """ + cat_cols = list(alts_cats_dict.keys()) # e.g. fuel type, body type, age + alts_long = pd.DataFrame( + list(itertools.product(*alts_cats_dict.values())), + columns=alts_cats_dict.keys()).astype(str) + alts_wide = pd.get_dummies(alts_long) # rows will sum to num_cats + + alts_wide = pd.concat([alts_wide, alts_long], axis=1) + return alts_wide, alts_long + + +def construct_model_alternatives(model_settings, alts_cats_dict, vehicle_type_data): + """ + Construct the table of vehicle type alternatives. + + Vehicle type data is joined to the alternatives table for use in utility expressions. + + Parameters + ---------- + model_settings : dict + alts_cats_dict : dict + nested dictionary of vehicle body, age, and fuel options + vehicle_type_data : pandas.DataFrame + + Returns + ------- + alts_wide : pd.DataFrame + includes column indicators and data for each alternative + alts_long : pd.DataFrame + rows just list the alternatives + """ + probs_spec_file = model_settings.get("PROBS_SPEC", None) + if probs_spec_file: + # do not include alternatives from fuel_type if they are given probabilisticly + del alts_cats_dict['fuel_type'] + alts_wide, alts_long = get_combinatorial_vehicle_alternatives(alts_cats_dict) + + # merge vehicle type data to alternatives if data is provided + if (vehicle_type_data is not None) and (probs_spec_file is None): + + alts_wide = pd.merge( + alts_wide, vehicle_type_data, + how='left', + on=['body_type', 'fuel_type', 'age'], + indicator=True) + + # checking to make sure all alternatives have data + missing_alts = alts_wide.loc[ + alts_wide._merge == 'left_only', ['body_type', 'fuel_type', 'age']] + + assert len(missing_alts) == 0, \ + f"missing vehicle data for alternatives:\n {missing_alts}" + alts_wide.drop(columns='_merge', inplace=True) + + # converting age to integer to allow interactions in utilities + alts_wide['age'] = alts_wide['age'].astype(int) + + # store alts in primary configs dir for inspection + configs_dirs = inject.get_injectable("configs_dir") + configs_dirs = configs_dirs if isinstance(configs_dirs, list) else [configs_dirs] + + if model_settings.get('WRITE_OUT_ALTS_FILE', False): + alts_wide.to_csv(os.path.join(configs_dirs[0]), 'vehicle_type_choice_aternatives.csv') + + return alts_wide, alts_long + + +def get_vehicle_type_data(model_settings, vehicle_type_data_file): + """ + Read in the vehicle type data and computes the vehicle age. + + Parameters + ---------- + model_settings : dict + vehicle_type_data_file : str + name of vehicle type data file found in config folder + + Returns + ------- + vehicle_type_data : pandas.DataFrame + table of vehicle type data with required body_type, age, and fuel_type columns + """ + vehicle_type_data = pd.read_csv( + config.config_file_path(vehicle_type_data_file), comment='#') + fleet_year = model_settings.get('FLEET_YEAR') + + vehicle_type_data['age'] = (1 + fleet_year - vehicle_type_data['vehicle_year']).astype(str) + vehicle_type_data['vehicle_type'] = vehicle_type_data[ + ['body_type', 'age', 'fuel_type']].astype(str).agg('_'.join, axis=1) + + return vehicle_type_data + + +def iterate_vehicle_type_choice( + vehicles_merged, + model_settings, + model_spec, + locals_dict, + estimator, + chunk_size, + trace_label): + """ + Select vehicle type for each household vehicle sequentially. + + Iterate through household vehicle numbers and select a vehicle type of + the form {body_type}_{age}_{fuel_type}. The preprocessor is run for each + iteration on the entire chooser table, not just the one for the current + vehicle number. This allows for computation of terms involving the presence + of other household vehicles. + + Vehicle type data is read in according to the specification and joined to + the alternatives. It can optionally be included in the output vehicles table + by specifying the `COLS_TO_INCLUDE_IN_VEHICLE_TABLE` option in the model yaml. + + Parameters + ---------- + vehicles_merged : orca.DataFrameWrapper + vehicle list owned by each household merged with households table + model_settings : dict + yaml model settings file as dict + model_spec : pandas.DataFrame + omnibus spec file with expressions in index and one column per segment + locals_dict : dict + additional variables available when writing expressions + estimator : Estimator object + chunk_size : orca.injectable + trace_label : str + + Returns + ------- + all_choices : pandas.DataFrame + single table of selected vehicle types and associated data + all_choosers : pandas.DataFrame + single table of chooser data with preprocessor variables included + """ + # - model settings + nest_spec = config.get_logit_model_settings(model_settings) + vehicle_type_data_file = model_settings.get('VEHICLE_TYPE_DATA_FILE', None) + probs_spec_file = model_settings.get("PROBS_SPEC", None) + alts_cats_dict = model_settings.get('combinatorial_alts', False) + + # adding vehicle type data to be available to locals_dict regardless of option + if vehicle_type_data_file: + vehicle_type_data = get_vehicle_type_data(model_settings, vehicle_type_data_file) + locals_dict.update({'vehicle_type_data': vehicle_type_data}) + + # - Preparing alternatives + # create alts on-the-fly as cartesian product of categorical values + if alts_cats_dict: + # do not include fuel types as alternatives if probability file is supplied + alts_wide, alts_long = construct_model_alternatives(model_settings, alts_cats_dict, vehicle_type_data) + + # - preparing choosers for iterating + vehicles_merged = vehicles_merged.to_frame() + vehicles_merged['already_owned_veh'] = '' + logger.info("Running %s with %d vehicles", trace_label, len(vehicles_merged)) + all_choosers = [] + all_choices = [] + + # - Selecting each vehicle in the household sequentially + # This is necessary to determine and use utility terms that include other + # household vehicles + for veh_num in range(1, vehicles_merged.vehicle_num.max()+1): + # - preprocessor + # running preprocessor on entire vehicle table to enumerate vehicle types + # already owned by the household + choosers = vehicles_merged + preprocessor_settings = model_settings.get('preprocessor', None) + if preprocessor_settings: + expressions.assign_columns( + df=choosers, + model_settings=preprocessor_settings, + locals_dict=locals_dict, + trace_label=trace_label) + + # only make choices for vehicles that have not been selected yet + choosers = choosers[choosers['vehicle_num'] == veh_num] + logger.info("Running %s for vehicle number %s with %d vehicles", trace_label, veh_num, len(choosers)) + + # if there were so many alts that they had to be created programmatically, + # by combining categorical variables, then the utility expressions should make + # use of interaction terms to accommodate alt-specific coefficients and constants + simulation_type = model_settings.get('SIMULATION_TYPE', 'interaction_simulate') + assert (simulation_type == 'interaction_simulate') or (simulation_type == 'simple_simulate'), \ + "SIMULATION_TYPE needs to be interaction_simulate or simple_simulate" + + log_alt_losers = config.setting('log_alt_losers', False) + + if simulation_type == 'interaction_simulate': + assert alts_cats_dict is not None, "Need to supply combinatorial_alts in yaml" + + choices = interaction_simulate( + choosers=choosers, + alternatives=alts_wide, + spec=model_spec, + log_alt_losers=log_alt_losers, + locals_d=locals_dict, + chunk_size=chunk_size, + trace_label=trace_label, + trace_choice_name='vehicle_type', + estimator=estimator) + + # otherwise, "simple simulation" should suffice, with a model spec that enumerates + # each alternative as a distinct column in the .csv + elif simulation_type == 'simple_simulate': + choices = simulate.simple_simulate( + choosers=choosers, + spec=model_spec, + log_alt_losers=log_alt_losers, + nest_spec=nest_spec, + locals_d=locals_dict, + chunk_size=chunk_size, + trace_label=trace_label, + trace_choice_name='vehicle_type', + estimator=estimator) + + if isinstance(choices, pd.Series): + choices = choices.to_frame('choice') + + choices.rename(columns={'choice': 'vehicle_type'}, inplace=True) + + if alts_cats_dict: + alts = alts_long[alts_long.columns].apply( + lambda row: '_'.join(row.values.astype(str)), axis=1).values + else: + alts = model_spec.columns + choices['vehicle_type'] = choices['vehicle_type'].map(dict(enumerate(alts))) + + # STEP II: append probabilistic vehicle type attributes + if probs_spec_file is not None: + choices = append_probabilistic_vehtype_type_choices( + choices, model_settings, trace_label) + + vehicles_merged.loc[choices.index, 'already_owned_veh'] = choices['vehicle_type'] + all_choices.append(choices) + all_choosers.append(choosers) + + # adding all vehicle numbers to one dataframe + all_choices = pd.concat(all_choices) + all_choosers = pd.concat(all_choosers) + + # appending vehicle type data to the vehicle table + additional_cols = model_settings.get('COLS_TO_INCLUDE_IN_VEHICLE_TABLE') + if additional_cols: + additional_cols.append('vehicle_type') + all_choices = all_choices.reset_index().merge( + vehicle_type_data[additional_cols], + how='left', on='vehicle_type').set_index('vehicle_id') + + return all_choices, all_choosers + + +@inject.step() +def vehicle_type_choice( + persons, + households, + vehicles, + vehicles_merged, + chunk_size, + trace_hh_id): + """Assign a vehicle type to each vehicle in the `vehicles` table. + + If a "SIMULATION_TYPE" is set to simple_simulate in the + vehicle_type_choice.yaml config file, then the model specification .csv file + should contain one column of coefficients for each distinct alternative. This + format corresponds to ActivitySim's :func:`activitysim.core.simulate.simple_simulate` + format. Otherwise, this model will construct a table of alternatives, at run time, + based on all possible combinations of values of the categorical variables enumerated + as "combinatorial_alts" in the .yaml config. In this case, the model leverages + ActivitySim's :func:`activitysim.core.interaction_simulate` model design, in which + the model specification .csv has only one column of coefficients, and the utility + expressions can turn coefficients on or off based on attributes of either + the chooser _or_ the alternative. + + As an optional second step, the user may also specify a "PROBS_SPEC" .csv file in + the main .yaml config, corresponding to a lookup table of additional vehicle + attributes and probabilities to be sampled and assigned to vehicles after the logit + choices have been made. The rows of the "PROBS_SPEC" file must include all body type + and vehicle age choices assigned in the logit model. These additional attributes are + concatenated with the selected alternative from the logit model to form a single + vehicle type name to be stored in the `vehicles` table as the vehicle_type column. + + Only one household vehicle is selected at a time to allow for the introduction of + owned vehicle related attributes. For example, a household may be less likely to + own a second van if they already own one. The model is run sequentially through + household vehicle numbers. The preprocessor is run for each iteration on the entire + vehicles table to allow for computation of terms involving the presence of other + household vehicles. + + The user may also augment the `households` or `persons` tables with new vehicle + type-based fields specified via expressions in "annotate_households_vehicle_type.csv" + and "annotate_persons_vehicle_type.csv", respectively. + + Parameters + ---------- + persons : orca.DataFrameWrapper + households : orca.DataFrameWrapper + vehicles : orca.DataFrameWrapper + vehicles_merged : orca.DataFrameWrapper + chunk_size : orca.injectable + trace_hh_id : orca.injectable + """ + trace_label = 'vehicle_type_choice' + model_settings_file_name = 'vehicle_type_choice.yaml' + model_settings = config.read_model_settings(model_settings_file_name) + + estimator = estimation.manager.begin_estimation('vehicle_type') + + model_spec_raw = simulate.read_model_spec(file_name=model_settings['SPEC']) + coefficients_df = simulate.read_model_coefficients(model_settings) + model_spec = simulate.eval_coefficients(model_spec_raw, coefficients_df, estimator) + + constants = config.get_model_constants(model_settings) + + locals_dict = {} + locals_dict.update(constants) + locals_dict.update(coefficients_df) + + choices, choosers = iterate_vehicle_type_choice( + vehicles_merged, + model_settings, + model_spec, + locals_dict, + estimator, + chunk_size, + trace_label) + + if estimator: + estimator.write_model_settings(model_settings, model_settings_file_name) + estimator.write_spec(model_settings) + estimator.write_coefficients(coefficients_df, model_settings) + estimator.write_choosers(choosers) + + # FIXME #interaction_simulate_estimation_requires_chooser_id_in_df_column + # shuold we do it here or have interaction_simulate do it? + # chooser index must be duplicated in column or it will be omitted from interaction_dataset + # estimation requires that chooser_id is either in index or a column of interaction_dataset + # so it can be reformatted (melted) and indexed by chooser_id and alt_id + assert choosers.index.name == 'vehicle_id' + assert 'vehicle_id' not in choosers.columns + choosers['vehicle_id'] = choosers.index + + # FIXME set_alt_id - do we need this for interaction_simulate estimation bundle tables? + estimator.set_alt_id('alt_id') + estimator.set_chooser_id(choosers.index.name) + + estimator.write_choices(choices) + choices = estimator.get_survey_values(choices, 'vehicles', 'vehicle_type_choice') + estimator.write_override_choices(choices) + estimator.end_estimation() + + # update vehicles table + # vehicles = pd.merge(vehicles.to_frame(), choices, left_index=True, right_index=True) + vehicles = pd.concat([vehicles.to_frame(), choices], axis=1) + pipeline.replace_table("vehicles", vehicles) + + # - annotate tables + if model_settings.get('annotate_households'): + annotate_vehicle_type_choice_households(model_settings, trace_label) + if model_settings.get('annotate_persons'): + annotate_vehicle_type_choice_persons(model_settings, trace_label) + if model_settings.get('annotate_vehicles'): + annotate_vehicle_type_choice_vehicles(model_settings, trace_label) + + tracing.print_summary('vehicle_type_choice', vehicles.vehicle_type, value_counts=True) + + if trace_hh_id: + tracing.trace_df(vehicles, + label='vehicle_type_choice', + warn_if_empty=True) diff --git a/activitysim/abm/tables/__init__.py b/activitysim/abm/tables/__init__.py index 24dd5a13d6..f22114928b 100644 --- a/activitysim/abm/tables/__init__.py +++ b/activitysim/abm/tables/__init__.py @@ -10,5 +10,5 @@ from . import trips from . import time_windows from . import shadow_pricing - from . import table_dict +from . import vehicles diff --git a/activitysim/abm/tables/vehicles.py b/activitysim/abm/tables/vehicles.py new file mode 100644 index 0000000000..e9369e298e --- /dev/null +++ b/activitysim/abm/tables/vehicles.py @@ -0,0 +1,64 @@ +# ActivitySim +# See full license in LICENSE.txt. +import logging + +from activitysim.core import inject, pipeline, tracing + +logger = logging.getLogger(__name__) + + +@inject.table() +def vehicles(households): + """ Creates the vehicles table and load it as an injectable + + This method initializes the `vehicles` table, where the number of rows + is equal to the sum of `households["auto_ownership"]`. + + Parameters + ---------- + households : orca.DataFrameWrapper + + Returns + ------- + vehicles : pandas.DataFrame + """ + + # initialize vehicles table + vehicles = households.to_frame().loc[ + households.index.repeat(households['auto_ownership'])] + vehicles = vehicles.reset_index()[['household_id']] + + vehicles['vehicle_num'] = vehicles.groupby('household_id').cumcount() + 1 + # tying the vehicle id to the household id in order to ensure reproducability + vehicles['vehicle_id'] = vehicles.household_id * 10 + vehicles.vehicle_num + vehicles.set_index('vehicle_id', inplace=True) + + # replace table function with dataframe + inject.add_table('vehicles', vehicles) + + pipeline.get_rn_generator().add_channel('vehicles', vehicles) + tracing.register_traceable_table('households', vehicles) + + return vehicles + + +@inject.table() +def vehicles_merged(vehicles, households_merged): + """ Augments the vehicles table with household attributes + + Parameters + ---------- + vehicles : orca.DataFrameWrapper + households_merged : orca.DataFrameWrapper + + Returns + ------- + vehicles_merged : pandas.DataFrame + """ + + vehicles_merged = inject.merge_tables( + vehicles.name, tables=[vehicles, households_merged]) + return vehicles_merged + + +inject.broadcast('households_merged', 'vehicles', cast_index=True, onto_on='household_id') diff --git a/activitysim/abm/test/test_misc/test_vehicle_type_alternatives.py b/activitysim/abm/test/test_misc/test_vehicle_type_alternatives.py new file mode 100644 index 0000000000..b77b1db9ff --- /dev/null +++ b/activitysim/abm/test/test_misc/test_vehicle_type_alternatives.py @@ -0,0 +1,35 @@ +import numpy as np +import pandas as pd +import pytest + +from activitysim.abm.models.vehicle_type_choice import get_combinatorial_vehicle_alternatives + + +def test_get_combinatorial_vehicle_alternatives(): + test_alts_cats_dict = { + 'body_type': ['Car', 'Van'], + 'age': [1, 2], + 'fuel_type': ['Gas', 'PEV'] + } + alts_wide, alts_long = get_combinatorial_vehicle_alternatives(test_alts_cats_dict) + + expected_wide = pd.DataFrame( + {'body_type_Car': {0: 1, 1: 1, 2: 1, 3: 1, 4: 0, 5: 0, 6: 0, 7: 0}, + 'body_type_Van': {0: 0, 1: 0, 2: 0, 3: 0, 4: 1, 5: 1, 6: 1, 7: 1}, + 'age_1': {0: 1, 1: 1, 2: 0, 3: 0, 4: 1, 5: 1, 6: 0, 7: 0}, + 'age_2': {0: 0, 1: 0, 2: 1, 3: 1, 4: 0, 5: 0, 6: 1, 7: 1}, + 'fuel_type_Gas': {0: 1, 1: 0, 2: 1, 3: 0, 4: 1, 5: 0, 6: 1, 7: 0}, + 'fuel_type_PEV': {0: 0, 1: 1, 2: 0, 3: 1, 4: 0, 5: 1, 6: 0, 7: 1}, + 'body_type': {0: 'Car', 1: 'Car', 2: 'Car', 3: 'Car', 4: 'Van', 5: 'Van', 6: 'Van', 7: 'Van'}, + 'age': {0: '1', 1: '1', 2: '2', 3: '2', 4: '1', 5: '1', 6: '2', 7: '2'}, + 'fuel_type': {0: 'Gas', 1: 'PEV', 2: 'Gas', 3: 'PEV', 4: 'Gas', 5: 'PEV', 6: 'Gas', 7: 'PEV'}} + ) + + expected_long = pd.DataFrame( + {'body_type': {0: 'Car', 1: 'Car', 2: 'Car', 3: 'Car', 4: 'Van', 5: 'Van', 6: 'Van', 7: 'Van'}, + 'age': {0: '1', 1: '1', 2: '2', 3: '2', 4: '1', 5: '1', 6: '2', 7: '2'}, + 'fuel_type': {0: 'Gas', 1: 'PEV', 2: 'Gas', 3: 'PEV', 4: 'Gas', 5: 'PEV', 6: 'Gas', 7: 'PEV'}} + ) + + pd.testing.assert_frame_equal(alts_wide, expected_wide, check_dtype=False) + pd.testing.assert_frame_equal(alts_long, expected_long, check_dtype=False) diff --git a/activitysim/core/interaction_simulate.py b/activitysim/core/interaction_simulate.py index 292c9ccaef..56ae540312 100644 --- a/activitysim/core/interaction_simulate.py +++ b/activitysim/core/interaction_simulate.py @@ -340,7 +340,6 @@ def _interaction_simulate( slicer='NONE', transpose=False) else: trace_rows = trace_ids = None - interaction_utilities, trace_eval_results \ = eval_interaction_utilities(spec, interaction_df, locals_d, trace_label, trace_rows, estimator=estimator, diff --git a/activitysim/examples/example_estimation/configs/estimation.yaml b/activitysim/examples/example_estimation/configs/estimation.yaml index 90bd53be5e..7e8112c0f0 100644 --- a/activitysim/examples/example_estimation/configs/estimation.yaml +++ b/activitysim/examples/example_estimation/configs/estimation.yaml @@ -5,6 +5,7 @@ bundles: - school_location - workplace_location - auto_ownership + - vehicle_type_choice - free_parking - cdap - mandatory_tour_frequency @@ -100,6 +101,7 @@ model_estimation_table_types: school_location: interaction_sample_simulate workplace_location: interaction_sample_simulate auto_ownership: simple_simulate + vehicle_type_choice: interaction_simulate free_parking: simple_simulate cdap: cdap_simulate mandatory_tour_frequency: simple_simulate diff --git a/activitysim/examples/example_estimation/configs/settings.yaml b/activitysim/examples/example_estimation/configs/settings.yaml index dbabd589c5..9e9dd4eefe 100644 --- a/activitysim/examples/example_estimation/configs/settings.yaml +++ b/activitysim/examples/example_estimation/configs/settings.yaml @@ -135,4 +135,3 @@ models: # - track_skim_usage # - write_trip_matrices - write_tables - diff --git a/activitysim/examples/example_manifest.yaml b/activitysim/examples/example_manifest.yaml index cd2f8ea446..7ea94cd49d 100644 --- a/activitysim/examples/example_manifest.yaml +++ b/activitysim/examples/example_manifest.yaml @@ -46,6 +46,44 @@ data/land_use.csv fac71207925a34c32b956632fe375814e42860624a99f88401c42317af0fc203 +- name: example_mtc_extended + description: 25-zone example for the MTC region with extended models + # activitysim create -e example_mtc_extended -d test_example_mtc_extended + # cd test_example_mtc_extended + # activitysim run -c configs_extended/configs -c configs -o output -d data + # cd .. + include: + - example_mtc/data + - example_mtc_extended/configs + configs_extended + - example_mtc/configs + - example_mtc_extended/configs_mp + - example_mtc_extended/output + - example_mtc_extended/README.MD + +- name: example_mtc_full_extended + description: Full 1475-zone dataset for the MTC region with 2.8M households and 7.5M persons with extended models + # activitysim create -e example_mtc_full_extended -d test_example_mtc_full_extended + # cd test_example_mtc_full_extended + # activitysim run -c configs_mp -c configs_extended/configs -c configs -o output -d data + # cd .. + include: + - example_mtc/data + - example_mtc/configs + - example_mtc_extended/configs + configs_extended + - example_mtc_extended/configs_mp + - example_mtc_extended/output + - example_mtc_extended/README.MD + - https://media.githubusercontent.com/media/activitysim/activitysim_resources/master/mtc_data_full/skims.omx + data/skims.omx + - https://media.githubusercontent.com/media/activitysim/activitysim_resources/master/mtc_data_full/households.csv + data/households.csv + - https://media.githubusercontent.com/media/activitysim/activitysim_resources/master/mtc_data_full/persons.csv + data/persons.csv + - https://media.githubusercontent.com/media/activitysim/activitysim_resources/master/mtc_data_full/land_use.csv + data/land_use.csv + - name: example_mtc_sf description: San Francisco MTC dataset with 190 zones, 400k households and 900k persons # activitysim create -e example_mtc_sf -d test_example_mtc_sf diff --git a/activitysim/examples/example_mtc/configs/annotate_households.csv b/activitysim/examples/example_mtc/configs/annotate_households.csv index b23f4f252f..ac29e74726 100644 --- a/activitysim/examples/example_mtc/configs/annotate_households.csv +++ b/activitysim/examples/example_mtc/configs/annotate_households.csv @@ -1,5 +1,5 @@ Description,Target,Expression -#,, annotate households table after import +#,,annotate households table after import ,_PERSON_COUNT,"lambda query, persons, households: persons.query(query).groupby('household_id').size().reindex(households.index).fillna(0).astype(np.int8)" #,,FIXME households.income can be negative - so we clip? income_in_thousands,income_in_thousands,(households.income / 1000).clip(lower=0) diff --git a/activitysim/examples/example_mtc/configs/write_data_dictionary.yaml b/activitysim/examples/example_mtc/configs/write_data_dictionary.yaml index 6d6ed3920c..0d68c8f830 100644 --- a/activitysim/examples/example_mtc/configs/write_data_dictionary.yaml +++ b/activitysim/examples/example_mtc/configs/write_data_dictionary.yaml @@ -11,3 +11,4 @@ tables: - tours - trips - joint_tour_participants + - vehicles diff --git a/activitysim/examples/example_mtc_extended/README.MD b/activitysim/examples/example_mtc_extended/README.MD new file mode 100644 index 0000000000..826cd33804 --- /dev/null +++ b/activitysim/examples/example_mtc_extended/README.MD @@ -0,0 +1,6 @@ + +### MTC Extended Example + +The MTC example with the following additional models: +* vehicle type model +* vehicle allocation model diff --git a/activitysim/examples/example_mtc_extended/configs/annotate_tours_tour_mode_choice.csv b/activitysim/examples/example_mtc_extended/configs/annotate_tours_tour_mode_choice.csv new file mode 100644 index 0000000000..457db87613 --- /dev/null +++ b/activitysim/examples/example_mtc_extended/configs/annotate_tours_tour_mode_choice.csv @@ -0,0 +1,9 @@ +Description,Target,Expression +non-motorized and walk tran and tnc set to null,selected_vehicle,np.nan +tours using sov option,selected_vehicle,"np.where(df.tour_mode.isin(['DRIVEALONEFREE','DRIVEALONEPAY','DRIVE_LOC','DRIVE_LRF','DRIVE_EXP','DRIVE_HVY','DRIVE_COM']), df.vehicle_occup_1, selected_vehicle)" +tours using sr2 option,selected_vehicle,"np.where(df.tour_mode.isin(['SHARED2FREE','SHARED2PAY']), df.vehicle_occup_2, selected_vehicle)" +tours using sr3 option,selected_vehicle,"np.where(df.tour_mode.isin(['SHARED3FREE','SHARED3PAY']), df['vehicle_occup_3.5'], selected_vehicle)" +parent tour vehicle,_parent_selected_vehicle,"reindex(df.selected_vehicle, df.parent_tour_id) if 'selected_vehicle' in df.columns else np.nan" +assign parent tour vehicle to atwork subtours,selected_vehicle,"np.where(df.tour_category == 'atwork', _parent_selected_vehicle, selected_vehicle)" +is non-driving tour,_is_non_driving_tour,"df.tour_mode.isin(['WALK','BIKE','WALK_LOC','WALK_LRF','WALK_EXP','WALK_HVY','WALK_COM','TAXI','TNC_SINGLE','TNC_SHARED'])" +atwork subtours whose parent tour did not use a vehicle use non_hh_veh,selected_vehicle,"np.where(~_is_non_driving_tour & (df.tour_category == 'atwork') & pd.isna(selected_vehicle),'non_hh_veh', selected_vehicle)" diff --git a/activitysim/examples/example_mtc_extended/configs/settings.yaml b/activitysim/examples/example_mtc_extended/configs/settings.yaml new file mode 100644 index 0000000000..b1faa5c258 --- /dev/null +++ b/activitysim/examples/example_mtc_extended/configs/settings.yaml @@ -0,0 +1,248 @@ +# input tables +# +# activitysim uses "well-known" index and foreign key names for imported tables (e.g. households, persons, land_use) +# as well as for created tables (tours, joint_tour_participants, trips) +# e.g. the households table must have an index column 'household_id' and the foreign key to households in the +# persons table is also household_id. This naming convention allows activitysim to intuit the relationship +# between tables - for instance, to ensure that multiprocess slicing includes all the persons, tours, and trips +# in the same subprocess pipeline. The same strategy is also when chunking choosers, and to support tracing by +# household_id. +# +# the input_table_list index_col directive instructs activitysim to set the imported table index to zone_id +# you cannot change the well-known name of the index by modifying this directive. However, if your input file +# has a different id column name, you can rename it to the required index name with the rename_columns directive. +# In the settings below, the 'TAZ' column in the imported table is renamed 'zone_id' in the rename_columns settings. +# +input_table_list: + # + # households (table index 'household_id') + # + - tablename: households + filename: households.csv + index_col: household_id + rename_columns: + HHID: household_id # household_id is the required index column + PERSONS: hhsize + workers: num_workers + VEHICL: auto_ownership + TAZ: home_zone_id + keep_columns: + - home_zone_id + - income + - hhsize + - HHT + - auto_ownership + - num_workers + # + # persons (table index 'person_id') + # + - tablename: persons + filename: persons.csv + index_col: person_id + rename_columns: + PERID: person_id # person_id is the required index column + keep_columns: + - household_id + - age + - PNUM + - sex + - pemploy + - pstudent + - ptype + # + # land_use (table index 'zone_id') + # + - tablename: land_use + filename: land_use.csv + index_col: zone_id + rename_columns: + TAZ: zone_id # person_id is the required index column + COUNTY: county_id + keep_columns: + - DISTRICT + - SD + - county_id + - TOTHH + - TOTPOP + - TOTACRE + - RESACRE + - CIACRE + - TOTEMP + - AGE0519 + - RETEMPN + - FPSEMPN + - HEREMPN + - OTHEMPN + - AGREMPN + - MWTEMPN + - PRKCST + - OPRKCST + - area_type + - HSENROLL + - COLLFTE + - COLLPTE + - TOPOLOGY + - TERMINAL + +# convert input CSVs to HDF5 format and save to outputs directory +# create_input_store: True + +#input_store: ../output/input_data.h5 + +# number of households to simulate +households_sample_size: 100 +# simulate all households +# households_sample_size: 0 + +# set false to disable variability check in simple_simulate and interaction_simulate +check_for_variability: False + +# - shadow pricing global switches + +# turn shadow_pricing on and off for all models (e.g. school and work) +# shadow pricing is deprecated for less than full samples +# see shadow_pricing.yaml for additional settings +use_shadow_pricing: False + +# turn writing of sample_tables on and off for all models +# (if True, tables will be written if DEST_CHOICE_SAMPLE_TABLE_NAME is specified in individual model settings) +want_dest_choice_sample_tables: False + +# log interaction simulate/sample expressions that return prohibitive utility values that exclude all alternatives +log_alt_losers: False + +# alternate dir to read/write cache (defaults to output_dir) +# used for skim cache, tvpb, and chunk_log caches +#cache_dir: data/cache + +############## +# +# chunking +# + +# chooser chunk size in gigabytes +# target top memory usage during activitysim run (including shared memory, loaded tables, and transient memory usage) +#chunk_size: 12_000_000_000 +chunk_size: 0 + +# minimum fraction of total chunk_size to reserve for adaptive chunking +min_available_chunk_ratio: 0.05 + +# initial number of chooser rows for first chunk in training mode +# when there is no pre-existing chunk_cache to set initial value +# ordinarily bigger is better as long as it is not so big it causes memory issues (e.g. accessibility with lots of zones) +default_initial_rows_per_chunk: 500 + +# method to calculate memory overhead when chunking is enabled +chunk_method: hybrid_uss + +# chunk training mode +# training to determine the chunking settings written to a cache file that is re-used for production runs +# training +# production +# disabled +# assume enough RAM to not chunk +chunk_training_mode: disabled + +# whether to preserve or delete subprocess chunk and mem logs when they are consolidated at end of multiprocess run +keep_chunk_logs: True +keep_mem_logs: True + +############## + +# - tracing + +# trace household id; comment out or leave empty for no trace +# households with all tour types +# [ 728370 1234067 1402924 1594625 1595333 1747572 1896849 1931818 2222690 2344951 2677154] +trace_hh_id: 982875 + +# trace origin, destination in accessibility calculation; comment out or leave empty for no trace +# trace_od: [5, 11] +trace_od: + + + +# to resume after last successful checkpoint, specify resume_after: _ +#resume_after: trip_destination +resume_after: + +checkpoints: True +# if checkpoints is False, no intermediate checkpoints will be written before the end of run +# (or if multiprocessing, at the end of each multiprocess_step) +#checkpoints: False +# explicit list of models to checkpoint +#checkpoints: +# - mandatory_tour_scheduling +# - non_mandatory_tour_scheduling +# - trip_mode_choice + + +models: + - initialize_landuse + - initialize_households + - compute_accessibility + - school_location + - workplace_location + - auto_ownership_simulate + - vehicle_type_choice + - free_parking + - cdap_simulate + - mandatory_tour_frequency + - mandatory_tour_scheduling + - joint_tour_frequency + - joint_tour_composition + - joint_tour_participation + - joint_tour_destination + - joint_tour_scheduling + - non_mandatory_tour_frequency + - non_mandatory_tour_destination + - non_mandatory_tour_scheduling + - vehicle_allocation + - tour_mode_choice_simulate + - atwork_subtour_frequency + - atwork_subtour_destination + - atwork_subtour_scheduling + - atwork_subtour_mode_choice + - stop_frequency + - trip_purpose + - trip_destination + - trip_purpose_and_destination + - trip_scheduling + - trip_mode_choice + - write_data_dictionary + - track_skim_usage + - write_trip_matrices + - write_tables + +output_tables: + h5_store: False + action: include + prefix: final_ + tables: + - checkpoints + - accessibility + - land_use + - households + - persons + - tours + - trips + - joint_tour_participants + - vehicles + +# area_types less than this are considered urban +urban_threshold: 4 +cbd_threshold: 2 +rural_threshold: 6 + +# - value of time +min_value_of_time: 1 +max_value_of_time: 50 +distributed_vot_mu: 0.684 +distributed_vot_sigma: 0.85 + +household_median_value_of_time: + 1: 6.01 + 2: 8.81 + 3: 10.44 + 4: 12.86 diff --git a/activitysim/examples/example_mtc_extended/configs/tour_mode_choice.csv b/activitysim/examples/example_mtc_extended/configs/tour_mode_choice.csv new file mode 100644 index 0000000000..2ba4c6d0df --- /dev/null +++ b/activitysim/examples/example_mtc_extended/configs/tour_mode_choice.csv @@ -0,0 +1,344 @@ +Label,Description,Expression,DRIVEALONEFREE,DRIVEALONEPAY,SHARED2FREE,SHARED2PAY,SHARED3FREE,SHARED3PAY,WALK,BIKE,WALK_LOC,WALK_LRF,WALK_EXP,WALK_HVY,WALK_COM,DRIVE_LOC,DRIVE_LRF,DRIVE_EXP,DRIVE_HVY,DRIVE_COM,TAXI,TNC_SINGLE,TNC_SHARED +#,Drive alone no toll,,,,,,,,,,,,,,,,,,,,,, +util_DRIVEALONEFREE_Unavailable,DRIVEALONEFREE - Unavailable,sov_available == False,-999,,,,,,,,,,,,,,,,,,,, +util_DRIVEALONEFREE_Unavailable_for_zero_auto_households,DRIVEALONEFREE - Unavailable for zero auto households,auto_ownership == 0,-999,,,,,,,,,,,,,,,,,,,, +util_DRIVEALONEFREE_Unavailable_for_persons_less_than_16,DRIVEALONEFREE - Unavailable for persons less than 16,age < 16,-999,,,,,,,,,,,,,,,,,,,, +util_DRIVEALONEFREE_Unavailable_for_joint_tours,DRIVEALONEFREE - Unavailable for joint tours,is_joint == True,-999,,,,,,,,,,,,,,,,,,,, +util_DRIVEALONEFREE_Unavailable_if_didn't_drive_to_work,DRIVEALONEFREE - Unavailable if didn't drive to work,is_atwork_subtour & ~work_tour_is_SOV,-999,,,,,,,,,,,,,,,,,,,, +util_DRIVEALONEFREE_In_vehicle_time,DRIVEALONEFREE - In-vehicle time,@odt_skims['SOV_TIME'] + dot_skims['SOV_TIME'],coef_ivt,,,,,,,,,,,,,,,,,,,, +util_DRIVEALONEFREE_Terminal_time,DRIVEALONEFREE - Terminal time,@2 * walktimeshort_multiplier * df.terminal_time,coef_ivt,,,,,,,,,,,,,,,,,,,, +util_DRIVEALONEFREE_Operating_cost,DRIVEALONEFREE - Operating cost,@ivt_cost_multiplier * df.ivot * df.sov_auto_op_cost * (odt_skims['SOV_DIST'] + dot_skims['SOV_DIST']),coef_ivt,,,,,,,,,,,,,,,,,,,, +util_DRIVEALONEFREE_Parking_cost,DRIVEALONEFREE - Parking cost,@ivt_cost_multiplier * df.ivot * df.daily_parking_cost,coef_ivt,,,,,,,,,,,,,,,,,,,, +util_DRIVEALONEFREE_Bridge_toll,DRIVEALONEFREE - Bridge toll,@ivt_cost_multiplier * df.ivot * (odt_skims['SOV_BTOLL'] + dot_skims['SOV_BTOLL']),coef_ivt,,,,,,,,,,,,,,,,,,,, +util_DRIVEALONEFREE_Person_is_between_16_and_19_years_old,DRIVEALONEFREE - Person is between 16 and 19 years old,@(df.age >= 16) & (df.age <= 19),coef_age1619_da_multiplier,,,,,,,,,,,,,,,,,,,, +#,Drive alone toll,,,,,,,,,,,,,,,,,,,,,, +util_DRIVEALONEPAY_Unavailable,DRIVEALONEPAY - Unavailable,sovtoll_available == False,,-999,,,,,,,,,,,,,,,,,,, +util_DRIVEALONEPAY_Unavailable_for_zero_auto_households,DRIVEALONEPAY - Unavailable for zero auto households,auto_ownership == 0,,-999,,,,,,,,,,,,,,,,,,, +util_DRIVEALONEPAY_Unavailable_for_persons_less_than_16,DRIVEALONEPAY - Unavailable for persons less than 16,age < 16,,-999,,,,,,,,,,,,,,,,,,, +util_DRIVEALONEPAY_Unavailable_for_joint_tours,DRIVEALONEPAY - Unavailable for joint tours,is_joint == True,,-999,,,,,,,,,,,,,,,,,,, +util_DRIVEALONEPAY_Unavailable_if_didn't_drive_to_work,DRIVEALONEPAY - Unavailable if didn't drive to work,is_atwork_subtour & ~work_tour_is_SOV,,-999,,,,,,,,,,,,,,,,,,, +util_DRIVEALONEPAY_In_vehicle_time,DRIVEALONEPAY - In-vehicle time,@odt_skims['SOVTOLL_TIME'] + dot_skims['SOVTOLL_TIME'],,coef_ivt,,,,,,,,,,,,,,,,,,, +util_DRIVEALONEPAY_Terminal_time,DRIVEALONEPAY - Terminal time,@2 * walktimeshort_multiplier * df.terminal_time,,coef_ivt,,,,,,,,,,,,,,,,,,, +util_DRIVEALONEPAY_Operating_cost,DRIVEALONEPAY - Operating cost,@ivt_cost_multiplier * df.ivot * df.sov_auto_op_cost * (odt_skims['SOVTOLL_DIST'] + dot_skims['SOVTOLL_DIST']),,coef_ivt,,,,,,,,,,,,,,,,,,, +util_DRIVEALONEPAY_Parking_cost,DRIVEALONEPAY - Parking cost,@ivt_cost_multiplier * df.ivot * df.daily_parking_cost,,coef_ivt,,,,,,,,,,,,,,,,,,, +util_DRIVEALONEPAY_Bridge_toll,DRIVEALONEPAY - Bridge toll,@ivt_cost_multiplier * df.ivot * (odt_skims['SOVTOLL_BTOLL'] + dot_skims['SOVTOLL_BTOLL']),,coef_ivt,,,,,,,,,,,,,,,,,,, +util_DRIVEALONEPAY_Value_toll,DRIVEALONEPAY - Value toll,@ivt_cost_multiplier * df.ivot * (odt_skims['SOVTOLL_VTOLL'] + dot_skims['SOVTOLL_VTOLL']),,coef_ivt,,,,,,,,,,,,,,,,,,, +util_DRIVEALONEPAY_Person_is_between_16_and_19_years_old,DRIVEALONEPAY - Person is between 16 and 19 years old,@(df.age >= 16) & (df.age <= 19),,coef_age1619_da_multiplier,,,,,,,,,,,,,,,,,,, +#,Shared ride 2,,,,,,,,,,,,,,,,,,,,,, +util_SHARED2FREE_Unavailable,SHARED2FREE - Unavailable,hov2_available == False,,,-999,,,,,,,,,,,,,,,,,, +util_SHARED2FREE_Unavailable_based_on_party_size,SHARED2FREE - Unavailable based on party size,is_joint & (number_of_participants > 2),,,-999,,,,,,,,,,,,,,,,,, +util_SHARED2FREE_In_vehicle_time,SHARED2FREE - In-vehicle time,@(odt_skims['HOV2_TIME'] + dot_skims['HOV2_TIME']),,,coef_ivt,,,,,,,,,,,,,,,,,, +util_SHARED2FREE_Terminal_time,SHARED2FREE - Terminal time,@2 * walktimeshort_multiplier * df.terminal_time,,,coef_ivt,,,,,,,,,,,,,,,,,, +util_SHARED2FREE_Operating_cost,SHARED2FREE - Operating cost,@ivt_cost_multiplier * df.ivot * df.sr2_auto_op_cost * (odt_skims['HOV2_DIST'] + dot_skims['HOV2_DIST']),,,coef_ivt,,,,,,,,,,,,,,,,,, +util_SHARED2FREE_Parking_cost,SHARED2FREE - Parking cost,@ivt_cost_multiplier * df.ivot * df.daily_parking_cost / costShareSr2,,,coef_ivt,,,,,,,,,,,,,,,,,, +util_SHARED2FREE_Bridge_toll,SHARED2FREE - Bridge toll,@ivt_cost_multiplier * df.ivot * (odt_skims['HOV2_BTOLL'] + dot_skims['HOV2_BTOLL']) / costShareSr2,,,coef_ivt,,,,,,,,,,,,,,,,,, +util_SHARED2FREE_One_person_household,SHARED2FREE - One person household,@(df.hhsize == 1),,,coef_hhsize1_sr_multiplier,,,,,,,,,,,,,,,,,, +util_SHARED2FREE_Two_person_household,SHARED2FREE - Two person household,@(df.hhsize == 2),,,coef_hhsize2_sr_multiplier,,,,,,,,,,,,,,,,,, +util_SHARED2FREE_Person_is_16_years_old_or_older,SHARED2FREE - Person is 16 years old or older,@(df.age >= 16),,,coef_age16p_sr_multiplier,,,,,,,,,,,,,,,,,, +#,Shared ride 2 toll,,,,,,,,,,,,,,,,,,,,,, +util_SHARED2PAY_Unavailable,SHARED2PAY - Unavailable,hov2toll_available == False,,,,-999,,,,,,,,,,,,,,,,, +util_SHARED2PAY_Unavailable_based_on_party_size,SHARED2PAY - Unavailable based on party size,is_joint & (number_of_participants > 2),,,,-999,,,,,,,,,,,,,,,,, +util_SHARED2PAY_In_vehicle_time,SHARED2PAY - In-vehicle time,@(odt_skims['HOV2TOLL_TIME'] + dot_skims['HOV2TOLL_TIME']),,,,coef_ivt,,,,,,,,,,,,,,,,, +util_SHARED2PAY_Terminal_time,SHARED2PAY - Terminal time,@2 * walktimeshort_multiplier * df.terminal_time,,,,coef_ivt,,,,,,,,,,,,,,,,, +util_SHARED2PAY_Operating_cost,SHARED2PAY - Operating cost,@ivt_cost_multiplier * df.ivot * df.sr2_auto_op_cost * (odt_skims['HOV2TOLL_DIST'] + dot_skims['HOV2TOLL_DIST']),,,,coef_ivt,,,,,,,,,,,,,,,,, +util_SHARED2PAY_Parking_cost,SHARED2PAY - Parking cost,@ivt_cost_multiplier * df.ivot * df.daily_parking_cost / costShareSr2,,,,coef_ivt,,,,,,,,,,,,,,,,, +util_SHARED2PAY_Bridge_toll,SHARED2PAY - Bridge toll,@ivt_cost_multiplier * df.ivot * (odt_skims['HOV2TOLL_BTOLL'] + dot_skims['HOV2TOLL_BTOLL']) / costShareSr2,,,,coef_ivt,,,,,,,,,,,,,,,,, +util_SHARED2PAY_Value_toll,SHARED2PAY - Value toll,@ivt_cost_multiplier * df.ivot * (odt_skims['HOV2TOLL_VTOLL'] + dot_skims['HOV2TOLL_VTOLL']) / costShareSr2,,,,coef_ivt,,,,,,,,,,,,,,,,, +util_SHARED2PAY_One_person_household,SHARED2PAY - One person household,@(df.hhsize == 1),,,,coef_hhsize1_sr_multiplier,,,,,,,,,,,,,,,,, +util_SHARED2PAY_Two_person_household,SHARED2PAY - Two person household,@(df.hhsize == 2),,,,coef_hhsize2_sr_multiplier,,,,,,,,,,,,,,,,, +util_SHARED2PAY_Person_is_16_years_old_or_older,SHARED2PAY - Person is 16 years old or older,@(df.age >= 16),,,,coef_age16p_sr_multiplier,,,,,,,,,,,,,,,,, +#,Shared ride 3+,,,,,,,,,,,,,,,,,,,,,, +util_SHARED3FREE_Unavailable,SHARED3FREE - Unavailable,hov3_available == False,,,,,-999,,,,,,,,,,,,,,,, +util_SHARED3FREE_In_vehicle_time,SHARED3FREE - In-vehicle time,@(odt_skims['HOV3_TIME'] + dot_skims['HOV3_TIME']),,,,,coef_ivt,,,,,,,,,,,,,,,, +util_SHARED3FREE_Terminal_time,SHARED3FREE - Terminal time,@2 * walktimeshort_multiplier * df.terminal_time,,,,,coef_ivt,,,,,,,,,,,,,,,, +util_SHARED3FREE_Operating_cost,SHARED3FREE - Operating cost,@ivt_cost_multiplier * df.ivot * df.sr3p_auto_op_cost * (odt_skims['HOV3_DIST'] + dot_skims['HOV3_DIST']),,,,,coef_ivt,,,,,,,,,,,,,,,, +util_SHARED3FREE_Parking_cost,SHARED3FREE - Parking cost,@ivt_cost_multiplier * df.ivot * df.daily_parking_cost / costShareSr3,,,,,coef_ivt,,,,,,,,,,,,,,,, +util_SHARED3FREE_Bridge_toll,SHARED3FREE - Bridge toll,@ivt_cost_multiplier * df.ivot * (odt_skims['HOV3_BTOLL'] + dot_skims['HOV3_BTOLL']) / costShareSr3,,,,,coef_ivt,,,,,,,,,,,,,,,, +util_SHARED3FREE_One_person_household,SHARED3FREE - One person household,@(df.hhsize == 1),,,,,coef_hhsize1_sr_multiplier,,,,,,,,,,,,,,,, +util_SHARED3FREE_Two_person_household,SHARED3FREE - Two person household,@(df.hhsize == 2),,,,,coef_hhsize2_sr_multiplier,,,,,,,,,,,,,,,, +util_SHARED3FREE_Person_is_16_years_old_or_older,SHARED3FREE - Person is 16 years old or older,@(df.age >= 16),,,,,coef_age16p_sr_multiplier,,,,,,,,,,,,,,,, +#,Shared ride 3+ toll,,,,,,,,,,,,,,,,,,,,,, +util_SHARED3PAY_Unavailable,SHARED3PAY - Unavailable,hov3toll_available == False,,,,,,-999,,,,,,,,,,,,,,, +util_SHARED3PAY_In_vehicle_time,SHARED3PAY - In-vehicle time,@(odt_skims['HOV3TOLL_TIME'] + dot_skims['HOV3TOLL_TIME']),,,,,,coef_ivt,,,,,,,,,,,,,,, +util_SHARED3PAY_Terminal_time,SHARED3PAY - Terminal time,@2 * walktimeshort_multiplier * df.terminal_time,,,,,,coef_ivt,,,,,,,,,,,,,,, +util_SHARED3PAY_Operating_cost,SHARED3PAY - Operating cost,@ivt_cost_multiplier * df.ivot * df.sr3p_auto_op_cost * (odt_skims['HOV3TOLL_DIST'] + dot_skims['HOV3TOLL_DIST']),,,,,,coef_ivt,,,,,,,,,,,,,,, +util_SHARED3PAY_Parking_cost,SHARED3PAY - Parking cost,@ivt_cost_multiplier * df.ivot * df.daily_parking_cost / costShareSr3,,,,,,coef_ivt,,,,,,,,,,,,,,, +util_SHARED3PAY_Bridge_toll,SHARED3PAY - Bridge toll,@ivt_cost_multiplier * df.ivot * (odt_skims['HOV3TOLL_BTOLL'] + dot_skims['HOV3TOLL_BTOLL']) / costShareSr3,,,,,,coef_ivt,,,,,,,,,,,,,,, +util_SHARED3PAY_Value_toll,SHARED3PAY - Value toll,@ivt_cost_multiplier * df.ivot * (odt_skims['HOV3TOLL_VTOLL'] + dot_skims['HOV3TOLL_VTOLL']) / costShareSr3,,,,,,coef_ivt,,,,,,,,,,,,,,, +util_SHARED3PAY_One_person_household,SHARED3PAY - One person household,@(df.hhsize == 1),,,,,,coef_hhsize1_sr_multiplier,,,,,,,,,,,,,,, +util_SHARED3PAY_Two_person_household,SHARED3PAY - Two person household,@(df.hhsize == 2),,,,,,coef_hhsize2_sr_multiplier,,,,,,,,,,,,,,, +util_SHARED3PAY_Person_is_16_years_old_or_older,SHARED3PAY - Person is 16 years old or older,@(df.age >= 16),,,,,,coef_age16p_sr_multiplier,,,,,,,,,,,,,,, +#,Walk,,,,,,,,,,,,,,,,,,,,,, +#,FIXME - skims aren't symmetrical,so we have to make sure they can get back,,,,,,,,,,,,,,,,,,,,, +util_WALK_Time_up_to_2_miles,WALK - Time up to 2 miles,@walktimeshort_multiplier * (od_skims['DISTWALK'].clip(upper=walkThresh) + od_skims.reverse('DISTWALK').clip(upper=walkThresh))*60/walkSpeed,,,,,,,coef_ivt,,,,,,,,,,,,,, +util_WALK_Time_beyond_2_of_a_miles,WALK - Time beyond 2 of a miles,@walktimelong_multiplier * ((od_skims['DISTWALK'] - walkThresh).clip(lower=0) + (od_skims.reverse('DISTWALK') - walkThresh).clip(lower=0))*60/walkSpeed,,,,,,,coef_ivt,,,,,,,,,,,,,, +util_WALK_Destination_zone_densityIndex,WALK - Destination zone densityIndex,@density_index_multiplier * df.density_index,,,,,,,coef_ivt,,,,,,,,,,,,,, +util_WALK_Topology,WALK - Topology,@coef_topology_walk_multiplier * df.dest_topology,,,,,,,coef_ivt,,,,,,,,,,,,,, +#,Bike,,,,,,,,,,,,,,,,,,,,,, +#,FIXME - skims aren't symmetrical,so we have to make sure they can get back,,,,,,,,,,,,,,,,,,,,, +util_BIKE_Unavailable_if_didn't_bike_to_work,BIKE - Unavailable if didn't bike to work,is_atwork_subtour & ~work_tour_is_bike,,,,,,,,-999,,,,,,,,,,,,, +util_BIKE_Time_up_to_6_miles,BIKE - Time up to 6 miles,@biketimeshort_multiplier * (od_skims['DISTBIKE'].clip(upper=bikeThresh) + od_skims.reverse('DISTBIKE').clip(upper=bikeThresh))*60/bikeSpeed,,,,,,,,coef_ivt,,,,,,,,,,,,, +util_BIKE_Time_beyond_6_of_a_miles,BIKE - Time beyond 6 of a miles,@biketimelong_multiplier * ((od_skims['DISTBIKE']-bikeThresh).clip(lower=0) + (od_skims.reverse('DISTBIKE')-bikeThresh).clip(lower=0))*60/bikeSpeed,,,,,,,,coef_ivt,,,,,,,,,,,,, +util_BIKE_Destination_zone_densityIndex,BIKE - Destination zone densityIndex,@density_index_multiplier * df.density_index,,,,,,,,coef_ivt,,,,,,,,,,,,, +util_BIKE_Topology,BIKE - Topology,@coef_topology_bike_multiplier * df.dest_topology,,,,,,,,coef_ivt,,,,,,,,,,,,, +#,Walk to Local,,,,,,,,,,,,,,,,,,,,,, +util_WALK_LOC_Unavailable,WALK_LOC - Unavailable,walk_local_available == False,,,,,,,,,-999,,,,,,,,,,,, +util_WALK_LOC_In_vehicle_time,WALK_LOC - In-vehicle time,@(odt_skims['WLK_LOC_WLK_TOTIVT']/100 + dot_skims['WLK_LOC_WLK_TOTIVT']/100),,,,,,,,,coef_ivt,,,,,,,,,,,, +util_WALK_LOC_Short_iwait_time,WALK_LOC - Short iwait time,@short_i_wait_multiplier * ((odt_skims['WLK_LOC_WLK_IWAIT']/100).clip(upper=waitThresh) + (dot_skims['WLK_LOC_WLK_IWAIT']/100).clip(upper=waitThresh)),,,,,,,,,coef_ivt,,,,,,,,,,,, +util_WALK_LOC_Long_iwait_time,WALK_LOC - Long iwait time,@long_i_wait_multiplier * ((odt_skims['WLK_LOC_WLK_IWAIT']/100-waitThresh).clip(0) + (dot_skims['WLK_LOC_WLK_IWAIT']/100-waitThresh).clip(0)),,,,,,,,,coef_ivt,,,,,,,,,,,, +util_WALK_LOC_transfer_wait_time,WALK_LOC - transfer wait time,@xwait_multiplier * (odt_skims['WLK_LOC_WLK_XWAIT']/100 + dot_skims['WLK_LOC_WLK_XWAIT']/100),,,,,,,,,coef_ivt,,,,,,,,,,,, +util_WALK_LOC_number_of_transfers,WALK_LOC - number of transfers,@xfers_wlk_multiplier * ((odt_skims['WLK_LOC_WLK_BOARDS']-1).clip(0) + (dot_skims['WLK_LOC_WLK_BOARDS']-1).clip(0)),,,,,,,,,coef_ivt,,,,,,,,,,,, +util_WALK_LOC_Walk_access_time,WALK_LOC - Walk access time,@2 * wacc_multiplier * df.origin_walk_time,,,,,,,,,coef_ivt,,,,,,,,,,,, +util_WALK_LOC_Walk_egress_time,WALK_LOC - Walk egress time,@2 * wegr_multiplier * df.destination_walk_time,,,,,,,,,coef_ivt,,,,,,,,,,,, +util_WALK_LOC_Walk_other_time,WALK_LOC - Walk other time,@waux_multiplier * (odt_skims['WLK_LOC_WLK_WAUX']/100 + dot_skims['WLK_LOC_WLK_WAUX']/100),,,,,,,,,coef_ivt,,,,,,,,,,,, +util_WALK_LOC_Fare,WALK_LOC - Fare,@ivt_cost_multiplier * df.ivot * (odt_skims['WLK_LOC_WLK_FAR'] + dot_skims['WLK_LOC_WLK_FAR']),,,,,,,,,coef_ivt,,,,,,,,,,,, +util_WALK_LOC_Destination_zone_densityIndex,WALK_LOC - Destination zone densityIndex,@density_index_multiplier * df.dest_density_index,,,,,,,,,coef_ivt,,,,,,,,,,,, +util_WALK_LOC_Topology,WALK_LOC - Topology,@coef_topology_trn_multiplier * df.dest_topology,,,,,,,,,coef_ivt,,,,,,,,,,,, +util_WALK_LOC_Person_is_less_than_10_years_old,WALK_LOC - Person is less than 10 years old,@(df.age <= 10),,,,,,,,,coef_age010_trn_multiplier,,,,,,,,,,,, +#,Walk to Light rail/Ferry,,,,,,,,,,,,,,,,,,,,,, +util_WALK_LRF_Unavailable,WALK_LRF - Unavailable,walk_lrf_available == False,,,,,,,,,,-999,,,,,,,,,,, +util_WALK_LRF_In_vehicle_time,WALK_LRF - In-vehicle time,@(odt_skims['WLK_LRF_WLK_TOTIVT']/100 + dot_skims['WLK_LRF_WLK_TOTIVT']/100),,,,,,,,,,coef_ivt,,,,,,,,,,, +#, FIXME coefficients below are wrong or needlessly complex? could be re-expressed to avoid subtract?,,,,,,,,,,,,,,,,,,,,,, +util_WALK_LRF_In_vehicle_time_on_Light_Rail,WALK_LRF - In-vehicle time on Light Rail (incremental w/ ivt),@(ivt_lrt_multiplier-1)*(odt_skims['WLK_LRF_WLK_KEYIVT']/100 + dot_skims['WLK_LRF_WLK_KEYIVT']/100),,,,,,,,,,coef_ivt,,,,,,,,,,, +util_WALK_LRF_In_vehicle_time_on_Ferry,WALK_LRF - In-vehicle time on Ferry (incremental w/keyivt),@(ivt_ferry_multiplier-ivt_lrt_multiplier)*(odt_skims['WLK_LRF_WLK_FERRYIVT']/100 + dot_skims['WLK_LRF_WLK_FERRYIVT']/100),,,,,,,,,,coef_ivt,,,,,,,,,,, +util_WALK_LRF_Short_iwait_time,WALK_LRF - Short iwait time,@short_i_wait_multiplier * ((odt_skims['WLK_LRF_WLK_IWAIT']/100).clip(upper=waitThresh) + (dot_skims['WLK_LRF_WLK_IWAIT']/100).clip(upper=waitThresh)),,,,,,,,,,coef_ivt,,,,,,,,,,, +util_WALK_LRF_Long_iwait_time,WALK_LRF - Long iwait time,@long_i_wait_multiplier * ((odt_skims['WLK_LRF_WLK_IWAIT']/100-waitThresh).clip(0) + (dot_skims['WLK_LRF_WLK_IWAIT']/100-waitThresh).clip(0)),,,,,,,,,,coef_ivt,,,,,,,,,,, +util_WALK_LRF_transfer_wait_time,WALK_LRF - transfer wait time,@xwait_multiplier * (odt_skims['WLK_LRF_WLK_XWAIT']/100 + dot_skims['WLK_LRF_WLK_XWAIT']/100),,,,,,,,,,coef_ivt,,,,,,,,,,, +util_WALK_LRF_number_of_transfers,WALK_LRF - number of transfers,@xfers_wlk_multiplier * ((odt_skims['WLK_LRF_WLK_BOARDS']-1).clip(0) + (dot_skims['WLK_LRF_WLK_BOARDS']-1).clip(0)),,,,,,,,,,coef_ivt,,,,,,,,,,, +util_WALK_LRF_Walk_access_time,WALK_LRF - Walk access time,@2 * wacc_multiplier * df.origin_walk_time,,,,,,,,,,coef_ivt,,,,,,,,,,, +util_WALK_LRF_Walk_egress_time,WALK_LRF - Walk egress time,@2 * wegr_multiplier * df.destination_walk_time,,,,,,,,,,coef_ivt,,,,,,,,,,, +util_WALK_LRF_Walk_other_time,WALK_LRF - Walk other time,@waux_multiplier * (odt_skims['WLK_LRF_WLK_WAUX']/100 + dot_skims['WLK_LRF_WLK_WAUX']/100),,,,,,,,,,coef_ivt,,,,,,,,,,, +util_WALK_LRF_Fare,WALK_LRF - Fare,@ivt_cost_multiplier * df.ivot * (odt_skims['WLK_LRF_WLK_FAR'] + dot_skims['WLK_LRF_WLK_FAR']),,,,,,,,,,coef_ivt,,,,,,,,,,, +util_WALK_LRF_Destination_zone_densityIndex,WALK_LRF - Destination zone densityIndex,@density_index_multiplier * df.dest_density_index,,,,,,,,,,coef_ivt,,,,,,,,,,, +util_WALK_LRF_Topology,WALK_LRF - Topology,@coef_topology_trn_multiplier * df.dest_topology,,,,,,,,,,coef_ivt,,,,,,,,,,, +util_WALK_LRF_Person_is_less_than_10_years_old,WALK_LRF - Person is less than 10 years old,@(df.age <= 10),,,,,,,,,,coef_age010_trn_multiplier,,,,,,,,,,, +#,Walk to Express bus,,,,,,,,,,,,,,,,,,,,,, +util_WALK_EXP_Unavailable,WALK_EXP - Unavailable,walk_express_available == False,,,,,,,,,,,-999,,,,,,,,,, +util_WALK_EXP_In_vehicle_time,WALK_EXP - In-vehicle time,@(odt_skims['WLK_EXP_WLK_TOTIVT']/100 + dot_skims['WLK_EXP_WLK_TOTIVT']/100),,,,,,,,,,,coef_ivt,,,,,,,,,, +util_WALK_EXP_In_vehicle_time_on_Express_bus,WALK_EXP - In-vehicle time on Express bus (incremental w/ ivt),@(ivt_exp_multiplier - 1)*(odt_skims['WLK_EXP_WLK_KEYIVT']/100 + dot_skims['WLK_EXP_WLK_KEYIVT']/100),,,,,,,,,,,coef_ivt,,,,,,,,,, +util_WALK_EXP_Short_iwait_time,WALK_EXP - Short iwait time,@short_i_wait_multiplier * ((odt_skims['WLK_EXP_WLK_IWAIT']/100).clip(upper=waitThresh) + (dot_skims['WLK_EXP_WLK_IWAIT']/100).clip(upper=waitThresh)),,,,,,,,,,,coef_ivt,,,,,,,,,, +util_WALK_EXP_Long_iwait_time,WALK_EXP - Long iwait time,@long_i_wait_multiplier * ((odt_skims['WLK_EXP_WLK_IWAIT']/100-waitThresh).clip(0) + (dot_skims['WLK_EXP_WLK_IWAIT']/100-waitThresh).clip(0)),,,,,,,,,,,coef_ivt,,,,,,,,,, +util_WALK_EXP_transfer_wait_time,WALK_EXP - transfer wait time,@xwait_multiplier * (odt_skims['WLK_EXP_WLK_XWAIT']/100 + dot_skims['WLK_EXP_WLK_XWAIT']/100),,,,,,,,,,,coef_ivt,,,,,,,,,, +util_WALK_EXP_number_of_transfers,WALK_EXP - number of transfers,@xfers_wlk_multiplier * ((odt_skims['WLK_EXP_WLK_BOARDS']-1).clip(0) + (dot_skims['WLK_EXP_WLK_BOARDS']-1).clip(0)),,,,,,,,,,,coef_ivt,,,,,,,,,, +util_WALK_EXP_Walk_access_time,WALK_EXP - Walk access time,@2 * wacc_multiplier * df.origin_walk_time,,,,,,,,,,,coef_ivt,,,,,,,,,, +util_WALK_EXP_Walk_egress_time,WALK_EXP - Walk egress time,@2 * wegr_multiplier * df.destination_walk_time,,,,,,,,,,,coef_ivt,,,,,,,,,, +util_WALK_EXP_Walk_other_time,WALK_EXP - Walk other time,@waux_multiplier * (odt_skims['WLK_EXP_WLK_WAUX']/100 + dot_skims['WLK_EXP_WLK_WAUX']/100),,,,,,,,,,,coef_ivt,,,,,,,,,, +util_WALK_EXP_Fare,WALK_EXP - Fare,@ivt_cost_multiplier * df.ivot * (odt_skims['WLK_EXP_WLK_FAR'] + dot_skims['WLK_EXP_WLK_FAR']),,,,,,,,,,,coef_ivt,,,,,,,,,, +util_WALK_EXP_Destination_zone_densityIndex,WALK_EXP - Destination zone densityIndex,@density_index_multiplier * df.dest_density_index,,,,,,,,,,,coef_ivt,,,,,,,,,, +util_WALK_EXP_Topology,WALK_EXP - Topology,@coef_topology_trn_multiplier * df.dest_topology,,,,,,,,,,,coef_ivt,,,,,,,,,, +util_WALK_EXP_Person_is_less_than_10_years_old,WALK_EXP - Person is less than 10 years old,@(df.age <= 10),,,,,,,,,,,coef_age010_trn_multiplier,,,,,,,,,, +#,Walk to Heavy Rail,,,,,,,,,,,,,,,,,,,,,, +util_WALK_HVY_Unavailable,WALK_HVY - Unavailable,walk_heavyrail_available == False,,,,,,,,,,,,-999,,,,,,,,, +util_WALK_HVY_In_vehicle_time,WALK_HVY - In-vehicle time,@(odt_skims['WLK_HVY_WLK_TOTIVT']/100 + dot_skims['WLK_HVY_WLK_TOTIVT']/100),,,,,,,,,,,,coef_ivt,,,,,,,,, +util_WALK_HVY_In_vehicle_time_on_heavy_rail,WALK_HVY - In-vehicle time on heavy rail (incremental w/ ivt),@(ivt_hvy_multiplier-1) * (odt_skims['WLK_HVY_WLK_KEYIVT']/100 + dot_skims['WLK_HVY_WLK_KEYIVT']/100),,,,,,,,,,,,coef_ivt,,,,,,,,, +util_WALK_HVY_Short_iwait_time,WALK_HVY - Short iwait time,@short_i_wait_multiplier * ((odt_skims['WLK_HVY_WLK_IWAIT']/100).clip(upper=waitThresh) + (dot_skims['WLK_HVY_WLK_IWAIT']/100).clip(upper=waitThresh)),,,,,,,,,,,,coef_ivt,,,,,,,,, +util_WALK_HVY_Long_iwait_time,WALK_HVY - Long iwait time,@long_i_wait_multiplier * ((odt_skims['WLK_HVY_WLK_IWAIT']/100-waitThresh).clip(0) + (dot_skims['WLK_HVY_WLK_IWAIT']/100-waitThresh).clip(0)),,,,,,,,,,,,coef_ivt,,,,,,,,, +util_WALK_HVY_transfer_wait_time,WALK_HVY - transfer wait time,@xwait_multiplier * (odt_skims['WLK_HVY_WLK_XWAIT']/100 + dot_skims['WLK_HVY_WLK_XWAIT']/100),,,,,,,,,,,,coef_ivt,,,,,,,,, +util_WALK_HVY_number_of_transfers,WALK_HVY - number of transfers,@xfers_wlk_multiplier * ((odt_skims['WLK_HVY_WLK_BOARDS']-1).clip(0) + (dot_skims['WLK_HVY_WLK_BOARDS']-1).clip(0)),,,,,,,,,,,,coef_ivt,,,,,,,,, +util_WALK_HVY_Walk_access_time,WALK_HVY - Walk access time,@2 * wacc_multiplier * df.origin_walk_time,,,,,,,,,,,,coef_ivt,,,,,,,,, +util_WALK_HVY_Walk_egress_time,WALK_HVY - Walk egress time,@wegr_multiplier * 2 *df.destination_walk_time,,,,,,,,,,,,coef_ivt,,,,,,,,, +util_WALK_HVY_Walk_other_time,WALK_HVY - Walk other time,@waux_multiplier * (odt_skims['WLK_HVY_WLK_WAUX']/100 + dot_skims['WLK_HVY_WLK_WAUX']/100),,,,,,,,,,,,coef_ivt,,,,,,,,, +util_WALK_HVY_Fare,WALK_HVY - Fare,@ivt_cost_multiplier * df.ivot * (odt_skims['WLK_HVY_WLK_FAR'] + dot_skims['WLK_HVY_WLK_FAR']),,,,,,,,,,,,coef_ivt,,,,,,,,, +util_WALK_HVY_Destination_zone_densityIndex,WALK_HVY - Destination zone densityIndex,@density_index_multiplier * df.dest_density_index,,,,,,,,,,,,coef_ivt,,,,,,,,, +util_WALK_HVY_Topology,WALK_HVY - Topology,@coef_topology_trn_multiplier * df.dest_topology,,,,,,,,,,,,coef_ivt,,,,,,,,, +util_WALK_HVY_Person_is_less_than_10_years_old,WALK_HVY - Person is less than 10 years old,@(df.age <= 10),,,,,,,,,,,,coef_age010_trn_multiplier,,,,,,,,, +#,Walk to Commuter rail,,,,,,,,,,,,,,,,,,,,,, +util_WALK_COM_Unavailable,WALK_COM - Unavailable,walk_commuter_available == False,,,,,,,,,,,,,-999,,,,,,,, +util_WALK_COM_In_vehicle_time,WALK_COM - In-vehicle time,@(odt_skims['WLK_COM_WLK_TOTIVT']/100 + dot_skims['WLK_COM_WLK_TOTIVT']/100),,,,,,,,,,,,,coef_ivt,,,,,,,, +util_WALK_COM_In_vehicle_time_on_commuter_rail,WALK_COM - In-vehicle time on commuter rail (incremental w/ ivt),@(ivt_com_multiplier - 1) * (odt_skims['WLK_COM_WLK_KEYIVT']/100 + dot_skims['WLK_COM_WLK_KEYIVT']/100),,,,,,,,,,,,,coef_ivt,,,,,,,, +util_WALK_COM_Short_iwait_time,WALK_COM - Short iwait time,@short_i_wait_multiplier * ((odt_skims['WLK_COM_WLK_IWAIT']/100).clip(upper=waitThresh) + (dot_skims['WLK_COM_WLK_IWAIT']/100).clip(upper=waitThresh)),,,,,,,,,,,,,coef_ivt,,,,,,,, +util_WALK_COM_Long_iwait_time,WALK_COM - Long iwait time,@long_i_wait_multiplier * ((odt_skims['WLK_COM_WLK_IWAIT']/100-waitThresh).clip(0) + (dot_skims['WLK_COM_WLK_IWAIT']/100-waitThresh).clip(0)),,,,,,,,,,,,,coef_ivt,,,,,,,, +util_WALK_COM_transfer_wait_time,WALK_COM - transfer wait time,@xwait_multiplier * (odt_skims['WLK_COM_WLK_XWAIT']/100 + dot_skims['WLK_COM_WLK_XWAIT']/100),,,,,,,,,,,,,coef_ivt,,,,,,,, +util_WALK_COM_number_of_transfers,WALK_COM - number of transfers,@xfers_wlk_multiplier * ((odt_skims['WLK_COM_WLK_BOARDS']-1).clip(0) + (dot_skims['WLK_COM_WLK_BOARDS']-1).clip(0)),,,,,,,,,,,,,coef_ivt,,,,,,,, +util_WALK_COM_Walk_access_time,WALK_COM - Walk access time,@2 * wacc_multiplier * df.origin_walk_time,,,,,,,,,,,,,coef_ivt,,,,,,,, +util_WALK_COM_Walk_egress_time,WALK_COM - Walk egress time,@2 * wegr_multiplier * df.destination_walk_time,,,,,,,,,,,,,coef_ivt,,,,,,,, +util_WALK_COM_Walk_other_time,WALK_COM - Walk other time,@waux_multiplier * (odt_skims['WLK_COM_WLK_WAUX']/100 + dot_skims['WLK_COM_WLK_WAUX']/100),,,,,,,,,,,,,coef_ivt,,,,,,,, +util_WALK_COM_Fare,WALK_COM - Fare,@ivt_cost_multiplier * df.ivot * (odt_skims['WLK_COM_WLK_FAR'] + dot_skims['WLK_COM_WLK_FAR']),,,,,,,,,,,,,coef_ivt,,,,,,,, +util_WALK_COM_Destination_zone_densityIndex,WALK_COM - Destination zone densityIndex,@density_index_multiplier * df.dest_density_index,,,,,,,,,,,,,coef_ivt,,,,,,,, +util_WALK_COM_Topology,WALK_COM - Topology,@coef_topology_trn_multiplier * df.dest_topology,,,,,,,,,,,,,coef_ivt,,,,,,,, +util_WALK_COM_Person_is_less_than_10_years_old,WALK_COM - Person is less than 10 years old,@(df.age < 10),,,,,,,,,,,,,coef_age010_trn_multiplier,,,,,,,, +#,Drive to Local,,,,,,,,,,,,,,,,,,,,,, +util_DRIVE_LOC_Unavailable,DRIVE_LOC - Unavailable,drive_local_available == False,,,,,,,,,,,,,,-999,,,,,,, +util_DRIVE_LOC_Unavailable_for_zero_auto_households,DRIVE_LOC - Unavailable for zero auto households,auto_ownership == 0,,,,,,,,,,,,,,-999,,,,,,, +util_DRIVE_LOC_Unavailable_for_persons_less_than_16,DRIVE_LOC - Unavailable for persons less than 16,age < 16,,,,,,,,,,,,,,-999,,,,,,, +util_DRIVE_LOC_In_vehicle_time,DRIVE_LOC - In-vehicle time,@(odt_skims['DRV_LOC_WLK_TOTIVT']/100 + dot_skims['WLK_LOC_DRV_TOTIVT']/100),,,,,,,,,,,,,,coef_ivt,,,,,,, +util_DRIVE_LOC_Short_iwait_time,DRIVE_LOC - Short iwait time,@short_i_wait_multiplier * ((odt_skims['DRV_LOC_WLK_IWAIT']/100).clip(upper=waitThresh) + (dot_skims['WLK_LOC_DRV_IWAIT']/100).clip(upper=waitThresh)),,,,,,,,,,,,,,coef_ivt,,,,,,, +util_DRIVE_LOC_Long_iwait_time,DRIVE_LOC - Long iwait time,@long_i_wait_multiplier * ((odt_skims['DRV_LOC_WLK_IWAIT']/100-waitThresh).clip(0) + (dot_skims['WLK_LOC_DRV_IWAIT']/100-waitThresh).clip(0)),,,,,,,,,,,,,,coef_ivt,,,,,,, +util_DRIVE_LOC_transfer_wait_time,DRIVE_LOC - transfer wait time,@xwait_multiplier * (odt_skims['DRV_LOC_WLK_XWAIT']/100 + dot_skims['WLK_LOC_DRV_XWAIT']/100),,,,,,,,,,,,,,coef_ivt,,,,,,, +util_DRIVE_LOC_number_of_transfers,DRIVE_LOC - number of transfers,@xfers_wlk_multiplier * ((odt_skims['DRV_LOC_WLK_BOARDS']-1).clip(0) + (dot_skims['WLK_LOC_DRV_BOARDS']-1).clip(0)),,,,,,,,,,,,,,coef_ivt,,,,,,, +util_DRIVE_LOC_Drive_time,DRIVE_LOC - Drive time,@dtim_multiplier * (odt_skims['DRV_LOC_WLK_DTIM']/100 + dot_skims['WLK_LOC_DRV_DTIM']/100),,,,,,,,,,,,,,coef_ivt,,,,,,, +util_DRIVE_LOC_Walk_access_time,DRIVE_LOC - Walk access time,@wacc_multiplier * df.destination_walk_time,,,,,,,,,,,,,,coef_ivt,,,,,,, +util_DRIVE_LOC_Walk_egress_time,DRIVE_LOC - Walk egress time (at attraction end),@wegr_multiplier * df.destination_walk_time,,,,,,,,,,,,,,coef_ivt,,,,,,, +util_DRIVE_LOC_Walk_other_time,DRIVE_LOC - Walk other time,@waux_multiplier * (odt_skims['DRV_LOC_WLK_WAUX']/100 + dot_skims['WLK_LOC_DRV_WAUX']/100),,,,,,,,,,,,,,coef_ivt,,,,,,, +util_DRIVE_LOC_Fare_and_operating_cost,DRIVE_LOC - Fare and operating cost,@ivt_cost_multiplier * df.ivot * ((odt_skims['DRV_LOC_WLK_FAR'] + dot_skims['WLK_LOC_DRV_FAR']) + ((odt_skims['DRV_LOC_WLK_DDIST']/100+dot_skims['WLK_LOC_DRV_DDIST']/100) * df.sov_auto_op_cost)),,,,,,,,,,,,,,coef_ivt,,,,,,, +util_DRIVE_LOC_Ratio_of_drive_access_distance_to_OD_distance,DRIVE_LOC - Ratio of drive access distance to OD distance,@dacc_ratio * ((odt_skims['DRV_LOC_WLK_DDIST']/100+ dot_skims['WLK_LOC_DRV_DDIST']/100)/ (od_skims['DIST']*2)),,,,,,,,,,,,,,1,,,,,,, +util_DRIVE_LOC_Destination_zone_densityIndex,DRIVE_LOC - Destination zone densityIndex,@density_index_multiplier * df.dest_density_index,,,,,,,,,,,,,,coef_ivt,,,,,,, +util_DRIVE_LOC_Topology,DRIVE_LOC - Topology,@coef_topology_trn_multiplier * df.dest_topology,,,,,,,,,,,,,,coef_ivt,,,,,,, +util_DRIVE_LOC_Person_is_less_than_10_years_old,DRIVE_LOC - Person is less than 10 years old,@(df.age < 10),,,,,,,,,,,,,,coef_age010_trn_multiplier,,,,,,, +#,Drive to Light Rail/Ferry,,,,,,,,,,,,,,,,,,,,,, +util_DRIVE_LRF_Unavailable,DRIVE_LRF - Unavailable,drive_lrf_available == False,,,,,,,,,,,,,,,-999,,,,,, +util_DRIVE_LRF_Unavailable_for_zero_auto_households,DRIVE_LRF - Unavailable for zero auto households,auto_ownership == 0,,,,,,,,,,,,,,,-999,,,,,, +util_DRIVE_LRF_Unavailable_for_persons_less_than_16,DRIVE_LRF - Unavailable for persons less than 16,age < 16,,,,,,,,,,,,,,,-999,,,,,, +util_DRIVE_LRF_In_vehicle_time,DRIVE_LRF - In-vehicle time,@(odt_skims['DRV_LRF_WLK_TOTIVT']/100 + dot_skims['WLK_LRF_DRV_TOTIVT']/100),,,,,,,,,,,,,,,coef_ivt,,,,,, +util_DRIVE_LRF_In_vehicle_time_on_Light_Rail,DRIVE_LRF - In-vehicle time on Light Rail (incremental w/ ivt),@(ivt_lrt_multiplier-1) * (odt_skims['DRV_LRF_WLK_KEYIVT']/100 + dot_skims['WLK_LRF_DRV_KEYIVT']/100),,,,,,,,,,,,,,,coef_ivt,,,,,, +util_DRIVE_LRF_In_vehicle_time_on_Ferry,DRIVE_LRF - In-vehicle time on Ferry (incremental w/ keyivt),@(ivt_ferry_multiplier-ivt_lrt_multiplier)*(odt_skims['DRV_LRF_WLK_FERRYIVT']/100 + dot_skims['WLK_LRF_DRV_FERRYIVT']/100),,,,,,,,,,,,,,,coef_ivt,,,,,, +util_DRIVE_LRF_Short_iwait_time,DRIVE_LRF - Short iwait time,@short_i_wait_multiplier * ((odt_skims['DRV_LRF_WLK_IWAIT']/100).clip(upper=waitThresh) + (dot_skims['WLK_LRF_DRV_IWAIT']/100).clip(upper=waitThresh)),,,,,,,,,,,,,,,coef_ivt,,,,,, +util_DRIVE_LRF_Long_iwait_time,DRIVE_LRF - Long iwait time,@long_i_wait_multiplier * ((odt_skims['DRV_LRF_WLK_IWAIT']/100-waitThresh).clip(0) + (dot_skims['WLK_LRF_DRV_IWAIT']/100-waitThresh).clip(0)),,,,,,,,,,,,,,,coef_ivt,,,,,, +util_DRIVE_LRF_transfer_wait_time,DRIVE_LRF - transfer wait time,@xwait_multiplier * (odt_skims['DRV_LRF_WLK_XWAIT']/100 + dot_skims['WLK_LRF_DRV_XWAIT']/100),,,,,,,,,,,,,,,coef_ivt,,,,,, +util_DRIVE_LRF_number_of_transfers,DRIVE_LRF - number of transfers,@xfers_drv_multiplier * ((odt_skims['DRV_LRF_WLK_BOARDS']-1).clip(0) + (dot_skims['WLK_LRF_DRV_BOARDS']-1).clip(0)),,,,,,,,,,,,,,,coef_ivt,,,,,, +util_DRIVE_LRF_Drive_time,DRIVE_LRF - Drive time,@dtim_multiplier * (odt_skims['DRV_LRF_WLK_DTIM']/100 + dot_skims['WLK_LRF_DRV_DTIM']/100),,,,,,,,,,,,,,,coef_ivt,,,,,, +util_DRIVE_LRF_Walk_access_time,DRIVE_LRF - Walk access time (at attraction end),@wacc_multiplier * df.destination_walk_time,,,,,,,,,,,,,,,coef_ivt,,,,,, +util_DRIVE_LRF_Walk_egress_time,DRIVE_LRF - Walk egress time (at attraction end),@wegr_multiplier * df.destination_walk_time,,,,,,,,,,,,,,,coef_ivt,,,,,, +util_DRIVE_LRF_Walk_other_time,DRIVE_LRF - Walk other time,@waux_multiplier * (odt_skims['DRV_LRF_WLK_WAUX']/100 + dot_skims['WLK_LRF_DRV_WAUX']/100),,,,,,,,,,,,,,,coef_ivt,,,,,, +util_DRIVE_LRF_Fare_and_operating_cost,DRIVE_LRF - Fare and operating cost,@ivt_cost_multiplier * df.ivot * ((odt_skims['DRV_LRF_WLK_FAR']+dot_skims['WLK_LRF_DRV_FAR']) + ((odt_skims['DRV_LRF_WLK_DDIST']/100+dot_skims['WLK_LRF_DRV_DDIST']/100) * df.sov_auto_op_cost)),,,,,,,,,,,,,,,coef_ivt,,,,,, +util_DRIVE_LRF_Ratio_of_drive_access_distance_to_OD_distance,DRIVE_LRF - Ratio of drive access distance to OD distance,@dacc_ratio * ((odt_skims['DRV_LRF_WLK_DDIST']/100+ dot_skims['WLK_LRF_DRV_DDIST']/100)/ (od_skims['DIST']*2)),,,,,,,,,,,,,,,1,,,,,, +util_DRIVE_LRF_Destination_zone_densityIndex,DRIVE_LRF - Destination zone densityIndex,@density_index_multiplier * df.dest_density_index,,,,,,,,,,,,,,,coef_ivt,,,,,, +util_DRIVE_LRF_Topology,DRIVE_LRF - Topology,@coef_topology_trn_multiplier * df.dest_topology,,,,,,,,,,,,,,,coef_ivt,,,,,, +util_DRIVE_LRF_Person_is_less_than_10_years_old,DRIVE_LRF - Person is less than 10 years old,@(df.age < 10),,,,,,,,,,,,,,,coef_age010_trn_multiplier,,,,,, +#,Drive to Express bus,,,,,,,,,,,,,,,,,,,,,, +util_DRIVE_EXP_Unavailable,DRIVE_EXP - Unavailable,drive_express_available == False,,,,,,,,,,,,,,,,-999,,,,, +util_DRIVE_EXP_Unavailable_for_zero_auto_households,DRIVE_EXP - Unavailable for zero auto households,auto_ownership == 0,,,,,,,,,,,,,,,,-999,,,,, +util_DRIVE_EXP_Unavailable_for_persons_less_than_16,DRIVE_EXP - Unavailable for persons less than 16,age < 16,,,,,,,,,,,,,,,,-999,,,,, +util_DRIVE_EXP_In_vehicle_time,DRIVE_EXP - In-vehicle time,@(odt_skims['DRV_EXP_WLK_TOTIVT']/100 + dot_skims['WLK_EXP_DRV_TOTIVT']/100),,,,,,,,,,,,,,,,coef_ivt,,,,, +util_DRIVE_EXP_In_vehicle_time_on_Express_bus,DRIVE_EXP - In-vehicle time on Express bus (incremental w/ ivt),@(ivt_exp_multiplier-1) * (odt_skims['DRV_EXP_WLK_KEYIVT']/100 + dot_skims['WLK_EXP_DRV_KEYIVT']/100),,,,,,,,,,,,,,,,coef_ivt,,,,, +util_DRIVE_EXP_Short_iwait_time,DRIVE_EXP - Short iwait time,@short_i_wait_multiplier * ((odt_skims['DRV_EXP_WLK_IWAIT']/100).clip(upper=waitThresh) + (dot_skims['WLK_EXP_DRV_IWAIT']/100).clip(upper=waitThresh)),,,,,,,,,,,,,,,,coef_ivt,,,,, +util_DRIVE_EXP_Long_iwait_time,DRIVE_EXP - Long iwait time,@long_i_wait_multiplier * ((odt_skims['DRV_EXP_WLK_IWAIT']/100-waitThresh).clip(0) + (dot_skims['WLK_EXP_DRV_IWAIT']/100-waitThresh).clip(0)),,,,,,,,,,,,,,,,coef_ivt,,,,, +util_DRIVE_EXP_transfer_wait_time,DRIVE_EXP - transfer wait time,@xwait_multiplier * (odt_skims['DRV_EXP_WLK_XWAIT']/100 + dot_skims['WLK_EXP_DRV_XWAIT']/100),,,,,,,,,,,,,,,,coef_ivt,,,,, +util_DRIVE_EXP_number_of_transfers,DRIVE_EXP - number of transfers,@xfers_drv_multiplier * ((odt_skims['DRV_EXP_WLK_BOARDS']-1).clip(0) + (dot_skims['WLK_EXP_DRV_BOARDS']-1).clip(0)),,,,,,,,,,,,,,,,coef_ivt,,,,, +util_DRIVE_EXP_Drive_time,DRIVE_EXP - Drive time,@dtim_multiplier * (odt_skims['DRV_EXP_WLK_DTIM']/100 + dot_skims['WLK_EXP_DRV_DTIM']/100),,,,,,,,,,,,,,,,coef_ivt,,,,, +util_DRIVE_EXP_Walk_access_time,DRIVE_EXP - Walk access time (at attraction end),@wacc_multiplier * df.destination_walk_time,,,,,,,,,,,,,,,,coef_ivt,,,,, +util_DRIVE_EXP_Walk_egress_ime,DRIVE_EXP - Walk egress ime (at attraction end),@wegr_multiplier * df.destination_walk_time,,,,,,,,,,,,,,,,coef_ivt,,,,, +util_DRIVE_EXP_Walk_other_time,DRIVE_EXP - Walk other time,@waux_multiplier * (odt_skims['DRV_EXP_WLK_WAUX']/100 + dot_skims['WLK_EXP_DRV_WAUX']/100),,,,,,,,,,,,,,,,coef_ivt,,,,, +util_DRIVE_EXP_Fare_and_operating_cost,DRIVE_EXP - Fare and operating cost,@ivt_cost_multiplier * df.ivot * ((odt_skims['DRV_EXP_WLK_FAR']+dot_skims['WLK_EXP_DRV_FAR']) + ((odt_skims['DRV_EXP_WLK_DDIST']/100+dot_skims['WLK_EXP_DRV_DDIST']/100) * df.sov_auto_op_cost)),,,,,,,,,,,,,,,,coef_ivt,,,,, +util_DRIVE_EXP_Ratio_of_drive_access_distance_to_OD_distance,DRIVE_EXP - Ratio of drive access distance to OD distance,@dacc_ratio * ((odt_skims['DRV_EXP_WLK_DDIST']/100+ dot_skims['WLK_EXP_DRV_DDIST']/100)/ (od_skims['DIST']*2)),,,,,,,,,,,,,,,,1,,,,, +util_DRIVE_EXP_Destination_zone_densityIndex,DRIVE_EXP - Destination zone densityIndex,@density_index_multiplier * df.dest_density_index,,,,,,,,,,,,,,,,coef_ivt,,,,, +util_DRIVE_EXP_Topology,DRIVE_EXP - Topology,@coef_topology_trn_multiplier * df.dest_topology,,,,,,,,,,,,,,,,coef_ivt,,,,, +util_DRIVE_EXP_Person_is_less_than_10_years_old,DRIVE_EXP - Person is less than 10 years old,@(df.age < 10),,,,,,,,,,,,,,,,coef_age010_trn_multiplier,,,,, +#,Drive to Heavy Rail,,,,,,,,,,,,,,,,,,,,,, +util_DRIVE_HVY_Unavailable,DRIVE_HVY - Unavailable,drive_heavyrail_available == False,,,,,,,,,,,,,,,,,-999,,,, +util_DRIVE_HVY_Unavailable_for_zero_auto_households,DRIVE_HVY - Unavailable for zero auto households,auto_ownership == 0,,,,,,,,,,,,,,,,,-999,,,, +util_DRIVE_HVY_Unavailable_for_persons_less_than_16,DRIVE_HVY - Unavailable for persons less than 16,age < 16,,,,,,,,,,,,,,,,,-999,,,, +util_DRIVE_HVY_In_vehicle_time,DRIVE_HVY - In-vehicle time,@(odt_skims['DRV_HVY_WLK_TOTIVT']/100 + dot_skims['WLK_HVY_DRV_TOTIVT']/100),,,,,,,,,,,,,,,,,coef_ivt,,,, +util_DRIVE_HVY_In_vehicle_time_on_heavy_rail,DRIVE_HVY - In-vehicle time on heavy rail (incremental w/ ivt),@(ivt_hvy_multiplier-1) * (odt_skims['DRV_HVY_WLK_KEYIVT']/100 + dot_skims['WLK_HVY_DRV_KEYIVT']/100),,,,,,,,,,,,,,,,,coef_ivt,,,, +util_DRIVE_HVY_Short_iwait_time,DRIVE_HVY - Short iwait time,@short_i_wait_multiplier * ((odt_skims['DRV_HVY_WLK_IWAIT']/100).clip(upper=waitThresh) + (dot_skims['WLK_HVY_DRV_IWAIT']/100).clip(upper=waitThresh)),,,,,,,,,,,,,,,,,coef_ivt,,,, +util_DRIVE_HVY_Long_iwait_time,DRIVE_HVY - Long iwait time,@long_i_wait_multiplier * ((odt_skims['DRV_HVY_WLK_IWAIT']/100-waitThresh).clip(0) + (dot_skims['WLK_HVY_DRV_IWAIT']/100-waitThresh).clip(0)),,,,,,,,,,,,,,,,,coef_ivt,,,, +util_DRIVE_HVY_transfer_wait_time,DRIVE_HVY - transfer wait time,@xwait_multiplier * (odt_skims['DRV_HVY_WLK_XWAIT']/100 + dot_skims['WLK_HVY_DRV_XWAIT']/100),,,,,,,,,,,,,,,,,coef_ivt,,,, +util_DRIVE_HVY_number_of_transfers,DRIVE_HVY - number of transfers,@xfers_drv_multiplier * ((odt_skims['DRV_HVY_WLK_BOARDS']-1).clip(0) + (dot_skims['WLK_HVY_DRV_BOARDS']-1).clip(0)),,,,,,,,,,,,,,,,,coef_ivt,,,, +util_DRIVE_HVY_Drive_time,DRIVE_HVY - Drive time,@dtim_multiplier * (odt_skims['DRV_HVY_WLK_DTIM']/100 + dot_skims['WLK_HVY_DRV_DTIM']/100),,,,,,,,,,,,,,,,,coef_ivt,,,, +util_DRIVE_HVY_Walk_access_time,DRIVE_HVY - Walk access time (at attraction end),@wacc_multiplier * df.destination_walk_time,,,,,,,,,,,,,,,,,coef_ivt,,,, +util_DRIVE_HVY_Walk_egress_time,DRIVE_HVY - Walk egress time (at attraction end),@wegr_multiplier * df.destination_walk_time,,,,,,,,,,,,,,,,,coef_ivt,,,, +util_DRIVE_HVY_Walk_other_time,DRIVE_HVY - Walk other time,@waux_multiplier * (odt_skims['DRV_HVY_WLK_WAUX']/100 + dot_skims['WLK_HVY_DRV_WAUX']/100),,,,,,,,,,,,,,,,,coef_ivt,,,, +util_DRIVE_HVY_Fare_and_operating_cost,DRIVE_HVY - Fare and operating cost,@ivt_cost_multiplier * df.ivot * ((odt_skims['DRV_HVY_WLK_FAR']+dot_skims['WLK_HVY_DRV_FAR']) + ((odt_skims['DRV_HVY_WLK_DDIST']/100+dot_skims['WLK_HVY_DRV_DDIST']/100) * df.sov_auto_op_cost)),,,,,,,,,,,,,,,,,coef_ivt,,,, +util_DRIVE_HVY_Ratio_of_drive_access_distance_to_OD_distance,DRIVE_HVY - Ratio of drive access distance to OD distance,@dacc_ratio * (odt_skims['DRV_HVY_WLK_DDIST']/100) / od_skims['DIST'],,,,,,,,,,,,,,,,,1,,,, +util_DRIVE_HVY_Destination_zone_densityIndex,DRIVE_HVY - Destination zone densityIndex,@density_index_multiplier * df.dest_density_index,,,,,,,,,,,,,,,,,coef_ivt,,,, +util_DRIVE_HVY_Topology,DRIVE_HVY - Topology,@coef_topology_trn_multiplier * df.dest_topology,,,,,,,,,,,,,,,,,coef_ivt,,,, +util_DRIVE_HVY_Person_is_less_than_10_years_old,DRIVE_HVY - Person is less than 10 years old,@(df.age < 10),,,,,,,,,,,,,,,,,coef_age010_trn_multiplier,,,, +#,Drive to Commuter Rail,,,,,,,,,,,,,,,,,,,,,, +util_DRIVE_COM_Unavailable,DRIVE_COM - Unavailable,drive_commuter_available == False,,,,,,,,,,,,,,,,,,-999,,, +util_DRIVE_COM_Unavailable_for_zero_auto_households,DRIVE_COM - Unavailable for zero auto households,auto_ownership == 0,,,,,,,,,,,,,,,,,,-999,,, +util_DRIVE_COM_Unavailable_for_persons_less_than_16,DRIVE_COM - Unavailable for persons less than 16,age < 16,,,,,,,,,,,,,,,,,,-999,,, +util_DRIVE_COM_In_vehicle_time,DRIVE_COM - In-vehicle time,@(odt_skims['DRV_COM_WLK_TOTIVT']/100 + dot_skims['WLK_COM_DRV_TOTIVT']/100),,,,,,,,,,,,,,,,,,coef_ivt,,, +util_DRIVE_COM_In_vehicle_time_on_commuter_rail,DRIVE_COM - In-vehicle time on commuter rail (incremental w/ ivt),@(ivt_com_multiplier - 1) * (odt_skims['DRV_COM_WLK_KEYIVT']/100 + dot_skims['WLK_COM_DRV_KEYIVT']/100),,,,,,,,,,,,,,,,,,coef_ivt,,, +util_DRIVE_COM_Short_iwait_time,DRIVE_COM - Short iwait time,@short_i_wait_multiplier * ((odt_skims['DRV_COM_WLK_IWAIT']/100).clip(upper=waitThresh) + (dot_skims['WLK_COM_DRV_IWAIT']/100).clip(upper=waitThresh)),,,,,,,,,,,,,,,,,,coef_ivt,,, +util_DRIVE_COM_Long_iwait_time,DRIVE_COM - Long iwait time,@long_i_wait_multiplier * ((odt_skims['DRV_COM_WLK_IWAIT']/100-waitThresh).clip(0) + (dot_skims['WLK_COM_DRV_IWAIT']/100-waitThresh).clip(0)),,,,,,,,,,,,,,,,,,coef_ivt,,, +util_DRIVE_COM_transfer_wait_time,DRIVE_COM - transfer wait time,@xwait_multiplier * (odt_skims['DRV_COM_WLK_XWAIT']/100 + dot_skims['WLK_COM_DRV_XWAIT']/100),,,,,,,,,,,,,,,,,,coef_ivt,,, +util_DRIVE_COM_number_of_transfers,DRIVE_COM - number of transfers,@xfers_drv_multiplier * ((odt_skims['DRV_COM_WLK_BOARDS']-1).clip(0) + (dot_skims['WLK_COM_DRV_BOARDS']-1).clip(0)),,,,,,,,,,,,,,,,,,coef_ivt,,, +util_DRIVE_COM_Drive_time,DRIVE_COM - Drive time,@dtim_multiplier * (odt_skims['DRV_COM_WLK_DTIM']/100 + dot_skims['WLK_COM_DRV_DTIM']/100),,,,,,,,,,,,,,,,,,coef_ivt,,, +util_DRIVE_COM_Walk_access_time,DRIVE_COM - Walk access time (at attraction end),@wacc_multiplier * df.destination_walk_time,,,,,,,,,,,,,,,,,,coef_ivt,,, +util_DRIVE_COM_Walk_egress_time,DRIVE_COM - Walk egress time (at attraction end),@wegr_multiplier * df.destination_walk_time,,,,,,,,,,,,,,,,,,coef_ivt,,, +util_DRIVE_COM_Walk_other_time,DRIVE_COM - Walk other time,@waux_multiplier * (odt_skims['DRV_COM_WLK_WAUX']/100 + dot_skims['WLK_COM_DRV_WAUX']/100),,,,,,,,,,,,,,,,,,coef_ivt,,, +util_DRIVE_COM_Fare_and_operating_cost,DRIVE_COM - Fare and operating cost,@ivt_cost_multiplier * df.ivot * ((odt_skims['DRV_COM_WLK_FAR']+dot_skims['WLK_COM_DRV_FAR']) + ((odt_skims['DRV_COM_WLK_DDIST']/100+dot_skims['WLK_COM_DRV_DDIST']/100) * df.sov_auto_op_cost)),,,,,,,,,,,,,,,,,,coef_ivt,,, +util_DRIVE_COM_Ratio_of_drive_access_distance_to_OD_distance,DRIVE_COM - Ratio of drive access distance to OD distance,@dacc_ratio * ((odt_skims['DRV_COM_WLK_DDIST']/100 + dot_skims['WLK_COM_DRV_DDIST']/100)/ (od_skims['DIST']*2)),,,,,,,,,,,,,,,,,,1,,, +util_DRIVE_COM_Destination_zone_densityIndex,DRIVE_COM - Destination zone densityIndex,@density_index_multiplier * df.dest_density_index,,,,,,,,,,,,,,,,,,coef_ivt,,, +util_DRIVE_COM_Topology,DRIVE_COM - Topology,@coef_topology_trn_multiplier * df.dest_topology,,,,,,,,,,,,,,,,,,coef_ivt,,, +util_DRIVE_COM_Person_is_less_than_10_years_old,DRIVE_COM - Person is less than 10 years old,@(df.age < 10),,,,,,,,,,,,,,,,,,coef_age010_trn_multiplier,,, +#,Taxi,,,,,,,,,,,,,,,,,,,,,, +util_Taxi_In_vehicle_time,Taxi - In-vehicle time,@(odt_skims['HOV2TOLL_TIME'] + dot_skims['HOV2TOLL_TIME']),,,,,,,,,,,,,,,,,,,coef_ivt,, + util_Taxi_Wait_time,Taxi - Wait time,@ridehail_wait_time_multiplier * df.totalWaitTaxi,,,,,,,,,,,,,,,,,,,coef_ivt,, +util_Taxi_Tolls,Taxi - Tolls,@ivt_cost_multiplier * df.ivot * (odt_skims['HOV2TOLL_VTOLL'] + dot_skims['HOV2TOLL_VTOLL']),,,,,,,,,,,,,,,,,,,coef_ivt,, +util_Taxi_Bridge_toll,Taxi - Bridge toll,@ivt_cost_multiplier * df.ivot * (odt_skims['HOV2TOLL_BTOLL'] + dot_skims['HOV2TOLL_BTOLL']),,,,,,,,,,,,,,,,,,,coef_ivt,, +util_Taxi_Fare,Taxi - Fare,@ivt_cost_multiplier * df.ivot * (Taxi_baseFare * 2 + (odt_skims['HOV2TOLL_DIST'] + dot_skims['HOV2TOLL_DIST']) * Taxi_costPerMile +(odt_skims['HOV2TOLL_TIME'] + dot_skims['HOV2TOLL_TIME']) * Taxi_costPerMinute)*100,,,,,,,,,,,,,,,,,,,coef_ivt,, +#,TNC Single,,,,,,,,,,,,,,,,,,,,,, +util_TNC_Single_In_vehicle_time,TNC Single - In-vehicle time,@(odt_skims['HOV2TOLL_TIME'] + dot_skims['HOV2TOLL_TIME']),,,,,,,,,,,,,,,,,,,,coef_ivt, +util_TNC_Single_Wait_time,TNC Single - Wait time,@ridehail_wait_time_multiplier * df.totalWaitSingleTNC,,,,,,,,,,,,,,,,,,,,coef_ivt, +util_TNC_Single_Tolls,TNC Single - Tolls,@ivt_cost_multiplier * df.ivot * (odt_skims['HOV2TOLL_VTOLL'] + dot_skims['HOV2TOLL_VTOLL']),,,,,,,,,,,,,,,,,,,,coef_ivt, +util_TNC_Single_Bridge_toll,TNC Single - Bridge toll,@ivt_cost_multiplier * df.ivot * (odt_skims['HOV2TOLL_BTOLL'] + odr_skims['HOV2TOLL_BTOLL'] + dot_skims['HOV2TOLL_BTOLL'] + dor_skims['HOV2TOLL_BTOLL']),,,,,,,,,,,,,,,,,,,,coef_ivt, +util_TNC_Single_Cost,TNC Single - Cost,"@ivt_cost_multiplier * df.ivot * np.maximum(TNC_single_baseFare * 2 + (odt_skims['HOV2TOLL_DIST'] + dot_skims['HOV2TOLL_DIST']) * TNC_single_costPerMile + (odt_skims['HOV2TOLL_TIME'] + dot_skims['HOV2TOLL_TIME']) * TNC_single_costPerMinute, TNC_single_costMinimum) * 100",,,,,,,,,,,,,,,,,,,,coef_ivt, +#,TNC Shared,,,,,,,,,,,,,,,,,,,,,, +util_TNC_Shared_In_vehicle_time,TNC Shared - In-vehicle time,@(odt_skims['HOV2TOLL_TIME'] + dot_skims['HOV2TOLL_TIME']) * TNC_shared_IVTFactor,,,,,,,,,,,,,,,,,,,,,coef_ivt +util_TNC_Shared_Wait_time,TNC Shared - Wait time,@ridehail_wait_time_multiplier * df.totalWaitSharedTNC,,,,,,,,,,,,,,,,,,,,,coef_ivt +util_TNC_Shared_Tolls,TNC Shared - Tolls,@ivt_cost_multiplier * df.ivot * (odt_skims['HOV2TOLL_VTOLL'] + dot_skims['HOV2TOLL_VTOLL']),,,,,,,,,,,,,,,,,,,,,coef_ivt +util_TNC_Shared_Bridge_toll,TNC Shared - Bridge toll,@ivt_cost_multiplier * df.ivot * (odt_skims['HOV2TOLL_BTOLL'] + odr_skims['HOV2TOLL_BTOLL'] + dot_skims['HOV2TOLL_BTOLL'] + dor_skims['HOV2TOLL_BTOLL']),,,,,,,,,,,,,,,,,,,,,coef_ivt +util_TNC_Shared_Cost,TNC Shared - Cost,"@ivt_cost_multiplier * df.ivot * np.maximum(TNC_shared_baseFare * 2 + (odt_skims['HOV2TOLL_DIST'] + dot_skims['HOV2TOLL_DIST']) * TNC_shared_costPerMile + (odt_skims['HOV2TOLL_TIME'] + dot_skims['HOV2TOLL_TIME']) * TNC_shared_costPerMinute, TNC_shared_costMinimum) * 100",,,,,,,,,,,,,,,,,,,,,coef_ivt +#,indiv tour ASCs,,,,,,,,,,,,,,,,,,,,,, +util_Walk_ASC_Zero_auto,Walk ASC - Zero auto,@(df.is_indiv & (df.auto_ownership == 0)),,,,,,,walk_ASC_no_auto,,,,,,,,,,,,,, +util_Walk_ASC_Auto_deficient,Walk ASC - Auto deficient,@(df.is_indiv & (df.auto_ownership < df.num_workers) & (df.auto_ownership > 0)),,,,,,,walk_ASC_auto_deficient,,,,,,,,,,,,,, +util_Walk_ASC_Auto_sufficient,Walk ASC - Auto sufficient,@(df.is_indiv & (df.auto_ownership >= df.num_workers) & (df.auto_ownership > 0)),,,,,,,walk_ASC_auto_sufficient,,,,,,,,,,,,,, +util_Bike_ASC_Zero_auto,Bike ASC - Zero auto,@(df.is_indiv & (df.auto_ownership == 0)),,,,,,,,bike_ASC_no_auto,,,,,,,,,,,,, +util_Bike_ASC_Auto_deficient,Bike ASC - Auto deficient,@(df.is_indiv & (df.auto_ownership < df.num_workers) & (df.auto_ownership > 0)),,,,,,,,bike_ASC_auto_deficient,,,,,,,,,,,,, +util_Bike_ASC_Auto_sufficient,Bike ASC - Auto sufficient,@(df.is_indiv & (df.auto_ownership >= df.num_workers) & (df.auto_ownership > 0)),,,,,,,,bike_ASC_auto_sufficient,,,,,,,,,,,,, +util_Shared_ride_2_ASC_Zero_auto,Shared ride 2 ASC - Zero auto,@(df.is_indiv & (df.auto_ownership == 0)),,,sr2_ASC_no_auto,sr2_ASC_no_auto,,,,,,,,,,,,,,,,, +util_Shared_ride_2_ASC_Auto_deficient,Shared ride 2 ASC - Auto deficient,@(df.is_indiv & (df.auto_ownership < df.num_workers) & (df.auto_ownership > 0)),,,sr2_ASC_auto_deficient,sr2_ASC_auto_deficient,,,,,,,,,,,,,,,,, +util_Shared_ride_2_ASC_Auto_sufficient,Shared ride 2 ASC - Auto sufficient,@(df.is_indiv & (df.auto_ownership >= df.num_workers) & (df.auto_ownership > 0)),,,sr2_ASC_auto_sufficient,sr2_ASC_auto_sufficient,,,,,,,,,,,,,,,,, +util_Shared_ride_3p_Zero_auto,Shared ride 3+ - Zero auto,@(df.is_indiv & (df.auto_ownership == 0)),,,,,sr3p_ASC_no_auto,sr3p_ASC_no_auto,,,,,,,,,,,,,,, +util_Shared_ride_3p_Auto_deficient,Shared ride 3+ - Auto deficient,@(df.is_indiv & (df.auto_ownership < df.num_workers) & (df.auto_ownership > 0)),,,,,sr3p_ASC_auto_deficient,sr3p_ASC_auto_deficient,,,,,,,,,,,,,,, +util_Shared_ride_3p_Auto_sufficient,Shared ride 3+ - Auto sufficient,@(df.is_indiv & (df.auto_ownership >= df.num_workers) & (df.auto_ownership > 0)),,,,,sr3p_ASC_auto_sufficient,sr3p_ASC_auto_sufficient,,,,,,,,,,,,,,, +util_Walk_to_Transit_Zero_auto,Walk to Transit - Zero auto,@(df.is_indiv & (df.auto_ownership == 0)),,,,,,,,,walk_transit_ASC_no_auto,walk_transit_ASC_no_auto,walk_transit_ASC_no_auto,walk_transit_ASC_no_auto,walk_transit_ASC_no_auto,,,,,,,, +util_Walk_to_Transit_Auto_deficient,Walk to Transit - Auto deficient,@(df.is_indiv & (df.auto_ownership < df.num_workers) & (df.auto_ownership > 0)),,,,,,,,,walk_transit_ASC_auto_deficient,walk_transit_ASC_auto_deficient,walk_transit_ASC_auto_deficient,walk_transit_ASC_auto_deficient,walk_transit_ASC_auto_deficient,,,,,,,, +util_Walk_to_Transit_Auto_sufficient,Walk to Transit - Auto sufficient,@(df.is_indiv & (df.auto_ownership >= df.num_workers) & (df.auto_ownership > 0)),,,,,,,,,walk_transit_ASC_auto_sufficient,walk_transit_ASC_auto_sufficient,walk_transit_ASC_auto_sufficient,walk_transit_ASC_auto_sufficient,walk_transit_ASC_auto_sufficient,,,,,,,, +util_Drive_to_Transit_Zero_auto,Drive to Transit - Zero auto,@(df.is_indiv & (df.auto_ownership == 0)),,,,,,,,,,,,,,drive_transit_ASC_no_auto,drive_transit_ASC_no_auto,drive_transit_ASC_no_auto,drive_transit_ASC_no_auto,drive_transit_ASC_no_auto,,, +util_Drive_to_Transit_Auto_deficient,Drive to Transit - Auto deficient,@(df.is_indiv & (df.auto_ownership < df.num_workers) & (df.auto_ownership > 0)),,,,,,,,,,,,,,drive_transit_ASC_auto_deficient,drive_transit_ASC_auto_deficient,drive_transit_ASC_auto_deficient,drive_transit_ASC_auto_deficient,drive_transit_ASC_auto_deficient,,, +util_Drive_to_Transit_Auto_sufficient,Drive to Transit - Auto sufficient,@(df.is_indiv & (df.auto_ownership >= df.num_workers) & (df.auto_ownership > 0)),,,,,,,,,,,,,,drive_transit_ASC_auto_sufficient,drive_transit_ASC_auto_sufficient,drive_transit_ASC_auto_sufficient,drive_transit_ASC_auto_sufficient,drive_transit_ASC_auto_sufficient,,, +util_Taxi_Zero_auto,Taxi - Zero auto,@(df.is_indiv & (df.auto_ownership == 0)),,,,,,,,,,,,,,,,,,,taxi_ASC_no_auto,, +util_Taxi_Auto_deficient,Taxi - Auto deficient,@(df.is_indiv & (df.auto_ownership < df.num_workers) & (df.auto_ownership > 0)),,,,,,,,,,,,,,,,,,,taxi_ASC_auto_deficient,, +util_Taxi_Auto_sufficient,Taxi - Auto sufficient,@(df.is_indiv & (df.auto_ownership >= df.num_workers) & (df.auto_ownership > 0)),,,,,,,,,,,,,,,,,,,taxi_ASC_auto_sufficient,, +util_TNC_Single_Zero_auto,TNC Single - Zero auto,@(df.is_indiv & (df.auto_ownership == 0)),,,,,,,,,,,,,,,,,,,,tnc_single_ASC_no_auto, +util_TNC_Single_Auto_deficient,TNC Single - Auto deficient,@(df.is_indiv & (df.auto_ownership < df.num_workers) & (df.auto_ownership > 0)),,,,,,,,,,,,,,,,,,,,tnc_single_ASC_auto_deficient, +util_TNC_Single_Auto_sufficient,TNC Single - Auto sufficient,@(df.is_indiv & (df.auto_ownership >= df.num_workers) & (df.auto_ownership > 0)),,,,,,,,,,,,,,,,,,,,tnc_single_ASC_auto_sufficient, +util_TNC_Shared_Zero_auto,TNC Shared - Zero auto,@(df.is_indiv & (df.auto_ownership == 0)),,,,,,,,,,,,,,,,,,,,,tnc_shared_ASC_no_auto +util_TNC_Shared_Auto_deficient,TNC Shared - Auto deficient,@(df.is_indiv & (df.auto_ownership < df.num_workers) & (df.auto_ownership > 0)),,,,,,,,,,,,,,,,,,,,,tnc_shared_ASC_auto_deficient +util_TNC_Shared_Auto_sufficient,TNC Shared - Auto sufficient,@(df.is_indiv & (df.auto_ownership >= df.num_workers) & (df.auto_ownership > 0)),,,,,,,,,,,,,,,,,,,,,tnc_shared_ASC_auto_sufficient +#,joint tour ASCs,,,,,,,,,,,,,,,,,,,,,, +util_Joint_Walk_ASC_Zero_auto,Joint - Walk ASC - Zero auto,@(df.is_joint & (df.auto_ownership == 0)),,,,,,,joint_walk_ASC_no_auto,,,,,,,,,,,,,, +util_Joint_Walk_ASC_Auto_deficient,Joint - Walk ASC - Auto deficient,@(df.is_joint & (df.auto_ownership < df.num_workers) & (df.auto_ownership > 0)),,,,,,,joint_walk_ASC_auto_deficient,,,,,,,,,,,,,, +util_Joint_Walk_ASC_Auto_sufficient,Joint - Walk ASC - Auto sufficient,@(df.is_joint & (df.auto_ownership >= df.num_workers) & (df.auto_ownership > 0)),,,,,,,joint_walk_ASC_auto_sufficient,,,,,,,,,,,,,, +util_Joint_Bike_ASC_Zero_auto,Joint - Bike ASC - Zero auto,@(df.is_joint & (df.auto_ownership == 0)),,,,,,,,joint_bike_ASC_no_auto,,,,,,,,,,,,, +util_Joint_Bike_ASC_Auto_deficient,Joint - Bike ASC - Auto deficient,@(df.is_joint & (df.auto_ownership < df.num_workers) & (df.auto_ownership > 0)),,,,,,,,joint_bike_ASC_auto_deficient,,,,,,,,,,,,, +util_Joint_Bike_ASC_Auto_sufficient,Joint - Bike ASC - Auto sufficient,@(df.is_joint & (df.auto_ownership >= df.num_workers) & (df.auto_ownership > 0)),,,,,,,,joint_bike_ASC_auto_sufficient,,,,,,,,,,,,, +util_Joint_Shared_ride_2_ASC_Zero_auto,Joint - Shared ride 2 ASC - Zero auto,@(df.is_joint & (df.auto_ownership == 0)),,,joint_sr2_ASC_no_auto,joint_sr2_ASC_no_auto,,,,,,,,,,,,,,,,, +util_Joint_Shared_ride_2_ASC_Auto_deficient,Joint - Shared ride 2 ASC - Auto deficient,@(df.is_joint & (df.auto_ownership < df.num_workers) & (df.auto_ownership > 0)),,,joint_sr2_ASC_auto_deficient,joint_sr2_ASC_auto_deficient,,,,,,,,,,,,,,,,, +util_Joint_Shared_ride_2_ASC_Auto_sufficient,Joint - Shared ride 2 ASC - Auto sufficient,@(df.is_joint & (df.auto_ownership >= df.num_workers) & (df.auto_ownership > 0)),,,joint_sr2_ASC_auto_sufficient,joint_sr2_ASC_auto_sufficient,,,,,,,,,,,,,,,,, +util_Joint_Shared_ride_3p_Zero_auto,Joint - Shared ride 3+ - Zero auto,@(df.is_joint & (df.auto_ownership == 0)),,,,,joint_sr3p_ASC_no_auto,joint_sr3p_ASC_no_auto,,,,,,,,,,,,,,, +util_Joint_Shared_ride_3p_Auto_deficient,Joint - Shared ride 3+ - Auto deficient,@(df.is_joint & (df.auto_ownership < df.num_workers) & (df.auto_ownership > 0)),,,,,joint_sr3p_ASC_auto_deficient,joint_sr3p_ASC_auto_deficient,,,,,,,,,,,,,,, +util_Joint_Shared_ride_3p_Auto_sufficient,Joint - Shared ride 3+ - Auto sufficient,@(df.is_joint & (df.auto_ownership >= df.num_workers) & (df.auto_ownership > 0)),,,,,joint_sr3p_ASC_auto_sufficient,joint_sr3p_ASC_auto_sufficient,,,,,,,,,,,,,,, +util_Joint_Walk_to_Transit_Zero_auto,Joint - Walk to Transit - Zero auto,@(df.is_joint & (df.auto_ownership == 0)),,,,,,,,,joint_walk_transit_ASC_no_auto,joint_walk_transit_ASC_no_auto,joint_walk_transit_ASC_no_auto,joint_walk_transit_ASC_no_auto,joint_walk_transit_ASC_no_auto,,,,,,,, +util_Joint_Walk_to_Transit_Auto_deficient,Joint - Walk to Transit - Auto deficient,@(df.is_joint & (df.auto_ownership < df.num_workers) & (df.auto_ownership > 0)),,,,,,,,,joint_walk_transit_ASC_auto_deficient,joint_walk_transit_ASC_auto_deficient,joint_walk_transit_ASC_auto_deficient,joint_walk_transit_ASC_auto_deficient,joint_walk_transit_ASC_auto_deficient,,,,,,,, +util_Joint_Walk_to_Transit_Auto_sufficient,Joint - Walk to Transit - Auto sufficient,@(df.is_joint & (df.auto_ownership >= df.num_workers) & (df.auto_ownership > 0)),,,,,,,,,joint_walk_transit_ASC_auto_sufficient,joint_walk_transit_ASC_auto_sufficient,joint_walk_transit_ASC_auto_sufficient,joint_walk_transit_ASC_auto_sufficient,joint_walk_transit_ASC_auto_sufficient,,,,,,,, +util_Joint_Drive_to_Transit_Zero_auto,Joint - Drive to Transit - Zero auto,@(df.is_joint & (df.auto_ownership == 0)),,,,,,,,,,,,,,joint_drive_transit_ASC_no_auto,joint_drive_transit_ASC_no_auto,joint_drive_transit_ASC_no_auto,joint_drive_transit_ASC_no_auto,joint_drive_transit_ASC_no_auto,,, +util_Joint_Drive_to_Transit_Auto_deficient,Joint - Drive to Transit - Auto deficient,@(df.is_joint & (df.auto_ownership < df.num_workers) & (df.auto_ownership > 0)),,,,,,,,,,,,,,joint_drive_transit_ASC_auto_deficient,joint_drive_transit_ASC_auto_deficient,joint_drive_transit_ASC_auto_deficient,joint_drive_transit_ASC_auto_deficient,joint_drive_transit_ASC_auto_deficient,,, +util_Joint_Drive_to_Transit_Auto_sufficient,Joint - Drive to Transit - Auto sufficient,@(df.is_joint & (df.auto_ownership >= df.num_workers) & (df.auto_ownership > 0)),,,,,,,,,,,,,,joint_drive_transit_ASC_auto_sufficient,joint_drive_transit_ASC_auto_sufficient,joint_drive_transit_ASC_auto_sufficient,joint_drive_transit_ASC_auto_sufficient,joint_drive_transit_ASC_auto_sufficient,,, +util_Joint_Taxi_Zero_auto,Joint - Taxi - Zero auto,@(df.is_joint & (df.auto_ownership == 0)),,,,,,,,,,,,,,,,,,,joint_taxi_ASC_no_auto,, +util_Joint_Taxi_Auto_deficient,Joint - Taxi - Auto deficient,@(df.is_joint & (df.auto_ownership < df.num_workers) & (df.auto_ownership > 0)),,,,,,,,,,,,,,,,,,,joint_taxi_ASC_auto_deficient,, +util_Joint_Taxi_Auto_sufficient,Joint - Taxi - Auto sufficient,@(df.is_joint & (df.auto_ownership >= df.num_workers) & (df.auto_ownership > 0)),,,,,,,,,,,,,,,,,,,joint_taxi_ASC_auto_sufficient,, +util_Joint_TNC_Single_Zero_auto,Joint - TNC Single - Zero auto,@(df.is_joint & (df.auto_ownership == 0)),,,,,,,,,,,,,,,,,,,,joint_tnc_single_ASC_no_auto, +util_Joint_TNC_Single_Auto_deficient,Joint - TNC Single - Auto deficient,@(df.is_joint & (df.auto_ownership < df.num_workers) & (df.auto_ownership > 0)),,,,,,,,,,,,,,,,,,,,joint_tnc_single_ASC_auto_deficient, +util_Joint_TNC_Single_Auto_sufficient,Joint - TNC Single - Auto sufficient,@(df.is_joint & (df.auto_ownership >= df.num_workers) & (df.auto_ownership > 0)),,,,,,,,,,,,,,,,,,,,joint_tnc_single_ASC_auto_sufficient, +util_Joint_TNC_Shared_Zero_auto,Joint - TNC Shared - Zero auto,@(df.is_joint & (df.auto_ownership == 0)),,,,,,,,,,,,,,,,,,,,,joint_tnc_shared_ASC_no_auto +util_Joint_TNC_Shared_Auto_deficient,Joint - TNC Shared - Auto deficient,@(df.is_joint & (df.auto_ownership < df.num_workers) & (df.auto_ownership > 0)),,,,,,,,,,,,,,,,,,,,,joint_tnc_shared_ASC_auto_deficient +util_Joint_TNC_Shared_Auto_sufficient,Joint - TNC Shared - Auto sufficient,@(df.is_joint & (df.auto_ownership >= df.num_workers) & (df.auto_ownership > 0)),,,,,,,,,,,,,,,,,,,,,joint_tnc_shared_ASC_auto_sufficient +util_Local_bus_ASC,Local bus ASC,1,,,,,,,,,local_bus_ASC,,,,,local_bus_ASC,,,,,,, +util_Walk_to_Light_Rail_ASC,Walk to Light Rail ASC,@(df.walk_ferry_available == False),,,,,,,,,,walk_light_rail_ASC,,,,,,,,,,, +util_Drive_to_Light_Rail_ASC,Drive to Light Rail ASC,@(df.drive_ferry_available == False),,,,,,,,,,,,,,,drive_light_rail_ASC,,,,,, +util_Walk_to_Ferry_ASC,Walk to Ferry ASC,@df.walk_ferry_available,,,,,,,,,,walk_ferry_ASC,,,,,,,,,,, +util_Drive_to_Ferry_ASC,Drive to Ferry ASC,@df.drive_ferry_available,,,,,,,,,,,,,,,drive_ferry_ASC,,,,,, +util_Express_Bus_ASC,Express Bus ASC,1,,,,,,,,,,,express_bus_ASC,,,,,express_bus_ASC,,,,, +util_Heavy_Rail_ASC,Heavy Rail ASC,1,,,,,,,,,,,,heavy_rail_ASC,,,,,heavy_rail_ASC,,,, +util_Commuter_Rail,Commuter Rail,1,,,,,,,,,,,,,commuter_rail_ASC,,,,,commuter_rail_ASC,,, +util_Walk_to_Transit_dest_CBD,Walk to Transit dest CBD,@df.destination_in_cbd,,,,,,,,,walk_transit_CBD_ASC,walk_transit_CBD_ASC,walk_transit_CBD_ASC,walk_transit_CBD_ASC,walk_transit_CBD_ASC,,,,,,,, +util_Drive_to_Transit_dest_CBD,Drive to Transit dest CBD,@df.destination_in_cbd,,,,,,,,,,,,,,drive_transit_CBD_ASC,drive_transit_CBD_ASC,drive_transit_CBD_ASC,drive_transit_CBD_ASC,drive_transit_CBD_ASC,,, +util_Drive_to_Transit_distance_penalty,Drive to Transit - distance penalty,@drvtrn_distpen_0_multiplier * (1-od_skims['DIST']/drvtrn_distpen_max).clip(lower=0),,,,,,,,,,,,,,coef_ivt,coef_ivt,coef_ivt,coef_ivt,coef_ivt,,, +#, FIXME - skims aren't symmetrical,so we have to make sure they can get back,,,,,,,,,,,,,,,,,,,,, +util_Walk_not_available_for_long_distances,Walk not available for long distances,@od_skims.max('DISTWALK') > 3,,,,,,,-999,,,,,,,,,,,,,, +util_Bike_not_available_for_long_distances,Bike not available for long distances,@od_skims.max('DISTBIKE') > 8,,,,,,,,-999,,,,,,,,,,,,, +util_Drive_alone_not_available_for_escort_tours,Drive alone not available for escort tours,is_escort,-999,-999,,,,,,,,,,,,,,,,,,, +#, max(c_densityIndexOrigin*originDensityIndex,originDensityIndexMax),,,,,,,,,1,1,1,1,1,1,1,,,,,, diff --git a/activitysim/examples/example_mtc_extended/configs/tour_mode_choice.yaml b/activitysim/examples/example_mtc_extended/configs/tour_mode_choice.yaml new file mode 100644 index 0000000000..19f5014fcc --- /dev/null +++ b/activitysim/examples/example_mtc_extended/configs/tour_mode_choice.yaml @@ -0,0 +1,198 @@ +# tour_mode_choice.yaml + +SPEC: tour_mode_choice.csv +COEFFICIENTS: tour_mode_choice_coefficients.csv +COEFFICIENT_TEMPLATE: tour_mode_choice_coefficients_template.csv + +LOGIT_TYPE: NL + +NESTS: + name: root + coefficient: coef_nest_root + alternatives: + - name: AUTO + coefficient: coef_nest_AUTO + alternatives: + - name: DRIVEALONE + coefficient: coef_nest_AUTO_DRIVEALONE + alternatives: + - DRIVEALONEFREE + - DRIVEALONEPAY + - name: SHAREDRIDE2 + coefficient: coef_nest_AUTO_SHAREDRIDE2 + alternatives: + - SHARED2FREE + - SHARED2PAY + - name: SHAREDRIDE3 + coefficient: coef_nest_AUTO_SHAREDRIDE3 + alternatives: + - SHARED3FREE + - SHARED3PAY + - name: NONMOTORIZED + coefficient: coef_nest_NONMOTORIZED + alternatives: + - WALK + - BIKE + - name: TRANSIT + coefficient: coef_nest_TRANSIT + alternatives: + - name: WALKACCESS + coefficient: coef_nest_TRANSIT_WALKACCESS + alternatives: + - WALK_LOC + - WALK_LRF + - WALK_EXP + - WALK_HVY + - WALK_COM + - name: DRIVEACCESS + coefficient: coef_nest_TRANSIT_DRIVEACCESS + alternatives: + - DRIVE_LOC + - DRIVE_LRF + - DRIVE_EXP + - DRIVE_HVY + - DRIVE_COM + - name: RIDEHAIL + coefficient: coef_nest_RIDEHAIL + alternatives: + - TAXI + - TNC_SINGLE + - TNC_SHARED + +CONSTANTS: + #valueOfTime: 8.00 + costPerMile: 18.29 + costShareSr2: 1.75 + costShareSr3: 2.50 + waitThresh: 10.00 + walkThresh: 1.50 + shortWalk: 0.333 + longWalk: 0.667 + walkSpeed: 3.00 + bikeThresh: 6.00 + bikeSpeed: 12.00 + maxCbdAreaTypeThresh: 2 + indivTour: 1.00000 + upperEA: 5 + upperAM: 10 + upperMD: 15 + upperPM: 19 + # RIDEHAIL Settings + Taxi_baseFare: 2.20 + Taxi_costPerMile: 2.30 + Taxi_costPerMinute: 0.10 + Taxi_waitTime_mean: + 1: 5.5 + 2: 9.5 + 3: 13.3 + 4: 17.3 + 5: 26.5 + Taxi_waitTime_sd: + 1: 0 + 2: 0 + 3: 0 + 4: 0 + 5: 0 + TNC_single_baseFare: 2.20 + TNC_single_costPerMile: 1.33 + TNC_single_costPerMinute: 0.24 + TNC_single_costMinimum: 7.20 + TNC_single_waitTime_mean: + 1: 3.0 + 2: 6.3 + 3: 8.4 + 4: 8.5 + 5: 10.3 + TNC_single_waitTime_sd: + 1: 0 + 2: 0 + 3: 0 + 4: 0 + 5: 0 + TNC_shared_baseFare: 2.20 + TNC_shared_costPerMile: 0.53 + TNC_shared_costPerMinute: 0.10 + TNC_shared_costMinimum: 3.00 + TNC_shared_IVTFactor: 1.5 + TNC_shared_waitTime_mean: + 1: 5.0 + 2: 8.0 + 3: 11.0 + 4: 15.0 + 5: 15.0 + TNC_shared_waitTime_sd: + 1: 0 + 2: 0 + 3: 0 + 4: 0 + 5: 0 + min_waitTime: 0 + max_waitTime: 50 + + ivt_cost_multiplier: 0.6 + ivt_lrt_multiplier: 0.9 + ivt_ferry_multiplier: 0.8 + ivt_exp_multiplier: 1 + ivt_hvy_multiplier: 0.8 + ivt_com_multiplier: 0.7 + walktimeshort_multiplier: 2 + walktimelong_multiplier: 10 + biketimeshort_multiplier: 4 + biketimelong_multiplier: 20 + short_i_wait_multiplier: 2 + long_i_wait_multiplier: 1 + wacc_multiplier: 2 + wegr_multiplier: 2 + waux_multiplier: 2 + dtim_multiplier: 2 + xwait_multiplier: 2 + dacc_ratio: 0 + xfers_wlk_multiplier: 10 + xfers_drv_multiplier: 20 + drvtrn_distpen_0_multiplier: 270 + drvtrn_distpen_max: 15 + density_index_multiplier: -0.2 +# joint_sr2_ASC_no_auto: 0 +# joint_sr2_ASC_auto_deficient: 0 +# joint_sr2_ASC_auto_sufficient: 0 +# joint_drive_transit_ASC_no_auto: 0 + ridehail_wait_time_multiplier: 1.5 + +# so far, we can use the same spec as for non-joint tours +preprocessor: + SPEC: tour_mode_choice_annotate_choosers_preprocessor + DF: choosers + TABLES: + - land_use + - vehicles + - tours + +nontour_preprocessor: + SPEC: tour_mode_choice_annotate_choosers_preprocessor + DF: choosers + TABLES: + - land_use + +annotate_tours: + SPEC: annotate_tours_tour_mode_choice + DF: choosers + TABLES: + - tours + +# to reduce memory needs filter chooser table to these fields +LOGSUM_CHOOSER_COLUMNS: + - tour_type + - hhsize + - density_index + - age + - age_16_p + - age_16_to_19 + - auto_ownership + - number_of_participants + - tour_category + - num_workers + - value_of_time + - free_parking_at_work + + +MODE_CHOICE_LOGSUM_COLUMN_NAME: mode_choice_logsum diff --git a/activitysim/examples/example_mtc_extended/configs/tour_mode_choice_annotate_choosers_preprocessor.csv b/activitysim/examples/example_mtc_extended/configs/tour_mode_choice_annotate_choosers_preprocessor.csv new file mode 100644 index 0000000000..282a5accb7 --- /dev/null +++ b/activitysim/examples/example_mtc_extended/configs/tour_mode_choice_annotate_choosers_preprocessor.csv @@ -0,0 +1,101 @@ +Description,Target,Expression +#,, +local,_DF_IS_TOUR,'tour_type' in df.columns +,number_of_participants,df.number_of_participants if _DF_IS_TOUR else 1 +,is_joint,(df.tour_category=='joint') if _DF_IS_TOUR else False +#,, + local,_HAVE_PARENT_TOURS,'parent_tour_id' in df.columns +,_parent_tour_mode,"reindex(tours.tour_mode, df.parent_tour_id) if _HAVE_PARENT_TOURS else ''" +,work_tour_is_drive,"_parent_tour_mode.isin(['DRIVEALONEFREE','DRIVEALONEPAY'])" +,work_tour_is_bike,_parent_tour_mode=='BIKE' +,work_tour_is_SOV,"_parent_tour_mode.isin(['DRIVEALONEFREE','DRIVEALONEPAY'])" +#,, +,is_mandatory,(df.tour_category=='mandatory') if 'tour_category' in df.columns else False +,is_joint,(df.tour_category=='joint') if 'tour_category' in df.columns else False +,is_indiv,~is_joint +,is_atwork_subtour,(df.tour_category=='atwork') if 'tour_category' in df.columns else False +,is_escort,(df.tour_type == 'escort') if _DF_IS_TOUR else False +#Auto operating costs,, +,parent_tour_veh,"reindex(tours['selected_vehicle'], df['parent_tour_id']) if 'selected_vehicle' in df.columns else np.nan" +,sov_veh_option,"np.where(is_atwork_subtour, parent_tour_veh, df.get('vehicle_occup_1', np.nan))" +,sr2_veh_option,"np.where(is_atwork_subtour, parent_tour_veh, df.get('vehicle_occup_2', np.nan))" +,sr3p_veh_option,"np.where(is_atwork_subtour, parent_tour_veh, df.get('vehicle_occup_3.5', np.nan))" +,sov_auto_op_cost,"reindex(vehicles.groupby('vehicle_type')['auto_operating_cost'].mean(), pd.Series(sov_veh_option, df.index)) if 'vehicle_occup_1' in df.columns else np.nan" +,sov_auto_op_cost,"np.where(sov_auto_op_cost.isna() | (pd.Series(sov_veh_option, df.index) == 'non_hh_veh'), costPerMile, sov_auto_op_cost)" +,sr2_auto_op_cost,"reindex(vehicles.groupby('vehicle_type')['auto_operating_cost'].mean(), pd.Series(sr2_veh_option, df.index)) if 'vehicle_occup_2' in df.columns else np.nan" +,sr2_auto_op_cost,"np.where(sr2_auto_op_cost.isna() | (pd.Series(sr2_veh_option, df.index) == 'non_hh_veh'), costPerMile, sr2_auto_op_cost)" +,sr3p_auto_op_cost,"reindex(vehicles.groupby('vehicle_type')['auto_operating_cost'].mean(), pd.Series(sr3p_veh_option, df.index)) if 'vehicle_occup_3.5' in df.columns else np.nan" +,sr3p_auto_op_cost,"np.where(sr3p_auto_op_cost.isna() | (pd.Series(sr3p_veh_option, df.index) == 'non_hh_veh'), costPerMile, sr3p_auto_op_cost)" +# FIXME why inverse of value of time? need better name?,, +#,c_cost,(0.60 * c_ivt) / df.value_of_time +# ivot * (c_ivt_cost_multiplier * c_ivt) +,ivot,1.0 / df.value_of_time +#,, +,dest_topology,"reindex(land_use.TOPOLOGY, df[dest_col_name])" +,terminal_time,"reindex(land_use.TERMINAL, df[dest_col_name])" +,dest_density_index,"reindex(land_use.density_index, df[dest_col_name])" +# FIXME no transit subzones for ONE_ZONE version so all zones short walk to transit,, +,_origin_distance_to_transit,"reindex(land_use.access_dist_transit, df[orig_col_name]) if 'access_dist_transit' in land_use else shortWalk" +,_destination_distance_to_transit,"reindex(land_use.access_dist_transit, df[dest_col_name]) if 'access_dist_transit' in land_use else shortWalk" +,walk_transit_available,(_origin_distance_to_transit > 0) & (_destination_distance_to_transit > 0) +,drive_transit_available,(_destination_distance_to_transit > 0) & (df.auto_ownership > 0) +,origin_walk_time,_origin_distance_to_transit*60/walkSpeed +,destination_walk_time,_destination_distance_to_transit*60/walkSpeed +# RIDEHAIL,, +,origin_density_measure,"(reindex(land_use.TOTPOP, df[orig_col_name]) + reindex(land_use.TOTEMP, df[orig_col_name])) / (reindex(land_use.TOTACRE, df[orig_col_name]) / 640)" +,dest_density_measure,"(reindex(land_use.TOTPOP, df[dest_col_name]) + reindex(land_use.TOTEMP, df[dest_col_name])) / (reindex(land_use.TOTACRE, df[dest_col_name]) / 640)" +,origin_density,"pd.cut(origin_density_measure, bins=[-np.inf, 500, 2000, 5000, 15000, np.inf], labels=[5, 4, 3, 2, 1]).astype(int)" +,dest_density,"pd.cut(dest_density_measure, bins=[-np.inf, 500, 2000, 5000, 15000, np.inf], labels=[5, 4, 3, 2, 1]).astype(int)" +,origin_zone_taxi_wait_time_mean,"origin_density.map({k: v for k, v in Taxi_waitTime_mean.items()})" +,origin_zone_taxi_wait_time_sd,"origin_density.map({k: v for k, v in Taxi_waitTime_sd.items()})" +,dest_zone_taxi_wait_time_mean,"dest_density.map({k: v for k, v in Taxi_waitTime_mean.items()})" +,dest_zone_taxi_wait_time_sd,"dest_density.map({k: v for k, v in Taxi_waitTime_sd.items()})" +# ,, Note that the mean and standard deviation are not the values for the distribution itself but of the underlying normal distribution it is derived from +,origTaxiWaitTime,"rng.lognormal_for_df(df, mu=origin_zone_taxi_wait_time_mean, sigma=origin_zone_taxi_wait_time_sd, broadcast=True, scale=True).clip(min_waitTime, max_waitTime)" +,destTaxiWaitTime,"rng.lognormal_for_df(df, mu=dest_zone_taxi_wait_time_mean, sigma=dest_zone_taxi_wait_time_sd, broadcast=True, scale=True).clip(min_waitTime, max_waitTime)" +,origin_zone_singleTNC_wait_time_mean,"origin_density.map({k: v for k, v in TNC_single_waitTime_mean.items()})" +,origin_zone_singleTNC_wait_time_sd,"origin_density.map({k: v for k, v in TNC_single_waitTime_sd.items()})" +,dest_zone_singleTNC_wait_time_mean,"dest_density.map({k: v for k, v in TNC_single_waitTime_mean.items()})" +,dest_zone_singleTNC_wait_time_sd,"dest_density.map({k: v for k, v in TNC_single_waitTime_sd.items()})" +,origSingleTNCWaitTime,"rng.lognormal_for_df(df, mu=origin_zone_singleTNC_wait_time_mean, sigma=origin_zone_singleTNC_wait_time_sd, broadcast=True, scale=True).clip(min_waitTime, max_waitTime)" +,destSingleTNCWaitTime,"rng.lognormal_for_df(df, mu=dest_zone_singleTNC_wait_time_mean, sigma=dest_zone_singleTNC_wait_time_sd, broadcast=True, scale=True).clip(min_waitTime, max_waitTime)" +,origin_zone_sharedTNC_wait_time_mean,"origin_density.map({k: v for k, v in TNC_shared_waitTime_mean.items()})" +,origin_zone_sharedTNC_wait_time_sd,"origin_density.map({k: v for k, v in TNC_shared_waitTime_sd.items()})" +,dest_zone_sharedTNC_wait_time_mean,"dest_density.map({k: v for k, v in TNC_shared_waitTime_mean.items()})" +,dest_zone_sharedTNC_wait_time_sd,"dest_density.map({k: v for k, v in TNC_shared_waitTime_sd.items()})" +,origSharedTNCWaitTime,"rng.lognormal_for_df(df, mu=origin_zone_sharedTNC_wait_time_mean, sigma=origin_zone_sharedTNC_wait_time_sd, broadcast=True, scale=True).clip(min_waitTime, max_waitTime)" +,destSharedTNCWaitTime,"rng.lognormal_for_df(df, mu=dest_zone_sharedTNC_wait_time_mean, sigma=dest_zone_sharedTNC_wait_time_sd, broadcast=True, scale=True).clip(min_waitTime, max_waitTime)" +,totalWaitTaxi,origTaxiWaitTime + destTaxiWaitTime +,totalWaitSingleTNC,origSingleTNCWaitTime + destSingleTNCWaitTime +,totalWaitSharedTNC,origSharedTNCWaitTime + destSharedTNCWaitTime +#,, +,_free_parking_available,(df.tour_type == 'work') & df.free_parking_at_work if _DF_IS_TOUR else False +,_dest_hourly_peak_parking_cost,"reindex(land_use.PRKCST, df[dest_col_name])" +,_dest_hourly_offpeak_parking_cost,"reindex(land_use.OPRKCST, df[dest_col_name])" +,_hourly_peak_parking_cost,"np.where(_free_parking_available, 0, _dest_hourly_peak_parking_cost)" +,_hourly_offpeak_parking_cost,"np.where(_free_parking_available, 0, _dest_hourly_offpeak_parking_cost)" +,daily_parking_cost,"np.where(is_mandatory, _hourly_peak_parking_cost * df.duration, _hourly_offpeak_parking_cost * df.duration)" +#,, +,distance,od_skims['DIST'] +,sov_available,(odt_skims['SOV_TIME']>0) & (dot_skims['SOV_TIME']>0) +,sovtoll_available,(odt_skims['SOVTOLL_VTOLL']>0) | (dot_skims['SOVTOLL_VTOLL']>0) +,hov2_available,(odt_skims['HOV2_TIME'] + dot_skims['HOV2_TIME'])>0 +,hov2toll_available,(odt_skims['HOV2TOLL_VTOLL'] + dot_skims['HOV2TOLL_VTOLL'])>0 +,hov3_available,(odt_skims['HOV3_TIME']>0) & (dot_skims['HOV3_TIME']>0) +,hov3toll_available,(odt_skims['HOV3TOLL_VTOLL'] + dot_skims['HOV3TOLL_VTOLL'])>0 +,walk_local_available,walk_transit_available & (odt_skims['WLK_LOC_WLK_TOTIVT']/100>0) & (dot_skims['WLK_LOC_WLK_TOTIVT']/100>0) +,walk_commuter_available,walk_transit_available & (odt_skims['WLK_COM_WLK_TOTIVT']/100>0) & (dot_skims['WLK_COM_WLK_TOTIVT']/100>0) & ((odt_skims['WLK_COM_WLK_KEYIVT']/100 + dot_skims['WLK_COM_WLK_KEYIVT']/100)>0) +,walk_express_available,walk_transit_available & (odt_skims['WLK_EXP_WLK_TOTIVT']/100>0) & (dot_skims['WLK_EXP_WLK_TOTIVT']/100>0) & ((odt_skims['WLK_EXP_WLK_KEYIVT']/100 + dot_skims['WLK_EXP_WLK_KEYIVT']/100)>0) +,walk_heavyrail_available,walk_transit_available & (odt_skims['WLK_HVY_WLK_TOTIVT']/100>0) & (dot_skims['WLK_HVY_WLK_TOTIVT']/100>0) & ((odt_skims['WLK_HVY_WLK_KEYIVT']/100 + dot_skims['WLK_HVY_WLK_KEYIVT']/100)>0) +,walk_lrf_available,walk_transit_available & (odt_skims['WLK_LRF_WLK_TOTIVT']/100>0) & (dot_skims['WLK_LRF_WLK_TOTIVT']/100>0) & ((odt_skims['WLK_LRF_WLK_KEYIVT']/100 + dot_skims['WLK_LRF_WLK_KEYIVT']/100)>0) +,walk_ferry_available,walk_lrf_available & ((odt_skims['WLK_LRF_WLK_FERRYIVT']/100 + dot_skims['WLK_LRF_WLK_FERRYIVT']/100)>0) +,drive_local_available,drive_transit_available & (odt_skims['DRV_LOC_WLK_TOTIVT']/100>0) & (dot_skims['WLK_LOC_DRV_TOTIVT']/100>0) +,drive_commuter_available,drive_transit_available & (odt_skims['DRV_COM_WLK_TOTIVT']/100>0) & (dot_skims['WLK_COM_DRV_TOTIVT']/100>0) & ((odt_skims['DRV_COM_WLK_KEYIVT']/100 + dot_skims['WLK_COM_DRV_KEYIVT']/100)>0) +,drive_express_available,drive_transit_available & (odt_skims['DRV_EXP_WLK_TOTIVT']/100>0) & (dot_skims['WLK_EXP_DRV_TOTIVT']/100>0) & ((odt_skims['DRV_EXP_WLK_KEYIVT']/100 + dot_skims['WLK_EXP_DRV_KEYIVT']/100)>0) +,drive_heavyrail_available,drive_transit_available & (odt_skims['DRV_HVY_WLK_TOTIVT']/100>0) & (dot_skims['WLK_HVY_DRV_TOTIVT']/100>0) & ((odt_skims['DRV_HVY_WLK_KEYIVT']/100 + dot_skims['WLK_HVY_DRV_KEYIVT']/100)>0) +,drive_lrf_available,drive_transit_available & (odt_skims['DRV_LRF_WLK_TOTIVT']/100>0) & (dot_skims['WLK_LRF_DRV_TOTIVT']/100>0) & ((odt_skims['DRV_LRF_WLK_KEYIVT']/100 + dot_skims['WLK_LRF_DRV_KEYIVT']/100)>0) +,drive_ferry_available,drive_lrf_available & ((odt_skims['DRV_LRF_WLK_FERRYIVT']/100 + dot_skims['WLK_LRF_WLK_FERRYIVT']/100)>0) +#,, +destination in central business district,destination_in_cbd,"(reindex(land_use.area_type, df[dest_col_name]) < setting('cbd_threshold')) * 1" +#,,FIXME diagnostic +#,sov_dist_rt,(odt_skims['SOV_DIST'] + dot_skims['SOV_DIST']) diff --git a/activitysim/examples/example_mtc_extended/configs/trip_mode_choice.csv b/activitysim/examples/example_mtc_extended/configs/trip_mode_choice.csv new file mode 100644 index 0000000000..0253954dbb --- /dev/null +++ b/activitysim/examples/example_mtc_extended/configs/trip_mode_choice.csv @@ -0,0 +1,405 @@ +Label,Description,Expression,DRIVEALONEFREE,DRIVEALONEPAY,SHARED2FREE,SHARED2PAY,SHARED3FREE,SHARED3PAY,WALK,BIKE,WALK_LOC,WALK_LRF,WALK_EXP,WALK_HVY,WALK_COM,DRIVE_LOC,DRIVE_LRF,DRIVE_EXP,DRIVE_HVY,DRIVE_COM,TAXI,TNC_SINGLE,TNC_SHARED +#,Drive alone no toll,,,,,,,,,,,,,,,,,,,,,, +util_DRIVEALONEFREE_Unavailable,DRIVEALONEFREE - Unavailable,sov_available == False,-999,,,,,,,,,,,,,,,,,,,, +util_DRIVEALONEFREE_Unavailable_for_zero_auto_households,DRIVEALONEFREE - Unavailable for zero auto households,auto_ownership == 0,-999,,,,,,,,,,,,,,,,,,,, +util_DRIVEALONEFREE_Unavailable_for_persons_less_than_16,DRIVEALONEFREE - Unavailable for persons less than 16,age < 16,-999,,,,,,,,,,,,,,,,,,,, +util_DRIVEALONEFREE_Unavailable_for_joint_tours,DRIVEALONEFREE - Unavailable for joint tours,is_joint == True,-999,,,,,,,,,,,,,,,,,,,, +util_DRIVEALONEFREE_Unavailable_if_didn't_drive_to_work,DRIVEALONEFREE - Unavailable if didn't drive to work,is_atwork_subtour & ~work_tour_is_SOV,-999,,,,,,,,,,,,,,,,,,,, +util_DRIVEALONEFREE_In_vehicle_time,DRIVEALONEFREE - In-vehicle time,@odt_skims['SOV_TIME'],coef_ivt,,,,,,,,,,,,,,,,,,,, +util_DRIVEALONEFREE_Terminal_time,DRIVEALONEFREE - Terminal time,@coef_walktimeshort_multiplier * df.total_terminal_time,coef_ivt,,,,,,,,,,,,,,,,,,,, +util_DRIVEALONEFREE_Operating_cost,DRIVEALONEFREE - Operating cost,@ivt_cost_multiplier * df.ivot * df.auto_op_cost * odt_skims['SOV_DIST'],coef_ivt,,,,,,,,,,,,,,,,,,,, +util_DRIVEALONEFREE_Parking_cost,DRIVEALONEFREE - Parking cost,@ivt_cost_multiplier * df.ivot * df.total_parking_cost,coef_ivt,,,,,,,,,,,,,,,,,,,, +util_DRIVEALONEFREE_Bridge_toll,DRIVEALONEFREE - Bridge toll,@ivt_cost_multiplier * df.ivot * odt_skims['SOV_BTOLL'],coef_ivt,,,,,,,,,,,,,,,,,,,, +util_DRIVEALONEFREE_Person_is_between_16_and_19_years_old,DRIVEALONEFREE - Person is between 16 and 19 years old,@(df.age >= 16) & (df.age <= 19),coef_age1619_da,,,,,,,,,,,,,,,,,,,, +#,Drive alone toll,,,,,,,,,,,,,,,,,,,,,, +util_DRIVEALONEPAY_Unavailable,DRIVEALONEPAY - Unavailable,sovtoll_available == False,,-999,,,,,,,,,,,,,,,,,,, +util_DRIVEALONEPAY_Unavailable_for_zero_auto_households,DRIVEALONEPAY - Unavailable for zero auto households,auto_ownership == 0,,-999,,,,,,,,,,,,,,,,,,, +util_DRIVEALONEPAY_Unavailable_for_persons_less_than_16,DRIVEALONEPAY - Unavailable for persons less than 16,age < 16,,-999,,,,,,,,,,,,,,,,,,, +util_DRIVEALONEPAY_Unavailable_for_joint_tours,DRIVEALONEPAY - Unavailable for joint tours,is_joint == True,,-999,,,,,,,,,,,,,,,,,,, +util_DRIVEALONEPAY_Unavailable_if_didn't_drive_to_work,DRIVEALONEPAY - Unavailable if didn't drive to work,is_atwork_subtour & ~work_tour_is_SOV,,-999,,,,,,,,,,,,,,,,,,, +util_DRIVEALONEPAY_In_vehicle_time,DRIVEALONEPAY - In-vehicle time,@odt_skims['SOVTOLL_TIME'],,coef_ivt,,,,,,,,,,,,,,,,,,, +util_DRIVEALONEPAY_Terminal_time,DRIVEALONEPAY - Terminal time,@coef_walktimeshort_multiplier * df.total_terminal_time,,coef_ivt,,,,,,,,,,,,,,,,,,, +util_DRIVEALONEPAY_Operating_cost,DRIVEALONEPAY - Operating cost,@ivt_cost_multiplier * df.ivot * df.auto_op_cost * odt_skims['SOVTOLL_DIST'],,coef_ivt,,,,,,,,,,,,,,,,,,, +util_DRIVEALONEPAY_Parking_cost,DRIVEALONEPAY - Parking cost,@ivt_cost_multiplier * df.ivot * df.total_parking_cost,,coef_ivt,,,,,,,,,,,,,,,,,,, +util_DRIVEALONEPAY_Bridge_toll,DRIVEALONEPAY - Bridge toll,@ivt_cost_multiplier * df.ivot * odt_skims['SOVTOLL_BTOLL'],,coef_ivt,,,,,,,,,,,,,,,,,,, +util_DRIVEALONEPAY_Value_toll,DRIVEALONEPAY - Value toll,@ivt_cost_multiplier * df.ivot * odt_skims['SOVTOLL_VTOLL'],,coef_ivt,,,,,,,,,,,,,,,,,,, +util_DRIVEALONEPAY_Person_is_between_16_and_19_years_old,DRIVEALONEPAY - Person is between 16 and 19 years old,@(df.age >= 16) & (df.age <= 19),,coef_age1619_da,,,,,,,,,,,,,,,,,,, +#,Shared ride 2,,,,,,,,,,,,,,,,,,,,,, +util_SHARED2FREE_Unavailable,SHARED2FREE - Unavailable,hov2_available == False,,,-999,,,,,,,,,,,,,,,,,, +util_SHARED2FREE_Unavailable_based_on_party_size,SHARED2FREE - Unavailable based on party size,is_joint & (number_of_participants > 2),,,-999,,,,,,,,,,,,,,,,,, +util_SHARED2FREE_In_vehicle_time,SHARED2FREE - In-vehicle time,@odt_skims['HOV2_TIME'],,,coef_ivt,,,,,,,,,,,,,,,,,, +util_SHARED2FREE_Terminal_time,SHARED2FREE - Terminal time,@coef_walktimeshort_multiplier * df.total_terminal_time,,,coef_ivt,,,,,,,,,,,,,,,,,, +util_SHARED2FREE_Operating_cost,SHARED2FREE - Operating cost,@ivt_cost_multiplier * df.ivot * df.auto_op_cost * odt_skims['HOV2_DIST'],,,coef_ivt,,,,,,,,,,,,,,,,,, +util_SHARED2FREE_Parking_cost,SHARED2FREE - Parking cost,@ivt_cost_multiplier * df.ivot * df.total_parking_cost / costShareSr2,,,coef_ivt,,,,,,,,,,,,,,,,,, +util_SHARED2FREE_Bridge_toll,SHARED2FREE - Bridge toll,@ivt_cost_multiplier * df.ivot * odt_skims['HOV2_BTOLL'] / costShareSr2,,,coef_ivt,,,,,,,,,,,,,,,,,, +util_SHARED2FREE_One_person_household,SHARED2FREE - One person household,@(df.hhsize == 1),,,coef_hhsize1_sr,,,,,,,,,,,,,,,,,, +util_SHARED2FREE_Two_person_household,SHARED2FREE - Two person household,@(df.hhsize == 2),,,coef_hhsize2_sr,,,,,,,,,,,,,,,,,, +util_SHARED2FREE_Person_is_16_years_old_or_older,SHARED2FREE - Person is 16 years old or older,@(df.age >= 16),,,coef_age16p_sr,,,,,,,,,,,,,,,,,, +#,Shared ride 2 toll,,,,,,,,,,,,,,,,,,,,,, +util_SHARED2PAY_Unavailable,SHARED2PAY - Unavailable,hov2toll_available == False,,,,-999,,,,,,,,,,,,,,,,, +util_SHARED2PAY_Unavailable_based_on_party_size,SHARED2PAY - Unavailable based on party size,is_joint & (number_of_participants > 2),,,,-999,,,,,,,,,,,,,,,,, +util_SHARED2PAY_In_vehicle_time,SHARED2PAY - In-vehicle time,@odt_skims['HOV2TOLL_TIME'],,,,coef_ivt,,,,,,,,,,,,,,,,, +util_SHARED2PAY_Terminal_time,SHARED2PAY - Terminal time,@coef_walktimeshort_multiplier * df.total_terminal_time,,,,coef_ivt,,,,,,,,,,,,,,,,, +util_SHARED2PAY_Operating_cost,SHARED2PAY - Operating cost,@ivt_cost_multiplier * df.ivot * df.auto_op_cost * odt_skims['HOV2TOLL_DIST'],,,,coef_ivt,,,,,,,,,,,,,,,,, +util_SHARED2PAY_Parking_cost,SHARED2PAY - Parking cost,@ivt_cost_multiplier * df.ivot * df.total_parking_cost / costShareSr2,,,,coef_ivt,,,,,,,,,,,,,,,,, +util_SHARED2PAY_Bridge_toll,SHARED2PAY - Bridge toll,@ivt_cost_multiplier * df.ivot * odt_skims['HOV2TOLL_BTOLL'] / costShareSr2,,,,coef_ivt,,,,,,,,,,,,,,,,, +util_SHARED2PAY_Value_toll,SHARED2PAY - Value toll,@ivt_cost_multiplier * df.ivot * odt_skims['HOV2TOLL_VTOLL'] / costShareSr2,,,,coef_ivt,,,,,,,,,,,,,,,,, +util_SHARED2PAY_One_person_household,SHARED2PAY - One person household,@(df.hhsize == 1),,,,coef_hhsize1_sr,,,,,,,,,,,,,,,,, +util_SHARED2PAY_Two_person_household,SHARED2PAY - Two person household,@(df.hhsize == 2),,,,coef_hhsize2_sr,,,,,,,,,,,,,,,,, +util_SHARED2PAY_Person_is_16_years_old_or_older,SHARED2PAY - Person is 16 years old or older,@(df.age >= 16),,,,coef_age16p_sr,,,,,,,,,,,,,,,,, +#,Shared ride 3+,,,,,,,,,,,,,,,,,,,,,, +util_SHARED3FREE_Unavailable,SHARED3FREE - Unavailable,hov3_available == False,,,,,-999,,,,,,,,,,,,,,,, +util_SHARED3FREE_In_vehicle_time,SHARED3FREE - In-vehicle time,@odt_skims['HOV3_TIME'],,,,,coef_ivt,,,,,,,,,,,,,,,, +util_SHARED3FREE_Terminal_time,SHARED3FREE - Terminal time,@coef_walktimeshort_multiplier * df.total_terminal_time,,,,,coef_ivt,,,,,,,,,,,,,,,, +util_SHARED3FREE_Operating_cost,SHARED3FREE - Operating cost,@ivt_cost_multiplier * df.ivot * df.auto_op_cost * odt_skims['HOV3_DIST'],,,,,coef_ivt,,,,,,,,,,,,,,,, +util_SHARED3FREE_Parking_cost,SHARED3FREE - Parking cost,@ivt_cost_multiplier * df.ivot * df.total_parking_cost / costShareSr3,,,,,coef_ivt,,,,,,,,,,,,,,,, +util_SHARED3FREE_Bridge_toll,SHARED3FREE - Bridge toll,@ivt_cost_multiplier * df.ivot * odt_skims['HOV3_BTOLL'] / costShareSr3,,,,,coef_ivt,,,,,,,,,,,,,,,, +util_SHARED3FREE_One_person_household,SHARED3FREE - One person household,@(df.hhsize == 1),,,,,coef_hhsize1_sr,,,,,,,,,,,,,,,, +util_SHARED3FREE_Two_person_household,SHARED3FREE - Two person household,@(df.hhsize == 2),,,,,coef_hhsize2_sr,,,,,,,,,,,,,,,, +util_SHARED3FREE_Person_is_16_years_old_or_older,SHARED3FREE - Person is 16 years old or older,@(df.age >= 16),,,,,coef_age16p_sr,,,,,,,,,,,,,,,, +#,Shared ride 3+ toll,,,,,,,,,,,,,,,,,,,,,, +util_SHARED3PAY_Unavailable,SHARED3PAY - Unavailable,hov3toll_available == False,,,,,,-999,,,,,,,,,,,,,,, +util_SHARED3PAY_In_vehicle_time,SHARED3PAY - In-vehicle time,@odt_skims['HOV3TOLL_TIME'],,,,,,coef_ivt,,,,,,,,,,,,,,, +util_SHARED3PAY_Terminal_time,SHARED3PAY - Terminal time,@coef_walktimeshort_multiplier * df.total_terminal_time,,,,,,coef_ivt,,,,,,,,,,,,,,, +util_SHARED3PAY_Operating_cost,SHARED3PAY - Operating cost,@ivt_cost_multiplier * df.ivot * df.auto_op_cost * odt_skims['HOV3TOLL_DIST'],,,,,,coef_ivt,,,,,,,,,,,,,,, +util_SHARED3PAY_Parking_cost,SHARED3PAY - Parking cost,@ivt_cost_multiplier * df.ivot * df.total_parking_cost / costShareSr3,,,,,,coef_ivt,,,,,,,,,,,,,,, +util_SHARED3PAY_Bridge_toll,SHARED3PAY - Bridge toll,@ivt_cost_multiplier * df.ivot * odt_skims['HOV3TOLL_BTOLL'] / costShareSr3,,,,,,coef_ivt,,,,,,,,,,,,,,, +util_SHARED3PAY_Value_toll,SHARED3PAY - Value toll,@ivt_cost_multiplier * df.ivot * odt_skims['HOV3TOLL_VTOLL'] / costShareSr3,,,,,,coef_ivt,,,,,,,,,,,,,,, +util_SHARED3PAY_One_person_household,SHARED3PAY - One person household,@(df.hhsize == 1),,,,,,coef_hhsize1_sr,,,,,,,,,,,,,,, +util_SHARED3PAY_Two_person_household,SHARED3PAY - Two person household,@(df.hhsize == 2),,,,,,coef_hhsize2_sr,,,,,,,,,,,,,,, +util_SHARED3PAY_Person_is_16_years_old_or_older,SHARED3PAY - Person is 16 years old or older,@(df.age >= 16),,,,,,coef_age16p_sr,,,,,,,,,,,,,,, +#,Walk,,,,,,,,,,,,,,,,,,,,,, +util_WALK_Time_up_to_2_miles,WALK - Time up to 2 miles,@coef_walktimeshort_multiplier * od_skims['DISTWALK'].clip(upper=walkThresh) * 60/walkSpeed,,,,,,,coef_ivt,,,,,,,,,,,,,, +util_WALK_Time_beyond_2_of_a_miles,WALK - Time beyond 2 of a miles,@walktimelong_multiplier * (od_skims['DISTWALK'] - walkThresh).clip(lower=0) * 60/walkSpeed,,,,,,,coef_ivt,,,,,,,,,,,,,, +util_WALK_Destination_zone_densityIndex,WALK - Destination zone densityIndex,@density_index_multiplier * df.density_index,,,,,,,coef_ivt,,,,,,,,,,,,,, +util_WALK_Topology,WALK - Topology,@topology_walk_multiplier * df.trip_topology,,,,,,,coef_ivt,,,,,,,,,,,,,, +#,Bike,,,,,,,,,,,,,,,,,,,,,, +util_BIKE_Unavailable_if_didn't_bike_to_work,BIKE - Unavailable if didn't bike to work,is_atwork_subtour & ~work_tour_is_bike,,,,,,,,-999,,,,,,,,,,,,, +util_BIKE_Time_up_to_6_miles,BIKE - Time up to 6 miles,@coef_biketimeshort_multiplier * od_skims['DISTBIKE'].clip(upper=bikeThresh)*60/bikeSpeed,,,,,,,,coef_ivt,,,,,,,,,,,,, +util_BIKE_Time_beyond_6_of_a_miles,BIKE - Time beyond 6 of a miles,@coef_biketimeshort_multiplier * biketimelong_multiplier * (od_skims['DISTBIKE']-bikeThresh).clip(lower=0)*60/bikeSpeed,,,,,,,,coef_ivt,,,,,,,,,,,,, +util_BIKE_Destination_zone_densityIndex,BIKE - Destination zone densityIndex,@density_index_multiplier*df.density_index,,,,,,,,coef_ivt,,,,,,,,,,,,, +util_BIKE_Topology,BIKE - Topology,@topology_bike_multiplier * df.trip_topology,,,,,,,,coef_ivt,,,,,,,,,,,,, +#,Walk to Local,,,,,,,,,,,,,,,,,,,,,, +util_WALK_LOC_Unavailable,WALK_LOC - Unavailable,walk_local_available == False,,,,,,,,,-999,,,,,,,,,,,, +util_WALK_LOC_In_vehicle_time,WALK_LOC - In-vehicle time,@odt_skims['WLK_LOC_WLK_TOTIVT']/100,,,,,,,,,coef_ivt,,,,,,,,,,,, +util_WALK_LOC_Short_iwait_time,WALK_LOC - Short iwait time,@coef_short_iwait_multiplier * (odt_skims['WLK_LOC_WLK_IWAIT']/100).clip(upper=waitThresh),,,,,,,,,coef_ivt,,,,,,,,,,,, +util_WALK_LOC_Long_iwait_time,WALK_LOC - Long iwait time,@coef_long_iwait_multiplier * (odt_skims['WLK_LOC_WLK_IWAIT']/100-waitThresh).clip(0),,,,,,,,,coef_ivt,,,,,,,,,,,, +util_WALK_LOC_transfer_wait_time,WALK_LOC - transfer wait time,@coef_xwait_multiplier * odt_skims['WLK_LOC_WLK_XWAIT']/100,,,,,,,,,coef_ivt,,,,,,,,,,,, +util_WALK_LOC_number_of_transfers,WALK_LOC - number of transfers,@xfers_wlk_multiplier * (odt_skims['WLK_LOC_WLK_BOARDS']-1).clip(0),,,,,,,,,coef_ivt,,,,,,,,,,,, +util_WALK_LOC_Walk_access_time,WALK_LOC - Walk access time,@coef_wacc_multiplier * df.origin_walk_time,,,,,,,,,coef_ivt,,,,,,,,,,,, +util_WALK_LOC_Walk_egress_time,WALK_LOC - Walk egress time,@coef_wegr_multiplier * df.destination_walk_time,,,,,,,,,coef_ivt,,,,,,,,,,,, +util_WALK_LOC_Walk_other_time,WALK_LOC - Walk other time,@coef_waux_multiplier * odt_skims['WLK_LOC_WLK_WAUX']/100,,,,,,,,,coef_ivt,,,,,,,,,,,, +util_WALK_LOC_Fare,WALK_LOC - Fare,@ivt_cost_multiplier * df.ivot * odt_skims['WLK_LOC_WLK_FAR'],,,,,,,,,coef_ivt,,,,,,,,,,,, +util_WALK_LOC_Destination_zone_densityIndex,WALK_LOC - Destination zone densityIndex,@density_index_multiplier * df.density_index,,,,,,,,,coef_ivt,,,,,,,,,,,, +util_WALK_LOC_Topology,WALK_LOC - Topology,@topology_trn_multiplier * df.trip_topology,,,,,,,,,coef_ivt,,,,,,,,,,,, +util_WALK_LOC_Person_is_less_than_10_years_old,WALK_LOC - Person is less than 10 years old,@(df.age <= 10),,,,,,,,,coef_age010_trn,,,,,,,,,,,, +#,Walk to Light rail/Ferry,,,,,,,,,,,,,,,,,,,,,, +util_WALK_LRF_Unavailable,WALK_LRF - Unavailable,walk_lrf_available == False,,,,,,,,,,-999,,,,,,,,,,, +util_WALK_LRF_In_vehicle_time,WALK_LRF - In-vehicle time,@odt_skims['WLK_LRF_WLK_TOTIVT']/100,,,,,,,,,,coef_ivt,,,,,,,,,,, +util_WALK_LRF_In_vehicle_time_on_Light_Rail,WALK_LRF - In-vehicle time on Light Rail (incremental w/ ivt),@(coef_ivt_lrt_multiplier-1) * odt_skims['WLK_LRF_WLK_KEYIVT']/100,,,,,,,,,,coef_ivt,,,,,,,,,,, +util_WALK_LRF_In_vehicle_time_on_Ferry,WALK_LRF - In-vehicle time on Ferry (incremental w/keyivt),@(coef_ivt_ferry_multiplier-coef_ivt_lrt_multiplier) * odt_skims['WLK_LRF_WLK_FERRYIVT']/100,,,,,,,,,,coef_ivt,,,,,,,,,,, +util_WALK_LRF_Short_iwait_time,WALK_LRF - Short iwait time,@coef_short_iwait_multiplier * (odt_skims['WLK_LRF_WLK_IWAIT']/100).clip(upper=waitThresh),,,,,,,,,,coef_ivt,,,,,,,,,,, +util_WALK_LRF_Long_iwait_time,WALK_LRF - Long iwait time,@coef_long_iwait_multiplier * (odt_skims['WLK_LRF_WLK_IWAIT']/100-waitThresh).clip(0),,,,,,,,,,coef_ivt,,,,,,,,,,, +util_WALK_LRF_transfer_wait_time,WALK_LRF - transfer wait time,@coef_xwait_multiplier * odt_skims['WLK_LRF_WLK_XWAIT']/100,,,,,,,,,,coef_ivt,,,,,,,,,,, +util_WALK_LRF_number_of_transfers,WALK_LRF - number of transfers,@xfers_wlk_multiplier * (odt_skims['WLK_LRF_WLK_BOARDS']-1).clip(0),,,,,,,,,,coef_ivt,,,,,,,,,,, +util_WALK_LRF_Walk_access_time,WALK_LRF - Walk access time,@coef_wacc_multiplier * df.origin_walk_time,,,,,,,,,,coef_ivt,,,,,,,,,,, +util_WALK_LRF_Walk_egress_time,WALK_LRF - Walk egress time,@coef_wegr_multiplier * df.destination_walk_time,,,,,,,,,,coef_ivt,,,,,,,,,,, +util_WALK_LRF_Walk_other_time,WALK_LRF - Walk otherLight rail/Ferry time,@coef_waux_multiplier * odt_skims['WLK_LRF_WLK_WAUX']/100,,,,,,,,,,coef_ivt,,,,,,,,,,, +util_WALK_LRF_Fare,WALK_LRF - Fare,@ivt_cost_multiplier * df.ivot * odt_skims['WLK_LRF_WLK_FAR'],,,,,,,,,,coef_ivt,,,,,,,,,,, +util_WALK_LRF_Destination_zone_densityIndex,WALK_LRF - Destination zone densityIndex,@density_index_multiplier * df.density_index,,,,,,,,,,coef_ivt,,,,,,,,,,, +util_WALK_LRF_Topology,WALK_LRF - Topology,@topology_trn_multiplier * df.trip_topology,,,,,,,,,,coef_ivt,,,,,,,,,,, +util_WALK_LRF_Person_is_less_than_10_years_old,WALK_LRF - Person is less than 10 years old,@(df.age <= 10),,,,,,,,,,coef_age010_trn,,,,,,,,,,, +#,Walk to Express bus,,,,,,,,,,,,,,,,,,,,,, +util_WALK_EXP_Unavailable,WALK_EXP - Unavailable,walk_express_available == False,,,,,,,,,,,-999,,,,,,,,,, +util_WALK_EXP_In_vehicle_time,WALK_EXP - In-vehicle time,@odt_skims['WLK_EXP_WLK_TOTIVT']/100,,,,,,,,,,,coef_ivt,,,,,,,,,, +util_WALK_EXP_In_vehicle_time_on_Express_bus,WALK_EXP - In-vehicle time on Express bus (incremental w/ ivt),@(ivt_exp_multiplier - 1) * odt_skims['WLK_EXP_WLK_KEYIVT']/100,,,,,,,,,,,coef_ivt,,,,,,,,,, +util_WALK_EXP_Short_iwait_time,WALK_EXP - Short iwait time,@coef_short_iwait_multiplier * (odt_skims['WLK_EXP_WLK_IWAIT']/100).clip(upper=waitThresh),,,,,,,,,,,coef_ivt,,,,,,,,,, +util_WALK_EXP_Long_iwait_time,WALK_EXP - Long iwait time,@coef_long_iwait_multiplier * (odt_skims['WLK_EXP_WLK_IWAIT']/100-waitThresh).clip(0),,,,,,,,,,,coef_ivt,,,,,,,,,, +util_WALK_EXP_transfer_wait_time,WALK_EXP - transfer wait time,@coef_xwait_multiplier * odt_skims['WLK_EXP_WLK_XWAIT']/100,,,,,,,,,,,coef_ivt,,,,,,,,,, +util_WALK_EXP_number_of_transfers,WALK_EXP - number of transfers,@xfers_wlk_multiplier * (odt_skims['WLK_EXP_WLK_BOARDS']-1).clip(0),,,,,,,,,,,coef_ivt,,,,,,,,,, +util_WALK_EXP_Walk_access_time,WALK_EXP - Walk access time,@coef_wacc_multiplier * df.origin_walk_time,,,,,,,,,,,coef_ivt,,,,,,,,,, +util_WALK_EXP_Walk_egress_time,WALK_EXP - Walk egress time,@coef_wegr_multiplier * df.destination_walk_time,,,,,,,,,,,coef_ivt,,,,,,,,,, +util_WALK_EXP_Walk_other_time,WALK_EXP - Walk other time,@coef_waux_multiplier * odt_skims['WLK_EXP_WLK_WAUX']/100,,,,,,,,,,,coef_ivt,,,,,,,,,, +util_WALK_EXP_Fare,WALK_EXP - Fare,@ivt_cost_multiplier * df.ivot * odt_skims['WLK_EXP_WLK_FAR'],,,,,,,,,,,coef_ivt,,,,,,,,,, +util_WALK_EXP_Destination_zone_densityIndex,WALK_EXP - Destination zone densityIndex,@density_index_multiplier * df.density_index,,,,,,,,,,,coef_ivt,,,,,,,,,, +util_WALK_EXP_Topology,WALK_EXP - Topology,@topology_trn_multiplier * df.trip_topology,,,,,,,,,,,coef_ivt,,,,,,,,,, +util_WALK_EXP_Person_is_less_than_10_years_old,WALK_EXP - Person is less than 10 years old,@(df.age <= 10),,,,,,,,,,,coef_age010_trn,,,,,,,,,, +#,Walk to Heavy Rail,,,,,,,,,,,,,,,,,,,,,, +util_WALK_HVY_Unavailable,WALK_HVY - Unavailable,walk_heavyrail_available == False,,,,,,,,,,,,-999,,,,,,,,, +util_WALK_HVY_In_vehicle_time,WALK_HVY - In-vehicle time,@odt_skims['WLK_HVY_WLK_TOTIVT']/100,,,,,,,,,,,,coef_ivt,,,,,,,,, +util_WALK_HVY_In_vehicle_time_on_heavy_rail,WALK_HVY - In-vehicle time on heavy rail (incremental w/ ivt),@(ivt_hvy_multiplier-1) * odt_skims['WLK_HVY_WLK_KEYIVT']/100,,,,,,,,,,,,coef_ivt,,,,,,,,, +util_WALK_HVY_Short_iwait_time,WALK_HVY - Short iwait time,@coef_short_iwait_multiplier * (odt_skims['WLK_HVY_WLK_IWAIT']/100).clip(upper=waitThresh),,,,,,,,,,,,coef_ivt,,,,,,,,, +util_WALK_HVY_Long_iwait_time,WALK_HVY - Long iwait time,@coef_long_iwait_multiplier * (odt_skims['WLK_HVY_WLK_IWAIT']/100-waitThresh).clip(0),,,,,,,,,,,,coef_ivt,,,,,,,,, +util_WALK_HVY_transfer_wait_time,WALK_HVY - transfer wait time,@coef_xwait_multiplier * odt_skims['WLK_HVY_WLK_XWAIT']/100,,,,,,,,,,,,coef_ivt,,,,,,,,, +util_WALK_HVY_number_of_transfers,WALK_HVY - number of transfers,@xfers_wlk_multiplier * (odt_skims['WLK_HVY_WLK_BOARDS']-1).clip(0),,,,,,,,,,,,coef_ivt,,,,,,,,, +util_WALK_HVY_Walk_access_time,WALK_HVY - Walk access time,@coef_wacc_multiplier * df.origin_walk_time,,,,,,,,,,,,coef_ivt,,,,,,,,, +util_WALK_HVY_Walk_egress_time,WALK_HVY - Walk egress time,@coef_wegr_multiplier * df.destination_walk_time,,,,,,,,,,,,coef_ivt,,,,,,,,, +util_WALK_HVY_Walk_other_time,WALK_HVY - Walk other time,@coef_waux_multiplier * odt_skims['WLK_HVY_WLK_WAUX']/100,,,,,,,,,,,,coef_ivt,,,,,,,,, +util_WALK_HVY_Fare,WALK_HVY - Fare,@ivt_cost_multiplier * df.ivot * odt_skims['WLK_HVY_WLK_FAR'],,,,,,,,,,,,coef_ivt,,,,,,,,, +util_WALK_HVY_Destination_zone_densityIndex,WALK_HVY - Destination zone densityIndex,@density_index_multiplier * df.density_index,,,,,,,,,,,,coef_ivt,,,,,,,,, +util_WALK_HVY_Topology,WALK_HVY - Topology,@topology_trn_multiplier * df.trip_topology,,,,,,,,,,,,coef_ivt,,,,,,,,, +util_WALK_HVY_Person_is_less_than_10_years_old,WALK_HVY - Person is less than 10 years old,@(df.age <= 10),,,,,,,,,,,,coef_age010_trn,,,,,,,,, +#,Walk to Commuter rail,,,,,,,,,,,,,,,,,,,,,, +util_WALK_COM_Unavailable,WALK_COM - Unavailable,walk_commuter_available == False,,,,,,,,,,,,,-999,,,,,,,, +util_WALK_COM_In_vehicle_time,WALK_COM - In-vehicle time,@odt_skims['WLK_COM_WLK_TOTIVT']/100,,,,,,,,,,,,,coef_ivt,,,,,,,, +util_WALK_COM_In_vehicle_time_on_commuter_rail,WALK_COM - In-vehicle time on commuter rail (incremental w/ ivt),@(ivt_com_multiplier - 1) * odt_skims['WLK_COM_WLK_KEYIVT']/100,,,,,,,,,,,,,coef_ivt,,,,,,,, +util_WALK_COM_Short_iwait_time,WALK_COM - Short iwait time,@coef_short_iwait_multiplier * (odt_skims['WLK_COM_WLK_IWAIT']/100).clip(upper=waitThresh),,,,,,,,,,,,,coef_ivt,,,,,,,, +util_WALK_COM_Long_iwait_time,WALK_COM - Long iwait time,@coef_long_iwait_multiplier * (odt_skims['WLK_COM_WLK_IWAIT']/100-waitThresh).clip(0),,,,,,,,,,,,,coef_ivt,,,,,,,, +util_WALK_COM_transfer_wait_time,WALK_COM - transfer wait time,@coef_xwait_multiplier * odt_skims['WLK_COM_WLK_XWAIT']/100,,,,,,,,,,,,,coef_ivt,,,,,,,, +util_WALK_COM_number_of_transfers,WALK_COM - number of transfers,@xfers_wlk_multiplier * (odt_skims['WLK_COM_WLK_BOARDS']-1).clip(0),,,,,,,,,,,,,coef_ivt,,,,,,,, +util_WALK_COM_Walk_access_time,WALK_COM - Walk access time,@coef_wacc_multiplier * df.origin_walk_time,,,,,,,,,,,,,coef_ivt,,,,,,,, +util_WALK_COM_Walk_egress_time,WALK_COM - Walk egress time,@coef_wegr_multiplier * df.destination_walk_time,,,,,,,,,,,,,coef_ivt,,,,,,,, +util_WALK_COM_Walk_other_time,WALK_COM - Walk other time,@coef_waux_multiplier * odt_skims['WLK_COM_WLK_WAUX']/100,,,,,,,,,,,,,coef_ivt,,,,,,,, +util_WALK_COM_Fare,WALK_COM - Fare,@ivt_cost_multiplier * df.ivot * odt_skims['WLK_COM_WLK_FAR'],,,,,,,,,,,,,coef_ivt,,,,,,,, +util_WALK_COM_Destination_zone_densityIndex,WALK_COM - Destination zone densityIndex,@density_index_multiplier * df.density_index,,,,,,,,,,,,,coef_ivt,,,,,,,, +util_WALK_COM_Topology,WALK_COM - Topology,@topology_trn_multiplier * df.trip_topology,,,,,,,,,,,,,coef_ivt,,,,,,,, +util_WALK_COM_Person_is_less_than_10_years_old,WALK_COM - Person is less than 10 years old,@(df.age < 10),,,,,,,,,,,,,coef_age010_trn,,,,,,,, +#,Drive to Local,,,,,,,,,,,,,,,,,,,,,, +util_DRIVE_LOC_Unavailable_for_zero_auto_households,DRIVE_LOC - Unavailable for zero auto households,auto_ownership == 0,,,,,,,,,,,,,,-999,,,,,,, +util_DRIVE_LOC_Unavailable_for_persons_less_than_16,DRIVE_LOC - Unavailable for persons less than 16,age < 16,,,,,,,,,,,,,,-999,,,,,,, +util_DRIVE_LOC_Destination_zone_densityIndex,DRIVE_LOC - Destination zone densityIndex,@density_index_multiplier * df.density_index,,,,,,,,,,,,,,coef_ivt,,,,,,, +util_DRIVE_LOC_Topology,DRIVE_LOC - Topology,@topology_trn_multiplier * df.trip_topology,,,,,,,,,,,,,,coef_ivt,,,,,,, +util_DRIVE_LOC_Person_is_less_than_10_years_old,DRIVE_LOC - Person is less than 10 years old,@(df.age < 10),,,,,,,,,,,,,,coef_age010_trn,,,,,,, +util_DRIVE_LOC_outbound_Unavailable,DRIVE_LOC outbound - Unavailable,outbound & ~drive_local_available_outbound,,,,,,,,,,,,,,-999,,,,,,, +util_DRIVE_LOC_outbound_In_vehicle_time,DRIVE_LOC outbound - In-vehicle time,@df.outbound * odt_skims['DRV_LOC_WLK_TOTIVT']/100,,,,,,,,,,,,,,coef_ivt,,,,,,, +util_DRIVE_LOC_outbound_Short_iwait_time,DRIVE_LOC outbound - Short iwait time,@df.outbound * coef_short_iwait_multiplier * (odt_skims['DRV_LOC_WLK_IWAIT']/100).clip(upper=waitThresh),,,,,,,,,,,,,,coef_ivt,,,,,,, +util_DRIVE_LOC_outbound_Long_iwait_time,DRIVE_LOC outbound - Long iwait time,@df.outbound * coef_long_iwait_multiplier * (odt_skims['DRV_LOC_WLK_IWAIT']/100-waitThresh).clip(0),,,,,,,,,,,,,,coef_ivt,,,,,,, +util_DRIVE_LOC_outbound_transfer_wait_time,DRIVE_LOC outbound - transfer wait time,@df.outbound * coef_xwait_multiplier * odt_skims['DRV_LOC_WLK_XWAIT']/100,,,,,,,,,,,,,,coef_ivt,,,,,,, +util_DRIVE_LOC_outbound_number_of_transfers,DRIVE_LOC outbound - number of transfers,@df.outbound * xfers_wlk_multiplier * (odt_skims['DRV_LOC_WLK_BOARDS']-1).clip(0),,,,,,,,,,,,,,coef_ivt,,,,,,, +util_DRIVE_LOC_outbound_Drive_time,DRIVE_LOC outbound - Drive time,@df.outbound * coef_dtim_multiplier * odt_skims['DRV_LOC_WLK_DTIM']/100,,,,,,,,,,,,,,coef_ivt,,,,,,, +util_DRIVE_LOC_outbound_Walk_egress_time,DRIVE_LOC outbound - Walk egress time,@df.outbound * coef_wegr_multiplier * df.destination_walk_time,,,,,,,,,,,,,,coef_ivt,,,,,,, +util_DRIVE_LOC_outbound_Walk_other_time,DRIVE_LOC outbound - Walk other time,@df.outbound * coef_waux_multiplier * odt_skims['DRV_LOC_WLK_WAUX']/100,,,,,,,,,,,,,,coef_ivt,,,,,,, +util_DRIVE_LOC_outbound_Fare_and_operating_cost,DRIVE_LOC outbound - Fare and operating cost,@df.outbound * ivt_cost_multiplier * df.ivot * (odt_skims['DRV_LOC_WLK_FAR'] + df.auto_op_cost*odt_skims['DRV_LOC_WLK_DDIST']/100),,,,,,,,,,,,,,coef_ivt,,,,,,, +util_DRIVE_LOC_outbound_Ratio_of_drive_access_distance_to_OD_distance,DRIVE_LOC outbound - Ratio of drive access distance to OD distance,@df.outbound * dacc_ratio_multiplier * (odt_skims['DRV_LOC_WLK_DDIST']/100)/ (od_skims['DIST']),,,,,,,,,,,,,,1,,,,,,, +util_DRIVE_LOC_inbound_Unavailable,DRIVE_LOC inbound - Unavailable,inbound & ~drive_local_available_inbound,,,,,,,,,,,,,,-999,,,,,,, +util_DRIVE_LOC_inbound_In_vehicle_time,DRIVE_LOC inbound - In-vehicle time,@df.inbound * odt_skims['WLK_LOC_DRV_TOTIVT']/100,,,,,,,,,,,,,,coef_ivt,,,,,,, +util_DRIVE_LOC_inbound_Short_iwait_time,DRIVE_LOC inbound - Short iwait time,@df.inbound * coef_short_iwait_multiplier * (odt_skims['WLK_LOC_DRV_IWAIT']/100).clip(upper=waitThresh),,,,,,,,,,,,,,coef_ivt,,,,,,, +util_DRIVE_LOC_inbound_Long_iwait_time,DRIVE_LOC inbound - Long iwait time,@df.inbound * coef_long_iwait_multiplier * (odt_skims['WLK_LOC_DRV_IWAIT']/100-waitThresh).clip(0),,,,,,,,,,,,,,coef_ivt,,,,,,, +util_DRIVE_LOC_inbound_transfer_wait_time,DRIVE_LOC inbound - transfer wait time,@df.inbound * coef_xwait_multiplier * odt_skims['WLK_LOC_DRV_XWAIT']/100,,,,,,,,,,,,,,coef_ivt,,,,,,, +util_DRIVE_LOC_inbound_number_of_transfers,DRIVE_LOC inbound - number of transfers,@df.inbound * xfers_wlk_multiplier * (odt_skims['WLK_LOC_DRV_BOARDS']-1).clip(0),,,,,,,,,,,,,,coef_ivt,,,,,,, +util_DRIVE_LOC_inbound_Drive_time,DRIVE_LOC inbound - Drive time,@df.inbound * coef_dtim_multiplier * odt_skims['WLK_LOC_DRV_DTIM']/100,,,,,,,,,,,,,,coef_ivt,,,,,,, +util_DRIVE_LOC_inbound_Walk_access_time,DRIVE_LOC inbound - Walk access time,@df.inbound * coef_wacc_multiplier * df.origin_walk_time,,,,,,,,,,,,,,coef_ivt,,,,,,, +util_DRIVE_LOC_inbound_Walk_other_time,DRIVE_LOC inbound - Walk other time,@df.inbound * coef_waux_multiplier * odt_skims['WLK_LOC_DRV_WAUX']/100,,,,,,,,,,,,,,coef_ivt,,,,,,, +util_DRIVE_LOC_inbound_Fare_and_operating_cost,DRIVE_LOC inbound - Fare and operating cost,@df.inbound * ivt_cost_multiplier * df.ivot * (odt_skims['WLK_LOC_DRV_FAR'] + df.auto_op_cost*odt_skims['WLK_LOC_DRV_DDIST']/100),,,,,,,,,,,,,,coef_ivt,,,,,,, +util_DRIVE_LOC_inbound_Ratio_of_drive_access_distance_to_OD_distance,DRIVE_LOC inbound - Ratio of drive access distance to OD distance,@df.outbound * dacc_ratio_multiplier * (odt_skims['WLK_LOC_DRV_DDIST']/100)/ (od_skims['DIST']),,,,,,,,,,,,,,1,,,,,,, +#,Drive to Light Rail/Ferry,,,,,,,,,,,,,,,,,,,,,, +util_DRIVE_LRF_Unavailable_for_zero_auto_households,DRIVE_LRF - Unavailable for zero auto households,auto_ownership == 0,,,,,,,,,,,,,,,-999,,,,,, +util_DRIVE_LRF_Unavailable_for_persons_less_than_16,DRIVE_LRF - Unavailable for persons less than 16,age < 16,,,,,,,,,,,,,,,-999,,,,,, +util_DRIVE_LRF_Destination_zone_densityIndex,DRIVE_LRF - Destination zone densityIndex,@density_index_multiplier * df.density_index,,,,,,,,,,,,,,,coef_ivt,,,,,, +util_DRIVE_LRF_Topology,DRIVE_LRF - Topology,@topology_trn_multiplier * df.trip_topology,,,,,,,,,,,,,,,coef_ivt,,,,,, +util_DRIVE_LRF_Person_is_less_than_10_years_old,DRIVE_LRF - Person is less than 10 years old,@(df.age < 10),,,,,,,,,,,,,,,coef_age010_trn,,,,,, +util_DRIVE_LRF_outbound_Unavailable,DRIVE_LRF outbound - Unavailable,outbound & ~drive_lrf_available_outbound,,,,,,,,,,,,,,,-999,,,,,, +util_DRIVE_LRF_outbound_In_vehicle_time,DRIVE_LRF outbound - In-vehicle time,@df.outbound * odt_skims['DRV_LRF_WLK_TOTIVT']/100,,,,,,,,,,,,,,,coef_ivt,,,,,, +util_DRIVE_LRF_outbound_In_vehicle_time_on_LR,DRIVE_LRF outbound - In-vehicle time on Light Rail (incremental w/ ivt),@df.outbound * (coef_ivt_lrt_multiplier - 1)*odt_skims['DRV_LRF_WLK_KEYIVT']/100,,,,,,,,,,,,,,,coef_ivt,,,,,, +util_DRIVE_LRF_outbound_In_vehicle_time_on_Ferry,DRIVE_LRF outbound - In-vehicle time on Ferry (incremental w/ keyivt),@df.outbound * (coef_ivt_ferry_multiplier-coef_ivt_lrt_multiplier)*odt_skims['DRV_LRF_WLK_FERRYIVT']/100,,,,,,,,,,,,,,,coef_ivt,,,,,, +util_DRIVE_LRF_outbound_Short_iwait_time,DRIVE_LRF outbound - Short iwait time,@df.outbound * coef_short_iwait_multiplier * (odt_skims['DRV_LRF_WLK_IWAIT']/100).clip(upper=waitThresh),,,,,,,,,,,,,,,coef_ivt,,,,,, +util_DRIVE_LRF_outbound_Long_iwait_time,DRIVE_LRF outbound - Long iwait time,@df.outbound * coef_long_iwait_multiplier * (odt_skims['DRV_LRF_WLK_IWAIT']/100-waitThresh).clip(0),,,,,,,,,,,,,,,coef_ivt,,,,,, +util_DRIVE_LRF_outbound_transfer_wait_time,DRIVE_LRF outbound - transfer wait time,@df.outbound * coef_xwait_multiplier * odt_skims['DRV_LRF_WLK_XWAIT']/100,,,,,,,,,,,,,,,coef_ivt,,,,,, +util_DRIVE_LRF_outbound_number_of_transfers,DRIVE_LRF outbound - number of transfers,@df.outbound * xfers_drv_multiplier * (odt_skims['DRV_LRF_WLK_BOARDS']-1).clip(0),,,,,,,,,,,,,,,coef_ivt,,,,,, +util_DRIVE_LRF_outbound_Drive_time,DRIVE_LRF outbound - Drive time,@df.outbound * coef_dtim_multiplier * odt_skims['DRV_LRF_WLK_DTIM']/100,,,,,,,,,,,,,,,coef_ivt,,,,,, +util_DRIVE_LRF_outbound_Walk_egress_time,DRIVE_LRF outbound - Walk egress time,@df.outbound * coef_wegr_multiplier * df.destination_walk_time,,,,,,,,,,,,,,,coef_ivt,,,,,, +util_DRIVE_LRF_outbound_Walk_other_time,DRIVE_LRF outbound - Walk other time,@df.outbound * coef_waux_multiplier * odt_skims['DRV_LRF_WLK_WAUX']/100,,,,,,,,,,,,,,,coef_ivt,,,,,, +util_DRIVE_LRF_outbound_Fare_and_operating_cost,DRIVE_LRF outbound - Fare and operating cost,@df.outbound * ivt_cost_multiplier * df.ivot * (odt_skims['DRV_LRF_WLK_FAR'] + df.auto_op_cost * odt_skims['DRV_LRF_WLK_DDIST']/100),,,,,,,,,,,,,,,coef_ivt,,,,,, +util_DRIVE_LRF_outbound_Ratio_of_drive_access_distance_to_OD_distance,DRIVE_LRF outbound - Ratio of drive access distance to OD distance,@df.outbound * dacc_ratio_multiplier * (odt_skims['DRV_LRF_WLK_DDIST']/100) / od_skims['DIST'],,,,,,,,,,,,,,,1,,,,,, +util_DRIVE_LRF_inbound_Unavailable,DRIVE_LRF inbound - Unavailable,inbound & ~drive_lrf_available_inbound,,,,,,,,,,,,,,,-999,,,,,, +util_DRIVE_LRF_inbound_In_vehicle_time,DRIVE_LRF inbound - In-vehicle time,@df.inbound * odt_skims['WLK_LRF_DRV_TOTIVT']/100,,,,,,,,,,,,,,,coef_ivt,,,,,, +util_DRIVE_LRF_inbound_In_vehicle_time_on_LR,DRIVE_LRF inbound - In-vehicle time on Light Rail (incremental w/ ivt),@df.inbound * (coef_ivt_lrt_multiplier - 1)*odt_skims['WLK_LRF_DRV_KEYIVT']/100,,,,,,,,,,,,,,,coef_ivt,,,,,, +util_DRIVE_LRF_inbound_In_vehicle_time_on_Ferry,DRIVE_LRF inbound - In-vehicle time on Ferry (incremental w/ keyivt),@df.inbound * (coef_ivt_ferry_multiplier-coef_ivt_lrt_multiplier)*odt_skims['WLK_LRF_DRV_FERRYIVT']/100,,,,,,,,,,,,,,,coef_ivt,,,,,, +util_DRIVE_LRF_inbound_Short_iwait_time,DRIVE_LRF inbound - Short iwait time,@df.inbound * coef_short_iwait_multiplier * (odt_skims['WLK_LRF_DRV_IWAIT']/100).clip(upper=waitThresh),,,,,,,,,,,,,,,coef_ivt,,,,,, +util_DRIVE_LRF_inbound_Long_iwait_time,DRIVE_LRF inbound - Long iwait time,@df.inbound * coef_long_iwait_multiplier * (odt_skims['WLK_LRF_DRV_IWAIT']/100-waitThresh).clip(0),,,,,,,,,,,,,,,coef_ivt,,,,,, +util_DRIVE_LRF_inbound_transfer_wait_time,DRIVE_LRF inbound - transfer wait time,@df.inbound * coef_xwait_multiplier * odt_skims['WLK_LRF_DRV_XWAIT']/100,,,,,,,,,,,,,,,coef_ivt,,,,,, +util_DRIVE_LRF_inbound_number_of_transfers,DRIVE_LRF inbound - number of transfers,@df.inbound * xfers_drv_multiplier * (odt_skims['WLK_LRF_DRV_BOARDS']-1).clip(0),,,,,,,,,,,,,,,coef_ivt,,,,,, +util_DRIVE_LRF_inbound_Drive_time,DRIVE_LRF inbound - Drive time,@df.inbound * coef_dtim_multiplier * odt_skims['WLK_LRF_DRV_DTIM']/100,,,,,,,,,,,,,,,coef_ivt,,,,,, +util_DRIVE_LRF_inbound_Walk_access_time,DRIVE_LRF inbound - Walk access time,@df.inbound * coef_wacc_multiplier * df.origin_walk_time,,,,,,,,,,,,,,,coef_ivt,,,,,, +util_DRIVE_LRF_inbound_Walk_other_time,DRIVE_LRF inbound - Walk other time,@df.inbound * coef_waux_multiplier * odt_skims['WLK_LRF_DRV_WAUX']/100,,,,,,,,,,,,,,,coef_ivt,,,,,, +util_DRIVE_LRF_inbound_Fare_and_operating_cost,DRIVE_LRF inbound - Fare and operating cost,@df.inbound * ivt_cost_multiplier * df.ivot * (odt_skims['WLK_LRF_DRV_FAR'] + df.auto_op_cost * odt_skims['WLK_LRF_DRV_DDIST']/100),,,,,,,,,,,,,,,coef_ivt,,,,,, +util_DRIVE_LRF_inbound_Ratio_of_drive_access_distance_to_OD_distance,DRIVE_LRF inbound - Ratio of drive access distance to OD distance,@df.inbound * dacc_ratio_multiplier * (odt_skims['WLK_LRF_DRV_DDIST']/100)/ od_skims['DIST'],,,,,,,,,,,,,,,1,,,,,, +#,Drive to Express bus,,,,,,,,,,,,,,,,,,,,,, +util_DRIVE_EXP_Unavailable_for_zero_auto_households,DRIVE_EXP - Unavailable for zero auto households,auto_ownership == 0,,,,,,,,,,,,,,,,-999,,,,, +util_DRIVE_EXP_Unavailable_for_persons_less_than_16,DRIVE_EXP - Unavailable for persons less than 16,age < 16,,,,,,,,,,,,,,,,-999,,,,, +util_DRIVE_EXP_Destination_zone_densityIndex,DRIVE_EXP - Destination zone densityIndex,@density_index_multiplier * df.density_index,,,,,,,,,,,,,,,,coef_ivt,,,,, +util_DRIVE_EXP_Topology,DRIVE_EXP - Topology,@topology_trn_multiplier * df.trip_topology,,,,,,,,,,,,,,,,coef_ivt,,,,, +util_DRIVE_EXP_Person_is_less_than_10_years_old,DRIVE_EXP - Person is less than 10 years old,@(df.age < 10),,,,,,,,,,,,,,,,coef_age010_trn,,,,, +util_DRIVE_EXP_outbound_Unavailable,DRIVE_EXP outbound - Unavailable,outbound & ~drive_express_available_outbound,,,,,,,,,,,,,,,,-999,,,,, +util_DRIVE_EXP_outbound_In_vehicle_time,DRIVE_EXP outbound - In-vehicle time,@df.outbound * odt_skims['DRV_EXP_WLK_TOTIVT']/100,,,,,,,,,,,,,,,,coef_ivt,,,,, +util_DRIVE_EXP_outbound_In_vehicle_time_on_EXP,DRIVE_EXP outbound - In-vehicle time on Express bus (incremental w/ ivt),@df.outbound * (ivt_exp_multiplier - 1) * odt_skims['DRV_EXP_WLK_KEYIVT']/100,,,,,,,,,,,,,,,,coef_ivt,,,,, +util_DRIVE_EXP_outbound_Short_iwait_time,DRIVE_EXP outbound - Short iwait time,@df.outbound * coef_short_iwait_multiplier * (odt_skims['DRV_EXP_WLK_IWAIT']/100).clip(upper=waitThresh),,,,,,,,,,,,,,,,coef_ivt,,,,, +util_DRIVE_EXP_outbound_Long_iwait_time,DRIVE_EXP outbound - Long iwait time,@df.outbound * coef_long_iwait_multiplier * (odt_skims['DRV_EXP_WLK_IWAIT']/100-waitThresh).clip(0),,,,,,,,,,,,,,,,coef_ivt,,,,, +util_DRIVE_EXP_outbound_transfer_wait_time,DRIVE_EXP outbound - transfer wait time,@df.outbound * coef_xwait_multiplier * odt_skims['DRV_EXP_WLK_XWAIT']/100,,,,,,,,,,,,,,,,coef_ivt,,,,, +util_DRIVE_EXP_outbound_number_of_transfers,DRIVE_EXP outbound - number of transfers,@df.outbound * xfers_drv_multiplier * (odt_skims['DRV_EXP_WLK_BOARDS']-1).clip(0),,,,,,,,,,,,,,,,coef_ivt,,,,, +util_DRIVE_EXP_outbound_Drive_time,DRIVE_EXP outbound - Drive time,@df.outbound * coef_dtim_multiplier * odt_skims['DRV_EXP_WLK_DTIM']/100,,,,,,,,,,,,,,,,coef_ivt,,,,, +util_DRIVE_EXP_outbound_Walk_egress_time,DRIVE_EXP outbound - Walk egress ime,@df.outbound * coef_wegr_multiplier * df.destination_walk_time,,,,,,,,,,,,,,,,coef_ivt,,,,, +util_DRIVE_EXP_outbound_Walk_other_time,DRIVE_EXP outbound - Walk other time,@df.outbound * coef_waux_multiplier * odt_skims['DRV_EXP_WLK_WAUX']/100,,,,,,,,,,,,,,,,coef_ivt,,,,, +util_DRIVE_EXP_outbound_Fare_and_operating_cost,DRIVE_EXP outbound - Fare and operating cost,@df.outbound * ivt_cost_multiplier * df.ivot * (odt_skims['DRV_EXP_WLK_FAR'] + df.auto_op_cost * odt_skims['DRV_EXP_WLK_DDIST']/100),,,,,,,,,,,,,,,,coef_ivt,,,,, +util_DRIVE_EXP_outbound_Ratio_of_drive_access_distance_to_OD_distance,DRIVE_EXP outbound - Ratio of drive access distance to OD distance,@df.outbound * dacc_ratio_multiplier * (odt_skims['DRV_EXP_WLK_DDIST']/100) / od_skims['DIST'],,,,,,,,,,,,,,,,coef_ivt,,,,, +util_DRIVE_EXP_inbound_Unavailable,DRIVE_EXP inbound - Unavailable,inbound & ~drive_express_available_inbound,,,,,,,,,,,,,,,,-999,,,,, +util_DRIVE_EXP_inbound_In_vehicle_time,DRIVE_EXP inbound - In-vehicle time,@df.inbound * odt_skims['WLK_EXP_DRV_TOTIVT']/100,,,,,,,,,,,,,,,,coef_ivt,,,,, +util_DRIVE_EXP_inbound_In_vehicle_time_on_EXP,DRIVE_EXP inbound - In-vehicle time on Express bus (incremental w/ ivt),@df.inbound * (ivt_exp_multiplier - 1) * odt_skims['WLK_EXP_DRV_KEYIVT']/100,,,,,,,,,,,,,,,,coef_ivt,,,,, +util_DRIVE_EXP_inbound_Short_iwait_time,DRIVE_EXP inbound - Short iwait time,@df.inbound * coef_short_iwait_multiplier * (odt_skims['WLK_EXP_DRV_IWAIT']/100).clip(upper=waitThresh),,,,,,,,,,,,,,,,coef_ivt,,,,, +util_DRIVE_EXP_inbound_Long_iwait_time,DRIVE_EXP inbound - Long iwait time,@df.inbound * coef_long_iwait_multiplier * (odt_skims['WLK_EXP_DRV_IWAIT']/100-waitThresh).clip(0),,,,,,,,,,,,,,,,coef_ivt,,,,, +util_DRIVE_EXP_inbound_transfer_wait_time,DRIVE_EXP inbound - transfer wait time,@df.inbound * coef_xwait_multiplier * odt_skims['WLK_EXP_DRV_XWAIT']/100,,,,,,,,,,,,,,,,coef_ivt,,,,, +util_DRIVE_EXP_inbound_number_of_transfers,DRIVE_EXP inbound - number of transfers,@df.inbound * xfers_drv_multiplier * (odt_skims['WLK_EXP_DRV_BOARDS']-1).clip(0),,,,,,,,,,,,,,,,coef_ivt,,,,, +util_DRIVE_EXP_inbound_Drive_time,DRIVE_EXP inbound - Drive time,@df.inbound * coef_dtim_multiplier * odt_skims['WLK_EXP_DRV_DTIM']/100,,,,,,,,,,,,,,,,coef_ivt,,,,, +util_DRIVE_EXP_inbound_Walk_access_time,DRIVE_EXP inbound - Walk access time,@df.inbound * coef_wacc_multiplier * df.origin_walk_time,,,,,,,,,,,,,,,,coef_ivt,,,,, +util_DRIVE_EXP_inbound_Walk_other_time,DRIVE_EXP inbound - Walk other time,@df.inbound * coef_waux_multiplier * odt_skims['WLK_EXP_DRV_WAUX']/100,,,,,,,,,,,,,,,,coef_ivt,,,,, +util_DRIVE_EXP_inbound_Fare_and_operating_cost,DRIVE_EXP inbound - Fare and operating cost,@df.inbound * ivt_cost_multiplier * df.ivot * (odt_skims['WLK_EXP_DRV_FAR'] + df.auto_op_cost * odt_skims['WLK_EXP_DRV_DDIST']/100),,,,,,,,,,,,,,,,coef_ivt,,,,, +util_DRIVE_EXP_inbound_Ratio_of_drive_access_distance_to_OD_distance,DRIVE_EXP inbound - Ratio of drive access distance to OD distance,@df.inbound * dacc_ratio_multiplier * (odt_skims['WLK_EXP_DRV_DDIST']/100) / od_skims['DIST'],,,,,,,,,,,,,,,,1,,,,, +#,Drive to Heavy Rail,,,,,,,,,,,,,,,,,,,,,, +util_DRIVE_HVY_Unavailable_for_zero_auto_households,DRIVE_HVY - Unavailable for zero auto households,auto_ownership == 0,,,,,,,,,,,,,,,,,-999,,,, +util_DRIVE_HVY_Unavailable_for_persons_less_than_16,DRIVE_HVY - Unavailable for persons less than 16,age < 16,,,,,,,,,,,,,,,,,-999,,,, +util_DRIVE_HVY_Destination_zone_densityIndex,DRIVE_HVY - Destination zone densityIndex,@density_index_multiplier * df.density_index,,,,,,,,,,,,,,,,,coef_ivt,,,, +util_DRIVE_HVY_Topology,DRIVE_HVY - Topology,@topology_trn_multiplier * df.trip_topology,,,,,,,,,,,,,,,,,coef_ivt,,,, +util_DRIVE_HVY_Person_is_less_than_10_years_old,DRIVE_HVY - Person is less than 10 years old,@(df.age < 10),,,,,,,,,,,,,,,,,coef_age010_trn,,,, +util_DRIVE_HVY_outbound_Unavailable,DRIVE_HVY outbound - Unavailable,outbound & ~drive_heavyrail_available_outbound,,,,,,,,,,,,,,,,,-999,,,, +util_DRIVE_HVY_outbound_In_vehicle_time,DRIVE_HVY outbound - In-vehicle time,@df.outbound * odt_skims['DRV_HVY_WLK_TOTIVT']/100,,,,,,,,,,,,,,,,,coef_ivt,,,, +util_DRIVE_HVY_outbound_In_vehicle_time_on_HVY,DRIVE_HVY outbound - In-vehicle time on heavy rail (incremental w/ ivt),@df.outbound * (ivt_hvy_multiplier - 1) * odt_skims['DRV_HVY_WLK_KEYIVT']/100,,,,,,,,,,,,,,,,,coef_ivt,,,, +util_DRIVE_HVY_outbound_Short_iwait_time,DRIVE_HVY outbound - Short iwait time,@df.outbound * coef_short_iwait_multiplier * (odt_skims['DRV_HVY_WLK_IWAIT']/100).clip(upper=waitThresh),,,,,,,,,,,,,,,,,coef_ivt,,,, +util_DRIVE_HVY_outbound_Long_iwait_time,DRIVE_HVY outbound - Long iwait time,@df.outbound * coef_long_iwait_multiplier * (odt_skims['DRV_HVY_WLK_IWAIT']/100-waitThresh).clip(0),,,,,,,,,,,,,,,,,coef_ivt,,,, +util_DRIVE_HVY_outbound_transfer_wait_time,DRIVE_HVY outbound - transfer wait time,@df.outbound * coef_xwait_multiplier * odt_skims['DRV_HVY_WLK_XWAIT']/100,,,,,,,,,,,,,,,,,coef_ivt,,,, +util_DRIVE_HVY_outbound_number_of_transfers,DRIVE_HVY outbound - number of transfers,@df.outbound * xfers_drv_multiplier * (odt_skims['DRV_HVY_WLK_BOARDS']-1).clip(0),,,,,,,,,,,,,,,,,coef_ivt,,,, +util_DRIVE_HVY_outbound_Drive_time,DRIVE_HVY outbound - Drive time,@df.outbound * coef_dtim_multiplier * odt_skims['DRV_HVY_WLK_DTIM']/100,,,,,,,,,,,,,,,,,coef_ivt,,,, +util_DRIVE_HVY_outbound_Walk_egress_time,DRIVE_HVY outbound - Walk egress time,@df.outbound * coef_wegr_multiplier * df.destination_walk_time,,,,,,,,,,,,,,,,,coef_ivt,,,, +util_DRIVE_HVY_outbound_Walk_other_time,DRIVE_HVY outbound - Walk other time,@df.outbound * coef_waux_multiplier * odt_skims['DRV_HVY_WLK_WAUX']/100,,,,,,,,,,,,,,,,,coef_ivt,,,, +util_DRIVE_HVY_outbound_Fare_and_operating_cost,DRIVE_HVY outbound - Fare and operating cost,@df.outbound * ivt_cost_multiplier * df.ivot * (odt_skims['DRV_HVY_WLK_FAR'] + df.auto_op_cost * odt_skims['DRV_HVY_WLK_DDIST']/100),,,,,,,,,,,,,,,,,coef_ivt,,,, +util_DRIVE_HVY_outbound_Ratio_of_drive_access_distance_to_OD_distance,DRIVE_HVY outbound - Ratio of drive access distance to OD distance,@df.outbound * dacc_ratio_multiplier * (odt_skims['DRV_HVY_WLK_DDIST']/100) / od_skims['DIST'],,,,,,,,,,,,,,,,,coef_ivt,,,, +util_DRIVE_HVY_inbound_Unavailable,DRIVE_HVY inbound - Unavailable,inbound & ~drive_heavyrail_available_inbound,,,,,,,,,,,,,,,,,-999,,,, +util_DRIVE_HVY_inbound_In_vehicle_time,DRIVE_HVY inbound - In-vehicle time,@df.inbound * odt_skims['WLK_HVY_DRV_TOTIVT']/100,,,,,,,,,,,,,,,,,coef_ivt,,,, +util_DRIVE_HVY_inbound_In_vehicle_time_on_HVY,DRIVE_HVY inbound - In-vehicle time on heavy rail (incremental w/ ivt),@df.inbound * (ivt_hvy_multiplier - 1) * odt_skims['WLK_HVY_DRV_KEYIVT']/100,,,,,,,,,,,,,,,,,coef_ivt,,,, +util_DRIVE_HVY_inbound_Short_iwait_time,DRIVE_HVY inbound - Short iwait time,@df.inbound * coef_short_iwait_multiplier * (odt_skims['WLK_HVY_DRV_IWAIT']/100).clip(upper=waitThresh),,,,,,,,,,,,,,,,,coef_ivt,,,, +util_DRIVE_HVY_inbound_Long_iwait_time,DRIVE_HVY inbound - Long iwait time,@df.inbound * coef_long_iwait_multiplier * (odt_skims['WLK_HVY_DRV_IWAIT']/100-waitThresh).clip(0),,,,,,,,,,,,,,,,,coef_ivt,,,, +util_DRIVE_HVY_inbound_transfer_wait_time,DRIVE_HVY inbound - transfer wait time,@df.inbound * coef_xwait_multiplier * odt_skims['WLK_HVY_DRV_XWAIT']/100,,,,,,,,,,,,,,,,,coef_ivt,,,, +util_DRIVE_HVY_inbound_number_of_transfers,DRIVE_HVY inbound - number of transfers,@df.inbound * xfers_drv_multiplier * (odt_skims['WLK_HVY_DRV_BOARDS']-1).clip(0),,,,,,,,,,,,,,,,,coef_ivt,,,, +util_DRIVE_HVY_inbound_Drive_time,DRIVE_HVY inbound - Drive time,@df.outbound * coef_dtim_multiplier * odt_skims['DRV_HVY_WLK_DTIM']/100,,,,,,,,,,,,,,,,,coef_ivt,,,, +util_DRIVE_HVY_inbound_Walk_access_time,DRIVE_HVY inbound - Walk access time,@df.inbound * coef_wacc_multiplier * df.origin_walk_time,,,,,,,,,,,,,,,,,coef_ivt,,,, +util_DRIVE_HVY_inbound_Walk_other_time,DRIVE_HVY inbound - Walk other time,@coef_waux_multiplier * odt_skims['WLK_HVY_DRV_WAUX']/100,,,,,,,,,,,,,,,,,coef_ivt,,,, +util_DRIVE_HVY_inbound_Fare_and_operating_cost,DRIVE_HVY inbound - Fare and operating cost,@df.inbound * ivt_cost_multiplier * df.ivot * (odt_skims['WLK_HVY_DRV_FAR'] + df.auto_op_cost * odt_skims['WLK_HVY_DRV_DDIST']/100),,,,,,,,,,,,,,,,,coef_ivt,,,, +util_DRIVE_HVY_inbound_Ratio_of_drive_access_distance_to_OD_distance,DRIVE_HVY inbound - Ratio of drive access distance to OD distance,@df.inbound * dacc_ratio_multiplier * (odt_skims['WLK_HVY_DRV_DDIST']/100)/ od_skims['DIST'],,,,,,,,,,,,,,,,,1,,,, +#,#Drive to Commuter Rail,,,,,,,,,,,,,,,,,,,,,, +util_DRIVE_COM_Unavailable_for_zero_auto_households,DRIVE_COM - Unavailable for zero auto households,auto_ownership == 0,,,,,,,,,,,,,,,,,,-999,,, +util_DRIVE_COM_Unavailable_for_persons_less_than_16,DRIVE_COM - Unavailable for persons less than 16,age < 16,,,,,,,,,,,,,,,,,,-999,,, +util_DRIVE_COM_Destination_zone_densityIndex,DRIVE_COM - Destination zone densityIndex,@density_index_multiplier * df.density_index,,,,,,,,,,,,,,,,,,coef_ivt,,, +util_DRIVE_COM_Topology,DRIVE_COM - Topology,@topology_trn_multiplier * df.trip_topology,,,,,,,,,,,,,,,,,,coef_ivt,,, +util_DRIVE_COM_Person_is_less_than_10_years_old,DRIVE_COM - Person is less than 10 years old,@(df.age < 10),,,,,,,,,,,,,,,,,,coef_age010_trn,,, +util_DRIVE_COM_outbound_Unavailable,DRIVE_COM outbound - Unavailable,outbound & ~drive_commuter_available_outbound,,,,,,,,,,,,,,,,,,-999,,, +util_DRIVE_COM_outbound_In_vehicle_time,DRIVE_COM outbound - In-vehicle time,@df.outbound * odt_skims['DRV_COM_WLK_TOTIVT']/100,,,,,,,,,,,,,,,,,,coef_ivt,,, +util_DRIVE_COM_outbound_In_vehicle_time_on_COM,DRIVE_COM outbound - In-vehicle time on commuter rail (incremental w/ ivt),@df.outbound * (ivt_com_multiplier - 1) * odt_skims['DRV_COM_WLK_KEYIVT']/100,,,,,,,,,,,,,,,,,,coef_ivt,,, +util_DRIVE_COM_outbound_Short_iwait_time,DRIVE_COM outbound - Short iwait time,@df.outbound * coef_short_iwait_multiplier * (odt_skims['DRV_COM_WLK_IWAIT']/100).clip(upper=waitThresh),,,,,,,,,,,,,,,,,,coef_ivt,,, +util_DRIVE_COM_outbound_Long_iwait_time,DRIVE_COM outbound - Long iwait time,@df.outbound * coef_long_iwait_multiplier * (odt_skims['DRV_COM_WLK_IWAIT']/100-waitThresh).clip(0),,,,,,,,,,,,,,,,,,coef_ivt,,, +util_DRIVE_COM_outbound_transfer_wait_time,DRIVE_COM outbound - transfer wait time,@df.outbound * coef_xwait_multiplier * odt_skims['DRV_COM_WLK_XWAIT']/100,,,,,,,,,,,,,,,,,,coef_ivt,,, +util_DRIVE_COM_outbound_number_of_transfers,DRIVE_COM outbound - number of transfers,@df.outbound * xfers_drv_multiplier * (odt_skims['DRV_COM_WLK_BOARDS']-1).clip(0),,,,,,,,,,,,,,,,,,coef_ivt,,, +util_DRIVE_COM_outbound_Drive_time,DRIVE_COM outbound - Drive time,@df.outbound * coef_dtim_multiplier * odt_skims['DRV_COM_WLK_DTIM']/100,,,,,,,,,,,,,,,,,,coef_ivt,,, +util_DRIVE_COM_outbound_Walk_egress_time,DRIVE_COM outbound - Walk egress time,@df.outbound * coef_wegr_multiplier * df.destination_walk_time,,,,,,,,,,,,,,,,,,coef_ivt,,, +util_DRIVE_COM_outbound_Walk_other_time,DRIVE_COM outbound - Walk other time,@df.outbound * coef_waux_multiplier * odt_skims['DRV_COM_WLK_WAUX']/100,,,,,,,,,,,,,,,,,,coef_ivt,,, +util_DRIVE_COM_outbound_Fare_and_operating_cost,DRIVE_COM outbound - Fare and operating cost,@df.outbound * ivt_cost_multiplier * df.ivot * (odt_skims['DRV_COM_WLK_FAR'] + df.auto_op_cost * odt_skims['DRV_COM_WLK_DDIST']/100),,,,,,,,,,,,,,,,,,coef_ivt,,, +util_DRIVE_COM_outbound_Ratio_of_drive_access_distance_to_OD_distance,DRIVE_COM outbound - Ratio of drive access distance to OD distance,@df.outbound * dacc_ratio_multiplier * (odt_skims['DRV_COM_WLK_DDIST']/100) / od_skims['DIST'],,,,,,,,,,,,,,,,,,1,,, +util_DRIVE_COM_inbound_Unavailable,DRIVE_COM inbound - Unavailable,inbound & ~drive_commuter_available_inbound,,,,,,,,,,,,,,,,,,-999,,, +util_DRIVE_COM_inbound_In_vehicle_time,DRIVE_COM inbound - In-vehicle time,@df.inbound * odt_skims['WLK_COM_DRV_TOTIVT']/100,,,,,,,,,,,,,,,,,,coef_ivt,,, +util_DRIVE_COM_inbound_In_vehicle_time_on_COM,DRIVE_COM inbound - In-vehicle time on commuter rail (incremental w/ ivt),@df.inbound * (ivt_com_multiplier - 1) * odt_skims['WLK_COM_DRV_KEYIVT']/100,,,,,,,,,,,,,,,,,,coef_ivt,,, +util_DRIVE_COM_inbound_Short_iwait_time,DRIVE_COM inbound - Short iwait time,@df.inbound * coef_short_iwait_multiplier * (odt_skims['WLK_COM_DRV_IWAIT']/100).clip(upper=waitThresh),,,,,,,,,,,,,,,,,,coef_ivt,,, +util_DRIVE_COM_inbound_Long_iwait_time,DRIVE_COM inbound - Long iwait time,@df.inbound * coef_long_iwait_multiplier * (odt_skims['WLK_COM_DRV_IWAIT']/100-waitThresh).clip(0),,,,,,,,,,,,,,,,,,coef_ivt,,, +util_DRIVE_COM_inbound_transfer_wait_time,DRIVE_COM inbound - transfer wait time,@df.inbound * coef_xwait_multiplier * odt_skims['WLK_COM_DRV_XWAIT']/100,,,,,,,,,,,,,,,,,,coef_ivt,,, +util_DRIVE_COM_inbound_number_of_transfers,DRIVE_COM inbound - number of transfers,@df.inbound * xfers_drv_multiplier * (odt_skims['WLK_COM_DRV_BOARDS']-1).clip(0),,,,,,,,,,,,,,,,,,coef_ivt,,, +util_DRIVE_COM_inbound_Drive_time,DRIVE_COM inbound - Drive time,@df.inbound * coef_dtim_multiplier * odt_skims['WLK_COM_DRV_DTIM']/100,,,,,,,,,,,,,,,,,,coef_ivt,,, +util_DRIVE_COM_inbound_Walk_access_time,DRIVE_COM inbound - Walk access time,@df.inbound * coef_wacc_multiplier * df.origin_walk_time,,,,,,,,,,,,,,,,,,coef_ivt,,, +util_DRIVE_COM_inbound_Walk_other_time,DRIVE_COM inbound - Walk other time,@df.inbound * coef_waux_multiplier * odt_skims['WLK_COM_DRV_WAUX']/100,,,,,,,,,,,,,,,,,,coef_ivt,,, +util_DRIVE_COM_inbound_Fare_and_operating_cost,DRIVE_COM inbound - Fare and operating cost,@df.inbound * ivt_cost_multiplier * df.ivot * (odt_skims['WLK_COM_DRV_FAR'] + df.auto_op_cost * odt_skims['WLK_COM_DRV_DDIST']/100),,,,,,,,,,,,,,,,,,coef_ivt,,, +util_DRIVE_COM_inbound_Ratio_of_drive_access_distance_to_OD_distance,DRIVE_COM inbound - Ratio of drive access distance to OD distance,@df.inbound * dacc_ratio_multiplier * (odt_skims['WLK_COM_DRV_DDIST']/100) / od_skims['DIST'],,,,,,,,,,,,,,,,,,1,,, +#,Taxi,,,,,,,,,,,,,,,,,,,,,, +util_Taxi_In_vehicle_time,Taxi - In-vehicle time,@odt_skims['HOV2TOLL_TIME'],,,,,,,,,,,,,,,,,,,coef_ivt,, +util_Taxi_Wait_time,Taxi - Wait time,@ridehail_wait_time_multiplier * df.origTaxiWaitTime,,,,,,,,,,,,,,,,,,,coef_ivt,, +util_Taxi_Tolls,Taxi - Tolls,@ivt_cost_multiplier * df.ivot * odt_skims['HOV2TOLL_VTOLL'],,,,,,,,,,,,,,,,,,,coef_ivt,, +util_Taxi_Bridge_toll,Taxi - Bridge toll,@ivt_cost_multiplier * df.ivot * odt_skims['HOV2TOLL_BTOLL'],,,,,,,,,,,,,,,,,,,coef_ivt,, +util_Taxi_Fare,Taxi - Fare,@ivt_cost_multiplier * df.ivot * (Taxi_baseFare + odt_skims['HOV2TOLL_DIST'] * Taxi_costPerMile + odt_skims['HOV2TOLL_TIME'] * Taxi_costPerMinute)*100,,,,,,,,,,,,,,,,,,,coef_ivt,, +#,TNC Single,,,,,,,,,,,,,,,,,,,,,, +util_TNC_Single_In_vehicle_time,TNC Single - In-vehicle time,@odt_skims['HOV2TOLL_TIME'] ,,,,,,,,,,,,,,,,,,,,coef_ivt, +util_TNC_Single_Wait_time,TNC Single - Wait time,@ridehail_wait_time_multiplier * df.origSingleTNCWaitTime,,,,,,,,,,,,,,,,,,,,coef_ivt, +util_TNC_Single_Tolls,TNC Single - Tolls,@ivt_cost_multiplier * df.ivot * odt_skims['HOV2TOLL_VTOLL'],,,,,,,,,,,,,,,,,,,,coef_ivt, +util_TNC_Single_Bridge_toll,TNC Single - Bridge toll,@ivt_cost_multiplier * df.ivot * (odt_skims['HOV2TOLL_BTOLL'] + dot_skims['HOV2TOLL_BTOLL']),,,,,,,,,,,,,,,,,,,,coef_ivt, +util_TNC_Single_Cost,TNC Single - Cost,"@ivt_cost_multiplier * df.ivot * np.maximum(TNC_single_baseFare + odt_skims['HOV2TOLL_DIST'] * TNC_single_costPerMile + odt_skims['HOV2TOLL_TIME'] * TNC_single_costPerMinute, TNC_single_costMinimum) * 100",,,,,,,,,,,,,,,,,,,,coef_ivt, +#,#TNC Shared,,,,,,,,,,,,,,,,,,,,,, +util_TNC_Shared_In_vehicle_time,TNC Shared - In-vehicle time,@odt_skims['HOV2TOLL_TIME'] * TNC_shared_IVTFactor,,,,,,,,,,,,,,,,,,,,,coef_ivt +util_TNC_Shared_Wait_time,TNC Shared - Wait time,@ridehail_wait_time_multiplier * df.origSharedTNCWaitTime,,,,,,,,,,,,,,,,,,,,,coef_ivt +util_TNC_Shared_Tolls,TNC Shared - Tolls,@ivt_cost_multiplier * df.ivot * odt_skims['HOV2TOLL_VTOLL'],,,,,,,,,,,,,,,,,,,,,coef_ivt +util_TNC_Shared_Bridge_toll,TNC Shared - Bridge toll,@ivt_cost_multiplier * df.ivot * (odt_skims['HOV2TOLL_BTOLL'] + dot_skims['HOV2TOLL_BTOLL']),,,,,,,,,,,,,,,,,,,,,coef_ivt +util_TNC_Shared_Cost,TNC Shared - Cost,"@ivt_cost_multiplier * df.ivot * np.maximum(TNC_shared_baseFare + odt_skims['HOV2TOLL_DIST'] * TNC_shared_costPerMile + odt_skims['HOV2TOLL_TIME']* TNC_shared_costPerMinute, TNC_shared_costMinimum) * 100",,,,,,,,,,,,,,,,,,,,,coef_ivt +#,,,,,,,,,,,,,,,,,,,,,,, +util_tour_mode_is_auto,Auto tour mode availability,tour_mode_is_auto,,,,,,,,-999,-999,-999,-999,-999,-999,-999,-999,-999,-999,-999,,, +util_tour_mode_is_walk,Walk tour mode availability,tour_mode_is_walk,-999,-999,-999,-999,-999,-999,,-999,-999,-999,-999,-999,-999,-999,-999,-999,-999,-999,,, +util_tour_mode_is_bike,Bike tour mode availability,tour_mode_is_bike,-999,-999,-999,-999,-999,-999,,,-999,-999,-999,-999,-999,-999,-999,-999,-999,-999,,, +util_tour_mode_is_walk_transit,Walk to Transit tour mode availability,tour_mode_is_walk_transit,-999,-999,,,,,,-999,,,,,,-999,-999,-999,-999,-999,,, +util_tour_mode_is_drive_transit,Drive to Transit tour modes availability,tour_mode_is_drive_transit,-999,-999,-999,-999,-999,-999,-999,-999,-999,-999,-999,-999,-999,,,,,,,, +util_tour_mode_is_ride_hail,Ride hail tour modes availability,tour_mode_is_ride_hail,-999,-999,,,,,,-999,,,,,,-999,-999,-999,-999,-999,,, +,#indiv tour ASCs,,,,,,,,,,,,,,,,,,,,,, +util_Drive_Alone_tour_mode_ASC_shared_ride_2_df_is_indiv,Drive Alone tour mode ASC -- shared ride 2,@(df.is_indiv & df.i_tour_mode.isin(I_SOV_MODES)),,,sov_ASC_sr2,sov_ASC_sr2,,,,,,,,,,,,,,,,, +util_Drive_Alone_tour_mode_ASC_shared_ride_3_plus,Drive Alone tour mode ASC -- shared ride 3+,@(df.is_indiv & df.i_tour_mode.isin(I_SOV_MODES)),,,,,sov_ASC_sr3p,sov_ASC_sr3p,,,,,,,,,,,,,,, +util_Drive_Alone_tour_mode_ASC_walk,Drive Alone tour mode ASC -- walk,@(df.is_indiv & df.i_tour_mode.isin(I_SOV_MODES)),,,,,,,sov_ASC_walk,,,,,,,,,,,,,, +util_Drive_Alone_tour_mode_ASC_ride_hail,Drive Alone tour mode ASC -- ride hail,@(df.is_indiv & df.i_tour_mode.isin(I_SOV_MODES)),,,,,,,,,,,,,,,,,,,sov_ASC_rh,sov_ASC_rh,sov_ASC_rh +util_Shared_Ride_2_tour_mode_ASC_shared_ride_2,Shared Ride 2 tour mode ASC -- shared ride 2,@(df.is_indiv & df.i_tour_mode.isin(I_SR2_MODES)),,,sr2_ASC_sr2,sr2_ASC_sr2,,,,,,,,,,,,,,,,, +util_Shared_Ride_2_tour_mode_ASC_shared_ride_3_plus,Shared Ride 2 tour mode ASC -- shared ride 3+,@(df.is_indiv & df.i_tour_mode.isin(I_SR2_MODES)),,,,,sr2_ASC_sr3p,sr2_ASC_sr3p,,,,,,,,,,,,,,, +util_Shared_Ride_2_tour_mode_ASC_walk,Shared Ride 2 tour mode ASC -- walk,@(df.is_indiv & df.i_tour_mode.isin(I_SR2_MODES)),,,,,,,sr2_ASC_walk,,,,,,,,,,,,,, +util_Shared_Ride_2_tour_mode_ASC_ride_hail,Shared Ride 2 tour mode ASC -- ride hail,@(df.is_indiv & df.i_tour_mode.isin(I_SR2_MODES)),,,,,,,,,,,,,,,,,,,sr2_ASC_rh,sr2_ASC_rh,sr2_ASC_rh +util_Shared_Ride_3_tour_mode_ASC_shared_ride_2,Shared Ride 3+ tour mode ASC -- shared ride 2,@(df.is_indiv & df.i_tour_mode.isin(I_SR3P_MODES)),,,sr3p_ASC_sr2,sr3p_ASC_sr2,,,,,,,,,,,,,,,,, +util_Shared_Ride_3_tour_mode_ASC_shared_ride_3_plus,Shared Ride 3+ tour mode ASC -- shared ride 3+,@(df.is_indiv & df.i_tour_mode.isin(I_SR3P_MODES)),,,,,sr3p_ASC_sr3p,sr3p_ASC_sr3p,,,,,,,,,,,,,,, +util_Shared_Ride_3_tour_mode_ASC_walk,Shared Ride 3+ tour mode ASC -- walk,@(df.is_indiv & df.i_tour_mode.isin(I_SR3P_MODES)),,,,,,,sr3p_ASC_walk,,,,,,,,,,,,,, +util_Shared_Ride_3_tour_mode_ASC_ride_hail,Shared Ride 3+ tour mode ASC -- ride hail,@(df.is_indiv & df.i_tour_mode.isin(I_SR3P_MODES)),,,,,,,,,,,,,,,,,,,sr3p_ASC_rh,sr3p_ASC_rh,sr3p_ASC_rh +util_Walk_tour_mode_ASC_ride_hail,Walk tour mode ASC -- ride hail,@df.is_indiv & (df.i_tour_mode == I_WALK_MODE),,,,,,,,,,,,,,,,,,,walk_ASC_rh,walk_ASC_rh,walk_ASC_rh +util_Bike_tour_mode_ASC_walk,Bike tour mode ASC -- walk,@df.is_indiv & (df.i_tour_mode == I_BIKE_MODE),,,,,,,bike_ASC_walk,,,,,,,,,,,,,, +util_Bike_tour_mode_ASC_ride_hail,Bike tour mode ASC -- ride hail,@df.is_indiv & (df.i_tour_mode == I_BIKE_MODE),,,,,,,,,,,,,,,,,,,bike_ASC_rh,bike_ASC_rh,bike_ASC_rh +util_Walk_to_Transit_tour_mode_ASC_light_rail,Walk to Transit tour mode ASC -- light rail,@(df.is_indiv & df.tour_mode_is_walk_transit & ~df.walk_ferry_available),,,,,,,,,,walk_transit_ASC_lightrail,,,,,,,,,,, +util_Walk_to_Transit_tour_mode_ASC_ferry,Walk to Transit tour mode ASC -- ferry,@(df.is_indiv & df.tour_mode_is_walk_transit & df.walk_ferry_available),,,,,,,,,,walk_transit_ASC_ferry,,,,,,,,,,, +util_Walk_to_Transit_tour_mode_ASC_express_bus,Walk to Transit tour mode ASC -- express bus,@(df.is_indiv & df.tour_mode_is_walk_transit),,,,,,,,,,,walk_transit_ASC_express,,,,,,,,,, +util_Walk_to_Transit_tour_mode_ASC_heavy_rail,Walk to Transit tour mode ASC -- heavy rail,@(df.is_indiv & df.tour_mode_is_walk_transit),,,,,,,,,,,,walk_transit_ASC_heavyrail,,,,,,,,, +util_Walk_to_Transit_tour_mode_ASC_commuter_rail,Walk to Transit tour mode ASC -- commuter rail,@(df.is_indiv & df.tour_mode_is_walk_transit),,,,,,,,,,,,,walk_transit_ASC_commuter,,,,,,,, +util_Walk_to_Transit_tour_mode_ASC_shared_ride_2,Walk to Transit tour mode ASC -- shared ride 2,@(df.is_indiv & df.tour_mode_is_walk_transit),,,walk_transit_ASC_sr2,walk_transit_ASC_sr2,,,,,,,,,,,,,,,,, +util_Walk_to_Transit_tour_mode_ASC_shared_ride_3_plus,Walk to Transit tour mode ASC -- shared ride 3+,@(df.is_indiv & df.tour_mode_is_walk_transit),,,,,walk_transit_ASC_sr3p,walk_transit_ASC_sr3p,,,,,,,,,,,,,,, +util_Walk_to_Transit_tour_mode_ASC_walk,Walk to Transit tour mode ASC -- walk,@(df.is_indiv & df.tour_mode_is_walk_transit),,,,,,,walk_transit_ASC_walk,,,,,,,,,,,,,, +util_Walk_to_Transit_tour_mode_ASC_ride_hail,Walk to Transit tour mode ASC -- ride hail,@(df.is_indiv & df.tour_mode_is_walk_transit),,,,,,,,,,,,,,,,,,,walk_transit_ASC_rh,walk_transit_ASC_rh,walk_transit_ASC_rh +util_Drive_to_Transit_tour_mode_ASC_light_rail_skims_differ,Drive to Transit tour mode ASC -- light rail (higher b/c loc d-trn skims differ),@(df.is_indiv & df.tour_mode_is_drive_transit & ~df.drive_ferry_available),,,,,,,,,,,,,,,drive_transit_ASC_lightrail,,,,,, +util_Drive_to_Transit_tour_mode_ASC_ferry,Drive to Transit tour mode ASC -- ferry,@(df.is_indiv & df.tour_mode_is_drive_transit & df.drive_ferry_available),,,,,,,,,,,,,,,drive_transit_ASC_ferry,,,,,, +util_Drive_to_Transit_tour_mode_ASC_express_bus,Drive to Transit tour mode ASC -- express bus,@(df.is_indiv & df.tour_mode_is_drive_transit),,,,,,,,,,,,,,,,drive_transit_ASC_express,,,,, +util_Drive_to_Transit_tour_mode_ASC_heavy_rail,Drive to Transit tour mode ASC -- heavy rail,@(df.is_indiv & df.tour_mode_is_drive_transit),,,,,,,,,,,,,,,,,drive_transit_ASC_heavyrail,,,, +util_Drive_to_Transit_tour_mode_ASC_commuter_rail,Drive to Transit tour mode ASC -- commuter rail,@(df.is_indiv & df.tour_mode_is_drive_transit),,,,,,,,,,,,,,,,,,drive_transit_ASC_commuter,,, +util_Drive_to_Transit_tour_mode_ASC_ride_hail,Drive to Transit tour mode ASC -- ride hail,@(df.is_indiv & df.tour_mode_is_drive_transit),,,,,,,,,,,,,,,,,,,drive_transit_ASC_rh,drive_transit_ASC_rh,drive_transit_ASC_rh +util_Ride_Hail_tour_mode_ASC_shared_ride_2,Ride Hail tour mode ASC -- shared ride 2,@(df.is_indiv & df.tour_mode_is_ride_hail),,,ride_hail_ASC_sr2,ride_hail_ASC_sr2,,,,,,,,,,,,,,,,, +util_Ride_Hail_tour_mode_ASC_shared_ride_3_plus,Ride Hail tour mode ASC -- shared ride 3+,@(df.is_indiv & df.tour_mode_is_ride_hail),,,,,ride_hail_ASC_sr3p,ride_hail_ASC_sr3p,,,,,,,,,,,,,,, +util_Ride_Hail_tour_mode_ASC_walk,Ride Hail tour mode ASC -- walk,@(df.is_indiv & df.tour_mode_is_ride_hail),,,,,,,ride_hail_ASC_walk,,,,,,,,,,,,,, +util_Ride_Hail_tour_mode_ASC_walk_to_transit,Ride Hail tour mode ASC -- walk to transit,@(df.is_indiv & df.tour_mode_is_ride_hail),,,,,,,,,ride_hail_ASC_walk_transit,ride_hail_ASC_walk_transit,ride_hail_ASC_walk_transit,ride_hail_ASC_walk_transit,ride_hail_ASC_walk_transit,,,,,,,, +util_Ride_Hail_tour_mode_ASC_ride_hail_taxi,Ride Hail tour mode ASC -- ride hail,@(df.is_indiv & df.i_tour_mode.isin(I_RIDE_HAIL_MODES)),,,,,,,,,,,,,,,,,,,ride_hail_ASC_taxi,, +util_Ride_Hail_tour_mode_ASC_ride_hail_single,Ride Hail tour mode ASC -- ride hail,@(df.is_indiv & df.i_tour_mode.isin(I_RIDE_HAIL_MODES)),,,,,,,,,,,,,,,,,,,,ride_hail_ASC_tnc_single, +util_Ride_Hail_tour_mode_ASC_ride_hail_shared,Ride Hail tour mode ASC -- ride hail,@(df.is_indiv & df.i_tour_mode.isin(I_RIDE_HAIL_MODES)),,,,,,,,,,,,,,,,,,,,,ride_hail_ASC_tnc_shared +#,joint tour ASCs,,,,,,,,,,,,,,,,,,,,,, +util_joint_auto_tour_mode_ASC_shared_ride_2,joint - auto tour mode ASC -- shared ride 2,@(df.is_joint & df.i_tour_mode.isin(I_AUTO_MODES)),,,joint_auto_ASC_sr2,joint_auto_ASC_sr2,,,,,,,,,,,,,,,,, +util_joint_auto_tour_mode_ASC_shared_ride_3_,joint - auto tour mode ASC -- shared ride 3+,@(df.is_joint & df.i_tour_mode.isin(I_AUTO_MODES)),,,,,joint_auto_ASC_sr3p,joint_auto_ASC_sr3p,,,,,,,,,,,,,,, +util_joint_auto_tour_mode_ASC_walk,joint - auto tour mode ASC -- walk,@(df.is_joint & df.i_tour_mode.isin(I_AUTO_MODES)),,,,,,,joint_auto_ASC_walk,,,,,,,,,,,,,, +util_joint_auto_tour_mode_ASC_ride_hail,joint - auto tour mode ASC -- ride hail,@(df.is_joint & df.i_tour_mode.isin(I_RIDE_HAIL_MODES)),,,,,,,,,,,,,,,,,,,joint_auto_ASC_rh,joint_auto_ASC_rh,joint_auto_ASC_rh +util_joint_Walk_tour_mode_ASC_ride_hail,joint - Walk tour mode ASC -- ride hail,@(df.is_joint & df.i_tour_mode.isin(I_RIDE_HAIL_MODES)),,,,,,,joint_walk_ASC_rh,,,,,,,,,,,,,, +util_joint_Bike_tour_mode_ASC_walk,joint - Bike tour mode ASC -- walk,@df.is_joint & (df.i_tour_mode == I_BIKE_MODE),,,,,,,joint_bike_ASC_walk,,,,,,,,,,,,,, +util_joint_Bike_tour_mode_ASC_ride_hail,joint - Bike tour mode ASC -- ride hail,@df.is_joint & (df.i_tour_mode == I_BIKE_MODE),,,,,,,,,,,,,,,,,,,joint_bike_ASC_rh,joint_bike_ASC_rh,joint_bike_ASC_rh +util_joint_Walk_to_Transit_tour_mode_ASC_light_rail,joint - Walk to Transit tour mode ASC -- light rail,@(df.is_joint & df.tour_mode_is_walk_transit & ~df.walk_ferry_available),,,,,,,,,,joint_walk_transit_ASC_lightrail,,,,,,,,,,, +util_joint_Walk_to_Transit_tour_mode_ASC_ferry,joint - Walk to Transit tour mode ASC -- ferry,@(df.is_joint & df.tour_mode_is_walk_transit & df.walk_ferry_available),,,,,,,,,,joint_walk_transit_ASC_ferry,,,,,,,,,,, +util_joint_Walk_to_Transit_tour_mode_ASC_express_bus,joint - Walk to Transit tour mode ASC -- express bus,@(df.is_joint & df.tour_mode_is_walk_transit),,,,,,,,,,,joint_walk_transit_ASC_express,,,,,,,,,, +util_joint_Walk_to_Transit_tour_mode_ASC_heavy_rail,joint - Walk to Transit tour mode ASC -- heavy rail,@(df.is_joint & df.tour_mode_is_walk_transit),,,,,,,,,,,,joint_walk_transit_ASC_heavyrail,,,,,,,,, +util_joint_Walk_to_Transit_tour_mode_ASC_commuter_rail,joint - Walk to Transit tour mode ASC -- commuter rail,@(df.is_joint & df.tour_mode_is_walk_transit),,,,,,,,,,,,,joint_walk_transit_ASC_commuter,,,,,,,, +util_joint_Walk_to_Transit_tour_mode_ASC_shared_ride_2,joint - Walk to Transit tour mode ASC -- shared ride 2,@(df.is_joint & df.tour_mode_is_walk_transit),,,joint_walk_transit_ASC_sr2,joint_walk_transit_ASC_sr2,,,,,,,,,,,,,,,,, +util_joint_Walk_to_Transit_tour_mode_ASC_shared_ride_3_plus,joint - Walk to Transit tour mode ASC -- shared ride 3+,@(df.is_joint & df.tour_mode_is_walk_transit),,,,,joint_walk_transit_ASC_sr3p,joint_walk_transit_ASC_sr3p,,,,,,,,,,,,,,, +util_joint_Walk_to_Transit_tour_mode_ASC_walk,joint - Walk to Transit tour mode ASC -- walk,@(df.is_joint & df.tour_mode_is_walk_transit),,,,,,,joint_walk_transit_ASC_walk,,,,,,,,,,,,,, +util_joint_Walk_to_Transit_tour_mode_ASC_ride_hail,joint - Walk to Transit tour mode ASC -- ride hail,@(df.is_joint & df.tour_mode_is_walk_transit),,,,,,,,,,,,,,,,,,,joint_walk_transit_ASC_rh,joint_walk_transit_ASC_rh,joint_walk_transit_ASC_rh +util_joint_Drive_to_Transit_tour_mode_ASC_light_rail_skims_differ,joint - Drive to Transit tour mode ASC -- light rail (higher b/c loc d-trn skims differ),@(df.is_joint & df.tour_mode_is_drive_transit & ~df.drive_ferry_available),,,,,,,,,,,,,,,joint_drive_transit_ASC_lightrail,,,,,, +util_joint_Drive_to_Transit_tour_mode_ASC_ferry,joint - Drive to Transit tour mode ASC -- ferry,@(df.is_joint & df.tour_mode_is_drive_transit & df.drive_ferry_available),,,,,,,,,,,,,,,joint_drive_transit_ASC_ferry,,,,,, +util_joint_Drive_to_Transit_tour_mode_ASC_express_bus,joint - Drive to Transit tour mode ASC -- express bus,@(df.is_joint & df.tour_mode_is_drive_transit),,,,,,,,,,,,,,,,joint_drive_transit_ASC_express,,,,, +util_joint_Drive_to_Transit_tour_mode_ASC_heavy_rail,joint - Drive to Transit tour mode ASC -- heavy rail,@(df.is_joint & df.tour_mode_is_drive_transit),,,,,,,,,,,,,,,,,joint_drive_transit_ASC_heavyrail,,,, +util_joint_Drive_to_Transit_tour_mode_ASC_commuter_rail,joint - Drive to Transit tour mode ASC -- commuter rail,@(df.is_joint & df.tour_mode_is_drive_transit),,,,,,,,,,,,,,,,,,joint_drive_transit_ASC_commuter,,, +util_joint_Drive_to_Transit_tour_mode_ASC_ride_hail,joint - Drive to Transit tour mode ASC -- ride hail,@(df.is_joint & df.tour_mode_is_drive_transit),,,,,,,,,,,,,,,,,,,joint_drive_transit_ASC_rh,joint_drive_transit_ASC_rh,joint_drive_transit_ASC_rh +util_joint_Ride_Hail_tour_mode_ASC_shared_ride_2,joint - Ride Hail tour mode ASC -- shared ride 2,@(df.is_joint & df.tour_mode_is_ride_hail),,,joint_ride_hail_ASC_sr2,joint_ride_hail_ASC_sr2,,,,,,,,,,,,,,,,, +util_joint_Ride_Hail_tour_mode_ASC_shared_ride_3_plus,joint - Ride Hail tour mode ASC -- shared ride 3+,@(df.is_joint & df.tour_mode_is_ride_hail),,,,,joint_ride_hail_ASC_sr3p,joint_ride_hail_ASC_sr3p,,,,,,,,,,,,,,, +util_joint_Ride_Hail_tour_mode_ASC_walk,joint - Ride Hail tour mode ASC -- walk,@(df.is_joint & df.tour_mode_is_ride_hail),,,,,,,joint_ride_hail_ASC_walk,,,,,,,,,,,,,, +util_joint_Ride_Hail_tour_mode_ASC_walk_to_transit,joint - Ride Hail tour mode ASC -- walk to transit,@(df.is_joint & df.tour_mode_is_ride_hail),,,,,,,,,joint_ride_hail_ASC_walk_transit,joint_ride_hail_ASC_walk_transit,joint_ride_hail_ASC_walk_transit,joint_ride_hail_ASC_walk_transit,joint_ride_hail_ASC_walk_transit,,,,,,,, +util_joint_Ride_Hail_tour_mode_ASC_ride_hail_taxi,joint - Ride Hail tour mode ASC -- ride hail,@(df.is_joint & df.i_tour_mode.isin(I_RIDE_HAIL_MODES)),,,,,,,,,,,,,,,,,,,joint_ride_hail_ASC_taxi,, +util_joint_Ride_Hail_tour_mode_ASC_ride_hail_single,joint - Ride Hail tour mode ASC -- ride hail,@(df.is_joint & df.i_tour_mode.isin(I_RIDE_HAIL_MODES)),,,,,,,,,,,,,,,,,,,,joint_ride_hail_ASC_tnc_single, +util_joint_Ride_Hail_tour_mode_ASC_ride_hail_shared,joint - Ride Hail tour mode ASC -- ride hail,@(df.is_joint & df.i_tour_mode.isin(I_RIDE_HAIL_MODES)),,,,,,,,,,,,,,,,,,,,,joint_ride_hail_ASC_tnc_shared +#,#,,,,,,,,,,,,,,,,,,,,,, +util_Walk_not_available_for_long_distances,Walk not available for long distances,@df.tour_mode_is_walk & (od_skims['DISTWALK'] > 3),,,,,,,-999,,,,,,,,,,,,,, +util_Bike_not_available_for_long_distances,Bike not available for long distances,@df.tour_mode_is_walk & (od_skims['DISTBIKE'] > 8),,,,,,,,-999,,,,,,,,,,,,, +util_origin_density_index,Origin density index,@origin_density_applied*(origin_density_index_multiplier*df.origin_density_index).clip(origin_density_index_max),,,,,,,coef_ivt,coef_ivt,coef_ivt,coef_ivt,coef_ivt,coef_ivt,coef_ivt,,,,,,,coef_ivt,coef_ivt +util_walk_express_penalty,Walk-express penalty for intermediate stops,@walk_express_penalty * ~(df.first_trip | df.first_trip),,,,,,,,,,,coef_ivt,,,,,,,,,, +util_adjust_tnc_shared,TNC shared adjustment,@adjust_tnc_shared,,,,,,,,,,,,,,,,,,,,,coef_ivt diff --git a/activitysim/examples/example_mtc_extended/configs/trip_mode_choice.yaml b/activitysim/examples/example_mtc_extended/configs/trip_mode_choice.yaml new file mode 100644 index 0000000000..7127618637 --- /dev/null +++ b/activitysim/examples/example_mtc_extended/configs/trip_mode_choice.yaml @@ -0,0 +1,209 @@ +# trip_mode_choice.yaml + +SPEC: trip_mode_choice.csv +COEFFICIENTS: trip_mode_choice_coefficients.csv +COEFFICIENT_TEMPLATE: trip_mode_choice_coefficients_template.csv + +LOGIT_TYPE: NL + +NESTS: + name: root + coefficient: coef_nest_root + alternatives: + - name: AUTO + coefficient: coef_nest_AUTO + alternatives: + - name: DRIVEALONE + coefficient: coef_nest_AUTO_DRIVEALONE + alternatives: + - DRIVEALONEFREE + - DRIVEALONEPAY + - name: SHAREDRIDE2 + coefficient: coef_nest_AUTO_SHAREDRIDE2 + alternatives: + - SHARED2FREE + - SHARED2PAY + - name: SHAREDRIDE3 + coefficient: coef_nest_AUTO_SHAREDRIDE3 + alternatives: + - SHARED3FREE + - SHARED3PAY + - name: NONMOTORIZED + coefficient: coef_nest_NONMOTORIZED + alternatives: + - WALK + - BIKE + - name: TRANSIT + coefficient: coef_nest_TRANSIT + alternatives: + - name: WALKACCESS + coefficient: coef_nest_TRANSIT_WALKACCESS + alternatives: + - WALK_LOC + - WALK_LRF + - WALK_EXP + - WALK_HVY + - WALK_COM + - name: DRIVEACCESS + coefficient: coef_nest_TRANSIT_DRIVEACCESS + alternatives: + - DRIVE_LOC + - DRIVE_LRF + - DRIVE_EXP + - DRIVE_HVY + - DRIVE_COM + - name: RIDEHAIL + coefficient: coef_nest_RIDEHAIL + alternatives: + - TAXI + - TNC_SINGLE + - TNC_SHARED + +CONSTANTS: + orig_col_name: origin + dest_col_name: destination + costPerMile: 18.29 + costShareSr2: 1.75 + costShareSr3: 2.50 + waitThresh: 10.00 + walkThresh: 1.00 + shortWalk: 0.333 + longWalk: 0.667 + walkSpeed: 3.00 + bikeThresh: 6.00 + bikeSpeed: 12.00 +# maxCbdAreaTypeThresh: 2 +# indivTour: 1.00000 +# upperEA: 5 +# upperAM: 10 +# upperMD: 15 +# upperPM: 19 + I_MODE_MAP: + DRIVEALONEFREE: 1 + DRIVEALONEPAY: 2 + SHARED2FREE: 3 + SHARED2PAY: 4 + SHARED3FREE: 5 + SHARED3PAY: 6 + WALK: 7 + BIKE: 8 + WALK_LOC: 9 + WALK_LRF: 10 + WALK_EXP: 11 + WALK_HVY: 12 + WALK_COM: 13 + DRIVE_LOC: 14 + DRIVE_LRF: 15 + DRIVE_EXP: 16 + DRIVE_HVY: 17 + DRIVE_COM: 18 + TAXI: 19 + TNC_SINGLE: 20 + TNC_SHARED: 21 + I_SOV_MODES: [1, 2] + I_SR2_MODES: [3, 4] + I_SR3P_MODES: [5, 6] + I_AUTO_MODES: [1, 2, 3, 4, 5, 6] + I_WALK_MODE: 7 + I_BIKE_MODE: 8 + I_WALK_TRANSIT_MODES: [9, 10, 11, 12, 13] + I_DRIVE_TRANSIT_MODES: [14, 15, 16, 17, 18] + I_RIDE_HAIL_MODES: [19, 20, 21] + # RIDEHAIL Settings + Taxi_baseFare: 2.20 + Taxi_costPerMile: 2.30 + Taxi_costPerMinute: 0.10 + Taxi_waitTime_mean: + 1: 5.5 + 2: 9.5 + 3: 13.3 + 4: 17.3 + 5: 26.5 + Taxi_waitTime_sd: + 1: 0 + 2: 0 + 3: 0 + 4: 0 + 5: 0 + TNC_single_baseFare: 2.20 + TNC_single_costPerMile: 1.33 + TNC_single_costPerMinute: 0.24 + TNC_single_costMinimum: 7.20 + TNC_single_waitTime_mean: + 1: 3.0 + 2: 6.3 + 3: 8.4 + 4: 8.5 + 5: 10.3 + TNC_single_waitTime_sd: + 1: 0 + 2: 0 + 3: 0 + 4: 0 + 5: 0 + TNC_shared_baseFare: 2.20 + TNC_shared_costPerMile: 0.53 + TNC_shared_costPerMinute: 0.10 + TNC_shared_costMinimum: 3.00 + TNC_shared_IVTFactor: 1.5 + TNC_shared_waitTime_mean: + 1: 5.0 + 2: 8.0 + 3: 11.0 + 4: 15.0 + 5: 15.0 + TNC_shared_waitTime_sd: + 1: 0 + 2: 0 + 3: 0 + 4: 0 + 5: 0 + min_waitTime: 0 + max_waitTime: 50 + ivt_cost_multiplier: 0.6 + topology_bike_multiplier: 20 + topology_trn_multiplier: 2.20 + topology_walk_multiplier: 15 + ridehail_wait_time_multiplier: 1.5 + walktimelong_multiplier: 5 + biketimelong_multiplier: 5 + xfers_wlk_multiplier: 5 + xfers_drv_multiplier: 15 + dacc_ratio_multiplier: 0 + density_index_multiplier: -5 + origin_density_index_multiplier: -15 + origin_density_index_max: -15 + ivt_com_multiplier: 0.80 + ivt_exp_multiplier: -0.0175 + ivt_hvy_multiplier: 0.80 + +# so far, we can use the same spec as for non-joint tours +preprocessor: + SPEC: trip_mode_choice_annotate_trips_preprocessor + DF: df + TABLES: + - land_use + - tours + - vehicles + +# - SPEC: trip_mode_choice_annotate_trips_preprocessor2 +# DF: df +# TABLES: +# - land_use + +# to reduce memory needs filter chooser table to these fields +TOURS_MERGED_CHOOSER_COLUMNS: + - hhsize + - age + - auto_ownership + - number_of_participants + - tour_category + - parent_tour_id + - tour_mode + - duration + - value_of_time + - tour_type + - free_parking_at_work + + +MODE_CHOICE_LOGSUM_COLUMN_NAME: mode_choice_logsum diff --git a/activitysim/examples/example_mtc_extended/configs/trip_mode_choice_annotate_trips_preprocessor.csv b/activitysim/examples/example_mtc_extended/configs/trip_mode_choice_annotate_trips_preprocessor.csv new file mode 100644 index 0000000000..cc1f223d57 --- /dev/null +++ b/activitysim/examples/example_mtc_extended/configs/trip_mode_choice_annotate_trips_preprocessor.csv @@ -0,0 +1,93 @@ +Description,Target,Expression +,is_joint,(df.number_of_participants > 1) +,is_indiv,(df.number_of_participants == 1) +,is_atwork_subtour,~df.parent_tour_id.isnull() +,ivot,1.0 / df.value_of_time +#,, +#atwork subtours,, +#FIXME tripModeChoice uec wrongly conflates these with tour_mode_is_bike?,, +,parent_tour_mode,"reindex(tours.tour_mode, df.parent_tour_id).fillna('')" +,work_tour_is_SOV,"parent_tour_mode.isin(['DRIVEALONEFREE','DRIVEALONEPAY'])" +,work_tour_is_bike,parent_tour_mode=='BIKE' +#,, +,i_tour_mode,df.tour_mode.map(I_MODE_MAP) +,tour_mode_is_SOV,i_tour_mode.isin(I_SOV_MODES) +,tour_mode_is_auto,i_tour_mode.isin(I_AUTO_MODES) +,tour_mode_is_walk,i_tour_mode == I_WALK_MODE +,tour_mode_is_bike,i_tour_mode == I_BIKE_MODE +,tour_mode_is_walk_transit,i_tour_mode.isin(I_WALK_TRANSIT_MODES) +,tour_mode_is_drive_transit,i_tour_mode.isin(I_DRIVE_TRANSIT_MODES) +,tour_mode_is_ride_hail,i_tour_mode.isin(I_RIDE_HAIL_MODES) +#,, +,selected_tour_vehicle,"reindex(tours.selected_vehicle, df.tour_id)" +,auto_op_cost,"reindex(vehicles.groupby('vehicle_type')['auto_operating_cost'].mean(), pd.Series(selected_tour_vehicle, df.index))" +,auto_op_cost,"np.where(pd.isna(auto_op_cost), costPerMile, auto_op_cost)" +,inbound,~df.outbound +,first_trip,df.trip_num == 1 +,last_trip,df.trip_num == df.trip_count +origin terminal time not counted at home,_origin_terminal_time,"np.where(df.outbound & first_trip, 0, reindex(land_use.TERMINAL, df[ORIGIN]))" +dest terminal time not counted at home,_dest_terminal_time,"np.where(inbound & last_trip, 0, reindex(land_use.TERMINAL, df[DESTINATION]))" +,total_terminal_time,_origin_terminal_time + _dest_terminal_time +#,, +,free_parking_available,(df.tour_type == 'work') & df.free_parking_at_work +,dest_hourly_peak_parking_cost,"reindex(land_use.PRKCST, df[DESTINATION])" +,origin_hourly_peak_parking_cost,"reindex(land_use.PRKCST, df[ORIGIN])" +,origin_duration,"np.where(first_trip, np.where(inbound,df.duration * ~free_parking_available,0), 1)" +,dest_duration,"np.where(last_trip, np.where(inbound, df.duration * ~free_parking_available, 0), 1)" +,origin_parking_cost,origin_duration*origin_hourly_peak_parking_cost +,dest_parking_cost,dest_duration*dest_hourly_peak_parking_cost +,total_parking_cost,(origin_parking_cost + dest_parking_cost) / 2.0 +,trip_topology,"np.where(df.outbound, reindex(land_use.TOPOLOGY, df[DESTINATION]), reindex(land_use.TOPOLOGY, df[ORIGIN]))" +,density_index,"np.where(df.outbound, reindex(land_use.density_index, df[DESTINATION]), reindex(land_use.density_index, df[ORIGIN]))" +,origin_density_index,"np.where(df.outbound, reindex(land_use.density_index, df[ORIGIN]), reindex(land_use.density_index, df[DESTINATION]))" +# FIXME no transit subzones so all zones short walk to transit,, +,_walk_transit_origin,True +,_walk_transit_destination,True +,walk_transit_available,_walk_transit_origin & _walk_transit_destination +,drive_transit_available,"np.where(df.outbound, _walk_transit_destination, _walk_transit_origin) & (df.auto_ownership > 0)" +,origin_walk_time,shortWalk*60/walkSpeed +,destination_walk_time,shortWalk*60/walkSpeed +# RIDEHAIL,, +,origin_density_measure,"(reindex(land_use.TOTPOP, df[orig_col_name]) + reindex(land_use.TOTEMP, df[orig_col_name])) / (reindex(land_use.TOTACRE, df[orig_col_name]) / 640)" +,origin_density,"pd.cut(origin_density_measure, bins=[-np.inf, 500, 2000, 5000, 15000, np.inf], labels=[5, 4, 3, 2, 1]).astype(int)" +,origin_zone_taxi_wait_time_mean,"origin_density.map({k: v for k, v in Taxi_waitTime_mean.items()})" +,origin_zone_taxi_wait_time_sd,"origin_density.map({k: v for k, v in Taxi_waitTime_sd.items()})" +# ,, Note that the mean and standard deviation are not the values for the distribution itself, but of the underlying normal distribution it is derived from +,origTaxiWaitTime,"rng.lognormal_for_df(df, mu=origin_zone_taxi_wait_time_mean, sigma=origin_zone_taxi_wait_time_sd, broadcast=True, scale=True).clip(min_waitTime, max_waitTime)" +,origin_zone_singleTNC_wait_time_mean,"origin_density.map({k: v for k, v in TNC_single_waitTime_mean.items()})" +,origin_zone_singleTNC_wait_time_sd,"origin_density.map({k: v for k, v in TNC_single_waitTime_sd.items()})" +,origSingleTNCWaitTime,"rng.lognormal_for_df(df, mu=origin_zone_singleTNC_wait_time_mean, sigma=origin_zone_singleTNC_wait_time_sd, broadcast=True, scale=True).clip(min_waitTime, max_waitTime)" +,origin_zone_sharedTNC_wait_time_mean,"origin_density.map({k: v for k, v in TNC_shared_waitTime_mean.items()})" +,origin_zone_sharedTNC_wait_time_sd,"origin_density.map({k: v for k, v in TNC_shared_waitTime_sd.items()})" +,origSharedTNCWaitTime,"rng.lognormal_for_df(df, mu=origin_zone_sharedTNC_wait_time_mean, sigma=origin_zone_sharedTNC_wait_time_sd, broadcast=True, scale=True).clip(min_waitTime, max_waitTime)" +#,, +,sov_available,odt_skims['SOV_TIME']>0 +,hov2_available,odt_skims['HOV2_TIME']>0 +,hov3_available,odt_skims['HOV3_TIME']>0 +,sovtoll_available,odt_skims['SOVTOLL_VTOLL']>0 +,hov2toll_available,odt_skims['HOV2TOLL_VTOLL']>0 +,hov3toll_available,odt_skims['HOV3TOLL_VTOLL']>0 +,walk_local_available,walk_transit_available & (odt_skims['WLK_LOC_WLK_TOTIVT']/100>0) +,walk_lrf_available,walk_transit_available & (i_tour_mode >= 10) & (odt_skims['WLK_LRF_WLK_KEYIVT']/100>0) +,walk_express_available,walk_transit_available & (i_tour_mode >= 11) & (odt_skims['WLK_EXP_WLK_KEYIVT']/100>0) +,walk_heavyrail_available,walk_transit_available & (i_tour_mode >= 12) & (odt_skims['WLK_HVY_WLK_KEYIVT']/100>0) +,walk_commuter_available,walk_transit_available & (i_tour_mode >= 13) & (odt_skims['WLK_COM_WLK_KEYIVT']/100>0) +,drive_local_available_outbound,drive_transit_available & df.outbound & (odt_skims['DRV_LOC_WLK_TOTIVT']/100>0) +,drive_local_available_inbound,drive_transit_available & ~df.outbound & (odt_skims['WLK_LOC_DRV_TOTIVT']/100>0) +,drive_lrf_available_outbound,drive_transit_available & df.outbound & (i_tour_mode >= 15) & (odt_skims['DRV_LRF_WLK_KEYIVT']/100>0) +,drive_lrf_available_inbound,drive_transit_available & ~df.outbound & (i_tour_mode >= 15) & (odt_skims['WLK_LRF_DRV_KEYIVT']/100>0) +,drive_express_available_outbound,drive_transit_available & df.outbound & (i_tour_mode >= 16) & (odt_skims['DRV_EXP_WLK_KEYIVT']/100>0) +,drive_express_available_inbound,drive_transit_available & ~df.outbound & (i_tour_mode >= 16) & (odt_skims['WLK_EXP_DRV_KEYIVT']/100>0) +,drive_heavyrail_available_outbound,drive_transit_available & df.outbound & (i_tour_mode >= 17) & (odt_skims['DRV_HVY_WLK_KEYIVT']/100>0) +,drive_heavyrail_available_inbound,drive_transit_available & ~df.outbound & (i_tour_mode >= 17) & (odt_skims['WLK_HVY_DRV_KEYIVT']/100>0) +,drive_commuter_available_outbound,drive_transit_available & df.outbound & (i_tour_mode >= 18) & (odt_skims['DRV_COM_WLK_KEYIVT']/100>0) +,drive_commuter_available_inbound,drive_transit_available & ~df.outbound & (i_tour_mode >= 18) & (odt_skims['WLK_COM_DRV_KEYIVT']/100>0) +,walk_ferry_available,walk_lrf_available & (odt_skims['WLK_LRF_WLK_FERRYIVT']/100>0) +,_drive_ferry_available_outbound,drive_lrf_available_outbound & (odt_skims['DRV_LRF_WLK_FERRYIVT']/100>0) +,_drive_ferry_available_inbound,drive_lrf_available_inbound & (odt_skims['WLK_LRF_DRV_FERRYIVT']/100>0) +,drive_ferry_available,"np.where(df.outbound, _drive_ferry_available_outbound, _drive_ferry_available_inbound)" +#,od_dist_walk,od_skims['DISTWALK'] +#,do_dist_walk,od_skims.reverse('DISTWALK') +#,max_dist_walk,od_skims.max('DISTWALK') +#,dist_bike,od_skims['DISTBIKE'] +#,dist_only,od_skims['DIST'] diff --git a/activitysim/examples/example_mtc_extended/configs/vehicle_allocation.csv b/activitysim/examples/example_mtc_extended/configs/vehicle_allocation.csv new file mode 100644 index 0000000000..7a4bd77971 --- /dev/null +++ b/activitysim/examples/example_mtc_extended/configs/vehicle_allocation.csv @@ -0,0 +1,174 @@ +Label,Description,Expression,veh_num1,veh_num2,veh_num3,veh_num4,non_hh_veh +#,Availability Conditions,,,, +util_alt1_unavail,Household does not own vehicle,"veh_num1.isna() | (veh_num1 == '')",coef_unavail,0,0,0,0 +util_alt2_unavail,Household does not own vehicle,"veh_num2.isna() | (veh_num2 == '')",0,coef_unavail,0,0,0 +util_alt3_unavail,Household does not own vehicle,"veh_num3.isna() | (veh_num3 == '')",0,0,coef_unavail,0,0 +util_alt4_unavail,Household does not own vehicle,"veh_num4.isna() | (veh_num4 == '')",0,0,0,coef_unavail,0 +#,BEV Range,,,, +util_dstgtrng1,Round trip tour distance > BEV range,"@np.where((df.tot_tour_dist > df.Range_1) & (df.fuel_type_1 == 'BEV'), 1, 0)",coef_dstgtrng,0,0,0,0 +util_dstgtrng2,Round trip tour distance > BEV range,"@np.where((df.tot_tour_dist > df.Range_2) & (df.fuel_type_2 == 'BEV'), 1, 0)",0,coef_dstgtrng,0,0,0 +util_dstgtrng3,Round trip tour distance > BEV range,"@np.where((df.tot_tour_dist > df.Range_3) & (df.fuel_type_3 == 'BEV'), 1, 0)",0,0,coef_dstgtrng,0,0 +util_dstgtrng4,Round trip tour distance > BEV range,"@np.where((df.tot_tour_dist > df.Range_4) & (df.fuel_type_4 == 'BEV'), 1, 0)",0,0,0,coef_dstgtrng,0 +#,Vehicles & Driver interactions,,,, +util_vehltdr_nh,Vehicles < Drivers -- Non-Household Vehicle,"hh_veh_lt_drivers",0,0,0,0,coef_vehltdr_nh +util_vehltdr_nh,Vehicles > Drivers -- Non-Household Vehicle,"hh_veh_gt_drivers",0,0,0,0,coef_vehgtdr_nh +util_vehltdr_van1,Vehicles > Drivers -- Van alt 1,"hh_veh_gt_drivers * (body_type_1 == 'Van')",coef_vehltdr_van,0,0,0,0 +util_vehltdr_van2,Vehicles > Drivers -- Van alt 2,"hh_veh_gt_drivers * (body_type_2 == 'Van')",0,coef_vehltdr_van,0,0,0 +util_vehltdr_van3,Vehicles > Drivers -- Van alt 3,"hh_veh_gt_drivers * (body_type_3 == 'Van')",0,0,coef_vehltdr_van,0,0 +util_vehltdr_van4,Vehicles > Drivers -- Van alt 4,"hh_veh_gt_drivers * (body_type_4 == 'Van')",0,0,0,coef_vehltdr_van,0 +util_vehltdr_suv1,Vehicles > Drivers -- SUV alt 1,"hh_veh_gt_drivers * (body_type_1 == 'SUV')",coef_vehltdr_suv,0,0,0,0 +util_vehltdr_suv2,Vehicles > Drivers -- SUV alt 2,"hh_veh_gt_drivers * (body_type_2 == 'SUV')",0,coef_vehltdr_suv,0,0,0 +util_vehltdr_suv3,Vehicles > Drivers -- SUV alt 3,"hh_veh_gt_drivers * (body_type_3 == 'SUV')",0,0,coef_vehltdr_suv,0,0 +util_vehltdr_suv4,Vehicles > Drivers -- SUV alt 4,"hh_veh_gt_drivers * (body_type_4 == 'SUV')",0,0,0,coef_vehltdr_suv,0 +util_vehltdr_pu1,Vehicles > Drivers -- Pickup alt 1,"hh_veh_gt_drivers * (body_type_1 == 'Pickup')",coef_vehltdr_pu,0,0,0,0 +util_vehltdr_pu2,Vehicles > Drivers -- Pickup alt 2,"hh_veh_gt_drivers * (body_type_2 == 'Pickup')",0,coef_vehltdr_pu,0,0,0 +util_vehltdr_pu3,Vehicles > Drivers -- Pickup alt 3,"hh_veh_gt_drivers * (body_type_3 == 'Pickup')",0,0,coef_vehltdr_pu,0,0 +util_vehltdr_pu4,Vehicles > Drivers -- Pickup alt 4,"hh_veh_gt_drivers * (body_type_4 == 'Pickup')",0,0,0,coef_vehltdr_pu,0 +util_vehltdr_mc1,Vehicles > Drivers -- Motorcycle alt 1,"hh_veh_gt_drivers * (body_type_1 == 'Motorcycle')",coef_vehltdr_mc,0,0,0,0 +util_vehltdr_mc2,Vehicles > Drivers -- Motorcycle alt 2,"hh_veh_gt_drivers * (body_type_2 == 'Motorcycle')",0,coef_vehltdr_mc,0,0,0 +util_vehltdr_mc3,Vehicles > Drivers -- Motorcycle alt 3,"hh_veh_gt_drivers * (body_type_3 == 'Motorcycle')",0,0,coef_vehltdr_mc,0,0 +util_vehltdr_mc4,Vehicles > Drivers -- Motorcycle alt 4,"hh_veh_gt_drivers * (body_type_4 == 'Motorcycle')",0,0,0,coef_vehltdr_mc,0 +util_vehltdr_hyb1,Vehicles > Drivers -- Hybrid alt 1,"hh_veh_gt_drivers * (fuel_type_1 == 'Hybrid')",coef_vehltdr_hyb,0,0,0,0 +util_vehltdr_hyb2,Vehicles > Drivers -- Hybrid alt 2,"hh_veh_gt_drivers * (fuel_type_2 == 'Hybrid')",0,coef_vehltdr_hyb,0,0,0 +util_vehltdr_hyb3,Vehicles > Drivers -- Hybrid alt 3,"hh_veh_gt_drivers * (fuel_type_3 == 'Hybrid')",0,0,coef_vehltdr_hyb,0,0 +util_vehltdr_hyb4,Vehicles > Drivers -- Hybrid alt 4,"hh_veh_gt_drivers * (fuel_type_4 == 'Hybrid')",0,0,0,coef_vehltdr_hyb,0 +util_vehltdr_ev1,Vehicles > Drivers -- Hybrid alt 1,"hh_veh_gt_drivers * ((fuel_type_1=='PEV') | (fuel_type_1=='BEV'))",coef_vehltdr_ev,0,0,0,0 +util_vehltdr_ev2,Vehicles > Drivers -- Hybrid alt 2,"hh_veh_gt_drivers * ((fuel_type_2=='PEV') | (fuel_type_2=='BEV'))",0,coef_vehltdr_ev,0,0,0 +util_vehltdr_ev3,Vehicles > Drivers -- Hybrid alt 3,"hh_veh_gt_drivers * ((fuel_type_3=='PEV') | (fuel_type_3=='BEV'))",0,0,coef_vehltdr_ev,0,0 +util_vehltdr_ev4,Vehicles > Drivers -- Hybrid alt 4,"hh_veh_gt_drivers * ((fuel_type_4=='PEV') | (fuel_type_4=='BEV'))",0,0,0,coef_vehltdr_ev,0 +util_vehltdr_age1,Vehicles > Drivers -- Age alt 1,"hh_veh_gt_drivers * age_1",coef_vehltdr_age,0,0,0,0 +util_vehltdr_age2,Vehicles > Drivers -- Age alt 2,"hh_veh_gt_drivers * age_2",0,coef_vehltdr_age,0,0,0 +util_vehltdr_age3,Vehicles > Drivers -- Age alt 3,"hh_veh_gt_drivers * age_3",0,0,coef_vehltdr_age,0,0 +util_vehltdr_age4,Vehicles > Drivers -- Age alt 4,"hh_veh_gt_drivers * age_4",0,0,0,coef_vehltdr_age,0 +#,Occupancy interactions,,,, +util_maxocc_van1,Maximum Occupancy -- Van alt 1,"@occup * (df.body_type_1 == 'Van')",coef_maxocc_van,0,0,0,0 +util_maxocc_van2,Maximum Occupancy -- Van alt 2,"@occup * (df.body_type_2 == 'Van')",0,coef_maxocc_van,0,0,0 +util_maxocc_van3,Maximum Occupancy -- Van alt 3,"@occup * (df.body_type_3 == 'Van')",0,0,coef_maxocc_van,0,0 +util_maxocc_van4,Maximum Occupancy -- Van alt 4,"@occup * (df.body_type_4 == 'Van')",0,0,0,coef_maxocc_van,0 +util_maxocc_suv1,Maximum Occupancy -- SUV alt 1,"@occup * (df.body_type_1 == 'SUV')",coef_maxocc_suv,0,0,0,0 +util_maxocc_suv2,Maximum Occupancy -- SUV alt 2,"@occup * (df.body_type_2 == 'SUV')",0,coef_maxocc_suv,0,0,0 +util_maxocc_suv3,Maximum Occupancy -- SUV alt 3,"@occup * (df.body_type_3 == 'SUV')",0,0,coef_maxocc_suv,0,0 +util_maxocc_suv4,Maximum Occupancy -- SUV alt 4,"@occup * (df.body_type_4 == 'SUV')",0,0,0,coef_maxocc_suv,0 +util_maxocc_pu1,Maximum Occupancy -- Pickup alt 1,"@occup * (df.body_type_1 == 'Pickup')",coef_maxocc_pu,0,0,0,0 +util_maxocc_pu2,Maximum Occupancy -- Pickup alt 2,"@occup * (df.body_type_2 == 'Pickup')",0,coef_maxocc_pu,0,0,0 +util_maxocc_pu3,Maximum Occupancy -- Pickup alt 3,"@occup * (df.body_type_3 == 'Pickup')",0,0,coef_maxocc_pu,0,0 +util_maxocc_pu4,Maximum Occupancy -- Pickup alt 4,"@occup * (df.body_type_4 == 'Pickup')",0,0,0,coef_maxocc_pu,0 +util_maxocc_mc1,Maximum Occupancy -- Motorcycle alt 1,"@occup * (df.body_type_1 == 'Motorcycle')",coef_maxocc_mc,0,0,0,0 +util_maxocc_mc2,Maximum Occupancy -- Motorcycle alt 2,"@occup * (df.body_type_2 == 'Motorcycle')",0,coef_maxocc_mc,0,0,0 +util_maxocc_mc3,Maximum Occupancy -- Motorcycle alt 3,"@occup * (df.body_type_3 == 'Motorcycle')",0,0,coef_maxocc_mc,0,0 +util_maxocc_mc4,Maximum Occupancy -- Motorcycle alt 4,"@occup * (df.body_type_4 == 'Motorcycle')",0,0,0,coef_maxocc_mc,0 +util_maxocc_age1,Maximum Occupancy -- Age alt 1,"@occup * df.age_1",coef_maxocc_age,0,0,0,0 +util_maxocc_age2,Maximum Occupancy -- Age alt 2,"@occup * df.age_2",0,coef_maxocc_age,0,0,0 +util_maxocc_age3,Maximum Occupancy -- Age alt 3,"@occup * df.age_3",0,0,coef_maxocc_age,0,0 +util_maxocc_age4,Maximum Occupancy -- Age alt 4,"@occup * df.age_4",0,0,0,coef_maxocc_age,0 +util_maxocc_nh,Maximum Occupancy -- Age alt 1,"@occup",0,0,0,0,util_maxocc_nh +#,Alternative Specific Constants,,,, +util_non_hh,Non-Household Vehicle Constant,"1",0,0,0,0,coef_non_hh +util_van1,Van ASC alt 1,"(body_type_1 == 'Van')",coef_van,0,0,0,0 +util_van2,Van ASC alt 2,"(body_type_2 == 'Van')",0,coef_van,0,0,0 +util_van3,Van ASC alt 3,"(body_type_3 == 'Van')",0,0,coef_van,0,0 +util_van4,Van ASC alt 4,"(body_type_4 == 'Van')",0,0,0,coef_van,0 +util_suv1,SUV ASC alt 1,"(body_type_1 == 'SUV')",coef_suv,0,0,0,0 +util_suv2,SUV ASC alt 2,"(body_type_2 == 'SUV')",0,coef_suv,0,0,0 +util_suv3,SUV ASC alt 3,"(body_type_3 == 'SUV')",0,0,coef_suv,0,0 +util_suv4,SUV ASC alt 4,"(body_type_4 == 'SUV')",0,0,0,coef_suv,0 +util_pu1,Pickup ASC alt 1,"(body_type_1 == 'Pickup')",coef_pu,0,0,0,0 +util_pu2,Pickup ASC alt 2,"(body_type_2 == 'Pickup')",0,coef_pu,0,0,0 +util_pu3,Pickup ASC alt 3,"(body_type_3 == 'Pickup')",0,0,coef_pu,0,0 +util_pu4,Pickup ASC alt 4,"(body_type_4 == 'Pickup')",0,0,0,coef_pu,0 +util_mc1,Motorcycle ASC alt 1,"(body_type_1 == 'Motorcycle')",coef_mc,0,0,0,0 +util_mc2,Motorcycle ASC alt 2,"(body_type_2 == 'Motorcycle')",0,coef_mc,0,0,0 +util_mc3,Motorcycle ASC alt 3,"(body_type_3 == 'Motorcycle')",0,0,coef_mc,0,0 +util_mc4,Motorcycle ASC alt 4,"(body_type_4 == 'Motorcycle')",0,0,0,coef_mc,0 +util_dsl1,Diesel ASC alt 1,"(fuel_type_1 == 'Diesel')",coef_dsl,0,0,0,0 +util_dsl2,Diesel ASC alt 2,"(fuel_type_2 == 'Diesel')",0,coef_dsl,0,0,0 +util_dsl3,Diesel ASC alt 3,"(fuel_type_3 == 'Diesel')",0,0,coef_dsl,0,0 +util_dsl4,Diesel ASC alt 4,"(fuel_type_4 == 'Diesel')",0,0,0,coef_dsl,0 +util_hyb1,Hybrid ASC alt 1,"(fuel_type_1 == 'Hybrid')",coef_hyb,0,0,0,0 +util_hyb2,Hybrid ASC alt 2,"(fuel_type_2 == 'Hybrid')",0,coef_hyb,0,0,0 +util_hyb3,Hybrid ASC alt 3,"(fuel_type_3 == 'Hybrid')",0,0,coef_hyb,0,0 +util_hyb4,Hybrid ASC alt 4,"(fuel_type_4 == 'Hybrid')",0,0,0,coef_hyb,0 +util_pev1,PEV ASC alt 1,"(fuel_type_1 == 'PEV')",coef_pev,0,0,0,0 +util_pev2,PEV ASC alt 2,"(fuel_type_2 == 'PEV')",0,coef_pev,0,0,0 +util_pev3,PEV ASC alt 3,"(fuel_type_3 == 'PEV')",0,0,coef_pev,0,0 +util_pev4,PEV ASC alt 4,"(fuel_type_4 == 'PEV')",0,0,0,coef_pev,0 +util_bev1,BEV ASC alt 1,"(fuel_type_1 == 'BEV')",coef_bev,0,0,0,0 +util_bev2,BEV ASC alt 2,"(fuel_type_2 == 'BEV')",0,coef_bev,0,0,0 +util_bev3,BEV ASC alt 3,"(fuel_type_3 == 'BEV')",0,0,coef_bev,0,0 +util_bev4,BEV ASC alt 4,"(fuel_type_4 == 'BEV')",0,0,0,coef_bev,0 +util_age2_1,Age 1 alt 1,"(age_1 == 2)",coef_age2,0,0,0,0 +util_age2_2,Age 1 alt 2,"(age_2 == 2)",0,coef_age2,0,0,0 +util_age2_3,Age 1 alt 3,"(age_3 == 2)",0,0,coef_age2,0,0 +util_age2_4,Age 1 alt 4,"(age_4 == 2)",0,0,0,coef_age2,0 +util_age3_1,Age 3 alt 1,"(age_1 == 3)",coef_age3,0,0,0,0 +util_age3_2,Age 3 alt 2,"(age_2 == 3)",0,coef_age3,0,0,0 +util_age3_3,Age 3 alt 3,"(age_3 == 3)",0,0,coef_age3,0,0 +util_age3_4,Age 4 alt 4,"(age_4 == 3)",0,0,0,coef_age3,0 +util_age4_1,Age 4 alt 1,"(age_1 == 4)",coef_age4,0,0,0,0 +util_age4_2,Age 4 alt 2,"(age_2 == 4)",0,coef_age4,0,0,0 +util_age4_3,Age 4 alt 3,"(age_3 == 4)",0,0,coef_age4,0,0 +util_age4_4,Age 3 alt 4,"(age_4 == 4)",0,0,0,coef_age4,0 +util_age5_1,Age 5 alt 1,"(age_1 == 5)",coef_age5,0,0,0,0 +util_age5_2,Age 5 alt 2,"(age_2 == 5)",0,coef_age5,0,0,0 +util_age5_3,Age 5 alt 3,"(age_3 == 5)",0,0,coef_age5,0,0 +util_age5_4,Age 5 alt 4,"(age_4 == 5)",0,0,0,coef_age5,0 +util_age6_1,Age 6 alt 1,"(age_1 == 6)",coef_age6,0,0,0,0 +util_age6_2,Age 6 alt 2,"(age_2 == 6)",0,coef_age6,0,0,0 +util_age6_3,Age 6 alt 3,"(age_3 == 6)",0,0,coef_age6,0,0 +util_age6_4,Age 6 alt 4,"(age_4 == 6)",0,0,0,coef_age6,0 +util_age7_1,Age 7 alt 1,"(age_1 == 7)",coef_age7,0,0,0,0 +util_age7_2,Age 7 alt 2,"(age_2 == 7)",0,coef_age7,0,0,0 +util_age7_3,Age 7 alt 3,"(age_3 == 7)",0,0,coef_age7,0,0 +util_age7_4,Age 7 alt 4,"(age_4 == 7)",0,0,0,coef_age7,0 +util_age8_1,Age 8 alt 1,"(age_1 == 8)",coef_age8,0,0,0,0 +util_age8_2,Age 8 alt 2,"(age_2 == 8)",0,coef_age8,0,0,0 +util_age8_3,Age 8 alt 3,"(age_3 == 8)",0,0,coef_age8,0,0 +util_age8_4,Age 8 alt 4,"(age_4 == 8)",0,0,0,coef_age8,0 +util_age9_1,Age 9 alt 1,"(age_1 == 9)",coef_age9,0,0,0,0 +util_age9_2,Age 9 alt 2,"(age_2 == 9)",0,coef_age9,0,0,0 +util_age9_3,Age 9 alt 3,"(age_3 == 9)",0,0,coef_age9,0,0 +util_age9_4,Age 9 alt 4,"(age_4 == 9)",0,0,0,coef_age9,0 +util_age10_1,Age 10 alt 1,"(age_1 == 10)",coef_age10,0,0,0,0 +util_age10_2,Age 10 alt 2,"(age_2 == 10)",0,coef_age10,0,0,0 +util_age10_3,Age 10 alt 3,"(age_3 == 10)",0,0,coef_age10,0,0 +util_age10_4,Age 10 alt 4,"(age_4 == 10)",0,0,0,coef_age10,0 +util_age11_1,Age 11 alt 1,"(age_1 == 11)",coef_age11,0,0,0,0 +util_age11_2,Age 11 alt 2,"(age_2 == 11)",0,coef_age11,0,0,0 +util_age11_3,Age 11 alt 3,"(age_3 == 11)",0,0,coef_age11,0,0 +util_age11_4,Age 11 alt 4,"(age_4 == 11)",0,0,0,coef_age11,0 +util_age12_1,Age 12 alt 1,"(age_1 == 12)",coef_age12,0,0,0,0 +util_age12_2,Age 12 alt 2,"(age_2 == 12)",0,coef_age12,0,0,0 +util_age12_3,Age 12 alt 3,"(age_3 == 12)",0,0,coef_age12,0,0 +util_age12_4,Age 12 alt 4,"(age_4 == 12)",0,0,0,coef_age12,0 +util_age13_1,Age 13 alt 1,"(age_1 == 13)",coef_age13,0,0,0,0 +util_age13_2,Age 13 alt 2,"(age_2 == 13)",0,coef_age13,0,0,0 +util_age13_3,Age 13 alt 3,"(age_3 == 13)",0,0,coef_age13,0,0 +util_age13_4,Age 13 alt 4,"(age_4 == 13)",0,0,0,coef_age13,0 +util_age14_1,Age 14 alt 1,"(age_1 == 14)",coef_age14,0,0,0,0 +util_age14_2,Age 14 alt 2,"(age_2 == 14)",0,coef_age14,0,0,0 +util_age14_3,Age 14 alt 3,"(age_3 == 14)",0,0,coef_age14,0,0 +util_age14_4,Age 14 alt 4,"(age_4 == 14)",0,0,0,coef_age14,0 +util_age15_1,Age 15 alt 1,"(age_1 == 15)",coef_age15,0,0,0,0 +util_age15_2,Age 15 alt 2,"(age_2 == 15)",0,coef_age15,0,0,0 +util_age15_3,Age 15 alt 3,"(age_3 == 15)",0,0,coef_age15,0,0 +util_age15_4,Age 15 alt 4,"(age_4 == 15)",0,0,0,coef_age15,0 +util_age16_1,Age 16 alt 1,"(age_1 == 16)",coef_age16,0,0,0,0 +util_age16_2,Age 16 alt 2,"(age_2 == 16)",0,coef_age16,0,0,0 +util_age16_3,Age 16 alt 3,"(age_3 == 16)",0,0,coef_age16,0,0 +util_age16_4,Age 16 alt 4,"(age_4 == 16)",0,0,0,coef_age16,0 +util_age17_1,Age 17 alt 1,"(age_1 == 17)",coef_age17,0,0,0,0 +util_age17_2,Age 17 alt 2,"(age_2 == 17)",0,coef_age17,0,0,0 +util_age17_3,Age 17 alt 3,"(age_3 == 17)",0,0,coef_age17,0,0 +util_age17_4,Age 17 alt 4,"(age_4 == 17)",0,0,0,coef_age17,0 +util_age18_1,Age 18 alt 1,"(age_1 == 18)",coef_age18,0,0,0,0 +util_age18_2,Age 18 alt 2,"(age_2 == 18)",0,coef_age18,0,0,0 +util_age18_3,Age 18 alt 3,"(age_3 == 18)",0,0,coef_age18,0,0 +util_age18_4,Age 18 alt 4,"(age_4 == 18)",0,0,0,coef_age18,0 +util_age19_1,Age 19 alt 1,"(age_1 == 19)",coef_age19,0,0,0,0 +util_age19_2,Age 19 alt 2,"(age_2 == 19)",0,coef_age19,0,0,0 +util_age19_3,Age 19 alt 3,"(age_3 == 19)",0,0,coef_age19,0,0 +util_age19_4,Age 19 alt 4,"(age_4 == 19)",0,0,0,coef_age19,0 +util_age20_1,Age 20 alt 1,"(age_1 == 20)",coef_age20,0,0,0,0 +util_age20_2,Age 20 alt 2,"(age_2 == 20)",0,coef_age20,0,0,0 +util_age20_3,Age 20 alt 3,"(age_3 == 20)",0,0,coef_age20,0,0 +util_age20_4,Age 20 alt 4,"(age_4 == 20)",0,0,0,coef_age20,0 diff --git a/activitysim/examples/example_mtc_extended/configs/vehicle_allocation.yaml b/activitysim/examples/example_mtc_extended/configs/vehicle_allocation.yaml new file mode 100644 index 0000000000..23222fd05d --- /dev/null +++ b/activitysim/examples/example_mtc_extended/configs/vehicle_allocation.yaml @@ -0,0 +1,28 @@ +# vehicle_choice.yaml + +# last column in spec needs to be non_hh_veh +SPEC: vehicle_allocation.csv +COEFFICIENTS: vehicle_allocation_coefficients.csv + +LOGIT_TYPE: MNL + +preprocessor: + SPEC: vehicle_allocation_annotate_choosers_preprocessor + DF: choosers + TABLES: + - vehicles + +# will create columns in the tour table selecting a vehicle for each of the following +# occupancy levels. They are named vehicle_occup_1, vehicle_occup_2, ... +# if not supplied, will default to only one occupancy level of 1 +OCCUPANCY_LEVELS: + - 1 + - 2 + - 3.5 + +# optional annotate tours +# annotate_tours: +# SPEC: annotate_tours_vehicle_allocation +# DF: tours +# TABLES: +# - vehicles diff --git a/activitysim/examples/example_mtc_extended/configs/vehicle_allocation_annotate_choosers_preprocessor.csv b/activitysim/examples/example_mtc_extended/configs/vehicle_allocation_annotate_choosers_preprocessor.csv new file mode 100644 index 0000000000..843099a16a --- /dev/null +++ b/activitysim/examples/example_mtc_extended/configs/vehicle_allocation_annotate_choosers_preprocessor.csv @@ -0,0 +1,20 @@ +Description,Target,Expression +Round Trip Tour Distance,tot_tour_dist,"(odt_skims['SOV_DIST'] + dot_skims['SOV_DIST'])" +number of vehicles is greater than the number of drivers,hh_veh_gt_drivers,"np.where(df.auto_ownership > df.num_drivers, 1, 0)" +number of vehicles is less than the number of drivers,hh_veh_lt_drivers,"np.where(df.auto_ownership < df.num_drivers, 1, 0)" +Age of vehicle alternative 1,age_1,"df.veh_num1.astype(str).str.split('_').str[1].fillna(0).astype(int)" +Age of vehicle alternative 2,age_2,"df.veh_num2.astype(str).str.split('_').str[1].fillna(0).astype(int)" +Age of vehicle alternative 3,age_3,"df.veh_num3.astype(str).str.split('_').str[1].fillna(0).astype(int)" +Age of vehicle alternative 4,age_4,"df.veh_num4.astype(str).str.split('_').str[1].fillna(0).astype(int)" +body type of vehicle alternative 1,body_type_1,"df.veh_num1.astype(str).str.split('_').str[0]" +body type of vehicle alternative 2,body_type_2,"df.veh_num2.astype(str).str.split('_').str[0]" +body type of vehicle alternative 3,body_type_3,"df.veh_num3.astype(str).str.split('_').str[0]" +body type of vehicle alternative 4,body_type_4,"df.veh_num4.astype(str).str.split('_').str[0]" +fuel type of vehicle alternative 1,fuel_type_1,"df.veh_num1.astype(str).str.split('_').str[2]" +fuel type of vehicle alternative 2,fuel_type_2,"df.veh_num2.astype(str).str.split('_').str[2]" +fuel type of vehicle alternative 3,fuel_type_3,"df.veh_num3.astype(str).str.split('_').str[2]" +fuel type of vehicle alternative 4,fuel_type_4,"df.veh_num4.astype(str).str.split('_').str[2]" +Range of vehicle alternative 1,Range_1,"reindex(vehicles.groupby('vehicle_type')['Range'].mean(), df.veh_num1)" +Range of vehicle alternative 2,Range_2,"reindex(vehicles.groupby('vehicle_type')['Range'].mean(), df.veh_num2)" +Range of vehicle alternative 3,Range_3,"reindex(vehicles.groupby('vehicle_type')['Range'].mean(), df.veh_num3)" +Range of vehicle alternative 4,Range_4,"reindex(vehicles.groupby('vehicle_type')['Range'].mean(), df.veh_num4)" diff --git a/activitysim/examples/example_mtc_extended/configs/vehicle_allocation_coefficients.csv b/activitysim/examples/example_mtc_extended/configs/vehicle_allocation_coefficients.csv new file mode 100644 index 0000000000..3a1a8fa8f5 --- /dev/null +++ b/activitysim/examples/example_mtc_extended/configs/vehicle_allocation_coefficients.csv @@ -0,0 +1,46 @@ +coefficient_name,value,constrain +coef_unavail,-999,F +coef_dstgtrng,-3.454,F +coef_vehltdr_nh,0.172,F +coef_vehgtdr_nh,-0.212,F +coef_vehltdr_van,0.048,F +coef_vehltdr_suv,0.104,F +coef_vehltdr_pu,-0.011,F +coef_vehltdr_mc,-0.749,F +coef_vehltdr_hyb,0.156,F +coef_vehltdr_ev,0.207,F +coef_vehltdr_age,-0.048,F +coef_maxocc_van,0.570,F +coef_maxocc_suv,0.316,F +coef_maxocc_pu,-0.077,F +coef_maxocc_mc,-0.938,F +coef_maxocc_age,-0.026,F +util_maxocc_nh,-0.212,F +coef_non_hh,-4.549,F +coef_van,-0.942,F +coef_suv,-0.429,F +coef_pu,-0.048,F +coef_mc,-0.470,F +coef_dsl,-0.227,F +coef_hyb,0.024,F +coef_pev,-0.168,F +coef_bev,-0.105,F +coef_age2,0.070,F +coef_age3,0.104,F +coef_age4,0.136,F +coef_age5,0.149,F +coef_age6,0.161,F +coef_age7,0.223,F +coef_age8,0.272,F +coef_age9,0.291,F +coef_age10,0.256,F +coef_age11,0.318,F +coef_age12,0.334,F +coef_age13,0.338,F +coef_age14,0.348,F +coef_age15,0.307,F +coef_age16,0.377,F +coef_age17,0.324,F +coef_age18,0.237,F +coef_age19,0.292,F +coef_age20,-0.181,F diff --git a/activitysim/examples/example_mtc_extended/configs/vehicle_type_choice.yaml b/activitysim/examples/example_mtc_extended/configs/vehicle_type_choice.yaml new file mode 100644 index 0000000000..d0b9a91f63 --- /dev/null +++ b/activitysim/examples/example_mtc_extended/configs/vehicle_type_choice.yaml @@ -0,0 +1,111 @@ +# vehicle_type_choice.yaml + +SPEC: vehicle_type_choice_op4.csv +COEFFICIENTS: vehicle_type_choice_op4_coefficients.csv +ALTS: vehicle_type_choice_op4_alternatives.csv + +# SPEC: vehicle_type_choice_op2.csv +# COEFFICIENTS: vehicle_type_choice_op2_coefficients.csv +# ALTS: vehicle_type_choice_op2_alternatives.csv +# # probs must have body_type and vehicle_year columns +# # probs spec has vehicle age calculated from FLEET_YEAR +# PROBS_SPEC: vehicle_type_choice_op2_fuel_type_probs.csv + +LOGIT_TYPE: MNL + +# options: simple_simulate or interaction_simulate +# if interaction_simulate, will build alteratives from combinatorial_alts below +# if simple_simulate, alternatives need to be specified in the columns of the model spec +SIMULATION_TYPE: interaction_simulate + +# additional vehicle_type_data merged to the alternatives for use in utility expressions +# need to have columns body_type, fuel_type, and vehicle_year +# entries in the data need to match the combinations in combinatorial_alts below +VEHICLE_TYPE_DATA_FILE: vehicle_type_data.csv + +# age is computed as (1 + FLEET_YEAR - vehicle_year) +FLEET_YEAR: 2017 + +# if PROBS_SPEC is supplied, auto operating cost will not be +# merged until after a fuel type is selected +COLS_TO_INCLUDE_IN_VEHICLE_TABLE: + - auto_operating_cost + - Range + - MPG + +# If PROBS_SPEC is supplied, fuel_type will be ignored +combinatorial_alts: + body_type: + - Car + - Van + - SUV + - Pickup + - Motorcycle + age: + - 1 + - 2 + - 3 + - 4 + - 5 + - 6 + - 7 + - 8 + - 9 + - 10 + - 11 + - 12 + - 13 + - 14 + - 15 + - 16 + - 17 + - 18 + - 19 + - 20 + fuel_type: + - Gas + - Diesel + - Hybrid + - PEV + - BEV + +# will write out the created vehicle_type_model_alternatives.csv file +# to the base configs directory. Helpful for debugging alternaties. +WRITE_OUT_ALTS_FILE: False + +preprocessor: + SPEC: vehicle_type_choice_annotate_choosers_preprocessor + DF: choosers + TABLES: + - land_use + - vehicles + - persons + - households + +# annotate_persons: +# SPEC: annotate_persons_vehicle_type +# DF: persons +# TABLES: +# - vehicles +# +# annotate_households: +# SPEC: annotate_households_vehicle_type +# DF: households +# TABLES: +# - persons +# - vehicles +# +# annotate_vehicles: +# SPEC: annotate_households_vehicle_type +# DF: vehicles +# TABLES: + +CONSTANTS: + # Select region for model and input the MSA population + # Expressions for CBSA values are implemented for: + # San Francisco (SFO), San Diego (SAN), Atlanta (ATL), + # Seattle (SEA), Detroit (DET), Minneapolis (MSP), + # Washington DC (DCA), Oregon (OREG), Ohio (OHIO) + CBSA: SFO + MSA_POP: 3320000 + CHARGERS_PER_CAP: 0.000721205 diff --git a/activitysim/examples/example_mtc_extended/configs/vehicle_type_choice_annotate_choosers_preprocessor.csv b/activitysim/examples/example_mtc_extended/configs/vehicle_type_choice_annotate_choosers_preprocessor.csv new file mode 100644 index 0000000000..d0a98ff3c2 --- /dev/null +++ b/activitysim/examples/example_mtc_extended/configs/vehicle_type_choice_annotate_choosers_preprocessor.csv @@ -0,0 +1,15 @@ +Description,Target,Expression +total household distance to work,total_hh_dist_to_work,persons.groupby('household_id')['distance_to_work'].sum().reindex(df.household_id).fillna(0) +total household distance to work capped at 100 mi per worker,total_hh_dist_to_work_cap,"np.where(total_hh_dist_to_work > (100*df.num_workers.values), 100*df.num_workers.values, total_hh_dist_to_work)" +average household distance to work,avg_hh_dist_to_work,persons.groupby('household_id')['distance_to_work'].mean().reindex(df.household_id).fillna(0) +household density per square mile,hh_per_mi,(df.TOTHH.values / df.TOTACRE.values) * 640 +number of vehicles is greater than the number of drivers,hh_veh_gt_drivers,"np.where(df.auto_ownership > df.num_drivers, 1, 0)" +number of household vehicles owned,num_hh_veh_owned,df[df['already_owned_veh'].str.len() > 0].groupby('household_id').size().reindex(df.household_id).fillna(0) +number of household Vans,num_hh_Van,"df[df['already_owned_veh'].str.contains('Van', na=False)].groupby('household_id').size().reindex(df.household_id).fillna(0)" +number of household SUVs,num_hh_SUV,"df[df['already_owned_veh'].str.contains('SUV', na=False)].groupby('household_id').size().reindex(df.household_id).fillna(0)" +number of household Pickups,num_hh_Pickup,"df[df['already_owned_veh'].str.contains('Pickup', na=False)].groupby('household_id').size().reindex(df.household_id).fillna(0)" +number of household Motorcycles,num_hh_Motorcycle,"df[df['already_owned_veh'].str.contains('Motorcycle', na=False)].groupby('household_id').size().reindex(df.household_id).fillna(0)" +number of household Hybrid,num_hh_Hybrid,"df[df['already_owned_veh'].str.contains('Hybrid', na=False)].groupby('household_id').size().reindex(df.household_id).fillna(0)" +number of household BEV,num_hh_BEV,"df[df['already_owned_veh'].str.contains('BEV', na=False)].groupby('household_id').size().reindex(df.household_id).fillna(0)" +number of household PEV,num_hh_PEV,"df[df['already_owned_veh'].str.contains('PEV', na=False)].groupby('household_id').size().reindex(df.household_id).fillna(0)" +number of household EVs,num_hh_EV,"num_hh_BEV + num_hh_PEV" diff --git a/activitysim/examples/example_mtc_extended/configs/vehicle_type_choice_op2.csv b/activitysim/examples/example_mtc_extended/configs/vehicle_type_choice_op2.csv new file mode 100644 index 0000000000..5125645e9f --- /dev/null +++ b/activitysim/examples/example_mtc_extended/configs/vehicle_type_choice_op2.csv @@ -0,0 +1,169 @@ +Label,Description,Expression,Coefficient +#,income,, +util_i025_age,Income $0-25k - Age,"((income < 25000) & (income > -1)) * age",coef_i025_age +util_i2550_age,Income $25-50k - Age,"((income < 50000) & (income >= 25000)) * age",coef_i2550_age +util_i100_age,Income $100-150k - Age,"((income < 150000) & (income >= 100000)) * age",coef_i100_age +util_i150p_age,Income $150k+ - Age,"(income > 150000) * age",coef_i150p_age +util_i025_van,Income $0-25k - Van,"((income < 25000) & (income > -1)) & (body_type == 'Van')",coef_i025_van +util_i2550_van,Income $25-50k - Van,"((income < 50000) & (income >= 25000)) & (body_type == 'Van')",coef_i2550_van +util_i100_van,Income $100-150k - Van,"((income < 150000) & (income >= 100000)) & (body_type == 'Van')",coef_i100_van +util_i150p_van,Income $150k+ - Van,"(income > 150000) & (body_type == 'Van')",coef_i150p_van +util_i025_suv,Income $0-25k - SUV,"((income < 25000) & (income > -1)) & (body_type == 'SUV')",coef_i025_suv +util_i2550_suv,Income $25-50k - SUV,"((income < 50000) & (income >= 25000)) & (body_type == 'SUV')",coef_i2550_suv +util_i100_suv,Income $100-150k - SUV,"((income < 150000) & (income >= 100000)) & (body_type == 'SUV')",coef_i100_suv +util_i150p_suv,Income $150k+ - SUV,"(income > 150000) & (body_type == 'SUV')",coef_i150p_suv +util_i025_pu,Income $0-25k - Pickup,"((income < 25000) & (income > -1)) & (body_type == 'Pickup')",coef_i025_pu +util_i2550_pu,Income $25-50k - Pickup,"((income < 50000) & (income >= 25000)) & (body_type == 'Pickup')",coef_i2550_pu +util_i100_pu,Income $100-150k - Pickup,"((income < 150000) & (income >= 100000)) & (body_type == 'Pickup')",coef_i100_pu +util_i150p_pu,Income $150k+ - Pickup,"(income > 150000) & (body_type == 'Pickup')",coef_i150p_pu +util_i025_mc,Income $0-25k - Motorcycle,"((income < 25000) & (income > -1)) & (body_type == 'Motorcycle')",coef_i025_mc +util_i2550_mc,Income $25-50k - Motorcycle,"((income < 50000) & (income >= 25000)) & (body_type == 'Motorcycle')",coef_i2550_mc +util_i100_mc,Income $100-150k - Motorcycle,"((income < 150000) & (income >= 100000)) & (body_type == 'Motorcycle')",coef_i100_mc +util_i150p_mc,Income $150k+ - Motorcycle,"(income > 150000) & (body_type == 'Motorcycle')",coef_i150p_mc +util_imiss_van,Income Missing - Van,"((income < 0) | income.isna()) & (body_type == 'Van')",coef_imiss_van +util_imiss_suv,Income Missing - SUV,"((income < 0) | income.isna()) & (body_type == 'SUV')",coef_imiss_suv +util_imiss_pu,Income Missing - Pickup,"((income < 0) | income.isna()) & (body_type == 'Pickup')",coef_imiss_pu +util_imiss_mc,Income Missing - Motorcycle,"((income < 0) | income.isna()) & (body_type == 'Motorcycle')",coef_imiss_mc +util_imiss_age,Income Missing - Age,"((income < 0) | income.isna()) * age",coef_imiss_age +#,household density variables,, +util_den3_van,500-999 HH / sq mi Van,"((hh_per_mi < 1000) & (hh_per_mi >= 500)) & (body_type == 'Van')",coef_den3_van +util_den4_van,1000-1999 HH / sq mi Van,"((hh_per_mi < 2000) & (hh_per_mi >= 1000)) & (body_type == 'Van')",coef_den4_van +util_den5_van,2000-3999 HH / sq mi Van,"((hh_per_mi < 4000) & (hh_per_mi >= 2000)) & (body_type == 'Van')",coef_den5_van +util_den6_van,4000-9999 HH / sq mi Van,"((hh_per_mi < 10000) & (hh_per_mi >= 4000)) & (body_type == 'Van')",coef_den6_van +util_den7_van,10000-24999 HH / sq mi Van,"((hh_per_mi < 25000) & (hh_per_mi >= 10000)) & (body_type == 'Van')",coef_den7_van +util_den8_van,25000+ HH / sq mi Van,"(hh_per_mi >= 25000) & (body_type == 'Van')",coef_den8_van +util_den3_suv,500-999 HH / sq mi SUV,"((hh_per_mi < 1000) & (hh_per_mi >= 500)) & (body_type == 'SUV')",coef_den3_suv +util_den4_suv,1000-1999 HH / sq mi SUV,"((hh_per_mi < 2000) & (hh_per_mi >= 1000)) & (body_type == 'SUV')",coef_den4_suv +util_den5_suv,2000-3999 HH / sq mi SUV,"((hh_per_mi < 4000) & (hh_per_mi >= 2000)) & (body_type == 'SUV')",coef_den5_suv +util_den6_suv,4000-9999 HH / sq mi SUV,"((hh_per_mi < 10000) & (hh_per_mi >= 4000)) & (body_type == 'SUV')",coef_den6_suv +util_den7_suv,10000-24999 HH / sq mi SUV,"((hh_per_mi < 25000) & (hh_per_mi >= 10000)) & (body_type == 'SUV')",coef_den7_suv +util_den8_suv,25000+ HH / sq mi SUV,"(hh_per_mi >= 25000) & (body_type == 'SUV')",coef_den8_suv +util_den3_pu,500-999 HH / sq mi Pickup,"((hh_per_mi < 1000) & (hh_per_mi >= 500)) & (body_type == 'Pickup')",coef_den3_pu +util_den4_pu,1000-1999 HH / sq mi Pickup,"((hh_per_mi < 2000) & (hh_per_mi >= 1000)) & (body_type == 'Pickup')",coef_den4_pu +util_den5_pu,2000-3999 HH / sq mi Pickup,"((hh_per_mi < 4000) & (hh_per_mi >= 2000)) & (body_type == 'Pickup')",coef_den5_pu +util_den6_pu,4000-9999 HH / sq mi Pickup,"((hh_per_mi < 10000) & (hh_per_mi >= 4000)) & (body_type == 'Pickup')",coef_den6_pu +util_den7_pu,10000-24999 HH / sq mi Pickup,"((hh_per_mi < 25000) & (hh_per_mi >= 10000)) & (body_type == 'Pickup')",coef_den7_pu +util_den8_mc,25000+ HH / sq mi Pickup,"(hh_per_mi >= 25000) & (body_type == 'Pickup')",coef_den8_pu +util_den3_mc,500-999 HH / sq mi Motorcycle,"((hh_per_mi < 1000) & (hh_per_mi >= 500)) & (body_type == 'Motorcycle')",coef_den3_mc +util_den4_mc,1000-1999 HH / sq mi Motorcycle,"((hh_per_mi < 2000) & (hh_per_mi >= 1000)) & (body_type == 'Motorcycle')",coef_den4_mc +util_den5_mc,2000-3999 HH / sq mi Motorcycle,"((hh_per_mi < 4000) & (hh_per_mi >= 2000)) & (body_type == 'Motorcycle')",coef_den5_mc +util_den6_mc,4000-9999 HH / sq mi Motorcycle,"((hh_per_mi < 10000) & (hh_per_mi >= 4000)) & (body_type == 'Motorcycle')",coef_den6_mc +util_den7_mc,10000-24999 HH / sq mi Motorcycle,"((hh_per_mi < 25000) & (hh_per_mi >= 10000)) & (body_type == 'Motorcycle')",coef_den7_mc +util_den8_mc,25000+ HH / sq mi Motorcycle,"(hh_per_mi >= 25000) & (body_type == 'Motorcycle')",coef_den8_mc +#,household interactions,, +util_oneveh_age,Household owns 1 vehicle * Age,"(auto_ownership == 1) * age",coef_oneveh_age +util_vhgtdr_van,Household vehicles gt drivers for Van,hh_veh_gt_drivers * (body_type == 'Van'),coef_vhgtdr_van +util_vhgtdr_suv,Household vehicles gt drivers for SUV,hh_veh_gt_drivers * (body_type == 'SUV'),coef_vhgtdr_suv +util_vhgtdr_pu,Household vehicles gt drivers for Pickup,hh_veh_gt_drivers * (body_type == 'Pickup'),coef_vhgtdr_pu +util_vhgtdr_mc,Household vehicles gt drivers for Motorcycle,hh_veh_gt_drivers * (body_type == 'Motorcycle'),coef_vhgtdr_mc +util_vhgtdr_age,Household vehicles gt drivers for age,hh_veh_gt_drivers * age,coef_vhgtdr_age +#,interacting with number of children,, +util_nchld_van,Number of children max 3 * Van,num_children.clip(upper=3) * (body_type == 'Van'),coef_nchld_van +util_nchld_suv,Number of children max 3 * SUV,num_children.clip(upper=3) * (body_type == 'SUV'),coef_nchld_suv +util_nchld_pu,Number of children max 3 * Pickup,num_children.clip(upper=3) * (body_type == 'Pickup'),coef_nchld_pu +util_nchld_mc,Number of children max 3 * Motorcycle,num_children.clip(upper=3) * (body_type == 'Motorcycle'),coef_nchld_mc +util_nchld_age,Number of children max 3 * age,num_children.clip(upper=3) * age,coef_nchld_age +util_dstwkt_age,Total distance to work * age,total_hh_dist_to_work_cap * age,coef_dstwkt_age +#,household already owning vehicles,, +util_van_van,Household already owns a Van -- Van,"(num_hh_Van > 0) & (body_type == 'Van')",coef_van_van +util_van_suv,Household already owns a Van -- SUV,"(num_hh_Van > 0) & (body_type == 'SUV')",coef_van_suv +util_van_pu,Household already owns a Van -- Pickup,"(num_hh_Van > 0) & (body_type == 'Pickup')",coef_van_pu +util_van_mc,Household already owns a Van -- Motorcycle,"(num_hh_Van > 0) & (body_type == 'Motorcycle')",coef_van_mc +util_van_suv,Household already owns an SUV -- Van (symmetrical with above),"(num_hh_SUV > 0) & (body_type == 'Van')",coef_van_suv +util_suv_suv,Household already owns an SUV -- SUV,"(num_hh_SUV > 0) & (body_type == 'SUV')",coef_suv_suv +util_suv_pu,Household already owns an SUV -- Pickup,"(num_hh_SUV > 0) & (body_type == 'Pickup')",coef_suv_pu +util_suv_mc,Household already owns an SUV -- Motorcycle,"(num_hh_SUV > 0) & (body_type == 'Motorcycle')",coef_suv_mc +util_van_pu,Household already owns a Pickup -- Van (symmetrical with above),"(num_hh_Pickup > 0) & (body_type == 'Van')",coef_van_pu +util_suv_pu,Household already owns a Pickup -- SUV (symmetrical with above),"(num_hh_Pickup > 0) & (body_type == 'SUV')",coef_suv_pu +util_pu_pu,Household already owns a Pickup -- Pickup,"(num_hh_Pickup > 0) & (body_type == 'Pickup')",coef_pu_pu +util_pu_mc,Household already owns a Pickup -- Motorcycle,"(num_hh_Pickup > 0) & (body_type == 'Motorcycle')",coef_pu_mc +util_van_mc,Household already owns a Motorcycle -- Van (symmetrical with above),"(num_hh_Motorcycle > 0) & (body_type == 'Van')",coef_van_mc +util_suv_mc,Household already owns a Motorcycle -- SUV (symmetrical with above),"(num_hh_Motorcycle > 0) & (body_type == 'SUV')",coef_suv_mc +util_pu_mc,Household already owns a Motorcycle -- Pickup (symmetrical with above),"(num_hh_Motorcycle > 0) & (body_type == 'Pickup')",coef_pu_mc +util_mc_mc,Household already owns a Motorcycle -- Motorcycle,"(num_hh_Motorcycle > 0) & (body_type == 'Motorcycle')",coef_mc_mc +util_only_van,Household only owns Vans,"(num_hh_Van > 0) & (num_hh_Van == num_hh_veh_owned) & (body_type == 'Van')",coef_only_van +util_only_suv,Household only owns SUVs,"(num_hh_SUV > 0) & (num_hh_SUV == num_hh_veh_owned) & (body_type == 'SUV')",coef_only_suv +util_only_pu,Household only owns Pickups,"(num_hh_Pickup > 0) & (num_hh_Pickup == num_hh_veh_owned) & (body_type == 'Pickup')",coef_only_pu +util_only_mc,Household only owns Motorcycles,"(num_hh_Motorcycle > 0) & (num_hh_Motorcycle == num_hh_veh_owned) & (body_type == 'Motorcycle')",coef_only_mc +#,constants,, +util_van,Van ASC,(body_type == 'Van'),coef_van +util_suv,SUV ASC,(body_type == 'SUV'),coef_suv +util_pu,Pickup ASC,(body_type == 'Pickup'),coef_pu +util_mc,Motorcycle ASC,(body_type == 'Motorcycle'),coef_mc +util_age2,Age 2 ASC,(age==2),coef_age2 +util_age3,Age 3 ASC,(age==3),coef_age3 +util_age4,Age 4 ASC,(age==4),coef_age4 +util_age5,Age 5 ASC,(age==5),coef_age5 +util_age6,Age 6 ASC,(age==6),coef_age6 +util_age7,Age 7 ASC,(age==7),coef_age7 +util_age8,Age 8 ASC,(age==8),coef_age8 +util_age9,Age 9 ASC,(age==9),coef_age9 +util_age10,Age 10 ASC,(age==10),coef_age10 +util_age11,Age 11 ASC,(age==11),coef_age11 +util_age12,Age 12 ASC,(age==12),coef_age12 +util_age13,Age 13 ASC,(age==13),coef_age13 +util_age14,Age 14 ASC,(age==14),coef_age14 +util_age15,Age 15 ASC,(age==15),coef_age15 +util_age16,Age 16 ASC,(age==16),coef_age16 +util_age17,Age 17 ASC,(age==17),coef_age17 +util_age18,Age 18 ASC,(age==18),coef_age18 +util_age19,Age 19 ASC,(age==19),coef_age19 +util_age20,Age 20 ASC,(age==20),coef_age20 +#,rural household coefficients,, +util_rural_van,Household is in Rural Area - Van,"home_is_rural & (body_type == 'Van')",coef_rural_van +util_rural_suv,Household is in Rural Area - SUV,"home_is_rural & (body_type == 'SUV')",coef_rural_suv +util_rural_pu,Household is in Rural Area - Pickup,"home_is_rural & (body_type == 'Pickup')",coef_rural_pu +util_rural_mc,Household is in Rural Area - Motorcycle,"home_is_rural & (body_type == 'Motorcycle')",coef_rural_mc +util_rural_age,Household is in Rural Area - Age,"home_is_rural * age",coef_rural_age +#,MSA population coefficients,, +util_smsa_van,MSA population less than 1 million - Van,"@(MSA_POP < 1000000) * (df.body_type == 'Van')",coef_smsa_van +util_smsa_suv,MSA population less than 1 million - SUV,"@(MSA_POP < 1000000) * (df.body_type == 'SUV')",coef_smsa_suv +util_smsa_pu,MSA population less than 1 million - Pickup,"@(MSA_POP < 1000000) * (df.body_type == 'Pickup')",coef_smsa_pu +util_smsa_mc,MSA population less than 1 million - Motorcycle,"@(MSA_POP < 1000000) * (df.body_type == 'Motorcycle')",coef_smsa_mc +util_smsa_age,MSA population less than 1 million - Age,"@(MSA_POP < 1000000) * df.age",coef_smsa_age +#,Region Specific Constants,, +util_sfo_van,SF and San Jose - Van,"@(CBSA == 'SFO') * (df.body_type == 'Van')",coef_sfo_van +util_sfo_suv,SF and San Jose - SUV,"@(CBSA == 'SFO') * (df.body_type == 'SUV')",coef_sfo_suv +util_sfo_pu,SF and San Jose - Pickup,"@(CBSA == 'SFO') * (df.body_type == 'Pickup')",coef_sfo_pu +util_sfo_mc,SF and San Jose - Motorcycle,"@(CBSA == 'SFO') * (df.body_type == 'Motorcycle')",coef_sfo_mc +util_sfo_age,SF and San Jose - Age,"@(CBSA == 'SFO') * df.age",coef_sfo_age +util_san_van,San Diego - Van,"@(CBSA == 'SAN') * (df.body_type == 'Van')",coef_san_van +util_san_suv,San Diego - SUV,"@(CBSA == 'SAN') * (df.body_type == 'SUV')",coef_san_suv +util_san_pu,San Diego - Pickup,"@(CBSA == 'SAN') * (df.body_type == 'Pickup')",coef_san_pu +util_san_mc,San Diego - Motorcycle,"@(CBSA == 'SAN') * (df.body_type == 'Motorcycle')",coef_san_mc +util_san_age,San Diego - Age,"@(CBSA == 'SAN') * df.age",coef_san_age +util_atl_van,Atlanta - Van,"@(CBSA == 'ATL') * (df.body_type == 'Van')",coef_atl_van +util_atl_suv,Atlanta - SUV,"@(CBSA == 'ATL') * (df.body_type == 'SUV')",coef_atl_suv +util_atl_pu,Atlanta - Pickup,"@(CBSA == 'ATL') * (df.body_type == 'Pickup')",coef_atl_pu +util_atl_mc,Atlanta - Motorcycle,"@(CBSA == 'ATL') * (df.body_type == 'Motorcycle')",coef_atl_mc +util_atl_age,Atlanta - Age,"@(CBSA == 'ATL') * df.age",coef_atl_age +util_sea_van,Seattle - Van,"@(CBSA == 'SEA') * (df.body_type == 'Van')",coef_sea_van +util_sea_suv,Seattle - SUV,"@(CBSA == 'SEA') * (df.body_type == 'SUV')",coef_sea_suv +util_sea_pu,Seattle - Pickup,"@(CBSA == 'SEA') * (df.body_type == 'Pickup')",coef_sea_pu +util_sea_mc,Seattle - Motorcycle,"@(CBSA == 'SEA') * (df.body_type == 'Motorcycle')",coef_sea_mc +util_sea_age,Seattle - Age,"@(CBSA == 'SEA') * df.age",coef_sea_age +util_det_van,Detroit - Van,"@(CBSA == 'DET') * (df.body_type == 'Van')",coef_det_van +util_det_suv,Detroit - SUV,"@(CBSA == 'DET') * (df.body_type == 'SUV')",coef_det_suv +util_det_pu,Detroit - Pickup,"@(CBSA == 'DET') * (df.body_type == 'Pickup')",coef_det_pu +util_det_mc,Detroit - Motorcycle,"@(CBSA == 'DET') * (df.body_type == 'Motorcycle')",coef_det_mc +util_det_age,Detroit - Age,"@(CBSA == 'DET') * df.age",coef_det_age +util_msp_van,Minneapolis - Van,"@(CBSA == 'MSP') * (df.body_type == 'Van')",coef_msp_van +util_msp_suv,Minneapolis - SUV,"@(CBSA == 'MSP') * (df.body_type == 'SUV')",coef_msp_suv +util_msp_pu,Minneapolis - Pickup,"@(CBSA == 'MSP') * (df.body_type == 'Pickup')",coef_msp_pu +util_msp_mc,Minneapolis - Motorcycle,"@(CBSA == 'MSP') * (df.body_type == 'Motorcycle')",coef_msp_mc +util_msp_age,Minneapolis - Age,"@(CBSA == 'MSP') * df.age",coef_msp_age +util_dca_van,Washington DC - Van,"@(CBSA == 'DCA') * (df.body_type == 'Van')",coef_dca_van +util_dca_suv,Washington DC - SUV,"@(CBSA == 'DCA') * (df.body_type == 'SUV')",coef_dca_suv +util_dca_pu,Washington DC - Pickup,"@(CBSA == 'DCA') * (df.body_type == 'Pickup')",coef_dca_pu +util_dca_mc,Washington DC - Motorcycle,"@(CBSA == 'DCA') * (df.body_type == 'Motorcycle')",coef_dca_mc +util_dca_age,Washington DC - Age,"@(CBSA == 'DCA') * df.age",coef_dca_age +util_oreg_van,Oregon - Van,"@(CBSA == 'OREG') * (df.body_type == 'Van')",coef_oreg_van +util_oreg_suv,Oregon - SUV,"@(CBSA == 'OREG') * (df.body_type == 'SUV')",coef_oreg_suv +util_oreg_pu,Oregon - Pickup,"@(CBSA == 'OREG') * (df.body_type == 'Pickup')",coef_oreg_pu +util_oreg_mc,Oregon - Motorcycle,"@(CBSA == 'OREG') * (df.body_type == 'Motorcycle')",coef_oreg_mc +util_oreg_age,Oregon - Age,"@(CBSA == 'OREG') * df.age",coef_oreg_age +util_ohio_van,Ohio - Van,"@(CBSA == 'OHIO') * (df.body_type == 'Van')",coef_ohio_van +util_ohio_suv,Ohio - SUV,"@(CBSA == 'OHIO') * (df.body_type == 'SUV')",coef_ohio_suv +util_ohio_pu,Ohio - Pickup,"@(CBSA == 'OHIO') * (df.body_type == 'Pickup')",coef_ohio_pu +util_ohio_mc,Ohio - Motorcycle,"@(CBSA == 'OHIO') * (df.body_type == 'Motorcycle')",coef_ohio_mc +util_ohio_age,Ohio - Age,"@(CBSA == 'OHIO') * df.age",coef_ohio_age diff --git a/activitysim/examples/example_mtc_extended/configs/vehicle_type_choice_op2_coefficients.csv b/activitysim/examples/example_mtc_extended/configs/vehicle_type_choice_op2_coefficients.csv new file mode 100644 index 0000000000..e15f71f44a --- /dev/null +++ b/activitysim/examples/example_mtc_extended/configs/vehicle_type_choice_op2_coefficients.csv @@ -0,0 +1,154 @@ +coefficient_name,value,constrain +coef_i025_age,0.102,F +coef_i2550_age,0.044,F +coef_i100_age,-0.034,F +coef_i150p_age,-0.062,F +coef_i025_van,0.252,F +coef_i2550_van,0.135,F +coef_i100_van,-0.082,F +coef_i150p_van,-0.332,F +coef_i025_suv,-0.430,F +coef_i2550_suv,-0.188,F +coef_i100_suv,0.125,F +coef_i150p_suv,0.227,F +coef_i025_pu,0.035,F +coef_i2550_pu,0.080,F +coef_i100_pu,-0.146,F +coef_i150p_pu,-0.423,F +coef_i025_mc,0.052,F +coef_i2550_mc,0.097,F +coef_i100_mc,-0.100,F +coef_i150p_mc,-0.377,F +coef_imiss_van,0.184,F +coef_imiss_suv,-0.014,F +coef_imiss_pu,-0.052,F +coef_imiss_mc,-0.483,F +coef_imiss_age,0.003,F +coef_den3_van,-0.017,F +coef_den4_van,-0.089,F +coef_den5_van,-0.203,F +coef_den6_van,-0.421,F +coef_den7_van,-0.714,F +coef_den8_van,-0.504,F +coef_den3_suv,0.001,F +coef_den4_suv,-0.084,F +coef_den5_suv,-0.200,F +coef_den6_suv,-0.412,F +coef_den7_suv,-0.475,F +coef_den8_suv,-0.513,F +coef_den3_pu,-0.174,F +coef_den4_pu,-0.233,F +coef_den5_pu,-0.342,F +coef_den6_pu,-0.759,F +coef_den7_pu,-1.193,F +coef_den8_pu,-2.018,F +coef_den3_mc,-0.035,F +coef_den4_mc,0.016,F +coef_den5_mc,0.213,F +coef_den6_mc,0.444,F +coef_den7_mc,1.104,F +coef_den8_mc,1.417,F +coef_oneveh_age,-0.032,F +coef_vhgtdr_van,-0.002,F +coef_vhgtdr_suv,-0.146,F +coef_vhgtdr_pu,0.416,F +coef_vhgtdr_mc,2.494,F +coef_vhgtdr_age,0.073,F +coef_nchld_van,0.563,F +coef_nchld_suv,0.183,F +coef_nchld_pu,0.035,F +coef_nchld_mc,-0.005,F +coef_nchld_age,-0.00053,F +coef_dstwkt_age,-0.00013,F +coef_van_van,0.057,F +coef_van_suv,-0.465,F +coef_van_pu,-0.090,F +coef_van_mc,0.540,F +coef_suv_suv,-0.183,F +coef_suv_pu,0.214,F +coef_suv_mc,0.980,F +coef_pu_pu,-0.136,F +coef_pu_mc,1.348,F +coef_mc_mc,3.424,F +coef_only_van,-0.336,F +coef_only_suv,-0.005,F +coef_only_pu,-0.852,F +coef_only_mc,-1.109,F +coef_van,-2.426,F +coef_suv,-0.653,F +coef_pu,-1.184,F +coef_mc,-5.314,F +coef_age2,0.083,F +coef_age3,0.031,F +coef_age4,-0.009,F +coef_age5,-0.145,F +coef_age6,-0.360,F +coef_age7,-.407,F +coef_age8,-.603,F +coef_age9,-0.354,F +coef_age10,-0.389,F +coef_age11,-0.462,F +coef_age12,-0.536,F +coef_age13,-0.684,F +coef_age14,-0.844,F +coef_age15,-1.023,F +coef_age16,-1.178,F +coef_age17,-1.357,F +coef_age18,-1.655,F +coef_age19,-1.957,F +coef_age20,-0.339,F +coef_rural_van,0.225,F +coef_rural_suv,0.190,F +coef_rural_pu,0.814,F +coef_rural_mc,-0.037,F +coef_rural_age,0.11,F +coef_smsa_van,0.127,F +coef_smsa_suv,0.033,F +coef_smsa_pu,0.333,F +coef_smsa_mc,0.102,F +coef_smsa_age,0.013,F +coef_sfo_van,0.104,F +coef_sfo_suv,-0.440,F +coef_sfo_pu,-0.421,F +coef_sfo_mc,-0.035,F +coef_sfo_age,0.050,F +coef_san_van,0.075,F +coef_san_suv,-0.154,F +coef_san_pu,-0.124,F +coef_san_mc,-0.105,F +coef_san_age,0.026,F +coef_atl_van,-0.145,F +coef_atl_suv,-0.069,F +coef_atl_pu,-0.123,F +coef_atl_mc,-0.212,F +coef_atl_age,0.015,F +coef_sea_van,0.146,F +coef_sea_suv,-0.175,F +coef_sea_pu,-0.065,F +coef_sea_mc,-0.192,F +coef_sea_age,0.056,F +coef_det_van,0.642,F +coef_det_suv,0.269,F +coef_det_pu,-0.237,F +coef_det_mc,0.371,F +coef_det_age,-0.043,F +coef_msp_van,0.291,F +coef_msp_suv,-0.064,F +coef_msp_pu,-0.095,F +coef_msp_mc,0.033,F +coef_msp_age,0.010,F +coef_dca_van,0.039,F +coef_dca_suv,0.284,F +coef_dca_pu,-0.455,F +coef_dca_mc,-0.015,F +coef_dca_age,-0.037,F +coef_oreg_van,0.079,F +coef_oreg_suv,-0.134,F +coef_oreg_pu,0.276,F +coef_oreg_mc,0.137,F +coef_oreg_age,0.055,F +coef_ohio_van,0.164,F +coef_ohio_suv,-0.135,F +coef_ohio_pu,-0.391,F +coef_ohio_mc,0.145,F +coef_ohio_age,-0.008,F diff --git a/activitysim/examples/example_mtc_extended/configs/vehicle_type_choice_op2_fuel_type_probs.csv b/activitysim/examples/example_mtc_extended/configs/vehicle_type_choice_op2_fuel_type_probs.csv new file mode 100644 index 0000000000..80a2619cb1 --- /dev/null +++ b/activitysim/examples/example_mtc_extended/configs/vehicle_type_choice_op2_fuel_type_probs.csv @@ -0,0 +1,101 @@ +body_type,vehicle_year,Gas,Diesel,Hybrid,PEV,BEV +Car,2017,0.9205,0.002,0.0468,0.0153,0.0155 +Car,2016,0.9095,0.012,0.0546,0.0082,0.0157 +Car,2015,0.9038,0.0163,0.0595,0.0115,0.0088 +Car,2014,0.8951,0.0167,0.0684,0.0107,0.009 +Car,2013,0.9079,0.0155,0.0646,0.0065,0.0054 +Car,2012,0.9365,0.0137,0.0436,0.0019,0.0043 +Car,2011,0.9131,0.0117,0.0744,0.0006,0.0002 +Car,2010,0.9541,0.0096,0.0355,0.0007,0.0 +Car,2009,0.9548,0.0037,0.0409,0.0004,0.0001 +Car,2008,0.953,0.0015,0.0451,0.0003,0.0001 +Car,2007,0.9676,0.0096,0.0225,0.0003,0.0 +Car,2006,0.963,0.0059,0.0306,0.0003,0.0002 +Car,2005,0.9773,0.0061,0.0164,0.0,0.0002 +Car,2004,0.9808,0.0107,0.0082,0.0002,0.0 +Car,2003,0.9844,0.0088,0.0065,0.0,0.0003 +Car,2002,0.9894,0.0056,0.005,0.0,0.0 +Car,2001,0.9947,0.0031,0.0022,0.0,0.0 +Car,2000,0.9934,0.0066,0.0,0.0,0.0 +Car,1999,0.994,0.005,0.0,0.0,0.001 +Car,1998,0.9877,0.012,0.0002,0.0,0.0002 +Van,2017,0.9728,0.0163,0.0072,0.0036,0.0 +Van,2016,0.9927,0.0073,0.0,0.0,0.0 +Van,2015,0.9873,0.0089,0.0025,0.0,0.0013 +Van,2014,0.9889,0.0063,0.0047,0.0,0.0 +Van,2013,0.992,0.004,0.0027,0.0013,0.0 +Van,2012,0.9965,0.0035,0.0,0.0,0.0 +Van,2011,0.9968,0.0032,0.0,0.0,0.0 +Van,2010,0.9977,0.0,0.0023,0.0,0.0 +Van,2009,0.9907,0.0093,0.0,0.0,0.0 +Van,2008,0.9973,0.0027,0.0,0.0,0.0 +Van,2007,0.9849,0.0151,0.0,0.0,0.0 +Van,2006,0.9927,0.0063,0.001,0.0,0.0 +Van,2005,0.9886,0.0114,0.0,0.0,0.0 +Van,2004,0.9982,0.0018,0.0,0.0,0.0 +Van,2003,0.9944,0.0037,0.0019,0.0,0.0 +Van,2002,0.9979,0.0021,0.0,0.0,0.0 +Van,2001,0.9943,0.0057,0.0,0.0,0.0 +Van,2000,0.997,0.003,0.0,0.0,0.0 +Van,1999,0.9918,0.0082,0.0,0.0,0.0 +Van,1998,0.981,0.019,0.0,0.0,0.0 +SUV,2017,0.9802,0.003,0.0136,0.002,0.0012 +SUV,2016,0.984,0.0104,0.0052,0.0003,0.0 +SUV,2015,0.9821,0.0131,0.0044,0.0,0.0004 +SUV,2014,0.986,0.0044,0.0087,0.0004,0.0004 +SUV,2013,0.9835,0.0102,0.0058,0.0003,0.0003 +SUV,2012,0.9874,0.0054,0.0072,0.0,0.0 +SUV,2011,0.9826,0.0039,0.0131,0.0004,0.0 +SUV,2010,0.9837,0.001,0.0154,0.0,0.0 +SUV,2009,0.9757,0.0019,0.0218,0.0006,0.0 +SUV,2008,0.9784,0.0027,0.0185,0.0003,0.0 +SUV,2007,0.9667,0.0042,0.0291,0.0,0.0 +SUV,2006,0.9881,0.0079,0.004,0.0,0.0 +SUV,2005,0.9962,0.0038,0.0,0.0,0.0 +SUV,2004,0.9939,0.0056,0.0005,0.0,0.0 +SUV,2003,0.9889,0.0111,0.0,0.0,0.0 +SUV,2002,0.9921,0.0079,0.0,0.0,0.0 +SUV,2001,0.9807,0.0167,0.0026,0.0,0.0 +SUV,2000,1.0,0.0,0.0,0.0,0.0 +SUV,1999,0.9956,0.0029,0.0015,0.0,0.0 +SUV,1998,0.9927,0.0073,0.0,0.0,0.0 +Pickup,2017,0.8568,0.1427,0.0005,0.0,0.0 +Pickup,2016,0.8575,0.1421,0.0,0.0,0.0004 +Pickup,2015,0.9087,0.0913,0.0,0.0,0.0 +Pickup,2014,0.9142,0.0848,0.0011,0.0,0.0 +Pickup,2013,0.8758,0.1242,0.0,0.0,0.0 +Pickup,2012,0.8668,0.132,0.0012,0.0,0.0 +Pickup,2011,0.9345,0.0648,0.0007,0.0,0.0 +Pickup,2010,0.91,0.0892,0.0008,0.0,0.0 +Pickup,2009,0.873,0.127,0.0,0.0,0.0 +Pickup,2008,0.8952,0.1048,0.0,0.0,0.0 +Pickup,2007,0.8427,0.1569,0.0004,0.0,0.0 +Pickup,2006,0.8593,0.1407,0.0,0.0,0.0 +Pickup,2005,0.8664,0.1332,0.0004,0.0,0.0 +Pickup,2004,0.8623,0.1377,0.0,0.0,0.0 +Pickup,2003,0.8811,0.1189,0.0,0.0,0.0 +Pickup,2002,0.8654,0.1346,0.0,0.0,0.0 +Pickup,2001,0.8923,0.1077,0.0,0.0,0.0 +Pickup,2000,0.8479,0.1521,0.0,0.0,0.0 +Pickup,1999,0.9634,0.0366,0.0,0.0,0.0 +Pickup,1998,0.9212,0.0787,0.0001,0.0,0.0 +Motorcycle,2017,0.9844,0.0,0.0,0.0,0.0156 +Motorcycle,2016,0.9908,0.0,0.0,0.0,0.0092 +Motorcycle,2015,0.9973,0.0,0.0,0.0,0.0027 +Motorcycle,2014,0.9968,0.0,0.0,0.0,0.0032 +Motorcycle,2013,0.9924,0.0,0.0,0.0,0.0076 +Motorcycle,2012,0.9821,0.0,0.0,0.0,0.0179 +Motorcycle,2011,0.9965,0.0,0.0,0.0,0.0035 +Motorcycle,2010,1.0,0.0,0.0,0.0,0.0 +Motorcycle,2009,0.998,0.0,0.0,0.0,0.002 +Motorcycle,2008,0.9964,0.0,0.0,0.0,0.0036 +Motorcycle,2007,0.9982,0.0,0.0,0.0,0.0018 +Motorcycle,2006,1.0,0.0,0.0,0.0,0.0 +Motorcycle,2005,1.0,0.0,0.0,0.0,0.0 +Motorcycle,2004,1.0,0.0,0.0,0.0,0.0 +Motorcycle,2003,1.0,0.0,0.0,0.0,0.0 +Motorcycle,2002,1.0,0.0,0.0,0.0,0.0 +Motorcycle,2001,1.0,0.0,0.0,0.0,0.0 +Motorcycle,2000,1.0,0.0,0.0,0.0,0.0 +Motorcycle,1999,1.0,0.0,0.0,0.0,0.0 +Motorcycle,1998,1.0,0.0,0.0,0.0,0.0 diff --git a/activitysim/examples/example_mtc_extended/configs/vehicle_type_choice_op4.csv b/activitysim/examples/example_mtc_extended/configs/vehicle_type_choice_op4.csv new file mode 100644 index 0000000000..0bc13c8dc5 --- /dev/null +++ b/activitysim/examples/example_mtc_extended/configs/vehicle_type_choice_op4.csv @@ -0,0 +1,205 @@ +Label,Description,Expression,Coefficient +util_ln_nmods,number of models available,"@np.log(1 + df.NumModels)",coef_ln_nmods +util_ln_nmakes,number of makes available,"@np.log(1 + df.NumMakes)",coef_ln_nmakes +util_mpg,miles per gallon (or equivalent),"@df.MPG",coef_mpg +util_crange,Range for BEV (mi),"@df.Range",coef_crange +util_crangeltwk,range less than average round trip distance to work,"@np.where((df.Range < df.avg_hh_dist_to_work * 2) & (df.fuel_type=='BEV'), 1, 0)",coef_crangeltwk +util_ln_chpc_ev,ln(1+number of chargers per capita in MSA/state),"@np.log(1+CHARGERS_PER_CAP) * ((df.fuel_type=='PEV') | (df.fuel_type=='BEV'))",coef_ln_chpc_ev +#,income related variables,, +util_cprice0,New Purchase Price (2017$) Segmented by Income,"((income < 25000) & (income > -1)) * NewPrice",coef_cprice0 +util_cprice25,New Purchase Price (2017$) Segmented by Income,"((income < 50000) & (income >= 25000)) * NewPrice",coef_cprice25 +util_cprice50,New Purchase Price (2017$) Segmented by Income,"((income < 100000) & (income >=50000)) * NewPrice",coef_cprice50 +util_cprice100,New Purchase Price (2017$) Segmented by Income,"((income < 150000) & (income >= 100000)) * NewPrice",coef_cprice100 +util_cprice150,New Purchase Price (2017$) Segmented by Income,"(income > 150000) * NewPrice",coef_cprice150 +util_cpricem,New Purchase Price (2017$) Missing Income,"((income < 0) | income.isna()) * NewPrice",coef_cpricem +util_i025_age,Vehicle Age Segmented by Income,"((income < 25000) & (income > -1)) * age",coef_i025_age +util_i2550_age,Vehicle Age Segmented by Income,"((income < 50000) & (income >= 25000)) * age",coef_i2550_age +util_i100_age,Vehicle Age Segmented by Income,"((income < 150000) & (income >= 100000)) * age",coef_i100_age +util_i150p_age,Vehicle Age Segmented by Income,"((income < 150000) & (income >= 100000)) * age",coef_i150p_age +util_imiss_age,Vehicle Age Missing Income,"((income < 0) | income.isna()) * age",coef_imiss_age +#,household density variables,, +util_den3_van,500-999 HH / sq mi Van,"((hh_per_mi < 1000) & (hh_per_mi >= 500)) & (body_type == 'Van')",coef_den3_van +util_den4_van,1000-1999 HH / sq mi Van,"((hh_per_mi < 2000) & (hh_per_mi >= 1000)) & (body_type == 'Van')",coef_den4_van +util_den5_van,2000-3999 HH / sq mi Van,"((hh_per_mi < 4000) & (hh_per_mi >= 2000)) & (body_type == 'Van')",coef_den5_van +util_den6_van,4000-9999 HH / sq mi Van,"((hh_per_mi < 10000) & (hh_per_mi >= 4000)) & (body_type == 'Van')",coef_den6_van +util_den7_van,10000-24999 HH / sq mi Van,"((hh_per_mi < 25000) & (hh_per_mi >= 10000)) & (body_type == 'Van')",coef_den7_van +util_den8_van,25000+ HH / sq mi Van,"(hh_per_mi >= 25000) & (body_type == 'Van')",coef_den8_van +util_den3_suv,500-999 HH / sq mi SUV,"((hh_per_mi < 1000) & (hh_per_mi >= 500)) & (body_type == 'SUV')",coef_den3_suv +util_den4_suv,1000-1999 HH / sq mi SUV,"((hh_per_mi < 2000) & (hh_per_mi >= 1000)) & (body_type == 'SUV')",coef_den4_suv +util_den5_suv,2000-3999 HH / sq mi SUV,"((hh_per_mi < 4000) & (hh_per_mi >= 2000)) & (body_type == 'SUV')",coef_den5_suv +util_den6_suv,4000-9999 HH / sq mi SUV,"((hh_per_mi < 10000) & (hh_per_mi >= 4000)) & (body_type == 'SUV')",coef_den6_suv +util_den7_suv,10000-24999 HH / sq mi SUV,"((hh_per_mi < 25000) & (hh_per_mi >= 10000)) & (body_type == 'SUV')",coef_den7_suv +util_den8_suv,25000+ HH / sq mi SUV,"(hh_per_mi >= 25000) & (body_type == 'SUV')",coef_den8_suv +util_den3_pu,500-999 HH / sq mi Pickup,"((hh_per_mi < 1000) & (hh_per_mi >= 500)) & (body_type == 'Pickup')",coef_den3_pu +util_den4_pu,1000-1999 HH / sq mi Pickup,"((hh_per_mi < 2000) & (hh_per_mi >= 1000)) & (body_type == 'Pickup')",coef_den4_pu +util_den5_pu,2000-3999 HH / sq mi Pickup,"((hh_per_mi < 4000) & (hh_per_mi >= 2000)) & (body_type == 'Pickup')",coef_den5_pu +util_den6_pu,4000-9999 HH / sq mi Pickup,"((hh_per_mi < 10000) & (hh_per_mi >= 4000)) & (body_type == 'Pickup')",coef_den6_pu +util_den7_pu,10000-24999 HH / sq mi Pickup,"((hh_per_mi < 25000) & (hh_per_mi >= 10000)) & (body_type == 'Pickup')",coef_den7_pu +util_den8_mc,25000+ HH / sq mi Pickup,"(hh_per_mi >= 25000) & (body_type == 'Pickup')",coef_den8_pu +util_den3_mc,500-999 HH / sq mi Motorcycle,"((hh_per_mi < 1000) & (hh_per_mi >= 500)) & (body_type == 'Motorcycle')",coef_den3_mc +util_den4_mc,1000-1999 HH / sq mi Motorcycle,"((hh_per_mi < 2000) & (hh_per_mi >= 1000)) & (body_type == 'Motorcycle')",coef_den4_mc +util_den5_mc,2000-3999 HH / sq mi Motorcycle,"((hh_per_mi < 4000) & (hh_per_mi >= 2000)) & (body_type == 'Motorcycle')",coef_den5_mc +util_den6_mc,4000-9999 HH / sq mi Motorcycle,"((hh_per_mi < 10000) & (hh_per_mi >= 4000)) & (body_type == 'Motorcycle')",coef_den6_mc +util_den7_mc,10000-24999 HH / sq mi Motorcycle,"((hh_per_mi < 25000) & (hh_per_mi >= 10000)) & (body_type == 'Motorcycle')",coef_den7_mc +util_den8_mc,25000+ HH / sq mi Motorcycle,"(hh_per_mi >= 25000) & (body_type == 'Motorcycle')",coef_den8_mc +util_den3_hyb,500-999 HH / sq mi Hybrid,"((hh_per_mi < 1000) & (hh_per_mi >= 500)) & (fuel_type == 'Hybrid')",coef_den3_hyb +util_den4_hyb,1000-1999 HH / sq mi Hybrid,"((hh_per_mi < 2000) & (hh_per_mi >= 1000)) & (fuel_type == 'Hybrid')",coef_den4_hyb +util_den5_hyb,2000-3999 HH / sq mi Hybrid,"((hh_per_mi < 4000) & (hh_per_mi >= 2000)) & (fuel_type == 'Hybrid')",coef_den5_hyb +util_den6_hyb,4000-9999 HH / sq mi Hybrid,"((hh_per_mi < 10000) & (hh_per_mi >= 4000)) & (fuel_type == 'Hybrid')",coef_den6_hyb +util_den7_hyb,10000-24999 HH / sq mi Hybrid,"((hh_per_mi < 25000) & (hh_per_mi >= 10000)) & (fuel_type == 'Hybrid')",coef_den7_hyb +util_den8_hyb,25000+ HH / sq mi Hybrid,"(hh_per_mi >= 25000) & (fuel_type == 'Hybrid')",coef_den8_hyb +util_den34_ev,500-1999 HH / sq mi Electric,"((hh_per_mi < 2000) & (hh_per_mi >= 500)) & ((fuel_type=='PEV') | (fuel_type=='BEV'))",coef_den34_ev +util_den5_ev,2000-3999 HH / sq mi Electric,"((hh_per_mi < 4000) & (hh_per_mi >= 2000)) & ((fuel_type=='PEV') | (fuel_type=='BEV'))",coef_den5_ev +util_den6_ev,4000-9999 HH / sq mi Electric,"((hh_per_mi < 10000) & (hh_per_mi >= 4000)) & ((fuel_type=='PEV') | (fuel_type=='BEV'))",coef_den6_ev +util_den78_ev,10000+ HH / sq mi Electric,"(hh_per_mi >= 10000) & ((fuel_type=='PEV') | (fuel_type=='BEV'))",coef_den78_ev +#,household drivers,, +util_oneveh_age,Household owns only one vehicle * vehicle age,"(auto_ownership == 1) * age",coef_oneveh_age +util_vhgtdr_van,Household vehicles gt drivers for Van,hh_veh_gt_drivers * (body_type == 'Van'),coef_vhgtdr_van +util_vhgtdr_suv,Household vehicles gt drivers for SUV,hh_veh_gt_drivers * (body_type == 'SUV'),coef_vhgtdr_suv +util_vhgtdr_pu,Household vehicles gt drivers for Pickup,hh_veh_gt_drivers * (body_type == 'Pickup'),coef_vhgtdr_pu +util_vhgtdr_mc,Household vehicles gt drivers for Motorcycle,hh_veh_gt_drivers * (body_type == 'Motorcycle'),coef_vhgtdr_mc +util_vhgtdr_hy,Household vehicles gt drivers for Hybrid,hh_veh_gt_drivers * (fuel_type == 'Hybrid'),coef_vhgtdr_hy +util_vhgtdr_ev,Household vehicles gt drivers for EVs,hh_veh_gt_drivers * ((fuel_type=='PEV') | (fuel_type=='BEV')),coef_vhgtdr_ev +util_vhgtdr_age,Household vehicles gt drivers for age,hh_veh_gt_drivers * age,coef_vhgtdr_age +#,interacting with number of children,, +util_nchld_van,Number of children max 3 * Van,num_children.clip(upper=3) * (body_type == 'Van'),coef_nchld_van +util_nchld_suv,Number of children max 3 * SUV,num_children.clip(upper=3) * (body_type == 'SUV'),coef_nchld_suv +util_nchld_pu,Number of children max 3 * Pickup,num_children.clip(upper=3) * (body_type == 'Pickup'),coef_nchld_pu +util_nchld_mc,Number of children max 3 * Motorcycle,num_children.clip(upper=3) * (body_type == 'Motorcycle'),coef_nchld_mc +util_nchld_hy,Number of children max 3 * Hybrid,num_children.clip(upper=3) * (fuel_type == 'Hybrid'),coef_nchld_hy +util_nchld_ev,Number of children max 3 * EVs,num_children.clip(upper=3) * ((fuel_type=='PEV') | (fuel_type=='BEV')),coef_nchld_ev +util_nchld_age,Number of children max 3 * age,num_children.clip(upper=3) * age,coef_nchld_age +util_dstwkt_age,Total distance to work * age,total_hh_dist_to_work_cap * age,coef_dstwkt_age +#,household already owning vehicles,, +util_van_van,Household already owns a Van -- Van,"(num_hh_Van > 0) & (body_type == 'Van')",coef_van_van +util_van_suv,Household already owns a Van -- SUV,"(num_hh_Van > 0) & (body_type == 'SUV')",coef_van_suv +util_van_pu,Household already owns a Van -- Pickup,"(num_hh_Van > 0) & (body_type == 'Pickup')",coef_van_pu +util_van_mc,Household already owns a Van -- Motorcycle,"(num_hh_Van > 0) & (body_type == 'Motorcycle')",coef_van_mc +util_van_suv,Household already owns an SUV -- Van (symmetrical with above),"(num_hh_SUV > 0) & (body_type == 'Van')",coef_van_suv +util_suv_suv,Household already owns an SUV -- SUV,"(num_hh_SUV > 0) & (body_type == 'SUV')",coef_suv_suv +util_suv_pu,Household already owns an SUV -- Pickup,"(num_hh_SUV > 0) & (body_type == 'Pickup')",coef_suv_pu +util_suv_mc,Household already owns an SUV -- Motorcycle,"(num_hh_SUV > 0) & (body_type == 'Motorcycle')",coef_suv_mc +util_van_pu,Household already owns a Pickup -- Van (symmetrical with above),"(num_hh_Pickup > 0) & (body_type == 'Van')",coef_van_pu +util_suv_pu,Household already owns a Pickup -- SUV (symmetrical with above),"(num_hh_Pickup > 0) & (body_type == 'SUV')",coef_suv_pu +util_pu_pu,Household already owns a Pickup -- Pickup,"(num_hh_Pickup > 0) & (body_type == 'Pickup')",coef_pu_pu +util_pu_mc,Household already owns a Pickup -- Motorcycle,"(num_hh_Pickup > 0) & (body_type == 'Motorcycle')",coef_pu_mc +util_van_mc,Household already owns a Motorcycle -- Van (symmetrical with above),"(num_hh_Motorcycle > 0) & (body_type == 'Van')",coef_van_mc +util_suv_mc,Household already owns a Motorcycle -- SUV (symmetrical with above),"(num_hh_Motorcycle > 0) & (body_type == 'SUV')",coef_suv_mc +util_pu_mc,Household already owns a Motorcycle -- Pickup (symmetrical with above),"(num_hh_Motorcycle > 0) & (body_type == 'Pickup')",coef_pu_mc +util_mc_mc,Household already owns a Motorcycle -- Motorcycle,"(num_hh_Motorcycle > 0) & (body_type == 'Motorcycle')",coef_mc_mc +util_hyb_hyb,Houeshold already owns a Hybrid -- Hybrid,"(num_hh_Hybrid > 0) & (fuel_type == 'Hybrid')",coef_hyb_hyb +util_hyb_ev,Houeshold already owns a Hybrid -- EV,"(num_hh_Hybrid > 0) & ((fuel_type=='PEV') | (fuel_type=='BEV'))",coef_hyb_ev +util_hyb_ev,Houeshold already owns an EV -- Hybrid (symmetrical with above),"(num_hh_EV> 0) & (fuel_type == 'Hybrid')",coef_hyb_ev +util_only_van,Household only owns Vans,"(num_hh_Van > 0) & (num_hh_Van == num_hh_veh_owned) & (body_type == 'Van')",coef_only_van +util_only_suv,Household only owns SUVs,"(num_hh_SUV > 0) & (num_hh_SUV == num_hh_veh_owned) & (body_type == 'SUV')",coef_only_suv +util_only_pu,Household only owns Pickups,"(num_hh_Pickup > 0) & (num_hh_Pickup == num_hh_veh_owned) & (body_type == 'Pickup')",coef_only_pu +util_only_mc,Household only owns Motorcycles,"(num_hh_Motorcycle > 0) & (num_hh_Motorcycle == num_hh_veh_owned) & (body_type == 'Motorcycle')",coef_only_mc +util_only_bev,Household only owns BEVs,"(num_hh_BEV > 0) & (num_hh_BEV == num_hh_veh_owned) & (fuel_type == 'BEV')",coef_only_bev +#,constants,, +util_van,Van ASC,(body_type == 'Van'),coef_van +util_suv,SUV ASC,(body_type == 'SUV'),coef_suv +util_pu,Pickup ASC,(body_type == 'Pickup'),coef_pu +util_mc,Motorcycle ASC,(body_type == 'Motorcycle'),coef_mc +util_dsl,Diesel ASC,(fuel_type == 'Diesel'),coef_dsl +util_hyb,Hybrid ASC,(fuel_type == 'Hybrid'),coef_hyb +util_pev,PEV ASC,(fuel_type == 'PEV'),coef_pev +util_bev,BEV ASC,(fuel_type == 'BEV'),coef_bev +util_age2,Age 2 ASC,(age==2),coef_age2 +util_age3,Age 3 ASC,(age==3),coef_age3 +util_age4,Age 4 ASC,(age==4),coef_age4 +util_age5,Age 5 ASC,(age==5),coef_age5 +util_age6,Age 6 ASC,(age==6),coef_age6 +util_age7,Age 7 ASC,(age==7),coef_age7 +util_age8,Age 8 ASC,(age==8),coef_age8 +util_age9,Age 9 ASC,(age==9),coef_age9 +util_age10,Age 10 ASC,(age==10),coef_age10 +util_age11,Age 11 ASC,(age==11),coef_age11 +util_age12,Age 12 ASC,(age==12),coef_age12 +util_age13,Age 13 ASC,(age==13),coef_age13 +util_age14,Age 14 ASC,(age==14),coef_age14 +util_age15,Age 15 ASC,(age==15),coef_age15 +util_age16,Age 16 ASC,(age==16),coef_age16 +util_age17,Age 17 ASC,(age==17),coef_age17 +util_age18,Age 18 ASC,(age==18),coef_age18 +util_age19,Age 19 ASC,(age==19),coef_age19 +util_age20,Age 20 ASC,(age==20),coef_age20 +#,rural household coefficients,, +util_rural_van,Household is in Rural Area - Van,"home_is_rural & (body_type == 'Van')",coef_rural_van +util_rural_suv,Household is in Rural Area - SUV,"home_is_rural & (body_type == 'SUV')",coef_rural_suv +util_rural_pu,Household is in Rural Area - Pickup,"home_is_rural & (body_type == 'Pickup')",coef_rural_pu +util_rural_mc,Household is in Rural Area - Motorcycle,"home_is_rural & (body_type == 'Motorcycle')",coef_rural_mc +util_rural_hyb,Household is in Rural Area - Hybrid,"home_is_rural & (fuel_type == 'Hybrid')",coef_rural_hyb +util_rural_ev,Household is in Rural Area - Electric,"home_is_rural & ((fuel_type=='PEV') | (fuel_type=='BEV'))",coef_rural_ev +util_rural_age,Household is in Rural Area - Age,"home_is_rural * age",coef_rural_age +#,MSA population coefficients,, +util_smsa_van,MSA population less than 1 million - Van,"@(MSA_POP < 1000000) * (df.body_type == 'Van')",coef_smsa_van +util_smsa_suv,MSA population less than 1 million - SUV,"@(MSA_POP < 1000000) * (df.body_type == 'SUV')",coef_smsa_suv +util_smsa_pu,MSA population less than 1 million - Pickup,"@(MSA_POP < 1000000) * (df.body_type == 'Pickup')",coef_smsa_pu +util_smsa_mc,MSA population less than 1 million - Motorcycle,"@(MSA_POP < 1000000) * (df.body_type == 'Motorcycle')",coef_smsa_mc +util_smsa_hyb,MSA population less than 1 million - Hybrid,"@(MSA_POP < 1000000) * (df.fuel_type == 'Hybrid')",coef_smsa_hyb +util_smsa_ev,MSA population less than 1 million - Electric,"@(MSA_POP < 1000000) * ((df.fuel_type=='PEV') | (df.fuel_type=='BEV'))",coef_smsa_ev +util_smsa_age,MSA population less than 1 million - Age,"@(MSA_POP < 1000000) * df.age",coef_smsa_age +#,Region Specific Constants,, +util_sfo_van,SF and San Jose - Van,"@(CBSA == 'SFO') * (df.body_type == 'Van')",coef_sfo_van +util_sfo_suv,SF and San Jose - SUV,"@(CBSA == 'SFO') * (df.body_type == 'SUV')",coef_sfo_suv +util_sfo_pu,SF and San Jose - Pickup,"@(CBSA == 'SFO') * (df.body_type == 'Pickup')",coef_sfo_pu +util_sfo_mc,SF and San Jose - Motorcycle,"@(CBSA == 'SFO') * (df.body_type == 'Motorcycle')",coef_sfo_mc +util_sfo_hyb,SF and San Jose - Hybrid,"@(CBSA == 'SFO') * (df.fuel_type == 'Hybrid')",coef_sfo_hyb +util_sfo_ev,SF and San Jose - Electric,"@(CBSA == 'SFO') * ((df.fuel_type=='PEV') | (df.fuel_type=='BEV'))",coef_sfo_ev +util_sfo_age,SF and San Jose - Age,"@(CBSA == 'SFO') * df.age",coef_sfo_age +util_san_van,San Diego - Van,"@(CBSA == 'SAN') * (df.body_type == 'Van')",coef_san_van +util_san_suv,San Diego - SUV,"@(CBSA == 'SAN') * (df.body_type == 'SUV')",coef_san_suv +util_san_pu,San Diego - Pickup,"@(CBSA == 'SAN') * (df.body_type == 'Pickup')",coef_san_pu +util_san_mc,San Diego - Motorcycle,"@(CBSA == 'SAN') * (df.body_type == 'Motorcycle')",coef_san_mc +util_san_hyb,San Diego - Hybrid,"@(CBSA == 'SAN') * (df.fuel_type == 'Hybrid')",coef_san_hyb +util_san_ev,San Diego - Electric,"@(CBSA == 'SAN') * ((df.fuel_type=='PEV') | (df.fuel_type=='BEV'))",coef_san_ev +util_san_age,San Diego - Age,"@(CBSA == 'SAN') * df.age",coef_san_age +util_atl_van,Atlanta - Van,"@(CBSA == 'ATL') * (df.body_type == 'Van')",coef_atl_van +util_atl_suv,Atlanta - SUV,"@(CBSA == 'ATL') * (df.body_type == 'SUV')",coef_atl_suv +util_atl_pu,Atlanta - Pickup,"@(CBSA == 'ATL') * (df.body_type == 'Pickup')",coef_atl_pu +util_atl_mc,Atlanta - Motorcycle,"@(CBSA == 'ATL') * (df.body_type == 'Motorcycle')",coef_atl_mc +util_atl_hyb,Atlanta - Hybrid,"@(CBSA == 'ATL') * (df.fuel_type == 'Hybrid')",coef_atl_hyb +util_atl_ev,Atlanta - Electric,"@(CBSA == 'ATL') * ((df.fuel_type=='PEV') | (df.fuel_type=='BEV'))",coef_atl_ev +util_atl_age,Atlanta - Age,"@(CBSA == 'ATL') * df.age",coef_atl_age +util_sea_van,Seattle - Van,"@(CBSA == 'SEA') * (df.body_type == 'Van')",coef_sea_van +util_sea_suv,Seattle - SUV,"@(CBSA == 'SEA') * (df.body_type == 'SUV')",coef_sea_suv +util_sea_pu,Seattle - Pickup,"@(CBSA == 'SEA') * (df.body_type == 'Pickup')",coef_sea_pu +util_sea_mc,Seattle - Motorcycle,"@(CBSA == 'SEA') * (df.body_type == 'Motorcycle')",coef_sea_mc +util_sea_hyb,Seattle - Hybrid,"@(CBSA == 'SEA') * (df.fuel_type == 'Hybrid')",coef_sea_hyb +util_sea_ev,Seattle - Electric,"@(CBSA == 'SEA') * ((df.fuel_type=='PEV') | (df.fuel_type=='BEV'))",coef_sea_ev +util_sea_age,Seattle - Age,"@(CBSA == 'SEA') * df.age",coef_sea_age +util_det_van,Detroit - Van,"@(CBSA == 'DET') * (df.body_type == 'Van')",coef_det_van +util_det_suv,Detroit - SUV,"@(CBSA == 'DET') * (df.body_type == 'SUV')",coef_det_suv +util_det_pu,Detroit - Pickup,"@(CBSA == 'DET') * (df.body_type == 'Pickup')",coef_det_pu +util_det_mc,Detroit - Motorcycle,"@(CBSA == 'DET') * (df.body_type == 'Motorcycle')",coef_det_mc +util_det_hyb,Detroit - Hybrid,"@(CBSA == 'DET') * (df.fuel_type == 'Hybrid')",coef_det_hyb +util_det_ev,Detroit - Electric,"@(CBSA == 'DET') * ((df.fuel_type=='PEV') | (df.fuel_type=='BEV'))",coef_det_ev +util_det_age,Detroit - Age,"@(CBSA == 'DET') * df.age",coef_det_age +util_msp_van,Minneapolis - Van,"@(CBSA == 'MSP') * (df.body_type == 'Van')",coef_msp_van +util_msp_suv,Minneapolis - SUV,"@(CBSA == 'MSP') * (df.body_type == 'SUV')",coef_msp_suv +util_msp_pu,Minneapolis - Pickup,"@(CBSA == 'MSP') * (df.body_type == 'Pickup')",coef_msp_pu +util_msp_mc,Minneapolis - Motorcycle,"@(CBSA == 'MSP') * (df.body_type == 'Motorcycle')",coef_msp_mc +util_msp_hyb,Minneapolis - Hybrid,"@(CBSA == 'MSP') * (df.fuel_type == 'Hybrid')",coef_msp_hyb +util_msp_ev,Minneapolis - Electric,"@(CBSA == 'MSP') * ((df.fuel_type=='PEV') | (df.fuel_type=='BEV'))",coef_msp_ev +util_msp_age,Minneapolis - Age,"@(CBSA == 'MSP') * df.age",coef_msp_age +util_dca_van,Washington DC - Van,"@(CBSA == 'DCA') * (df.body_type == 'Van')",coef_dca_van +util_dca_suv,Washington DC - SUV,"@(CBSA == 'DCA') * (df.body_type == 'SUV')",coef_dca_suv +util_dca_pu,Washington DC - Pickup,"@(CBSA == 'DCA') * (df.body_type == 'Pickup')",coef_dca_pu +util_dca_mc,Washington DC - Motorcycle,"@(CBSA == 'DCA') * (df.body_type == 'Motorcycle')",coef_dca_mc +util_dca_hyb,Washington DC - Hybrid,"@(CBSA == 'DCA') * (df.fuel_type == 'Hybrid')",coef_dca_hyb +util_dca_ev,Washington DC - Electric,"@(CBSA == 'DCA') * ((df.fuel_type=='PEV') | (df.fuel_type=='BEV'))",coef_dca_ev +util_dca_age,Washington DC - Age,"@(CBSA == 'DCA') * df.age",coef_dca_age +util_oreg_van,Oregon - Van,"@(CBSA == 'OREG') * (df.body_type == 'Van')",coef_oreg_van +util_oreg_suv,Oregon - SUV,"@(CBSA == 'OREG') * (df.body_type == 'SUV')",coef_oreg_suv +util_oreg_pu,Oregon - Pickup,"@(CBSA == 'OREG') * (df.body_type == 'Pickup')",coef_oreg_pu +util_oreg_mc,Oregon - Motorcycle,"@(CBSA == 'OREG') * (df.body_type == 'Motorcycle')",coef_oreg_mc +util_oreg_hyb,Oregon - Hybrid,"@(CBSA == 'OREG') * (df.fuel_type == 'Hybrid')",coef_oreg_hyb +util_oreg_ev,Oregon - Electric,"@(CBSA == 'OREG') * ((df.fuel_type=='PEV') | (df.fuel_type=='BEV'))",coef_oreg_ev +util_oreg_age,Oregon - Age,"@(CBSA == 'OREG') * df.age",coef_oreg_age +util_ohio_van,Ohio - Van,"@(CBSA == 'OHIO') * (df.body_type == 'Van')",coef_ohio_van +util_ohio_suv,Ohio - SUV,"@(CBSA == 'OHIO') * (df.body_type == 'SUV')",coef_ohio_suv +util_ohio_pu,Ohio - Pickup,"@(CBSA == 'OHIO') * (df.body_type == 'Pickup')",coef_ohio_pu +util_ohio_mc,Ohio - Motorcycle,"@(CBSA == 'OHIO') * (df.body_type == 'Motorcycle')",coef_ohio_mc +util_ohio_hyb,Ohio - Hybrid,"@(CBSA == 'OHIO') * (df.fuel_type == 'Hybrid')",coef_ohio_hyb +util_ohio_ev,Ohio - Electric,"@(CBSA == 'OHIO') * ((df.fuel_type=='PEV') | (df.fuel_type=='BEV'))",coef_ohio_ev +util_ohio_age,Ohio - Age,"@(CBSA == 'OHIO') * df.age",coef_ohio_age diff --git a/activitysim/examples/example_mtc_extended/configs/vehicle_type_choice_op4_coefficients.csv b/activitysim/examples/example_mtc_extended/configs/vehicle_type_choice_op4_coefficients.csv new file mode 100644 index 0000000000..50a1871bff --- /dev/null +++ b/activitysim/examples/example_mtc_extended/configs/vehicle_type_choice_op4_coefficients.csv @@ -0,0 +1,189 @@ +coefficient_name,value,constrain +coef_ln_nmods,.612,F +coef_ln_nmakes,.247,F +coef_mpg,0.007,F +coef_crange,0.018,F +coef_crangeltwk,-0.781,F +coef_ln_chpc_ev,1686.871,F +coef_cprice0,-0.00010,F +coef_cprice25,-0.00009,F +coef_cprice50,-0.00008,F +coef_cprice100,-0.00007,F +coef_cprice150,-0.00005,F +coef_cpricem,-0.00007,F +coef_i025_age,0.107,F +coef_i2550_age,0.047,F +coef_i100_age,-0.037,F +coef_i150p_age,-0.071,F +coef_imiss_age,0.001,F +coef_den3_van,-0.019,F +coef_den4_van,-0.089,F +coef_den5_van,-0.193,F +coef_den6_van,-0.413,F +coef_den7_van,-0.710,F +coef_den8_van,-0.509,F +coef_den3_suv,0.005,F +coef_den4_suv,-0.084,F +coef_den5_suv,-0.208,F +coef_den6_suv,-0.422,F +coef_den7_suv,-0.465,F +coef_den8_suv,-0.463,F +coef_den3_pu,-0.167,F +coef_den4_pu,-0.219,F +coef_den5_pu,-0.313,F +coef_den6_pu,-0.720,F +coef_den7_pu,-1.140,F +coef_den8_pu,-2.006,F +coef_den3_mc,-0.030,F +coef_den4_mc,0.157,F +coef_den5_mc,0.185,F +coef_den6_mc,0.436,F +coef_den7_mc,1.106,F +coef_den8_mc,1.533,F +coef_den3_hyb,-0.018,F +coef_den4_hyb,0.070,F +coef_den5_hyb,0.239,F +coef_den6_hyb,0.290,F +coef_den7_hyb,0.406,F +coef_den8_hyb,0.445,F +coef_den34_ev,0.107,F +coef_den5_ev,0.323,F +coef_den6_ev,0.272,F +coef_den78_ev,0.030,F +coef_oneveh_age,-0.028,F +coef_vhgtdr_van,-.108,F +coef_vhgtdr_suv,-0.126,F +coef_vhgtdr_pu,0.287,F +coef_vhgtdr_mc,2.408,F +coef_vhgtdr_hy,-0.168,F +coef_vhgtdr_ev,0.165,F +coef_vhgtdr_age,0.068,F +coef_nchld_van,0.560,F +coef_nchld_suv,0.193,F +coef_nchld_pu,0.016,F +coef_nchld_mc,0.028,F +coef_nchld_hy,-0.045,F +coef_nchld_ev,0.174,F +coef_nchld_age,-0.001,F +coef_dstwkt_age,-0.00013,F +coef_van_van,0.028,F +coef_van_suv,-0.477,F +coef_van_pu,-0.075,F +coef_van_mc,0.527,F +coef_suv_suv,-0.115,F +coef_suv_pu,0.194,F +coef_suv_mc,1.048,F +coef_pu_pu,-0.164,F +coef_pu_mc,1.360,F +coef_mc_mc,3.469,F +coef_hyb_hyb,1.611,F +coef_hyb_ev,0.940,F +coef_only_van,-0.259,F +coef_only_suv,-0.102,F +coef_only_pu,-0.781,F +coef_only_mc,-1.233,F +coef_only_bev,-0.491,F +coef_van,-0.629,F +coef_suv,0.413,F +coef_pu,0.224,F +coef_mc,-5.259,F +coef_dsl,-0.649,F +coef_hyb,-1.055,F +coef_pev,-1.406,F +coef_bev,-4.640,F +coef_age2,0.163,F +coef_age3,0.107,F +coef_age4,0.009,F +coef_age5,-0.079,F +coef_age6,-0.307,F +coef_age7,-0.216,F +coef_age8,-0.346,F +coef_age9,-0.133,F +coef_age10,-0.163,F +coef_age11,-0.060,F +coef_age12,-0.032,F +coef_age13,-0.248,F +coef_age14,-0.350,F +coef_age15,-0.510,F +coef_age16,-0.658,F +coef_age17,-0.772,F +coef_age18,-0.885,F +coef_age19,-1.187,F +coef_age20,0.484,F +coef_rural_van,0.234,F +coef_rural_suv,0.150,F +coef_rural_pu,0.824,F +coef_rural_mc,-0.150,F +coef_rural_hyb,-0.280,F +coef_rural_ev,-0.483,F +coef_rural_age,0.004,F +coef_smsa_van,0.130,F +coef_smsa_suv,0.003,F +coef_smsa_pu,0.357,F +coef_smsa_mc,0.011,F +coef_smsa_hyb,-0.063,F +coef_smsa_ev,-0.341,F +coef_smsa_age,0.011,F +coef_sfo_van,0.047,F +coef_sfo_suv,-0.386,F +coef_sfo_pu,-0.527,F +coef_sfo_mc,-0.021,F +coef_sfo_hyb,0.942,F +coef_sfo_ev,1.497,F +coef_sfo_age,0.058,F +coef_san_van,0.055,F +coef_san_suv,-0.132,F +coef_san_pu,-0.187,F +coef_san_mc,-0.129,F +coef_san_hyb,0.0629,F +coef_san_ev,0.0922,F +coef_san_age,0.030,F +coef_atl_van,-0.158,F +coef_atl_suv,-0.072,F +coef_atl_pu,-0.107,F +coef_atl_mc,-0.284,F +coef_atl_hyb,-0.180,F +coef_atl_ev,0.547,F +coef_atl_age,0.016,F +coef_sea_van,0.088,F +coef_sea_suv,-0.134,F +coef_sea_pu,-0.131,F +coef_sea_mc,-0.275,F +coef_sea_hyb,0.421,F +coef_sea_ev,0.706,F +coef_sea_age,0.060,F +coef_det_van,0.703,F +coef_det_suv,0.260,F +coef_det_pu,-0.150,F +coef_det_mc,0.427,F +coef_det_hyb,-0.982,F +coef_det_ev,0.531,F +coef_det_age,-0.045,F +coef_msp_van,0.263,F +coef_msp_suv,-0.052,F +coef_msp_pu,-0.087,F +coef_msp_mc,0.083,F +coef_msp_hyb,-0.111,F +coef_msp_ev,-0.733,F +coef_msp_age,0.008,F +coef_dca_van,0.062,F +coef_dca_suv,0.273,F +coef_dca_pu,-0.411,F +coef_dca_mc,0.062,F +coef_dca_hyb,-0.428,F +coef_dca_ev,-1.605,F +coef_dca_age,-0.040,F +coef_oreg_van,0.037,F +coef_oreg_suv,-0.121,F +coef_oreg_pu,0.185,F +coef_oreg_mc,0.044,F +coef_oreg_hyb,0.819,F +coef_oreg_ev,0.278,F +coef_oreg_age,0.056,F +coef_ohio_van,0.170,F +coef_ohio_suv,-0.147,F +coef_ohio_pu,-0.355,F +coef_ohio_mc,0.140,F +coef_ohio_hyb,-0.142,F +coef_ohio_ev,-1.590,F +coef_ohio_age,-0.008,F diff --git a/activitysim/examples/example_mtc_extended/configs/vehicle_type_data.csv b/activitysim/examples/example_mtc_extended/configs/vehicle_type_data.csv new file mode 100644 index 0000000000..7831b521dd --- /dev/null +++ b/activitysim/examples/example_mtc_extended/configs/vehicle_type_data.csv @@ -0,0 +1,501 @@ +body_type,fuel_type,vehicle_year,NumMakes,NumModels,MPG,Range,NewPrice,auto_operating_cost,co2gpm +Car,Gas,2017,39,738,24,0,32926.61346,20.17,388.85 +Car,Gas,2016,39,734,23.7,0,33383.61537,20.32822785,392.27 +Car,Gas,2015,39,740,23.4,0,33369.12233,20.49051282,398.43 +Car,Gas,2014,41,717,23.2,0,32571.33539,20.60103448,402.86 +Car,Gas,2013,40,702,23.1,0,32976.62731,20.65701299,402.94 +Car,Gas,2012,42,668,22.4,0,32959.56219,21.06285714,417.59 +Car,Gas,2011,42,617,21.7,0,34409.88113,21.49488479,428.48 +Car,Gas,2010,44,641,21.5,0,35279.71318,21.62348837,434.37 +Car,Gas,2009,45,637,21,0,35638.52401,21.95571429,444.46 +Car,Gas,2008,46,649,20.5,0,35745.78309,22.30414634,454.02 +Car,Gas,2007,43,594,20.3,0,37613.76774,22.44832512,454.23 +Car,Gas,2006,43,595,20.2,0,38581.65596,22.52148515,456.18 +Car,Gas,2005,41,661,20.4,0,37537.36453,22.37588235,452.05 +Car,Gas,2004,43,628,20.6,0,37988.14511,22.2331068,445.25 +Car,Gas,2003,42,573,20.5,0,37597.37624,22.30414634,450.5 +Car,Gas,2002,42,543,20.8,0,37380.8733,22.09307692,439.76 +Car,Gas,2001,39,505,21,0,37361.09207,21.95571429,437.72 +Car,Gas,2000,39,473,21,0,38856.86312,21.95571429,437.7 +Car,Gas,1999,40,483,21.2,0,38447.21363,21.8209434,435.35 +Car,Gas,1998,42,464,21.3,0,38952.55256,21.75450704,433.86 +Car,Diesel,2017,3,9,35.2,0,38787.1746,16.19272727,290 +Car,Diesel,2016,2,8,31.4,0,39325.51763,17.22414013,325.13 +Car,Diesel,2015,4,23,32.8,0,39308.445,16.81634146,311.57 +Car,Diesel,2014,4,20,31.5,0,38368.66109,17.19380952,322.3 +Car,Diesel,2013,2,12,31.8,0,38846.09034,17.10396226,319.17 +Car,Diesel,2012,2,8,32.3,0,38825.98783,16.9579257,314.55 +Car,Diesel,2011,3,8,31.4,0,40534.44697,17.22414013,324.25 +Car,Diesel,2010,3,8,31.4,0,41559.0992,17.22414013,324.25 +Car,Diesel,2009,3,6,30.2,0,41981.77425,17.60377483,339.1 +Car,Diesel,2008,1,1,26,0,42108.12422,19.20846154,391.54 +Car,Diesel,2007,1,1,26,0,44308.58881,19.20846154,391.54 +Car,Diesel,2006,2,7,32.3,0,45448.75007,16.9579257,317.06 +Car,Diesel,2005,2,13,32,0,44218.5867,17.045,321.07 +Car,Diesel,2004,1,10,32.6,0,44749.60108,16.87245399,315.61 +Car,Diesel,2003,1,8,35.6,0,44289.27981,16.09696629,287.33 +Car,Diesel,2002,1,8,35.6,0,44034.24182,16.09696629,287.33 +Car,Diesel,2001,1,6,35.5,0,44010.93975,16.12070423,288.19 +Car,Diesel,2000,1,6,35.5,0,45772.94097,16.12070423,288.19 +Car,Diesel,1999,2,8,34.5,0,45290.37855,16.36565217,299.48 +Car,Diesel,1998,2,8,33.8,0,45885.66203,16.54573964,306.26 +Car,Hybrid,2017,11,29,40.4,0,34769.7517,15.09574257,242.55 +Car,Hybrid,2016,14,31,36.8,0,35252.33528,15.82217391,253.65 +Car,Hybrid,2015,12,33,35.5,0,35237.03096,16.12070423,261.42 +Car,Hybrid,2014,15,40,34.8,0,34394.58617,16.29068966,270.95 +Car,Hybrid,2013,15,34,35.3,0,34822.56518,16.16858357,265.21 +Car,Hybrid,2012,12,25,34.2,0,34804.54481,16.44192982,280.1 +Car,Hybrid,2011,11,20,33.6,0,36336.04847,16.59857143,285.2 +Car,Hybrid,2010,8,13,34.5,0,37254.57126,16.36565217,276.5 +Car,Hybrid,2009,6,8,32.3,0,37633.4673,16.9579257,293.75 +Car,Hybrid,2008,6,8,31.8,0,37746.73043,17.10396226,299.43 +Car,Hybrid,2007,5,7,33.3,0,39719.27956,16.67900901,281.75 +Car,Hybrid,2006,2,5,42.4,0,40741.3474,14.7454717,224.05 +Car,Hybrid,2005,2,8,41.9,0,39638.59951,14.82990453,218.55 +Car,Hybrid,2004,2,7,43.9,0,40114.61351,14.50371298,204.44 +Car,Hybrid,2003,2,7,43.3,0,39701.9705,14.59840647,207.34 +Car,Hybrid,2002,2,3,47,0,39473.34834,14.05297872,191.17 +Car,Hybrid,2001,2,4,47,0,39452.45982,14.05297872,190.65 +Car,Hybrid,2000,1,1,53,0,41031.95988,13.33037736,167.68 +Car,Hybrid,1999,0,0,0,0,40599.37938,13.33037736,0 +Car,Hybrid,1998,0,0,0,0,41133.00574,13.33037736,0 +Car,PEV,2017,9,14,35.1,0,56882.64178,16.21700855,138.64 +Car,PEV,2016,8,14,33.8,0,65356.24918,16.54573964,142.21 +Car,PEV,2015,8,11,32.1,0,55150.60558,17.01579439,181.55 +Car,PEV,2014,8,10,35.1,0,44172.85443,16.21700855,160 +Car,PEV,2013,3,4,40.8,0,52370.99125,15.02294118,118 +Car,PEV,2012,3,3,35.7,0,47444.73245,16.07336134,129.67 +Car,PEV,2011,1,1,37,0,38741.26195,15.77810811,84 +Car,PEV,2010,0,0,0,0,38741.26195,15.77810811,0 +Car,PEV,2009,0,0,0,0,38741.26195,15.77810811,0 +Car,PEV,2008,0,0,0,0,38741.26195,15.77810811,0 +Car,PEV,2007,0,0,0,0,38741.26195,15.77810811,0 +Car,PEV,2006,0,0,0,0,38741.26195,15.77810811,0 +Car,PEV,2005,0,0,0,0,38741.26195,15.77810811,0 +Car,PEV,2004,0,0,0,0,38741.26195,15.77810811,0 +Car,PEV,2003,0,0,0,0,38741.26195,15.77810811,0 +Car,PEV,2002,0,0,0,0,38741.26195,15.77810811,0 +Car,PEV,2001,0,0,0,0,38741.26195,15.77810811,0 +Car,PEV,2000,0,0,0,0,38741.26195,15.77810811,0 +Car,PEV,1999,0,0,0,0,38741.26195,15.77810811,0 +Car,PEV,1998,0,0,0,0,38741.26195,15.77810811,0 +Car,BEV,2017,13,23,108.7,169,65091.20275,10.4298896,0 +Car,BEV,2016,11,25,103.1,173,74787.61065,10.57979631,0 +Car,BEV,2015,10,18,103.2,157,63109.22167,10.57697674,0 +Car,BEV,2014,10,13,106.1,115,50547.30465,10.49752121,0 +Car,BEV,2013,9,12,104.3,105,59928.48966,10.54631831,0 +Car,BEV,2012,5,5,95.6,113,54291.33743,10.80807531,0 +Car,BEV,2011,3,4,93.8,73,44331.89559,10.86829424,0 +Car,BEV,2010,0,0,0,0,44331.89559,10.86829424,0 +Car,BEV,2009,0,0,0,0,44331.89559,10.86829424,0 +Car,BEV,2008,0,0,0,0,44331.89559,10.86829424,0 +Car,BEV,2007,0,0,0,0,44331.89559,10.86829424,0 +Car,BEV,2006,0,0,0,0,44331.89559,10.86829424,0 +Car,BEV,2005,0,0,0,0,44331.89559,10.86829424,0 +Car,BEV,2004,0,0,0,0,44331.89559,10.86829424,0 +Car,BEV,2003,0,0,0,0,44331.89559,10.86829424,0 +Car,BEV,2002,0,0,0,0,44331.89559,10.86829424,0 +Car,BEV,2001,0,0,0,0,44331.89559,10.86829424,0 +Car,BEV,2000,0,0,0,0,44331.89559,10.86829424,0 +Car,BEV,1999,0,0,0,0,44331.89559,10.86829424,0 +Car,BEV,1998,0,0,0,0,44331.89559,10.86829424,0 +Van,Gas,2017,9,17,18.4,0,30190.16873,24.11434783,510.06 +Van,Gas,2016,9,17,18,0,30609.19041,24.47666667,516.47 +Van,Gas,2015,11,32,16.3,0,30595.90185,26.21490798,577.5 +Van,Gas,2014,12,48,15.7,0,29864.41689,26.91828025,587.94 +Van,Gas,2013,11,48,15.9,0,30236.02606,26.67792453,587.33 +Van,Gas,2012,12,51,15.4,0,30220.37918,27.29051948,603.9 +Van,Gas,2011,11,47,15.1,0,31550.1659,27.67754967,611 +Van,Gas,2010,10,30,17.2,0,32347.70849,25.25186047,530.66 +Van,Gas,2009,11,43,16.4,0,32676.69949,26.10268293,553.56 +Van,Gas,2008,11,46,16.5,0,32775.04455,25.99181818,550.05 +Van,Gas,2007,13,49,16.3,0,34487.78588,26.21490798,553.75 +Van,Gas,2006,14,52,16.7,0,35375.23544,25.77407186,542.24 +Van,Gas,2005,14,65,16.4,0,34417.73234,26.10268293,549.76 +Van,Gas,2004,13,64,16,0,34831.04973,26.56,565.75 +Van,Gas,2003,12,68,15.8,0,34472.75663,26.79734177,574.52 +Van,Gas,2002,14,65,16,0,34274.24668,26.56,564.71 +Van,Gas,2001,13,62,15.8,0,34256.10942,26.79734177,571.5 +Van,Gas,2000,14,69,16.1,0,35627.57086,26.44354037,562.93 +Van,Gas,1999,13,67,15.9,0,35251.96627,26.67792453,566.55 +Van,Gas,1998,4,37,14.5,0,35715.30779,28.49965517,615.25 +Van,Diesel,2017,0,0,0,0,36228.20248,24.11434783,0 +Van,Diesel,2016,0,0,0,0,36731.02849,24.47666667,0 +Van,Diesel,2015,0,0,0,0,36715.08222,26.21490798,0 +Van,Diesel,2014,0,0,0,0,35837.30027,26.91828025,0 +Van,Diesel,2013,0,0,0,0,36283.23127,26.67792453,0 +Van,Diesel,2012,0,0,0,0,36264.45502,27.29051948,0 +Van,Diesel,2011,0,0,0,0,37860.19908,27.67754967,0 +Van,Diesel,2010,0,0,0,0,38817.25019,25.25186047,0 +Van,Diesel,2009,0,0,0,0,39212.03939,26.10268293,0 +Van,Diesel,2008,0,0,0,0,39330.05345,25.99181818,0 +Van,Diesel,2007,0,0,0,0,41385.34306,26.21490798,0 +Van,Diesel,2006,0,0,0,0,42450.28253,25.77407186,0 +Van,Diesel,2005,0,0,0,0,41301.2788,26.10268293,0 +Van,Diesel,2004,0,0,0,0,41797.25967,26.56,0 +Van,Diesel,2003,0,0,0,0,41367.30796,26.79734177,0 +Van,Diesel,2002,0,0,0,0,41129.09602,26.56,0 +Van,Diesel,2001,0,0,0,0,41107.3313,26.79734177,0 +Van,Diesel,2000,0,0,0,0,42753.08503,26.44354037,0 +Van,Diesel,1999,0,0,0,0,42302.35952,26.67792453,0 +Van,Diesel,1998,0,0,0,0,42858.36935,28.49965517,0 +Van,Hybrid,2017,0,0,0,0,33209.1856,15.23574257,0 +Van,Hybrid,2016,0,0,0,0,33670.10945,15.96217391,0 +Van,Hybrid,2015,0,0,0,0,33655.49203,16.26070423,0 +Van,Hybrid,2014,0,0,0,0,32850.85858,16.43068966,0 +Van,Hybrid,2013,0,0,0,0,33259.62867,16.30858357,0 +Van,Hybrid,2012,0,0,0,0,33242.4171,16.58192982,0 +Van,Hybrid,2011,0,0,0,0,34705.18249,16.73857143,0 +Van,Hybrid,2010,0,0,0,0,35582.47934,16.50565217,0 +Van,Hybrid,2009,0,0,0,0,35944.36944,17.0979257,0 +Van,Hybrid,2008,0,0,0,0,36052.549,17.24396226,0 +Van,Hybrid,2007,0,0,0,0,37936.56447,16.81900901,0 +Van,Hybrid,2006,0,0,0,0,38912.75898,14.8854717,0 +Van,Hybrid,2005,0,0,0,0,37859.50557,14.96990453,0 +Van,Hybrid,2004,0,0,0,0,38314.1547,14.64371298,0 +Van,Hybrid,2003,0,0,0,0,37920.03229,14.73840647,0 +Van,Hybrid,2002,0,0,0,0,37701.67135,14.19297872,0 +Van,Hybrid,2001,0,0,0,0,37681.72036,14.19297872,0 +Van,Hybrid,2000,0,0,0,0,39190.32794,13.47037736,0 +Van,Hybrid,1999,0,0,0,0,38777.16289,13.47037736,0 +Van,Hybrid,1998,0,0,0,0,39286.83857,13.47037736,0 +Van,PEV,2017,1,1,32,0,53599.94056,17.185,106 +Van,PEV,2016,0,0,0,0,61584.53548,17.185,0 +Van,PEV,2015,0,0,0,0,51967.86028,17.185,0 +Van,PEV,2014,0,0,0,0,41623.63591,17.185,0 +Van,PEV,2013,0,0,0,0,49348.65769,17.185,0 +Van,PEV,2012,0,0,0,0,44706.69363,17.185,0 +Van,PEV,2011,0,0,0,0,36505.50102,17.185,0 +Van,PEV,2010,0,0,0,0,36505.50102,17.185,0 +Van,PEV,2009,0,0,0,0,36505.50102,17.185,0 +Van,PEV,2008,0,0,0,0,36505.50102,17.185,0 +Van,PEV,2007,0,0,0,0,36505.50102,17.185,0 +Van,PEV,2006,0,0,0,0,36505.50102,17.185,0 +Van,PEV,2005,0,0,0,0,36505.50102,17.185,0 +Van,PEV,2004,0,0,0,0,36505.50102,17.185,0 +Van,PEV,2003,0,0,0,0,36505.50102,17.185,0 +Van,PEV,2002,0,0,0,0,36505.50102,17.185,0 +Van,PEV,2001,0,0,0,0,36505.50102,17.185,0 +Van,PEV,2000,0,0,0,0,36505.50102,17.185,0 +Van,PEV,1999,0,0,0,0,36505.50102,17.185,0 +Van,PEV,1998,0,0,0,0,36505.50102,17.185,0 +Van,BEV,2017,0,0,0,0,60163.19858,17.185,0 +Van,BEV,2016,0,0,0,0,69125.49901,17.185,0 +Van,BEV,2015,0,0,0,0,58331.27174,17.185,0 +Van,BEV,2014,0,0,0,0,46720.40766,17.185,0 +Van,BEV,2013,0,0,0,0,55391.35047,17.185,0 +Van,BEV,2012,0,0,0,0,50180.98264,17.185,0 +Van,BEV,2011,0,0,0,0,40975.56237,17.185,0 +Van,BEV,2010,0,0,0,0,40975.56237,17.185,0 +Van,BEV,2009,0,0,0,0,40975.56237,17.185,0 +Van,BEV,2008,0,0,0,0,40975.56237,17.185,0 +Van,BEV,2007,0,0,0,0,40975.56237,17.185,0 +Van,BEV,2006,0,0,0,0,40975.56237,17.185,0 +Van,BEV,2005,0,0,0,0,40975.56237,17.185,0 +Van,BEV,2004,0,0,0,0,40975.56237,17.185,0 +Van,BEV,2003,0,0,0,0,40975.56237,17.185,0 +Van,BEV,2002,0,0,0,0,40975.56237,17.185,0 +Van,BEV,2001,0,0,0,0,40975.56237,17.185,0 +Van,BEV,2000,0,0,0,0,40975.56237,17.185,0 +Van,BEV,1999,0,0,0,0,40975.56237,17.185,0 +Van,BEV,1998,0,0,0,0,40975.56237,17.185,0 +SUV,Gas,2017,30,318,21.2,0,37821.12858,22.3309434,432.19 +SUV,Gas,2016,27,293,21.4,0,38346.06347,22.19869159,429.37 +SUV,Gas,2015,26,301,20.9,0,38329.41605,22.53406699,438.28 +SUV,Gas,2014,26,271,20.3,0,37413.03871,22.95832512,449.05 +SUV,Gas,2013,27,267,20,0,37878.57695,23.18,460.25 +SUV,Gas,2012,28,257,19.5,0,37858.97512,23.56461538,468.49 +SUV,Gas,2011,29,287,19.4,0,39524.88281,23.64391753,473.4 +SUV,Gas,2010,31,280,18.9,0,40524.01472,24.05301587,484.89 +SUV,Gas,2009,34,325,18.2,0,40936.16249,24.66351648,502.83 +SUV,Gas,2008,34,313,17.7,0,41059.36555,25.12915254,515.69 +SUV,Gas,2007,34,294,17.6,0,43205.02465,25.22545455,515.55 +SUV,Gas,2006,33,279,17.3,0,44316.78868,25.52104046,527.77 +SUV,Gas,2005,33,280,17.1,0,43117.26416,25.72385965,531.9 +SUV,Gas,2004,33,260,16.6,0,43635.05292,26.25228916,546.56 +SUV,Gas,2003,31,253,16.8,0,43186.19656,26.03714286,544.4 +SUV,Gas,2002,31,222,16.7,0,42937.51063,26.14407186,546.93 +SUV,Gas,2001,28,195,17.1,0,42914.78893,25.72385965,534.91 +SUV,Gas,2000,22,163,17,0,44632.90518,25.82705882,539.03 +SUV,Gas,1999,22,160,17.2,0,44162.36162,25.62186047,533.63 +SUV,Gas,1998,25,167,17.4,0,44742.81877,25.42137931,523.18 +SUV,Diesel,2017,3,5,25,0,44897.93782,20.18,405 +SUV,Diesel,2016,7,11,25,0,45521.09463,20.18,407.73 +SUV,Diesel,2015,6,10,25.2,0,45501.33227,20.0847619,409.8 +SUV,Diesel,2014,6,8,24.5,0,44413.4892,20.42489796,418.88 +SUV,Diesel,2013,5,5,23.4,0,44966.1355,21.00051282,438.4 +SUV,Diesel,2012,3,3,21,0,44942.86593,22.46571429,485.59 +SUV,Diesel,2011,3,3,21.3,0,46920.48592,22.26450704,478.24 +SUV,Diesel,2010,3,3,20.7,0,48106.56799,22.67275362,493.58 +SUV,Diesel,2009,3,3,20.7,0,48595.8338,22.67275362,493.58 +SUV,Diesel,2008,3,6,19.7,0,48742.08969,23.4084264,520.36 +SUV,Diesel,2007,3,6,19.7,0,51289.22862,23.4084264,520.36 +SUV,Diesel,2006,2,2,19,0,52609.0177,23.96947368,541.79 +SUV,Diesel,2005,1,1,21,0,51185.04703,22.46571429,484.76 +SUV,Diesel,2004,1,1,18,0,51799.72059,24.84666667,565.56 +SUV,Diesel,2003,0,0,0,0,51266.87756,28.18,0 +SUV,Diesel,2002,0,0,0,0,50971.65936,28.18,0 +SUV,Diesel,2001,0,0,0,0,50944.68615,28.18,0 +SUV,Diesel,2000,0,0,0,0,52984.28357,28.18,0 +SUV,Diesel,1999,2,2,15,0,52425.69538,28.18,678.67 +SUV,Diesel,1998,2,2,15,0,53114.76338,28.18,678.67 +SUV,Hybrid,2017,5,10,29.6,0,40628.40849,18.31513514,302.1 +SUV,Hybrid,2016,5,11,29.1,0,41192.30676,18.48927835,305.82 +SUV,Hybrid,2015,7,13,27.5,0,41174.42369,19.08909091,323.54 +SUV,Hybrid,2014,8,12,26.3,0,40190.02808,19.58684411,334.08 +SUV,Hybrid,2013,8,13,23.1,0,40690.12098,21.16701299,386.15 +SUV,Hybrid,2012,8,14,23.9,0,40669.0642,20.73230126,381.01 +SUV,Hybrid,2011,12,20,24.9,0,42458.62419,20.22819277,370.01 +SUV,Hybrid,2010,11,17,26.1,0,43531.91684,19.67425287,351.19 +SUV,Hybrid,2009,10,16,25.4,0,43974.65635,19.99102362,361.73 +SUV,Hybrid,2008,8,14,26.1,0,44107.00417,19.67425287,349.33 +SUV,Hybrid,2007,5,8,26.8,0,46411.9252,19.37402985,332.95 +SUV,Hybrid,2006,5,8,27,0,47606.21011,19.29111111,329.48 +SUV,Hybrid,2005,1,2,28,0,46317.65066,18.89428571,317.8 +SUV,Hybrid,2004,0,0,0,0,46873.87239,18.89428571,0 +SUV,Hybrid,2003,0,0,0,0,46391.69959,18.89428571,0 +SUV,Hybrid,2002,0,0,0,0,46124.5549,18.89428571,0 +SUV,Hybrid,2001,0,0,0,0,46100.14668,18.89428571,0 +SUV,Hybrid,2000,0,0,0,0,47945.79041,18.89428571,0 +SUV,Hybrid,1999,0,0,0,0,47440.32067,18.89428571,0 +SUV,Hybrid,1998,0,0,0,0,48063.86236,18.89428571,0 +SUV,PEV,2017,4,4,23,0,66088.39654,21.22347826,260 +SUV,PEV,2016,4,4,23,0,75933.35291,21.22347826,260.5 +SUV,PEV,2015,1,1,22,0,64076.05162,21.81636364,260 +SUV,PEV,2014,0,0,0,0,51321.68669,21.81636364,0 +SUV,PEV,2013,0,0,0,0,60846.59096,21.81636364,0 +SUV,PEV,2012,0,0,0,0,55123.07786,21.81636364,0 +SUV,PEV,2011,0,0,0,0,45011.05789,21.81636364,0 +SUV,PEV,2010,0,0,0,0,45011.05789,21.81636364,0 +SUV,PEV,2009,0,0,0,0,45011.05789,21.81636364,0 +SUV,PEV,2008,0,0,0,0,45011.05789,21.81636364,0 +SUV,PEV,2007,0,0,0,0,45011.05789,21.81636364,0 +SUV,PEV,2006,0,0,0,0,45011.05789,21.81636364,0 +SUV,PEV,2005,0,0,0,0,45011.05789,21.81636364,0 +SUV,PEV,2004,0,0,0,0,45011.05789,21.81636364,0 +SUV,PEV,2003,0,0,0,0,45011.05789,21.81636364,0 +SUV,PEV,2002,0,0,0,0,45011.05789,21.81636364,0 +SUV,PEV,2001,0,0,0,0,45011.05789,21.81636364,0 +SUV,PEV,2000,0,0,0,0,45011.05789,21.81636364,0 +SUV,PEV,1999,0,0,0,0,45011.05789,21.81636364,0 +SUV,PEV,1998,0,0,0,0,45011.05789,21.81636364,0 +SUV,BEV,2017,2,7,87.4,245,75017.02367,11.61249428,0 +SUV,BEV,2016,2,6,87.5,237,86192.04627,11.60857143,0 +SUV,BEV,2015,0,0,0,0,72732.80836,12.49654676,0 +SUV,BEV,2014,2,2,69.5,115,58255.31238,12.49654676,0 +SUV,BEV,2013,2,2,69.5,115,69067.04343,12.49654676,0 +SUV,BEV,2012,2,2,69,113,62570.27637,12.52782609,0 +SUV,BEV,2011,0,0,0,0,51092.10953,12.52782609,0 +SUV,BEV,2010,0,0,0,0,51092.10953,12.52782609,0 +SUV,BEV,2009,0,0,0,0,51092.10953,12.52782609,0 +SUV,BEV,2008,0,0,0,0,51092.10953,12.52782609,0 +SUV,BEV,2007,0,0,0,0,51092.10953,12.52782609,0 +SUV,BEV,2006,0,0,0,0,51092.10953,12.52782609,0 +SUV,BEV,2005,0,0,0,0,51092.10953,12.52782609,0 +SUV,BEV,2004,0,0,0,0,51092.10953,12.52782609,0 +SUV,BEV,2003,0,0,0,0,51092.10953,12.52782609,0 +SUV,BEV,2002,0,0,0,0,51092.10953,12.52782609,0 +SUV,BEV,2001,0,0,0,0,51092.10953,12.52782609,0 +SUV,BEV,2000,0,0,0,0,51092.10953,12.52782609,0 +SUV,BEV,1999,0,0,0,0,51092.10953,12.52782609,0 +SUV,BEV,1998,0,0,0,0,51092.10953,12.52782609,0 +Pickup,Gas,2017,8,84,18.5,0,33196.53386,24.54621622,488.67 +Pickup,Gas,2016,7,72,18.5,0,33657.28211,24.54621622,488.18 +Pickup,Gas,2015,6,66,18.6,0,33642.67026,24.45903226,485.79 +Pickup,Gas,2014,8,65,17.1,0,32838.34335,25.87385965,531.12 +Pickup,Gas,2013,7,69,16.9,0,33246.9577,26.08147929,532.93 +Pickup,Gas,2012,8,100,17.3,0,33229.7527,25.67104046,520.49 +Pickup,Gas,2011,8,110,17.3,0,34691.96081,25.67104046,522.85 +Pickup,Gas,2010,10,108,17.2,0,35568.92344,25.77186047,525.8 +Pickup,Gas,2009,11,138,16.8,0,35930.67567,26.18714286,534.88 +Pickup,Gas,2008,14,148,16.3,0,36038.81401,26.73490798,556.44 +Pickup,Gas,2007,12,162,16.1,0,37922.11173,26.96354037,558.22 +Pickup,Gas,2006,12,151,16.2,0,38897.93434,26.84851852,561 +Pickup,Gas,2005,7,127,16.4,0,37845.08219,26.62268293,556.04 +Pickup,Gas,2004,7,140,16.3,0,38299.55811,26.73490798,557.48 +Pickup,Gas,2003,8,127,15.8,0,37905.58585,27.31734177,571.99 +Pickup,Gas,2002,9,127,15.7,0,37687.3081,27.43828025,577.81 +Pickup,Gas,2001,8,126,16,0,37667.36471,27.08,566.42 +Pickup,Gas,2000,8,119,16.5,0,39175.39755,26.51181818,550.73 +Pickup,Gas,1999,8,119,16,0,38762.38991,27.08,566.51 +Pickup,Gas,1998,8,124,16.1,0,39271.87141,26.96354037,561.74 +Pickup,Diesel,2017,3,7,23,0,39835.84063,21.37347826,448.43 +Pickup,Diesel,2016,3,7,23.6,0,40388.73853,21.04186441,434.71 +Pickup,Diesel,2015,1,3,23,0,40371.20431,21.37347826,443.67 +Pickup,Diesel,2014,1,2,22.5,0,39406.01202,21.66333333,450.5 +Pickup,Diesel,2013,0,0,0,0,39896.34924,21.66333333,0 +Pickup,Diesel,2012,0,0,0,0,39875.70323,21.66333333,0 +Pickup,Diesel,2011,1,1,20,0,41630.35298,23.33,509 +Pickup,Diesel,2010,0,0,0,0,42682.70813,23.33,0 +Pickup,Diesel,2009,0,0,0,0,43116.8108,23.33,0 +Pickup,Diesel,2008,0,0,0,0,43246.57682,23.33,0 +Pickup,Diesel,2007,0,0,0,0,45506.53408,23.33,0 +Pickup,Diesel,2006,0,0,0,0,46677.52121,23.33,0 +Pickup,Diesel,2005,0,0,0,0,45414.09862,23.33,0 +Pickup,Diesel,2004,0,0,0,0,45959.46973,23.33,0 +Pickup,Diesel,2003,0,0,0,0,45486.70302,23.33,0 +Pickup,Diesel,2002,0,0,0,0,45224.76972,23.33,0 +Pickup,Diesel,2001,0,0,0,0,45200.83765,23.33,0 +Pickup,Diesel,2000,0,0,0,0,47010.47706,23.33,0 +Pickup,Diesel,1999,0,0,0,0,46514.86789,23.33,0 +Pickup,Diesel,1998,2,4,15,0,47126.2457,28.33,678.67 +Pickup,Hybrid,2017,2,4,19,0,36516.18724,24.11947368,467.5 +Pickup,Hybrid,2016,2,4,19,0,37023.01032,24.11947368,468 +Pickup,Hybrid,2015,0,0,0,0,37006.93728,24.11947368,0 +Pickup,Hybrid,2014,0,0,0,0,36122.17768,24.11947368,0 +Pickup,Hybrid,2013,2,4,21,0,36571.65347,22.61571429,420.5 +Pickup,Hybrid,2012,2,4,21,0,36552.72796,22.61571429,423.19 +Pickup,Hybrid,2011,2,4,21,0,38161.1569,22.61571429,423.19 +Pickup,Hybrid,2010,2,4,21.5,0,39125.81578,22.28348837,413.57 +Pickup,Hybrid,2009,2,4,20.5,0,39523.74323,22.96414634,433.77 +Pickup,Hybrid,2008,0,0,0,0,39642.69542,22.96414634,0 +Pickup,Hybrid,2007,2,4,16.5,0,41714.3229,26.51181818,539.1 +Pickup,Hybrid,2006,2,4,16.5,0,42787.72777,26.51181818,539.1 +Pickup,Hybrid,2005,2,4,16.5,0,41629.5904,26.51181818,539.1 +Pickup,Hybrid,2004,2,4,16.5,0,42129.51392,26.51181818,539.1 +Pickup,Hybrid,2003,0,0,0,0,41696.14444,26.51181818,0 +Pickup,Hybrid,2002,0,0,0,0,41456.03891,26.51181818,0 +Pickup,Hybrid,2001,0,0,0,0,41434.10118,26.51181818,0 +Pickup,Hybrid,2000,0,0,0,0,43092.93731,26.51181818,0 +Pickup,Hybrid,1999,0,0,0,0,42638.6289,26.51181818,0 +Pickup,Hybrid,1998,0,0,0,0,43199.05855,26.51181818,0 +Pickup,PEV,2017,0,0,0,0,58937.47257,26.51181818,0 +Pickup,PEV,2016,0,0,0,0,67717.1809,26.51181818,0 +Pickup,PEV,2015,0,0,0,0,57142.86822,26.51181818,0 +Pickup,PEV,2014,0,0,0,0,45768.55635,26.51181818,0 +Pickup,PEV,2013,0,0,0,0,54262.843,26.51181818,0 +Pickup,PEV,2012,0,0,0,0,49158.62783,26.51181818,0 +Pickup,PEV,2011,0,0,0,0,40140.75282,26.51181818,0 +Pickup,PEV,2010,0,0,0,0,40140.75282,26.51181818,0 +Pickup,PEV,2009,0,0,0,0,40140.75282,26.51181818,0 +Pickup,PEV,2008,0,0,0,0,40140.75282,26.51181818,0 +Pickup,PEV,2007,0,0,0,0,40140.75282,26.51181818,0 +Pickup,PEV,2006,0,0,0,0,40140.75282,26.51181818,0 +Pickup,PEV,2005,0,0,0,0,40140.75282,26.51181818,0 +Pickup,PEV,2004,0,0,0,0,40140.75282,26.51181818,0 +Pickup,PEV,2003,0,0,0,0,40140.75282,26.51181818,0 +Pickup,PEV,2002,0,0,0,0,40140.75282,26.51181818,0 +Pickup,PEV,2001,0,0,0,0,40140.75282,26.51181818,0 +Pickup,PEV,2000,0,0,0,0,40140.75282,26.51181818,0 +Pickup,PEV,1999,0,0,0,0,40140.75282,26.51181818,0 +Pickup,PEV,1998,0,0,0,0,40140.75282,26.51181818,0 +Pickup,BEV,2017,0,0,0,0,66154.30594,26.51181818,0 +Pickup,BEV,2016,0,0,0,0,76009.0806,26.51181818,0 +Pickup,BEV,2015,0,0,0,0,64139.95412,26.51181818,0 +Pickup,BEV,2014,0,0,0,0,51372.86938,26.51181818,0 +Pickup,BEV,2013,0,0,0,0,60907.27275,26.51181818,0 +Pickup,BEV,2012,0,0,0,0,55178.05164,26.51181818,0 +Pickup,BEV,2011,0,0,0,0,45055.94704,26.51181818,0 +Pickup,BEV,2010,0,0,0,0,45055.94704,26.51181818,0 +Pickup,BEV,2009,0,0,0,0,45055.94704,26.51181818,0 +Pickup,BEV,2008,0,0,0,0,45055.94704,26.51181818,0 +Pickup,BEV,2007,0,0,0,0,45055.94704,26.51181818,0 +Pickup,BEV,2006,0,0,0,0,45055.94704,26.51181818,0 +Pickup,BEV,2005,0,0,0,0,45055.94704,26.51181818,0 +Pickup,BEV,2004,0,0,0,0,45055.94704,26.51181818,0 +Pickup,BEV,2003,0,0,0,0,45055.94704,26.51181818,0 +Pickup,BEV,2002,0,0,0,0,45055.94704,26.51181818,0 +Pickup,BEV,2001,0,0,0,0,45055.94704,26.51181818,0 +Pickup,BEV,2000,0,0,0,0,45055.94704,26.51181818,0 +Pickup,BEV,1999,0,0,0,0,45055.94704,26.51181818,0 +Pickup,BEV,1998,0,0,0,0,45055.94704,26.51181818,0 +Motorcycle,Gas,2017,11,23,53,0,11531.02445,12.49037736,365.46 +Motorcycle,Gas,2016,13,28,53,0,11691.06825,12.49037736,365.46 +Motorcycle,Gas,2015,11,30,53,0,11685.99273,12.49037736,365.46 +Motorcycle,Gas,2014,11,30,53,0,11406.60473,12.49037736,365.46 +Motorcycle,Gas,2013,12,30,53,0,11548.53949,12.49037736,365.46 +Motorcycle,Gas,2012,12,25,53,0,11542.56322,12.49037736,365.46 +Motorcycle,Gas,2011,12,26,53,0,12050.47039,12.49037736,365.46 +Motorcycle,Gas,2010,11,29,53,0,12355.08887,12.49037736,365.46 +Motorcycle,Gas,2009,12,30,53,0,12480.74577,12.49037736,365.46 +Motorcycle,Gas,2008,11,28,53,0,12518.30831,12.49037736,365.46 +Motorcycle,Gas,2007,12,32,53,0,13172.48359,12.49037736,365.46 +Motorcycle,Gas,2006,12,33,53,0,13511.4417,12.49037736,365.46 +Motorcycle,Gas,2005,12,27,53,0,13145.7269,12.49037736,365.46 +Motorcycle,Gas,2004,10,26,53,0,13303.59196,12.49037736,365.46 +Motorcycle,Gas,2003,11,30,53,0,13166.74322,12.49037736,365.46 +Motorcycle,Gas,2002,13,31,53,0,13090.92308,12.49037736,365.46 +Motorcycle,Gas,2001,15,33,53,0,13083.99561,12.49037736,365.46 +Motorcycle,Gas,2000,10,22,53,0,13607.82029,12.49037736,365.46 +Motorcycle,Gas,1999,10,20,53,0,13464.35949,12.49037736,365.46 +Motorcycle,Gas,1998,15,40,53,0,13641.33109,12.49037736,365.46 +Motorcycle,Diesel,2017,0,0,0,0,11531.02445,12.49037736,0 +Motorcycle,Diesel,2016,0,0,0,0,11691.06825,12.49037736,0 +Motorcycle,Diesel,2015,0,0,0,0,11685.99273,12.49037736,0 +Motorcycle,Diesel,2014,0,0,0,0,11406.60473,12.49037736,0 +Motorcycle,Diesel,2013,0,0,0,0,11548.53949,12.49037736,0 +Motorcycle,Diesel,2012,0,0,0,0,11542.56322,12.49037736,0 +Motorcycle,Diesel,2011,0,0,0,0,12050.47039,12.49037736,0 +Motorcycle,Diesel,2010,0,0,0,0,12355.08887,12.49037736,0 +Motorcycle,Diesel,2009,0,0,0,0,12480.74577,12.49037736,0 +Motorcycle,Diesel,2008,0,0,0,0,12518.30831,12.49037736,0 +Motorcycle,Diesel,2007,0,0,0,0,13172.48359,12.49037736,0 +Motorcycle,Diesel,2006,0,0,0,0,13511.4417,12.49037736,0 +Motorcycle,Diesel,2005,0,0,0,0,13145.7269,12.49037736,0 +Motorcycle,Diesel,2004,0,0,0,0,13303.59196,12.49037736,0 +Motorcycle,Diesel,2003,0,0,0,0,13166.74322,12.49037736,0 +Motorcycle,Diesel,2002,0,0,0,0,13090.92308,12.49037736,0 +Motorcycle,Diesel,2001,0,0,0,0,13083.99561,12.49037736,0 +Motorcycle,Diesel,2000,0,0,0,0,13607.82029,12.49037736,0 +Motorcycle,Diesel,1999,0,0,0,0,13464.35949,12.49037736,0 +Motorcycle,Diesel,1998,0,0,0,0,13641.33109,12.49037736,0 +Motorcycle,Hybrid,2017,0,0,0,0,11531.02445,8.08,0 +Motorcycle,Hybrid,2016,0,0,0,0,11691.06825,8.08,0 +Motorcycle,Hybrid,2015,0,0,0,0,11685.99273,8.08,0 +Motorcycle,Hybrid,2014,0,0,0,0,11406.60473,8.08,0 +Motorcycle,Hybrid,2013,0,0,0,0,11548.53949,8.08,0 +Motorcycle,Hybrid,2012,0,0,0,0,11542.56322,8.08,0 +Motorcycle,Hybrid,2011,0,0,0,0,12050.47039,8.08,0 +Motorcycle,Hybrid,2010,0,0,0,0,12355.08887,8.08,0 +Motorcycle,Hybrid,2009,0,0,0,0,12480.74577,8.08,0 +Motorcycle,Hybrid,2008,0,0,0,0,12518.30831,8.08,0 +Motorcycle,Hybrid,2007,0,0,0,0,13172.48359,8.08,0 +Motorcycle,Hybrid,2006,0,0,0,0,13511.4417,8.08,0 +Motorcycle,Hybrid,2005,0,0,0,0,13145.7269,8.08,0 +Motorcycle,Hybrid,2004,0,0,0,0,13303.59196,8.08,0 +Motorcycle,Hybrid,2003,0,0,0,0,13166.74322,8.08,0 +Motorcycle,Hybrid,2002,0,0,0,0,13090.92308,8.08,0 +Motorcycle,Hybrid,2001,0,0,0,0,13083.99561,8.08,0 +Motorcycle,Hybrid,2000,0,0,0,0,13607.82029,8.08,0 +Motorcycle,Hybrid,1999,0,0,0,0,13464.35949,8.08,0 +Motorcycle,Hybrid,1998,0,0,0,0,13641.33109,8.08,0 +Motorcycle,PEV,2017,0,0,0,0,16712.08255,8.08,0 +Motorcycle,PEV,2016,0,0,0,0,19201.6228,8.08,0 +Motorcycle,PEV,2015,0,0,0,0,16203.21145,8.08,0 +Motorcycle,PEV,2014,0,0,0,0,12977.95542,8.08,0 +Motorcycle,PEV,2013,0,0,0,0,15386.5626,8.08,0 +Motorcycle,PEV,2012,0,0,0,0,13939.23102,8.08,0 +Motorcycle,PEV,2011,0,0,0,0,11382.15714,8.08,0 +Motorcycle,PEV,2010,0,0,0,0,11382.15714,8.08,0 +Motorcycle,PEV,2009,0,0,0,0,11382.15714,8.08,0 +Motorcycle,PEV,2008,0,0,0,0,11382.15714,8.08,0 +Motorcycle,PEV,2007,0,0,0,0,11382.15714,8.08,0 +Motorcycle,PEV,2006,0,0,0,0,11382.15714,8.08,0 +Motorcycle,PEV,2005,0,0,0,0,11382.15714,8.08,0 +Motorcycle,PEV,2004,0,0,0,0,11382.15714,8.08,0 +Motorcycle,PEV,2003,0,0,0,0,11382.15714,8.08,0 +Motorcycle,PEV,2002,0,0,0,0,11382.15714,8.08,0 +Motorcycle,PEV,2001,0,0,0,0,11382.15714,8.08,0 +Motorcycle,PEV,2000,0,0,0,0,11382.15714,8.08,0 +Motorcycle,PEV,1999,0,0,0,0,11382.15714,8.08,0 +Motorcycle,PEV,1998,0,0,0,0,11382.15714,8.08,0 +Motorcycle,BEV,2017,2,2,240,80,16712.08255,8.08,0 +Motorcycle,BEV,2016,2,2,240,80,19201.6228,8.08,0 +Motorcycle,BEV,2015,1,1,240,80,16203.21145,8.08,0 +Motorcycle,BEV,2014,1,1,240,80,12977.95542,8.08,0 +Motorcycle,BEV,2013,1,1,240,80,15386.5626,8.08,0 +Motorcycle,BEV,2012,1,1,240,80,13939.23102,8.08,0 +Motorcycle,BEV,2011,1,1,240,80,11382.15714,8.08,0 +Motorcycle,BEV,2010,1,1,240,80,11382.15714,8.08,0 +Motorcycle,BEV,2009,1,1,240,80,11382.15714,8.08,0 +Motorcycle,BEV,2008,1,1,240,80,11382.15714,8.08,0 +Motorcycle,BEV,2007,0,0,0,0,11382.15714,8.08,0 +Motorcycle,BEV,2006,0,0,0,0,11382.15714,8.08,0 +Motorcycle,BEV,2005,0,0,0,0,11382.15714,8.08,0 +Motorcycle,BEV,2004,0,0,0,0,11382.15714,8.08,0 +Motorcycle,BEV,2003,0,0,0,0,11382.15714,8.08,0 +Motorcycle,BEV,2002,0,0,0,0,11382.15714,8.08,0 +Motorcycle,BEV,2001,0,0,0,0,11382.15714,8.08,0 +Motorcycle,BEV,2000,0,0,0,0,11382.15714,8.08,0 +Motorcycle,BEV,1999,0,0,0,0,11382.15714,8.08,0 +Motorcycle,BEV,1998,0,0,0,0,11382.15714,8.08,0 diff --git a/activitysim/examples/example_mtc_extended/configs_mp/logging.yaml b/activitysim/examples/example_mtc_extended/configs_mp/logging.yaml new file mode 100644 index 0000000000..e932009c5d --- /dev/null +++ b/activitysim/examples/example_mtc_extended/configs_mp/logging.yaml @@ -0,0 +1,57 @@ +# Config for logging +# ------------------ +# See http://docs.python.org/2.7/library/logging.config.html#configuration-dictionary-schema + +logging: + version: 1 + disable_existing_loggers: true + + + # Configuring the default (root) logger is highly recommended + root: + level: DEBUG + handlers: [console, logfile] + + loggers: + + activitysim: + level: DEBUG + handlers: [console, logfile] + propagate: false + + orca: + level: WARNING + handlers: [console, logfile] + propagate: false + + handlers: + + logfile: + class: logging.FileHandler + filename: !!python/object/apply:activitysim.core.config.log_file_path ['activitysim.log'] + mode: w + formatter: fileFormatter + level: NOTSET + + console: + class: logging.StreamHandler + stream: ext://sys.stdout + formatter: simpleFormatter + #level: NOTSET + level: !!python/object/apply:activitysim.core.mp_tasks.if_sub_task [WARNING, NOTSET] + + formatters: + + simpleFormatter: + class: logging.Formatter + #format: '%(processName)-10s %(levelname)s - %(name)s - %(message)s' + format: !!python/object/apply:activitysim.core.mp_tasks.if_sub_task [ + '%(processName)-10s %(levelname)s - %(name)s - %(message)s', + '%(levelname)s - %(name)s - %(message)s'] + datefmt: '%d/%m/%Y %H:%M:%S' + + fileFormatter: + class: logging.Formatter + format: '%(asctime)s - %(levelname)s - %(name)s - %(message)s' + datefmt: '%d/%m/%Y %H:%M:%S' + diff --git a/activitysim/examples/example_mtc_extended/configs_mp/settings.yaml b/activitysim/examples/example_mtc_extended/configs_mp/settings.yaml new file mode 100644 index 0000000000..9938537c7b --- /dev/null +++ b/activitysim/examples/example_mtc_extended/configs_mp/settings.yaml @@ -0,0 +1,101 @@ + +inherit_settings: True + +# raise error if any sub-process fails without waiting for others to complete +fail_fast: True + +# - ------------------------- production config +#multiprocess: True +#strict: False +#use_shadow_pricing: True + +# - full sample - 2875192 households on 64 processor 432 GiB RAM +#households_sample_size: 0 +#chunk_size: 400_000_000_000 +#num_processes: 60 + +# - ------------------------- no chunking due to sufficient RAM +# chunk_training_mode: disabled + +# - ------------------------- dev config +multiprocess: True +strict: False +use_shadow_pricing: False + +households_sample_size: 0 +chunk_size: 0 +num_processes: 2 + +# - ------------------------- + +# not recommended or supported for multiprocessing +want_dest_choice_sample_tables: False + +#read_skim_cache: True +#write_skim_cache: True + +# - tracing +#trace_hh_id: +trace_od: + +# to resume after last successful checkpoint, specify resume_after: _ +#resume_after: trip_purpose_and_destination + +models: + ### mp_initialize step + - initialize_landuse + - initialize_households + ### mp_accessibility step + - compute_accessibility + ### mp_households step + - school_location + - workplace_location + - auto_ownership_simulate + - vehicle_type_choice + - free_parking + - cdap_simulate + - mandatory_tour_frequency + - mandatory_tour_scheduling + - joint_tour_frequency + - joint_tour_composition + - joint_tour_participation + - joint_tour_destination + - joint_tour_scheduling + - non_mandatory_tour_frequency + - non_mandatory_tour_destination + - non_mandatory_tour_scheduling + - vehicle_allocation + - tour_mode_choice_simulate + - atwork_subtour_frequency + - atwork_subtour_destination + - atwork_subtour_scheduling + - atwork_subtour_mode_choice + - stop_frequency + - trip_purpose + - trip_destination + - trip_purpose_and_destination + - trip_scheduling + - trip_mode_choice + ### mp_summarize step + - write_data_dictionary + - write_trip_matrices + - write_tables + +multiprocess_steps: + - name: mp_initialize + begin: initialize_landuse + - name: mp_accessibility + begin: compute_accessibility + slice: + tables: + - accessibility + # don't slice any tables not explicitly listed above in slice.tables + except: True + - name: mp_households + begin: school_location + slice: + tables: + - households + - persons + - name: mp_summarize + begin: write_data_dictionary diff --git a/activitysim/examples/example_mtc_extended/output/.gitignore b/activitysim/examples/example_mtc_extended/output/.gitignore new file mode 100644 index 0000000000..bf5bf15e3e --- /dev/null +++ b/activitysim/examples/example_mtc_extended/output/.gitignore @@ -0,0 +1,7 @@ +*.csv +*.log +*.prof +*.h5 +*.txt +*.yaml +*.omx diff --git a/activitysim/examples/example_mtc_extended/output/cache/.gitignore b/activitysim/examples/example_mtc_extended/output/cache/.gitignore new file mode 100644 index 0000000000..3dd2e62f9e --- /dev/null +++ b/activitysim/examples/example_mtc_extended/output/cache/.gitignore @@ -0,0 +1,2 @@ +*.mmap +*.feather diff --git a/activitysim/examples/example_mtc_extended/output/log/.gitignore b/activitysim/examples/example_mtc_extended/output/log/.gitignore new file mode 100644 index 0000000000..8edb806780 --- /dev/null +++ b/activitysim/examples/example_mtc_extended/output/log/.gitignore @@ -0,0 +1,3 @@ +*.csv +*.log +*.txt diff --git a/activitysim/examples/example_mtc_extended/output/trace/.gitignore b/activitysim/examples/example_mtc_extended/output/trace/.gitignore new file mode 100644 index 0000000000..8edb806780 --- /dev/null +++ b/activitysim/examples/example_mtc_extended/output/trace/.gitignore @@ -0,0 +1,3 @@ +*.csv +*.log +*.txt diff --git a/activitysim/examples/example_mtc_extended/test/configs/settings.yaml b/activitysim/examples/example_mtc_extended/test/configs/settings.yaml new file mode 100644 index 0000000000..78bdcf9220 --- /dev/null +++ b/activitysim/examples/example_mtc_extended/test/configs/settings.yaml @@ -0,0 +1,40 @@ +inherit_settings: True + +# number of households to simulate +households_sample_size: 10 +# simulate all households +# households_sample_size: 0 + +strict: True + +chunk_size: 0 + +# - shadow pricing global switches +# turn shadow_pricing on and off for all models (e.g. school and work) +# shadow pricing is deprecated for less than full samples +# see shadow_pricing.yaml for additional settings +use_shadow_pricing: False + +# turn writing of sample_tables on and off for all models +# (if True, tables will be written if DEST_CHOICE_SAMPLE_TABLE_NAME is specified in individual model settings) +want_dest_choice_sample_tables: False + +# global switch to turn on or off presampling of destination alternatives at TAZ level (multizone models only) +want_dest_choice_presampling: True + +# - tracing +# trace household id; comment out or leave empty for no trace +trace_hh_id: + +# trace origin, destination in accessibility calculation; comment out or leave empty for no trace +# trace_od: [5, 11] +trace_od: + +output_tables: + h5_store: False + action: include + prefix: final_ + sort: True + tables: + - trips + - vehicles diff --git a/activitysim/examples/example_mtc_extended/test/output/.gitignore b/activitysim/examples/example_mtc_extended/test/output/.gitignore new file mode 100644 index 0000000000..bf5bf15e3e --- /dev/null +++ b/activitysim/examples/example_mtc_extended/test/output/.gitignore @@ -0,0 +1,7 @@ +*.csv +*.log +*.prof +*.h5 +*.txt +*.yaml +*.omx diff --git a/activitysim/examples/example_mtc_extended/test/output/cache/.gitignore b/activitysim/examples/example_mtc_extended/test/output/cache/.gitignore new file mode 100644 index 0000000000..3dd2e62f9e --- /dev/null +++ b/activitysim/examples/example_mtc_extended/test/output/cache/.gitignore @@ -0,0 +1,2 @@ +*.mmap +*.feather diff --git a/activitysim/examples/example_mtc_extended/test/output/trace/.gitignore b/activitysim/examples/example_mtc_extended/test/output/trace/.gitignore new file mode 100644 index 0000000000..8edb806780 --- /dev/null +++ b/activitysim/examples/example_mtc_extended/test/output/trace/.gitignore @@ -0,0 +1,3 @@ +*.csv +*.log +*.txt diff --git a/activitysim/examples/example_mtc_extended/test/regress/final_trips.csv b/activitysim/examples/example_mtc_extended/test/regress/final_trips.csv new file mode 100644 index 0000000000..2260ceead7 --- /dev/null +++ b/activitysim/examples/example_mtc_extended/test/regress/final_trips.csv @@ -0,0 +1,80 @@ +trip_id,person_id,household_id,primary_purpose,trip_num,outbound,trip_count,destination,origin,tour_id,purpose,destination_logsum,depart,trip_mode,mode_choice_logsum +211388201,644476,386761,escort,1,True,1,11,16,26423525,escort,,5,WALK_LOC,4.789158412380779 +211388205,644476,386761,escort,1,False,1,16,11,26423525,home,,6,WALK_LOC,5.050171287433508 +211388329,644476,386761,othdiscr,1,True,1,16,16,26423541,othdiscr,,18,WALK,7.330879513166791 +211388333,644476,386761,othdiscr,1,False,1,16,16,26423541,home,,18,WALK,7.330879513166791 +211388353,644476,386761,othmaint,1,True,1,13,16,26423544,othmaint,,18,WALK,-0.4192505336997586 +211388357,644476,386761,othmaint,1,False,1,16,13,26423544,home,,19,WALK,-0.41925030619506426 +211388441,644476,386761,work,1,True,1,4,16,26423555,work,,7,SHARED2FREE,0.6902839738239953 +211388445,644476,386761,work,1,False,1,16,4,26423555,home,,17,SHARED3FREE,-0.060176139897114116 +211388721,644477,386761,shopping,1,True,1,16,16,26423590,shopping,,14,WALK,5.857443647205806 +211388725,644477,386761,shopping,1,False,1,16,16,26423590,home,,14,WALK,5.857443647205806 +211389033,644478,386761,school,1,True,1,20,16,26423629,school,,11,WALK_LOC,1.5300445825829465 +211389037,644478,386761,school,1,False,1,16,20,26423629,home,,19,WALK_LRF,3.76602489416099 +515832417,1572659,763879,shopping,1,True,3,25,6,64479052,othmaint,40.895784325733594,7,WALK,12.896301701456215 +515832418,1572659,763879,shopping,2,True,3,25,25,64479052,escort,40.13139614585728,12,WALK,13.621701652814899 +515832419,1572659,763879,shopping,3,True,3,24,25,64479052,shopping,,17,WALK,3.0930067693134005 +515832421,1572659,763879,shopping,1,False,3,25,24,64479052,shopping,38.41713719577139,18,WALK,3.0706867412992 +515832422,1572659,763879,shopping,2,False,3,7,25,64479052,escort,59.6309483835455,20,WALK,12.807021629683366 +515832423,1572659,763879,shopping,3,False,3,6,7,64479052,home,,20,WALK,14.258626224164276 +535620049,1632987,824207,work,1,True,1,4,18,66952506,work,,15,WALK_LOC,0.2992185756062765 +535620053,1632987,824207,work,1,False,1,18,4,66952506,home,,21,WALK,0.5557332757868809 +615236801,1875721,982875,work,1,True,1,10,16,76904600,work,,8,WALK_LOC,7.627291076037502 +615236805,1875721,982875,work,1,False,1,16,10,76904600,home,,18,WALK_LOC,7.6193935739287255 +615236865,1875722,982875,eatout,1,True,2,7,16,76904608,escort,33.332775271121825,10,WALK,12.852466196970816 +615236866,1875722,982875,eatout,2,True,2,14,7,76904608,eatout,,13,WALK,0.0679239371174617 +615236869,1875722,982875,eatout,1,False,1,16,14,76904608,home,,17,WALK,0.9383092208675533 +708171009,2159057,1099626,work,1,True,1,2,20,88521376,work,,7,WALK,-0.35400338649017565 +708171013,2159057,1099626,work,1,False,2,8,2,88521376,shopping,28.059656557964445,18,WALK,0.34307389812569966 +708171014,2159057,1099626,work,2,False,2,20,8,88521376,home,,18,WALK_LOC,9.930931452887558 +708171273,2159058,1099626,univ,1,True,1,9,20,88521409,univ,,15,WALK_LOC,10.081589126967758 +708171277,2159058,1099626,univ,1,False,1,20,9,88521409,home,,18,WALK_LOC,9.700222902924416 +708171601,2159059,1099626,school,1,True,1,20,20,88521450,school,,8,WALK,2.001157626801728 +708171605,2159059,1099626,school,1,False,1,20,20,88521450,home,,13,WALK,2.001157626801728 +841877257,2566698,1196298,work,1,True,1,1,25,105234657,work,,6,WALK,0.5218384234138416 +841877261,2566698,1196298,work,1,False,1,25,1,105234657,home,,17,WALK_LOC,0.4855336440096438 +841877849,2566700,1196298,school,1,True,1,25,25,105234731,school,,7,WALK,12.824615869979219 +841877853,2566700,1196298,school,1,False,1,25,25,105234731,home,,15,WALK,12.824615869979219 +841878177,2566701,1196298,school,1,True,1,3,25,105234772,school,,8,WALK,8.979312480941104 +841878181,2566701,1196298,school,1,False,1,25,3,105234772,home,,13,WALK,8.979312481086987 +841878505,2566702,1196298,school,1,True,1,6,25,105234813,school,,12,WALK_LOC,11.709395865665709 +841878509,2566702,1196298,school,1,False,2,25,6,105234813,shopping,51.23589608925055,20,WALK_LOC,11.238325436501778 +841878510,2566702,1196298,school,2,False,2,25,25,105234813,home,,20,WALK,11.641815891720018 +1004301497,3061894,1363467,shopping,1,True,1,20,24,125537687,shopping,,12,TNC_SHARED,0.09686480459546322 +1004301501,3061894,1363467,shopping,1,False,1,24,20,125537687,home,,13,DRIVEALONEFREE,0.015792413826355586 +1004301761,3061895,1363467,othdiscr,1,True,1,9,24,125537720,othdiscr,,17,WALK_HVY,11.684658026322639 +1004301765,3061895,1363467,othdiscr,1,False,1,24,9,125537720,home,,19,WALK_LRF,11.49938905905555 +1004301785,3061895,1363467,othmaint,1,True,1,7,24,125537723,othmaint,,15,WALK,8.131583343724042 +1004301789,3061895,1363467,othmaint,1,False,1,24,7,125537723,home,,16,WALK,8.096583148991245 +1004301873,3061895,1363467,work,1,True,1,25,24,125537734,work,,6,WALK,10.08552703351978 +1004301877,3061895,1363467,work,1,False,1,24,25,125537734,home,,13,WALK,10.103127058632895 +1368289969,4171615,1810015,univ,1,True,1,12,16,171036246,univ,,13,WALK,4.061179288088942 +1368289973,4171615,1810015,univ,1,False,1,16,12,171036246,home,,13,WALK,4.06117926693834 +1368290273,4171616,1810015,othmaint,1,True,1,3,16,171036284,othmaint,,9,WALK,5.752949863933666 +1368290277,4171616,1810015,othmaint,1,False,1,16,3,171036284,home,,11,WALK,5.595449988691705 +1368290689,4171617,1810015,work,1,True,2,8,16,171036336,social,23.477345398553453,9,WALK,7.896576327414681 +1368290690,4171617,1810015,work,2,True,2,15,8,171036336,work,,12,WALK,-0.8211572450364255 +1368290693,4171617,1810015,work,1,False,1,16,15,171036336,home,,18,WALK,0.23912905823533456 +1368291297,4171619,1810015,shopping,1,True,1,1,16,171036412,shopping,,13,WALK,-1.0053143437541998 +1368291301,4171619,1810015,shopping,1,False,2,7,1,171036412,shopping,29.48393750646727,14,WALK,-1.5297238905680486 +1368291302,4171619,1810015,shopping,2,False,2,16,7,171036412,home,,15,WALK,12.573466151788852 +1368291609,4171620,1810015,school,1,True,1,8,16,171036451,school,,7,WALK_LOC,10.68060996983474 +1368291613,4171620,1810015,school,1,False,1,16,8,171036451,home,,15,WALK_LOC,10.665116381563836 +1368292281,4171622,1810015,shopping,1,True,1,19,16,171036535,shopping,,9,WALK,-2.394141994327624 +1368292285,4171622,1810015,shopping,1,False,1,16,19,171036535,home,,15,WALK,-2.4219133842589526 +1368292377,4171623,1810015,atwork,1,True,1,7,21,171036547,atwork,,10,WALK,13.897946303660285 +1368292381,4171623,1810015,atwork,1,False,2,6,7,171036547,othmaint,62.239483838845736,10,WALK,14.364186248721689 +1368292382,4171623,1810015,atwork,2,False,2,21,6,171036547,work,,10,WALK,12.200629295549986 +1368292657,4171623,1810015,work,1,True,2,25,16,171036582,escort,30.234430836012045,8,WALK,9.029527074456235 +1368292658,4171623,1810015,work,2,True,2,21,25,171036582,work,,8,WALK,2.0014416307382055 +1368292661,4171623,1810015,work,1,False,2,7,21,171036582,work,34.72578612209499,23,WALK,2.5646380272501808 +1368292662,4171623,1810015,work,2,False,2,16,7,171036582,home,,23,WALK,9.584561374619746 +2464104641,7512514,2821179,eatout,1,True,1,13,8,308013080,eatout,,8,WALK,-1.171759971785514 +2464104645,7512514,2821179,eatout,1,False,1,8,13,308013080,home,,16,WALK,-1.238718768693438 +2464104857,7512514,2821179,shopping,1,True,1,6,8,308013107,shopping,,17,WALK,12.612248978887928 +2464104861,7512514,2821179,shopping,1,False,1,8,6,308013107,home,,19,WALK,12.322088998148224 +2464104881,7512514,2821179,social,1,True,1,9,8,308013110,social,,16,WALK,6.292424410910544 +2464104885,7512514,2821179,social,1,False,1,8,9,308013110,home,,16,WALK_LOC,6.322192231184283 +2464449633,7513565,2822230,work,1,True,2,9,8,308056204,univ,40.040196758213916,9,WALK,7.9948426686587775 +2464449634,7513565,2822230,work,2,True,2,25,9,308056204,work,,9,WALK,8.34752700809022 +2464449637,7513565,2822230,work,1,False,1,8,25,308056204,home,,18,WALK,9.31552710851258 diff --git a/activitysim/examples/example_mtc_extended/test/regress/final_vehicles.csv b/activitysim/examples/example_mtc_extended/test/regress/final_vehicles.csv new file mode 100644 index 0000000000..7d0108b700 --- /dev/null +++ b/activitysim/examples/example_mtc_extended/test/regress/final_vehicles.csv @@ -0,0 +1,7 @@ +vehicle_id,household_id,vehicle_num,vehicle_type,auto_operating_cost,Range,MPG +3867611,386761,1,SUV_14_Gas,26.25228916,0,16.6 +7638791,763879,1,Car_10_Gas,22.30414634,0,20.5 +9828751,982875,1,Car_12_Gas,22.52148515,0,20.2 +10996261,1099626,1,SUV_1_Hybrid,18.31513514,0,29.6 +13634671,1363467,1,Car_5_Gas,20.65701299,0,23.1 +18100151,1810015,1,SUV_20_Gas,25.42137931,0,17.4 diff --git a/activitysim/examples/example_mtc_extended/test/simulation.py b/activitysim/examples/example_mtc_extended/test/simulation.py new file mode 100644 index 0000000000..97ca6b6483 --- /dev/null +++ b/activitysim/examples/example_mtc_extended/test/simulation.py @@ -0,0 +1,15 @@ +# ActivitySim +# See full license in LICENSE.txt. + +import sys +import argparse + +from activitysim.cli.run import add_run_args, run + +if __name__ == '__main__': + + parser = argparse.ArgumentParser() + add_run_args(parser) + args = parser.parse_args() + + sys.exit(run(args)) diff --git a/activitysim/examples/example_mtc_extended/test/test_mtc_extended.py b/activitysim/examples/example_mtc_extended/test/test_mtc_extended.py new file mode 100644 index 0000000000..acf60459f6 --- /dev/null +++ b/activitysim/examples/example_mtc_extended/test/test_mtc_extended.py @@ -0,0 +1,57 @@ +# ActivitySim +# See full license in LICENSE.txt. +import os +import subprocess +import pkg_resources + +import pandas as pd +import pandas.testing as pdt + +from activitysim.core import inject + + +def teardown_function(func): + inject.clear_cache() + inject.reinject_decorated_tables() + + +def test_mtc_extended(): + + def example_path(dirname): + resource = os.path.join('examples', 'example_mtc_extended', dirname) + return pkg_resources.resource_filename('activitysim', resource) + + def example_mtc_path(dirname): + resource = os.path.join('examples', 'example_mtc', dirname) + return pkg_resources.resource_filename('activitysim', resource) + + def test_path(dirname): + return os.path.join(os.path.dirname(__file__), dirname) + + def regress(): + regress_trips_df = pd.read_csv(test_path('regress/final_trips.csv')) + final_trips_df = pd.read_csv(test_path('output/final_trips.csv')) + + regress_vehicles_df = pd.read_csv(test_path('regress/final_vehicles.csv')) + final_vehicles_df = pd.read_csv(test_path('output/final_vehicles.csv')) + + # person_id,household_id,tour_id,primary_purpose,trip_num,outbound,trip_count,purpose, + # destination,origin,destination_logsum,depart,trip_mode,mode_choice_logsum + # compare_cols = [] + pdt.assert_frame_equal(final_trips_df, regress_trips_df) + pdt.assert_frame_equal(final_vehicles_df, regress_vehicles_df) + + file_path = os.path.join(os.path.dirname(__file__), 'simulation.py') + + subprocess.run(['coverage', 'run', '-a', file_path, + '-c', test_path('configs'), '-c', example_path('configs'), + '-c', example_mtc_path('configs'), + '-d', example_mtc_path('data'), + '-o', test_path('output')], check=True) + + regress() + + +if __name__ == '__main__': + + test_mtc_extended() diff --git a/docs/core.rst b/docs/core.rst index 2d71d3c507..f9625ef72a 100644 --- a/docs/core.rst +++ b/docs/core.rst @@ -2,11 +2,11 @@ Core Components =============== -ActivitySim's core components include features for multiprocessing, data management, -utility expressions, choice models, person time window management, and helper -functions. These core components include the multiprocessor, network LOS (skim) manager, the -data pipeline manager, the random number manager, the tracer, sampling -methods, simulation methods, model specification readers and expression +ActivitySim's core components include features for multiprocessing, data management, +utility expressions, choice models, person time window management, and helper +functions. These core components include the multiprocessor, network LOS (skim) manager, the +data pipeline manager, the random number manager, the tracer, sampling +methods, simulation methods, model specification readers and expression evaluators, choice models, timetable, transit virtual path builder, and helper functions. .. _multiprocessing_in_detail: @@ -69,7 +69,7 @@ API Pipeline ~~~~~~~~ -Data pipeline manager, which manages the list of model steps, runs them, reads +Data pipeline manager, which manages the list of model steps, runs them, reads and writes data tables from/to the pipeline datastore, and supports restarting of the pipeline at any model step. @@ -93,8 +93,9 @@ ActivitySim's random number generation has a number of important features unique * Repeatable household-level choices - results for a household are repeatable when run with different sample sizes * Repeatable household level results with different scenarios - results for a household are repeatable with different scenario configurations sequentially up to the point at which those differences emerge, and in alternate submodels in which those differences do not apply. -Random number generation is done using the `numpy Mersenne Twister PNRG `__. -ActivitySim seeds on-the-fly and uses a stream of random numbers seeded by the household id, person id, tour id, trip id, the model step offset, and the global seed. +Random number generation is done using the `numpy Mersenne Twister PNRG `__. +ActivitySim seeds on-the-fly and uses a stream of random numbers seeded by the household id, person id, tour id, trip id, the model step offset, and the global seed. +The global seed can be set in the settings.yaml file using the ```rng_base_seed`` option. The logic for calculating the seed is something along the lines of: :: @@ -109,7 +110,7 @@ The logic for calculating the seed is something along the lines of: 0 = first household model - auto ownership 1 = global seed offset for testing the same model under different random global seeds -ActivitySim generates a separate, distinct, and stable random number stream for each tour type and tour number in order to maintain as much stability as is +ActivitySim generates a separate, distinct, and stable random number stream for each tour type and tour number in order to maintain as much stability as is possible across alternative scenarios. This is done for trips as well, by direction (inbound versus outbound). .. note:: @@ -124,7 +125,7 @@ API Tracing ~~~~~~~ -Household tracer. If a household trace ID is specified, then ActivitySim will output a +Household tracer. If a household trace ID is specified, then ActivitySim will output a comprehensive set of trace files for all calculations for all household members: * ``hhtrace.log`` - household trace log file, which specifies the CSV files traced. The order of output files is consistent with the model sequence. @@ -145,8 +146,8 @@ API Utility Expressions ------------------- -Much of the power of ActivitySim comes from being able to specify Python, pandas, and -numpy expressions for calculations. Refer to the pandas help for a general +Much of the power of ActivitySim comes from being able to specify Python, pandas, and +numpy expressions for calculations. Refer to the pandas help for a general introduction to expressions. ActivitySim provides two ways to evaluate expressions: * Simple table expressions are evaluated using ``DataFrame.eval()``. `pandas' eval `__ operates on the current table. @@ -184,23 +185,23 @@ An expressions file has the following basic form: | util_dist_0_1 | Distance, from 0 to 1 miles | @skims['DIST'].clip(1) | | coef_dist_0_1 | +---------------------------------+---------------------------------+-------------------------------+-----------+---------------------------------+ -In the :ref:`tour_mode_choice` model expression file example shown below, the ``@c_ivt*(@odt_skims['SOV_TIME'] + dot_skims['SOV_TIME'])`` -expression is travel time for the tour origin to destination at the tour start time plus the tour destination to tour origin at the tour end time. +In the :ref:`tour_mode_choice` model expression file example shown below, the ``@c_ivt*(@odt_skims['SOV_TIME'] + dot_skims['SOV_TIME'])`` +expression is travel time for the tour origin to destination at the tour start time plus the tour destination to tour origin at the tour end time. The ``odt_skims`` and ``dot_skims`` objects are setup ahead-of-time to refer to the relevant skims for this model. The ``@c_ivt`` comes from the -tour mode choice coefficient file. The tour mode choice model is a nested logit (NL) model and the nesting structure (including nesting +tour mode choice coefficient file. The tour mode choice model is a nested logit (NL) model and the nesting structure (including nesting coefficients) is specified in the YAML settings file. +-----------------------------------------------------------+--------------------------------------------------------+------------------------------------------------+-----------------+---------------+ | Label | Description | Expression | DRIVEALONEFREE | DRIVEALONEPAY | -+===========================================================+========================================================+================================================+=================+===============+ -| util_DRIVEALONEFREE_Unavailable | DRIVEALONEFREE - Unavailable | sov_available == False | -999 | | -+-----------------------------------------------------------+--------------------------------------------------------+------------------------------------------------+-----------------+---------------+ ++===========================================================+========================================================+================================================+=================+===============+ +| util_DRIVEALONEFREE_Unavailable | DRIVEALONEFREE - Unavailable | sov_available == False | -999 | | ++-----------------------------------------------------------+--------------------------------------------------------+------------------------------------------------+-----------------+---------------+ | util_DRIVEALONEFREE_In_vehicle_time | DRIVEALONEFREE - In-vehicle time | odt_skims['SOV_TIME'] + dot_skims['SOV_TIME'] | coef_ivt | | -+-----------------------------------------------------------+--------------------------------------------------------+------------------------------------------------+-----------------+---------------+ -| util_DRIVEALONEFREE_Unavailable_for_persons_less_than_16 | DRIVEALONEFREE - Unavailable for persons less than 16 | age < 16 | -999 | | -+-----------------------------------------------------------+--------------------------------------------------------+------------------------------------------------+-----------------+---------------+ -| util_DRIVEALONEFREE_Unavailable_for_joint_tours | DRIVEALONEFREE - Unavailable for joint tours | is_joint == True | -999 | | -+-----------------------------------------------------------+--------------------------------------------------------+------------------------------------------------+-----------------+---------------+ ++-----------------------------------------------------------+--------------------------------------------------------+------------------------------------------------+-----------------+---------------+ +| util_DRIVEALONEFREE_Unavailable_for_persons_less_than_16 | DRIVEALONEFREE - Unavailable for persons less than 16 | age < 16 | -999 | | ++-----------------------------------------------------------+--------------------------------------------------------+------------------------------------------------+-----------------+---------------+ +| util_DRIVEALONEFREE_Unavailable_for_joint_tours | DRIVEALONEFREE - Unavailable for joint tours | is_joint == True | -999 | | ++-----------------------------------------------------------+--------------------------------------------------------+------------------------------------------------+-----------------+---------------+ * Rows are vectorized expressions that will be calculated for every record in the current table being operated on * The Label column is the unique expression name (used for model estimation integration) @@ -208,8 +209,8 @@ coefficients) is specified in the YAML settings file. * The Expression column contains a valid vectorized Python/pandas/numpy expression. In the example above, ``drivers`` is a column in the current table. Use ``@`` to refer to data outside the current table * There is a column for each alternative and its relevant coefficient from the submodel coefficient file -There are some variations on this setup, but the functionality is similar. For example, -in the example destination choice model, the size terms expressions file has market segments as rows and employment type +There are some variations on this setup, but the functionality is similar. For example, +in the example destination choice model, the size terms expressions file has market segments as rows and employment type coefficients as columns. Broadly speaking, there are currently four types of model expression configurations: * Simple :ref:`simulate` choice model - select from a fixed set of choices defined in the specification file, such as the example above. @@ -219,10 +220,10 @@ coefficients as columns. Broadly speaking, there are currently four types of mo Expressions ~~~~~~~~~~~ -The expressions class is often used for pre- and post-processor table annotation, which read a CSV file of expression, calculate -a number of additional table fields, and join the fields to the target table. An example table annotation expressions -file is found in the example configuration files for households for the CDAP model - -`annotate_households_cdap.csv `__. +The expressions class is often used for pre- and post-processor table annotation, which read a CSV file of expression, calculate +a number of additional table fields, and join the fields to the target table. An example table annotation expressions +file is found in the example configuration files for households for the CDAP model - +`annotate_households_cdap.csv `__. .. automodule:: activitysim.core.expressions :members: @@ -230,13 +231,13 @@ file is found in the example configuration files for households for the CDAP mod Sampling with Interaction ~~~~~~~~~~~~~~~~~~~~~~~~~ -Methods for expression handling, solving, and sampling (i.e. making multiple choices), -with interaction with the chooser table. +Methods for expression handling, solving, and sampling (i.e. making multiple choices), +with interaction with the chooser table. -Sampling is done with replacement and a sample correction factor is calculated. The factor is +Sampling is done with replacement and a sample correction factor is calculated. The factor is calculated as follows: -:: +:: freq = how often an alternative is sampled (i.e. the pick_count) prob = probability of the alternative @@ -248,8 +249,8 @@ calculated as follows: prob 0.30 0.30 0.30 0.30 0.30 correction factor 1.20 1.90 2.30 2.59 2.81 -As the alternative is oversampled, its utility goes up for final selection. The unique set -of alternatives is passed to the final choice model and the correction factor is +As the alternative is oversampled, its utility goes up for final selection. The unique set +of alternatives is passed to the final choice model and the correction factor is included in the utility. API @@ -263,7 +264,7 @@ API Simulate ~~~~~~~~ -Methods for expression handling, solving, choosing (i.e. making choices) from a fixed set of choices +Methods for expression handling, solving, choosing (i.e. making choices) from a fixed set of choices defined in the specification file. API @@ -277,20 +278,20 @@ API Simulate with Interaction ~~~~~~~~~~~~~~~~~~~~~~~~~ -Methods for expression handling, solving, choosing (i.e. making choices), -with interaction with the chooser table. +Methods for expression handling, solving, choosing (i.e. making choices), +with interaction with the chooser table. API ^^^ .. automodule:: activitysim.core.interaction_simulate :members: - + Simulate with Sampling and Interaction ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Methods for expression handling, solving, sampling (i.e. making multiple choices), -and choosing (i.e. making choices), with interaction with the chooser table. +Methods for expression handling, solving, sampling (i.e. making multiple choices), +and choosing (i.e. making choices), with interaction with the chooser table. API ^^^ @@ -301,7 +302,7 @@ API Assign ~~~~~~ -Alternative version of the expression evaluators in :mod:`activitysim.core.simulate` that supports temporary variable assignment. +Alternative version of the expression evaluators in :mod:`activitysim.core.simulate` that supports temporary variable assignment. Temporary variables are identified in the expressions as starting with "_", such as "_hh_density_bin". These fields are not saved to the data pipeline store. This feature is used by the :ref:`accessibility` model. @@ -345,9 +346,9 @@ API Person Time Windows ------------------- -The departure time and duration models require person time windows. Time windows are adjacent time -periods that are available for travel. Time windows are stored in a timetable table and each row is -a person and each time period (in the case of MTC TM1 is 5am to midnight in 1 hr increments) is a column. +The departure time and duration models require person time windows. Time windows are adjacent time +periods that are available for travel. Time windows are stored in a timetable table and each row is +a person and each time period (in the case of MTC TM1 is 5am to midnight in 1 hr increments) is a column. Each column is coded as follows: * 0 - unscheduled, available @@ -356,7 +357,7 @@ Each column is coded as follows: * 6 - scheduled, end or start of a tour, available for this period only * 7 - scheduled, unavailable, middle of a tour -A good example of a time window expression is ``@tt.previous_tour_ends(df.person_id, df.start)``. This +A good example of a time window expression is ``@tt.previous_tour_ends(df.person_id, df.start)``. This uses the person id and the tour start period to check if a previous tour ends in the same time period. API @@ -371,38 +372,38 @@ Transit Virtual Path Builder ---------------------------- Transit virtual path builder (TVPB) for three zone system (see :ref:`multiple_zone_systems`) transit path utility calculations. -TAP to TAP skims and walk access and egress times between MAZs and TAPs are input to the -demand model. ActivitySim then assembles the total transit path utility based on the user specified TVPB +TAP to TAP skims and walk access and egress times between MAZs and TAPs are input to the +demand model. ActivitySim then assembles the total transit path utility based on the user specified TVPB expression files for the respective components: -* from MAZ to first boarding TAP + -* from first boarding to final alighting TAP + +* from MAZ to first boarding TAP + +* from first boarding to final alighting TAP + * from alighting TAP to destination MAZ -This assembling is done via the TVPB, which considers all the possible combinations of nearby boarding and alighting TAPs for each origin +This assembling is done via the TVPB, which considers all the possible combinations of nearby boarding and alighting TAPs for each origin destination MAZ pair and selects the user defined N best paths to represent the transit mode. After selecting N best paths, the logsum across -N best paths is calculated and exposed to the mode choice models and a random number is drawn and a path is chosen. The boarding TAP, -alighting TAP, and TAP to TAP skim set for the chosen path is saved to the chooser table. +N best paths is calculated and exposed to the mode choice models and a random number is drawn and a path is chosen. The boarding TAP, +alighting TAP, and TAP to TAP skim set for the chosen path is saved to the chooser table. -The initialize TVPB submodel (see :ref:`initialize_los`) pre-computes TAP to TAP total utilities for the user defined attribute_segments, +The initialize TVPB submodel (see :ref:`initialize_los`) pre-computes TAP to TAP total utilities for the user defined attribute_segments, which are typically demographic segment (for example household income bin), time-of-day, and access/egress mode. This submodel can be run in both single process and multiprocess mode, with single process excellent for development/debugging and multiprocess excellent -for application. ActivitySim saves the pre-calculated TAP to TAP total utilities to a memory mapped cache file for reuse by downstream models -such as tour mode choice. In tour mode choice, the pre-computed TAP to TAP total utilities for the attribute_segment, along with the -access and egress impedances, are used to evaluate the best N TAP pairs for each origin MAZ destination MAZ pair being evaluated. -Assembling the total transit path impedance and then picking the best N is quick since it is done in a de-duplicated manner within +for application. ActivitySim saves the pre-calculated TAP to TAP total utilities to a memory mapped cache file for reuse by downstream models +such as tour mode choice. In tour mode choice, the pre-computed TAP to TAP total utilities for the attribute_segment, along with the +access and egress impedances, are used to evaluate the best N TAP pairs for each origin MAZ destination MAZ pair being evaluated. +Assembling the total transit path impedance and then picking the best N is quick since it is done in a de-duplicated manner within each chunk of multiprocessed choosers. -A model with TVPB can take considerably longer to run than a traditional TAZ based model since it does an order of magnitude more -calculations. Thus, it is important to be mindful of your approach to your network model as well, especially the number of TAPs -accessible to each MAZ, which is the key determinant of runtime. +A model with TVPB can take considerably longer to run than a traditional TAZ based model since it does an order of magnitude more +calculations. Thus, it is important to be mindful of your approach to your network model as well, especially the number of TAPs +accessible to each MAZ, which is the key determinant of runtime. API ~~~ .. automodule:: activitysim.core.pathbuilder :members: - + Cache API ~~~~~~~~~ @@ -611,14 +612,14 @@ Chunk Chunking management. .. note:: - The definition of chunk_size has changed from previous versions of ActivitySim. The revised definition + The definition of chunk_size has changed from previous versions of ActivitySim. The revised definition of chunk_size simplifies model setup since it is the approximate amount of RAM available to ActivitySim as opposed to the obscure number of doubles (64-bit numbers) in a chunk of a choosers table. -The ``chunk_size`` is the approximate amount of RAM in GBs to allocate to ActivitySim for batch +The ``chunk_size`` is the approximate amount of RAM in GBs to allocate to ActivitySim for batch processing choosers across all processes. It is specified in bytes, for example ``chunk_size: 500_000_000_000`` is 500 GBs. If set ``chunk_training_mode: disabled`` then no chunking will be performed and ActivitySim will attempt to solve all the -choosers at once across all the processes. Chunking is required when all the chooser data required to process all the +choosers at once across all the processes. Chunking is required when all the chooser data required to process all the choosers cannot fit within the available RAM and so ActivitySim must split the choosers into batches and then process the batches in sequence. Configuration of the ``chunk_size`` depends on several parameters: @@ -638,35 +639,35 @@ enough to fit within the available memory. For example, the choosers table is s processed in sequence. In multi process mode, for example with 10 processes, ActivitySim splits the 1 million households into 10 mini processes each with 100,000 households. Then for the auto ownership submodel, the chooser table within each process is the 100,000 choosers and there must be enough RAM to simultaneously solve all 10 processes with each 100,000 choosers at once. If not, -then chunking can be setup so each mini process table of choosers is split into chunks for sequential processing, for example from -10 tables of 100,000 choosers to 20 tables of 50,000 choosers. +then chunking can be setup so each mini process table of choosers is split into chunks for sequential processing, for example from +10 tables of 100,000 choosers to 20 tables of 50,000 choosers. -If the user desires the fastest runtimes possible given their hardware, model inputs, and model configuration, then ActivitySim +If the user desires the fastest runtimes possible given their hardware, model inputs, and model configuration, then ActivitySim should be configured to use most of the CPUs/cores (physical, not virtual), most of the RAM, and with the :ref:`mkl_settings`. For -example, if the machine has 12 cores and 256 GB of RAM, then try configuring the model with ``num_processes: 10`` and +example, if the machine has 12 cores and 256 GB of RAM, then try configuring the model with ``num_processes: 10`` and ``chunk_size: 0`` to start and seeing if the model can fit the problem into the available RAM. If not, then try setting ``chunk_size`` to something like 225 GB, ``chunk_size: 225_000_000_000``. Experimentation of the desired configuration of the CPUs and RAM should be done for each new machine and model setup (with respect to the number of households, skims, and model configuration). In general, more processors means faster runtimes and more RAM means faster runtimes, but the relationship of processors to RAM is not linear as processors can only go so fast and because there is more to runtime than processors and RAM, including cache speed, disk speed, etc. Also, the amount of RAM -to use is approximate and ActivitySim often pushes a bit above the user specified amount due to pandas/numpy memory spikes for -memory intensive operations and so it is recommended to leave some RAM unallocated. The exact amount to leave unallocated depends on the +to use is approximate and ActivitySim often pushes a bit above the user specified amount due to pandas/numpy memory spikes for +memory intensive operations and so it is recommended to leave some RAM unallocated. The exact amount to leave unallocated depends on the parameters above. To configure chunking behavior, ActivitySim must first be trained with the model setup and machine. To do so, first run the model with ``chunk_training_mode: training``. This tracks the amount of memory used by each table by submodel and writes the results to a cache file that is then re-used for production runs. This training mode is significantly slower than production mode since it does -significantly more memory inspection. For a training mode run, set ``num_processors`` to about 80% of the avaiable logical processors and ``chunk_size`` +significantly more memory inspection. For a training mode run, set ``num_processors`` to about 80% of the avaiable logical processors and ``chunk_size`` to about 80% of the available RAM. This will run the model and create the ``chunk_cache.csv`` file in output\cache for reuse. After creating the chunk cache file, the model can be run with ``chunk_training_mode: production`` and the desired ``num_processors`` and ``chunk_size``. The model will read the chunk cache file from the output\cache folder, similar to how it reads cached skims if specified. -The software trains on the size of problem so the cache file can be re-used and only needs to be updated due to significant revisions in population, -expression, skims/network LOS, or changes in machine specs. If run in production mode and no cache file is found then ActivitySim falls -back to training mode. A third ``chunk_training_mode`` is adaptive, which if a cache file exists, runs the model with the starting cache -settings but also updates the cache settings based on additional memory inspection. This may additionally improve the cache setttings to -reduce runtimes when run in production mode. If ``resume_after`` is set, then the chunk cache file is not overwritten in cache directory +The software trains on the size of problem so the cache file can be re-used and only needs to be updated due to significant revisions in population, +expression, skims/network LOS, or changes in machine specs. If run in production mode and no cache file is found then ActivitySim falls +back to training mode. A third ``chunk_training_mode`` is adaptive, which if a cache file exists, runs the model with the starting cache +settings but also updates the cache settings based on additional memory inspection. This may additionally improve the cache setttings to +reduce runtimes when run in production mode. If ``resume_after`` is set, then the chunk cache file is not overwritten in cache directory since the list of submodels would be incomplete. A foruth ``chunk_training_mode`` is disabled, which assumes the model can be run without -chunking due to an abundance of RAM. +chunking due to an abundance of RAM. The following ``chunk_methods`` are supported to calculate memory overhead when chunking is enabled: @@ -676,10 +677,10 @@ The following ``chunk_methods`` are supported to calculate memory overhead when * rss - like uss, but for resident set size (rss), which is the portion of memory occupied by a process that is held in RAM * hybrid_rss - like hybrid_uss, but for rss -RSS is reported by psutil.memory_info and USS is reported by psutil.memory_full_info. USS is the memory which is private to -a process and which would be freed if the process were terminated. This is the metric that most closely matches the rather -vague notion of memory "in use" (the meaning of which is difficult to pin down in operating systems with virtual memory -where memory can (but sometimes can't) be swapped or mapped to disk. ``hybrid_uss`` performs best and is most reliable and +RSS is reported by psutil.memory_info and USS is reported by psutil.memory_full_info. USS is the memory which is private to +a process and which would be freed if the process were terminated. This is the metric that most closely matches the rather +vague notion of memory "in use" (the meaning of which is difficult to pin down in operating systems with virtual memory +where memory can (but sometimes can't) be swapped or mapped to disk. ``hybrid_uss`` performs best and is most reliable and is therefore the default. Additional chunking settings: diff --git a/docs/examples.rst b/docs/examples.rst index 5986f46dfc..a2768ea44f 100644 --- a/docs/examples.rst +++ b/docs/examples.rst @@ -14,6 +14,8 @@ This page describes the example models included with ActivitySim. The current e +=================================+===========================================================+==============+======================+ | :ref:`example_mtc` | Primary MTC travel model one example | 1 | Mature | +---------------------------------+-----------------------------------------------------------+--------------+----------------------+ +| :ref:`example_mtc_extended` | example_mtc with additional optional models | 1 | In development | ++---------------------------------+-----------------------------------------------------------+--------------+----------------------+ | :ref:`example_estimation` | Estimation example with example_mtc | 1 | Mature | +---------------------------------+-----------------------------------------------------------+--------------+----------------------+ | :ref:`example_multiple_zones` | 2 or 3 zone system example using example_mtc data | 2 or 3 | Simple test example | @@ -32,7 +34,7 @@ This page describes the example models included with ActivitySim. The current e +---------------------------------+-----------------------------------------------------------+--------------+----------------------+ .. note:: - The `example_manifest.yaml `_ + The `example_manifest.yaml `_ contains example commands to create and run several versions of the examples. See also :ref:`adding_agency_examples` for more information on agency example models. @@ -41,9 +43,9 @@ This page describes the example models included with ActivitySim. The current e example_mtc ----------- -The initial example implemented in ActivitySim was example_mtc. This section described the example_mtc -model design, how to setup and run the example, and how to review outputs. The default configuration of the -example is limited to a small sample of households and zones so that it can be run quickly and require +The initial example implemented in ActivitySim was example_mtc. This section described the example_mtc +model design, how to setup and run the example, and how to review outputs. The default configuration of the +example is limited to a small sample of households and zones so that it can be run quickly and require less than 1 GB of RAM. The full scale example can be configured and run as well. Model Design @@ -67,7 +69,7 @@ TM1 uses the 1454 TAZ zone system developed for the MTC trip-based model. The z which may somewhat distort the representation of transit access in mode choice. To ameliorate this problem, the original model zones were further sub-divided into three categories of transit access: short walk, long walk, and not walkable. However, support for transit subzones is not included in the activitysim implementation since the latest generation -of activity-based models typically use an improved approach to spatial representation called multiple zone systems. See +of activity-based models typically use an improved approach to spatial representation called multiple zone systems. See :ref:`multiple_zone_systems` for more information. Decision-making units @@ -202,39 +204,39 @@ occupancy and toll/non-toll choice, walk and bike, walk and drive access to five transit line-haul modes, and ride hail with taxi, single TNC (Transportation Network Company), and shared TNC. * Auto - + * SOV Free * SOV Pay * 2 Person Free * 2 Person Pay * 3+ Person Free * 3+ Person Pay - + * Nonmotorized - + * Walk * Bike - - * Transit - + + * Transit + * Walk - + * Walk to Local Bus * Walk to Light-Rail Transit * Walk to Express Bus * Walk to Bus Rapid Transit * Walk to Heavy Rail - + * Drive - + * Drive to Local Bus * Drive to Light-Rail Transit * Drive to Express Bus * Drive to Bus Rapid Transit * Drive to Heavy Rail - + * Ride Hail - + * Taxi * Single TNC * Shared TNC @@ -466,17 +468,17 @@ Area types +------+------------------------------------------+ .. note:: - + ActivitySim can optionally build an HDF5 file of the input CSV tables for use in subsequent runs since HDF5 is binary and therefore results in faster read times. see :ref:`configuration` - OMX and HDF5 files can be viewed with the `OMX Viewer `__ or + OMX and HDF5 files can be viewed with the `OMX Viewer `__ or `HDFView `__. - + The ``other_resources\scripts\build_omx.py`` script will build one OMX file containing all the skims. The original MTC TM1 skims were converted from Cube to OMX using the ``other_resources\scripts\mtc_tm1_omx_export.s`` script. - The example_mtc inputs were created by the ``other_resources\scripts\create_sf_example.py`` script, which creates the land use, synthetic population, and + The example_mtc inputs were created by the ``other_resources\scripts\create_sf_example.py`` script, which creates the land use, synthetic population, and skim inputs for a subset of user-defined zones. .. index:: configuration @@ -545,7 +547,7 @@ Python/pandas/numpy expressions, alternatives, and other settings used by each m alternatives file since the alternatives are not easily described as columns in the expressions file. An example of this is the ``non_mandatory_tour_frequency_alternatives.csv`` file, which lists each alternative as a row and each columns indicates the number of non-mandatory tours by purpose. The set of files for the example_mtc are below. The -:ref:`example_arc` example and :ref:`example_semcog` example added additional submodels. +:ref:`example_arc`, :ref:`example_semcog`, and :ref:`example_mtc_extended` examples added additional submodels. +------------------------------------------------+--------------------------------------------------------------------+ | Model | Specification Files | @@ -846,13 +848,13 @@ include the multiprocessing configuration settings via settings file inheritance The multiprocessing example also writes outputs to the output folder. The default multiprocessed example is configured to run with two processors and chunking training: ``num_processes: 2``, -``chunk_size: 0``, and ``chunk_training_mode: training``. Additional more performant configurations are included and -commented out in the example settings file. For example, the 100 percent sample full scale multiprocessing example -- ``example_mtc_full`` - was run on a Windows Server machine with 28 cores and 256GB RAM with the configuration below. -The default setup runs with ``chunk_training_mode: training`` since no chunk cache file is present. To run the example -significantly faster, try ``chunk_training_mode: disabled`` if the machine has sufficient RAM, or try -``chunk_training_mode: production``. To configure ``chunk_training_mode: production``, first configure chunking as -discussed below. See :ref:`multiprocessing` and :ref:`chunk_size` for more information. +``chunk_size: 0``, and ``chunk_training_mode: training``. Additional more performant configurations are included and +commented out in the example settings file. For example, the 100 percent sample full scale multiprocessing example +- ``example_mtc_full`` - was run on a Windows Server machine with 28 cores and 256GB RAM with the configuration below. +The default setup runs with ``chunk_training_mode: training`` since no chunk cache file is present. To run the example +significantly faster, try ``chunk_training_mode: disabled`` if the machine has sufficient RAM, or try +``chunk_training_mode: production``. To configure ``chunk_training_mode: production``, first configure chunking as +discussed below. See :ref:`multiprocessing` and :ref:`chunk_size` for more information. :: @@ -867,7 +869,7 @@ discussed below. See :ref:`multiprocessing` and :ref:`chunk_size` for more infor Configuring chunking ^^^^^^^^^^^^^^^^^^^^ -To configure chunking, ActivitySim must first be trained to determine reasonable chunking settings given the +To configure chunking, ActivitySim must first be trained to determine reasonable chunking settings given the model setup and machine. The steps to configure chunking are: * Run the full scale model with ``chunk_training_mode: training``. Set ``num_processors`` to about 80% of the available physical processors and ``chunk_size`` to about 80% of the available RAM. This will run the model and create the ``chunk_cache.csv`` file in the output\cache directory for reuse. @@ -880,10 +882,10 @@ Outputs ~~~~~~~ The key output of ActivitySim is the HDF5 data pipeline file ``outputs\pipeline.h5``. By default, this datastore file -contains a copy of each data table after each model step in which the table was modified. +contains a copy of each data table after each model step in which the table was modified. The example also writes the final tables to CSV files by using the ``write_tables`` step. This step calls -:func:`activitysim.core.pipeline.get_table` to get a pandas DataFrame and write a CSV file for each table +:func:`activitysim.core.pipeline.get_table` to get a pandas DataFrame and write a CSV file for each table specified in ``output_tables`` in the settings.yaml file. :: @@ -904,7 +906,7 @@ specified in ``output_tables`` in the settings.yaml file. -The ``other_resources\scripts\make_pipeline_output.py`` script uses the information stored in the pipeline file to create +The ``other_resources\scripts\make_pipeline_output.py`` script uses the information stored in the pipeline file to create the table below for a small sample of households. The table shows that for each table in the pipeline, the number of rows and/or columns changes as a result of the relevant model step. A ``checkpoints`` table is also stored in the pipeline, which contains the crosswalk between model steps and table states in order to reload tables for @@ -1022,9 +1024,9 @@ help debug data and/or logic errors. Writing Logsums ^^^^^^^^^^^^^^^ -The tour and trip destination and mode choice models calculate logsums but do not persist them by default. -Mode and destination choice logsums are essential for re-estimating these models and can therefore be -saved to the pipeline if desired. To save the tour and trip destination and mode choice model logsums, include +The tour and trip destination and mode choice models calculate logsums but do not persist them by default. +Mode and destination choice logsums are essential for re-estimating these models and can therefore be +saved to the pipeline if desired. To save the tour and trip destination and mode choice model logsums, include the following optional settings in the model settings file. The data is saved to the pipeline for later use. :: @@ -1032,18 +1034,18 @@ the following optional settings in the model settings file. The data is saved t # in workplace_location.yaml for example DEST_CHOICE_LOGSUM_COLUMN_NAME: workplace_location_logsum DEST_CHOICE_SAMPLE_TABLE_NAME: workplace_location_sample - + # in tour_mode_choice.yaml for example MODE_CHOICE_LOGSUM_COLUMN_NAME: mode_choice_logsum -The `DEST_CHOICE_SAMPLE_TABLE_NAME` contains the fields in the table below. Writing out the -destination choice sample table, which includes the mode choice logsum for each sampled +The `DEST_CHOICE_SAMPLE_TABLE_NAME` contains the fields in the table below. Writing out the +destination choice sample table, which includes the mode choice logsum for each sampled alternative destination, adds significant size to the pipeline. Therefore, this feature should only be activated when writing logsums for a small set of households for model estimation. +-----------------------------------+---------------------------------------+ | Field | Description | -+===================================+=======================================+ ++===================================+=======================================+ | chooser_id | chooser id such as person or tour id | +-----------------------------------+---------------------------------------+ | alt_dest | destination alternative id | @@ -1055,13 +1057,28 @@ only be activated when writing logsums for a small set of households for model e | mode_choice_logsum | mode choice logsum | +-----------------------------------+---------------------------------------+ +.. _example_mtc_extended : + +example_mtc_extended +-------------------- + +example_mtc_extended contains additional models that were developed to enhance ActivitySim's modeling +capabilities, but are not part of travel model one that example_mtc was developed from. This example inherets +the data and configuration files from example_mtc. The current list of additional models included +in this example are: + +* :ref:`vehicle_type_choice`: Selects a vehicle type for each household vehicle. Runs after auto_ownership. +* :ref:`vehicle_allocation`: Allocates a vehicle for each tour and each occupancy level. Tour and trip mode choice + auto operating costs are modified to reflect the allocated vehicle option. + + .. _example_estimation : example_estimation ------------------ ActivitySim includes the ability to re-estimate submodels using choice model estimation tools -such as `larch `__. In order to do so, ActivitySim adopts the concept of an estimation +such as `larch `__. In order to do so, ActivitySim adopts the concept of an estimation data bundle (EDB), which is a collection of the necessary data to re-estimate a submodel. See :ref:`estimation` for examples that illustrate running ActivitySim in estimation mode and using larch to re-restimate submodels. @@ -1075,7 +1092,7 @@ example_multiple_zones In a multiple zone system approach, households, land use, and trips are modeled at the microzone (MAZ) level. MAZs are smaller than traditional TAZs and therefore make for a more precise system. However, when considering network level-of-service (LOS) indicators (e.g. skims), the model uses different spatial resolutions for different travel modes in order to reduce the network -modeling burden and model runtimes. The typical multiple zone system setup is a TAZ zone system for auto travel, a MAZ zone +modeling burden and model runtimes. The typical multiple zone system setup is a TAZ zone system for auto travel, a MAZ zone system for non-motorized travel, and optionally a transit access points (TAPs) zone system for transit. ActivitySim supports models with multiple zone systems. The three versions of multiple zone systems are one-zone, two-zone, and three-zone. @@ -1093,7 +1110,7 @@ TAZ only model, but it provides a much richer framework for transit modeling. TAZ to TAZ impedances. To develop the three zone example system example, the TM1 TAZ model was further transformed so select TAZs also became TAPs and TAP to TAP skims and MAZ to TAP impedances files were created. While sufficient for initial development, these examples were insufficient for validation and performance testing of the new software. As a result, - the :ref:`example_marin` example was created. + the :ref:`example_marin` example was created. Example simple test configurations and inputs for two and three-zone system models are described below. @@ -1129,7 +1146,7 @@ To run the two zone and three zone system examples, do the following: Settings ~~~~~~~~ -Additional settings for running ActivitySim with two or three zone systems are specified in the ``settings.yaml`` and +Additional settings for running ActivitySim with two or three zone systems are specified in the ``settings.yaml`` and ``network_los.yaml`` files. The settings are: Two Zone @@ -1316,11 +1333,11 @@ Additional settings to configure the TVPB are: Outputs ~~~~~~~ -Essentially the same set of outputs is created for a two or three zone system +Essentially the same set of outputs is created for a two or three zone system model as for a one zone system model. However, the one key additional bit of -information for a three zone system model is the boarding TAP, alighting TAP, and -transit skim set is added to the relevant chooser table (e.g. tours and trips) when the -chosen mode is transit. Logging and tracing also work for two and three zone models, +information for a three zone system model is the boarding TAP, alighting TAP, and +transit skim set is added to the relevant chooser table (e.g. tours and trips) when the +chosen mode is transit. Logging and tracing also work for two and three zone models, including tracing of the TVPB calculations. The :ref:`write_trip_matrices` step writes both TAZ and TAP level matrices depending on the configured number of zone systems. @@ -1329,10 +1346,10 @@ both TAZ and TAP level matrices depending on the configured number of zone syste Presampling ~~~~~~~~~~~ -In multiple zone systems models, destination choice presampling is activated by default. Destination -choice presampling first aggregates microzone size terms to the TAZ level and then runs destination -choice sampling at the TAZ level using the destination choice sampling models. After sampling X -number of TAZs based on impedance and size, the model selects a microzone for each TAZ based +In multiple zone systems models, destination choice presampling is activated by default. Destination +choice presampling first aggregates microzone size terms to the TAZ level and then runs destination +choice sampling at the TAZ level using the destination choice sampling models. After sampling X +number of TAZs based on impedance and size, the model selects a microzone for each TAZ based on the microzone share of TAZ size. Presampling significantly reduces runtime while producing similar results. @@ -1374,10 +1391,10 @@ To run example_marin, do the following: Settings ~~~~~~~~ -Additional settings for running the Marin TM2 tour mode choice example are in the ``network_los.yaml`` file. The -only additional notable setting is the ``tap_lines`` setting, which identifies a table of transit line names -served for each TAP. This file is used to trimmed the set of nearby TAP for each MAZ so only TAPs that are -further away and serve new service are included in the TAP set for consideration. It is a very important +Additional settings for running the Marin TM2 tour mode choice example are in the ``network_los.yaml`` file. The +only additional notable setting is the ``tap_lines`` setting, which identifies a table of transit line names +served for each TAP. This file is used to trimmed the set of nearby TAP for each MAZ so only TAPs that are +further away and serve new service are included in the TAP set for consideration. It is a very important file to include as it can considerably reduce runtimes. :: @@ -1396,7 +1413,7 @@ example_arc The example_arc added a :ref:`trip_scheduling_choice`, :ref:`trip_departure_choice`, and :ref:`parking_location_choice` -submodel. These submodel specification files are below, and are in addition to the :ref:`example_mtc` +submodel. These submodel specification files are below, and are in addition to the :ref:`example_mtc` submodel :ref:`sub-model-spec-files`. .. _arc-sub-model-spec-files: @@ -1424,7 +1441,7 @@ Example ARC Sub-Model Specification Files Example ~~~~~~~ -See example commands in `example_manifest.yaml `_ +See example commands in `example_manifest.yaml `_ for running example_arc. For optimal performance, configure multiprocessing and chunk_size based on machine hardware. .. _example_semcog : @@ -1472,7 +1489,7 @@ Example SEMCOG Sub-Model Specification Files Example ~~~~~~~ -See example commands in `example_manifest.yaml `_ +See example commands in `example_manifest.yaml `_ for running example_semcog. For optimal performance, configure multiprocessing and chunk_size based on machine hardware. @@ -1486,13 +1503,13 @@ example_psrc This example is in development -The example_psrc is a two zone system (MAZs and TAZs) implementation of the +The example_psrc is a two zone system (MAZs and TAZs) implementation of the example_mtc model design. It uses PSRC zones, land use, synthetic population, and network LOS (skims). Example ~~~~~~~ -See example commands in `example_manifest.yaml `_ +See example commands in `example_manifest.yaml `_ for running example_psrc. For optimal performance, configure multiprocessing and chunk_size based on machine hardware. .. _example_sandag : @@ -1505,7 +1522,7 @@ example_sandag This example is in development -The example_sandag is a three zone system (MAZs, TAZs, and TAPs) implementation of the +The example_sandag is a three zone system (MAZs, TAZs, and TAPs) implementation of the example_mtc model design. It uses SANDAG zones, land use, synthetic population, and network LOS (skims). Example @@ -1530,4 +1547,4 @@ Example ~~~~~~~ See example commands in `example_manifest.yaml `_ -for running example_sandag_xborder. For optimal performance, configure multiprocessing and chunk_size based on machine hardware. \ No newline at end of file +for running example_sandag_xborder. For optimal performance, configure multiprocessing and chunk_size based on machine hardware. diff --git a/docs/models.rst b/docs/models.rst index e5a39f870a..f8290fb0ac 100644 --- a/docs/models.rst +++ b/docs/models.rst @@ -5,7 +5,7 @@ Models ====== -The currently implemented example ActivitySim AB models are described below. See the example +The currently implemented example ActivitySim AB models are described below. See the example model :ref:`sub-model-spec-files`, :ref:`arc-sub-model-spec-files`, and :ref:`semcog-sub-model-spec-files` for more information. .. _initialize_landuse: @@ -15,20 +15,20 @@ model :ref:`sub-model-spec-files`, :ref:`arc-sub-model-spec-files`, and :ref:`se Initialize ---------- -The initialize model isn't really a model, but rather a few data processing steps in the data pipeline. +The initialize model isn't really a model, but rather a few data processing steps in the data pipeline. The initialize data processing steps code variables used in downstream models, such as household and person -value-of-time. This step also pre-loads the land_use, households, persons, and person_windows tables because -random seeds are set differently for each step and therefore the sampling of households depends on which step -they are initially loaded in. +value-of-time. This step also pre-loads the land_use, households, persons, and person_windows tables because +random seeds are set differently for each step and therefore the sampling of households depends on which step +they are initially loaded in. -The main interface to the initialize land use step is the :py:func:`~activitysim.abm.models.initialize.initialize_landuse` -function. The main interface to the initialize household step is the :py:func:`~activitysim.abm.models.initialize.initialize_households` -function. The main interface to the initialize tours step is the :py:func:`~activitysim.abm.models.initialize_tours.initialize_tours` +The main interface to the initialize land use step is the :py:func:`~activitysim.abm.models.initialize.initialize_landuse` +function. The main interface to the initialize household step is the :py:func:`~activitysim.abm.models.initialize.initialize_households` +function. The main interface to the initialize tours step is the :py:func:`~activitysim.abm.models.initialize_tours.initialize_tours` function. These functions are registered as Inject steps in the example Pipeline. .. automodule:: activitysim.abm.models.initialize :members: - + .. automodule:: activitysim.abm.models.initialize_tours :members: @@ -38,14 +38,14 @@ function. These functions are registered as Inject steps in the example Pipelin Initialize LOS -------------- -The initialize LOS model isn't really a model, but rather a series of data processing steps in the data pipeline. +The initialize LOS model isn't really a model, but rather a series of data processing steps in the data pipeline. The initialize LOS model does two things: * Loads skims and cache for later if desired * Loads network LOS inputs for transit virtual path building (see :ref:`transit_virtual_path_builder`), pre-computes tap-to-tap total utilities and cache for later if desired -The main interface to the initialize LOS step is the :py:func:`~activitysim.abm.models.initialize_los.initialize_los` -function. The main interface to the initialize TVPB step is the :py:func:`~activitysim.abm.models.initialize_los.initialize_tvpb` +The main interface to the initialize LOS step is the :py:func:`~activitysim.abm.models.initialize_los.initialize_los` +function. The main interface to the initialize TVPB step is the :py:func:`~activitysim.abm.models.initialize_los.initialize_tvpb` function. These functions are registered as Inject steps in the example Pipeline. .. automodule:: activitysim.abm.models.initialize_los @@ -56,23 +56,23 @@ function. These functions are registered as Inject steps in the example Pipelin Accessibility ------------- -The accessibilities model is an aggregate model that calculates multiple origin-based accessibility -measures by origin zone to all destination zones. +The accessibilities model is an aggregate model that calculates multiple origin-based accessibility +measures by origin zone to all destination zones. -The accessibility measure first multiplies an employment variable by a mode-specific decay function. The -product reflects the difficulty of accessing the activities the farther (in terms of round-trip travel time) -the jobs are from the location in question. The products to each destination zone are next summed over -each origin zone, and the logarithm of the product mutes large differences. The decay function on -the walk accessibility measure is steeper than automobile or transit. The minimum accessibility is zero. +The accessibility measure first multiplies an employment variable by a mode-specific decay function. The +product reflects the difficulty of accessing the activities the farther (in terms of round-trip travel time) +the jobs are from the location in question. The products to each destination zone are next summed over +each origin zone, and the logarithm of the product mutes large differences. The decay function on +the walk accessibility measure is steeper than automobile or transit. The minimum accessibility is zero. -Level-of-service variables from three time periods are used, specifically the AM peak period (6 am to 10 am), the +Level-of-service variables from three time periods are used, specifically the AM peak period (6 am to 10 am), the midday period (10 am to 3 pm), and the PM peak period (3 pm to 7 pm). *Inputs* * Highway skims for the three periods. Each skim is expected to include a table named "TOLLTIMEDA", which is the drive alone in-vehicle travel time for automobiles willing to pay a "value" (time-savings) toll. * Transit skims for the three periods. Each skim is expected to include the following tables: (i) "IVT", in-vehicle time; (ii) "IWAIT", initial wait time; (iii) "XWAIT", transfer wait time; (iv) "WACC", walk access time; (v) "WAUX", auxiliary walk time; and, (vi) "WEGR", walk egress time. -* Zonal data with the following fields: (i) "TOTEMP", total employment; (ii) "RETEMPN", retail trade employment per the NAICS classification. +* Zonal data with the following fields: (i) "TOTEMP", total employment; (ii) "RETEMPN", retail trade employment per the NAICS classification. *Outputs* @@ -88,8 +88,8 @@ midday period (10 am to 3 pm), and the PM peak period (3 pm to 7 pm). * nonMotorizedRetail, the accessibility by walking during all time periods to retail employment * nonMotorizedTotal, the accessibility by walking during all time periods to all employment -The main interface to the accessibility model is the -:py:func:`~activitysim.abm.models.accessibility.compute_accessibility` +The main interface to the accessibility model is the +:py:func:`~activitysim.abm.models.accessibility.compute_accessibility` function. This function is registered as an Inject step in the example Pipeline. Core Table: ``skims`` | Result Table: ``accessibility`` | Skims Keys: ``O-D, D-O`` @@ -146,19 +146,19 @@ The school location model is made up of four steps: * logsums - starts with the table created above and calculates and adds the mode choice logsum expression for each alternative school location. * simulate - starts with the table created above and chooses a final school location, this time with the mode choice logsum included. * shadow prices - compare modeled zonal destinations to target zonal size terms and calculate updated shadow prices. - -These steps are repeated until shadow pricing convergence criteria are satisfied or a max number of iterations is reached. See :ref:`shadow_pricing`. + +These steps are repeated until shadow pricing convergence criteria are satisfied or a max number of iterations is reached. See :ref:`shadow_pricing`. School location choice for :ref:`multiple_zone_systems` models uses :ref:`presampling` by default. -The main interfaces to the model is the :py:func:`~activitysim.abm.models.location_choice.school_location` function. -This function is registered as an Inject step in the example Pipeline. See :ref:`writing_logsums` for how to write logsums for estimation. +The main interfaces to the model is the :py:func:`~activitysim.abm.models.location_choice.school_location` function. +This function is registered as an Inject step in the example Pipeline. See :ref:`writing_logsums` for how to write logsums for estimation. Core Table: ``persons`` | Result Field: ``school_taz`` | Skims Keys: ``TAZ, alt_dest, AM time period, MD time period`` Work Location ------------- - + The usual work location choice models assign a usual work location for the primary mandatory activity of each employed person in the synthetic population. The models are composed of a set of accessibility-based parameters @@ -177,8 +177,8 @@ These steps are repeated until shadow pricing convergence criteria are satisfied Work location choice for :ref:`multiple_zone_systems` models uses :ref:`presampling` by default. -The main interfaces to the model is the :py:func:`~activitysim.abm.models.location_choice.workplace_location` function. -This function is registered as an Inject step in the example Pipeline. See :ref:`writing_logsums` for how to write logsums for estimation. +The main interfaces to the model is the :py:func:`~activitysim.abm.models.location_choice.workplace_location` function. +This function is registered as an Inject step in the example Pipeline. See :ref:`writing_logsums` for how to write logsums for estimation. Core Table: ``persons`` | Result Field: ``workplace_taz`` | Skims Keys: ``TAZ, alt_dest, AM time period, PM time period`` @@ -240,15 +240,15 @@ In total, ActivitySim generates three types of output files for each model with Transit Pass Subsidy -------------------- -The transit fare discount model is defined as persons who purchase or are -provided a transit pass. The transit fare discount consists of two submodels - this -transit pass subsidy model and a person :ref:`transit_pass_ownership` model. The -result of this model can be used to condition downstream models such as the +The transit fare discount model is defined as persons who purchase or are +provided a transit pass. The transit fare discount consists of two submodels - this +transit pass subsidy model and a person :ref:`transit_pass_ownership` model. The +result of this model can be used to condition downstream models such as the person :ref:`transit_pass_ownership` model and the tour and trip mode choice models -via fare discount adjustments. +via fare discount adjustments. -The main interface to the transit pass subsidy model is the -:py:func:`~activitysim.examples.example_semcog.extensions.transit_pass_subsidy` function. This +The main interface to the transit pass subsidy model is the +:py:func:`~activitysim.examples.example_semcog.extensions.transit_pass_subsidy` function. This function is registered as an Inject step in the example Pipeline. Core Table: ``persons`` | Result Field: ``transit_pass_subsidy`` | Skims Keys: NA @@ -261,14 +261,14 @@ Core Table: ``persons`` | Result Field: ``transit_pass_subsidy`` | Skims Keys: N Transit Pass Ownership ---------------------- -The transit fare discount is defined as persons who purchase or are -provided a transit pass. The transit fare discount consists of two submodels - this -transit pass ownership model and a person :ref:`transit_pass_subsidy` model. The -result of this model can be used to condition downstream models such as the tour and trip -mode choice models via fare discount adjustments. +The transit fare discount is defined as persons who purchase or are +provided a transit pass. The transit fare discount consists of two submodels - this +transit pass ownership model and a person :ref:`transit_pass_subsidy` model. The +result of this model can be used to condition downstream models such as the tour and trip +mode choice models via fare discount adjustments. -The main interface to the transit pass ownership model is the -:py:func:`~activitysim.examples.example_semcog.extensions.transit_pass_ownership` function. This +The main interface to the transit pass ownership model is the +:py:func:`~activitysim.examples.example_semcog.extensions.transit_pass_ownership` function. This function is registered as an Inject step in the example Pipeline. Core Table: ``persons`` | Result Field: ``transit_pass_ownership`` | Skims Keys: NA @@ -293,6 +293,73 @@ Core Table: ``households`` | Result Field: ``auto_ownership`` | Skims Keys: NA .. automodule:: activitysim.abm.models.auto_ownership :members: + +.. _vehicle_type_choice: + +Vehicle Type Choice +------------------- + +The vehicle type choice model selects a vehicle type for each household vehicle. A vehicle type +is a combination of the vehicle's body type, age, and fuel type. For example, a 13 year old +gas powered van would have a vehicle type of *van_13_gas*. + +There are two vehicle type choice model structures implemented: + +1. Simultaneous choice of body type, age, and fuel type. +2. Simultaneous choice of body type and age, with fuel type assigned from a probability distribution. + +The *vehicle_type_choice.yaml* file contains the following model specific options: + +* ``SPEC``: Filename for input utility expressions +* ``COEFS``: Filename for input utility expression coefficients +* ``LOGIT_TYPE``: Specifies whether you are using a nested or multinomial logit structure +* ``combinatorial_alts``: Specifies the alternatives for the choice model. + Has sub-categories of ``body_type``, ``age``, and ``fuel_type``. +* ``PROBS_SPEC``: Filename for input fuel type probabilities. Supplying probabilities + corresponds to implementation structure 2 above, and not supplying probabilities would correspond to implementation structure 1. + If provided, the ``fuel_type`` category in ``combinatorial_alts`` + will be excluded from the model alternatives such that only body type and age are selected. Input ``PROBS_SPEC`` table will have an index + column named *vehicle_type* which is a combination of body type and age in the form ``{body type}_{age}``. Subsequent column names + specify the fuel type that will be added and the column values are the probabilities of that fuel type. + The vehicle type model will select a fuel type for each vehicle based on the provided probabilities. +* ``VEHICLE_TYPE_DATA_FILE``: Filename for input vehicle type data. Must have columns ``body_type``, ``fuel_type``, and ``vehicle_year``. + Vehicle ``age`` is computed using the ``FLEET_YEAR`` option. Data for every alternative specified in the ``combinatorial_alts`` option must be included + in the file. Vehicle type data file will be joined to the alternatives and can be used in the utility expressions if ``PROBS_SPEC`` is not provided. + If ``PROBS_SPEC`` is provided, the vehicle type data will be joined after a vehicle type is decided so the data can be used in downstream models. +* ``COLS_TO_INCLUDE_IN_VEHICLE_TABLE``: List of columns from the vehicle type data file to include in the vehicle table that can be used in downstream models. + Examples of data that might be needed is vehicle range for the :ref:`vehicle_allocation` model, auto operating costs to use in tour and trip mode choice, + and emissions data for post-model-run analysis. +* ``FLEET_YEAR``: Integer specifying the fleet year to be used in the model run. This is used to compute ``age`` in the + vehicle type data table where ``age = (1 + FLEET_YEAR - vehicle_year)``. Computing age on the fly with the ``FLEET_YEAR`` variable allows the + user flexibility to compile and share a single vehicle type data file containing all years and simply change the ``FLEET_YEAR`` to run + different scenario years. +* Optional additional settings that work the same in other models are constants, expression preprocessor, and annotate tables. + +Input vehicle type data included in :ref:`example_mtc_extended` came from a variety of sources. The number of vehicle makes, models, MPG, and +electric vehicle range was sourced from the Enivornmental Protection Agency (EPA). Additional data on vehicle costs were derived from the +National Household Travel Survey. Auto operating costs in the vehicle type data file were a sum of fuel costs and maintenance costs. +Fuel costs were calculated from MPG assuming a $3.00 cost for a gallon of gas. When MPG was not available to calculate fuel costs, +the closest year, vehicle type, or body type available was used. Maintenance costs were taken from AAA's +`2017 driving cost study `_. +Size categories within body types were averaged, e.g. car was an average of AAA's small, medium, and large sedan categories. +Motorcycles were assigned the small sedan maintenance costs since they were not included in AAA's report. +Maintenance costs were not varied by vehicle year. (According to +`data from the U.S. Bureau of Labor Statistics `_, +there was no consistent relationship between vehicle age and maintenance costs.) + +Using the above methodology, the average auto operating costs of vehicles output from :ref:`example_mtc_extended` was 18.4 cents. +This value is very close to the auto operating cost of 18.3 cents used in :ref:`example_mtc`. +Non-household vehicles in example_mtc_extended use the auto operating cost of 18.3 cents used in example_mtc. +Users are encouraged to make their own assumptions and calculate auto operating costs as they see fit. + +The distribution of fuel type probabilities included in :ref:`example_mtc_extended` are computed directly from the National Household Travel Survey data +and include the entire US. Therefore, there is "lumpiness" in probabilities due to poor statistics in the data for some vehicle types. +The user is encouraged to adjust the probabilities to their modeling region and "smooth" them for more consistent results. + +Further discussion of output results and model sensitivities can be found `here `_. + +.. automodule:: activitysim.abm.models.vehicle_type_choice + :members: .. _telecommute_frequency: @@ -622,6 +689,32 @@ Core Table: ``tours`` | Result Field: ``start, end, duration`` | Skims Keys: ``T .. automodule:: activitysim.abm.models.non_mandatory_scheduling :members: +.. _vehicle_allocation: + +Vehicle Allocation +------------------- + +The vehicle allocation model selects which vehicle would be used for a tour of given occupancy. The alternatives for the vehicle +allocation model consist of the vehicles owned by the household and an additional non household vehicle option. (Zero-auto +households would be assigned the non-household vehicle option since there are no owned vehicles in the household). +A vehicle is selected for each occupancy level set by the user such that different tour modes that have different occupancies could see different operating +characteristics. The output of the vehicle allocation model is appended to the tour table with column names ``vehicle_occup_{occupancy}`` and the values are +the vehicle type selected. + +In :ref:`example_mtc_extended`, three occupancy levels are used: 1, 2, and 3.5. The auto operating cost +for occupancy level 1 is used in the drive alone mode and drive to transit modes. Occupancy levels 2 and 3.5 are used for shared +ride 2 and shared ride 3+ auto operating costs, respectively. Auto operating costs are selected in the mode choice pre-processors by selecting the allocated +vehicle type data from the vehicles table. If the allocated vehicle type was the non-household vehicle, the auto operating costs uses +the previous default value from :ref:`example_mtc`. All trips and atwork subtours use the auto operating cost of the parent tour. Functionality +was added in tour and atwork subtour mode choice to annotate the tour table and create a ``selected_vehicle`` which denotes the actual vehicle used. +If the tour mode does not include a vehicle, then the ``selected_vehicle`` entry is left blank. + +The current implementation does not account for possible use of the household vehicles by other household members. Thus, it is possible for a +selected vehicle to be used in two separate tours at the same time. + + +.. automodule:: activitysim.abm.models.vehicle_allocation + :members: .. _tour_mode_choice: